lfortran-lfortran-2f73434/0000775000175000017500000000000015141516316015633 5ustar alastairalastairlfortran-lfortran-2f73434/.mailmap0000664000175000017500000000777715141516316017276 0ustar alastairalastair# The "Name " on the left is the desired name and email Gagandeep Singh czgdp1807 Gagandeep Singh ਗਗਨਦੀਪ ਸਿੰਘ (Gagandeep Singh) Gagandeep Singh ਗਗਨਦੀਪ ਸਿੰਘ Dominic Poerio dvp Dominic Poerio Dominic Poerio Himanshu Pandey hp77 Himanshu Pandey hp77 Thirumalai Shaktivel Thirumalai-Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel Thirumalai Shaktivel <74826228+Thirumalai-Shaktivel@users.noreply.github.com> Andrew Best Andrew Mengjia Lyu mengjia.lyu Ondřej Čertík Ondrej Certik Ubaid Shaikh Shaikh Ubaid Ubaid Shaikh Ubaid Smit Lunagariya Smit-create Zihua Wu Gabriel Wu Zihua Wu Zihua Wu Pranav Goswami Pranav <85227306+Pranavchiku@users.noreply.github.com> Pranav Goswami Pranavchiku Pranav Goswami Co-authored-by: Pranav Goswami Giannis Nikiteas gnikit Oshanath Rajawasam oshanath Emilio Gonzalez Emilio 左志华 (Zuo Zhihua) zoziha 左志华 (Zuo Zhihua) 左志华 Akarshit Verma akarshitkverma meow464 meow464 <70211708+meow464@users.noreply.github.com> Luthfan Anshar Lubis Lubis Julian Hofer Hofer-Julian Julian Hofer Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Rohit Goswami Rohit Goswami Rohit Goswami Rohit Goswami <308505-HaoZeke@users.noreply.gitlab.com> Konrad Handrick Konrad Handrick Harshita Kalani HarshitaKalani Harshita Kalani Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com> Harris M. Snyder Harris Snyder Jacob Marks Jacob Marks Sebastian Ehlert Sebastian Ehlert <2684096-awvwgk@users.noreply.gitlab.com> Sebastian Ehlert Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Aarush Bhat sloorush Benson Muite Benson Muite Felix Wang topazus Felix Wang Felix <77263945+topazus@users.noreply.github.com> Sarthak Gupta gptsarthak John Shimanek <42622333+shimanek@users.noreply.github.com> shimanek <42622333+shimanek@users.noreply.github.com> Brian Beckman rebcabin Carl Burkert Carl Sergey Fedorov barracuda156 lfortran-lfortran-2f73434/GOVERNANCE.md0000664000175000017500000000104715141516316017606 0ustar alastairalastair# LFortran Governance ## Technical Decisions Technical decisions are made by the developer community by discussing at each Pull Request (PR) and arriving at a consensus. In case of disagreements, the project leader (Ondřej Čertík) will facilitate the discussion and help achieve a consensus. If a consensus cannot be achieved, the final decision will be made by the project leader. ## Financial Decisions Financial decisions are made by Ondřej Čertík and Milan Curcic with the goal to benefit and be good stewards of the LFortran community. lfortran-lfortran-2f73434/environment_linux.yml0000664000175000017500000000075715141516316022152 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11 # Enable for OpenMP: #- llvm-openmp=11 - toml=0.10.2 - pytest=8.3.4 - jupyter=1.1.1 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test - xonsh=0.16.0 - re2c=4.0.1 - numpy=2.2.0 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - zlib=1.3.1 - zstd-static=1.5.6 - cmake=3.29.1 - make=4.3 # install libunwind if building with llvmdev > 11 only on Linux # - libunwind=1.7.2 lfortran-lfortran-2f73434/CLAUDE.md0000777000175000017500000000000015141516316020410 2AGENTS.mdustar alastairalastairlfortran-lfortran-2f73434/build0.bat0000664000175000017500000000002715141516316017501 0ustar alastairalastairxonsh ./build0_win.xsh lfortran-lfortran-2f73434/build_release.sh0000775000175000017500000000107415141516316020773 0ustar alastairalastair#!/usr/bin/env bash set -e set -x cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DUSE_DYNAMIC_ZSTD=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_INSTALL_LIBDIR=share/lfortran/lib \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ -G Ninja \ . cmake --build . --target install lfortran-lfortran-2f73434/AGENTS.md0000664000175000017500000001742715141516316017151 0ustar alastairalastair# Repository Guidelines This file is for LLM agents and new contributors to have a single point of detailed reference how to contribute to the project. ## Project Structure & Module Organization - `src/`: core sources - `libasr/`: ASR + utilities, passes, verification - `lfortran/`: parser, semantics, drivers, backends - `runtime/`: Fortran runtime (built via CMake) - `server/`: language server - `tests/`, `integration_tests/`: unit/E2E suites - `doc/`: docs & manpages (site generated from here) - `examples/`, `grammar/`, `cmake/`, `ci/`, `share/`: supporting assets ## Prerequisites - Tools: CMake (>=3.10), Ninja, Git, Python (>=3.8), GCC/Clang. - Generators: re2c, bison (needed for build0/codegen). - Libraries: zlib; optional: LLVM dev, libunwind, RapidJSON, fmt, xeus/xeus-zmq, Pandoc. ## Build, Test, and Development Commands - Typical dev config (Ninja + LLVM) is specified in `./build1.sh`: - `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_STACKTRACE=yes` - `cmake --build build -j` - Release build: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_LLVM=ON` - Tests: `./run_tests.py` (compiler); `cd integration_tests && ./run_tests.py -j16` ## Quick Smoke Test - We usually build with LLVM enabled (`-DWITH_LLVM=ON`). - AST/ASR (no LLVM): `build/src/bin/lfortran --show-ast examples/expr2.f90` - Run program (LLVM): `build/src/bin/lfortran examples/expr2.f90 && ./a.out` ## Architecture & Scope - AST (syntax) ↔ ASR (semantic, valid-only). See `doc/src/design.md`. - Pipeline: parse → semantics → ASR passes → codegen (LLVM/C/C++/x86/WASM). - Prefer `src/libasr/pass` and existing utils; avoid duplicate helpers/APIs. ## Git Remotes & Issues - Upstream: `lfortran/lfortran` on GitHub (canonical repo and issues). - Fork workflow: `origin` is your fork; submit draft PRs to upstream and mark ready for review. - Setup: - `git remote add upstream git@github.com:lfortran/lfortran.git` - `git fetch upstream --tags` - `git checkout -b feature/xyz && git push -u origin feature/xyz` - PRs: always target `upstream/main`. Keep feature branches rebased on `upstream/main`: - `git fetch upstream && git rebase upstream/main && git push --force-with-lease` - Ensure the `upstream` remote exists (see setup) when working from a fork. ## Coding Style & Naming Conventions - C/C++: C++17; follow the existing formatting in the file to be consistent; use 4 spaces for indentation - Names: lower_snake_case files; concise CMake target names. - No commented-out code. ## Testing Guidelines - Full coverage required: every behavior change must come with tests that fail before your change and pass after. Do not merge without a full local pass of unit and integration suites. ### Integration Tests (`integration_tests/`) - Purpose: build-and-run end-to-end programs across backends/configurations via CMake/CTest. - Add a `.f90` program under `integration_tests/` and register it in `integration_tests/CMakeLists.txt` using the `RUN(...)` macro (labels like `gfortran`, `llvm`, `cpp`, etc.). - See `integration_tests/CMakeLists.txt` (search for `macro(RUN` and existing `RUN(NAME ...)` entries). - Avoid custom generation; place real sources in the tree and check them in. - Prefer integration tests; all new tests should be integration tests. - Ensure integration tests pass locally: `cd integration_tests && ./run_tests.py -j16`. - Add checks for correct results inside the `.f90` file using `if (i /= 4) error stop`-style idioms. - Always label new tests with at least `gfortran` (to ensure the code compiles with GFortran and does not rely on any LFortran-specific behavior) and `llvm` (to test with LFortran's default LLVM backend). - When fixing a bug, add an integration test that reproduces the failure and now compiles/runs successfully. - CI‑parity (recommended): run with the same env and scripts CI uses - Use micromamba with `ci/environment.yml` to match toolchain (LLVM, etc.). - Set env like CI and call the same helper scripts: - `export LFORTRAN_CMAKE_GENERATOR=Ninja` - `export ENABLE_RUNTIME_STACKTRACE=yes` (Linux/macOS) - Build: `bash ci/build.sh` - Quick integration run (LLVM): - `bash ci/test.sh` (runs a CMake+CTest LLVM pass and runner passes) - or: `cd integration_tests && ./run_tests.py -b llvm && ./run_tests.py -b llvm -f -nf16` - GFortran pass: `cd integration_tests && ./run_tests.py -b gfortran` - Other backends as in CI: - `./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma && ./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma -f` - `./run_tests.py -b cpp c c_nopragma` and `-f` - `./run_tests.py -b wasm` and `-f` - `./run_tests.py -b llvm_omp` / `target_offload` / `fortran -j1` - Minimal local (without micromamba): - Build: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_RUNTIME_STACKTRACE=yes` - Run: `cd integration_tests && ./run_tests.py -b llvm && ./run_tests.py -b llvm -f -nf16` - If builds fail with messages about missing debug info: - Install LLVM tools so `llvm-dwarfdump` is available (e.g., `sudo pacman -S llvm`, `apt install llvm`, or `conda install -c conda-forge llvm-tools`). - Rebuild with runtime stacktraces if needed: `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=ON -DWITH_RUNTIME_STACKTRACE=yes -DWITH_UNWIND=ON` - More details: `integration_tests/run_tests.py` (CLI flags and supported backends). ### Unit/Reference Tests (`tests/`) - Use only when an integration test is not yet feasible (e.g., feature doesn’t compile end‑to‑end). Prefer integration tests for all new work. - If possible, still add a test under `integration_tests/`, but only register `gfortran` (not `llvm`), then register this test in `tests/tests.toml` with the needed outputs (`ast`, `asr`, `llvm`, `run`, etc.). Use `.f90` or `.f` (fixed-form auto-handled). Only if that cannot be done, add a new test into `tests/`. - See `tests/tests.toml` for examples; reference outputs live under `tests/reference/`. - Multi-file modules: set `extrafiles = "mod1.f90,mod2.f90"`. - Run locally: `./run_tests.py -j16` (use `-s` to debug). - Update references only when outputs intentionally change: `./run_tests.py -t path/to/test -u -s`. - Error messages: add to `tests/errors/continue_compilation_1.f90` and update references. - If your integration test does not compile yet, temporarily validate the change by adding a reference test that checks AST/ASR construction (enable `asr = true` and/or `ast = true` in `tests/tests.toml`). Promote it to an integration test once end‑to‑end compilation succeeds. ### Local Troubleshooting - Modfile version mismatch: if you see "Incompatible format: LFortran Modfile...", clean and recompile (`ninja clean && ninja`) Ensure the current `build/src/bin` is first on `PATH` when running tests. ### Common Commands - Run all tests: `ctest` and `./run_tests.py -j16` - Run a specific test: `./run_tests.py -t pattern -s` References - Developer docs: `doc/src/installation.md` (Tests) and `doc/src/progress.md` (workflow). - Online docs: https://docs.lfortran.org/en/installation/ (Tests: run, update, integration). - CI examples: `.github/workflows/Quick-Checks-CI.yml` and `ci/test.sh`. ## Commit & Pull Request Guidelines - Commits: small, single-topic, imperative (e.g., "fix: handle BOZ constants"). - PRs target `upstream/main`; reference issues (`fixes #123`), explain rationale. - Include test evidence (commands + summary); ensure CI passes. - Do not commit generated artifacts, large binaries, or local configs. - Use Draft PRs while iterating; click “Ready for review” only when satisfied. - Use plain Markdown in PR descriptions (no escaped `\n`). Keep it clean, minimal, and follow simple headings (Summary, Scope, Verification, Rationale). - Before marking ready: ensure all local tests pass (unit + integration) and include evidence. lfortran-lfortran-2f73434/grammar/0000775000175000017500000000000015141516316017261 5ustar alastairalastairlfortran-lfortran-2f73434/grammar/AST.asdl0000664000175000017500000004501415141516316020561 0ustar alastairalastair-- This is an Abstract Syntax Description Lanuguage (ASDL) that describes the -- Fortran's Abstract Syntax Tree (AST). See [1] for a short background -- information and motivation and see the paper [2] for a detailed motivation, -- explanation and specification of the language. See [3] for further examples -- of ASDL usage in a real compiler. -- -- [1] https://eli.thegreenplace.net/2014/06/04/using-asdl-to-describe-asts-in-compilers/ -- [2] Wang, D. C., Appel, A. W., Korn, J. L., & Serra, C. S. (1997). The Zephyr Abstract Syntax Description Language. USENIX Conference on Domain-Specific Languages, (October), 213–228. -- [3] https://arxiv.org/abs/cs/9810013 -- -- ASDL's builtin types are: -- * identifier -- * int (signed integers of infinite precision) -- * string -- We extend these by: -- * node (any ASDL node) -- * bool -- -- Specific tools may choose to produce language interfaces that represent -- these types and the ASDL tree in a language specific way (e.g. use finite -- precision integers and signal an error otherwise). -- -- At the AST level we strictly only represent local syntax (no semantics). That -- way each syntax construct is parsed locally, no need to do any non-local -- lookups to figure out what AST node to construct. That is the job of the AST -- to ASR conversion to do non-local lookups to figure out what is what (i.e., -- disambiguate) and report any errors. module AST { unit = TranslationUnit(node* items) mod = Module(identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) | Submodule(identifier id, identifier? parent_name, identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) | BlockData(identifier? name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body) | Program(identifier name, trivia? trivia, unit_decl1* use, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, location start_name, location end_name) program_unit = Subroutine(identifier name, arg* args, decl_attribute* attributes, bind? bind, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, identifier* temp_args, location start_name, location end_name) | Procedure(identifier name, arg* args, decl_attribute* attributes, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains) | Function(identifier name, arg* args, decl_attribute* attributes, expr? return_var, bind? bind, trivia? trivia, unit_decl1* use, import_statement* import, implicit_statement* implicit, unit_decl2* decl, stmt* body, program_unit* contains, identifier* temp_args, location start_name, location end_name) unit_decl1 = Use(decl_attribute* nature, identifier module, use_symbol* symbols, bool only_present, trivia? trivia) unit_decl2 = Declaration(decl_attribute? vartype, decl_attribute* attributes, var_sym* syms, trivia? trivia) | DeclarationPragma(pragma_type type, string text, trivia? trivia) | Interface(interface_header header, trivia? trivia, interface_item* items) | DerivedType(identifier name, identifier* namelist, trivia? trivia, decl_attribute* attrtype, unit_decl2* items, procedure_decl* contains) | Template(identifier name, identifier* namelist, unit_decl2* decl, program_unit* contains) | Enum(decl_attribute* attr, trivia? trivia, unit_decl2* items) | Instantiate(identifier name, decl_attribute* args, use_symbol* symbols) | Requirement(identifier name, identifier* namelist, unit_decl2* decl, program_unit* funcs) | Require(unit_require* reqs) | Union(identifier name, trivia? trivia, decl_attribute* attrtype, unit_decl2* items) interface_header = InterfaceHeader() | InterfaceHeaderName(identifier name) | InterfaceHeaderAssignment() | InterfaceHeaderOperator(intrinsicop op) | InterfaceHeaderDefinedOperator(string operator_name) | AbstractInterfaceHeader() | InterfaceHeaderWrite(identifier id) | InterfaceHeaderRead(identifier id) interface_item = InterfaceProc(program_unit proc) | InterfaceModuleProcedure(identifier* names, decl_attribute* attributes, trivia? trivia) import_statement = Import(identifier* symbols, import_modifier mod, trivia? trivia) import_modifier = ImportDefault | ImportOnly | ImportNone | ImportAll implicit_statement = ImplicitNone(implicit_none_spec* specs, trivia? trivia) | Implicit(implicit_spec* specs, trivia? trivia) implicit_spec = ImplicitSpec(decl_attribute type, letter_spec* specs) implicit_none_spec = ImplicitNoneExternal(int dummy) | ImplicitNoneType() letter_spec = LetterSpec(identifier? start, identifier end) stmt -- Single-line statements (each has a `label`): = Allocate(int label, fnarg* args, keyword* keywords, trivia? trivia) | Assign(int label, int assign_label, identifier variable, trivia? trivia) | Assignment(int label, expr target, expr value, trivia? trivia) | Associate(int label, expr target, expr value, trivia? trivia) | Backspace(int label, expr* args, keyword* kwargs, trivia? trivia) | Close(int label, expr* args, keyword* kwargs, trivia? trivia) | Continue(int label, trivia? trivia) | Cycle(int label, identifier? stmt_name, trivia? trivia) | Deallocate(int label, fnarg* args, keyword* keywords, trivia? trivia) | Endfile(int label, expr* args, keyword* kwargs, trivia? trivia) | Entry(int label, identifier name, arg* args, expr? return_var, bind? bind, trivia? trivia) | ErrorStop(int label, expr? code, expr? quiet, trivia? trivia) | EventPost(int label, expr variable, event_attribute* stat, trivia? trivia) | EventWait(int label, expr variable, event_attribute* spec, trivia? trivia) | Exit(int label, identifier? stmt_name, trivia? trivia) | Flush(int label, expr* args, keyword* kwargs, trivia? trivia) | ForAllSingle(int label, identifier? stmt_name, concurrent_control *control, expr? mask, stmt assign, trivia? trivia) | Format(int label, string fmt, trivia? trivia) | DataStmt(int label, data_stmt_set* items, trivia? trivia) | FormTeam(int label, expr team_number, identifier team_var, event_attribute* sync_stat, trivia? trivia) | GoTo(int label, identifier? int_var, expr? goto_label, expr* labels, trivia? trivia) | Include(int label, string filename, trivia? trivia) | Inquire(int label, expr* args, keyword* kwargs, expr* values, trivia? trivia) | Nullify(int label, expr* args, keyword* kwargs, trivia? trivia) | Open(int label, expr* args, keyword* kwargs, trivia? trivia) | Return(int label, expr? value, trivia? trivia) | Pragma(int label, pragma_type type, bool end, string construct_name, expr* clauses, trivia? trivia) | Print(int label, expr? fmt, expr* values, trivia? trivia) | Read(int label, expr? format, argstar* args, kw_argstar* kwargs, expr* values, trivia? trivia) | Rewind(int label, expr* args, keyword* kwargs, trivia? trivia) | Stop(int label, expr? code, expr? quiet, trivia? trivia) | SubroutineCall(int label, identifier name, struct_member* member, fnarg* args, keyword* keywords, decl_attribute* temp_args, trivia? trivia) | SyncAll(int label, event_attribute* stat, trivia? trivia) | SyncImages(int label, expr? image_set, symbol sym, event_attribute* stat, trivia? trivia) | SyncMemory(int label, event_attribute* stat, trivia? trivia) | SyncTeam(int label, expr value, event_attribute* stat, trivia? trivia) | Write(int label, argstar* args, kw_argstar* kwargs, expr* values, trivia? trivia) -- Multi-line statements (each has a `label` and `stmt_name`): | AssociateBlock(int label, identifier? stmt_name, var_sym* syms, stmt* body, trivia? t_inside, trivia? trivia) | Block(int label, identifier? stmt_name, unit_decl1* use, import_statement* import,unit_decl2* decl, stmt* body, trivia? t_inside, trivia? trivia) | ChangeTeam(int label, identifier? stmt_name, expr team_value, team_attribute* coarray_assoc, event_attribute* sync, stmt* body, trivia? t_inside, trivia? trivia, event_attribute* sync_stat) | Critical(int label, identifier? stmt_name, event_attribute* sync_stat, stmt* body, trivia? t_inside, trivia? trivia) | DoConcurrentLoop(int label, identifier? stmt_name, concurrent_control *control, expr? mask, concurrent_locality* locality, stmt* body, trivia? t_inside, trivia? trivia) | DoLoop(int label, identifier? stmt_name, int do_label, identifier? var, expr? start, expr? end, expr? increment, stmt* body, trivia? t_inside, trivia? trivia) | ForAll(int label, identifier? stmt_name, concurrent_control *control, expr? mask, concurrent_locality* locality, stmt* body, trivia? t_inside, trivia? trivia) | If(int label, identifier? stmt_name, expr test, stmt* body, stmt* orelse, trivia? if_trivia, trivia? else_trivia, trivia? trivia) | IfArithmetic(int label, identifier? stmt_name, expr test, int lt_label, int eq_label, int gt_label, trivia? trivia) | Select(int label, identifier? stmt_name, expr test, case_stmt* body, trivia? t_inside, trivia? trivia) | SelectRank(int label, identifier? stmt_name, identifier? assoc_name, expr selector, rank_stmt* body, trivia? t_inside, trivia? trivia) | SelectType(int label, identifier? stmt_name, identifier? assoc_name, expr selector, type_stmt* body, trivia? t_inside, trivia? trivia) | Where(int label, identifier? stmt_name, expr test, stmt* body, stmt* orelse, trivia? t_inside, trivia? trivia) | WhileLoop(int label, identifier? stmt_name, expr test, stmt* body, trivia? t_inside, trivia? trivia) expr = BoolOp(expr left, boolop op, expr right) | BinOp(expr left, operator op, expr right) | DefBinOp(expr left, string op, expr right) | StrOp(expr left, stroperator op, expr right) | UnaryOp(unaryop op, expr operand) | DefUnaryOp(string op, expr operand) | Compare(expr left, cmpop op, expr right) | FuncCallOrArray(identifier func, struct_member* member, fnarg* args, keyword* keywords, fnarg* subargs, decl_attribute* temp_args) | CoarrayRef(identifier name, struct_member* member, fnarg* args, keyword* fnkw, coarrayarg* coargs, keyword* cokw) | ArrayInitializer(decl_attribute? vartype, identifier? classtype, expr* args) | ImpliedDoLoop(expr* values, identifier var, expr start, expr end, expr? increment) | Num(int n, string? kind) | Real(string n) | Complex(expr re, expr im) | String(string s, string? kind) | Substring(string s, fnarg* args) | BOZ(string s) | Name(identifier id, struct_member* member) | Logical(bool value) | DataImpliedDo(expr* object_list, decl_attribute? type, identifier var, expr start, expr end, expr? increment) | Parenthesis(expr operand) -- All statement nodes have an optional trivia?, here is the meaning: -- nullptr ... Equivalent to \n (the statement ends with \n) -- Meaning of trivia_node (in both `inside` and `after`): -- Comment ...... Comment followed by \n (previous line must be ended) -- EOLComment ... Ends the current line with a comment followed by \n -- EndOfLine .... Ends the current line with \n -- Semicolon .... ";" (just one character, does not end the line) -- The trivia starts with an open line, must be first ended by either -- EOLComment or EndOfLine. trivia = TriviaNode(trivia_node* inside, trivia_node* after) trivia_node = Comment(string comment) | EOLComment(string comment) | EndOfLine() | Semicolon() boolop = And | Or | Xor | Eqv | NEqv operator = Add | Sub | Mul | Div | Pow stroperator = Concat unaryop = Invert | Not | UAdd | USub cmpop = Eq | NotEq | Lt | LtE | Gt | GtE intrinsicop = AND | OR | XOR | EQV | NEQV | PLUS | MINUS | STAR | DIV | POW | NOT | EQ | NOTEQ | LT | LTE | GT | GTE | CONCAT procedure_decl = DerivedTypeProc(identifier? name, decl_attribute* attr, use_symbol* symbols, trivia? trivia) | GenericOperator(decl_attribute* attr, intrinsicop op, identifier* names, trivia? trivia) | GenericDefinedOperator(decl_attribute* attr, string optype, identifier* names, trivia? trivia) | GenericAssignment(decl_attribute* attr, identifier* names, trivia? trivia) | GenericName(decl_attribute* attr, identifier name, identifier* names, trivia? trivia) | GenericWrite(decl_attribute* attr, identifier id, identifier* names, trivia? trivia) | GenericRead(decl_attribute* attr, identifier id, identifier* names, trivia? trivia) | FinalName(identifier name, trivia? trivia) | Private(trivia? trivia) decl_attribute = AttrBind(bind bind) | AttrDimension(dimension* dim) | AttrCodimension(codimension* codim) | AttrCommon(common_block* blks) | AttrEquivalence(equi* args) | AttrExtends(identifier name) | AttrIntent(attr_intent intent) | AttrNamelist(identifier name) | AttrPass(identifier? name) | SimpleAttribute(simple_attribute attr) | AttrType(decl_type type, kind_item* kind, decl_attribute? attr, identifier? name, symbol sym) | AttrTypeList(decl_type type, decl_attribute* attr) | AttrAssignment() | AttrIntrinsicOperator(intrinsicop op) | AttrDefinedOperator(string op_name) simple_attribute = AttrAbstract | AttrAllocatable | AttrAsynchronous | AttrContiguous | AttrDeferred | AttrElemental | AttrEnumerator | AttrExternal | AttrImpure | AttrIntrinsic | AttrKind | AttrLen | AttrModule | AttrNoPass | AttrNonDeferred | AttrNon_Intrinsic | AttrOptional | AttrParameter | AttrPointer | AttrPrivate | AttrProtected | AttrPublic | AttrPure | AttrRecursive | AttrNonRecursive | AttrSave | AttrSequence | AttrTarget | AttrValue | AttrVolatile attr_intent = In | Out | InOut decl_type = TypeClass | TypeCharacter | TypeComplex | TypeDoublePrecision | TypeDoubleComplex | TypeInteger | TypeLogical | TypeProcedure | TypeReal | TypeType | TypeList | TypeSet | TypeDict | TypeTuple event_attribute = AttrStat(identifier variable) | AttrErrmsg(identifier variable) | AttrNewIndex(expr value) | AttrEventWaitKwArg(identifier id, expr value) team_attribute = CoarrayAssociation(expr coarray, expr selector) var_sym = (identifier? name, dimension* dim, codimension* codim, expr? length, expr? initializer, symbol sym, decl_attribute? spec) common_block = (identifier? name, var_sym* objects) kind_item = (identifier? id, expr? value, kind_item_type type) kind_item_type = Star | Colon | Value dimension = (expr? start, expr? end, dimension_type end_star) dimension_type = DimensionExpr | DimensionStar | AssumedRank codimension = (expr? start, expr? end, codimension_type end_star) codimension_type = CodimensionExpr | CodimensionStar symbol = None | Arrow | Equal | Asterisk | DoubleAsterisk | Slash equi = (expr* set_list) -- Encoding of an array dimension declaration: -- start end end_star -- Declaration: -- X(n) 1 n Expr # Note: X(n) is equivalent to X(1:n) -- X(:) () () Expr -- X(a:) a () Expr -- X(:b) () b Expr -- X(a:b) a b Expr -- X(*) () () Star -- X(a:*) a () Star -- Null for `expr` means it's a star kw_argstar = (identifier arg, expr? value) argstar = (expr? value) -- The identifier is wrapped up in a product type so that location information -- is included: -- Null for `arg` means, it's a star arg = (identifier? arg) -- Encoding of array elements and sections in fnarg: -- start end step label -- element: -- X(i) () i () 0 -- X(*10) () () () 10 -- section: -- X(:) () () 1 0 -- X(a:) a () 1 0 -- X(:b) () b 1 0 -- X(a:b) a b 1 0 -- X(::c) () () c 0 -- X(a::c) a () c 0 -- X(:b:c) () b c 0 -- X(a:b:c) a b c 0 -- fnarg = (expr? start, expr? end, expr? step, int label) coarrayarg = (expr? start, expr? end, expr? step, codimension_type star) keyword = (identifier arg, expr value) struct_member = (identifier name, fnarg* args) bind = Bind(expr* args, keyword* kwargs) array_index = ArrayIndex(expr? left, expr? right, expr? step) case_stmt = CaseStmt(case_cond* test, trivia? trivia, stmt* body) | CaseStmt_Default(trivia? trivia, stmt* body) case_cond = CaseCondExpr(expr cond) | CaseCondRange(expr? start, expr? end) rank_stmt = RankExpr(expr value, trivia? trivia, stmt* body) | RankStar(trivia? trivia, stmt* body) | RankDefault(trivia? trivia, stmt* body) type_stmt = TypeStmtName(identifier? name, trivia? trivia, stmt* body) | TypeStmtType(decl_attribute? vartype, trivia? trivia, stmt* body) | ClassStmt(identifier? id, trivia? trivia, stmt* body) | ClassDefault(trivia? trivia, stmt* body) use_symbol = UseSymbol(identifier remote_sym, identifier? local_rename) | UseAssignment() | IntrinsicOperator(intrinsicop op) | DefinedOperator(string opName) | RenameOperator(string local_defop, string use_defop) | UseWrite(identifier id) | UseRead(identifier id) concurrent_control = ConcurrentControl(identifier? var, expr? start, expr? end, expr? increment) concurrent_locality = ConcurrentLocal(identifier *vars) | ConcurrentLocalInit(identifier *vars) | ConcurrentShared(identifier *vars) | ConcurrentDefault() | ConcurrentReduce(reduce_op op, identifier *vars) reduce_op = ReduceAdd | ReduceSub | ReduceMul | ReduceMIN | ReduceMAX data_stmt_set = DataStmtSet(expr* object, expr* value) pragma_type = LFortranPragma | OMPPragma unit_require = UnitRequire(identifier name, decl_attribute* namelist) } lfortran-lfortran-2f73434/build0.sh0000775000175000017500000000212115141516316017345 0ustar alastairalastair#!/usr/bin/env bash set -e set -x RE2C=${RE2C:-re2c} BISON=${BISON:-bison} # Generate the `version` file ci/version.sh # Generate a Fortran AST from AST.asdl (C++) python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h # Generate a Fortran ASR from ASR.asdl (C++) python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h # Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++) python src/libasr/wasm_instructions_visitor.py # Generate the intrinsic_function_registry_util.h (C++) python src/libasr/intrinsic_func_registry_util_gen.py # Generate the tokenizer and parser (cd src/lfortran && ${RE2C} -W -b parser/tokenizer.re -o parser/tokenizer.cpp) (cd src/lfortran && ${RE2C} -W -b parser/preprocessor.re -o parser/preprocessor.cpp) (cd src/lfortran/parser && ${BISON} -Wall -d -r all parser.yy) # Generate the LSP sources python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server grep -n "'" src/lfortran/parser/parser.yy && echo "Single quote not allowed" && exit 1 echo "OK" lfortran-lfortran-2f73434/run_tests.py0000775000175000017500000006145415141516316020250 0ustar alastairalastair#!/usr/bin/env python import os import subprocess as sp import sys from typing import Dict ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__))) sys.path.append(os.path.join(ROOT_DIR, "src", "libasr")) from compiler_tester.tester import color, fg, log, run_test, style, tester_main def run_cmd(cmd, cwd=None): print(f"+ {cmd}") process = sp.run(cmd, shell=True, cwd=cwd) if process.returncode != 0: print("Command failed.") exit(1) def single_test(test: Dict, verbose: bool, no_llvm: bool, skip_run_with_dbg: bool, update_reference: bool, verify_hash: bool, no_color: bool, specific_backends=None, excluded_backends=None) -> None: def is_included(backend): return test.get(backend, False) \ and (specific_backends is None or backend in specific_backends) \ and (excluded_backends is None or backend not in excluded_backends) filename = test["filename"] show_verbose = "" if not verbose else "-v" tokens = is_included("tokens") ast = is_included("ast") ast_indent = is_included("ast_indent") ast_disable_style_suggestion = is_included("ast_disable_style_suggestion") ast_json = is_included("ast_json") ast_no_prescan = is_included("ast_no_prescan") ast_f90 = is_included("ast_f90") ast_cpp = is_included("ast_cpp") ast_cpp_hip = is_included("ast_cpp_hip") ast_openmp = is_included("ast_openmp") lookup_name = is_included("lookup_name") rename_symbol = is_included("rename_symbol") line = "-1" if is_included("line"): line = str(test["line"]) column = "-1" if is_included("column"): column = str(test["column"]) asr = is_included("asr") asr_ignore_pragma = is_included("asr_ignore_pragma") asr_implicit_typing = is_included("asr_implicit_typing") asr_disable_implicit_typing = is_included("asr_disable_implicit_typing") enable_and_disable_implicit_typing = is_included("enable_and_disable_implicit_typing") asr_implicit_interface = is_included("asr_implicit_interface") asr_implicit_interface_and_typing = is_included("asr_implicit_interface_and_typing") asr_implicit_argument_casting = is_included("asr_implicit_argument_casting") enable_disable_implicit_argument_casting = is_included("enable_disable_implicit_argument_casting") asr_implicit_interface_and_typing_with_llvm = is_included("asr_implicit_interface_and_typing_with_llvm") asr_disable_warnings = is_included("asr_disable_warnings") asr_disable_style_suggestion_and_warnings = is_included("asr_disable_style_suggestion_and_warnings") asr_enable_style_suggestion = is_included("asr_enable_style_suggestion") enable_disable_style_suggestion = is_included("enable_disable_style_suggestion") continue_compilation = is_included("continue_compilation") fixed_form_cc_asr = is_included("fixed_form_cc_asr") semantics_only_cc = is_included("semantics_only_cc") show_errors = is_included("show_errors") document_symbols = is_included("document_symbols") syntax_only_cc = is_included("syntax_only_cc") show_asr_with_cc = is_included("show_asr_with_cc") asr_use_loop_variable_after_loop = is_included("asr_use_loop_variable_after_loop") asr_preprocess = is_included("asr_preprocess") asr_indent = is_included("asr_indent") asr_json = is_included("asr_json") asr_clojure = is_included("asr_clojure") asr_openmp = is_included("asr_openmp") c_target_omp = is_included("c_target_omp") c_target_cuda = is_included("c_target_cuda") asr_logical_casting = is_included("asr_logical_casting") mod_to_asr = is_included("mod_to_asr") llvm = is_included("llvm") cpp = is_included("cpp") cpp_infer = is_included("cpp_infer") c = is_included("c") is_cumulative_pass = is_included("cumulative") julia = is_included("julia") wat = is_included("wat") obj = is_included("obj") x86 = is_included("x86") fortran = is_included("fortran") bin_ = is_included("bin") fast = is_included("fast") print_leading_space = is_included("print_leading_space") interactive = is_included("interactive") options = test.get("options", "") pass_ = test.get("pass", None) extrafiles = test.get("extrafiles", "").split(",") run = test.get("run") run_with_dbg = test.get("run_with_dbg") optimization_passes = ["flip_sign", "div_to_mul", "fma", "sign_from_value", "inline_function_calls", "loop_unroll", "dead_code_removal"] if pass_ is not None: pass_list = pass_.split(",") for _pass in pass_list: _pass = _pass.rstrip(" ").lstrip(" ") if (_pass not in ["do_loops", "global_stmts", "transform_optional_argument_functions", "array_op", "select_case", "class_constructor", "implied_do_loops", "pass_array_by_data", "init_expr", "where", "nested_vars", "insert_deallocate", "openmp", "array_struct_temporary"] and _pass not in optimization_passes): raise Exception(f"Unknown pass: {_pass}") if update_reference: log.debug(f"{color(style.bold)} UPDATE TEST: {color(style.reset)} {filename}") elif verify_hash: log.debug(f"{color(style.bold)} VERIFY HASH: {color(style.reset)} {filename}") else: log.debug(f"{color(style.bold)} START TEST: {color(style.reset)} {filename}") extra_args = f"--no-error-banner {show_verbose}" if print_leading_space: extra_args += " --print-leading-space" if interactive: extra_args += " --interactive-parse" if cpp_infer: extra_args += " --cpp-infer" if line: extra_args += " --line=" + line if column: extra_args += " --column=" + column if options: extra_args += " " + options if tokens: run_test( filename, "tokens", "lfortran --no-color --show-tokens {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast: if filename.endswith(".f"): # Use fixed form run_test( filename, "ast", "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "ast", "lfortran --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_indent: run_test( filename, "ast_indent", "lfortran --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_openmp: run_test( filename, "ast_openmp", "lfortran --show-ast --no-color --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if enable_and_disable_implicit_typing: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --implicit-typing --disable-implicit-typing --no-color {infile}", filename, update_reference, verify_hash, extra_args) if enable_disable_implicit_argument_casting: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --implicit-argument-casting --disable-implicit-argument-casting --no-color {infile}", filename, update_reference, verify_hash, extra_args) if ast_json: run_test( filename, "ast_json", "lfortran --show-ast --no-indent --json {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_disable_style_suggestion: run_test( filename, "ast_disable_style_suggestion", "lfortran --show-ast --no-style-suggestions --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_no_prescan: # Use free form with prescan disabled run_test( filename, "ast_no_prescan", "lfortran --no-prescan --show-ast --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if ast_f90: if filename.endswith(".f"): # Use fixed form run_test( filename, "ast_f90", "lfortran --fixed-form --show-ast-f90 --no-indent --no-color {infile}", filename, update_reference, verify_hash, extra_args) else: # Use free form run_test( filename, "ast_f90", "lfortran --show-ast-f90 --no-indent --no-color {infile}", filename, update_reference, verify_hash, extra_args) if lookup_name: run_test( filename, "lookup_name", "lfortran --lookup-name --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if rename_symbol: run_test( filename, "rename_symbol", "lfortran --rename-symbol --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_warnings: run_test( filename, "asr_disable_warnings", "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_style_suggestion_and_warnings: run_test( filename, "asr_disable_style_suggestion_and_warnings", "lfortran --show-asr --no-style-suggestions --no-warnings --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_enable_style_suggestion: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "asr_enable_style_suggestion", "lfortran --std=f23 --style-suggestions --no-color {infile}", filename, update_reference, verify_hash, extra_args) if enable_disable_style_suggestion: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "enable_disable_style_suggestion", "lfortran --style-suggestions --no-style-suggestions --no-color {infile}", filename, update_reference, verify_hash, extra_args) if asr: # run fixed form if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: skip_test = False for extrafile in extrafiles: extrafile_ = extrafile.rstrip().lstrip() if no_llvm and len(extrafile_) > 0: log.info(f"{filename} * asr SKIPPED because LLVM is not enabled") skip_test = True break if len(extrafile_) > 0: extrafile_ = os.path.join("tests", extrafile_) modfile = extrafile_[:-4] + ".mod" if not os.path.exists(modfile): run_cmd("lfortran -c {}".format(extrafile_)) if not skip_test: run_test( filename, "asr", "lfortran --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if pass_ is not None: if fast: cmd = "lfortran --pass=" + pass_ + \ " --show-asr --no-color --fast {infile} -o {outfile}" else: cmd = "lfortran --pass=" + pass_ + \ " --show-asr --no-color {infile} -o {outfile}" pass_ = pass_.replace(",", "_") run_test(filename, "pass_{}".format(pass_), cmd, filename, update_reference, verify_hash, extra_args) pass_ = None if asr_implicit_interface_and_typing: # run fixed form if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "asr", "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_use_loop_variable_after_loop: run_test( filename, "asr", "lfortran --show-asr --use-loop-variable-after-loop --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_argument_casting: run_test( filename, "asr", "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_interface_and_typing_with_llvm: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") else: run_test( filename, "llvm", "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if semantics_only_cc: run_test(filename, "asr", "lfortran --semantics-only --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if document_symbols: skip_test = False for extrafile in extrafiles: extrafile_ = extrafile.rstrip().lstrip() if no_llvm and len(extrafile_) > 0: log.info(f"{filename} * asr SKIPPED because LLVM is not enabled") skip_test = True break if len(extrafile_) > 0: extrafile_ = os.path.join("tests", extrafile_) modfile = extrafile_[:-4] + ".mod" if not os.path.exists(modfile): run_cmd("lfortran -c {}".format(extrafile_)) if not skip_test: run_test(filename, "asr", "lfortran --show-document-symbols --no-color {infile}", filename, update_reference, verify_hash, extra_args) if show_errors: run_test(filename, "asr", "lfortran --show-errors --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if syntax_only_cc: run_test(filename, "ast", "lfortran --continue-compilation --show-ast --no-color {infile}", filename, update_reference, verify_hash, extra_args) if show_asr_with_cc: run_test(filename, "asr", "lfortran --continue-compilation --show-asr --no-color {infile}", filename, update_reference, verify_hash, extra_args) if continue_compilation: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --continue-compilation --no-color {infile}", filename, update_reference, verify_hash, extra_args) if fixed_form_cc_asr: run_test( filename, "asr", "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_typing: run_test( filename, "asr", "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_disable_implicit_typing: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") run_test( filename, "asr", "lfortran --std=f23 --show-asr --disable-implicit-typing --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_implicit_interface: if filename.endswith(".f"): run_test( filename, "asr", "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) else: run_test( filename, "asr", "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_preprocess: run_test( filename, "asr_preprocess", "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_indent: run_test( filename, "asr_indent", "lfortran --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_json: run_test( filename, "asr_json", "lfortran --show-asr --no-indent --json {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_clojure: run_test( filename, "asr_clojure", "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_openmp: run_test( filename, "asr_openmp", "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if c_target_omp: run_test( filename, "c_target_omp", "lfortran --show-c --openmp {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if c_target_cuda: run_test( filename, "c_target_cuda", "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if asr_logical_casting: run_test( filename, "asr_logical_casting", "lfortran --show-asr --logical-casting --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if mod_to_asr: run_test( filename, "mod_to_asr", "lfortran mod --show-asr --no-indent --no-color {infile}", filename, update_reference, verify_hash) if asr_ignore_pragma: run_test( filename, "asr_ignore_pragma", "lfortran --ignore-pragma --show-asr --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if pass_ is not None: cmd = "lfortran " if is_cumulative_pass: cmd += "--cumulative " cmd += "--pass=" + pass_ + \ " --show-asr --no-color {infile} -o {outfile}" pass_ = pass_.replace(",", "_") run_test(filename, "pass_{}".format(pass_), cmd, filename, update_reference, verify_hash, extra_args) if llvm: if no_llvm: log.info(f"{filename} * llvm SKIPPED as requested") else: run_test( filename, "llvm", "lfortran --no-color --show-llvm {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if cpp: run_test(filename, "cpp", "lfortran --no-color --show-cpp {infile}", filename, update_reference, verify_hash, extra_args) if obj: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test( filename, "obj", "lfortran --no-color -c {infile} -o output.o", filename, update_reference, verify_hash, extra_args) if c: run_test(filename, "c", "lfortran --no-color --show-c {infile}", filename, update_reference, verify_hash, extra_args) if julia: run_test(filename, "julia", "lfortran --no-color --show-julia {infile}", filename, update_reference, verify_hash, extra_args) if wat: run_test(filename, "wat", "lfortran --no-color --show-wat {infile}", filename, update_reference, verify_hash, extra_args) if x86: run_test( filename, "x86", "lfortran --no-color --backend=x86 {infile} -o output", filename, update_reference, verify_hash, extra_args) if fortran: run_test( filename, "fortran", "lfortran --show-fortran --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if bin_: run_test(filename, "bin", "lfortran --no-color {infile} -o {outfile}", filename, update_reference, verify_hash, extra_args) if run: if no_llvm: log.info(f"{filename} * obj SKIPPED as requested") else: run_test(filename, "run", "lfortran --no-color {infile}", filename, update_reference, verify_hash, extra_args) if run_with_dbg: if skip_run_with_dbg: log.info(f"{filename} * run_with_dbg SKIPPED as requested") else: run_test( filename, "run_dbg", "lfortran {infile} -g --no-color", filename, update_reference, verify_hash, extra_args) if __name__ == "__main__": tester_main("LFortran", single_test) lfortran-lfortran-2f73434/.github/0000775000175000017500000000000015141516316017173 5ustar alastairalastairlfortran-lfortran-2f73434/.github/dependabot.yml0000664000175000017500000000015615141516316022025 0ustar alastairalastairversion: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" lfortran-lfortran-2f73434/.github/FUNDING.yml0000664000175000017500000000021615141516316021007 0ustar alastairalastair# These are supported funding model platforms github: lfortran open_collective: lfortran custom: ['https://numfocus.org/donate-to-lfortran'] lfortran-lfortran-2f73434/.github/workflows/0000775000175000017500000000000015141516316021230 5ustar alastairalastairlfortran-lfortran-2f73434/.github/workflows/Clean-Cache-CI.yml0000664000175000017500000000161115141516316024266 0ustar alastairalastairname: Cleanup caches by a branch on: pull_request: types: - closed jobs: cleanup: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v6 - name: Cleanup run: | gh extension install actions/gh-actions-cache REPO=${{ github.repository }} BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" echo "Fetching list of cache key" cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm done echo "Done" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} lfortran-lfortran-2f73434/.github/workflows/Quick-Checks-CI.yml0000664000175000017500000003544115141516316024525 0ustar alastairalastairname: Quick checks on: push: branches: - main tags: - 'v*' pull_request: branches: - main # For a PR #7488 against main branch, the `group` will become: CI-{{ 7488 || github.sha }} # which eventually evaluates to: CI-7488 and 'sha' isn't used. # NOTE: `||` acts as a logical OR and a default operator both, # see: https://docs.github.com/en/actions/learn-github-actions/expressions#operators. # When it isn't a PR against main but instead a commit pushed (or merged) to main, then `group` will # evaluate to `${{ github.sha }}` but "cancel-in-progress" evaluates to false, so the CI on main # will run in a new group `${{ github.sha }}`, but no previous CI will be cancelled on main concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: MACOSX_DEPLOYMENT_TARGET: 15.0 jobs: Build: name: LFortran CI (OS=${{ matrix.os }}, LLVM=${{ matrix.llvm-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: macos-latest llvm-version: "11" - os: macos-latest llvm-version: "21" - os: ubuntu-latest llvm-version: "11" - os: ubuntu-latest llvm-version: "21" - os: windows-2025 llvm-version: "11" steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment.yml create-args: >- llvmdev=${{ matrix.llvm-version }} - name: Install Windows Packages if: contains(matrix.os, 'windows') shell: bash -e -l {0} run: | micromamba install m2-bison=3.0.4 m2-filesystem cmake=3.21.1 zstd-static=1.5.5 zlib=1.2.13 - name: Install Linux / macOS Packages if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') shell: bash -e -l {0} run: | micromamba install bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 zlib=1.3.1 llvmdev=${{ matrix.llvm-version }} if [[ "${{ matrix.os }}" == *ubuntu* ]]; then micromamba install openmpi=5.0.6=hb85ec53_102 elif [[ "${{ matrix.os }}" == *macos* ]]; then micromamba install openmpi=5.0.6=h31ce4ef_102 fi if [[ "${{ matrix.llvm-version }}" == "11" ]]; then micromamba install zstd-static=1.5.6 nodejs=18.20.4 kokkos=4.4.01 elif [[ "${{ matrix.llvm-version }}" == "21" ]]; then micromamba install zstd-static=1.5.7 fi if [[ "${{ matrix.os }}" == *ubuntu* && "${{ matrix.llvm-version }}" != "11" ]]; then micromamba install libunwind=1.7.2 fi if [[ "${{ matrix.os }}" == *ubuntu* && "${{ matrix.llvm-version }}" == "11" ]]; then micromamba install pandoc=3.1.13 fi - uses: hendrikmuhs/ccache-action@main with: key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.llvm-version }} - name: Setup Platform shell: bash -e -l {0} run: | echo "LFORTRAN_CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV echo "ENABLE_RUNTIME_STACKTRACE=yes" >> $GITHUB_ENV # we need to run this only once for debugging purpose - name: Print github concurrent group name shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') run: | echo "Concurrency Group: ${{ github.workflow }}-${{ github.event.number || github.sha }}" echo "Cancel-in-progress: ${{ github.event_name == 'pull_request' }}" - name: Build (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" export CFLAGS="-Werror -D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" export WIN=0 shell ci/build.sh - name: Build (Windows) if: contains(matrix.os, 'windows') shell: cmd run: | set MAMBA_INSTALL_LOCN=C:\\Users\runneradmin\micromamba call %MAMBA_INSTALL_LOCN%\Scripts\activate.bat call micromamba activate lf set LFORTRAN_CMAKE_GENERATOR=Ninja set WIN=1 set MACOS=0 set ENABLE_RUNTIME_STACKTRACE=no call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CC=cl.exe set CXX=cl.exe set "PATH=%PATH:C:\mingw64\bin;=%" shell ci\build.sh - name: Test (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | case "$OSTYPE" in darwin*) export MACOS=1;; *) export MACOS=0;; esac export LFORTRAN_LLVM_VERSION=${{ matrix.llvm-version }} export LFORTRAN_TEST_ENV_VAR='STATUS OK!' shell ci/test.sh - name: Test LFortran's Command Line Interface (Linux / macOS) shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | ./test_lfortran_cmdline - name: Test with specific Fortran standard shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | cd ./integration_tests ./run_tests.py -b llvm --std=f23 ./run_tests.py -b llvm -f --std=f23 -nf16 - name: Test (Windows) if: contains(matrix.os, 'windows') shell: cmd run: | set MAMBA_INSTALL_LOCN=C:\\Users\runneradmin\micromamba call %MAMBA_INSTALL_LOCN%\Scripts\activate.bat call micromamba activate lf set LFORTRAN_CMAKE_GENERATOR=Ninja set WIN=1 set MACOS=0 set ENABLE_RUNTIME_STACKTRACE=no call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CC=cl.exe set CXX=cl.exe set "PATH=%PATH:C:\mingw64\bin;=%" shell ci\test.sh - name: Install Timeout (macOS) shell: bash -e -l {0} if: contains(matrix.os, 'macos') run: brew install coreutils # ~/.bash_logout wanted to run `/usr/bin/clear_console -q` while exiting # login shells which frequently erred on ubuntu-latest since the shell was # not run interactively. - name: Disable ~/.bash_logout (Linux) shell: bash -e {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: mv -v ~/.bash_logout ~/.bash_logout.bak - name: LSP Test (Linux / macOS) shell: bash -e -l {0} if: (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) && contains(matrix.llvm-version, '11') timeout-minutes: 5 env: EXIT_SUCCESS: 0 EXIT_TIMEOUT: 124 EXIT_KILL: 137 MAX_ATTEMPTS: 3 SIGTERM_TIMEOUT: 60s SIGKILL_TIMEOUT: 10s PYTEST_TIMEOUT: 10 run: | set -ex pip install src/server/tests tests/server timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ pytest -vv \ --showlocals \ --timeout=$PYTEST_TIMEOUT \ --execution-strategy="concurrent" \ tests/server set +e for (( ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++ )); do echo "Attempt $ATTEMPT of $MAX_ATTEMPTS" timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ pytest -vv \ --showlocals \ --timeout=$PYTEST_TIMEOUT \ --execution-strategy="parallel" \ tests/server EXIT_CODE=$? if [ $EXIT_CODE -eq $EXIT_SUCCESS ]; then break fi echo "Command failed with exit code: $EXIT_CODE" 1>&2 done set -e exit $EXIT_CODE - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test integration_tests with GFortran shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b gfortran - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Debug Build Linux shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | ctest ./run_tests.py ./run_tests.py -vh cd integration_tests ./run_tests.py -m ./run_tests.py -b llvm ./run_tests.py -b llvm -f -nf16 ./run_tests.py -b llvm_single_invocation - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test OpenMP shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b llvm_omp - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Target Offload shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b target_offload - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test Fortran Backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b fortran -j1 ./run_tests.py -b fortran -f -j1 - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test C/C++ Backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | mkdir build-kokkos cd build-kokkos wget https://github.com/kokkos/kokkos/archive/3.1.01.tar.gz tar xaf 3.1.01.tar.gz cd kokkos-3.1.01 mkdir build cd build export LFORTRAN_KOKKOS_DIR=$HOME/ext/kokkos cmake -DCMAKE_INSTALL_PREFIX=$LFORTRAN_KOKKOS_DIR -DKokkos_ENABLE_OPENMP=On -DKokkos_ARCH_HSW=On .. make make install cd ../../.. cd integration_tests ./run_tests.py -b cpp c c_nopragma ./run_tests.py -b cpp c c_nopragma -f - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test CPP shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | shell ci/test_cpp_version.sh - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Show Node Info shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | set -ex which node node --version - name: Test GFortran, Debug Build, Fortran, OpenMP, C/C++ backend, Upload Tarball, CPP Build, WASM - Test WASM backend shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd integration_tests ./run_tests.py -b wasm ./run_tests.py -b wasm -f - name: Check Bison Grammar for Essential Conflicts if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') shell: bash -e -l {0} run: | ./ci/grammar_conflicts.sh # Run last. Script checks out to first commit in PR history - name: Check for Added Binary Files shell: bash -e -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '21') run: | python3 check_binary_file_in_git_history.py build_to_wasm_and_upload: name: Build LFortran to WASM and Upload runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name : Remove existing node shell: bash -e -l {0} run : | which node node -v sudo rm -rf /usr/local/bin/node /usr/local/bin/npm - name: Setup Emscripten SDK shell: bash -l {0} run: | set -ex mkdir -p $HOME/ext cd $HOME/ext curl -o emsdk.tar.gz -L https://github.com/emscripten-core/emsdk/archive/refs/tags/4.0.13.tar.gz tar -xvf emsdk.tar.gz mv emsdk-4.0.13 emsdk export EMSDK_PATH=$HOME/ext/emsdk echo $EMSDK_PATH cd $EMSDK_PATH ./emsdk install 3.1.35 ./emsdk activate 3.1.35 ./emsdk install node-18.20.3-64bit ./emsdk activate node-18.20.3-64bit - name: Show Emscripten and Node Info shell: bash -l {0} run: | set -ex # Activate PATH and other environment variables in the current terminal source $HOME/ext/emsdk/emsdk_env.sh emcc -v em++ -v which node node -v - name: Build to WASM shell: bash -l {0} run: | set -ex source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten ./build_to_wasm.sh - name: Test built lfortran.wasm shell: bash -l {0} run: | set -ex source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten which node node -v node src/lfortran/tests/test_lfortran.js - name: Upload to wasm_builds shell: bash -l {0} run: | ci/upload_lfortran_wasm.sh env: SSH_PRIVATE_KEY_WASM_BUILDS: ${{ secrets.SSH_PRIVATE_KEY_WASM_BUILDS }} lfortran-lfortran-2f73434/.github/workflows/Exhaustive-Checks-CI.yml0000664000175000017500000006526415141516316025604 0ustar alastairalastairname: Exhaustive checks on: push: branches: - main tags: - 'v*' pull_request: types: [labeled, unlabeled, synchronize] branches: - main # For a PR #7488 against main branch, the `group` will become: CI-{{ 7488 || github.sha }} # which eventually evaluates to: CI-7488 and 'sha' isn't used. # NOTE: `||` acts as a logical OR and a default operator both, # see: https://docs.github.com/en/actions/learn-github-actions/expressions#operators. # When it isn't a PR against main but instead a commit pushed (or merged) to main, then `group` will # evaluate to `${{ github.sha }}` but "cancel-in-progress" evaluates to false, so the CI on main # will run in a new group `${{ github.sha }}`, but no previous CI will be cancelled on main concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: MACOSX_DEPLOYMENT_TARGET: 15.0 jobs: debug_outOfSource: name: Check Out-of-Source Debug build runs-on: ubuntu-latest # Run on push to main, or when the PR has the label at the time of the event if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 path: src - uses: mamba-org/setup-micromamba@v1.8.0 with: micromamba-version: '1.5.10-0' environment-file: src/ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ( cd src && ./build0.sh ) export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" cmake -S src -B builddir -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_KOKKOS=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build builddir -j16 --target install - name: Test Linux shell: bash -e -l {0} run: ctest --output-on-failure working-directory: builddir - name: Test Moved Installation shell: bash -e -l {0} run: | mv inst inst.moved cp src/examples/expr2.f90 expr2.F90 rm -rf src inst.moved/bin/lfortran expr2.F90 -o expr2 ./expr2 inst.moved/bin/lfortran --backend=c expr2.F90 -o expr2b ./expr2b inst.moved/bin/lfortran --openmp --backend=cpp expr2.F90 -o expr2c ./expr2c release: name: Check Release build runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ./build0.sh export CXXFLAGS="-Werror" export CFLAGS="-Werror" cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DWITH_RUNTIME_STACKTRACE=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_INSTALL_BINDIR=bin/tastic \ -DCMAKE_INSTALL_LIBDIR=oh/my/sweet/lib \ -DCMAKE_INSTALL_INCLUDEDIR=incl/O/Matic \ -DCMAKE_INSTALL_MANDIR=man/O/man \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux shell: bash -e -l {0} run: | ctest ./run_tests.py ./run_tests.py -vh cd integration_tests ./run_tests.py -m ./run_tests.py -b llvm ./run_tests.py -b llvm -f -nf16 - name: Test Installation shell: bash -e -l {0} run: | test -x inst/bin/tastic/lfortran test -f inst/oh/my/sweet/lib/liblfortran_runtime_static.a test -f inst/oh/my/sweet/lib/liblfortran_runtime.so test -f inst/incl/O/Matic/lfortran/impure/lfortran_intrinsics.h test -f inst/man/O/man/man1/lfortran.1 # Commented out to save CI runners: # test-pixi: # name: Pixi Build (${{ matrix.os }}) # runs-on: ${{ matrix.os }} # strategy: # fail-fast: false # matrix: # os: ["ubuntu-latest"] # steps: # - uses: actions/checkout@v6 # with: # fetch-depth: 0 # - uses: prefix-dev/setup-pixi@v0.8.1 # with: # pixi-version: v0.37.0 # cache: true # - name: LLVM 10 # run: | # pixi run -e llvm10 build # pixi run start --version # pixi run ctest # pixi run integration_tests # pixi run clean # - name: LLVM 11 # run: | # pixi run -e llvm11 build # pixi run start --version # pixi run ctest # pixi run tests # Only run for LLVM 11 # pixi run integration_tests # pixi run clean # - name: LLVM 19 # run: | # pixi run -e llvm19 build # pixi run start --version # pixi run ctest # pixi run integration_tests # pixi run clean test_llvm: name: Test LLVM ${{ matrix.llvm-version }} runs-on: ${{ matrix.os }} # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} strategy: fail-fast: false matrix: # this is only run on ubuntu intentionally os: ["ubuntu-latest"] # Note: The LLVM 11 test is redundant, since it is already tested by # most other tests (since LLVM 11 is our default version), but we have # it here as well for consistency, and that way other tests can freely # switch to other versions as needed. We test all versions here in # exactly the same manner, to ensure that users can just change the # `llvmdev` version in their conda environment and everything will just # work. llvm-version: ["7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"] python-version: ["3.10"] steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '19') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 nodejs=18.20.4 openmpi=5.0.6=hb85ec53_102 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.6 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '10') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 nodejs=18.20.2 openmpi=5.0.6=hb85ec53_102 zlib=1.3.1 zstd-static=1.5.6 xonsh=0.16.0 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '18') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.6 openmpi=5.0.6=hb85ec53_102 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '20') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 xonsh=0.16.0 zlib=1.3.1 zstd-static=1.5.7 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '21') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- llvmdev=21.1.0 python=${{ matrix.python-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 - uses: mamba-org/setup-micromamba@v2.0.2 if: contains(matrix.llvm-version, '12') with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.3 - uses: mamba-org/setup-micromamba@v2.0.2 if: ${{! (contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '12') || contains(matrix.llvm-version, '18') || contains(matrix.llvm-version, '19') || contains(matrix.llvm-version, '20') || contains(matrix.llvm-version, '21'))}} with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=${{ matrix.python-version }} llvmdev=${{ matrix.llvm-version }} bison=3.4 openblas=0.3.21 llvm-openmp=14.0.4 make=4.3 openmpi=5.0.6=hb85ec53_102 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.llvm-version }} - name: Install libunwind if: matrix.llvm-version > 11 run: micromamba install -y -n lf libunwind=1.7.2 - name: Setup WASI SDK if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | mkdir -p $HOME/ext cd $HOME/ext curl -o wasi-sdk.tar.gz -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0-linux.tar.gz tar -xvf wasi-sdk.tar.gz mv wasi-sdk-21.0 wasi-sdk export WASI_SDK_PATH=$HOME/ext/wasi-sdk echo $WASI_SDK_PATH $WASI_SDK_PATH/bin/clang --version - name: Install wasmtime if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | cd $HOME curl -o wasmtime.tar.gz -L https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux.tar.xz tar -xvf wasmtime.tar.gz export PATH=$HOME/wasmtime-v19.0.2-x86_64-linux:$PATH wasmtime --version - name: Setup Emscripten SDK if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | mkdir -p $HOME/ext cd $HOME/ext curl -o emsdk.tar.gz -L https://github.com/emscripten-core/emsdk/archive/refs/tags/4.0.13.tar.gz tar -xvf emsdk.tar.gz mv emsdk-4.0.13 emsdk export EMSDK_PATH=$HOME/ext/emsdk echo $EMSDK_PATH cd $EMSDK_PATH ./emsdk install 3.1.35 ./emsdk activate 3.1.35 - name: Build Linux ( WASM ) if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | export WASI_SDK_PATH=$HOME/ext/wasi-sdk export EMSDK_PATH=$HOME/ext/emsdk export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_TARGET_WASM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux ( WASM ) if: contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19') shell: bash -e -l {0} run: | export WASI_SDK_PATH=$HOME/ext/wasi-sdk export EMSDK_PATH=$HOME/ext/emsdk export PATH=$HOME/wasmtime-v19.0.2-x86_64-linux:$PATH export WASMTIME_NEW_CLI=0 cd integration_tests ./run_tests.py -b llvm_wasm llvm_wasm_emcc - name: Build Linux if: ${{! (contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '19'))}} shell: bash -e -l {0} run: | ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install # LLVM 10-19 all work in exactly the same way, so the test is identical - name: Test Linux LLVM 8-16 if: ${{(contains(matrix.llvm-version, '8') || contains(matrix.llvm-version, '9') || contains(matrix.llvm-version, '10') || contains(matrix.llvm-version, '11') || contains(matrix.llvm-version, '12') || contains(matrix.llvm-version, '13') || contains(matrix.llvm-version, '14') || contains(matrix.llvm-version, '15') || contains(matrix.llvm-version, '16'))}} shell: bash -e -l {0} run: | cd integration_tests ./run_tests.py -b llvm -sc ./run_tests.py -b llvm llvmImplicit ./run_tests.py -b llvm llvmImplicit -f -nf16 ./run_tests.py -b llvm_submodule ./run_tests.py -b llvm_submodule -sc - name: Test Linux LLVM 17-21 if: ${{(contains(matrix.llvm-version, '17') || contains(matrix.llvm-version, '18') || contains(matrix.llvm-version, '19') || contains(matrix.llvm-version, '20') || contains(matrix.llvm-version, '21'))}} shell: bash -e -l {0} run: | ctest --output-on-failure cd integration_tests ./run_tests.py -b llvm -sc ./run_tests.py -b llvm llvmImplicit ./run_tests.py -b llvm llvmImplicit -f ./run_tests.py -b llvm_submodule ./run_tests.py -b llvm_submodule -sc - name: Check SciPy Build and Test Run - Test SciPy shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | git clone https://github.com/scipy/scipy.git cd scipy git checkout 527f2ddcda98ebf4dae37abc38c85082218fcd6a find . -name "*.f" > files.txt files=$( $file.f90 gfortran -fallow-argument-mismatch -ffree-line-length-none -c $file.f90 -o $file.o #if [[ "$file" == *"minpack"* ]]; then # if [[ "$file" != *"dpmpar.f"* ]]; then # ../src/bin/lfortran --show-asr --no-indent --no-color --fixed-form --implicit-typing --implicit-interface $file > $file.asr # fi #fi done cd .. rm -rf scipy/ git clone https://github.com/pranavchiku/scipy.git cd scipy git checkout -t origin/scipy1 git checkout a70f11a305edd024cb9a0e5048257eb0f51e29e1 find . -name "*.f" > files.txt files=$( $file.f90 done cd .. rm -rf scipy/ - name: Check SciPy Build and Test Run - Build SciPy shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | git clone https://github.com/scipy/scipy cd scipy git remote add ondrej https://github.com/certik/scipy git fetch ondrej git checkout -t ondrej/merge_special_minpack_minpack2_fitpack_integrate_02 git checkout de851b31c795d41ce9e1fdead3dac7afff173156 micromamba env create -f environment.yml micromamba activate scipy-dev git submodule update --init mkdir lfortran-build/ cd lfortran-build/ LIBRARY_PATH="`pwd`/../../src/runtime/" FC=$(pwd)/../../src/bin/lfortran cmake \ -DCMAKE_Fortran_FLAGS=--verbose \ -DLFORTRAN_RUNTIME_LIBRARY_PATH=$LIBRARY_PATH \ .. make install cp ${{ github.workspace }}/src/runtime/liblfortran_runtime.* $CONDA_PREFIX/lib cd ../ python dev.py build - name: Check SciPy Build and Test Run - Test SciPy Special (Specfun, Amos, Mach and Cdflib) shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd scipy/ micromamba activate scipy-dev python dev.py test -t scipy.special -v - name: Check SciPy Build and Test Run - Test SciPy Minpack & Minpack2 shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd scipy/ micromamba activate scipy-dev python dev.py test -t scipy.optimize -v - name: Check SciPy Build and Test Run - Test SciPy Fitpack shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd scipy/ micromamba activate scipy-dev python dev.py test -t scipy.interpolate -v - name: Check SciPy Build and Test Run - Test SciPy Mach & Quadpack (Integrate) shell: bash -e -x -l {0} if: contains(matrix.os, 'ubuntu') && contains(matrix.llvm-version, '11') run: | cd scipy/ micromamba activate scipy-dev python dev.py test -t scipy.integrate -v - name: Test third party codes shell: bash -e -x -l {0} if: ${{! (matrix.llvm-version == '7') }} run: | export PATH="$(pwd)/src/bin:$PATH" RUNNER_OS="${{matrix.os}}" FC=lfortran ci/test_third_party_codes.sh upload_tarball: name: Upload Tarball runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - name: Upload Tarball shell: bash -e -l {0} run: | ./build0.sh lfortran_version=$(- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux.yml create-args: >- python=3.10 - name: Test shell: bash -e -l {0} run: | shell ci/test_without_llvm_backend.sh test_mlir: name: Test MLIR backend runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_linux_llvm.yml create-args: >- python=3.10 mlir=19.1.6 llvm=19.1.6 llvm-openmp=19.1.6 libunwind=1.7.2 - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Linux shell: bash -e -l {0} run: | ./build0.sh cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_MLIR=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . -j16 --target install - name: Test Linux shell: bash -e -l {0} run: | cd integration_tests ./run_tests.py -b mlir mlir_omp mlir_llvm_omp -j1 upload_docs: name: Documentation runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: mamba-org/setup-micromamba@v2.0.2 with: micromamba-version: '2.0.4-0' environment-file: ci/environment_docs_linux.yml - uses: hendrikmuhs/ccache-action@main with: variant: sccache key: ${{ github.job }}-${{ matrix.os }} - name: Build Kernel shell: bash -e -l {0} run: | ./build0.sh export CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_LSP=yes \ -DWITH_XEUS=yes \ -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ninja install ctest --output-on-failure jupyter kernelspec list --json - name: Build Docs shell: bash -e -l {0} working-directory: doc run: | $(command -v python) build.py - name: Upload Docs shell: bash -e -l {0} working-directory: doc run: | ../ci/upload_docs.sh env: SSH_PRIVATE_KEY_DOCS: ${{ secrets.SSH_PRIVATE_KEY_DOCS }} build-and-push-image: runs-on: ubuntu-latest # Run on push to main, or only when the specific label is modified on a PR if: >- ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Tests::Run-Exhaustive')) }} permissions: contents: read packages: write env: REGISTRY: ghcr.io USER: lfortran PROJECT: lfortran steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Log in to the Container registry if: ${{ github.event_name == 'push' }} uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ env.USER }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: context: . push: ${{ github.event_name == 'push' }} tags: ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.PROJECT }}:latest lfortran-lfortran-2f73434/spack.yaml0000664000175000017500000000101315141516316017613 0ustar alastairalastair# This is a Spack Environment file. # # It describes a set of packages to be installed, along with # configuration settings. # # Activate it with: # # spack env activate . # # The first time you need to build all the packages in it: # # spack install # # Then build LFortran as usual: # # ./build0.sh # ./build1.sh # # And everything should be automatically found. spack: # add package specs to the `specs` list specs: [python@3, cmake, llvm@14.0.0, py-toml@0.10.2, re2c@2.2, bison@3.4.2] view: true lfortran-lfortran-2f73434/README.md0000664000175000017500000000416515141516316017120 0ustar alastairalastair# LFortran [![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://lfortran.zulipchat.com/) LFortran is a modern open-source (BSD licensed) interactive Fortran compiler built on top of LLVM. It can execute user's code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user's code on modern architectures such as multi-core CPUs and GPUs. Website: https://lfortran.org/ Try online: https://dev.lfortran.org/ # Documentation All documentation, installation instructions, motivation, design, ... is available at: https://docs.lfortran.org/ Which is generated using the files in the `doc` directory. # Development We welcome all contributions. The main development repository is at GitHub: https://github.com/lfortran/lfortran Please send Pull Requests (PRs) and open issues there. See the [CONTRIBUTING](CONTRIBUTING.md) document for more information. Main mailinglist: https://groups.io/g/lfortran You can also chat with us on Zulip ([![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://lfortran.zulipchat.com/)). Note: We moved to the above GitHub repository from GitLab on July 18, 2022. # Donations You can support LFortran's development by donating to NumFOCUS or Open Collective as well as GitHub Sponsors: * https://numfocus.org/donate-to-lfortran * https://opencollective.com/lfortran * https://github.com/sponsors/lfortran All donations will be used strictly to fund LFortran development, by supporting tasks such as paying developers to implement features, sprints, improved documentation, fixing bugs, etc. The donations to LFortran are managed by the NumFOCUS foundation. NumFOCUS is a 501(c)3 non-profit foundation, so if you are subject to US Tax law, your contributions will be tax-deductible. If you want to discuss another way to fund or help with the development, feel free to contact Ondřej Čertík (ondrej@certik.us). # Star History [![Star History Chart](https://api.star-history.com/svg?repos=lfortran/lfortran&type=Date)](https://star-history.com/#lfortran/lfortran&Date) lfortran-lfortran-2f73434/build1.bat0000664000175000017500000000045415141516316017506 0ustar alastairalastaircmake ^ -DCMAKE_BUILD_TYPE=Release ^ -DWITH_LLVM=yes ^ -DLFORTRAN_BUILD_ALL=yes ^ -DWITH_STACKTRACE=no ^ -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX=%cd%/inst ^ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes ^ . cmake --build . --config Release --target installlfortran-lfortran-2f73434/build0_win.xsh0000664000175000017500000000123715141516316020416 0ustar alastairalastair#!/usr/bin/env xonsh #bash ci/version.sh version=$(git describe --tags --dirty).strip()[1:] echo @(version) > version python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h pushd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd pushd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && popd pushd src/lfortran/parser && bison -Wall -d -r all parser.yy && popd python src/libasr/wasm_instructions_visitor.py python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server lfortran-lfortran-2f73434/CONTRIBUTING.md0000664000175000017500000000355315141516316020072 0ustar alastairalastair## Contributing We welcome contributions from anyone, even if you are new to open source. It might sound daunting to contribute to a compiler at first, but please do, it is not complicated. We will help you with any technical issues and help improve your contribution so that it can be merged. ### Getting Started To contribute, follow these steps: 1. **Fork the Repository** Fork the [LFortran repository](https://github.com/lfortran/lfortran) to your GitHub account. 2. **Clone Your Fork** Clone your forked repository to your local machine: ``` git clone https://github.com//lfortran.git cd lfortran ``` 3. **Add the Upstream Repository** Add the original LFortran repository as the upstream remote. ``` git remote add upstream https://github.com/lfortran/lfortran.git git fetch upstream --tags ``` 4. **Install Dependencies and Build the Project** Follow the [installation guide](https://docs.lfortran.org/en/installation/#build-from-git) to set up the required dependencies and build the project. 5. **Make Changes and Submit Your Contribution** Create a branch for your changes and make the necessary edits. When ready, push your changes to your fork and submit a Pull Request (PR) against our repository at: https://github.com/lfortran/lfortran. ### Communication If you have any questions or need help, please ask as at our [mailinglist](https://groups.io/g/lfortran) or a [chat](https://lfortran.zulipchat.com/). ### Code of Conduct Please note that all participants of this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). ### Licensing By submitting a PR you agree to license your contribution under the LFortran's BSD [license](LICENSE) unless explicitly noted otherwise. lfortran-lfortran-2f73434/tests/0000775000175000017500000000000015141516316016775 5ustar alastairalastairlfortran-lfortran-2f73434/tests/lookup_name1.f900000664000175000017500000000012315141516316021703 0ustar alastairalastairprogram lookup_name1 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-lfortran-2f73434/tests/fn3.f900000664000175000017500000000037515141516316020010 0ustar alastairalastairrecursive pure integer function a() end function pure integer elemental function b() end function elemental pure integer function c() end function elemental pure function cb() integer cb end function integer pure recursive function d() end function lfortran-lfortran-2f73434/tests/declaration1.f900000664000175000017500000000021615141516316021662 0ustar alastairalastairmodule declaration1 integer(4), dimension(1,1), parameter :: & arr = reshape([1, 1],shape(arr),order=[2,1]) end module declaration1 lfortran-lfortran-2f73434/tests/no_prescan_include1.f900000664000175000017500000000002215141516316023222 0ustar alastairalastairinclude "if1.f90" lfortran-lfortran-2f73434/tests/char_arr_assignment.f900000664000175000017500000000015415141516316023326 0ustar alastairalastairprogram char_arr_assignment character char_arr(4) char_arr(:) = "A" end program char_arr_assignment lfortran-lfortran-2f73434/tests/external3.f900000664000175000017500000000017415141516316021224 0ustar alastairalastairdouble precision function brcmp1() double precision bcorr external bcorr intrinsic exp brcmp1 = exp(-bcorr(a,b)) return end lfortran-lfortran-2f73434/tests/execute_command_line.f900000664000175000017500000000020115141516316023455 0ustar alastairalastairprogram execute_command_line call execute_command_line('echo "Hello World"') call execute_command_line('ls') end program lfortran-lfortran-2f73434/tests/loop_test3.f0000664000175000017500000000040515141516316021236 0ustar alastairalastair PROGRAM TEST DO 240 K=1,MP CON(K)=-DATMAT(K,NP) DO 220 J=1,N 220 W(J)=DATMAT(K,J)+CON(K) DO 240 I=1,N TEMP=0.0d0 DO 230 J=1,N 230 TEMP=TEMP+W(J)*SIMI(J,I) IF (K .EQ. MP) TEMP=-TEMP 240 A(I,K)=TEMP END lfortran-lfortran-2f73434/tests/implied_do_loop2.f900000664000175000017500000000022015141516316022527 0ustar alastairalastairprogram implied_do_loop2 implicit none character(len=5) :: s = "Hello" integer :: i print *, (s, i = 1, 3) end program implied_do_loop2 lfortran-lfortran-2f73434/tests/format1.f900000664000175000017500000001212215141516316020664 0ustar alastairalastairprogram format_04 real :: a,b,c,d,e(6) double precision :: r,s,t,real_hundred real, parameter :: t1 = 3.47399991e-03, t2 = 3.47000011e-03 integer :: f,i,j real(8) :: p,q a = 123.456 b = 123.45678 c = 12.34 d = 123.45 f = 12345 i = 19 j = 21 r = 12345678 s = 23.5678 t = 0.345678 p = 2.0d0 q = 0.0d0 e = [-1.70138506e+38, -1.25381181e+38, 8.69779800e+37, & -1.40706263e+37, 1.11501114e+37, -9.56332244e+37] real_hundred = 100.0 print *, "ok", "b" print '(a,a)', "ok", "b" print 1, "ok", "b" 1 FORMAT ( a, a ) print '("Success!",/,10X,A6,"World!")',"Hello 123" print 2, "Hello 123" 2 FORMAT ("Success!",/,10 X,A 6,"World!") print 3, "Hello 123" 3 FORMAT ("Success!",/,1 0 X , A 6,"World!") print '(4a4)',"dancing","in","the","moonlight" print 4,"dancing","in","the","moonlight" 4 FORMAT (4a4) print 5,"dancing","in","the","moonlight" 5 FORMAT (4 a 4) print '(A2,4(2X,A),I3)',"ab", "cdef", "ghi", "jkl","qwerty",12 print 6,"ab", "cdef", "ghi", "jkl","qwerty",12 6 FORMAT (A 2,4(2 X,A),I3) print 7,"ab", "cdef", "ghi", "jkl","qwerty",12 7 FORMAT (A 2,4 ( 2 X, A),I 3) print '(i3,i10.5,/i6.6,2x,i3)' , 123,456,12345,6789 print 8 , 123,456,12345,6789 8 FORMAT (i3,i10.5,/i6.6,2 x,i3) print 9 , 123,456,12345,6789 9 FORMAT (i 3,i 10. 5,/i 6 .6, 2 x,i 3) print '(d10.2,d15.6,d010.2,2x,d7.2)', 123.456, -123.45678, 12.34, -123.45 print 10, 123.456, -123.45678, 12.34, -123.45 10 FORMAT (d 10.2,d 15.6,d 010.2,2x,d 7.2) print 11, 123.456, -123.45678, 12.34, -123.45 11 FORMAT (d 10 .2,d 1 5. 6, d 0 10.2, 2 x, d 7 .2) print '(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2)', -a, b, -c, d print 12, -a, b, -c, d 12 FORMAT (1p d10.2,2 p d15.6,1p d010. 2,2 x,1pd9.2) print 13, -a, b, -c, d 13 FORMAT (1 p d 10.2,2 p d1 5.6,1p d 0 10. 2,2 x,1 p d 9.2) print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)', -a, b, -c, d print 14, -a, b, -c, d 14 FORMAT (- 1 p e 10.2,-2 p e 15.6,1 p e 010 . 2, 2 x,1 pe 9.2) print 15, -a, b, -c, d 15 FORMAT (- 1 p e 10.2,-2 p e 15. 6,1 p e 01 0 . 2, 2 x, 1 pe 9. 2) print "(12(i3))", 1,2,3,4,5,6,7,8,9,10,11,12 print 16, 1,2,3,4,5,6,7,8,9,10,11,12 16 FORMAT ( 12 ( i 3 )) print "(4(i3),' hello')", 1,2,3,4,5,6,7,8,9,10,11,12,13,14 print 17, 1,2,3,4,5,6,7,8,9,10,11,12,13,14 17 FORMAT (4 ( i 3),' hello') print '(i0)', f, -f print 18, f, -f 18 FORMAT (i0) print '(d0.0,1x,d0.1,1x,d0.2)',a,b,c print 19,a,b,c 19 FORMAT (d0. 0,1 x,d0.1,1x,d 0.2) print 20, a, b, c 20 FORMAT (d 0. 0,1 x,d 0.1,1x, d 0.2) print '(d0.0,1x,d0.1,1x,d0.2)',-a,-b,-c print 21,-a,-b,-c 21 FORMAT (d 0.0,1x,d0.1,1x,d0.2) print '("Hello")' print '( F13.3,1X,F9.6,1X, F0.2 )', r, s, t print 22, r, s, t 22 FORMAT ( F13.3,1 X,F9.6,1X, F0.2 ) print 23, r, s, t 23 FORMAT ( F 13.3,1 X,F 9.6,1 X, F 0. 2 ) print '( F13.3,1X,F9.6,1X, F0.2 )', -r, -s, -t print 24, -r, -s, -t 24 FORMAT ( F 13.3,1X,F 9.6,1X, F0.2 ) print '(1PE13.6)', p, q print 25, p, q 25 FORMAT (1PE13.6) print '(F30.25)', 12345e-25 print 26, 12345e-25 26 FORMAT (F30.25) print '("x:", F4.2, " y:", ES7.1)', 1.123, 4.456 print 27, 1.123, 4.456 27 FORMAT ("x:", F4.2, " y:", ES7.1) print 28, 1.123, 4.456 28 FORMAT ("x:", F 4. 2, " y:", E S 7.1) print '("x:", ES10.2)', 0.999, 0.1 print 29, 0.999, 0.1 29 FORMAT ("x:", E S 10.2) print '("x:", ES15.5)', 0.102212 print 30, 0.102212 30 FORMAT ("x:", ES15.5) print "(*(es15.5e2,1x))", e print 31, e 31 FORMAT (*(es15.5e2,1x)) print 32, e 32 FORMAT (*( es 15. 5e2, 1 x)) ! test for issue: https://github.com/lfortran/lfortran/issues/4001 print "(F10.3)", abs(t2-t1) print 33, abs(t2-t1) 33 FORMAT (F10.3) print "(F10.3)", t2-t1 print 34, t2-t1 34 FORMAT (F10.3) print 35, t2-t1 35 FORMAT ( F 10. 3) print "(F0.6)", real_hundred print 36, real_hundred 36 FORMAT (F10.3) ! test for issue: https://github.com/lfortran/lfortran/issues/6348 print '(A,F0.0,A)', '"',0.0 ,'"' ! test for issue: https://github.com/lfortran/lfortran/issues/4040 print "(2 (I3))", i, j print 37, i, j 37 FORMAT (I3) print "(2 (I 3))", i, j print 38, i, j 38 FORMAT (2 (I3)) ! test for issue: https://github.com/lfortran/lfortran/issues/6761 print "(2((I0), 1x))", i, j ! test for issue: https://github.com/lfortran/lfortran/issues/6748 print "((A))))", ' foobar' print "((A))x", ' foobar' print "(a)xx)", ' foobar' ! the below test also ensures that blank character ! isn't removed from ' Dates: ' print 39, i, i + 1, j + 1, i + 2, j + 2 39 FORMAT (I12, /, ' Dates: ', 2 (2I3, I5)) print 40, i, i + 1, j + 1, i + 2, j + 2 40 FORMAT (I 1 2, /, ' Dates: ', 2 ( 2 I 3, I 5 )) print 41, i, i + 1, j + 1, i + 2, j + 2 41 FORMAT (I 12, /, ' Dates: ', 2 (2I3, I5)) print 42, i, i + 1, j + 1, i + 2, j + 2 42 FORMAT (I 1 2, /, ' Dates: ', 2 (2 I 3, I 5)) end program lfortran-lfortran-2f73434/tests/classes1.f900000664000175000017500000000066515141516316021042 0ustar alastairalastairmodule xx type :: base integer :: x contains procedure, non_overridable :: show_x end type contains subroutine show_x(this) class(base), intent(inout) :: this this%x = 12 end subroutine show_x end module program main use xx implicit none type(base) :: b b%x = 10 call b%show_x() print *, b%x if ( b%x /= 12 ) error stop end program lfortran-lfortran-2f73434/tests/exit2.f900000664000175000017500000000021415141516316020345 0ustar alastairalastairprogram exit2 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(2) end if end do end program lfortran-lfortran-2f73434/tests/implicit_interface2.f900000664000175000017500000000012715141516316023231 0ustar alastairalastairprogram implicit_interface2 double precision f, g print *, f(5), g(1, 3.0) end program lfortran-lfortran-2f73434/tests/data3.f900000664000175000017500000000123015141516316020305 0ustar alastairalastairprogram datatest implicit none integer :: ivon01,ivon02,ivon03,ivon04,ivon05 integer :: ivon06,ivon07,ivon08,ivon09,ivon10 integer :: ivon11,ivon12,ivon13,ivon14,ivon15 integer :: ivon16,ivon17,ivon18,ivon19,ivon20 integer, parameter :: vals(5) = [2,76,587,9999,21111] complex :: axva,axvb data ivon01,ivon02,ivon03,ivon04,ivon05 /vals(1), vals(2), vals(3), vals(4), vals(5)/ data ivon06,ivon07,ivon08,ivon09,ivon10 /+3,+76,+587,+9999,+21111/ data ivon11,ivon12,ivon13,ivon14,ivon15 /-3,-76,-587,-9999,-21111/ data ivon16,ivon17,ivon18,ivon19,ivon20 / 2*119, 2*7, -427/ data axva,axvb /(-234.23, 3), (+2, -3.0)/ end program datatest lfortran-lfortran-2f73434/tests/write1.f900000664000175000017500000000143215141516316020530 0ustar alastairalastairprogram write_01 implicit none write(*,*) "a", 2 write(*,*) write(*) a write(out_str,'(" Found index ", i9," but item is not in list.")') index write(out_string,*) 'Scalar_in = ', scalar_in write(out_string, 10) int_src, int_given, int_expected write(string,fmt='(f6.2)') max_angle write(fmt,'("(i",i0,".",i0,")")') n, n write(unit=*, fmt='(a)') trim(prog) // ': ' // message write(unit=0,fmt='(a,i4.4)') "Assertion failed at " // file // ":", line write(*,fmt='(a,l1)') 'exactly_conservative= ',exactly_conservative write(unit=lun) vec write(*,'(a,a)',advance='no') trim(input_string),": " WRITE( ounit, FMT=303, ADVANCE='NO' ) WRITE( *, 201) ( star, i = 1, 80 ) WRITE( *, '(1X,A)') 'Success!' WRITE( ounit, * ) print *, "2" print * print "(a, es22.14)", "Ekin: ", Ekin end program lfortran-lfortran-2f73434/tests/derived_types_10.f900000664000175000017500000000213015141516316022457 0ustar alastairalastairmodule my_module type :: my_super_type integer :: x end type type :: my_type integer :: x type(my_super_type) :: super ! procedure(print_something), pointer :: p_ptr contains final :: finalize procedure :: proc => print_something procedure :: unary, plus generic :: operator(+) => unary, plus generic :: g_proc => plus, unary end type my_type contains subroutine finalize(self) type(my_type), intent(inout) :: self end subroutine finalize subroutine print_something(self, str) class(my_type), intent(inout) :: self character(len=*), intent(in) :: str print *, str end subroutine print_something subroutine say_something(self, msg) class(my_type), intent(inout) :: self character(len=*), intent(in) :: msg print *, msg end subroutine pure type(my_type) function unary(self, x) class(my_type), intent(in) :: self, x end function unary pure type(my_type) function plus(self) class(my_type), intent(in) :: self end function plus end module my_modulelfortran-lfortran-2f73434/tests/read2.f900000664000175000017500000000035515141516316020315 0ustar alastairalastairprogram read2 implicit none character(256) :: phifile='default' character(60) :: val = "''" read(val, *) phifile print *, "phifile: ", phifile print *, phifile == "" print *, phifile == "''" end program read2 lfortran-lfortran-2f73434/tests/external1.f900000664000175000017500000000010515141516316021214 0ustar alastairalastair subroutine iddr_rsvd(matvect) implicit none external matvect end lfortran-lfortran-2f73434/tests/fn1.f900000664000175000017500000000035115141516316020000 0ustar alastairalastairinteger function a() end function real function b() end function logical function c() end function integer function d() result(r) end function real function e() result(r) end function logical function f() result(r) end function lfortran-lfortran-2f73434/tests/implicit1.f900000664000175000017500000000250715141516316021214 0ustar alastairalastairprogram implicit1 ! AST only implicit none IMPLICIT NONE implicit none () implicit none (external) implicit none (type) implicit none (external, type) implicit none (type, external) implicit real (a-h,o-z) implicit real (dp) (a-h,o-z) implicit real*8 (a-h,o-z) implicit real(8) (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) implicit character (id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) implicit integer (dp) (a-h,o-z) implicit integer*8 (i,j-l,m,n) IMPLICIT INTEGER (A, C) IMPLICIT INTEGER*4 (C, D-x) IMPLICIT INTEGER(4) (C, D-x) implicit logical (l, u-z) implicit logical (dp) (a-h,o-z) implicit logical*4 (l, u-z) implicit logical(4) (l, u-z) implicit complex (z) implicit complex (dp) (a-h,o-z) IMPLICIT COMPLEX (C) implicit complex*8 (z) implicit complex(4) (z) IMPLICIT TYPE(BLOB) (A) IMPLICIT class(X) (A-b) implicit real(kind=4)(a), real(4+4)(b), real(d)(d), real(d(2))(a-z) implicit integer(kind=4)(a), integer(4+4)(b), integer(d)(d), integer(d(2))(a-z) implicit logical(kind=4)(a), logical(4+4)(b), logical(d)(d), logical(d(2))(a-z) implicit complex(kind=4)(a), complex(4+4)(b), complex(d)(d), complex(d(2))(a-z) implicit character(kind=c_char, len=4)(a) implicit character(len=4, kind=c_char)(a) implicit character(kind=c_char)(a) end program implicit1 lfortran-lfortran-2f73434/tests/interface4.f900000664000175000017500000000154415141516316021345 0ustar alastairalastairMODULE DOT ! Module for dot product of two real arrays of rank 1. ! The caller needs to ensure that exceptions do not cause halting. ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf USE, INTRINSIC :: IEEE_EXCEPTIONS LOGICAL :: MATRIX_ERROR = .FALSE. INTERFACE OPERATOR(.dot.) MODULE PROCEDURE MULT END INTERFACE CONTAINS REAL FUNCTION MULT (A, B) REAL, INTENT (IN) :: A(:), B(:) INTEGER I LOGICAL OVERFLOW IF (SIZE(A) /= SIZE(B)) THEN MATRIX_ERROR = .TRUE. RETURN END IF ! The processor ensures that IEEE_OVERFLOW is quiet. MULT = 0.0 DO I = 1, SIZE (A) MULT = MULT + A(I)*B(I) END DO CALL IEEE_GET_FLAG (IEEE_OVERFLOW, OVERFLOW) IF (OVERFLOW) MATRIX_ERROR = .TRUE. END FUNCTION MULT END MODULE DOT lfortran-lfortran-2f73434/tests/fixed_form5.f0000664000175000017500000000022715141516316021354 0ustar alastairalastair COMPLEX*16 FUNCTION ZDOTC(N,D1X) INTEGER N COMPLEX*16D1X(*) CHARACTER*2D2V D2V="AB" RETURN END lfortran-lfortran-2f73434/tests/preprocessor15.f900000664000175000017500000000361315141516316022214 0ustar alastairalastairprogram preprocessor15 #define X DEC(1 << 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #undef X #define X (1 << 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #undef X #define X 1<<2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 4 print *, "X == 4" #else print *, "X other" #endif #define X DEC(8 >> 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (8 >> 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 8>>2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC((53 & 4) >> 2) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X ((53 & 4) >> 2) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (53&4)>>2 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC((2 | 8) / 5) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X ((2 | 8) / 5) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (2|8)/5 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif end program lfortran-lfortran-2f73434/tests/modules3.f900000664000175000017500000000012115141516316021042 0ustar alastairalastairmodule tomlf_type use tomlf_type_array implicit none end module tomlf_type lfortran-lfortran-2f73434/tests/array12.f900000664000175000017500000000156415141516316020604 0ustar alastairalastairmodule array12 use, intrinsic :: iso_c_binding, only: c_char, c_int, c_ptr, c_associated implicit none interface function getcwd(buf, bufsize) result(path) bind(C, name="getcwd") import :: c_char, c_int, c_ptr character(kind=c_char, len=1), intent(in) :: buf(*) integer(c_int), value, intent(in) :: bufsize type(c_ptr) :: path end function getcwd end interface contains subroutine get_current_directory(path) character(len=:), allocatable, intent(out) :: path character(kind=c_char, len=1), allocatable :: cpath(:) integer(c_int), parameter :: buffersize = 1000_c_int type(c_ptr) :: tmp allocate(cpath(buffersize)) tmp = getcwd(cpath, buffersize) if (c_associated(tmp)) then print *, "PWD: ", tmp end if end subroutine get_current_directory end module array12 lfortran-lfortran-2f73434/tests/implicit6.f900000664000175000017500000000017315141516316021216 0ustar alastairalastairinteger function CH12N(N,Z) IMPLICIT DOUBLE PRECISION (A,B,D-H,O-Y) IMPLICIT COMPLEX*16 (C,Z) CI=(0.0D0,1.0D0) end functionlfortran-lfortran-2f73434/tests/empty.f900000664000175000017500000000000015141516316020441 0ustar alastairalastairlfortran-lfortran-2f73434/tests/fixedform_assign_minimal.f0000664000175000017500000000004215141516316024175 0ustar alastairalastair integer a, b,c,d end lfortran-lfortran-2f73434/tests/format5.f900000664000175000017500000000051715141516316020675 0ustar alastairalastairprogram format5 print "(1PE24.16E3)", -8.431309591172336803666098603571299463510513305E-01_8 print "(1PE24.16E3)", -0.8431309591172336803666098603571299463510513305E-01_8 print "(1PE24.16E3)", -8.431309591172336803666098603571299463510513305E+01_8 print "(2PE23.15)", 1.E-3 print "(1PE23.15)", 1.234567890123456d-3 end program format5 lfortran-lfortran-2f73434/tests/preprocessor3c.h0000664000175000017500000000003415141516316022117 0ustar alastairalastair#include "preprocessor3b.h" lfortran-lfortran-2f73434/tests/parse_without_program_line.f900000664000175000017500000000100715141516316024746 0ustar alastairalastairinteger, allocatable :: a(:) integer, pointer :: p allocate(a(10)) deallocate(a) open(unit=10, file="test.txt", status="old") flush(10) close(unit=10) nullify(p) exit cycle return continue print *, exit print *, cycle print *, return print *, continue call exit call cycle call return call continue contains subroutine sub integer :: i do i = 1, 10 print *, i if (i == 5) exit if (i == 7) cycle if (i == 9) return if (i == 2) continue end do end subroutine end program lfortran-lfortran-2f73434/tests/preprocessor14.f900000664000175000017500000000170315141516316022211 0ustar alastairalastairprogram preprocessor14 #define X DEC(4 - 3) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (4 - 3) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 4-3 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #define X DEC(10 % 3) #define DEC(n) (n) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X (10 % 3) #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif #undef X #define X 10%3 #if X == 0 print *, "X == 0" #elif X == 1 print *, "X == 1" #elif X == 2 print *, "X == 2" #else print *, "X other" #endif end program lfortran-lfortran-2f73434/tests/external_04.f900000664000175000017500000000005715141516316021444 0ustar alastairalastairsubroutine a() external f, g call b(f, g) end lfortran-lfortran-2f73434/tests/data1.f900000664000175000017500000000210715141516316020307 0ustar alastairalastairprogram data1 type person integer :: age character(20) :: fullname end type character (len = 10) myname integer, dimension (0:9) :: miles data myname / 'xyz' /, miles / 10 * 0 / real, dimension (100, 100) :: skew type (person) yourname data yourname % age, yourname % fullname / 35, 'abc' / data ((skew (k, j), j = 1, k), integer(4) :: k = 1, 10) / 55 * 0.0 / data ((skew (k, j), j = 1, k, k), integer(4) :: k = 1, 100, 2) / 50 * 0.0 / data ((skew (k, j), j = k + 1, 10), k = 1, 3) / 24 * 1.0 / data ((skew (k, j), j = k + 1, 10, k), k = 1, 3, 1) / 16 * 1.0 / real(8), parameter :: sin3 = sin(3.d0) real(8), parameter :: cos3 = cos(3.d0) real(8) s(10) DATA s/ 1.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, sin3, cos3, 0.d0, -1.d0 / integer :: iarx(3,1), iary(3,1) print *, "Your name is: ", yourname % fullname print *, "Your age is: ", yourname % age data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, "My name is: ", myname data(iary(i,1),i=1,3)/ 1, 9, 1950 / end program lfortran-lfortran-2f73434/tests/fixed_form_implicit1.f0000664000175000017500000000016415141516316023242 0ustar alastairalastair program main implicit none integer a a = 1 if(a.le.1) print *, "h" end program lfortran-lfortran-2f73434/tests/fixedform_module.f0000664000175000017500000000015315141516316022473 0ustar alastairalastair MODULE E END MODULE E PROGRAM MAIN IMPLICIT NONE END PROGRAM MAIN lfortran-lfortran-2f73434/tests/save4.f900000664000175000017500000000042115141516316020334 0ustar alastairalastairprogram save4 implicit none integer :: y = 1 if (y .eq. 1) then print *, "y is 1" end if contains subroutine f() integer :: x = 5 if (x .eq. 1) then print *, "x is 1" end if end subroutine end program lfortran-lfortran-2f73434/tests/do_concurrent2.f900000664000175000017500000000044515141516316022246 0ustar alastairalastairsubroutine do_concurrent2(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine lfortran-lfortran-2f73434/tests/save1.f900000664000175000017500000000112715141516316020335 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 end function module save_module implicit none public real :: x = 5, z real, save :: y = 5 contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 end function end module program main real :: x = 5, z real, save :: y = 5 end program lfortran-lfortran-2f73434/tests/loop_test1.f0000664000175000017500000000047115141516316021237 0ustar alastairalastair program main integer KP integer i,j,do330i kp = 10 DO 330 I=1,KP DO 320, J=I+1,KP IF (0.GT.1) THEN print *, i, j ELSE print *, j, i END IF 320 CONTINUE 330 CONTINUE DO330I = 15 end program lfortran-lfortran-2f73434/tests/statement1.f900000664000175000017500000000016715141516316021406 0ustar alastairalastairsubroutine statement1() double precision x, a, b, c logical q q(x) = .NOT. ( a == b .AND. c == 0.0 ) end subroutine lfortran-lfortran-2f73434/tests/allow_implicit_interface5.f900000664000175000017500000000025315141516316024432 0ustar alastairalastairsubroutine klvnzo_(nt,kd) implicit double precision (a-h,o-z) dimension zo(nt),rt0(8) call klvna(rt) return end program main call klvnzo_(5,8) end program lfortran-lfortran-2f73434/tests/fixed_form_interface.f0000664000175000017500000000310015141516316023300 0ustar alastairalastair program fixed_form_interface implicit none integer :: i, arr(5) integer :: OUTPUT_UNIT type :: element character(len=2) :: symbol integer :: atomic_number real :: atomic_mass integer :: quantity end type element type :: chemical_compound character(len=30) :: name character(len=10) :: formula real :: molecular_weight type(element), allocatable, dimension(:) :: elements end type c tests that 'interface' is tokenized correctly interface subroutine my_subroutine(a) integer, intent(in) :: a end subroutine my_subroutine function my_function(b) result(res) integer, intent(in) :: b integer :: res end function my_function end interface c tests that 'allocate' is tokenized correctly integer :: num = 2 integer, dimension(:), allocatable :: factors allocate ( factors(num) ) factors = [3, 4] c tests that 'deallocate' is tokenized correctly deallocate(factors) 1 FORMAT (TR1, A) print 1, factors do concurrent (i=1:10:2) arr(i) = i enddo c ensures that 'FLUSH' is tokenized FLUSH(OUTPUT_UNIT) contains end program fixed_form_interface lfortran-lfortran-2f73434/tests/optional_01.f900000664000175000017500000000045515141516316021446 0ustar alastairalastairMODULE optmod IMPLICIT NONE CONTAINS SUBROUTINE optional_argument(name) CHARACTER(LEN=10), INTENT(IN), OPTIONAL :: name IF (PRESENT(name)) THEN PRINT*, 'Hello '// name ELSE PRINT*, 'Hello world!' END IF END SUBROUTINE optional_argument END MODULE optmod lfortran-lfortran-2f73434/tests/derived_types_03.f900000664000175000017500000000070515141516316022467 0ustar alastairalastairprogram derived_types_03 ! AST only DO nn = 1, ndiag ing = diag(nn)%len ALLOCATE( diag(nn)%cell_id(ing), STAT=ierr ) IF ( ierr /= 0 ) RETURN ndpwds = ndpwds + SIZE( diag(nn)%cell_id ) END DO DO k = 1, nz DO j = 1, ny DO i = 1, ichunk nn = i + j + k - 2 indx(nn) = indx(nn) + 1 ing = indx(nn) diag(nn)%cell_id(ing)%ic = i diag(nn)%cell_id(ing)%j = j diag(nn)%cell_id(ing)%k = k END DO END DO END DO end program lfortran-lfortran-2f73434/tests/string1.f900000664000175000017500000000206115141516316020703 0ustar alastairalastairmodule fpm_strings use iso_c_binding, only: c_char, c_ptr, c_size_t implicit none public :: f_string, string_t type string_t character(len=:), allocatable :: s end type interface f_string module procedure f_string, f_string_cptr, f_string_cptr_n end interface f_string contains function f_string(c_string) character(len=1), intent(in) :: c_string(:) character(:), allocatable :: f_string end function f_string function f_string_cptr(cptr) result(s) type(c_ptr), intent(in), value :: cptr character(len=:, kind=c_char), allocatable :: s interface function c_strlen(s) result(r) bind(c, name="strlen") import c_size_t, c_ptr type(c_ptr), intent(in), value :: s integer(kind=c_size_t) :: r end function end interface s = f_string_cptr_n(cptr, c_strlen(cptr)) end function function f_string_cptr_n(cptr, n) result(s) type(c_ptr), intent(in), value :: cptr integer(kind=c_size_t), intent(in) :: n character(len=n, kind=c_char) :: s end function end module fpm_strings lfortran-lfortran-2f73434/tests/external4.f900000664000175000017500000000022715141516316021224 0ustar alastairalastairsubroutine dqc25s(f) double precision dlog,f external f call dqk15w(f) print *, f(hlgth+centr) print *, dlog(2.0d0) end subroutine lfortran-lfortran-2f73434/tests/do7.f900000664000175000017500000000027215141516316020007 0ustar alastairalastairprogram do7 implicit none integer :: i, a do i = 1, 10 a = f(5) end do contains integer function f(a) integer, intent(in) :: a f = a + 1 end function end program lfortran-lfortran-2f73434/tests/subroutine3b.f900000664000175000017500000000017515141516316021744 0ustar alastairalastairinteger function f() f = 42 end function integer function g() g = 42 end function integer function h() h = 42 end function lfortran-lfortran-2f73434/tests/write2.f900000664000175000017500000000021115141516316020523 0ustar alastairalastairprogram write2 implicit none integer :: i write(unit=*, fmt='(a)', advance='no') "Some text: " read *, i print *, "Got: ", i end program lfortran-lfortran-2f73434/tests/format8.f900000664000175000017500000000076415141516316020704 0ustar alastairalastairprogram format8 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: val ! Test E format exponent for values near powers of 10 ! E format normalizes mantissa to [0.1, 1.0) ! e.g., 1.0e-10 becomes 0.1e-9 val = 1.0d-10 print '(E25.17)', val val = 1.0d-100 print '(E25.17)', val val = 1.0d0 print '(E25.17)', val val = 1.0d+10 print '(E25.17)', val val = 1.0d+100 print '(E25.17)', val end program format8 lfortran-lfortran-2f73434/tests/fixed_form_implicit_check.f0000664000175000017500000000011715141516316024314 0ustar alastairalastair program main IMPLICIT DOUBLE PRECISION (A-H,O-Z) end program lfortran-lfortran-2f73434/tests/fixedform_data.f0000664000175000017500000000017615141516316022124 0ustar alastairalastair subroutine f() integer x real one, two data x /1/ DATA ONE, TWO /1.0, 2.0/ end subroutine lfortran-lfortran-2f73434/tests/implicit_typing2.f900000664000175000017500000000030115141516316022575 0ustar alastairalastairsubroutine f(ifault, r, n, b) integer :: a(n) integer :: b(n) ifault = 4 r = 3 end subroutine integer function g(ifault, r, n, b) integer :: a(n) integer :: b(n) ifault = 4 r = 3 end function lfortran-lfortran-2f73434/tests/program4.f900000664000175000017500000000124215141516316021047 0ustar alastairalastairprogram program4 real :: x, y, z x = 1.0 y = 2.0 z = func1(x, y) print *, "6.0 == ", z z = func1(x, y) print *, "7.0 == ", z z = func2(x, y) print *, "6.0 == ", z z = func2(x, y) print *, "8.0 == ", z contains function func1(a, b) result(c) real, intent(in) :: a, b real :: c real, save :: saved = 2.0 saved = saved + 1.0 c = c + a + b + saved end function func1 function func2(a, b) result(c) real, intent(in) :: a, b real :: c real :: saved1 = 2.0 real, save :: saved2 real :: d saved1 = saved1 + 1.0 c = d + c + a + b + saved1 + saved2 saved2 = saved2 + 1.0 d = d + 3.0 end function func2 end program program4lfortran-lfortran-2f73434/tests/preprocessor3.f900000664000175000017500000000015115141516316022123 0ustar alastairalastairprogram preprocessor3 implicit none #include "preprocessor3e.h" x = (2+3)*5 print *, x, C123 end program lfortran-lfortran-2f73434/tests/wasm_main_program.f900000664000175000017500000000100015141516316023006 0ustar alastairalastairprogram main implicit none integer :: pi, radius, area real :: pi2, radius2, area2 pi = 3 radius = 5 area = pi * sqr(radius) print *, area pi2 = 3.14 radius2 = 5.0 area2 = pi2 * radius2 * radius2 print *, area2 print *, "radius of the circle is", radius2, radius print *, "and its area is", area2, "cm^2" contains function sqr(x) result(r) integer, intent(in) :: x integer :: r r = x * x end function end program lfortran-lfortran-2f73434/tests/subroutine8.f900000664000175000017500000000035615141516316021610 0ustar alastairalastairrecursive pure subroutine a() end subroutine pure elemental subroutine b() end subroutine elemental pure subroutine c() end subroutine pure recursive subroutine d() end subroutine impure elemental module subroutine e() end subroutine lfortran-lfortran-2f73434/tests/sole_intrinsic.f0000664000175000017500000000050715141516316022172 0ustar alastairalastair program main intrinsic aimag, cmplx, real !TODO for the below: runtime ComplexConstructor not !implemented yet complex f f = cmplx(3, 1) complex :: x = (1.0, -3.0) real :: y y = aimag(x) intrinsic mod end program lfortran-lfortran-2f73434/tests/do_concurrent_reduce2.f900000664000175000017500000000033015141516316023566 0ustar alastairalastairsubroutine sum_reduce(a, s, t) real, intent(in) :: a(:) real, intent(out) :: s, t integer :: N, i N = size(a) s = 0 t = 0 do concurrent (i = 1:N) reduce(+:s,t) s = s + a(i) t = t + a(i) end do end subroutine lfortran-lfortran-2f73434/tests/modules_04.f900000664000175000017500000000036215141516316021271 0ustar alastairalastairmodule access_vars implicit none private public print_vars real :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-lfortran-2f73434/tests/wasm_unary_minus.f900000664000175000017500000000140415141516316022714 0ustar alastairalastairprogram wasm_unary_minus implicit none print *, get_num_neg_i32(13), get_num_neg_i64(130000000000000000_8) print *, get_num_neg_i32(-13), get_num_neg_i64(-130000000000000000_8) print *, test_unary_minus() contains function get_num_neg_i32(x) result(r) implicit none integer(4), intent(in) :: x integer(4) :: r r = -x return end function function get_num_neg_i64(x) result(r) implicit none integer(8), intent(in) :: x integer(8):: r r = -x return end function function test_unary_minus() result(r) implicit none integer(8) :: r r = (-15000000000000_8) - (-16000000000000_8) return end function end program lfortran-lfortran-2f73434/tests/fixedform_nestedloop_implicit.f0000664000175000017500000000020615141516316025253 0ustar alastairalastair 20 print *, 1 do k=1,10 do l=1,10 print*,k,l enddo enddo if(0>1) goto 20 end lfortran-lfortran-2f73434/tests/array2.f900000664000175000017500000000045415141516316020520 0ustar alastairalastairprogram array2 implicit none real, dimension(5) :: a, b integer, dimension(3) :: c logical, dimension(2) :: d real, dimension(2,3) :: e integer, dimension(3,4) :: f logical, dimension(5,2) :: g real, dimension(2,3,4) :: h integer, dimension(3,4,3) :: i logical, dimension(5,2,2) :: j end program lfortran-lfortran-2f73434/tests/multi_error1.f900000664000175000017500000000017015141516316021737 0ustar alastairalastairprogram multi_error1 integer :: x = integer :: z integer :: y = print *, x + print *, x y z = 1 print *, z end program lfortran-lfortran-2f73434/tests/modules1_module2.f900000664000175000017500000000054315141516316022477 0ustar alastairalastairmodule y use abc, only: t1 implicit none type :: t2 class(t1), allocatable :: val end type t2 contains subroutine sub(self) class(t2), intent(inout), target :: self ! TODO: Add one test for SubroutineCall as well if(self%val%f()) print *, 1 ! <---- Error end subroutine sub end module y lfortran-lfortran-2f73434/tests/global_scope4.f900000664000175000017500000000004115141516316022025 0ustar alastairalastairinteger :: x x = 6 x = x + 1 3*x lfortran-lfortran-2f73434/tests/implicit_check.f900000664000175000017500000000011715141516316022263 0ustar alastairalastair program main IMPLICIT DOUBLE PRECISION (A-H,O-Z) end program lfortran-lfortran-2f73434/tests/modules2_module_a.f900000664000175000017500000000067415141516316022723 0ustar alastairalastairmodule tomlf_type_value implicit none private public :: toml_value type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy end type toml_value abstract interface subroutine destroy(self) import toml_value class(toml_value), intent(inout) :: self end subroutine destroy end interface end module tomlf_type_value lfortran-lfortran-2f73434/tests/fn6.f900000664000175000017500000000513715141516316020014 0ustar alastairalastair! module fn6 ! interface str ! module procedure msg_scalar ! end interface str ! contains ! function msg_scalar(generic0, generic1, generic2, generic3, & ! & generica, genericb, genericc, genericd, & ! & sep) ! implicit none ! class(*), intent(in), optional :: generic0, generic1, generic2, generic3 ! class(*), intent(in), optional :: generica, genericb, genericc, genericd ! character(len=*), intent(in), optional :: sep ! character(len=:), allocatable :: sep_local ! character(len=:), allocatable :: msg_scalar ! character(len=4096) :: line ! integer :: istart ! integer :: increment ! if( present(sep) ) then ! sep_local = sep ! increment = len(sep_local)+1 ! else ! sep_local = ' ' ! increment = 2 ! end if ! istart = 1 ! line = '' ! if(present(generic0))call print_generic(generic0) ! if(present(generic1))call print_generic(generic1) ! if(present(generic2))call print_generic(generic2) ! if(present(generic3))call print_generic(generic3) ! if(present(generica))call print_generic(generica) ! if(present(genericb))call print_generic(genericb) ! if(present(genericc))call print_generic(genericc) ! if(present(genericd))call print_generic(genericd) ! msg_scalar = trim(line) ! contains ! subroutine print_generic(generic) ! class(*), intent(in) :: generic ! select type(generic) ! type is (integer(kind=1)); write(line(istart:),'(i0)') generic ! type is (integer(kind=2)); write(line(istart:),'(i0)') generic ! type is (integer(kind=4)); write(line(istart:),'(i0)') generic ! type is (integer(kind=8)); write(line(istart:),'(i0)') generic ! type is (real(kind=4)); write(line(istart:),'(1pg0)') generic ! type is (real(kind=8)) ! write(line(istart:), '(1pg0)') generic ! type is (logical) ! write(line(istart:), '(l1)') generic ! type is (character(len=*)) ! write(line(istart:), '(a)') trim(generic) ! type is (complex); write(line(istart:), '("(",1pg0,",",1pg0,")")') generic ! end select ! istart = len_trim(line)+increment ! line = trim(line)//sep_local ! end subroutine print_generic ! end function msg_scalar ! subroutine journal(where, g0, g1, g2, g3, ga, gb, gc, gd, sep) ! implicit none ! character(len=*), intent(in) :: where ! class(*), intent(in) :: g0 ! class(*), intent(in), optional :: g1, g2, g3 ! class(*), intent(in), optional :: ga, gb, gc, gd ! character(len=*), intent(in), optional :: sep ! write(*,'(a)') str(g0, g1, g2, g3, ga, gb, gc, gd, sep) ! end subroutine journal ! end module fn6 lfortran-lfortran-2f73434/tests/fmt1.f900000664000175000017500000000067015141516316020167 0ustar alastairalastairreal(kind=c_float) r real(c_float) r character(kind=c_char) c character(*) c character(len=*) c character(len=*, kind=c_char) c character(*, kind=c_char) c character(kind=c_char, len=*) c character(:) c character(len=:) c character(len=:, kind=c_char) c character(:, kind=c_char) c character(kind=c_char, len=:) c character(n) c character(len=n) c character(len=n, kind=c_char) c character(n, kind=c_char) c character(kind=c_char, len=n) c lfortran-lfortran-2f73434/tests/unlimited_polymorphic_intrinsic_type_allocate.f900000664000175000017500000000067415141516316030732 0ustar alastairalastairprogram unlimited_polymorphic_intrinsic_type_allocate implicit none class(*), allocatable :: var integer(8) :: x x = 10 allocate(var, source=x) select type(var) type is (integer(8)) print *, "integer(8)" type is (integer(4)) print *, "integer(4)" type is (real) print *, "real" class default print *, "default" end select end program unlimited_polymorphic_intrinsic_type_allocate lfortran-lfortran-2f73434/tests/complex3.f900000664000175000017500000000032415141516316021046 0ustar alastairalastairprogram complex3 complex*16 :: x complex(8) :: y complex*8 :: z complex(4) :: w x = (3.0_8, 4.0_8) print *, x y = (3.0_8, 4.0_8) print *, y z = (3.0_4, 4.0_4) print *, z w = (3.0_4, 4.0_4) print *, w end program lfortran-lfortran-2f73434/tests/assert.fpp0000664000175000017500000000020015141516316020775 0ustar alastairalastair#ifdef NDEBUG # define ASSERT(x) !! assert( x ) #else # define ASSERT(x) if(.not.(x)) call f90_assert(__FILE__,__LINE__) #endif lfortran-lfortran-2f73434/tests/implicit10.f900000664000175000017500000000050015141516316021263 0ustar alastairalastairinteger function a() implicit none integer :: b, c real :: d, e, f integer :: d1, e1, f1 real*8 :: g, h, i complex :: j, k complex*8 :: l, m complex *16 :: n double precision :: o, p integer :: Y(e1) real :: X(d1, e1, f1) Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 end function lfortran-lfortran-2f73434/tests/document_symbols1_module.f900000664000175000017500000000033215141516316024327 0ustar alastairalastairmodule module_document_symbols1 implicit none integer :: xy, yz contains subroutine sub() implicit none end subroutine subroutine sub2() implicit none end subroutine end module module_document_symbols1 lfortran-lfortran-2f73434/tests/expr3.f900000664000175000017500000000005315141516316020354 0ustar alastairalastair5 5+3 (5+3)*2 5+3*2 5-3 4**3 5 + 3 5 + 3 lfortran-lfortran-2f73434/tests/fixedform_subroutine.f0000664000175000017500000000050415141516316023405 0ustar alastairalastair subroutine f(a,b,c) print *,4 end subroutine integer k,l k=100 do 80 k=1,10 print*,k 80 continue if (k.le.10000) then print*,k else print*,k+1 do l=1,10 print*,"do" enddo endif end lfortran-lfortran-2f73434/tests/lookup_name3.f900000664000175000017500000000032715141516316021713 0ustar alastairalastairMODULE lookup_name3_module REAL, ALLOCATABLE, DIMENSION(:,:,:) :: ec CONTAINS SUBROUTINE sn_expcoeff( ndimen ) INTEGER, INTENT(IN) :: ndimen ec(:,1,5) = 1.0 END SUBROUTINE sn_expcoeff END MODULE lookup_name3_module lfortran-lfortran-2f73434/tests/preprocessor6.f900000664000175000017500000000241115141516316022127 0ustar alastairalastairprogram preprocessor6 ! Nested macros implicit none #define X 5 #define Y #ifdef X # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef X # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif ! ifndef #ifdef X # ifndef Y print *, "1a" # else print *, "1b" # endif #else # ifndef Y print *, "2a" # else print *, "2b" # endif #endif ! more nesting #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef Z print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # else print *, "1b" # endif print *, "1c" #else print *, "20" # ifdef Y print *, "20" # ifdef Z print *, "2aa" # else print *, "2ab" # endif print *, "2a" # else print *, "2b" # endif print *, "2c" #endif #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef X print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # endif print *, "1c" #endif end program lfortran-lfortran-2f73434/tests/invalidInput_float.txt0000664000175000017500000000001715141516316023367 0ustar alastairalastairWRONG TESTCASESlfortran-lfortran-2f73434/tests/expr7.f900000664000175000017500000000004315141516316020357 0ustar alastairalastair5_int32 5_int64 5_l 5__l_3 5__l_3_ lfortran-lfortran-2f73434/tests/format4.f900000664000175000017500000000007315141516316020671 0ustar alastairalastairprogram format4 print "(I0)",'int?' end program format4lfortran-lfortran-2f73434/tests/variable1.f900000664000175000017500000000015615141516316021165 0ustar alastairalastairsubroutine variable01(m, n) integer m,n complex x(m), y(n), p1, p2, p3, p4 call matveca(x,m,y,p1,p2,p3,p4) endlfortran-lfortran-2f73434/tests/implicit_interface5.f900000664000175000017500000000015615141516316023236 0ustar alastairalastairsubroutine implicit_interface5(a, b, n) integer, intent(in) :: n, a(n), b(n) call driver(a, b) end subroutine lfortran-lfortran-2f73434/tests/preprocessor7.f900000664000175000017500000000033615141516316022134 0ustar alastairalastairprogram preprocessor7 ! undef implicit none #define X #ifdef X print *, 1 #else print *, 2 #endif #undef X #ifdef X print *, 3 #else print *, 4 #endif #undef X #ifdef X print *, 3 #else print *, 4 #endif end program lfortran-lfortran-2f73434/tests/special_chars_json.f900000664000175000017500000000011715141516316023145 0ustar alastairalastairprogram special_chars_json ! A "comment". print *, "A ""string""." end lfortran-lfortran-2f73434/tests/format3.f900000664000175000017500000000127415141516316020674 0ustar alastairalastair! tests for 'EN' formatting program format3 ! standard positive values real :: num1, num2, num3, small_num4, under_power_10 ! standard negative values real :: neg_num1, small_neg_num4 real :: zero1 num1 = 12345.6789 num2 = 0.000123456789 num3 = 1234.5678 small_num4 = 0.000123456789 under_power_10 = 999.9999 neg_num1 = -1234.5678 small_neg_num4 = -0.000123456789 zero1 = 0.0 print '(EN12.4)', num1 print '(EN12.4)', num2 print '(EN10.4)', num3 print '(EN10.4)', small_num4 print '(EN10.4)', under_power_10 print '(EN12.4)', neg_num1 print '(EN15.5)', small_neg_num4 print '(EN10.4)', zero1 end program format3 lfortran-lfortran-2f73434/tests/allow_implicit_interface2.f900000664000175000017500000000010615141516316024424 0ustar alastairalastairsubroutine fdjac1(fcn, n, x, y) integer :: n, x, y call fcn(x, y) end lfortran-lfortran-2f73434/tests/interface3.f900000664000175000017500000000420615141516316021342 0ustar alastairalastairmodule interface3 implicit none !checks the syntax public :: x, y, z, assignment(=), operator(+), operator(.and.), operator(.in.) public :: operator(*) public :: operator(/) public :: operator(/ ) public :: operator(// ) interface module procedure sample end interface interface A module procedure :: sample end interface A INTERFACE ASSIGNMENT ( = ) SUBROUTINE LOGICAL_TO_NUMERIC (N, B) INTEGER, INTENT (OUT) :: N LOGICAL, INTENT (IN) :: B END SUBROUTINE LOGICAL_TO_NUMERIC END INTERFACE ASSIGNMENT ( = ) interface operator (+) module procedure union end interface operator (+) interface operator (-) module procedure difference end interface operator (-) interface operator (*) module procedure intersection end interface operator (*) interface operator ( / ) end interface operator ( / ) interface operator (/) end interface operator (/) interface operator (**) end interface operator (**) interface operator (==) end interface operator (==) interface operator (/=) end interface operator (/=) interface operator (>) end interface operator (>) interface operator (>=) end interface operator (>=) interface operator (<) end interface operator (<) interface operator (<=) module procedure subset end interface operator (<=) interface operator (.not.) end interface operator (.not.) interface operator (.and.) end interface operator (.and.) interface operator (.or.) end interface operator (.or.) interface operator (.eqv.) end interface operator (.eqv.) interface operator (.neqv.) end interface operator (.neqv.) abstract interface end interface public :: operator(//) interface operator (//) end interface operator (//) interface write(formatted) module procedure :: write_formatted end interface interface write(unformatted) module procedure :: write_unformatted end interface interface read(formatted) module procedure :: read_formatted end interface interface read(unformatted) module procedure :: read_unformatted end interface contains function f(operator) ! Currently parsed as an operator, but AST -> ASR phase can fix that: real, intent(in) :: operator (*) end function f end module lfortran-lfortran-2f73434/tests/parameter1.f900000664000175000017500000000024015141516316021352 0ustar alastairalastairsubroutine dcstep() double precision zero, p66, two, three, s parameter (zero=0.0d0,p66=0.66d0,two=2.0d0,three=3.0d0) s = max(abs(three),abs(two),abs(p66)) end lfortran-lfortran-2f73434/tests/format7.f900000664000175000017500000000024015141516316020670 0ustar alastairalastairmodule module_format7 character(len=10) :: a = '(es15.8e2)' end module program format7 use module_format7 print *, a print a, 1.0 end program lfortran-lfortran-2f73434/tests/nullify1.f900000664000175000017500000000013315141516316021055 0ustar alastairalastairprogram nullify1 ! Tests for syntax (AST) only: nullify(a) nullify(a, b, c, d) end program lfortran-lfortran-2f73434/tests/fixed_form_line_limit.f0000664000175000017500000000220515141516316023472 0ustar alastairalastairc 1 2 3 4 5 6 7 c 789012345678901234567890123456789012345678901234567890123456789012 program test <- int <- $eger a <- print *, "this is a test to see if the fixed form parser properly " <- that quote mark is in c73 $ignores text past column 72" print *, "test that we can still see the quote in the last column"<- print *, "test that we avoid double "" lookahead in col 73 "" print *, " end-of-line double """" c The next line only has text past column 72 00770402 c The next pattern is used to do continuations in code that is read c by both fixed-form AND free-form parsers a= & & 5 & & + 3 end program lfortran-lfortran-2f73434/tests/fixedform_doloop2.f0000664000175000017500000000041415141516316022564 0ustar alastairalastair program main integer k do k=1,10 print *, k end do do 80 k=1,10 print *, k 80 continue do 800 k=1,10 print *, k 800 continue do 8000 k=1,10 print *, k 8000 continue end program lfortran-lfortran-2f73434/tests/include2b.f900000664000175000017500000000004415141516316021162 0ustar alastairalastairinteger :: x x = (2+3)*5 print *, x lfortran-lfortran-2f73434/tests/save3.f900000664000175000017500000000006515141516316020337 0ustar alastairalastairsubroutine f() real :: var = 0.0 save end subroutine lfortran-lfortran-2f73434/tests/fixed_form3.f0000664000175000017500000000072715141516316021357 0ustar alastairalastair integerfunctionfunctionf(n) integerfunctionfunctionf(n) integern endfunctionfunctionf integerfunctionf(endfunctionf) integerendfunctionf endfunctionf=4 endfunctionf integerfunctiong(integerx) integerintegerx integerx integerx=5 x=5 integerx=5 endfunctiong integerfunctiong2(integerx) integerintegerx integer::x=5 x=5 integerx=5 endfunctiong2 lfortran-lfortran-2f73434/tests/constant_kinds.f900000664000175000017500000000052715141516316022342 0ustar alastairalastairprogram constant_kinds implicit none integer, parameter :: i1 = 1 integer, parameter :: i2 = 1_4 integer, parameter :: i3 = 1_8 real, parameter :: r1 = 1.0 real, parameter :: r2 = 1.d0 real, parameter :: r3 = 1.0_4 real, parameter :: r4 = 1.0_8 integer :: x real :: y y = 1.0 y = 1.d0 y = 1.0_4 y = 1.0_8 x = 1 x = 1_4 x = 1_8 end program lfortran-lfortran-2f73434/tests/subroutine3.f900000664000175000017500000000005115141516316021573 0ustar alastairalastairinteger function f() f = 42 end function lfortran-lfortran-2f73434/tests/preprocessor10.f900000664000175000017500000000244315141516316022207 0ustar alastairalastairprogram preprocessor10 ! #if implicit none #define X #define Y(x) 4*(x) #if defined(X) print *, "X is defined" #endif #if defined( Y ) print *, "Y is defined" #else print *, "Y is not defined" #endif #if defined(Z) print *, "Z is defined" #else print *, "Z is not defined" #endif #if defined(X) && defined(Y) print *, "X and Y is defined" #else print *, "X and Y is not defined" #endif #if defined(Z) && defined(Y) print *, "Z and Y is defined" #else print *, "Z and Y is not defined" #endif #if defined(Z) || defined(Y) print *, "Z or Y is defined" #else print *, "Z or Y is not defined" #endif #if defined(X) && defined(Y) && defined(Z) print *, "X and Y and Z is defined" #else print *, "X and Y and Z is not defined" #endif #if defined(X) && defined(Y) || defined(Z) print *, "X and Y or Z is defined" #else print *, "X and Y or Z is not defined" #endif #if defined(X) && \ defined(Y) || defined(Z) print *, "X and Y or Z is defined" #else print *, "X and Y or Z is not defined" #endif #if defined(X) && \ !defined(Y) || !defined(Z) print *, "X and !Y or !Z is defined" #else print *, "X and !Y or !Z is not defined" #endif #if defined(X) && \ !(defined(Y) || defined(Z)) print *, "X and !(Y or Z) is defined" #else print *, "X and !(Y or Z) is not defined" #endif end program lfortran-lfortran-2f73434/tests/global_scope2.f900000664000175000017500000000002315141516316022023 0ustar alastairalastairinteger :: x x = 6 lfortran-lfortran-2f73434/tests/optional_02.f900000664000175000017500000000045015141516316021442 0ustar alastairalastairmodule optional_02_m contains function f1(x) result(r) integer, optional, intent(in) :: x integer, allocatable :: r r = 0 end function f1 end module program optional_02 use optional_02_m integer, allocatable :: i i = 10 print *, f1(i) end program lfortran-lfortran-2f73434/tests/external_03.f900000664000175000017500000000027215141516316021442 0ustar alastairalastairsubroutine b() external f call a(f) end subroutine subroutine a(f) real r external f r = f(2.0) print *, r end subroutine program external_03 call b() end program lfortran-lfortran-2f73434/tests/write6.f900000664000175000017500000000021215141516316020530 0ustar alastairalastairprogram main write(*,'(I0.4)') 12345 write(*,'(I0.4)') 2 write(*,'(I0.3)') -3 write(*,'(A4,I0.2,A4)') "file", 4, ".txt" end program mainlfortran-lfortran-2f73434/tests/module_struct_global_separate_compilation_01.f900000664000175000017500000000045515141516316030314 0ustar alastairalastairmodule module_struct_global_separate_compilation_01 implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine set_targets(v) integer, intent(in) :: v targets%x = v end subroutine set_targets end module module_struct_global_separate_compilation_01 lfortran-lfortran-2f73434/tests/stop1.f900000664000175000017500000000127715141516316020372 0ustar alastairalastairprogram stop1 implicit none ! AST only(Syntax check) integer :: stop = 15 integer :: errstop = 25 if(stop /=15) then stop else if(errstop /=25) then error stop end if if(stop /=15) then stop "message" else if(errstop /=25) then error stop "message" end if if(stop /=15) then stop 0 else if(errstop /=25) then error stop 0 end if if(stop /=15) then stop, quiet = .true. else if(errstop /=25) then error stop, quiet = .true. end if if(stop /=15) then stop 1, quiet = .false. else if(errstop /=25) then error stop 1, quiet = .false. end if end program lfortran-lfortran-2f73434/tests/implicit_interface_allocatable_array.f900000664000175000017500000000032515141516316026670 0ustar alastairalastairsubroutine implicit_interface_allocatable_array implicit none real(4), dimension(:), allocatable :: r_g real(4), dimension(:), pointer :: r_t call sub1(1, r_g) call sub2(1, r_t) end subroutine lfortran-lfortran-2f73434/tests/integer_to_real_cast_in_comparison.f900000664000175000017500000000045615141516316026416 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) contains elemental real(dp) function dabs(x) result(r) real(dp), intent(in) :: x if (x > 0) then r = x else r = 0 - x end if end function dabs end program lfortran-lfortran-2f73434/tests/preprocessor22.f900000664000175000017500000000135315141516316022211 0ustar alastairalastair! this test program is almost the same as ! tests/preprocessor21.f90, except it defines ! value of some of the variables by using `#define` program preprocessor22 #define VAR1 1 #define VAR2 3 #if (!defined(VAR1) | !defined(VAR2)) print *, "Atleast one of VAR1 and VAR2 isn't defined" #else print *, 'Both VAR1 and VAR2 are defined.' #endif #define VAR3 4 #if (!defined(VAR3) & !defined(VAR4)) print *, "Neither of VAR3 or VAR4 is defined" #else print *, "At least one of VAR3 or VAR4 is defined." #endif #define VAR5 6 #if (!defined(VAR5) ^ !defined(VAR6)) print *, "Exactly one of VAR5 or VAR6 is not defined." #else print *, "Both VAR5 and VAR6 are defined or neither is defined." #endif end program preprocessor22 lfortran-lfortran-2f73434/tests/pragma2.f900000664000175000017500000000011115141516316020637 0ustar alastairalastairprogram pragma2 !LF$ attributes simd :: A real :: A(8) A = 1 end program lfortran-lfortran-2f73434/tests/global_scope8.f900000664000175000017500000000003015141516316022027 0ustar alastairalastairinteger(4) :: x x = 6 x lfortran-lfortran-2f73434/tests/preprocessor1.f900000664000175000017500000000016315141516316022124 0ustar alastairalastairprogram preprocessor1 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 print *, x, X123 end program lfortran-lfortran-2f73434/tests/implicit_typing3.f900000664000175000017500000000010115141516316022574 0ustar alastairalastairinteger function f(h, i, j) implicit real (j) f = 3 end function lfortran-lfortran-2f73434/tests/write7.f900000664000175000017500000000312615141516316020540 0ustar alastairalastair! NOTE: the commented out code can be used to test ! the GenericWrite ASR node end to end module write7_mod type :: person ! character(len=20) :: name ! integer :: age contains procedure, private :: pwf, pwunf generic :: write(formatted) => pwf generic :: write(unformatted) => pwunf end type person contains subroutine pwf(dtv, unit, iotype, vlist, iostat, iomsg) class(person), intent(in) :: dtv integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: vlist(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=9) :: pfmt ! WRITE(pfmt,'(A,I2,A,I2,A)') '(A', vlist(1), ',I', vlist(2), ')' ! WRITE(unit, FMT=pfmt, IOSTAT=iostat) dtv%name, dtv%age end subroutine subroutine pwunf(dtv, unit, iostat, iomsg) class(person), intent(in) :: dtv integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg ! write(unit, IOSTAT=iostat, IOMSG=iomsg) dtv%name, dtv%age ! if (iostat /= 0) then ! ! Optionally set iomsg if an error occurs ! iomsg = 'Error writing unformatted person data' ! end if end subroutine end module ! program write7 ! use write7_mod ! integer :: id, members ! type(person) :: chairman ! id = 1 ! members = 10 ! chairman%name = "John Doe" ! chairman%age = 45 ! WRITE(6, FMT="(I2, DT (15,6), I5)") id, chairman, members ! end program lfortran-lfortran-2f73434/tests/string2.f900000664000175000017500000000132215141516316020703 0ustar alastairalastairmodule fpm_filesystem use fpm_strings, only: f_string, string_t use iso_c_binding, only: c_ptr, c_associated implicit none public :: list_files contains recursive subroutine list_files() type(c_ptr) :: dir_handle type(c_ptr) :: dir_entry_c character(len=:), allocatable :: string_fortran do if (.not. c_associated(dir_entry_c)) then exit else string_fortran = f_string(dir_entry_c) end if end do end subroutine list_files function get_temp_filename() result(tempfile) character(:), allocatable :: tempfile character(len=1), pointer :: c_tempfile(:) tempfile = f_string(c_tempfile) end function get_temp_filename end module fpm_filesystem lfortran-lfortran-2f73434/tests/collect_occurence1.f900000664000175000017500000000027115141516316023051 0ustar alastairalastairsubroutine sub() integer :: abc print *, abc abc = 12 print *, abc+9 end subroutine program collection_occurence1 integer :: abc = 15 abc = abc - 9 print *, abc call sub() end program lfortran-lfortran-2f73434/tests/fixedform_return2.f0000664000175000017500000000036115141516316022610 0ustar alastairalastair subroutine f(a,b,c) print *, a go to 1 return 1 print *, b return end subroutine function g(a,b,c) print *, a go to 2 return 2 print *, b return end function lfortran-lfortran-2f73434/tests/fixed_form/0000775000175000017500000000000015141516316021117 5ustar alastairalastairlfortran-lfortran-2f73434/tests/fixed_form/end_label.f0000664000175000017500000000030315141516316023167 0ustar alastairalastair subroutine f() go to 1 1 end integer function h() h = 0 go to 1 1 end subroutine g() if (.true.) then go to 1 1 end if end lfortran-lfortran-2f73434/tests/fixed_form/block_data1.f0000664000175000017500000000004715141516316023433 0ustar alastairalastair block data block_data1 end lfortran-lfortran-2f73434/tests/fixed_form/real8_1.f0000664000175000017500000000005015141516316022514 0ustar alastairalastair real*8 function f() end lfortran-lfortran-2f73434/tests/fixed_form/crlf1.f0000664000175000017500000000005615141516316022276 0ustar alastairalastair PROGRAM p CALL f() END lfortran-lfortran-2f73434/tests/fixed_form/do1.f0000664000175000017500000000020015141516316021741 0ustar alastairalastair subroutine f() do 1 i=1,2 do 2 j=1,3 do 2 k=1,4 2 continue 1 continue end lfortran-lfortran-2f73434/tests/fixed_form/auxiliary_IO_1.f0000664000175000017500000000030615141516316024103 0ustar alastairalastair subroutine xub (nunit) integer nunit integer i do, i=1, 5 backspace nunit rewind nunit end do end program main end programlfortran-lfortran-2f73434/tests/fixed_form/call1.f0000664000175000017500000000030715141516316022262 0ustar alastairalastair program call1 integer callf call f() callf callf = 5 callf_s(3,2) callf_s(3,2) = 5 callf_s(3,2,f("(")) callf_s(3,2,f("(")) = 5 end program lfortran-lfortran-2f73434/tests/fixed_form/double_complex1.f0000664000175000017500000000012215141516316024343 0ustar alastairalastair program test_double_complex DOUBLE COMPLEX Y, ZWORK end program lfortran-lfortran-2f73434/tests/fixed_form/assign_to3.f0000664000175000017500000000036615141516316023344 0ustar alastairalastair program assign3 10 assign 30 to next 20 GO TO next,(30, 50, 70, 110) assign 50 to next assign 70 to next assign 110 to next 30 print *, 30 50 print *, 50 70 print *, 70 110 print *, 110 end program lfortran-lfortran-2f73434/tests/fixed_form/data1.f0000664000175000017500000000020215141516316022252 0ustar alastairalastair program test_data real(8) :: coef(10,1) DATA (coef(i,1),i=1,10)/1.0D0,2.0D0,3*3.0D0,5*4.0d0/ end program lfortran-lfortran-2f73434/tests/fixed_form/assign_to1.f0000664000175000017500000000010015141516316023324 0ustar alastairalastair program assign1 10 assign 10 to next end program lfortran-lfortran-2f73434/tests/fixed_form/contains1.f0000664000175000017500000000452215141516316023170 0ustar alastairalastairC Program to show 23 ways Fortran uses the asterisk. Comments at ends of * lines mark uses of *, as here: ! Comment line, * character in it. (1,2) C This program is valid Fortran 2018, but its fixed source form, alternate C return, and declaration beginning character* are all obsolescent. Class(*) C was new in f2003, unlimited format in F2008, and type(*) and rank(*) in C F2018. List-directed internal read, use of lower case, and comments that C begin with ! are its only other features that were not valid Fortran 77. program test23stars character:: b,c,d='?' integer j,k,n(2) data j,k/2*0/ ! repeated value in data (3) call input(n,'2*4',b,c,d,666)! repeated value in list-directed input, C ! alternate return (4,5) write(*,'(2i2,1x,a)') n(1)*j, ! default output unit ! multiply (6,7) * n(2)**k,b ! continuation line ! exponentiate (8,9) stop 666 print '(a)', ' * error in n' ! in non-comment character string (10) print '(*(i4))', n ! unlimited format item (11) contains subroutine input(n,a,b,c,d,r) ! dummy alternate return argument (12) integer,intent(out)::n(*) ! assumed-size array (13) character,intent(in)::a*(*) ! length selector ! assumed length C following variable name (14,15) character*(*),intent(out)::b ! length selector ! assumed length C following character keyword (16,17) type(*),intent(in)::c ! assumed-type (18) character(1),intent(in)::d(..) integer i character ch class(*),allocatable:: e(:) ! polymorphic entity (19) select rank (d) rank(*) ! rank selector (20) print "(a)",'This should not be printed!' end select read(a,*,iostat=i) n(1),n(2) ! list-directed internal read (21) if (i.ne.0) return 1 print '(a)', 'Enter anything to continue.' read(*,'(a)',iostat=i)ch ! default input unit (22) write(b,'(i1)',iostat=i)666 ! writes '*' as 666 won't fit in i1 (23) end subroutine input end program test23stars lfortran-lfortran-2f73434/tests/fixed_form/assign1.f0000664000175000017500000000010015141516316022622 0ustar alastairalastair program assign1 10 assign 30 to next end program lfortran-lfortran-2f73434/tests/fixed_form/use1.f0000664000175000017500000000033515141516316022144 0ustar alastairalastair subroutine f() use iso_c_binding, only: c_loc, c_f_pointer print *, "OK" end integer function g() use iso_c_binding, only: c_loc, c_f_pointer print *, "OK" g = 5 end lfortran-lfortran-2f73434/tests/fixed_form/error_stop1.f0000664000175000017500000000006015141516316023541 0ustar alastairalastair subroutine f() error stop end lfortran-lfortran-2f73434/tests/fixed_form/else1.f0000664000175000017500000000072515141516316022303 0ustar alastairalastair subroutine fun1() IF (ABS(BJV0).GT.ABS(BJV1)) CS=BJV0/F ELSE CS=BJV1/F2 end subroutine subroutine fun2() if (.true.) then x = 1 IF (ABS(BJV0).GT.ABS(BJV1)) CS=BJV0/F ELSE CS=BJV1/F2 end if end subroutine subroutine fun3() if (.true.) then x = 1 IF (ABS(BJV0).GT.ABS(BJV1)) THEN CS=BJV0/F ELSE CS=BJV1/F2 END IF end if end subroutine lfortran-lfortran-2f73434/tests/fixed_form/error_stop2.f0000664000175000017500000000013015141516316023540 0ustar alastairalastair subroutine f() if (.true.) then error stop end if end lfortran-lfortran-2f73434/tests/fixed_form/assign_to2.f0000664000175000017500000000021115141516316023330 0ustar alastairalastair program assign2 100 if (0<1) assign 101 to k go to k, (100,101) print *, "no" 101 print *, "yes" end program lfortran-lfortran-2f73434/tests/fixed_form/do2.f0000664000175000017500000000011515141516316021747 0ustar alastairalastair subroutine g() do i=1,2 go to 1 1 end do end lfortran-lfortran-2f73434/tests/fixed_form/while_02_fixed_form.f0000664000175000017500000000124115141516316025077 0ustar alastairalastair program while_02 implicit none integer :: i, j i = 0 j = 0 do while (i < 10) i = i + 1 j = j + i end do if (j /= 55) error stop if (i /= 10) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) exit j = j + i end do if (j /= 1) error stop if (i /= 2) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) cycle j = j + i end do if (j /= 53) error stop if (i /= 10) error stop end lfortran-lfortran-2f73434/tests/fixed_form/include1.f0000664000175000017500000000015015141516316022766 0ustar alastairalastair include "do1.f" include "do2.f" program main call f() end program lfortran-lfortran-2f73434/tests/collect_occurence3.f900000664000175000017500000000015415141516316023053 0ustar alastairalastairreal function xyz() print *, "abc" xyz = 1.0 end function xyz program main print *, xyz() end program main lfortran-lfortran-2f73434/tests/print5.f900000664000175000017500000000021715141516316020536 0ustar alastairalastairprogram print5 implicit none character(len=:), allocatable :: s s = 'ABC' // achar(0) // 'XYZ' print *, s end program print5 lfortran-lfortran-2f73434/tests/block2.f900000664000175000017500000000040615141516316020471 0ustar alastairalastairsubroutine hybrd() implicit none real :: ratio, delta interface subroutine fcn(n) integer, intent(in) :: n end subroutine fcn end interface main : block delta = abs(ratio) end block main end subroutine lfortran-lfortran-2f73434/tests/modules_01.f900000664000175000017500000000564515141516316021277 0ustar alastairalastairmodule bsplines use types, only: dp use lapack, only: dgesv, dgbsv use utils, only: stop_error implicit none private public bspline, bspline_der, bspline_der2 contains pure recursive function bspline(t, i, k, r) result(B) ! Returns values of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then if ((t(size(t)) - t(i+1)) < tiny(1._dp) .and. & (t(i+1) - t(i)) > tiny(1._dp)) then ! If this is the last non-zero knot span, include the right end point, ! to ensure that the last basis function goes to 1. where (t(i) <= r .and. r <= t(i+1)) B = 1 else where B = 0 end where else ! Otherwise exclude the right end point where (t(i) <= r .and. r < t(i+1)) B = 1 else where B = 0 end where end if else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (r-t(i)) / (t(i+k-1)-t(i)) * bspline(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B + (t(i+k)-r) / (t(i+k)-t(i+1)) * bspline(t, i+1, k-1, r) end if end if end function pure function bspline_der(t, i, k, r) result(B) ! Returns values of a derivative of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then B = 0 else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (k-1) / (t(i+k-1)-t(i)) * bspline(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B - (k-1) / (t(i+k)-t(i+1)) * bspline(t, i+1, k-1, r) end if end if end function pure function bspline_der2(t, i, k, r) result(B) ! Returns values of a second derivative of a B-spline. ! There are set of `n` B-splines of order `k`. The mesh is composed of `n+k` ! knots, stored in the t(:) array. real(dp), intent(in) :: t(:) ! {t_i}, i = 1, 2, ..., n+k integer, intent(in) :: i ! i = 1..n ? integer, intent(in) :: k ! Order of the spline k = 1, 2, 3, ... real(dp), intent(in) :: r(:) ! points to evaluate the spline at real(dp) :: B(size(r)) if (k == 1) then B = 0 else B = 0 if (t(i+k-1)-t(i) > tiny(1._dp)) then B = B + (k-1) / (t(i+k-1)-t(i)) * bspline_der(t, i, k-1, r) end if if (t(i+k)-t(i+1) > tiny(1._dp)) then B = B - (k-1) / (t(i+k)-t(i+1)) * bspline_der(t, i+1, k-1, r) end if end if end function end module lfortran-lfortran-2f73434/tests/real_to_integer_cast_fortran_codegen.f900000664000175000017500000000060515141516316026711 0ustar alastairalastairprogram ImplicitRealToIntCastExample implicit none real :: realNumber integer :: integerValue ! Assign a real number realNumber = 3.14 ! Perform an implicit real to integer cast integerValue = realNumber ! Output the result print *, "Real Number:", realNumber print *, "Integer Value:", integerValue end program ImplicitRealToIntCastExample lfortran-lfortran-2f73434/tests/arrayelements1.f900000664000175000017500000000226515141516316022256 0ustar alastairalastairmodule my_subs implicit none interface my_sum module procedure sum_real, sum_int end interface my_sum contains subroutine sum_real (array, tot) real, dimension(:), intent (in) :: array real, intent (out) :: tot integer :: i tot = 1.0 do i=1, size (array) tot = tot * array (i) end do end subroutine sum_real subroutine sum_int (array, tot) integer, dimension(:), intent (in) :: array integer, intent (out) :: tot integer :: i tot = 0 do i=1, size (array) tot = tot + array (i) end do end subroutine sum_int end module my_subs program test_dt use my_subs implicit none type my_type integer weight real length end type my_type type (my_type), dimension (:), allocatable :: people type (my_type) :: answer allocate (people (2)) people (1) % weight = 1 people (1) % length = 1.0 people (2) % weight = 2 people (2) % length = 2.0 call my_sum ( people (:) % weight, answer % weight ) write (*, *) answer % weight call my_sum ( people (:) % length, answer % length ) write (*, *) answer % length end program test_dt lfortran-lfortran-2f73434/tests/pragma1.f900000664000175000017500000000126415141516316020650 0ustar alastairalastairsubroutine a1(n, A, B) integer, intent(in) :: n real, intent(in) :: A(n) real, intent(out) :: B(n) integer :: i !$OMP PARALLEL DO do i = 2, N B(i) = (A(i) + A(i-1)) / 2 end do !$OMP END PARALLEL DO end subroutine subroutine parallel_sum(n, a) integer, intent(in) :: n integer, intent(in) :: a(:) integer :: partial_sum, total_sum, i partial_sum = 0 total_sum = 0 !$omp parallel private(partial_sum) shared(total_sum) !$omp do do i = 1, n partial_sum = partial_sum + a(i) end do !$omp end do ! TODO: ! !$omp critical ! total_sum = total_sum + partial_sum ! !$omp end critical !$omp end parallel end subroutine lfortran-lfortran-2f73434/tests/dimension_attr2.f900000664000175000017500000000010115141516316022406 0ustar alastairalastairinteger function f(x) dimension x(3) dimension y(3) end function lfortran-lfortran-2f73434/tests/stdin_read_blank_lines_01.f900000664000175000017500000000062415141516316024274 0ustar alastairalastairprogram stdin_read_blank_lines_01 implicit none integer :: i integer :: m integer :: n integer, parameter :: expected_m(2) = [10, 20] integer, parameter :: expected_n(2) = [5, 10] do i = 1, 2 read(*, *) m read(*, *) n if (m /= expected_m(i)) error stop 1 if (n /= expected_n(i)) error stop 1 end do end program stdin_read_blank_lines_01 lfortran-lfortran-2f73434/tests/fixedform_subroutine2.f0000664000175000017500000000037315141516316023473 0ustar alastairalastair PROGRAM SUBR2 CALL MY_SUBR() END SUBROUTINE MY_SUBR() PRINT *, SXVALS() IF (SXVALS() /= 4) ERROR STOP RETURN CONTAINS INTEGER FUNCTION SXVALS() SXVALS = 4 RETURN END END lfortran-lfortran-2f73434/tests/modules2.f900000664000175000017500000000136215141516316021051 0ustar alastairalastairmodule tomlf_type_array use tomlf_type_value, only : toml_value use tomlf_structure, only : toml_ordered implicit none type, extends(toml_value) :: toml_array class(toml_ordered), allocatable :: list contains procedure :: destroy end type toml_array interface new module procedure :: new_array end interface contains subroutine destroy(self) class(toml_array), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%list)) then call self%list%destroy deallocate(self%list) end if end subroutine destroy subroutine new_array(self) type(toml_array), intent(out) :: self end subroutine new_array end module tomlf_type_array lfortran-lfortran-2f73434/tests/string.f900000664000175000017500000000070115141516316020621 0ustar alastairalastairprogram string implicit none character(50) :: str str = "Hi, I'm using string" str = 'Use "Double" "quote"' str = "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" str = 'random'' a"b''cd""fg""hij"kl"mno"p"qr"s''' str = """equal''" str = '"Double" ''Quote''' str = "'Single' ""Quote""" print *, "Hi, I'm using string" print *, 'This is a "sting"' print *, "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" end program lfortran-lfortran-2f73434/tests/array13.f900000664000175000017500000000014515141516316020577 0ustar alastairalastairprogram array13 implicit none integer, dimension(5) :: numbers = [5, 4, 2, 1, 3] end program lfortran-lfortran-2f73434/tests/optional_03.f900000664000175000017500000000070215141516316021443 0ustar alastairalastairmodule optional_03_m contains subroutine my_sub(a) integer, intent(in) :: a print *, "a =", a end subroutine my_sub function f1(x) result(r) integer, optional, intent(in) :: x integer, allocatable :: r r = 0 end function f1 end module program optional_03 use optional_03_m integer, allocatable :: i i = 10 ! Fails for NUM_TRIES < 4 call my_sub(f1(f1(f1(i)))) end program lfortran-lfortran-2f73434/tests/do_concurrent_reduce.f900000664000175000017500000000027215141516316023511 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(+: s) s = s + a(i) end do end subroutine lfortran-lfortran-2f73434/tests/implicit11.f900000664000175000017500000000041615141516316021272 0ustar alastairalastairinteger function f1(z,i) implicit complex*16 (z,i) z = 5 print *, dimag(z), dimag(i) end function subroutine f2(z,i) implicit complex*16 (z,i) z = 5 ! Does not yet work due to: https://github.com/lfortran/lfortran/issues/894 !print *, dimag(z), dimag(i) end subroutine lfortran-lfortran-2f73434/tests/print4.f900000664000175000017500000000245615141516316020544 0ustar alastairalastair! Try lots of different print statements program print_07 integer(8) :: ii1 integer :: ii2 integer :: ii3 real(8) :: rr real(4) :: rr2 logical :: ll logical :: ll_arr(10) integer,allocatable :: arr(:) integer, allocatable :: aarr(:) character :: arr2(10) integer(8) :: arr23(10) character(:), allocatable :: str character(10) :: str2 character(5) :: ssss(10) complex :: cc allocate(aarr(10)) allocate(arr(10)) ssss = "medoo" ii1 = 20000000000000000_8 ii2 = 22 ii3 = 33 rr = 10.3_8 rr2 = 10.3 ll = .false. arr = 1 arr(1) = 33 arr2 = 's' print *, ii1, ii2, ii3, ll str = "HelloLFortran" str2 = "HelloLCompilers" arr23 = 1 cc = complex(2,3) ll_arr = .true. ll_arr(10) = .false. aarr = 1 print *,aarr print *, cc print *, arr23 print "(a,2x,a,3x,a)", str, str, str print "(a,2x,a,3x,a)", str2 print "(i0)", ii1 ,ii1, ii1 print *,str print *, str,str print "(A3)", ssss print *, ii2 print *, rr print *, ll_arr print *, rr2 print *, ll print *, 232 print *, "string", "string" PRINT "(I0, 2X , I0)", arr23 print *,arr23 print *, arr print *, "here" print *, str, str print "(l)", ll end programlfortran-lfortran-2f73434/tests/external5.f900000664000175000017500000000010415141516316021217 0ustar alastairalastairsubroutine ddet_c() end subroutine ddet_r() external ddet_c end lfortran-lfortran-2f73434/tests/do5.f900000664000175000017500000000042315141516316020003 0ustar alastairalastairprogram do5 implicit none integer :: i, j, k, enddo j = 0 do 15 i = 1, 5 15 j = j + i j = 0 do 16 i = 1, 5 16 enddo = 5 j = 0 do 20 i = 1, 6, 2 20 j = j + i k = 0 do 30 i = 1, 5 do 35 j = 1, 5 31 continue 35 k = k + 1 33 continue 30 k = k + 1 40 continue end program lfortran-lfortran-2f73434/tests/preprocessor3.h0000664000175000017500000000016315141516316021757 0ustar alastairalastair#define X123 12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123+B123 integer :: x, y lfortran-lfortran-2f73434/tests/derived_type1.f900000664000175000017500000000064215141516316022063 0ustar alastairalastairmodule derived_type1 implicit none integer, public, parameter :: tfc = selected_char_kind('DEFAULT') type enum_escape character(len=1, kind=tfc) :: newline = achar(10, kind=tfc) end type enum_escape type(enum_escape), public, parameter :: toml_escape = enum_escape() character(kind=tfc, len=*), public, parameter :: nl = & &' '//toml_escape%newline end module derived_type1 lfortran-lfortran-2f73434/tests/dependency_test_03.f900000664000175000017500000000010415141516316022767 0ustar alastairalastairmodule m_cli2_user use m_cli2 implicit none end module m_cli2_user lfortran-lfortran-2f73434/tests/interactive_parse_without_program_line.f900000664000175000017500000000100715141516316027343 0ustar alastairalastairinteger, allocatable :: a(:) integer, pointer :: p allocate(a(10)) deallocate(a) open(unit=10, file="test.txt", status="old") flush(10) close(unit=10) nullify(p) exit cycle return continue print *, exit print *, cycle print *, return print *, continue call exit call cycle call return call continue contains subroutine sub integer :: i do i = 1, 10 print *, i if (i == 5) exit if (i == 7) cycle if (i == 9) return if (i == 2) continue end do end subroutine end program lfortran-lfortran-2f73434/tests/derived_types_04.f900000664000175000017500000000604715141516316022475 0ustar alastairalastairmodule tomlf_datetime implicit none private public :: toml_datetime, toml_time, toml_date !> TOML time value (HH:MM:SS.sssssZ...) type :: toml_time integer :: hour = 0 integer :: minute = 0 integer :: second = 0 integer, allocatable :: millisec character(len=:), allocatable :: zone contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => time_to_string end type interface toml_time module procedure :: new_toml_time end interface toml_time !> TOML date value (YYYY-MM-DD) type :: toml_date integer :: year = 0 integer :: month = 0 integer :: day = 0 contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => date_to_string end type !> TOML datatime value type type :: toml_datetime type(toml_date), allocatable :: date type(toml_time), allocatable :: time contains generic :: assignment(=) => to_string procedure, pass(rhs) :: to_string => datetime_to_string end type contains subroutine date_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_date), intent(in) :: rhs allocate(character(len=10) :: lhs) write(lhs, '(i4.4,"-",i2.2,"-",i2.2)') & & rhs%year, rhs%month, rhs%day end subroutine date_to_string subroutine time_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_time), intent(in) :: rhs if (allocated(rhs%millisec)) then allocate(character(len=12) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2,".",i3.3)') & & rhs%hour, rhs%minute, rhs%second, rhs%millisec else allocate(character(len=8) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2)') & & rhs%hour, rhs%minute, rhs%second end if if (allocated(rhs%zone)) lhs = lhs // trim(rhs%zone) end subroutine time_to_string subroutine datetime_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_datetime), intent(in) :: rhs character(len=:), allocatable :: temporary if (allocated(rhs%date)) then call rhs%date%to_string(lhs) if (allocated(rhs%time)) then call rhs%time%to_string(temporary) lhs = lhs // temporary end if else if (allocated(rhs%time)) lhs = rhs%time end if end subroutine datetime_to_string !> Constructor for toml_time type, necessary due to PGI bug in NVHPC 20.7 and 20.9 elemental function new_toml_time(hour, minute, second, millisec, zone) & & result(self) integer, intent(in), optional :: hour integer, intent(in), optional :: minute integer, intent(in), optional :: second integer, intent(in), optional :: millisec character(len=*), intent(in), optional :: zone type(toml_time) :: self if (present(hour)) self%hour = hour if (present(minute)) self%minute = minute if (present(second)) self%second = second if (present(millisec)) self%millisec = millisec if (present(zone)) self%zone = zone end function new_toml_time end module tomlf_datetime lfortran-lfortran-2f73434/tests/allow_implicit_interface.f900000664000175000017500000000043515141516316024347 0ustar alastairalastairdouble precision function prho() double precision zero, one, two, b, x, y, u, six data zero, one, two, six /0.0d0, 1.0d0, 2.0d0, 6.0d0/ prho = u / exp(y / two) + alnorm(x, .true.) external dgetrf call dgetrf(x, y, u) if (prho < zero) prho = zero if (prho > one) prho = one return end lfortran-lfortran-2f73434/tests/reference/0000775000175000017500000000000015141516316020733 5ustar alastairalastairlfortran-lfortran-2f73434/tests/reference/asr-logical4-72c2657.json0000664000175000017500000000074215141516316025027 0ustar alastairalastair{ "basename": "asr-logical4-72c2657", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "asr-logical4-72c2657.stdout", "stdout_hash": "2a6097e5388676caea662fcbd781702e59d9ee449220ae4ca84dcb83", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-write1-6827691.stdout0000664000175000017500000000144315141516316025523 0ustar alastairalastairprogram write_01 implicit none write(*, *) "a", 2 write(*, *) write(*) a write(out_str, '(" Found index ", i9," but item is not in list.")') index write(out_string, *) "Scalar_in = ", scalar_in write(out_string, 10) int_src, int_given, int_expected write(string, fmt="(f6.2)") max_angle write(fmt, '("(i",i0,".",i0,")")') n, n write(unit=*, fmt="(a)") trim(prog) // ": " // message write(unit=0, fmt="(a,i4.4)") "Assertion failed at " // file // ":", line write(*, fmt="(a,l1)") "exactly_conservative= ", exactly_conservative write(unit=lun) vec write(*, "(a,a)", advance="no") trim(input_string), ": " write(ounit, FMT=303, ADVANCE="NO") write(*, 201) (star, i = 1, 80) write(*, "(1X,A)") "Success!" write(ounit, *) print *, "2" print * print "(a, es22.14)", "Ekin: ", Ekin end program write_01 lfortran-lfortran-2f73434/tests/reference/asr-allocate_05-48fb994.stdout0000664000175000017500000001345215141516316026066 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_05: (Program (SymbolTable 2 { num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 2 string [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) allocate_05 [] [(Allocate [((Var 2 string) [] (IntegerConstant 3 (Integer 4) Decimal) () ())] () () () ) (Assignment (Var 2 num) (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 string) (Var 2 num) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (StringSection (Var 2 string) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 2 string) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 2 string) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Var 2 num) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "abc" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutine4-a425266.stdout0000664000175000017500000002324115141516316026156 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { triad: (Function (SymbolTable 2 { a: (Variable 2 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Out () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), scalar: (Variable 2 scalar [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) triad (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Real 4) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(Assignment (Var 2 n) (ArraySize (Var 2 a) () (Integer 4) () ) () .false. .false. ) (DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ())] [] [] [] [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Add (RealBinOp (Var 2 scalar) Mul (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-nullify_02-1c6befe.json0000664000175000017500000000075015141516316025611 0ustar alastairalastair{ "basename": "ast-nullify_02-1c6befe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify_02-1c6befe.stdout", "stdout_hash": "c34ed265adbd8eec2c077ab39fec677bcdf6a74575ee04339cd7ad87", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_type_01-d480dc4.json0000664000175000017500000000075115141516316026447 0ustar alastairalastair{ "basename": "asr-derived_type_01-d480dc4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_01.f90", "infile_hash": "74c9f7ee5dfaf581b24988b384a68b11d6023d84b46344260436f624", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_01-d480dc4.stderr", "stderr_hash": "d6731b078923ba1abe7454042289cdb0c47c5c22f7acb516b02d7d3f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-implicit8-03c7a90.json0000664000175000017500000000072015141516316025276 0ustar alastairalastair{ "basename": "asr-implicit8-03c7a90", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit8.f90", "infile_hash": "5ab8320f5bd93962cbba1babe7f4f17779af2d5575f625095988f4d8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit8-03c7a90.stderr", "stderr_hash": "6990d3cbec523ef3460ff0c8eeeb96a68cf69b77a943bd72383a7895", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-assign_to1-e0b6dcb.json0000664000175000017500000000075115141516316025670 0ustar alastairalastair{ "basename": "ast-assign_to1-e0b6dcb", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to1.f", "infile_hash": "9dbe8770330acd15438625f1425b45ce1f593b85ba08bc96601b1ddd", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to1-e0b6dcb.stdout", "stdout_hash": "875a120cceb0cdf1fba755f101bf72b2be5e73c537a021c671587708", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_int-3ed778d.json0000664000175000017500000000075415141516316027016 0ustar alastairalastair{ "basename": "asr-kind_star_of_int-3ed778d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_int.f90", "infile_hash": "3abc16b6b262878a30ddb8a43eba007396a3a42b61d3c01340922b6b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_int-3ed778d.stderr", "stderr_hash": "4b09ff95a79239ed54dc548fef6cdabe3d5d6ccd9a88854b2fd3218b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_array_04-ed63449.json0000664000175000017500000000077515141516316026736 0ustar alastairalastair{ "basename": "asr-template_array_04-ed63449", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_04.f90", "infile_hash": "4baecd1a31a51c75bc2200f740db7ffb3605fff739876acd7ca4b65b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_04-ed63449.stdout", "stdout_hash": "d942663cf1500a7cdd19611b88eca6a68ce5af7094904b87f1e636e5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-callback_02-aec5457.stdout0000664000175000017500000007537215141516316026110 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { callback_02: (Module (SymbolTable 2 { cb: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 4 { res: (Variable 4 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4) (Real 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 res)] [] () Public .false. .false. () ), res: (Variable 3 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cb (FunctionType [(Real 4) (Real 4) (Real 4) (FunctionType [(Real 4) (Real 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] () .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] () .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4) () ) Mul (Var 3 res) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 3 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), foo: (Function (SymbolTable 5 { c: (Variable 5 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 5 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 6 { res: (Variable 6 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 res)] [(Assignment (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (Var 6 x) (Real 4) () ) () .false. .false. )] () Public .false. .false. () ), foo: (Variable 5 foo [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 5 res [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) foo (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cb] [(Var 5 c) (Var 5 d) (Var 5 res)] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] () .false. ) (Assignment (Var 5 foo) (Var 5 res) () .false. .false. )] (Var 5 foo) Public .false. .false. () ) }) callback_02 () [] .false. .false. .false. ), main: (Program (SymbolTable 7 { cb: (ExternalSymbol 7 cb 2 cb callback_02 [] cb Public ), foo: (ExternalSymbol 7 foo 2 foo callback_02 [] foo Public ), res: (Variable 7 res [] Local (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [callback_02] [(Assignment (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((Var 7 res))] (Real 4) () () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutine9-60500c5.stdout0000664000175000017500000000062515141516316026635 0ustar alastairalastairsubroutine a() import, none implicit none end subroutine a subroutine b() import, all implicit none end subroutine b subroutine c() import :: a, b implicit none end subroutine c subroutine d() import :: a, b implicit none end subroutine d subroutine e() import, only: a, b implicit none end subroutine e subroutine f() import :: a, b import :: c import :: d, e, f implicit none end subroutine f lfortran-lfortran-2f73434/tests/reference/ast_f90-allocate_01-df1748d.stdout0000664000175000017500000000044715141516316026612 0ustar alastairalastairprogram hello implicit none character(len=:), allocatable :: cmd integer :: cmdlen integer :: ierr call get_command(length=cmdlen) if (cmdlen > 0) then allocate(character(cmdlen)::cmd) call get_command(cmd) print *, "hello ", cmd end if deallocate(cmd, stat=ierr) end program hello lfortran-lfortran-2f73434/tests/reference/asr-character_03-a7476e8.stdout0000664000175000017500000000404215141516316026223 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_03: (Program (SymbolTable 2 { str: (Variable 2 str [] Local () () Default (String 1 (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) character_03 [] [(Assignment (Var 2 str) (StringConstant "hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (Var 2 str) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-external3-2aafcb3.json0000664000175000017500000000076715141516316025527 0ustar alastairalastair{ "basename": "asr-external3-2aafcb3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external3.f90", "infile_hash": "54099789ee8d301435db8814db171bc443101af05d6cb268f45fd815", "outfile": null, "outfile_hash": null, "stdout": "asr-external3-2aafcb3.stdout", "stdout_hash": "44d94af76caaaf2910ef39e7259e10673f96196a23cacb0fdb045d93", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-continue_body_if_loop-406ed85.stdout0000664000175000017500000000436115141516316030335 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(u [] [] () () None ()) (s [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(u [(1 100 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () )] [(Assignment 0 s (Real "0.0") () ) (DoLoop 0 () 1 j 1 100 () [(Assignment 0 s (+ s (FuncCallOrArray u [] [(() j () 0)] [] [] [] )) () ) (If 0 () (>= s 1000000) [(GoTo 0 () 2 [] () )] [] () () () ) (Continue 1 () )] () () ) (Stop 0 () () () ) (Continue 2 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutine3-952da2b.json0000664000175000017500000000071715141516316026265 0ustar alastairalastair{ "basename": "julia-subroutine3-952da2b", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine3-952da2b.stdout", "stdout_hash": "ce1171ffded74d916e60a8a0d1543285b051d49f34ef15b64c0810f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-integer16-eab0df9.json0000664000175000017500000000072715141516316025435 0ustar alastairalastair{ "basename": "ast-integer16-eab0df9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/integer16.f90", "infile_hash": "baf6d6f3f106302b5334bdba9d405160f52d531ac537d6268cc984fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-integer16-eab0df9.stderr", "stderr_hash": "dc07b98205e0d06bb0c8691f4c1f3888b088c8c43f984be4fe7ea2f0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_call3-8c7b642.json0000664000175000017500000000100515141516316026602 0ustar alastairalastair{ "basename": "asr-fixed_form_call3-8c7b642", "cmd": "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_call3.f", "infile_hash": "d0980dc66f3d039f2f11de3b1dbb87c3c5e2db5a8ddcdcb480adfb6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-fixed_form_call3-8c7b642.stderr", "stderr_hash": "ab1a497605476706e39b3a5cf0f850464574fd18ca9b34c4e74c999b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-global_scope2-181c327.stdout0000664000175000017500000000050515141516316026405 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Assignment 0 x 6 () )] ) lfortran-lfortran-2f73434/tests/reference/ast_indent-subroutine1-fdc40b3.json0000664000175000017500000000074415141516316027364 0ustar alastairalastair{ "basename": "ast_indent-subroutine1-fdc40b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "ast_indent-subroutine1-fdc40b3.stdout", "stdout_hash": "522465bcf29ea6cee23fd91313c1d21c73a291d11690341df76680ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_24-257ddde.stdout0000664000175000017500000000072415141516316025735 0ustar alastairalastairtest: 1.0000 0.33333333333333331 12346. 0.12345669999999999E-7 123456789012345.00 1.2345678901234560 -42.000000000000000 0.0000000000000000 42 -1000 T F Hello G format! 1.2300000000000000 -4.5599999999999996 1.10000000000000012.20000000000000023.2999999999999998 0.12345678901234501E+19 -0.12345678901234500E+22 0.1234000E-4 1.000000 1.230000 1234568. 0.1234000E-03 1234568. 1.000000 1.230000 1234568. 0.1234000E-03 lfortran-lfortran-2f73434/tests/reference/asr-intrinsics8-6c1e53e.stderr0000664000175000017500000000024415141516316026271 0ustar alastairalastairsemantic error: Kind of all the arguments of Ior must be the same --> tests/errors/intrinsics8.f90:4:14 | 4 | print *, ior(x, y) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-string_01-bda4726.json0000664000175000017500000000074515141516316025274 0ustar alastairalastair{ "basename": "asr-string_01-bda4726", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "asr-string_01-bda4726.stdout", "stdout_hash": "e70a50429a359ff09ea2045ab84d22bfb1e1464a0bfd7e824379a4dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_float_of_int-4b9cf53.stderr0000664000175000017500000000032615141516316027471 0ustar alastairalastairsemantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/kind_float_of_int.f90:3:13 | 3 | integer(4.2) :: x | ^^^ lfortran-lfortran-2f73434/tests/reference/llvm-case_01-09dad75.stdout0000664000175000017500000002126115141516316025437 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [1 x i8] c"1" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data, i32 0, i32 0), i64 1 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [1 x i8] c"2" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [1 x i8] c"3" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.3, i32 0, i32 0), i64 1 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [1 x i8] c"4" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.5, i32 0, i32 0), i64 1 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [1 x i8] c"1" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.7, i32 0, i32 0), i64 1 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [5 x i8] c"2,3,4" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.9, i32 0, i32 0), i64 5 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i64, align 8 %out = alloca i64, align 8 store i64 4, i64* %i, align 4 %2 = load i64, i64* %i, align 4 %3 = icmp eq i64 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i64 10, i64* %out, align 4 %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %4, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont9 else: ; preds = %.entry %5 = load i64, i64* %i, align 4 %6 = icmp eq i64 %5, 2 br i1 %6, label %then1, label %else2 then1: ; preds = %else store i64 20, i64* %out, align 4 %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont8 else2: ; preds = %else %8 = load i64, i64* %i, align 4 %9 = icmp eq i64 %8, 3 br i1 %9, label %then3, label %else4 then3: ; preds = %else2 store i64 30, i64* %out, align 4 %10 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %10, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont7 else4: ; preds = %else2 %11 = load i64, i64* %i, align 4 %12 = icmp eq i64 %11, 4 br i1 %12, label %then5, label %else6 then5: ; preds = %else4 store i64 40, i64* %out, align 4 %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %13, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont else6: ; preds = %else4 br label %ifcont ifcont: ; preds = %else6, %then5 br label %ifcont7 ifcont7: ; preds = %ifcont, %then3 br label %ifcont8 ifcont8: ; preds = %ifcont7, %then1 br label %ifcont9 ifcont9: ; preds = %ifcont8, %then %14 = load i64, i64* %out, align 4 %15 = icmp ne i64 %14, 40 br i1 %15, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %16 = load i64, i64* %i, align 4 %17 = icmp eq i64 %16, 1 br i1 %17, label %then13, label %else14 then13: ; preds = %ifcont12 store i64 11, i64* %out, align 4 %18 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %18, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont18 else14: ; preds = %ifcont12 %19 = load i64, i64* %i, align 4 %20 = icmp eq i64 %19, 2 %21 = load i64, i64* %i, align 4 %22 = icmp eq i64 %21, 3 %23 = icmp eq i1 %20, false %24 = select i1 %23, i1 %22, i1 %20 %25 = load i64, i64* %i, align 4 %26 = icmp eq i64 %25, 4 %27 = icmp eq i1 %24, false %28 = select i1 %27, i1 %26, i1 %24 br i1 %28, label %then15, label %else16 then15: ; preds = %else14 store i64 22, i64* %out, align 4 %29 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %29, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont17 else16: ; preds = %else14 br label %ifcont17 ifcont17: ; preds = %else16, %then15 br label %ifcont18 ifcont18: ; preds = %ifcont17, %then13 %30 = load i64, i64* %out, align 4 %31 = icmp ne i64 %30, 22 br i1 %31, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_case_01 FINALIZE_SYMTABLE_case_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-common1-abbc59b.stdout0000664000175000017500000001204415141516316025543 0ustar alastairalastair(TranslationUnit [(Program common1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Implicit [(ImplicitSpec (AttrType TypeReal [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(A [] [] () () None ()) (B [] [] () () None ())] () ) (Declaration () [(AttrCommon [(sample [(A [] [] () A None ()) (B [] [] () B None ())])] )] [] () ) (Declaration () [(AttrCommon [(c [(c [] [] () c None ())]) (b [(d [] [] () d None ()) (e [] [] () e None ()) (f [] [] () f None ())]) (c [(g [] [] () g None ()) (h [] [] () h None ()) (i [(1 5 DimensionExpr)] [] () (FuncCallOrArray i [] [(() 5 () 0)] [] [] [] ) None ())])] )] [] () ) (Declaration () [(AttrCommon [(() [(x [] [] () x None ()) (y [] [] () y None ()) (z [(1 10 DimensionExpr)] [] () (FuncCallOrArray z [] [(() 10 () 0)] [] [] [] ) None ())])] )] [] () )] [(Assignment 0 A 10 () ) (Assignment 0 B 20 () ) (SubroutineCall 0 pass [] [] [] [] () ) (Stop 0 () () () )] [] ) (Subroutine pass [] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(A [] [] () () None ()) (B [] [] () () None ())] () ) (Declaration () [(AttrCommon [(sample [(A [] [] () A None ()) (B [] [] () B None ())])] )] [] () )] [(Print 0 () [A B] () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-empty-6449c98.stdout0000664000175000017500000000012715141516316025050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-builtin1-21cf43e.stdout0000664000175000017500000000073315141516316026241 0ustar alastairalastairprogram builtin_01 ! AST only tests implicit none inquire(unit=n, opened=inuse) inquire(UNIT=JOAN, OPENED=LOG_01, NAMED=LOG_02, FORM=CHAR_VAR, IOSTAT=IOS) inquire(IOLENGTH=IOL) A(1:N) rewind(s) rewind(s) rewind(10) rewind(err=label, unit=s) rewind(iunit(13)) backspace(u) backspace(io_unit) backspace(10) backspace(10, IOSTAT=N) backspace(iunit(13)) endfile(K) endfile(5) endfile(k) endfile(10, iostat=n) endfile(unit=iout, iostat=ios, iomsg=msg) end program builtin_01 ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.jsonlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000000123415141516316035005 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_39.f90", "infile_hash": "f7ccaf8b5a3d38f726e5e5ea8fbd529c12fe8f7ce34e85944c882db7", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.stdout", "stdout_hash": "716a234fdb66f5c69792e95289f641a8513eb99ec318c44be3de2d30", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-array1-3c35261.json0000664000175000017500000000070015141516316025030 0ustar alastairalastair{ "basename": "julia-array1-3c35261", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "julia-array1-3c35261.stdout", "stdout_hash": "a460fa50c8b0162a5bac418df385fdef90aa1887c86f143005893424", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.jsonlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_010000664000175000017500000000113615141516316034411 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f90", "infile_hash": "4f0393569eb2e0f4081875d3cbd2cfe5df6ae707a7e7dc5c425a43d1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.stderr", "stderr_hash": "54eeb4568bab318f2a36a8096992246f0856e7b292b55677a43d73a9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor21-aded728.stdout0000664000175000017500000000234715141516316031262 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor21: (Program (SymbolTable 2 { }) preprocessor21 [] [(Print (StringConstant "Atleast one of VAR1 and VAR2 isn't defined" (String 1 (IntegerConstant 42 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Neither of VAR3 or VAR4 is defined" (String 1 (IntegerConstant 34 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Both VAR5 and VAR6 are defined or neither is defined." (String 1 (IntegerConstant 53 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-loop_test3-f4e458f.stdout0000664000175000017500000001117315141516316026145 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [] [(DoLoop 0 () 240 k 1 mp () [(Assignment 0 (FuncCallOrArray con [] [(() k () 0)] [] [] [] ) (u- (FuncCallOrArray datmat [] [(() k () 0) (() np () 0)] [] [] [] )) () ) (DoLoop 0 () 220 j 1 n () [(Assignment 220 (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray datmat [] [(() k () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray con [] [(() k () 0)] [] [] [] )) () )] () () ) (DoLoop 0 () 240 i 1 n () [(Assignment 0 temp (Real "0.0d0") () ) (DoLoop 0 () 230 j 1 n () [(Assignment 230 temp (+ temp (* (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (FuncCallOrArray simi [] [(() j () 0) (() i () 0)] [] [] [] ))) () )] () () ) (If 0 () (== k mp) [(Assignment 0 temp (u- temp) () )] [] () () () ) (Assignment 240 (FuncCallOrArray a [] [(() i () 0) (() k () 0)] [] [] [] ) temp () )] () () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-dimension_attr-1c00ad6.stdout0000664000175000017500000001741615141516316027046 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a)] [(Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit9-5318b32.json0000664000175000017500000000072015141516316025220 0ustar alastairalastair{ "basename": "asr-implicit9-5318b32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit9.f90", "infile_hash": "8821b0b62f5857553eb0efe35ab8190a8b1c4fe82e623f1dae4e81b3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit9-5318b32.stderr", "stderr_hash": "2537e65ee73bce5d64169c321e19ee4f107be96cc008abc67335b07e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-format_03-c54e532.stdout0000664000175000017500000000060115141516316025543 0ustar alastairalastair(TranslationUnit [(Program format_03 () [] [] [] [(Format 1000 "/' --- PROBLEM SIZE:'/' N = ',i5,' (NUMBER WITH NONZERO WEIGHT = ',i5,')'/' NQ = ',i5/' M = ',i5/' NP = ',i5,' (NUMBER UNFIXED = ',i5,')'" () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/pass_flip_sign-flip_sign-16b288c.json0000664000175000017500000000101415141516316027565 0ustar alastairalastair{ "basename": "pass_flip_sign-flip_sign-16b288c", "cmd": "lfortran --pass=flip_sign --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/flip_sign.f90", "infile_hash": "12739178c354710c6f6bbeb834508a7932ae385c1340b0c08bca8b8d", "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", "stdout_hash": "03c7183b90d024c9801d24ae9522426eaeb48efc397e73489108301b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_logical-f19a63d.stdout0000664000175000017500000014526415141516316027531 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [184 x i8] c"At 6:1 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @3 = private unnamed_addr constant [184 x i8] c"At 8:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [185 x i8] c"At 8:18 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @7 = private unnamed_addr constant [186 x i8] c"At 10:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [185 x i8] c"At 11:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @15 = private unnamed_addr constant [186 x i8] c"At 12:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @19 = private unnamed_addr constant [185 x i8] c"At 14:1 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [185 x i8] c"At 16:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @23 = private unnamed_addr constant [186 x i8] c"At 16:21 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [185 x i8] c"At 18:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [186 x i8] c"At 19:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [185 x i8] c"At 20:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [186 x i8] c"At 21:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @41 = private unnamed_addr constant [185 x i8] c"At 24:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @43 = private unnamed_addr constant [186 x i8] c"At 24:12 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [185 x i8] c"At 26:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [185 x i8] c"At 27:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @51 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @53 = private unnamed_addr constant [185 x i8] c"At 28:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @55 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @57 = private unnamed_addr constant [185 x i8] c"At 30:1 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [185 x i8] c"At 30:8 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @61 = private unnamed_addr constant [186 x i8] c"At 30:18 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [186 x i8] c"At 30:28 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @65 = private unnamed_addr constant [186 x i8] c"At 30:38 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [186 x i8] c"At 31:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @71 = private unnamed_addr constant [185 x i8] c"At 33:1 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @73 = private unnamed_addr constant [185 x i8] c"At 33:8 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @75 = private unnamed_addr constant [186 x i8] c"At 34:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @77 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @79 = private unnamed_addr constant [186 x i8] c"At 39:13 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @81 = private unnamed_addr constant [186 x i8] c"At 39:13 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @82 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @83 = private unnamed_addr constant [186 x i8] c"At 41:13 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @85 = private unnamed_addr constant [186 x i8] c"At 41:13 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @87 = private unnamed_addr constant [185 x i8] c"At 45:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @89 = private unnamed_addr constant [185 x i8] c"At 45:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @93 = private unnamed_addr constant [186 x i8] c"At 46:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @94 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @95 = private unnamed_addr constant [186 x i8] c"At 46:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @97 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @98 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @99 = private unnamed_addr constant [186 x i8] c"At 47:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @101 = private unnamed_addr constant [186 x i8] c"At 47:11 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @102 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @103 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @104 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @105 = private unnamed_addr constant [185 x i8] c"At 48:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @107 = private unnamed_addr constant [185 x i8] c"At 48:5 of file tests/../integration_tests/arrays_01_logical.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @108 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @109 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x i8], align 1 %b = alloca [4 x i8], align 1 %c = alloca [4 x i8], align 1 %i = alloca i32, align 4 %j = alloca i32, align 4 br i1 false, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %2 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 store i8 1, i8* %2, align 1 store i32 1, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont4, %ifcont %3 = load i32, i32* %i, align 4 %4 = add i32 %3, 1 %5 = icmp sle i32 %4, 3 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %i, align 4 %8 = load i32, i32* %i, align 4 %9 = sub i32 %8, 1 %10 = mul i32 1, %9 %11 = add i32 0, %10 %12 = icmp slt i32 %8, 1 %13 = icmp sgt i32 %8, 3 %14 = or i1 %12, %13 br i1 %14, label %then1, label %ifcont2 then1: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 %8, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.body %15 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 %11 %16 = load i32, i32* %i, align 4 %17 = sub i32 %16, 1 %18 = sub i32 %17, 1 %19 = mul i32 1, %18 %20 = add i32 0, %19 %21 = icmp slt i32 %17, 1 %22 = icmp sgt i32 %17, 3 %23 = or i1 %21, %22 br i1 %23, label %then3, label %ifcont4 then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 %17, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %24 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 %20 %25 = load i8, i8* %24, align 1 %26 = icmp ne i8 %25, 0 %27 = xor i1 %26, true %28 = zext i1 %27 to i8 store i8 %28, i8* %15, align 1 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then5, label %ifcont6 then5: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.end %29 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 %30 = load i8, i8* %29, align 1 %31 = icmp ne i8 %30, 0 %32 = xor i1 %31, true br i1 %32, label %then7, label %else then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont8 else: ; preds = %ifcont6 br label %ifcont8 ifcont8: ; preds = %else, %then7 br i1 false, label %then9, label %ifcont10 then9: ; preds = %ifcont8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %33 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 1 %34 = load i8, i8* %33, align 1 %35 = icmp ne i8 %34, 0 br i1 %35, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 br i1 false, label %then14, label %ifcont15 then14: ; preds = %ifcont13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 3, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %36 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 2 %37 = load i8, i8* %36, align 1 %38 = icmp ne i8 %37, 0 %39 = xor i1 %38, true br i1 %39, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 br i1 false, label %then19, label %ifcont20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont20: ; preds = %ifcont18 %40 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 0 store i8 0, i8* %40, align 1 store i32 11, i32* %i, align 4 br label %loop.head21 loop.head21: ; preds = %ifcont26, %ifcont20 %41 = load i32, i32* %i, align 4 %42 = add i32 %41, 1 %43 = icmp sle i32 %42, 14 br i1 %43, label %loop.body22, label %loop.end27 loop.body22: ; preds = %loop.head21 %44 = load i32, i32* %i, align 4 %45 = add i32 %44, 1 store i32 %45, i32* %i, align 4 %46 = load i32, i32* %i, align 4 %47 = sub i32 %46, 10 %48 = sub i32 %47, 1 %49 = mul i32 1, %48 %50 = add i32 0, %49 %51 = icmp slt i32 %47, 1 %52 = icmp sgt i32 %47, 4 %53 = or i1 %51, %52 br i1 %53, label %then23, label %ifcont24 then23: ; preds = %loop.body22 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 %47, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont24: ; preds = %loop.body22 %54 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 %50 %55 = load i32, i32* %i, align 4 %56 = sub i32 %55, 10 %57 = sub i32 %56, 1 %58 = sub i32 %57, 1 %59 = mul i32 1, %58 %60 = add i32 0, %59 %61 = icmp slt i32 %57, 1 %62 = icmp sgt i32 %57, 4 %63 = or i1 %61, %62 br i1 %63, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 %57, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %64 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 %60 %65 = load i8, i8* %64, align 1 %66 = icmp ne i8 %65, 0 %67 = xor i1 %66, true %68 = zext i1 %67 to i8 store i8 %68, i8* %54, align 1 br label %loop.head21 loop.end27: ; preds = %loop.head21 br i1 false, label %then28, label %ifcont29 then28: ; preds = %loop.end27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont29: ; preds = %loop.end27 %69 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 0 %70 = load i8, i8* %69, align 1 %71 = icmp ne i8 %70, 0 br i1 %71, label %then30, label %else31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont32 else31: ; preds = %ifcont29 br label %ifcont32 ifcont32: ; preds = %else31, %then30 br i1 false, label %then33, label %ifcont34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %72 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 1 %73 = load i8, i8* %72, align 1 %74 = icmp ne i8 %73, 0 %75 = xor i1 %74, true br i1 %75, label %then35, label %else36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont37 else36: ; preds = %ifcont34 br label %ifcont37 ifcont37: ; preds = %else36, %then35 br i1 false, label %then38, label %ifcont39 then38: ; preds = %ifcont37 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont39: ; preds = %ifcont37 %76 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 2 %77 = load i8, i8* %76, align 1 %78 = icmp ne i8 %77, 0 br i1 %78, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 br i1 false, label %then43, label %ifcont44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %79 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 3 %80 = load i8, i8* %79, align 1 %81 = icmp ne i8 %80, 0 %82 = xor i1 %81, true br i1 %82, label %then45, label %else46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont47 else46: ; preds = %ifcont44 br label %ifcont47 ifcont47: ; preds = %else46, %then45 store i32 0, i32* %i, align 4 br label %loop.head48 loop.head48: ; preds = %ifcont53, %ifcont47 %83 = load i32, i32* %i, align 4 %84 = add i32 %83, 1 %85 = icmp sle i32 %84, 3 br i1 %85, label %loop.body49, label %loop.end54 loop.body49: ; preds = %loop.head48 %86 = load i32, i32* %i, align 4 %87 = add i32 %86, 1 store i32 %87, i32* %i, align 4 %88 = load i32, i32* %i, align 4 %89 = sub i32 %88, 1 %90 = mul i32 1, %89 %91 = add i32 0, %90 %92 = icmp slt i32 %88, 1 %93 = icmp sgt i32 %88, 4 %94 = or i1 %92, %93 br i1 %94, label %then50, label %ifcont51 then50: ; preds = %loop.body49 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 %88, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont51: ; preds = %loop.body49 %95 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 %91 %96 = load i32, i32* %i, align 4 %97 = sub i32 %96, 1 %98 = mul i32 1, %97 %99 = add i32 0, %98 %100 = icmp slt i32 %96, 1 %101 = icmp sgt i32 %96, 3 %102 = or i1 %100, %101 br i1 %102, label %then52, label %ifcont53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 %96, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %103 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 %99 %104 = load i8, i8* %103, align 1 %105 = icmp ne i8 %104, 0 %106 = icmp eq i1 %105, false %107 = select i1 %106, i1 %105, i1 false %108 = zext i1 %107 to i8 store i8 %108, i8* %95, align 1 br label %loop.head48 loop.end54: ; preds = %loop.head48 br i1 false, label %then55, label %ifcont56 then55: ; preds = %loop.end54 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont56: ; preds = %loop.end54 %109 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 0 %110 = load i8, i8* %109, align 1 %111 = icmp ne i8 %110, 0 br i1 %111, label %then57, label %else58 then57: ; preds = %ifcont56 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont59 else58: ; preds = %ifcont56 br label %ifcont59 ifcont59: ; preds = %else58, %then57 br i1 false, label %then60, label %ifcont61 then60: ; preds = %ifcont59 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont61: ; preds = %ifcont59 %112 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 1 %113 = load i8, i8* %112, align 1 %114 = icmp ne i8 %113, 0 br i1 %114, label %then62, label %else63 then62: ; preds = %ifcont61 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont64 else63: ; preds = %ifcont61 br label %ifcont64 ifcont64: ; preds = %else63, %then62 br i1 false, label %then65, label %ifcont66 then65: ; preds = %ifcont64 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont66: ; preds = %ifcont64 %115 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 2 %116 = load i8, i8* %115, align 1 %117 = icmp ne i8 %116, 0 br i1 %117, label %then67, label %else68 then67: ; preds = %ifcont66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont69 else68: ; preds = %ifcont66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %118 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 3 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %119 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 0 %120 = load i8, i8* %119, align 1 %121 = icmp ne i8 %120, 0 br i1 false, label %then74, label %ifcont75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont75: ; preds = %ifcont73 %122 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 1 %123 = load i8, i8* %122, align 1 %124 = icmp ne i8 %123, 0 %125 = icmp eq i1 %121, false %126 = select i1 %125, i1 %124, i1 %121 br i1 false, label %then76, label %ifcont77 then76: ; preds = %ifcont75 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont77: ; preds = %ifcont75 %127 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 2 %128 = load i8, i8* %127, align 1 %129 = icmp ne i8 %128, 0 %130 = icmp eq i1 %126, false %131 = select i1 %130, i1 %129, i1 %126 br i1 false, label %then78, label %ifcont79 then78: ; preds = %ifcont77 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont79: ; preds = %ifcont77 %132 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 %133 = load i8, i8* %132, align 1 %134 = icmp ne i8 %133, 0 %135 = icmp eq i1 %131, false %136 = select i1 %135, i1 %134, i1 %131 %137 = zext i1 %136 to i8 store i8 %137, i8* %118, align 1 br i1 false, label %then80, label %ifcont81 then80: ; preds = %ifcont79 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont81: ; preds = %ifcont79 %138 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 3 %139 = load i8, i8* %138, align 1 %140 = icmp ne i8 %139, 0 %141 = xor i1 %140, true br i1 %141, label %then82, label %else83 then82: ; preds = %ifcont81 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont84 else83: ; preds = %ifcont81 br label %ifcont84 ifcont84: ; preds = %else83, %then82 br i1 false, label %then85, label %ifcont86 then85: ; preds = %ifcont84 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont86: ; preds = %ifcont84 %142 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 3 br i1 false, label %then87, label %ifcont88 then87: ; preds = %ifcont86 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont88: ; preds = %ifcont86 %143 = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 %144 = load i8, i8* %143, align 1 %145 = icmp ne i8 %144, 0 %146 = zext i1 %145 to i8 store i8 %146, i8* %142, align 1 br i1 false, label %then89, label %ifcont90 then89: ; preds = %ifcont88 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont90: ; preds = %ifcont88 %147 = getelementptr [4 x i8], [4 x i8]* %b, i32 0, i32 3 %148 = load i8, i8* %147, align 1 %149 = icmp ne i8 %148, 0 %150 = xor i1 %149, true br i1 %150, label %then91, label %else92 then91: ; preds = %ifcont90 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont93 else92: ; preds = %ifcont90 br label %ifcont93 ifcont93: ; preds = %else92, %then91 store i32 0, i32* %i, align 4 br label %loop.head94 loop.head94: ; preds = %loop.end109, %ifcont93 %151 = load i32, i32* %i, align 4 %152 = add i32 %151, 1 %153 = icmp sle i32 %152, 2 br i1 %153, label %loop.body95, label %loop.end110 loop.body95: ; preds = %loop.head94 %154 = load i32, i32* %i, align 4 %155 = add i32 %154, 1 store i32 %155, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head96 loop.head96: ; preds = %ifcont108, %loop.body95 %156 = load i32, i32* %j, align 4 %157 = add i32 %156, 1 %158 = icmp sle i32 %157, 2 br i1 %158, label %loop.body97, label %loop.end109 loop.body97: ; preds = %loop.head96 %159 = load i32, i32* %j, align 4 %160 = add i32 %159, 1 store i32 %160, i32* %j, align 4 %161 = load i32, i32* %i, align 4 %162 = load i32, i32* %j, align 4 %163 = add i32 %161, %162 %164 = load i32, i32* %i, align 4 %165 = load i32, i32* %j, align 4 %166 = add i32 %164, %165 %167 = sdiv i32 %166, 2 %168 = mul i32 2, %167 %169 = sub i32 %163, %168 %170 = icmp eq i32 %169, 1 br i1 %170, label %then98, label %else103 then98: ; preds = %loop.body97 %171 = load i32, i32* %i, align 4 %172 = load i32, i32* %j, align 4 %173 = sub i32 %171, 1 %174 = mul i32 1, %173 %175 = add i32 0, %174 %176 = icmp slt i32 %171, 1 %177 = icmp sgt i32 %171, 2 %178 = or i1 %176, %177 br i1 %178, label %then99, label %ifcont100 then99: ; preds = %then98 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0), i32 %171, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont100: ; preds = %then98 %179 = sub i32 %172, 1 %180 = mul i32 2, %179 %181 = add i32 %175, %180 %182 = icmp slt i32 %172, 1 %183 = icmp sgt i32 %172, 2 %184 = or i1 %182, %183 br i1 %184, label %then101, label %ifcont102 then101: ; preds = %ifcont100 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @81, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i32 %172, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont102: ; preds = %ifcont100 %185 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 %181 store i8 1, i8* %185, align 1 br label %ifcont108 else103: ; preds = %loop.body97 %186 = load i32, i32* %i, align 4 %187 = load i32, i32* %j, align 4 %188 = sub i32 %186, 1 %189 = mul i32 1, %188 %190 = add i32 0, %189 %191 = icmp slt i32 %186, 1 %192 = icmp sgt i32 %186, 2 %193 = or i1 %191, %192 br i1 %193, label %then104, label %ifcont105 then104: ; preds = %else103 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @82, i32 0, i32 0), i32 %186, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont105: ; preds = %else103 %194 = sub i32 %187, 1 %195 = mul i32 2, %194 %196 = add i32 %190, %195 %197 = icmp slt i32 %187, 1 %198 = icmp sgt i32 %187, 2 %199 = or i1 %197, %198 br i1 %199, label %then106, label %ifcont107 then106: ; preds = %ifcont105 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i32 %187, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont107: ; preds = %ifcont105 %200 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 %196 store i8 0, i8* %200, align 1 br label %ifcont108 ifcont108: ; preds = %ifcont107, %ifcont102 br label %loop.head96 loop.end109: ; preds = %loop.head96 br label %loop.head94 loop.end110: ; preds = %loop.head94 br i1 false, label %then111, label %ifcont112 then111: ; preds = %loop.end110 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont112: ; preds = %loop.end110 br i1 false, label %then113, label %ifcont114 then113: ; preds = %ifcont112 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont114: ; preds = %ifcont112 %201 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 0 %202 = load i8, i8* %201, align 1 %203 = icmp ne i8 %202, 0 br i1 %203, label %then115, label %else116 then115: ; preds = %ifcont114 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont117 else116: ; preds = %ifcont114 br label %ifcont117 ifcont117: ; preds = %else116, %then115 br i1 false, label %then118, label %ifcont119 then118: ; preds = %ifcont117 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @93, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont119: ; preds = %ifcont117 br i1 false, label %then120, label %ifcont121 then120: ; preds = %ifcont119 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @94, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont121: ; preds = %ifcont119 %204 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 2 %205 = load i8, i8* %204, align 1 %206 = icmp ne i8 %205, 0 %207 = xor i1 %206, true br i1 %207, label %then122, label %else123 then122: ; preds = %ifcont121 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @97, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont124 else123: ; preds = %ifcont121 br label %ifcont124 ifcont124: ; preds = %else123, %then122 br i1 false, label %then125, label %ifcont126 then125: ; preds = %ifcont124 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @98, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont126: ; preds = %ifcont124 br i1 false, label %then127, label %ifcont128 then127: ; preds = %ifcont126 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @101, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont128: ; preds = %ifcont126 %208 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 1 %209 = load i8, i8* %208, align 1 %210 = icmp ne i8 %209, 0 %211 = xor i1 %210, true br i1 %211, label %then129, label %else130 then129: ; preds = %ifcont128 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @103, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @102, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont131 else130: ; preds = %ifcont128 br label %ifcont131 ifcont131: ; preds = %else130, %then129 br i1 false, label %then132, label %ifcont133 then132: ; preds = %ifcont131 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @104, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont133: ; preds = %ifcont131 br i1 false, label %then134, label %ifcont135 then134: ; preds = %ifcont133 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @107, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont135: ; preds = %ifcont133 %212 = getelementptr [4 x i8], [4 x i8]* %c, i32 0, i32 3 %213 = load i8, i8* %212, align 1 %214 = icmp ne i8 %213, 0 br i1 %214, label %then136, label %else137 then136: ; preds = %ifcont135 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @108, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont138 else137: ; preds = %ifcont135 br label %ifcont138 ifcont138: ; preds = %else137, %then136 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont138 br label %FINALIZE_SYMTABLE_arrays_01_logical FINALIZE_SYMTABLE_arrays_01_logical: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-dreal_arg_error-91381bb.json0000664000175000017500000000075115141516316026534 0ustar alastairalastair{ "basename": "asr-dreal_arg_error-91381bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dreal_arg_error.f90", "infile_hash": "b3eef179f8004efffebeb00ee2a7cccd1d2c6c90cfaa04973a3e8d50", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dreal_arg_error-91381bb.stderr", "stderr_hash": "ab0ace5f803a78c7790287d4b8d2a54073815a3bb40e830cee3164f5", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp4-0611905.json0000664000175000017500000000074415141516316026354 0ustar alastairalastair{ "basename": "asr_preprocess-cpp4-0611905", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp4.f90", "infile_hash": "cdfb40699075b2ba0ddb610fe1bc708cecd3e38d14adcc946b2ca70a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp4-0611905.stderr", "stderr_hash": "b215b344a6a7ea30b40d38cf92f756b1982a66068232a12de9e62cbc", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-class_04-285a1df.stdout0000664000175000017500000006752215141516316025456 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { 1_bar_a_a: (ExternalSymbol 2 1_bar_a_a 3 a bar_a [] a Public ), 1_bar_b_b: (ExternalSymbol 2 1_bar_b_b 5 b bar_b [] b Public ), 1_bar_c_c: (ExternalSymbol 2 1_bar_c_c 6 c bar_c [] c Public ), 1_foo_a_m_bar_a: (ExternalSymbol 2 1_foo_a_m_bar_a 4 m_bar_a foo_a [] m_bar_a Public ), 1_foo_b_m_bar_b: (ExternalSymbol 2 1_foo_b_m_bar_b 7 m_bar_b foo_b [] m_bar_b Public ), 1_foo_c_m_bar_c: (ExternalSymbol 2 1_foo_c_m_bar_c 8 m_bar_c foo_c [] m_bar_c Public ), bar_a: (Struct (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bar_a (StructType [(Integer 4)] [] .true. .false. ) [] [a] [] Source Public .false. .false. [] () () ), bar_b: (Struct (SymbolTable 5 { b: (Variable 5 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bar_b (StructType [(Integer 4)] [] .true. .false. ) [] [b] [] Source Public .false. .false. [] () 2 bar_a ), bar_c: (Struct (SymbolTable 6 { c: (Variable 6 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bar_c (StructType [(Integer 4)] [] .true. .false. ) [] [c] [] Source Public .false. .false. [] () 2 bar_b ), foo: (Variable 2 foo [] Local () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) 2 foo_c Source Public Required .false. .false. .false. () .false. .false. ), foo_a: (Struct (SymbolTable 4 { m_bar_a: (Variable 4 m_bar_a [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_a Source Public Required .false. .false. .false. () .false. .false. ) }) foo_a (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_a] [m_bar_a] [] Source Public .false. .false. [] () () ), foo_b: (Struct (SymbolTable 7 { m_bar_b: (Variable 7 m_bar_b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_b Source Public Required .false. .false. .false. () .false. .false. ) }) foo_b (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_b] [m_bar_b] [] Source Public .false. .false. [] () 2 foo_a ), foo_c: (Struct (SymbolTable 8 { m_bar_c: (Variable 8 m_bar_c [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 bar_c Source Public Required .false. .false. .false. () .false. .false. ) }) foo_c (StructType [(StructType [(Integer 4)] [] .true. .false. )] [] .true. .false. ) [bar_c] [m_bar_c] [] Source Public .false. .false. [] () 2 foo_b ) }) main [] [(Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () ) (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () ) (IntegerConstant 9 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () ) (IntegerConstant 11 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (IntegerBinOp (IntegerBinOp (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_a_m_bar_a (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_a_a (Integer 4) () ) Add (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_b_m_bar_b (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_b_b (Integer 4) () ) (Integer 4) () ) Add (StructInstanceMember (StructInstanceMember (Var 2 foo) 2 1_foo_c_m_bar_c (StructType [(Integer 4)] [] .true. .false. ) () ) 2 1_bar_c_c (Integer 4) () ) (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-function_call1-c233951.stdout0000664000175000017500000000027515141516316030322 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":5,"line":8},"end":{"character":24,"line":12}},"uri":"tests/function_call1.f90"},"name":"eval_1d","filename":"tests/function_call1.f90"}]lfortran-lfortran-2f73434/tests/reference/wat-abs_01-0c0b4df.stdout0000664000175000017500000001777715141516316025200 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local f32) f32.const 1.500000 local.set 0 local.get 0 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 f32.const 0.000000 f32.lt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end f32.const 1.500000 local.set 0 local.get 0 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 f32.const 0.000000 f32.lt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/asr-preprocessor17-f2d76bb.stdout0000664000175000017500000000641715141516316027022 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor1 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_12-ff7ce44.stdout0000664000175000017500000001453215141516316026616 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_12: (Program (SymbolTable 2 { }) intrinsics_12 [] [(Print (StringFormat () [(TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 4) (RealConstant 5.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Real 8) (RealConstant 5.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_01-9cd45b3.json0000664000175000017500000000100115141516316030217 0ustar alastairalastair{ "basename": "ast-program_without_line_01-9cd45b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_01.f90", "infile_hash": "16c0177d21a94c7cdb24606167def8b7d93e9c927778d13b8ec1ae92", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_01-9cd45b3.stdout", "stdout_hash": "cecb5013af867fa1849c74cf81134bb3505379e5153c7e8839a48508", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_01-9dc98da.stdout0000664000175000017500000003506015141516316026371 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_01: (Program (SymbolTable 5 { a: (ExternalSymbol 5 a 2 a interface_01_mod [] a Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_01_mod [] a1 Public ), a2@a: (ExternalSymbol 5 a2@a 2 a2 interface_01_mod [] a2 Public ), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_01_mod [] a1 Private ), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_01_mod [] a2 Private ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) interface_01 [interface_01_mod] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] () .false. ) (If () (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 i) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_01_mod: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1 2 a2] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), a2: (Function (SymbolTable 4 { a: (Variable 4 a [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a2 (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) () .false. .false. )] () Public .false. .false. () ) }) interface_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-goto_02-fc47ad0.stderr0000664000175000017500000000103115141516316025337 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/goto_02.f90:10:12 | 10 | if (A.GT.2) go to 95 | ^^^^ help: write this as '>' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:13:12 | 13 | if (A.EQ.1) go to 10 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:25:12 | 25 | if (A.EQ.2) go to 99 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-external4-4e8bc7b.stdout0000664000175000017500000004125515141516316026033 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dqc25s: (Function (SymbolTable 2 { centr: (Variable 2 centr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dlog: (Variable 2 dlog [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), dqk15w: (Function (SymbolTable 3 { dqk15w_arg_0: (Variable 3 dqk15w_arg_0 [] Unspecified () () Default (FunctionType [] (Real 8) Source Interface () .false. .false. .false. .false. .false. [] .false. ) 2 ~implicit_interface_dqk15w_arg_0_4 BindC Public Required .false. .false. .false. () .false. .false. ) }) dqk15w (FunctionType [(FunctionType [] (Real 8) Source Interface () .false. .false. .false. .false. .false. [] .false. )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 dqk15w_arg_0)] [] () Public .false. .false. () ), f: (Variable 2 f [] Unspecified () () Default (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) 1 ~implicit_interface_f_2 Source Public Required .false. .false. .false. () .false. .false. ), hlgth: (Variable 2 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~implicit_interface_dqk15w_arg_0_4: (Function (SymbolTable 4 { ~implicit_interface_dqk15w_arg_0_4_return_var: (Variable 4 ~implicit_interface_dqk15w_arg_0_4_return_var [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) ~implicit_interface_dqk15w_arg_0_4 (FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 ~implicit_interface_dqk15w_arg_0_4_return_var) Public .false. .false. () ) }) dqc25s (FunctionType [(FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [(SubroutineCall 2 dqk15w () [((Var 2 f))] () .false. ) (Print (StringFormat () [(FunctionCall 2 f () [((RealBinOp (Var 2 hlgth) Add (Var 2 centr) (Real 4) () ))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Log [(RealConstant 2.000000 (Real 8) )] 0 (Real 8) (RealConstant 0.693147 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), ~implicit_interface_f_2: (Function (SymbolTable 6 { ~implicit_interface_f_2_arg_0: (Variable 6 ~implicit_interface_f_2_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), ~implicit_interface_f_2_return_var: (Variable 6 ~implicit_interface_f_2_return_var [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) ~implicit_interface_f_2 (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 ~implicit_interface_f_2_arg_0)] [] (Var 6 ~implicit_interface_f_2_return_var) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_11-72f8b07.stderr0000664000175000017500000000000515141516316025543 0ustar alastairalastairSTOP lfortran-lfortran-2f73434/tests/reference/llvm-associate_03-68dfbc7.json0000664000175000017500000000076115141516316026220 0ustar alastairalastair{ "basename": "llvm-associate_03-68dfbc7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_03.f90", "infile_hash": "54a0fef1ee3727e70478189b60d108081d8e7760cadd89e8c99a8378", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_03-68dfbc7.stdout", "stdout_hash": "b22bf40c55ff78f93b966668201bf8ee24c3a0d3d50b0590634ec369", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_30-3cec484.stdout0000664000175000017500000000122015141516316025641 0ustar alastairalastair 0.100E+01 0.200E+01 1.192E-07 1.192E-07 1.2345 2.3456 3.4567 123.000E+00 456.000E+00 1.192E-07 1.192E-07 0.119E-06 0.222E-15 1.E+10 3.333333333333333E+199 +0.12345678910111198970867447229396098431025025677513E-61 0.E+0 1.E+1 3.E+0 3.E+5 3.000000000000000E-100 1.E+0 1.E+00 2.22507386E-308 1.79769313E+308 0.0000000E+00 lfortran-lfortran-2f73434/tests/reference/asr-array_02_pack-233bae0.stdout0000664000175000017500000002216115141516316026436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_02_pack: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_02_pack [] [(Assignment (Var 2 m) (ArrayConstant 16 [1, 0, 0, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 p) (IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (ArrayConstant 16 [0, 0, 3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 3 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 2 p) NotEq (ArrayConstant 16 [1, 2, 3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-modules_01-1b129c3.json0000664000175000017500000000075315141516316025535 0ustar alastairalastair{ "basename": "llvm-modules_01-1b129c3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_01-1b129c3.stdout", "stdout_hash": "94897b60167a07788208679503825f1d3dba0407e017bb7306546ba0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-associate_07-a296ccb.json0000664000175000017500000000075615141516316026031 0ustar alastairalastair{ "basename": "asr-associate_07-a296ccb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_07.f90", "infile_hash": "fe0eb1af053495fc080e49f70bf829f7aee3ac2f87c5c64b552bdffe", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_07-a296ccb.stdout", "stdout_hash": "bb2ad9350df9a5d620c74260577da24a9d198b56272c433a3fe3226b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine5-e248afc.stdout0000664000175000017500000000764715141516316026416 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { add: (Function (SymbolTable 2 { a: (Variable 2 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(Real 4) (Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 c)] [(Assignment (Var 2 c) (RealBinOp (Var 2 a) Add (Var 2 b) (Real 4) () ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/obj-expr5-7a93333.json0000664000175000017500000000055715141516316024362 0ustar alastairalastair{ "basename": "obj-expr5-7a93333", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-bccf386.stdout0000664000175000017500000001533415141516316027411 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), datap: (Variable 2 datap [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), integerx: (Variable 2 integerx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), realr: (Variable 2 realr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x [] [(Assignment (Var 2 l) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 integerx) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 datap) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 realr) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l) (Var 2 a) (Var 2 integerx) (Var 2 datap) (Var 2 realr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-intent_01-6d96ec5.json0000664000175000017500000000075015141516316025464 0ustar alastairalastair{ "basename": "llvm-intent_01-6d96ec5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "llvm-intent_01-6d96ec5.stdout", "stdout_hash": "fe1958ebe17ce6fd01d0ebfdbb1ef956381d5223ca60e6569ac11ce0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-string_assignment_02-84c751f.stderr0000664000175000017500000000010615141516316030015 0ustar alastairalastairLFORTRAN ERROR: Run-time Error : Copying from unallocated RHS string. lfortran-lfortran-2f73434/tests/reference/llvm-variables_03-4ba9d62.json0000664000175000017500000000076115141516316026125 0ustar alastairalastair{ "basename": "llvm-variables_03-4ba9d62", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/variables_03.f90", "infile_hash": "8d8aca80aa33efae3a67154a5d778388037b8ff8866bb59f1909be52", "outfile": null, "outfile_hash": null, "stdout": "llvm-variables_03-4ba9d62.stdout", "stdout_hash": "b3af5c0ecb13f72d3d00da87445b49c27b9022823190729d82cb09d2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-Subroutine_Call1-5aa005c.stdout0000664000175000017500000000102215141516316027644 0ustar alastairalastairprogram Subroutine_Call1 implicit none ! Syntax check !Subroutine CALL call randn(x(i)) call randn(x) call random_number(U) call rand_gamma0(a, .true., x) call rand_gamma0(a, .true., x(1)) call rand_gamma0(a, .false., x(i)) call rand_gamma_vector_n(a, size(x), x) call f(a=4, b=6, c=i) call g(a(3:5, i:j), b(:)) call g(a(:5, i:j), b(1:)) call a%random_number(u) call a%b%random_number(u) call f(a=4, b=6, c=i) call x%f%e() call self%dependency(ii)%info(unit, pr - 1) call self%dep(:self%ndep)%done(a) end program Subroutine_Call1 lfortran-lfortran-2f73434/tests/reference/ast-open1-df87f77.json0000664000175000017500000000070415141516316024530 0ustar alastairalastair{ "basename": "ast-open1-df87f77", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/open1.f90", "infile_hash": "932467cb6b7bcbf97a0b9a7c90ea1ca8074bde26145accfc0bb252c2", "outfile": null, "outfile_hash": null, "stdout": "ast-open1-df87f77.stdout", "stdout_hash": "c04e156b6fe36aeb38e7cb3dbd7aa9fd653205542f08759997a670c8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-modules_12-09f81d9.json0000664000175000017500000000074115141516316025706 0ustar alastairalastair{ "basename": "julia-modules_12-09f81d9", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/modules_12.f90", "infile_hash": "aba2ca12e578c5e6c071c1baf18c66272a5c54a88a9c73d8f05e6196", "outfile": null, "outfile_hash": null, "stdout": "julia-modules_12-09f81d9.stdout", "stdout_hash": "33e927aeaa053a17848b2ec23f8f983d294e794d8f1fcbe8941cb829", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_60-baa1105.stdout0000664000175000017500000002131415141516316025770 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bobyqa_exmp: (Program (SymbolTable 6 { is_finite: (ExternalSymbol 6 is_finite 2 is_finite inf_mod_1 [] is_finite Public ), is_finite_1: (ExternalSymbol 6 is_finite_1 4 is_finite_1 infnan_mod_1 [] is_finite_1 Public ), is_finite_1@is_finite: (ExternalSymbol 6 is_finite_1@is_finite 2 is_finite_1 inf_mod_1 [] is_finite_1 Public ) }) bobyqa_exmp [infnan_mod_1] [(SubroutineCall 6 is_finite_1 () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] ), inf_mod_1: (Module (SymbolTable 2 { is_finite: (GenericProcedure 2 is_finite [2 is_finite_1] Public ), is_finite_1: (Function (SymbolTable 3 { }) is_finite_1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) inf_mod_1 () [] .false. .false. .false. ), infnan_mod_1: (Module (SymbolTable 4 { is_finite: (ExternalSymbol 4 is_finite 2 is_finite inf_mod_1 [] is_finite Public ), is_finite_1: (Function (SymbolTable 5 { x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) is_finite_1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Print (StringFormat () [(Var 5 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 5 x) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), is_finite_1@is_finite: (ExternalSymbol 4 is_finite_1@is_finite 2 is_finite_1 inf_mod_1 [] is_finite_1 Public ) }) infnan_mod_1 () [inf_mod_1] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_array_03-b7f9799.stdout0000664000175000017500000050604115141516316027321 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_03: (Program (SymbolTable 21 { add_integer: (ExternalSymbol 21 add_integer 2 add_integer template_array_03_math [] add_integer Public ), add_real: (ExternalSymbol 21 add_real 2 add_real template_array_03_math [] add_real Public ), array_tmpl: (ExternalSymbol 21 array_tmpl 9 array_tmpl template_array_03_m [] array_tmpl Public ), mult_integer: (ExternalSymbol 21 mult_integer 2 mult_integer template_array_03_math [] mult_integer Public ), mult_real: (ExternalSymbol 21 mult_real 2 mult_real template_array_03_math [] mult_real Public ), operations: (ExternalSymbol 21 operations 9 operations template_array_03_m [] operations Public ), test_template: (ExternalSymbol 21 test_template 9 test_template template_array_03_m [] test_template Public ), zero_integer: (ExternalSymbol 21 zero_integer 2 zero_integer template_array_03_math [] zero_integer Public ), zero_real: (ExternalSymbol 21 zero_real 2 zero_real template_array_03_math [] zero_real Public ) }) template_array_03 [template_array_03_m] [(SubroutineCall 21 test_template () [] () .false. )] ), template_array_03_m: (Module (SymbolTable 9 { add_integer: (ExternalSymbol 9 add_integer 2 add_integer template_array_03_math [] add_integer Public ), add_real: (ExternalSymbol 9 add_real 2 add_real template_array_03_math [] add_real Public ), array_tmpl: (Template (SymbolTable 14 { mult_t: (Function (SymbolTable 17 { l: (Variable 17 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 17 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), result: (Variable 17 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) mult_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 17 l) (Var 17 r)] [] (Var 17 result) Private .false. .false. () ), mymatmul_t: (Function (SymbolTable 18 { a: (Variable 18 a [i j] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 j))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 18 b [j k] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 j)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), elem: (Variable 18 elem [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 18 i [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 18 j [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 18 k [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 18 r [i k] Unspecified () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 18 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 18 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 18 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 18 z [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mymatmul_t (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t mult_t plus_t] [(Var 18 i) (Var 18 j) (Var 18 k) (Var 18 a) (Var 18 b) (Var 18 r)] [(DoLoop () ((Var 18 x) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 i) ()) [(DoLoop () ((Var 18 z) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 k) ()) [(Assignment (Var 18 elem) (FunctionCall 14 zero_t () [((ArrayItem (Var 18 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 18 y) (IntegerConstant 1 (Integer 4) Decimal) (Var 18 j) ()) [(Assignment (Var 18 elem) (FunctionCall 14 plus_t () [((Var 18 elem)) ((FunctionCall 14 mult_t () [((ArrayItem (Var 18 a) [(() (Var 18 x) ()) (() (Var 18 y) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 18 b) [(() (Var 18 y) ()) (() (Var 18 z) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 18 r) [(() (Var 18 x) ()) (() (Var 18 z) ())] (TypeParameter t ) ColMajor () ) (Var 18 elem) () .false. .false. )] [] )] [] )] () Public .false. .false. () ), plus_t: (Function (SymbolTable 15 { l: (Variable 15 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 15 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), result: (Variable 15 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 l) (Var 15 r)] [] (Var 15 result) Private .false. .false. () ), t: (Variable 14 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), zero_t: (Function (SymbolTable 16 { result: (Variable 16 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 16 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 16 x)] [] (Var 16 result) Private .false. .false. () ) }) array_tmpl [t plus_t zero_t mult_t] [(Require operations [t plus_t zero_t mult_t] )] ), mult_integer: (ExternalSymbol 9 mult_integer 2 mult_integer template_array_03_math [] mult_integer Public ), mult_real: (ExternalSymbol 9 mult_real 2 mult_real template_array_03_math [] mult_real Public ), operations: (Requirement (SymbolTable 10 { mult_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), result: (Variable 13 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) mult_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 result) Private .false. .false. () ), plus_t: (Function (SymbolTable 11 { l: (Variable 11 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 11 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), result: (Variable 11 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 11 l) (Var 11 r)] [] (Var 11 result) Private .false. .false. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), zero_t: (Function (SymbolTable 12 { result: (Variable 12 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 x)] [] (Var 12 result) Private .false. .false. () ) }) operations [t plus_t zero_t mult_t] [] ), test_template: (Function (SymbolTable 19 { arr: (Variable 19 arr [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), mymatmul_int: (Function (SymbolTable 20 { a: (Variable 20 a [i j] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 j))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 20 b [j k] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 j)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), elem: (Variable 20 elem [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 20 i [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 20 j [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 20 k [] In () () Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 20 r [i k] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 20 i)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 20 k))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 20 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 20 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 20 z [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mymatmul_int (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 i) (Var 20 j) (Var 20 k) (Var 20 a) (Var 20 b) (Var 20 r)] [(DoLoop () ((Var 20 x) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 i) ()) [(DoLoop () ((Var 20 z) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 k) ()) [(Assignment (Var 20 elem) (FunctionCall 9 zero_integer () [((ArrayItem (Var 20 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 20 y) (IntegerConstant 1 (Integer 4) Decimal) (Var 20 j) ()) [(Assignment (Var 20 elem) (FunctionCall 9 add_integer () [((Var 20 elem)) ((FunctionCall 9 mult_integer () [((ArrayItem (Var 20 a) [(() (Var 20 x) ()) (() (Var 20 y) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 20 b) [(() (Var 20 y) ()) (() (Var 20 z) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 20 r) [(() (Var 20 x) ()) (() (Var 20 z) ())] (Integer 4) ColMajor () ) (Var 20 elem) () .false. .false. )] [] )] [] )] () Public .false. .false. () ), r: (Variable 19 r [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 19 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 19 mymatmul_int () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 19 arr) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () )) ((ArrayPhysicalCast (Var 19 arr) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () )) ((ArrayPhysicalCast (Var 19 r) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) () ))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayItem (Var 19 r) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), zero_integer: (ExternalSymbol 9 zero_integer 2 zero_integer template_array_03_math [] zero_integer Public ), zero_real: (ExternalSymbol 9 zero_real 2 zero_real template_array_03_math [] zero_real Public ) }) template_array_03_m () [template_array_03_math template_array_03_m] .false. .false. .false. ), template_array_03_math: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 r) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 r) Public .false. .false. () ), add_real: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 y)] [(Assignment (Var 6 r) (RealBinOp (Var 6 x) Add (Var 6 y) (Real 4) () ) () .false. .false. )] (Var 6 r) Public .false. .false. () ), mult_integer: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mult_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (IntegerBinOp (Var 5 x) Mul (Var 5 y) (Integer 4) () ) () .false. .false. )] (Var 5 r) Public .false. .false. () ), mult_real: (Function (SymbolTable 8 { r: (Variable 8 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mult_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 r) (RealBinOp (Var 8 x) Mul (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 r) Public .false. .false. () ), zero_integer: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .false. .false. () ), zero_real: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 x)] [(Assignment (Var 7 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. )] (Var 7 r) Public .false. .false. () ) }) template_array_03_math () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_data-650e309.json0000664000175000017500000000075215141516316026304 0ustar alastairalastair{ "basename": "ast-fixedform_data-650e309", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_data.f", "infile_hash": "6fe89c2b6280304d8c329af8dade86a21e78f1189e2c58fe9cd6916b", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_data-650e309.stdout", "stdout_hash": "1d4c551e6cd8a923885aa6c3bfb8ef73afb84fcb771530fd8f296b7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-loop_unroll_large-c6b628b.json0000664000175000017500000000077515141516316027212 0ustar alastairalastair{ "basename": "asr-loop_unroll_large-c6b628b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_large.f90", "infile_hash": "6dea35d299ef0d2baadd87d2ed6132d3e57e15e85a4bef2d609d1d22", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_large-c6b628b.stdout", "stdout_hash": "4be1f31f1df8e54ecf678c49792088a353dd89e1019fc0c1fd232316", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_14-79df2e1.stdout0000664000175000017500000000617215141516316025517 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), types_14: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 2 s [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_14 [iso_fortran_env] [(Assignment (Var 2 r) (RealConstant 1.000000 (Real 8) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface4-034a306.stdout0000664000175000017500000002611515141516316027603 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { driver: (Function (SymbolTable 2 { driver2: (Function (SymbolTable 4 { }) driver2 (FunctionType [(FunctionType [(Integer 4) (Real 4) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [] () Public .false. .false. () ), f: (Function (SymbolTable 3 { f_arg_0: (Variable 3 f_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_arg_1: (Variable 3 f_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_arg_2: (Variable 3 f_arg_2 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Real 4) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f_arg_0) (Var 3 f_arg_1) (Var 3 f_arg_2)] [] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) driver (FunctionType [(Real 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f) (Var 2 n)] [(SubroutineCall 2 f () [((Var 2 n)) ((Var 2 i)) ((Var 2 j))] () .false. ) (SubroutineCall 2 driver2 () [((Var 2 f))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-end_program_name-2d38a01.stderr0000664000175000017500000000032715141516316027222 0ustar alastairalastairsyntax error: End program name does not match program name --> tests/errors/end_program_name.f90:1:1 - 2:17 | 1 | program name | ^^^^^^^^^^^^... ... | 2 | end program name2 | ...^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/cpp-case_02-9e53b61.json0000664000175000017500000000072215141516316024617 0ustar alastairalastair{ "basename": "cpp-case_02-9e53b61", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_02-9e53b61.stdout", "stdout_hash": "37e4c809436c9ce441b1aa757236a5b39d80b8a9fc078beb14b97fe9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err2-aa1ccd3.stderr0000664000175000017500000000021315141516316030115 0ustar alastairalastairC preprocessor error: Unexpected token '/' in factor() --> tests/errors/cpp_err2.f90:2:13 | 2 | #if 2 < 1+2+ / 1 2 | ^^^ lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_08-49d8a27.stdout0000664000175000017500000005400115141516316033103 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { function_08_a: (Module (SymbolTable 2 { }) function_08_a () [] .false. .false. .false. ), functions_08: (Program (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_real] [(Var 4 a)] [(Assignment (Var 4 x) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .false. .false. () ), f_real: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 5 a)] [(If () (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(Assignment (Var 5 b) (RealConstant 2.000000 (Real 4) ) () .false. .false. )] [(Assignment (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] )] (Var 5 b) Public .false. .false. () ), p: (Variable 3 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 3 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_08 [] [(Assignment (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-submodule_01-198736c.json0000664000175000017500000000074015141516316025633 0ustar alastairalastair{ "basename": "asr-submodule_01-198736c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/submodule_01.f90", "infile_hash": "e2738a16d41b50655f9aadcb09a0752dec5565a2ae749495d540d417", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-submodule_01-198736c.stderr", "stderr_hash": "6275283f1afb119c322a31f2e1fecdaa9a5f46e5070b2be671baba8f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-format_27-3469667.json0000664000175000017500000000071515141516316025101 0ustar alastairalastair{ "basename": "run-format_27-3469667", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_27.f90", "infile_hash": "2abc6c4108f92794b81644eadaa44c6542867b7dac138f276656fb6d", "outfile": null, "outfile_hash": null, "stdout": "run-format_27-3469667.stdout", "stdout_hash": "9d7266b9f5fd59e7fc3ba208639b54e6de527c3cc5590951ecf4973e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_05-2fed69e.stdout0000664000175000017500000000126015141516316024777 0ustar alastairalastair #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); static char * grade = "B"; if (grade == "A") { printf("%s\n","Excellent!"); } else if (grade == "B") { } else if (grade == "C") { printf("%s\n","Well done"); } else if (grade == "D") { printf("%s\n","You passed"); } else if (grade == "F") { printf("%s\n","Better try again"); } else { printf("%s\n","Invalid grade"); } printf("%s%s%s\n", "Your grade is ", " ", grade); return 0; } lfortran-lfortran-2f73434/tests/reference/ast_f90-program_04-4e711d5.json0000664000175000017500000000076315141516316026041 0ustar alastairalastair{ "basename": "ast_f90-program_04-4e711d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/program_04.f90", "infile_hash": "6d4faa951231e470e99cbc3ff617437048ceb99e3d92ba6e7810ef43", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-program_04-4e711d5.stdout", "stdout_hash": "50ee720f2d8e312d6a47c95d2456e67eb3c05a875b6192195957bdcc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-double_complex1-2f3d83c.stdout0000664000175000017500000000105415141516316027120 0ustar alastairalastair(TranslationUnit [(Program test_double_complex () [] [] [(Declaration (AttrType TypeDoubleComplex [] () () None ) [] [(y [] [] () () None ()) (zwork [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-format3-ee61b31.json0000664000175000017500000000066215141516316025053 0ustar alastairalastair{ "basename": "run-format3-ee61b31", "cmd": "lfortran --no-color {infile}", "infile": "tests/format3.f90", "infile_hash": "416c1b82f5461120638fce27597e42a9721aed16668f49fc146f94d3", "outfile": null, "outfile_hash": null, "stdout": "run-format3-ee61b31.stdout", "stdout_hash": "478638af760ebc36887ce7aaca13365ca0500aceeeb8b18a1d915a5a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_01-96f2648.json0000664000175000017500000000100115141516316030072 0ustar alastairalastair{ "basename": "ast-program_without_line_01-96f2648", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_01.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_01-96f2648.stderr", "stderr_hash": "58d3c9474a5ef269a382a3679ad492f6e66bd22f092ed9d04b945f16", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface5-6590dfc.json0000664000175000017500000000104715141516316030606 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface5-6590dfc", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface5.f90", "infile_hash": "a6d515b8d2cffc62b4e5f725328def2f8c0e7c0101e44fd2e4be5e83", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface5-6590dfc.stdout", "stdout_hash": "8bbe3114c3a53084d9ae35242216edf16effef733c922a255e1719ba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_no_prescan-no_prescan_include2-420be52.stdout0000664000175000017500000000030615141516316032067 0ustar alastairalastair(TranslationUnit [(Program include2 () [] [] [] [(Include 0 "include2b.f90" () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_types-bffc811.stderr0000664000175000017500000000027715141516316034171 0ustar alastairalastairsemantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/array_constructor_with_different_types.f90:2:18 | 2 | print *, [1, 2.] | ^^ lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce2-1f96d95.stdout0000664000175000017500000000566615141516316030263 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s) (t)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ()) (t [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (Assignment 0 t 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s t] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () ) (Assignment 0 t (+ t (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsic_implicit-b5b124f.stdout0000664000175000017500000001300715141516316027722 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fppasu: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), max0: (Variable 2 max0 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fppasu (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (Cast (IntrinsicElementalFunction Max [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntrinsicElementalFunction Max [(IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_08_func-2759ced.stderr0000664000175000017500000000032315141516316026644 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/arrays_08_func.f90:29:27 | 29 | r = r .and. (a(i) .eq. b(i)) | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/llvm-doloop_03-d4372bd.json0000664000175000017500000000075015141516316025445 0ustar alastairalastair{ "basename": "llvm-doloop_03-d4372bd", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_03-d4372bd.stdout", "stdout_hash": "226ee91892f31198923a7df99c5607752507c7c564025ed596e8bbe1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-intrinsics_02-707a51a.json0000664000175000017500000000074415141516316026064 0ustar alastairalastair{ "basename": "cpp-intrinsics_02-707a51a", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "cpp-intrinsics_02-707a51a.stdout", "stdout_hash": "9a3bf311b75e2c5f76f116336e7822db7d9fe7334f7ff92abd41ff46", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_02-acc6d43.stderr0000664000175000017500000000030615141516316027175 0ustar alastairalastairsemantic error: Type mismatch in argument `x`: expected `integer(4)[:]` but got `integer(8)[:]` --> tests/errors/implicit_call_02.f90:9:19 | 9 | call test_sub(arr) | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-nested_04-8423f42.stdout0000664000175000017500000004300615141516316025464 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_04: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_04_a [] b Public ), test: (Variable 5 test [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) nested_04 [nested_04_a] [(Assignment (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] ), nested_04_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Function (SymbolTable 4 { c: (Variable 4 c [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) c (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 z)] [(Print (StringFormat () [(Var 4 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 yy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 4 c) (Var 4 z) () .false. .false. )] (Var 4 c) Public .false. .false. () ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), yy: (Variable 3 yy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 yy) (RealConstant 6.600000 (Real 4) ) () .false. .false. ) (Assignment (Var 3 y) (Var 3 x) () .false. .false. ) (Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] (Var 3 b) Public .false. .false. () ) }) nested_04_a () [nested_04_a] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-error_stop2-7d55ddf.stdout0000664000175000017500000000064315141516316026407 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(If 0 () (Logical .true.) [(ErrorStop 0 () () () )] [] () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit3-016ebe4.stderr0000664000175000017500000000025415141516316025705 0ustar alastairalastairsemantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/implicit3.f90:3:1 | 3 | implicit real (a) | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-return_02-99fb0b3.json0000664000175000017500000000107115141516316025471 0ustar alastairalastair{ "basename": "llvm-return_02-99fb0b3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_02.f90", "infile_hash": "e5f24828e2cdf4070fa9095cd731b2eb065bd9c3cbb2885c825f0655", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_02-99fb0b3.stdout", "stdout_hash": "e62c5b6f9e2520c4f4c671648cf86f4500fab7e2ea307f3ae0182002", "stderr": "llvm-return_02-99fb0b3.stderr", "stderr_hash": "efcbccc2e2e71c4026b6ef48d5fa977b7432890f8fc2395640038aa4", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface2-5630d9d.json0000664000175000017500000000100315141516316027313 0ustar alastairalastair{ "basename": "asr-implicit_interface2-5630d9d", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface2.f90", "infile_hash": "17d4faebf0f6b3174637c94c038202e4d7eb71b2311836c34fa78898", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface2-5630d9d.stdout", "stdout_hash": "8be9b5723c8b814af38eb63d25b1b40c452795ed8273d7e599f57470", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_01-204dfa1.json0000664000175000017500000000076415141516316026277 0ustar alastairalastair{ "basename": "asr-select_type_01-204dfa1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_01.f90", "infile_hash": "4981b936f0ddf008f38b82c5717fa34093538455199276653661a08f", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_01-204dfa1.stdout", "stdout_hash": "7900c2117800c28f32671ec7e09d0faa1959c0b36207deb89499faf6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-implicit_typing1-40bb07b.json0000664000175000017500000000077115141516316026760 0ustar alastairalastair{ "basename": "run-implicit_typing1-40bb07b", "cmd": "lfortran --implicit-typing --disable-implicit-typing --no-color {infile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-implicit_typing1-40bb07b.stderr", "stderr_hash": "fb96f08b2d0e268a7652c10ceee84208546b1e2f786812f42c656613", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_02-1dafc5f.json0000664000175000017500000000076715141516316026556 0ustar alastairalastair{ "basename": "asr-template_add_02-1dafc5f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_02.f90", "infile_hash": "95dedcde4510d21053421bad8c1396a6d11065c339bbbed7132de2e1", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_02-1dafc5f.stdout", "stdout_hash": "234bd2efad8df409fa079ed90dbe5305a2c898dc01258f7b19bbf3a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-issue532-d63b703.stdout0000664000175000017500000000076215141516316025524 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_issue532 FINALIZE_SYMTABLE_issue532: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-types_06-6f66d2c.json0000664000175000017500000000074515141516316025333 0ustar alastairalastair{ "basename": "llvm-types_06-6f66d2c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_06.f90", "infile_hash": "821a3f29390ed022c7e72bdf2e4f9bace059d335abe1d1b729ac6d22", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_06-6f66d2c.stdout", "stdout_hash": "addfeef86620c798c4fd3c914febc22a1688116bb9c6ae55158c3575", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor3-1a6f5d9.stdout0000664000175000017500000000711115141516316031115 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor3: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor3 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerBinOp (IntegerConstant 12345678 (Integer 4) Decimal) Add (IntegerConstant 12345678 (Integer 4) Decimal) (Integer 4) (IntegerConstant 24691356 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_02_pack-233bae0.json0000664000175000017500000000076115141516316026067 0ustar alastairalastair{ "basename": "asr-array_02_pack-233bae0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_02_pack.f90", "infile_hash": "8d58570ab351e8b1ec04ca39b9a3dd9c099cffdcdf4ea487fe742f35", "outfile": null, "outfile_hash": null, "stdout": "asr-array_02_pack-233bae0.stdout", "stdout_hash": "c73accd2418d2a76fbbd41392b42230f07e99bb31c3aecffafe51113", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_39-aaf2ba8.json0000664000175000017500000000077415141516316027012 0ustar alastairalastair{ "basename": "asr_openmp-openmp_39-aaf2ba8", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_39.f90", "infile_hash": "ad3526cfb8a0d0c158dce1e8db3e86ea6516fd68238496485fb00d1a", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_39-aaf2ba8.stdout", "stdout_hash": "2ffba90e5c7168c18218162c1b41b5ff6d779748a83c54a07d88e945", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-45de3a2.stderr0000664000175000017500000000017615141516316027301 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/implicit_typing1.f90:3:1 | 3 | x = 1 | ^ 'x' is undeclared lfortran-lfortran-2f73434/tests/reference/llvm-allocate_03-495d621.json0000664000175000017500000000075615141516316025610 0ustar alastairalastair{ "basename": "llvm-allocate_03-495d621", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_03.f90", "infile_hash": "1f3440c7b139aaa793981c1458c516ddc41106d2950a39f47077b0f5", "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_03-495d621.stdout", "stdout_hash": "ab82afd8e87b4d76095e94a3a1fd0b3e25cec953981268d268bf9494", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_05-ee2fdac.json0000664000175000017500000000073015141516316025501 0ustar alastairalastair{ "basename": "julia-expr_05-ee2fdac", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_05-ee2fdac.stdout", "stdout_hash": "7deee894fa5887f2a3c037b0ccee9c3981a7b3bc3ddc57440f6a9bca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external_01-6754623.stdout0000664000175000017500000001643015141516316025746 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { foo: (Function (SymbolTable 2 { a: (Variable 2 a [] Out () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 5 { f_arg_0: (Variable 5 f_arg_0 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 5 f_return_var_name [] ReturnVar () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Complex 4)] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 f_arg_0)] [] (Var 5 f_return_var_name) Public .false. .false. () ) }) foo (FunctionType [(Complex 4) (Complex 4) (FunctionType [] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 f)] [(Assignment (Var 2 a) (FunctionCall 2 f () [((Var 2 b))] (Complex 4) () () ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_array_op-modules_43-6930881.stdout0000664000175000017500000013203115141516316027655 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_43: (Program (SymbolTable 5 { add_sources_from_dir: (ExternalSymbol 5 add_sources_from_dir 2 add_sources_from_dir modules_43_fpm_sources [] add_sources_from_dir Public ), sources: (Variable 5 sources [] Local () () Default (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 5 srcfile_t Source Public Required .false. .true. .false. () .false. .false. ), srcfile_t: (ExternalSymbol 5 srcfile_t 2 srcfile_t modules_43_fpm_sources [] srcfile_t Public ) }) modules_43 [modules_43_fpm_sources] [(Allocate [((Var 5 sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 5 add_sources_from_dir () [((Var 5 sources))] () .false. )] ), modules_43_fpm_sources: (Module (SymbolTable 2 { add_sources_from_dir: (Function (SymbolTable 4 { __1__libasr_index_: (Variable 4 __1__libasr_index_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __1_t: (Variable 4 __1_t [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), dir_sources: (Variable 4 dir_sources [] Local () () Default (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .false. .false. () .false. .false. ), exclude_source: (Variable 4 exclude_source [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), sources: (Variable 4 sources [] InOut () () Default (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 srcfile_t Source Public Required .false. .true. .false. () .false. .false. ) }) add_sources_from_dir (FunctionType [(Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sources)] [(Allocate [((Var 4 dir_sources) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (If () (LogicalNot (IntrinsicImpureFunction Allocated [(Var 4 sources)] 0 (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 sources) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () .false. .false. )] [(Assignment (Var 4 __1__libasr_index_) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 4 __1_t) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 sources) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 4 sources) [(() (Var 4 __1__libasr_index_) ())] (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) RowMajor () ) (ArrayItem (Var 4 sources) [(() (Var 4 __1_t) ())] (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) RowMajor () ) () .false. .false. ) (Assignment (Var 4 __1__libasr_index_) (IntegerBinOp (Var 4 __1__libasr_index_) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (Assignment (ArraySection (Var 4 sources) [((Var 4 __1__libasr_index_) (IntegerBinOp (IntegerBinOp (Var 4 __1__libasr_index_) Add (ArraySize (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () (Integer 4) () ) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 dir_sources) () (Integer 4) () ))] PointerArray ) () ) (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 4 __1__libasr_index_) (IntegerBinOp (Var 4 __1__libasr_index_) Add (ArraySize (IntrinsicArrayFunction Pack [(Var 4 dir_sources) (ArrayPhysicalCast (LogicalNot (Var 4 exclude_source) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) () (Integer 4) () ) (Integer 4) () ) () .false. .false. )] )] () Public .false. .false. () ), srcfile_t: (Struct (SymbolTable 3 { digest: (Variable 3 digest [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), exe_name: (Variable 3 exe_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_name: (Variable 3 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) srcfile_t (StructType [(Integer 8) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [file_name exe_name digest] [] Source Public .false. .false. [] () () ) }) modules_43_fpm_sources () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit6-061f8e3.stdout0000664000175000017500000001222015141516316025651 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ch12n: (Function (SymbolTable 2 { ch12n: (Variable 2 ch12n [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ci: (Variable 2 ci [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) ch12n (FunctionType [(Integer 4) (Complex 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 z)] [(Assignment (Var 2 ci) (ComplexConstructor (RealConstant 0.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) (Complex 8) (ComplexConstant 0.000000 1.000000 (Complex 8) ) ) () .false. .false. )] (Var 2 ch12n) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-data1-01ffd6c.stdout0000664000175000017500000000324215141516316025564 0ustar alastairalastairprogram data1 type :: person integer :: age character(len=20) :: fullname end type person character(len=10) :: myname integer, dimension(0:9) :: miles real, dimension(100,100) :: skew type(person) :: yourname real(8), parameter :: sin3 = sin(3.d0) real(8), parameter :: cos3 = cos(3.d0) real(8) :: s(10) integer :: iarx(3,1), iary(3,1) data myname/"xyz"/, miles/0, 0, 0, 0, 0, 0, 0, 0, 0, 0/ data yourname%age, yourname%fullname/35, "abc"/ data ((skew(k, j), j = 1, k), integer(4) :: k = 1, 10)/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ data ((skew(k, j), j = 1, k, k), integer(4) :: k = 1, 100, 2)/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/ data ((skew(k, j), j = k + 1, 10), k = 1, 3)/1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data ((skew(k, j), j = k + 1, 10, k), k = 1, 3, 1)/1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0/ data s/1.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, sin3, cos3, 0.d0, -1.d0/ print *, "Your name is: ", yourname%fullname print *, "Your age is: ", yourname%age data (iarx(i, 1), iary(i, 1), i = 1, 3)/1, 9, 1950, 1350, 4350, 4/ print *, "My name is: ", myname data (iary(i, 1), i = 1, 3)/1, 9, 1950/ end program data1 lfortran-lfortran-2f73434/tests/reference/ast_f90-case_05-0476e14.stdout0000664000175000017500000000065515141516316025577 0ustar alastairalastairprogram case_05 implicit none ! local variable declaration character :: grade = "B" select case (grade) case ("A") print *, "Excellent!" case ("B") case ("C") print *, "Well done" case ("D") print *, "You passed" case ("F") print *, "Better try again" case default print *, "Invalid grade" end select print *, "Your grade is ", grade end program case_05 lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_complex-16f8004.stderr0000664000175000017500000000023215141516316031366 0ustar alastairalastairsemantic error: Kind 6 is not supported for Complex --> tests/errors/kind_invalid_int_of_complex.f90:3:13 | 3 | complex(6) :: x | ^ lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop1-1d0df34.json0000664000175000017500000000071515141516316026715 0ustar alastairalastair{ "basename": "run-implied_do_loop1-1d0df34", "cmd": "lfortran --no-color {infile}", "infile": "tests/implied_do_loop1.f90", "infile_hash": "7443c3a7fc3b197f6fc90dcb12fac71feecd7e3895b3b32b0c6fad91", "outfile": null, "outfile_hash": null, "stdout": "run-implied_do_loop1-1d0df34.stdout", "stdout_hash": "ace582716591b04fdfc6236ef01b77a190242deeba1acaed9a726244", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-entry_06-b57385d.stdout0000664000175000017500000010076515141516316025440 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry_06: (Program (SymbolTable 5 { mvndfn: (Function (SymbolTable 6 { mvndfn: (Variable 6 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 6 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mvndfn (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 w)] [] (Var 6 mvndfn) Public .false. .false. () ), w: (Variable 5 w [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) entry_06 [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 5 mvndfn () [((ArrayPhysicalCast (Var 5 w) FixedSizeArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] UnboundedPointerArray ) () ))] (Real 8) () () ) Sub (RealConstant 1.200000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), mvndfn: (Function (SymbolTable 2 { mvndfn: (Variable 2 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 2 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mvndfn (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [mvndfn_main__lcompilers] [(Var 2 w)] [(Assignment (Var 2 mvndfn) (FunctionCall 1 mvndfn_main__lcompilers 1 mvndfn_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 w))] (Real 8) () () ) () .false. .false. )] (Var 2 mvndfn) Public .false. .false. () ), mvndfn_main__lcompilers: (Function (SymbolTable 4 { entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), mvndfn: (Variable 4 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), mvndfn_main__lcompilers: (Variable 4 mvndfn_main__lcompilers [] ReturnVar () () Default (Real 8) 4 mvndfn Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 4 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mvndfn_main__lcompilers (FunctionType [(Integer 4) (Array (Real 8) [(() ())] UnboundedPointerArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 w)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 mvndfn_main__lcompilers) (RealConstant 1.200000 (Real 8) ) () .false. .false. ) (GoToTarget 2 2 ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealConstant 10.900000 (Real 8) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Sub (RealConstant 10.900000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 mvndfn_main__lcompilers) (RealConstant 1.200000 (Real 8) ) () .false. .false. )] (Var 4 mvndfn_main__lcompilers) Public .false. .false. () ), mvndnt: (Function (SymbolTable 3 { mvndfn: (Variable 3 mvndfn [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), mvndnt: (Variable 3 mvndnt [] ReturnVar () () Default (Real 8) 3 mvndfn Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 3 w [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mvndnt (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [mvndfn_main__lcompilers] [] [(Assignment (Var 3 mvndnt) (FunctionCall 1 mvndfn_main__lcompilers 1 mvndfn_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 3 w))] (Real 8) () () ) () .false. .false. )] (Var 3 mvndnt) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-write1-170ef53.json0000664000175000017500000000070715141516316024622 0ustar alastairalastair{ "basename": "ast-write1-170ef53", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/write1.f90", "infile_hash": "75eba9b93bd747fb18efbf173e1d35340019e1c62f38efc3a4cbcf22", "outfile": null, "outfile_hash": null, "stdout": "ast-write1-170ef53.stdout", "stdout_hash": "8010a23c5bb02456c1bc42fb2e30ae0366b9c33b40b6724cd6a12211", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-return_01-495409d.json0000664000175000017500000000107115141516316025334 0ustar alastairalastair{ "basename": "llvm-return_01-495409d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_01.f90", "infile_hash": "a2ba2932ff6e67ee7972619b545d6fbf6d4e3987a09beff2296d6295", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_01-495409d.stdout", "stdout_hash": "0fc27de719ced6ae5187dae7f9d7ffada1c20165f210ebbee6c5f953", "stderr": "llvm-return_01-495409d.stderr", "stderr_hash": "98d80e924c656c0c4a14372c1012a5da09682be3684f582f50255347", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external2-e21d7a5.stdout0000664000175000017500000001401015141516316025730 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { sub2: (Function (SymbolTable 4 { sub2_arg_0: (Variable 4 sub2_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub2 (FunctionType [(Real 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sub2_arg_0)] [] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 sub2)] [(SubroutineCall 2 sub2 () [((Var 2 x))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-string_allocation_01-8484aaf.json0000664000175000017500000000074015141516316027521 0ustar alastairalastair{ "basename": "run-string_allocation_01-8484aaf", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_allocation_01.f90", "infile_hash": "cd0f6232a42aa948f55971480a8894730237824e112755a510b37317", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-string_allocation_01-8484aaf.stderr", "stderr_hash": "798d42b98a53bf914ee8d9bb8714e1bc4fdf04128ec7028805b8eaed", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine3b-7e4c8ab.json0000664000175000017500000000072215141516316026510 0ustar alastairalastair{ "basename": "julia-subroutine3b-7e4c8ab", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine3b-7e4c8ab.stdout", "stdout_hash": "b9e4b2cd4c60ca38d65caeade2362911283f0dce306905bb2bff712f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics11-7200632.stderr0000664000175000017500000000025315141516316026113 0ustar alastairalastairsemantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/intrinsics11.f90:4:14 | 4 | print *, hypot(x, y) | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/julia-block_02-1362742.stdout0000664000175000017500000000047415141516316025527 0ustar alastairalastairfunction square(b::Int32) local result::Int32 result = b * b println(result) end function main() local a::Int32 a = 10 @label label_1 let b::Int32 a = a + 5 if a == 15 @goto label_1 end b = a ÷ 2 square(b) end end main() lfortran-lfortran-2f73434/tests/reference/julia-doloop_02-13efa8f.json0000664000175000017500000000073615141516316025666 0ustar alastairalastair{ "basename": "julia-doloop_02-13efa8f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_02-13efa8f.stdout", "stdout_hash": "5b604b185db4645137879631e1fee5d8c404f0a2182d0f8a7e0e0df8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-goto_02-fc47ad0.stdout0000664000175000017500000001042415141516316025364 0ustar alastairalastair(TranslationUnit [(Program goto2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(A [] [] () () None ())] () )] [(Assignment 0 A 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 1 () ) (Write 0 [(()) (())] [] [] () ) (Assignment 0 A (+ A 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> A 2) [(GoTo 0 () 95 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Starting" ())] () ) (If 0 () (== A 1) [(GoTo 0 () 10 [] () )] [] () () () ) (GoTo 0 () 20 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 10 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 10" ())] () ) (GoTo 0 () 30 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 20 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 20" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 30 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 30" ())] () ) (If 0 () (== A 2) [(GoTo 0 () 99 [] () )] [] () () () ) (GoTo 0 () 1 [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Continue 95 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 95" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Continue 99 () ) (Write 0 [(()) (())] [] [(String "A =" ()) A (String " Got to 99" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Stop 0 (String " " ()) () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-arrays_09-5096a19.json0000664000175000017500000000074515141516316025146 0ustar alastairalastair{ "basename": "ast-arrays_09-5096a19", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_09.f90", "infile_hash": "4807239e4f9ca8eaee4604e98cad28c2a760cf3900a1e2018d304838", "outfile": null, "outfile_hash": null, "stdout": "ast-arrays_09-5096a19.stdout", "stdout_hash": "15dcb38cd14eb4bbf06cc6090201752843d2f94986b6054ac0500d45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_04-2e3d8fb.stderr0000664000175000017500000000054215141516316030246 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'my'. Tried to match size 4 of dimension 2 of argument number 1, but expected size is 1 --> tests/errors/array_bounds_check_04.f90:5:13 | 5 | call my(x) | ^ | 10 | integer, intent(in) :: x(3, 1) | ~ Expected range 1:1, got 4 lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor7-4734850.stdout0000664000175000017500000000316415141516316030704 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor7: (Program (SymbolTable 2 { }) preprocessor7 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 4 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 4 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-global_scope6-b11d04e.stdout0000664000175000017500000000212015141516316026532 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-lfortran-2f73434/tests/reference/run-print3-b6beca0.json0000664000175000017500000000065715141516316025057 0ustar alastairalastair{ "basename": "run-print3-b6beca0", "cmd": "lfortran --no-color {infile}", "infile": "tests/print3.f90", "infile_hash": "891fa35fc5d09524ef73c8c3b92bcd5a4bede01e35fdf0f116df99b2", "outfile": null, "outfile_hash": null, "stdout": "run-print3-b6beca0.stdout", "stdout_hash": "b7a8e92f3ad654f0db00b67a50310de56893a8ef6bcf296f40cdece5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-ichar_01-a5284c8.json0000664000175000017500000000072415141516316024776 0ustar alastairalastair{ "basename": "asr-ichar_01-a5284c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ichar_01.f90", "infile_hash": "96e818fc8837a0604686a6414be1828c77eef5189d2cece2e0d130d9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ichar_01-a5284c8.stderr", "stderr_hash": "acd2bd0eb673fed1e139af2f060958c180fba50a2fa022469790cb0e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-functions_05-adf0d8b.stdout0000664000175000017500000007422215141516316026513 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 x) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4) () ) () .false. .false. )] (Var 3 b) Public .false. .false. () ), f_real: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [signr32] [(Var 4 a)] [(Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4) )) ((Var 4 a))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .false. .false. () ), p: (Variable 2 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), signr32: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) signr32 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (Var 5 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 5 r) (Var 5 x) () .false. .false. )] [(Assignment (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4) () ) () .false. .false. )] )] (Var 5 r) Public .false. .false. () ), x: (Variable 2 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_01 [] [(Assignment (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4) ) (Real 4) (RealConstant -30.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-expr5-3c9d655.json0000664000175000017500000000070415141516316024457 0ustar alastairalastair{ "basename": "ast-expr5-3c9d655", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "ast-expr5-3c9d655.stdout", "stdout_hash": "8626e1d712d0239ce42b57162895d1011f9ef06bf475c4a6f5450154", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-int_02-e7de6a7.stdout0000664000175000017500000001233715141516316025223 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_15: (Program (SymbolTable 2 { x1: (Variable 2 x1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x2: (Variable 2 x2 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y1: (Variable 2 y1 [x1] Local (IntrinsicElementalFunction Int [(Var 2 x1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y2: (Variable 2 y2 [x2] Local (IntrinsicElementalFunction Int [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_15 [] [(Print (StringFormat () [(Var 2 y1) (Var 2 y2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-bits_04-d0f89f1.stdout0000664000175000017500000021346415141516316025317 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_04: (Program (SymbolTable 2 { }) bits_04 [] [(If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bgt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Bge [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Ble [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) (IntegerConstant -10 (Integer 4) Decimal) ) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 4 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerUnaryMinus (IntegerConstant 4 (Integer 8) Decimal) (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerConstant 10 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntrinsicElementalFunction Blt [(IntegerUnaryMinus (IntegerConstant 10 (Integer 8) Decimal) (Integer 8) (IntegerConstant -10 (Integer 8) Decimal) ) (IntegerConstant 0 (Integer 8) Decimal)] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_37-2c7ae83.stdout0000664000175000017500000052634315141516316027236 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_37: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ik: (Variable 2 ik [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nk: (Variable 2 nk [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_37 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nk) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPPrivate [(Var 2 iy) (Var 2 ix)] )] [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 2 (Integer 4) Decimal) )] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] ) (OMPRegion ParallelDo [] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] )] [] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-types_02-b5bfe0b.json0000664000175000017500000000074515141516316025454 0ustar alastairalastair{ "basename": "llvm-types_02-b5bfe0b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_02-b5bfe0b.stdout", "stdout_hash": "3e6b692e0d6c6dffe538915c059875468d7aa95ef19ec91d56dfb953", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fn2-b585098.stdout0000664000175000017500000002403315141516316024373 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 2 a) Public .false. .false. () ), b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 b) Public .false. .false. () ), c: (Function (SymbolTable 4 { c: (Variable 4 c [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) c (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 c) Public .false. .false. () ), d: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) d (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 5 r) Public .false. .false. () ), e: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) e (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 r) Public .false. .false. () ), f: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 r) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format4-aaf60f4.json0000664000175000017500000000066215141516316025135 0ustar alastairalastair{ "basename": "run-format4-aaf60f4", "cmd": "lfortran --no-color {infile}", "infile": "tests/format4.f90", "infile_hash": "3c91cadf1851b5203fa5f2904ef5d6b588f591c535efa7325f1f2e13", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-format4-aaf60f4.stderr", "stderr_hash": "3c4c7e7bc1c826a3726a68d9ad6593d0426e0f2f724d5627ca76dab4", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-compare_01-c98905f.json0000664000175000017500000000073215141516316025346 0ustar alastairalastair{ "basename": "asr-compare_01-c98905f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/compare_01.f90", "infile_hash": "21afd80a6b0d843b42712983504099e18283c93b9a98101e0613e6c9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-compare_01-c98905f.stderr", "stderr_hash": "5015812ef55e87ef0ec0a5deec02333e66183f99b81ff453e5301e8e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_call_filter_01-5a87413.stdout0000664000175000017500000003526615141516316032610 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 7 { a: (Variable 7 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_call_filter_01: (Program (SymbolTable 4 { modproc: (ExternalSymbol 4 modproc 2 modproc nested_call_filter_mod [] modproc Public ), outer: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (ExternalSymbol 5 a1 7 a __lcompilers_created__nested_context__outer_ [] a Public ), a2: (ExternalSymbol 5 a2 7 a __lcompilers_created__nested_context__outer_ [] a Public ), a3: (ExternalSymbol 5 a3 7 a __lcompilers_created__nested_context__outer_ [] a Public ), inner: (Function (SymbolTable 6 { a: (ExternalSymbol 6 a 7 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 a) (IntegerBinOp (Var 6 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 a3) (Var 5 a) () .false. .false. ) (SubroutineCall 5 inner () [] () .false. ) (Assignment (Var 5 a) (Var 5 a3) () .false. .false. ) (SubroutineCall 4 modproc () [((Var 5 a2))] () .false. )] () Public .false. .false. () ) }) nested_call_filter_01 [nested_call_filter_mod] [(SubroutineCall 4 outer () [] () .false. )] ), nested_call_filter_mod: (Module (SymbolTable 2 { modproc: (Function (SymbolTable 3 { y: (Variable 3 y [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modproc (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 y)] [(Assignment (Var 3 y) (IntegerBinOp (Var 3 y) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) nested_call_filter_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_01-960dafe.stdout0000664000175000017500000012271515141516316027274 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { 1_y: (ExternalSymbol 1 1_y 2 y derived_types_01_m_01 [] y Public ), derived_types_01: (Program (SymbolTable 8 { 1_x_i: (ExternalSymbol 8 1_x_i 3 i x [] i Public ), 1_x_r: (ExternalSymbol 8 1_x_r 3 r x [] r Public ), 1_y_d: (ExternalSymbol 8 1_y_d 4 d 1_y [] d Public ), 1_z_k: (ExternalSymbol 8 1_z_k 7 k z [] k Public ), 1_z_l: (ExternalSymbol 8 1_z_l 7 l z [] l Public ), b: (Variable 8 b [] Local () () Default (StructType [(Integer 4) (Real 4)] [] .true. .false. ) 8 x Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 8 c [] Local () () Default (StructType [(Complex 4) (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) 8 z Source Public Required .false. .false. .false. () .false. .false. ), set: (ExternalSymbol 8 set 2 set derived_types_01_m_01 [] set Public ), x: (ExternalSymbol 8 x 2 x derived_types_01_m_01 [] x Public ), z: (ExternalSymbol 8 z 6 z derived_types_01_m_02 [] z Public ) }) derived_types_01 [derived_types_01_m_02 derived_types_01_m_01] [(Assignment (StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 8 set () [((Var 8 b))] () .false. ) (Print (StringFormat () [(StructInstanceMember (Var 8 b) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 b) 8 1_x_r (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () ) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 2.000000 (Complex 4) ) ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 8 set () [((StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ))] () .false. ) (Print (StringFormat () [(StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_r (Real 4) () ) (StructInstanceMember (StructInstanceMember (StructInstanceMember (Var 8 c) 8 1_z_l (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) () ) 8 1_y_d (StructType [(Integer 4) (Real 4)] [] .true. .false. ) () ) 8 1_x_i (Integer 4) () ) (StructInstanceMember (Var 8 c) 8 1_z_k (Complex 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), derived_types_01_m_01: (Module (SymbolTable 2 { set: (Function (SymbolTable 5 { 1_x_i: (ExternalSymbol 5 1_x_i 3 i x [] i Public ), 1_x_r: (ExternalSymbol 5 1_x_r 3 r x [] r Public ), a: (Variable 5 a [] Out () () Default (StructType [(Integer 4) (Real 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. ) }) set (FunctionType [(StructType [(Integer 4) (Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a)] [(Assignment (StructInstanceMember (Var 5 a) 5 1_x_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 a) 5 1_x_r (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. )] () Public .false. .false. () ), x: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x (StructType [(Integer 4) (Real 4)] [] .true. .false. ) [] [r i] [] Source Public .false. .false. [] () () ), y: (Struct (SymbolTable 4 { c: (Variable 4 c [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 4 d [] Local () () Default (StructType [(Integer 4) (Real 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. ) }) y (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) [x] [c d] [] Source Public .false. .false. [] () () ) }) derived_types_01_m_01 () [] .false. .false. .false. ), derived_types_01_m_02: (Module (SymbolTable 6 { y: (ExternalSymbol 6 y 2 y derived_types_01_m_01 [] y Public ), z: (Struct (SymbolTable 7 { k: (Variable 7 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 7 l [] Local () () Default (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. ) 6 y Source Public Required .false. .false. .false. () .false. .false. ) }) z (StructType [(Complex 4) (StructType [(Complex 4) (StructType [(Integer 4) (Real 4)] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) [y] [k l] [] Source Public .false. .false. [] () () ) }) derived_types_01_m_02 () [derived_types_01_m_01] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dprod_01-80a930c.json0000664000175000017500000000072415141516316025011 0ustar alastairalastair{ "basename": "asr-dprod_01-80a930c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dprod_01.f90", "infile_hash": "d1ce33c89bee90c6db80924ecb910e367598d14758aafaa9303aeeb1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dprod_01-80a930c.stderr", "stderr_hash": "e2b330264207fb4416b7623e66f71d83926b820e67b727c487394dfd", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine1-b6656b7.stderr0000664000175000017500000000020715141516316026221 0ustar alastairalastairsemantic error: Assignment to subroutine is not allowed --> tests/errors/subroutine1.f90:5:9 | 5 | bpe = 1 | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics4-113f724.json0000664000175000017500000000073515141516316025574 0ustar alastairalastair{ "basename": "asr-intrinsics4-113f724", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics4.f90", "infile_hash": "ed2175be9e9694d0cef36f97f3f74e236df03c8b2cc7ab3f155b5025", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics4-113f724.stderr", "stderr_hash": "e8e8ad6a3f7b8dcbe5c01b3b96feadc46c761a052df71a8522f71218", "returncode": 2 }././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.jsonlfortran-lfortran-2f73434/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e266010000664000175000017500000000107715141516316034145 0ustar alastairalastair{ "basename": "llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/unlimited_polymorphic_intrinsic_type_allocate.f90", "infile_hash": "5e3fd98f08d2d9173c3610e43114224b2865c77917c3c0faa1951861", "outfile": null, "outfile_hash": null, "stdout": "llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.stdout", "stdout_hash": "767712acc47631fefba5f9285d633102671fdfa926c0e3f8d0bb0bfe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07c-901677a.json0000664000175000017500000000076215141516316027027 0ustar alastairalastair{ "basename": "asr-template_error_07c-901677a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07c.f90", "infile_hash": "5a4d161fc22863d78263e4a5e4a34a63e5f5a73e4c894b4ac91ea35b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07c-901677a.stderr", "stderr_hash": "26d480e92127e294998ca7f559ccb8d78bc7b057256d7baf17483da4", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_04-bf080aa.json0000664000175000017500000000100115141516316030266 0ustar alastairalastair{ "basename": "ast-program_without_line_04-bf080aa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_04.f90", "infile_hash": "2472f436e81a455036413e097c9177de811e6eeb2b78579076e00bee", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_04-bf080aa.stdout", "stdout_hash": "07d77481a3e5fd16c38342d0b79d66659db3518386c72f91bfb82432", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-data3-0afaffe.json0000664000175000017500000000070415141516316024674 0ustar alastairalastair{ "basename": "asr-data3-0afaffe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/data3.f90", "infile_hash": "b4838a394f3b26e78e6092c67193187a539ff83b61c12d3468a6a030", "outfile": null, "outfile_hash": null, "stdout": "asr-data3-0afaffe.stdout", "stdout_hash": "31880d5073367012e37a9a14e850804d1cf929e24746e03b253f797f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_05-4c31742.stdout0000664000175000017500000001045215141516316026362 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_05 [] [(Assignment (Var 2 x) (IntrinsicElementalFunction Sinh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 1.175201 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Cosh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 1.543081 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Tanh [(RealConstant 1.000000 (Real 4) )] 0 (Real 4) (RealConstant 0.761594 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-c_ptr_02-fce1b0e.json0000664000175000017500000000074215141516316025227 0ustar alastairalastair{ "basename": "asr-c_ptr_02-fce1b0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/c_ptr_02.f90", "infile_hash": "b2f28a737ab24c02c4aa0fe0d88023004fbd708e506952f4c61b3211", "outfile": null, "outfile_hash": null, "stdout": "asr-c_ptr_02-fce1b0e.stdout", "stdout_hash": "99cd3451dfe7e2fe381aa3663a0d7f63e90acb05e34712be163061a6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence2-a095a33.json0000664000175000017500000000100415141516316031173 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence2-a095a33", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence2.f90", "infile_hash": "64f44de76cd08c4e21e4f8e05bb2747574f998c95bcdb8d474c8c449", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence2-a095a33.stdout", "stdout_hash": "ceb3972a4c1cdd81d16bc86d83173dbab5f181773ce8f1b1defed487", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form1-7fa677f.json0000664000175000017500000000074115141516316025705 0ustar alastairalastair{ "basename": "ast-fixed_form1-7fa677f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form1.f", "infile_hash": "a6774c19d8ae1f0ab04227a596e393ce26d84d1c0f796b7187a87f1a", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form1-7fa677f.stdout", "stdout_hash": "df87735dcdbe5b242827a4b47e5d9b7fea700b78b11f0a4b5835b17a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-interface_12-2e5ecb8.json0000664000175000017500000000076115141516316026177 0ustar alastairalastair{ "basename": "llvm-interface_12-2e5ecb8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_12.f90", "infile_hash": "800cf79ed2c17c44073c43bc8ae9453e21c3858b328a398f3246061f", "outfile": null, "outfile_hash": null, "stdout": "llvm-interface_12-2e5ecb8.stdout", "stdout_hash": "28b97653df8d4e9143537823971a96aef2d3582d616afd7ec30359dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp7-cec734d.json0000664000175000017500000000074415141516316026666 0ustar alastairalastair{ "basename": "asr_preprocess-cpp7-cec734d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp7.f90", "infile_hash": "7fd2c5f2e27e38f3077d73ff101677fca4440938898d80a835bc0579", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp7-cec734d.stderr", "stderr_hash": "161849f4e8dbf12024e5879cee3cb861e2f067404aeabf71e73e188b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-end_module_name-8436c0b.stderr0000664000175000017500000000032215141516316027044 0ustar alastairalastairsyntax error: End module name does not match module name --> tests/errors/end_module_name.f90:1:1 - 3:16 | 1 | module name1 | ^^^^^^^^^^^^... ... | 3 | end module name2 | ...^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent2-9ec99ee.stdout0000664000175000017500000000046615141516316027550 0ustar alastairalastairsubroutine do_concurrent2(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i = 1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine do_concurrent2 lfortran-lfortran-2f73434/tests/reference/ast_f90-write1-6827691.json0000664000175000017500000000072215141516316025151 0ustar alastairalastair{ "basename": "ast_f90-write1-6827691", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/write1.f90", "infile_hash": "75eba9b93bd747fb18efbf173e1d35340019e1c62f38efc3a4cbcf22", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-write1-6827691.stdout", "stdout_hash": "b7350e07cee74319a8cc97e0ef84988f663a50cc1f3785a676127c46", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr7-68a8628.stdout0000664000175000017500000000011415141516316024751 0ustar alastairalastair(TranslationUnit [5_int32 5_int64 5_l 5__l_3 5__l_3_] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_dp-7286fd2.stdout0000664000175000017500000000536115141516316026306 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_8 = type <{ double, double }> %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [24 x i8] c"{R8,R8},{R4,R4},{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %v = alloca %complex_8, align 8 %x = alloca %complex_4, align 8 %zero = alloca %complex_4, align 8 store %complex_4 zeroinitializer, %complex_4* %zero, align 1 store %complex_8 <{ double 0x3FF0CCCCC0000000, double 0x3FF0CCCCC0000000 }>, %complex_8* %v, align 1 store %complex_4 <{ float 0x3FF0CCCCC0000000, float 0x3FF0CCCCC0000000 }>, %complex_4* %x, align 1 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %complex_8* %v, %complex_4* %x, %complex_4* %zero) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex_dp FINALIZE_SYMTABLE_complex_dp: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-c_f_pointer_01-2d288d7.stderr0000664000175000017500000000033415141516316026532 0ustar alastairalastairsemantic error: shape argument specified in c_f_pointer even though fptr is not an array. --> tests/errors/c_f_pointer_01.f90:5:34 | 5 | call c_f_pointer(queries, x, [2]) | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-modules_28-9506bba.json0000664000175000017500000000075015141516316025442 0ustar alastairalastair{ "basename": "asr-modules_28-9506bba", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_28.f90", "infile_hash": "0fe02444ac1b5b30e62b86a49a930b9480573b556960f066ba59133d", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_28-9506bba.stdout", "stdout_hash": "57215dbdb592ab6d0e376ae4b6d9ed97a3b2f7abd3bbee495cf4dd1b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_simd-4dab78a.stderr0000664000175000017500000000221615141516316031332 0ustar alastairalastairsemantic error: SIMD arrays must be 1 dimensional, but `simd_2d` has 2 dimensions --> tests/errors/continue_compilation_simd.f90:5:5 | 5 | real :: simd_2d(8, 8) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: SIMD arrays cannot be allocatable: `simd_alloc` --> tests/errors/continue_compilation_simd.f90:6:5 | 6 | real, allocatable :: simd_alloc(:) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: SIMD arrays cannot be pointers: `simd_ptr` --> tests/errors/continue_compilation_simd.f90:7:5 | 7 | real, pointer :: simd_ptr(:) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The SIMD variable `simd_scalar` must be an array --> tests/errors/continue_compilation_simd.f90:8:5 | 8 | real :: simd_scalar | ^^^^^^^^^^^^^^^^^^^ semantic error: SIMD arrays must have Real or Integer element type, but `simd_char` has an incompatible type --> tests/errors/continue_compilation_simd.f90:9:5 | 9 | character :: simd_char(8) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The SIMD variable `x` must be an array --> tests/errors/continue_compilation_simd.f90:10:5 | 10 | real :: x | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-array16-b6f006f.stdout0000664000175000017500000000003015141516316025326 0ustar alastairalastair1 2 3 4 5 6 lfortran-lfortran-2f73434/tests/reference/asr-submodule_01-198736c.stderr0000664000175000017500000000035115141516316026163 0ustar alastairalastairsemantic error: Procedure 'func' must be declared within a generic module interface --> tests/errors/submodule_01.f90:14:3 - 16:1 | 14 | module procedure func | ^^^^^^^^^^^^^^^^^^^^^... ... | 16 | | ...^ lfortran-lfortran-2f73434/tests/reference/ast-namelist_01-032372e.json0000664000175000017500000000075315141516316025437 0ustar alastairalastair{ "basename": "ast-namelist_01-032372e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/namelist_01.f90", "infile_hash": "82b81ebf89597c4cee2bae25cbe602a58d7d628cf9dec14337630861", "outfile": null, "outfile_hash": null, "stdout": "ast-namelist_01-032372e.stdout", "stdout_hash": "dbc63b7acc68b1eb32fe028442d79c0ee03117051d4e35550f74d2b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-types_04-054550e.json0000664000175000017500000000072515141516316024777 0ustar alastairalastair{ "basename": "wat-types_04-054550e", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "wat-types_04-054550e.stdout", "stdout_hash": "3c10352c3e82dc8c629b030759d05559b9519fcda9afa7bcfada5351", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format7-5662bc0.stdout0000664000175000017500000000003315141516316025341 0ustar alastairalastair(es15.8e2) 1.00000000E+00 lfortran-lfortran-2f73434/tests/reference/asr-modules_12-744ab27.stdout0000664000175000017500000000700215141516316025723 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_12: (Module (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) module_12 () [] .false. .false. .false. ), prog_module_12: (Program (SymbolTable 3 { a: (ExternalSymbol 3 a 2 a module_12 [] a Public ) }) prog_module_12 [module_12] [(Assignment (ArrayItem (Var 3 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 3 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-block_03-6c8fdd8.stdout0000664000175000017500000002231515141516316025525 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { block_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), loop: (Block (SymbolTable 4 { b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) loop [(Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (Assignment (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 1 square () [((Var 4 b))] () .false. )] ) }) block_02 [] [(Assignment (Var 2 a) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 1 1 ) (BlockCall -1 2 loop )] ), square: (Function (SymbolTable 3 { b: (Variable 3 b [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), result: (Variable 3 result [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) square (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 b)] [(Assignment (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 result)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-modules_13-6b5ac80.json0000664000175000017500000000075315141516316025624 0ustar alastairalastair{ "basename": "llvm-modules_13-6b5ac80", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_13.f90", "infile_hash": "4781335f29ad38af698fbda1884929e97755c6c34f445e65b30a36ed", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_13-6b5ac80.stdout", "stdout_hash": "2927f300656c5b072e23db5b9bc74ae40e5618573c28e1ad1ef9880d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-types_12-025af39.json0000664000175000017500000000074215141516316025053 0ustar alastairalastair{ "basename": "ast-types_12-025af39", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_12.f90", "infile_hash": "d5db9207ff7ebb121312ebf448d4b591da2b645185b23095e2558455", "outfile": null, "outfile_hash": null, "stdout": "ast-types_12-025af39.stdout", "stdout_hash": "276add62a512cac401d26a5b58d3cf079a8fa2fca888526d60042a44", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_real-6c5e850.json0000664000175000017500000000076715141516316026411 0ustar alastairalastair{ "basename": "llvm-arrays_01_real-6c5e850", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_real.f90", "infile_hash": "52d4b470c5523650dead5fa570d62db7293b9ecd23758e3cc4ba28c2", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_real-6c5e850.stdout", "stdout_hash": "b176ecfd9eea8c75b004d5ae364429748cdd16d34c5ed442211994ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-program1-29eca93.json0000664000175000017500000000072015141516316025402 0ustar alastairalastair{ "basename": "llvm-program1-29eca93", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "llvm-program1-29eca93.stdout", "stdout_hash": "d2ba4a52b0d0e2a8951914a1e28e0b9f2d699c0389bbe58a1067aee3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-flip_sign-a0cebd4.stdout0000664000175000017500000002145515141516316026143 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-mangle_underscore_external_01-c26c50a.json0000664000175000017500000000101715141516316031534 0ustar alastairalastair{ "basename": "llvm-mangle_underscore_external_01-c26c50a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/mangle_underscore_external_01.f90", "infile_hash": "2e8c05ad551bccbce7f14d927259e3824749eeba2389cdf53ba7bd02", "outfile": null, "outfile_hash": null, "stdout": "llvm-mangle_underscore_external_01-c26c50a.stdout", "stdout_hash": "bc7e64c877e47b652fc26825d85ff0a2617247b6b2ef83211b1a737b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence1-98d138a.json0000664000175000017500000000100415141516316031206 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence1-98d138a", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence1.f90", "infile_hash": "acffed461dbe1cc05dfd5085fa5344e0c755f1139a7f9c24cb4656e1", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence1-98d138a.stdout", "stdout_hash": "fa4ac473422f7e302b0cbda18f562c23a9675d915087e0d2b7ff1e01", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit7-9099c07.stdout0000664000175000017500000001617715141516316025621 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Real 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m)] [(Assignment (Var 2 n) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 32 [1, 2, 3, ...., 6, 7, 8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_26-f627ed6.json0000664000175000017500000000071515141516316025313 0ustar alastairalastair{ "basename": "run-format_26-f627ed6", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_26.f90", "infile_hash": "f23f69602a3b407cc16f2cb4f36c6689ff6b1b9576f58eed6497ad1a", "outfile": null, "outfile_hash": null, "stdout": "run-format_26-f627ed6.stdout", "stdout_hash": "5b8b4b7e16f70f3be2f5ae9c568f973a2cd4d80527db4ad8b10bbe36", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_dead_code_removal-cond_02-69b6d7d.stdout0000664000175000017500000002470715141516316031160 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cond_02 [] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-array2-7b9505c.json0000664000175000017500000000070715141516316024613 0ustar alastairalastair{ "basename": "ast-array2-7b9505c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "ast-array2-7b9505c.stdout", "stdout_hash": "9b1a35b08f61c89abd685321a6482493ea4b443085071fb54118cf14", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-expr6-914a051.stdout0000664000175000017500000000114415141516316025115 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define float @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca float, align 4 store i32 8, i32* %__lfortran_evaluate_11, align 4 store float 0x4015333340000000, float* %__lfortran_evaluate_12, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load float, float* %__lfortran_evaluate_12, align 4 ret float %0 } lfortran-lfortran-2f73434/tests/reference/asr-specific_type_intrinsic-60c666c.json0000664000175000017500000000100115141516316030304 0ustar alastairalastair{ "basename": "asr-specific_type_intrinsic-60c666c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/specific_type_intrinsic.f90", "infile_hash": "442e8580aa683980ba51d19893cf7a3c1add2254bf3099797f242fe8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-specific_type_intrinsic-60c666c.stderr", "stderr_hash": "19c488d38fbb043d34d051f0af173af9108e439e5af9da09ded06a59", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form4-a6a0e27.stdout0000664000175000017500000000117615141516316026242 0ustar alastairalastair(TranslationUnit [(Program x () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [(Assignment 0 y 5 () ) (Print 500 () [y] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-do1-0a89222.stderr0000664000175000017500000000020315141516316024330 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/do1.f90:21:1 | 21 | enddo | ^^^^^ help: write this as 'end do' lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_02-83f1d9f.stdout0000664000175000017500000002641515141516316027124 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %j, align 4 call void @f(i32* %i, i32* %j) %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %i, i32* %j) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = load i32, i32* %i, align 4 %14 = icmp ne i32 %13, 1 br i1 %14, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %15 = load i32, i32* %j, align 4 %16 = icmp ne i32 %15, 2 br i1 %16, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 call void @g(i32* %i, i32* %j) %17 = alloca i64, align 8 %18 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, i32* %i, i32* %j) %19 = load i64, i64* %17, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %19, i64* %21, align 4 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %25 = load i64, i64* %24, align 4 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %ifcont3 call void @_lfortran_free(i8* %18) br label %free_done6 free_done6: ; preds = %free_nonnull5, %ifcont3 %28 = load i32, i32* %i, align 4 %29 = icmp ne i32 %28, 1 br i1 %29, label %then7, label %else8 then7: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %free_done6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %30 = load i32, i32* %j, align 4 %31 = icmp ne i32 %30, 0 br i1 %31, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 call void @h(i32* %i, i32* %j) %32 = alloca i64, align 8 %33 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.2, i32 0, i32 0), i64* %32, i32 0, i32 0, i32* %i, i32* %j) %34 = load i64, i64* %32, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %33, i8** %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %34, i64* %36, align 4 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %40 = load i64, i64* %39, align 4 %41 = trunc i64 %40 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %38, i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %42 = icmp eq i8* %33, null br i1 %42, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %ifcont12 call void @_lfortran_free(i8* %33) br label %free_done15 free_done15: ; preds = %free_nonnull14, %ifcont12 %43 = load i32, i32* %i, align 4 %44 = icmp ne i32 %43, 1 br i1 %44, label %then16, label %else17 then16: ; preds = %free_done15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %free_done15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %45 = load i32, i32* %j, align 4 %46 = icmp ne i32 %45, 0 br i1 %46, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_subroutines_02 FINALIZE_SYMTABLE_subroutines_02: ; preds = %return ret i32 0 } define void @f(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define void @g(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = sub i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_g FINALIZE_SYMTABLE_g: ; preds = %return ret void } define void @h(i32* %a, i32* %b) { .entry: call void @g(i32* %a, i32* %b) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_h FINALIZE_SYMTABLE_h: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-45de3a2.json0000664000175000017500000000077615141516316026755 0ustar alastairalastair{ "basename": "asr-implicit_typing1-45de3a2", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing1.f90", "infile_hash": "023385ae1cffd8cc74cd969d2a2ea8fc4cbc958e5bb0ca340f5c6118", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing1-45de3a2.stderr", "stderr_hash": "ae9589c5db61e45a67309453ee8e0d3425e569617b4e41104f5eb62d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-fixed_form1-f592417.json0000664000175000017500000000075415141516316026221 0ustar alastairalastair{ "basename": "ast_f90-fixed_form1-f592417", "cmd": "lfortran --fixed-form --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fixed_form1.f", "infile_hash": "a6774c19d8ae1f0ab04227a596e393ce26d84d1c0f796b7187a87f1a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fixed_form1-f592417.stdout", "stdout_hash": "6798fc0ebf9d89dc59d13a73af9fccd743a361d1b4906f49b78847de", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-block_data1-d563f39.json0000664000175000017500000000072615141516316025565 0ustar alastairalastair{ "basename": "ast-block_data1-d563f39", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/block_data1.f90", "infile_hash": "18c095bb88a2f3528ab34c788fd6a66b9294d38866605cfec26b8dfd", "outfile": null, "outfile_hash": null, "stdout": "ast-block_data1-d563f39.stdout", "stdout_hash": "092152a27734c4bdce8c776f9a24f659bf13eb70522dc54baecc3f53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_02-2faf7cf.json0000664000175000017500000000075015141516316025601 0ustar alastairalastair{ "basename": "ast-program_02-2faf7cf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_02.f90", "infile_hash": "cfd9e7516e44684e41465abbcb4438aa337500b426c3e8b772e69fbe", "outfile": null, "outfile_hash": null, "stdout": "ast-program_02-2faf7cf.stdout", "stdout_hash": "09d16c04765c03fcc3b5e9114a7d30f2e236d0b1b9be2075cb77f77c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_03-43a00f9.json0000664000175000017500000000076715141516316026334 0ustar alastairalastair{ "basename": "asr-template_add_03-43a00f9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_03.f90", "infile_hash": "ea28185a5bc40e72bf2bb2f76bb2de4072cd321390f02993ae27aafe", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_03-43a00f9.stdout", "stdout_hash": "957500079aaf482f4e3f4aee158a91df4368ab0019d4719356701aa3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format6-f98f4d0.stdout0000664000175000017500000000025715141516316025445 0ustar alastairalastair +12.1+122.1 122.1 +011 +011 +11 +11 -11 -1111 *** 11 +0.1234567871D+05 +0.12345678910111198970867447229396098431025025677513E-61 +12.3457E+03 +12.8E+03 +1.0 lfortran-lfortran-2f73434/tests/reference/asr-cmplx_02-48bb125.json0000664000175000017500000000072415141516316025025 0ustar alastairalastair{ "basename": "asr-cmplx_02-48bb125", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_02.f90", "infile_hash": "2638b55f2204102e3c6df348aba6ab5405453fc87f2db6c8b5b6b28e", "outfile": null, "outfile_hash": null, "stdout": "asr-cmplx_02-48bb125.stdout", "stdout_hash": "ac4ba70f6eda0e09e57834045a44409b2bfd2cd26e048309319e4831", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_07-4a9f44e.stdout0000664000175000017500000004014415141516316026733 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_07: (Program (SymbolTable 4 { f: (ExternalSymbol 4 f 2 f subroutines_07_mod [] f Public ), f_int: (ExternalSymbol 4 f_int 2 f_int subroutines_07_mod [] f_int Public ), f_int@f: (ExternalSymbol 4 f_int@f 2 f subroutines_07_mod [] f Private ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 4 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) subroutines_07 [subroutines_07_mod] [(Assignment (Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 l) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 4 f_int@f 4 f_int [((Var 4 i)) ((Var 4 j)) ((Var 4 k)) ((Var 4 l)) (())] () .false. ) (If () (IntegerCompare (Var 4 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), subroutines_07_mod: (Module (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), kind: (Variable 3 kind [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 kind)] [(Assignment (Var 3 b) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (Var 3 c) (Integer 4) () ) Add (Var 3 d) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), f_int: (GenericProcedure 2 f_int [2 f] Public ) }) subroutines_07_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_return2-597f864.stdout0000664000175000017500000000224215141516316027362 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b) (c)] [] () () [] [] [] [] [(Print 0 () [a] () ) (GoTo 0 () 1 [] () ) (Return 0 () () ) (Print 1 () [b] () ) (Return 0 () () )] [] [] ) (Function g [(a) (b) (c)] [] () () () [] [] [] [] [(Print 0 () [a] () ) (GoTo 0 () 2 [] () ) (Return 0 () () ) (Print 2 () [b] () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp5-4cb2070.stderr0000664000175000017500000000023515141516316027036 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp5.f90:5:13 | 5 | print *, x, C123 | ^^^^ 'z12345678' is undeclared lfortran-lfortran-2f73434/tests/reference/ast-if_04-7f1b69d.stdout0000664000175000017500000000703015141516316024745 0ustar alastairalastair(TranslationUnit [(Program if_04 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 1 () ) (If 0 () (== i 1) [(Print 0 () [(String "1" ())] () )] [(If 0 () (== i 2) [(Print 0 () [(String "2" ())] () )] [(If 0 () (== i 3) [(Print 0 () [(String "3" ())] () )] [(If 0 () (== i 4) [(Print 0 () [(String "4" ())] () )] [] () () () )] () () () )] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 name (== i 1) [(Print 0 () [(String "1" ())] () )] [(If 0 () (== i 2) [(Print 0 () [(String "2" ())] () )] [(If 0 () (== i 3) [(Print 0 () [(String "3" ())] () )] [(If 0 () (== i 4) [(Print 0 () [(String "4" ())] () )] [(Print 0 () [(String "Invalid!" ())] () )] () () () )] () () () )] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope5-688b5a0.stdout0000664000175000017500000000150015141516316026654 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 %4 = load i32, i32* @x, align 4 %5 = mul i32 3, %4 store i32 %5, i32* %__lfortran_evaluate_12, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %6 = load i32, i32* %__lfortran_evaluate_12, align 4 ret i32 %6 } lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor6-c43df4d.json0000664000175000017500000000077015141516316030627 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor6-c43df4d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor6.f90", "infile_hash": "ab74c4b1ba190571a15fc7788dd695d43963753391f8e83f5780477e", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor6-c43df4d.stdout", "stdout_hash": "948476336c787f4fe8f8928e127d359c81dd2c92480d49d4f504d660", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_06-609dd30.json0000664000175000017500000000075015141516316025357 0ustar alastairalastair{ "basename": "asr-modules_06-609dd30", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_06.f90", "infile_hash": "ffed6acf9a41c361cf70e0d7be27fb220ad99d98ab607fce09d93992", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-609dd30.stdout", "stdout_hash": "4b4da82bfd40720f8e21a479a89b6d8437653ccfc7017a99c288565c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allocate_05-48fb994.json0000664000175000017500000000075315141516316025515 0ustar alastairalastair{ "basename": "asr-allocate_05-48fb994", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_05.f90", "infile_hash": "4aec5c0fcf89fa53670beb1afa8af66e589841696723e0f2f4d966ba", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_05-48fb994.stdout", "stdout_hash": "5bf7db4012a41019ea425258653c3fc39dcf6d1ee7d2d638851b45c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-execute_command_line-0e9cd63.stdout0000664000175000017500000000606315141516316030376 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [18 x i8] c"echo \22Hello World\22" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data, i32 0, i32 0), i64 18 }> @string_const_data.1 = private constant [2 x i8] c"ls" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.1, i32 0, i32 0), i64 2 }> define void @_lcompilers_execute_command_line_(%string_descriptor* %command, i1* %wait) { .entry: %_lcompilers_exit_status = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %1 = load i8*, i8** %0, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %3 = load i8*, i8** %2, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1 %5 = load i64, i64* %4, align 4 %6 = trunc i64 %5 to i32 %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6) store i32 %7, i32* %_lcompilers_exit_status, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_ FINALIZE_SYMTABLE__lcompilers_execute_command_line_: ; preds = %return ret void } declare i32 @_lfortran_exec_command(i8*, i32) define void @_lcompilers_execute_command_line_1(%string_descriptor* %command, i1* %wait) { .entry: %_lcompilers_exit_status = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %1 = load i8*, i8** %0, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0 %3 = load i8*, i8** %2, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1 %5 = load i64, i64* %4, align 4 %6 = trunc i64 %5 to i32 %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6) store i32 %7, i32* %_lcompilers_exit_status, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_1 FINALIZE_SYMTABLE__lcompilers_execute_command_line_1: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i1, align 1 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i1 true, i1* %call_arg_value, align 1 call void @_lcompilers_execute_command_line_(%string_descriptor* @string_const, i1* %call_arg_value) store i1 true, i1* %call_arg_value, align 1 call void @_lcompilers_execute_command_line_1(%string_descriptor* @string_const.2, i1* %call_arg_value) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_execute_command_line FINALIZE_SYMTABLE_execute_command_line: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-do7-8069d7a.json0000664000175000017500000000070115141516316024265 0ustar alastairalastair{ "basename": "llvm-do7-8069d7a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/do7.f90", "infile_hash": "208cf89ff021dde72679466570c7a75054dfbec047dde672f22e8487", "outfile": null, "outfile_hash": null, "stdout": "llvm-do7-8069d7a.stdout", "stdout_hash": "6ffd524566b9138ae5e2052579cfdfb88ee3b6fe9082e5dd8c4b8b5a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_31-9b91cfb.json0000664000175000017500000000076115141516316026242 0ustar alastairalastair{ "basename": "asr-intrinsics_31-9b91cfb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_31.f90", "infile_hash": "f9db5457e09683e2b0afde876cbd0ddf85412c67117277ba413679af", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", "stdout_hash": "70539bee87641bef19fa44e86e53ce4eb02cdd5ef6e5a56fd43010f9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-complex_01-f07fa9a.json0000664000175000017500000000075015141516316025517 0ustar alastairalastair{ "basename": "ast-complex_01-f07fa9a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_01.f90", "infile_hash": "e94aebc987a1655b49e1e31229a6c24ccdbed83af0ebf6a0fb4684f2", "outfile": null, "outfile_hash": null, "stdout": "ast-complex_01-f07fa9a.stdout", "stdout_hash": "8fb68c50009aae86bea9902acccea31dd75f9372e349cfcc5986c104", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.jsonlfortran-lfortran-2f73434/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.0000664000175000017500000000107415141516316033747 0ustar alastairalastair{ "basename": "llvm-module_struct_global_separate_compilation_01-043bc7f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/module_struct_global_separate_compilation_01.f90", "infile_hash": "08f54b36d504349558d92a29ac0ea311917967e95e6d32b9019a9574", "outfile": null, "outfile_hash": null, "stdout": "llvm-module_struct_global_separate_compilation_01-043bc7f.stdout", "stdout_hash": "fcbd403421436a3fa4b7dc768708592cff659691b525b47eceb46fa8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_assignment_arr1-28b49c0.stderr0000664000175000017500000000030515141516316033622 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 1(1 and 3) --> tests/errors/incompatible_dimension_assignment_arr1.f90:7:5 | 7 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-maskr_negative-89183d3.json0000664000175000017500000000074615141516316026340 0ustar alastairalastair{ "basename": "asr-maskr_negative-89183d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskr_negative.f90", "infile_hash": "f49d8a5ebf8050f22484de61b993732e9fa5fab18faeee525c4579d1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskr_negative-89183d3.stderr", "stderr_hash": "4002541c74a9445686f77ea75e6c0a357e9a4598a84578f7f81ad5ed", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_13-07b50ad.json0000664000175000017500000000076115141516316026145 0ustar alastairalastair{ "basename": "asr-intrinsics_13-07b50ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_13.f90", "infile_hash": "71322461e1575230ec6b7f06378bb7a3d3f21a3575676307ac8ea762", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_13-07b50ad.stdout", "stdout_hash": "ba06e3366b09f9b10645213b665d8dd8eefbd85e92beb67f97b3e008", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_44-1c0f6fe.json0000664000175000017500000000077415141516316026734 0ustar alastairalastair{ "basename": "asr_openmp-openmp_44-1c0f6fe", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_44.f90", "infile_hash": "7f52b7f964df7c09c7339881973e424ae1381de1034a007c5312b86f", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_44-1c0f6fe.stdout", "stdout_hash": "9dd7378de5d1c728c9bb3cc72e06b7f44368afdf8d6c56786099adcc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-parameter_04-553ff5b.stdout0000664000175000017500000003011515141516316026322 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { parameter_04: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 14 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i2: (Variable 2 i2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), i32: (Variable 2 i32 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 6 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i64: (Variable 2 i64 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 12 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), l_knd: (Variable 2 l_knd [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r1: (Variable 2 r1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 2 sp [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) parameter_04 [] [(Assignment (Var 2 l) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l_knd) (Var 2 sp) (Var 2 dp) (Var 2 i32) (Var 2 i64)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_04-114a023.json0000664000175000017500000000075015141516316025260 0ustar alastairalastair{ "basename": "ast-program_04-114a023", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_04.f90", "infile_hash": "6d4faa951231e470e99cbc3ff617437048ceb99e3d92ba6e7810ef43", "outfile": null, "outfile_hash": null, "stdout": "ast-program_04-114a023.stdout", "stdout_hash": "7fc2eca3a57ac776159f26e1191c79ae6df28fa5ec3d0e53f2a49f5f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arithmetic_if1-f119c2a.json0000664000175000017500000000074615141516316026354 0ustar alastairalastair{ "basename": "asr-arithmetic_if1-f119c2a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/arithmetic_if1.f90", "infile_hash": "41667893ffab9b073a6c0674e1821f3009b9c55fe383c44dd863ac77", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-arithmetic_if1-f119c2a.stderr", "stderr_hash": "a9af1739b20d99ec366498b705aeb4044956976d00d257546dada29a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-print1-b2e5cea.json0000664000175000017500000000070715141516316025040 0ustar alastairalastair{ "basename": "ast-print1-b2e5cea", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/print1.f90", "infile_hash": "b39169477bbb20a9f0fc581832d539c45122fbc253e90314075c6581", "outfile": null, "outfile_hash": null, "stdout": "ast-print1-b2e5cea.stdout", "stdout_hash": "3e669d75e364de4c89b6e41164a18121f831e6d777d29c81665134b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_04-0d478be.stdout0000664000175000017500000001327315141516316026016 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { }) print_vars (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 priv)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 publ)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_02-48f3a02.stderr0000664000175000017500000000103115141516316025654 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/goto_02.f90:10:12 | 10 | if (A.GT.2) go to 95 | ^^^^ help: write this as '>' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:13:12 | 13 | if (A.EQ.1) go to 10 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/goto_02.f90:25:12 | 25 | if (A.EQ.2) go to 99 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/llvm-return_02-99fb0b3.stdout0000664000175000017500000002465415141516316026056 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [9 x i8] c"calling b" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data, i32 0, i32 0), i64 9 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_many_returns_b(i32* %a) { .entry: %b = alloca i32, align 4 %e = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %1 = call i32 @b.__module_many_returns_d(i32* %a) store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %2 = load i32, i32* %b, align 4 ret i32 %2 } define i32 @b.__module_many_returns_d(i32* %i) { .entry: %d = alloca i32, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp eq i32 %0, 1 br i1 %1, label %then, label %else then: ; preds = %.entry store i32 1, i32* %d, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %2 = load i32, i32* %i, align 4 %3 = icmp eq i32 %2, 2 br i1 %3, label %then1, label %else3 then1: ; preds = %ifcont store i32 2, i32* %d, align 4 br label %return unreachable_after_return2: ; No predecessors! br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %unreachable_after_return2 %4 = load i32, i32* %i, align 4 %5 = icmp eq i32 %4, 3 br i1 %5, label %then5, label %else7 then5: ; preds = %ifcont4 store i32 3, i32* %d, align 4 br label %return unreachable_after_return6: ; No predecessors! br label %ifcont8 else7: ; preds = %ifcont4 br label %ifcont8 ifcont8: ; preds = %else7, %unreachable_after_return6 store i32 999, i32* %d, align 4 br label %return return: ; preds = %ifcont8, %then5, %then1, %then br label %FINALIZE_SYMTABLE_d FINALIZE_SYMTABLE_d: ; preds = %return %6 = load i32, i32* %d, align 4 ret i32 %6 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca i32, align 4 store i32 1, i32* %call_arg_value, align 4 %2 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %2, i32* %c, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32* %c) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %14 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %14, i32* %c, align 4 %15 = alloca i64, align 8 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %15, i32 0, i32 0, i32* %c) %17 = load i64, i64* %15, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %23 = load i64, i64* %22, align 4 %24 = trunc i64 %23 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %21, i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %25 = icmp eq i8* %16, null br i1 %25, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %16) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store i32 3, i32* %call_arg_value, align 4 %26 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %26, i32* %c, align 4 %27 = alloca i64, align 8 %28 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %27, i32 0, i32 0, i32* %c) %29 = load i64, i64* %27, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %29, i64* %31, align 4 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %35 = load i64, i64* %34, align 4 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %28) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 store i32 4, i32* %call_arg_value, align 4 %38 = call i32 @__module_many_returns_b(i32* %call_arg_value) store i32 %38, i32* %c, align 4 %39 = alloca i64, align 8 %40 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %39, i32 0, i32 0, i32* %c) %41 = load i64, i64* %39, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %40, i8** %42, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %41, i64* %43, align 4 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %45 = load i8*, i8** %44, align 8 %46 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %47 = load i64, i64* %46, align 4 %48 = trunc i64 %47 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %45, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %49 = icmp eq i8* %40, null br i1 %49, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %40) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 call void @_lpython_free_argv() br label %return return: ; preds = %free_done9 br label %FINALIZE_SYMTABLE_returns FINALIZE_SYMTABLE_returns: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-complex_sub_test-f54ef56.json0000664000175000017500000000077215141516316027060 0ustar alastairalastair{ "basename": "asr-complex_sub_test-f54ef56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_sub_test.f90", "infile_hash": "9f572986fbed1d55d70fd8cd6941a7aaff7a29b92b0b8eada122ac20", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_sub_test-f54ef56.stdout", "stdout_hash": "2667cc290791d562a2d0eb6f75e10c7916759bf3e5a1183232245aec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array7-b9de38f.json0000664000175000017500000000070715141516316024766 0ustar alastairalastair{ "basename": "ast-array7-b9de38f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array7.f90", "infile_hash": "e8a4f12c21d75c3eee1ba6cc82227a262f41e146ccfd34c1ffb12612", "outfile": null, "outfile_hash": null, "stdout": "ast-array7-b9de38f.stdout", "stdout_hash": "deea556a927bab2a181ab718f525d699a049741fc3c5ef4ac5989a8b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do1-87a7869.json0000664000175000017500000000075415141516316026531 0ustar alastairalastair{ "basename": "asr-data_implied_do1-87a7869", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do1.f90", "infile_hash": "f370b515ef426e1716db9ed2545c6325818481045ecaf0b397bb0648", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do1-87a7869.stderr", "stderr_hash": "23b9784791e8b09e3d06b5357db3091fce1b8a481a17006179bb85c4", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_div_to_mul-div_to_mul-d0027c6.stdout0000664000175000017500000003137415141516316030520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { div_to_mul: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div_to_mul [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.318471 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.500000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Cast (Var 2 x) RealToReal (Real 8) () ) Mul (RealConstant 0.500000 (Real 8) ) (Real 8) () ) Sub (Cast (RealConstant 1.570000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.570000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (Var 2 eps) RealToReal (Real 8) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Mul (RealConstant 0.500000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (IntegerBinOp (Var 2 y) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface2-f4d4abc.json0000664000175000017500000000104715141516316030732 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface2-f4d4abc", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface2.f90", "infile_hash": "1f457aff9cece7a1bae818adeed2dfdb5998c30ee4ff92f4cb11c692", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface2-f4d4abc.stdout", "stdout_hash": "abda02d46b208e262a8a5e6751c727fdd778293d8893f4709a4e662e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-associate_04-97f4e70.stdout0000664000175000017500000001664615141516316026445 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R4,R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_cos_f32(float* %x) { .entry: %_lcompilers_cos_f32 = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = call float @_lfortran_scos(float %0) store float %1, float* %_lcompilers_cos_f32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_cos_f32 FINALIZE_SYMTABLE__lcompilers_cos_f32: ; preds = %return %2 = load float, float* %_lcompilers_cos_f32, align 4 ret float %2 } declare float @_lfortran_scos(float) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca float, align 4 %myreal = alloca float, align 4 %theta = alloca float, align 4 %x = alloca float, align 4 %y = alloca float, align 4 store float 0x3FDAE147A0000000, float* %x, align 4 store float 0x3FD6666660000000, float* %y, align 4 store float 0x4022333340000000, float* %myreal, align 4 store float 1.500000e+00, float* %theta, align 4 store float 0x3FD99999A0000000, float* %a, align 4 br label %associate_block_start associate_block_start: ; preds = %.entry %v = alloca float*, align 8 store float* null, float** %v, align 8 %z = alloca float, align 4 %2 = load float, float* %x, align 4 %3 = fmul float %2, 2.000000e+00 %4 = load float, float* %y, align 4 %5 = fmul float %4, 2.000000e+00 %6 = fadd float %3, %5 %7 = fneg float %6 %8 = call float @_lcompilers_cos_f32(float* %theta) %9 = fmul float %7, %8 store float %9, float* %z, align 4 store float* %myreal, float** %v, align 8 %10 = alloca i64, align 8 %11 = load float, float* %a, align 4 %12 = load float, float* %z, align 4 %13 = fadd float %11, %12 %14 = alloca float, align 4 store float %13, float* %14, align 4 %15 = load float, float* %a, align 4 %16 = load float, float* %z, align 4 %17 = fsub float %15, %16 %18 = alloca float, align 4 store float %17, float* %18, align 4 %19 = load float*, float** %v, align 8 %20 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %10, i32 0, i32 0, float* %14, float* %18, float* %19) %21 = load i64, i64* %10, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %20, i8** %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %21, i64* %23, align 4 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %27 = load i64, i64* %26, align 4 %28 = trunc i64 %27 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %25, i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %29 = icmp eq i8* %20, null br i1 %29, label %free_done, label %free_nonnull free_nonnull: ; preds = %associate_block_start call void @_lfortran_free(i8* %20) br label %free_done free_done: ; preds = %free_nonnull, %associate_block_start %30 = load float*, float** %v, align 8 %31 = load float*, float** %v, align 8 %32 = load float, float* %31, align 4 %33 = fmul float %32, 0x4012666660000000 store float %33, float* %30, align 4 br label %associate_block_end associate_block_end: ; preds = %free_done br label %FINALIZE_SYMTABLE_associate_block FINALIZE_SYMTABLE_associate_block: ; preds = %associate_block_end %34 = alloca i64, align 8 %35 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %34, i32 0, i32 0, float* %myreal) %36 = load i64, i64* %34, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %35, i8** %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %36, i64* %38, align 4 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %42 = load i64, i64* %41, align 4 %43 = trunc i64 %42 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %40, i32 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %44 = icmp eq i8* %35, null br i1 %44, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %FINALIZE_SYMTABLE_associate_block call void @_lfortran_free(i8* %35) br label %free_done3 free_done3: ; preds = %free_nonnull2, %FINALIZE_SYMTABLE_associate_block %45 = load float, float* %myreal, align 4 %46 = fsub float %45, 0x4044EE1480000000 %47 = fcmp ogt float %46, 0x3EE4F8B580000000 %48 = load float, float* %myreal, align 4 %49 = fsub float %48, 0x4044EE1480000000 %50 = fcmp olt float %49, 0xBEE4F8B580000000 %51 = icmp eq i1 %47, false %52 = select i1 %51, i1 %50, i1 %47 br i1 %52, label %then, label %else then: ; preds = %free_done3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done3 br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_associate_04 FINALIZE_SYMTABLE_associate_04: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/pass_insert_deallocate-finalize_01-3efebdd.json0000664000175000017500000000102515141516316031724 0ustar alastairalastair{ "basename": "pass_insert_deallocate-finalize_01-3efebdd", "cmd": "lfortran --pass=insert_deallocate --show-asr --no-color {infile} -o {outfile}", "infile": "tests/finalize_01.f90", "infile_hash": "81b1d43091ce29fff8f14e778b9a33030de61262f7c499b22c152b7e", "outfile": null, "outfile_hash": null, "stdout": "pass_insert_deallocate-finalize_01-3efebdd.stdout", "stdout_hash": "ab45c055117c0a6bf60bd92cd7fa9a6c52d65b0f24d079416a125797", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_02-b6aed2a.json0000664000175000017500000000076215141516316030747 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_02-b6aed2a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_02.f90", "infile_hash": "334ddfdd17e21ad5f18931bde4b01c8463c16124c4f2b35f872b0bae", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_02-b6aed2a.stderr", "stderr_hash": "750d1566bb2c8a1c12d5502880f3ac91631ac4c3d0e020105c0dff23", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/cpp-kokkos_program1-1d79f7a.json0000664000175000017500000000072515141516316026603 0ustar alastairalastair{ "basename": "cpp-kokkos_program1-1d79f7a", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/kokkos_program1.f90", "infile_hash": "81575b3ab7fd1a2dc16c67f0a5ff241d9057fed389befd1c3084d6ea", "outfile": null, "outfile_hash": null, "stdout": "cpp-kokkos_program1-1d79f7a.stdout", "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics1-8ebce32.stderr0000664000175000017500000000027615141516316026347 0ustar alastairalastairsemantic error: Unexpected args, Radix expects (int) or (real) as arguments --> tests/errors/intrinsics1.f90:3:14 | 3 | print *, radix((2.4, 1.0)) | ^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-document_symbols1-8238851.stdout0000664000175000017500000000404415141516316027273 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":14,"line":2}},"uri":"uri"},"name":"add","filename":"tests/document_symbols1.f90"},{"kind":0,"location":{"range":{"start":{"character":1,"line":4},"end":{"character":11,"line":12}},"uri":"uri"},"name":"document_symbols1","filename":"tests/document_symbols1.f90"},{"kind":5,"location":{"range":{"start":{"character":1,"line":5},"end":{"character":14,"line":7}},"uri":"uri"},"name":"sub","filename":"tests/document_symbols1_module.f90"},{"kind":5,"location":{"range":{"start":{"character":1,"line":8},"end":{"character":14,"line":10}},"uri":"uri"},"name":"sub2","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":12,"line":7},"end":{"character":12,"line":7}},"uri":"uri"},"name":"x","filename":"tests/document_symbols1.f90"},{"kind":5,"location":{"range":{"start":{"character":16,"line":3},"end":{"character":17,"line":3}},"uri":"uri"},"name":"xy","filename":"tests/document_symbols1_module.f90"},{"kind":5,"location":{"range":{"start":{"character":20,"line":3},"end":{"character":21,"line":3}},"uri":"uri"},"name":"yz","filename":"tests/document_symbols1_module.f90"},{"kind":1,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":35,"line":11}},"uri":"uri"},"name":"module_document_symbols1","filename":"tests/document_symbols1_module.f90"},{"kind":2,"location":{"range":{"start":{"character":1,"line":5},"end":{"character":14,"line":7}},"uri":"uri"},"name":"sub","filename":"tests/document_symbols1_module.f90"},{"kind":2,"location":{"range":{"start":{"character":1,"line":8},"end":{"character":14,"line":10}},"uri":"uri"},"name":"sub2","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":16,"line":3},"end":{"character":17,"line":3}},"uri":"uri"},"name":"xy","filename":"tests/document_symbols1_module.f90"},{"kind":9,"location":{"range":{"start":{"character":20,"line":3},"end":{"character":21,"line":3}},"uri":"uri"},"name":"yz","filename":"tests/document_symbols1_module.f90"}]lfortran-lfortran-2f73434/tests/reference/asr-array_shape_02-d196aa4.json0000664000175000017500000000074615141516316026266 0ustar alastairalastair{ "basename": "asr-array_shape_02-d196aa4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_shape_02.f90", "infile_hash": "4ba934bc62b338ae381400a5ccbac953acdf938e36b87038134b372c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_shape_02-d196aa4.stderr", "stderr_hash": "af7870ea4a4a3795f6cf089c797aaf9fdc32500d1e866d0f797d3b64", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_array_02-85b6b2e.stdout0000664000175000017500000035533415141516316027364 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_02: (Program (SymbolTable 19 { add_integer: (ExternalSymbol 19 add_integer 2 add_integer template_array_02_math [] add_integer Public ), add_real: (ExternalSymbol 19 add_real 2 add_real template_array_02_math [] add_real Public ), array_tmpl: (ExternalSymbol 19 array_tmpl 7 array_tmpl template_array_02_m [] array_tmpl Public ), operations: (ExternalSymbol 19 operations 7 operations template_array_02_m [] operations Public ), test_template: (ExternalSymbol 19 test_template 7 test_template template_array_02_m [] test_template Public ), zero_integer: (ExternalSymbol 19 zero_integer 2 zero_integer template_array_02_math [] zero_integer Public ), zero_real: (ExternalSymbol 19 zero_real 2 zero_real template_array_02_math [] zero_real Public ) }) template_array_02 [template_array_02_math template_array_02_m] [(SubroutineCall 19 test_template () [] () .false. )] ), template_array_02_m: (Module (SymbolTable 7 { add_integer: (ExternalSymbol 7 add_integer 2 add_integer template_array_02_math [] add_integer Public ), add_real: (ExternalSymbol 7 add_real 2 add_real template_array_02_math [] add_real Public ), array_tmpl: (Template (SymbolTable 11 { mysum_t: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 14 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) mysum_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t plus_t] [(Var 14 a)] [(Assignment (Var 14 r) (FunctionCall 11 zero_t () [((ArrayItem (Var 14 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 14 a) () (Integer 4) () ) ()) [(Assignment (Var 14 r) (FunctionCall 11 plus_t () [((Var 14 r)) ((ArrayItem (Var 14 a) [(() (Var 14 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 14 r) Public .false. .false. () ), mysum_t_n: (Function (SymbolTable 15 { a: (Variable 15 a [n] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 15 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 15 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 15 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) mysum_t_n (FunctionType [(Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [zero_t plus_t] [(Var 15 n) (Var 15 a)] [(Assignment (Var 15 r) (FunctionCall 11 zero_t () [((ArrayItem (Var 15 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) () (Integer 4) () ) ()) [(Assignment (Var 15 r) (FunctionCall 11 plus_t () [((Var 15 r)) ((ArrayItem (Var 15 a) [(() (Var 15 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 15 r) Private .false. .false. () ), plus_t: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 12 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rs: (Variable 12 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 rs) Private .false. .false. () ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), zero_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rs: (Variable 13 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l)] [] (Var 13 rs) Private .false. .false. () ) }) array_tmpl [t plus_t zero_t] [(Require operations [t plus_t zero_t] )] ), operations: (Requirement (SymbolTable 8 { plus_t: (Function (SymbolTable 9 { l: (Variable 9 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 9 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rs: (Variable 9 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 l) (Var 9 r)] [] (Var 9 rs) Private .false. .false. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), zero_t: (Function (SymbolTable 10 { l: (Variable 10 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rs: (Variable 10 rs [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_t (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 l)] [] (Var 10 rs) Private .false. .false. () ) }) operations [t plus_t zero_t] [] ), test_template: (Function (SymbolTable 16 { a: (Variable 16 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 16 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), mysum_integer: (Function (SymbolTable 17 { a: (Variable 17 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 17 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mysum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 a)] [(Assignment (Var 17 r) (FunctionCall 7 zero_integer () [((ArrayItem (Var 17 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 17 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 17 a) () (Integer 4) () ) ()) [(Assignment (Var 17 r) (FunctionCall 7 add_integer () [((Var 17 r)) ((ArrayItem (Var 17 a) [(() (Var 17 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] (Var 17 r) Public .false. .false. () ), mysum_integer_n: (Function (SymbolTable 18 { a: (Variable 18 a [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 18 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 18 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) mysum_integer_n (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 n) (Var 18 a)] [(Assignment (Var 18 r) (FunctionCall 7 zero_integer () [((ArrayItem (Var 18 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 18 a) () (Integer 4) () ) ()) [(Assignment (Var 18 r) (FunctionCall 7 add_integer () [((Var 18 r)) ((ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] (Var 18 r) Private .false. .false. () ), sa: (Variable 16 sa [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), sb: (Variable 16 sb [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 16 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 16 a) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (Var 16 i) () .false. .false. ) (Assignment (ArrayItem (Var 16 b) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (Var 16 i) () .false. .false. )] [] ) (Assignment (Var 16 sa) (FunctionCall 16 mysum_integer () [((ArrayPhysicalCast (Var 16 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 16 sb) (FunctionCall 16 mysum_integer_n () [((ArraySize (Var 16 b) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) )) ((ArrayPhysicalCast (Var 16 b) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 16 sa)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 16 sb)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), zero_integer: (ExternalSymbol 7 zero_integer 2 zero_integer template_array_02_math [] zero_integer Public ), zero_real: (ExternalSymbol 7 zero_real 2 zero_real template_array_02_math [] zero_real Public ) }) template_array_02_m () [template_array_02_math template_array_02_m] .false. .false. .false. ), template_array_02_math: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 r) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 r) Public .false. .false. () ), add_real: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (RealBinOp (Var 5 x) Add (Var 5 y) (Real 4) () ) () .false. .false. )] (Var 5 r) Public .false. .false. () ), zero_integer: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .false. .false. () ), zero_real: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) zero_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x)] [(Assignment (Var 6 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. )] (Var 6 r) Public .false. .false. () ) }) template_array_02_math () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-close1-d682580.stdout0000664000175000017500000000141615141516316025072 0ustar alastairalastair(TranslationUnit [(Program close1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Close 0 [u] [] () ) (Close 0 [] [(unit gmv_lun)] () ) (Close 0 [] [(unit dunit [(dxf [])]) (status (String "delete" ()))] () ) (Close 0 [] [(UNIT funit) (IOSTAT ierr)] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-case_03-c3a5078.stdout0000664000175000017500000002371115141516316025360 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"Pass!" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [7 x i8] c"Failed!" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.1, i32 0, i32 0), i64 7 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [13 x i8] c"Invalid marks" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.3, i32 0, i32 0), i64 13 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.5 = private constant [15 x i8] c"Your marks are " @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.5, i32 0, i32 0), i64 15 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [5 x i8] c"Pass!" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.7, i32 0, i32 0), i64 5 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [7 x i8] c"Failed!" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.9, i32 0, i32 0), i64 7 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [13 x i8] c"Invalid marks" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.11, i32 0, i32 0), i64 13 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.14 = private constant [15 x i8] c"Your marks are " @string_const.15 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.14, i32 0, i32 0), i64 15 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 store i32 1, i32* %a, align 4 %b = alloca i32, align 4 store i32 2, i32* %b, align 4 %marks = alloca i32, align 4 store i32 94, i32* %marks, align 4 %2 = load i32, i32* %marks, align 4 %3 = icmp sle i32 42, %2 br i1 %3, label %then, label %else then: ; preds = %.entry %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %4, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont3 else: ; preds = %.entry %5 = load i32, i32* %marks, align 4 %6 = icmp sle i32 %5, 38 br i1 %6, label %then1, label %else2 then1: ; preds = %else %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont else2: ; preds = %else %8 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %8, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else2, %then1 br label %ifcont3 ifcont3: ; preds = %ifcont, %then %9 = alloca i64, align 8 %10 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %9, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %marks) %11 = load i64, i64* %9, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %10, i8** %12, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %11, i64* %13, align 4 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %15 = load i8*, i8** %14, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %17 = load i64, i64* %16, align 4 %18 = trunc i64 %17 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %15, i32 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %19 = icmp eq i8* %10, null br i1 %19, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont3 call void @_lfortran_free(i8* %10) br label %free_done free_done: ; preds = %free_nonnull, %ifcont3 store i32 -1, i32* %marks, align 4 %20 = load i32, i32* %marks, align 4 %21 = icmp sle i32 42, %20 br i1 %21, label %then4, label %else5 then4: ; preds = %free_done %22 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %22, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) br label %ifcont9 else5: ; preds = %free_done %23 = load i32, i32* %marks, align 4 %24 = icmp sle i32 0, %23 %25 = load i32, i32* %marks, align 4 %26 = icmp sle i32 %25, 38 %27 = icmp eq i1 %24, false %28 = select i1 %27, i1 %24, i1 %26 br i1 %28, label %then6, label %else7 then6: ; preds = %else5 %29 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %29, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont8 else7: ; preds = %else5 %30 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %30, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont8 ifcont8: ; preds = %else7, %then6 br label %ifcont9 ifcont9: ; preds = %ifcont8, %then4 %31 = alloca i64, align 8 %32 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.13, i32 0, i32 0), i64* %31, i32 0, i32 0, %string_descriptor* @string_const.15, i32* %marks) %33 = load i64, i64* %31, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %33, i64* %35, align 4 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %39 = load i64, i64* %38, align 4 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free(i8* %32) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 call void @_lpython_free_argv() br label %return return: ; preds = %free_done12 br label %FINALIZE_SYMTABLE_case03 FINALIZE_SYMTABLE_case03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-string_10-eb8bca7.stdout0000664000175000017500000003570415141516316026012 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_10: (Program (SymbolTable 2 { c: (Variable 2 c [] Local (StringConstant "BC" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "BC" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), is_alpha: (Variable 2 is_alpha [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_10 [] [(Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 c) (StringConstant "@a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 c) (StringConstant "a@" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 is_alpha) (LogicalBinOp (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "Z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (StringCompare (Var 2 c) GtE (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) And (StringCompare (Var 2 c) LtE (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 is_alpha)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StringSection (Var 2 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () ) (StringConstant "sbs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (StringCompare (Var 2 num) NotEq (StringConstant "sbs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-array_bound_1-6741f43.stdout0000664000175000017500000003542515141516316026621 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [12 x i8] c"I4,I4,I4,I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [12 x i8] c"I4,I4,I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [196 x i32], align 4 %b = alloca [96 x i32], align 4 %c = alloca [35 x i32], align 4 %d = alloca [4 x i32], align 4 %2 = alloca i64, align 8 %3 = alloca i32, align 4 store i32 2, i32* %3, align 4 %4 = alloca i32, align 4 store i32 3, i32* %4, align 4 %5 = alloca i32, align 4 store i32 1, i32* %5, align 4 %6 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %3, i32* %4, i32* %5) %7 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 4 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %.entry %16 = alloca i64, align 8 %17 = alloca i32, align 4 store i32 5, i32* %17, align 4 %18 = alloca i32, align 4 store i32 9, i32* %18, align 4 %19 = alloca i32, align 4 store i32 7, i32* %19, align 4 %20 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32* %17, i32* %18, i32* %19) %21 = load i64, i64* %16, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %20, i8** %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %21, i64* %23, align 4 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %27 = load i64, i64* %26, align 4 %28 = trunc i64 %27 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %25, i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %29 = icmp eq i8* %20, null br i1 %29, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %20) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %30 = alloca i64, align 8 %31 = alloca i32, align 4 store i32 1, i32* %31, align 4 %32 = alloca i32, align 4 store i32 2, i32* %32, align 4 %33 = alloca i32, align 4 store i32 3, i32* %33, align 4 %34 = alloca i32, align 4 store i32 4, i32* %34, align 4 %35 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.2, i32 0, i32 0), i64* %30, i32 0, i32 0, i32* %31, i32* %32, i32* %33, i32* %34) %36 = load i64, i64* %30, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %35, i8** %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %36, i64* %38, align 4 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %42 = load i64, i64* %41, align 4 %43 = trunc i64 %42 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %40, i32 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %44 = icmp eq i8* %35, null br i1 %44, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %35) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %45 = alloca i64, align 8 %46 = alloca i32, align 4 store i32 2, i32* %46, align 4 %47 = alloca i32, align 4 store i32 4, i32* %47, align 4 %48 = alloca i32, align 4 store i32 6, i32* %48, align 4 %49 = alloca i32, align 4 store i32 7, i32* %49, align 4 %50 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.3, i32 0, i32 0), i64* %45, i32 0, i32 0, i32* %46, i32* %47, i32* %48, i32* %49) %51 = load i64, i64* %45, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %50, i8** %52, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %51, i64* %53, align 4 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %55 = load i8*, i8** %54, align 8 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %57 = load i64, i64* %56, align 4 %58 = trunc i64 %57 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %55, i32 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %59 = icmp eq i8* %50, null br i1 %59, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %50) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %60 = alloca i64, align 8 %61 = alloca i32, align 4 store i32 6, i32* %61, align 4 %62 = alloca i32, align 4 store i32 1, i32* %62, align 4 %63 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.4, i32 0, i32 0), i64* %60, i32 0, i32 0, i32* %61, i32* %62) %64 = load i64, i64* %60, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %63, i8** %65, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %64, i64* %66, align 4 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %68 = load i8*, i8** %67, align 8 %69 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %70 = load i64, i64* %69, align 4 %71 = trunc i64 %70 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %68, i32 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %72 = icmp eq i8* %63, null br i1 %72, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free(i8* %63) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %73 = alloca i64, align 8 %74 = alloca i32, align 4 store i32 10, i32* %74, align 4 %75 = alloca i32, align 4 store i32 7, i32* %75, align 4 %76 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.5, i32 0, i32 0), i64* %73, i32 0, i32 0, i32* %74, i32* %75) %77 = load i64, i64* %73, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %78 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %76, i8** %78, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %77, i64* %79, align 4 %80 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %81 = load i8*, i8** %80, align 8 %82 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %83 = load i64, i64* %82, align 4 %84 = trunc i64 %83 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %81, i32 %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %85 = icmp eq i8* %76, null br i1 %85, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free(i8* %76) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %86 = alloca i64, align 8 %87 = alloca i32, align 4 store i32 1, i32* %87, align 4 %88 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %86, i32 0, i32 0, i32* %87) %89 = load i64, i64* %86, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %90 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %88, i8** %90, align 8 %91 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %89, i64* %91, align 4 %92 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %93 = load i8*, i8** %92, align 8 %94 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %95 = load i64, i64* %94, align 4 %96 = trunc i64 %95 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %93, i32 %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %97 = icmp eq i8* %88, null br i1 %97, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free(i8* %88) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %98 = alloca i64, align 8 %99 = alloca i32, align 4 store i32 4, i32* %99, align 4 %100 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.7, i32 0, i32 0), i64* %98, i32 0, i32 0, i32* %99) %101 = load i64, i64* %98, align 4 %stringFormat_desc19 = alloca %string_descriptor, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %100, i8** %102, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %101, i64* %103, align 4 %104 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %105 = load i8*, i8** %104, align 8 %106 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %107 = load i64, i64* %106, align 4 %108 = trunc i64 %107 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %105, i32 %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %109 = icmp eq i8* %100, null br i1 %109, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free(i8* %100) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 call void @_lpython_free_argv() br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_array_bound_1 FINALIZE_SYMTABLE_array_bound_1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_assignment_arr2-3867783.json0000664000175000017500000000105615141516316033153 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_assignment_arr2-3867783", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_assignment_arr2.f90", "infile_hash": "f3f2370b6a0b01d3cea561679f559769fc74d0a3e5100a33c249e0c7", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_assignment_arr2-3867783.stderr", "stderr_hash": "b774158a1115ef8b895a06920255e024b47c4d489e57b3642a65baf9", "returncode": 2 }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e26601.stdoutlfortran-lfortran-2f73434/tests/reference/llvm-unlimited_polymorphic_intrinsic_type_allocate-3e266010000664000175000017500000002433215141516316034144 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %"~unlimited_polymorphic_type" = type <{ i32 (...)**, i8* }> @_Type_Info_integer_8 = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* inttoptr (i32 8 to i8*), i8* inttoptr (i8 8 to i8*) }, align 8 @_VTable_integer_8 = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_Type_Info_integer_8 to i8*), i8* bitcast (void (i8*, i8*)* @_copy_integer_8 to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [10 x i8] c"integer(8)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data, i32 0, i32 0), i64 10 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Type_Info_integer_4 = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* inttoptr (i32 4 to i8*), i8* inttoptr (i8 4 to i8*) }, align 8 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [10 x i8] c"integer(4)" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.1, i32 0, i32 0), i64 10 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Type_Info_real_4 = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* inttoptr (i32 6 to i8*), i8* inttoptr (i8 4 to i8*) }, align 8 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [4 x i8] c"real" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.3, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [7 x i8] c"default" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.5, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %var = alloca %"~unlimited_polymorphic_type"*, align 8 store %"~unlimited_polymorphic_type"* null, %"~unlimited_polymorphic_type"** %var, align 8 %x = alloca i64, align 8 store i64 10, i64* %x, align 4 %2 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 8, i1 false) %3 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 16, i1 false) %4 = bitcast i8* %3 to %"~unlimited_polymorphic_type"* store %"~unlimited_polymorphic_type"* %4, %"~unlimited_polymorphic_type"** %var, align 8 %5 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %6 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %5, i32 0, i32 1 store i8* %2, i8** %6, align 8 %7 = load i8*, i8** %6, align 8 %8 = bitcast i8* %7 to i64* %9 = bitcast %"~unlimited_polymorphic_type"* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_VTable_integer_8, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %9, align 8 %10 = load i64, i64* %x, align 4 store i64 %10, i64* %8, align 4 %11 = alloca i1, align 1 %12 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %13 = bitcast %"~unlimited_polymorphic_type"* %12 to i8* %14 = call i8* @__lfortran_dynamic_cast(i8* %13, i8* bitcast ({ i8*, i8* }* @_Type_Info_integer_8 to i8*), i1 true) %15 = icmp ne i8* %14, null store i1 %15, i1* %11, align 1 %16 = load i1, i1* %11, align 1 br i1 %16, label %then, label %else then: ; preds = %.entry br label %"~select_type_block_.start" "~select_type_block_.start": ; preds = %then %17 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %"~select_type_block_.end" "~select_type_block_.end": ; preds = %"~select_type_block_.start" br label %"FINALIZE_SYMTABLE_~select_type_block_" "FINALIZE_SYMTABLE_~select_type_block_": ; preds = %"~select_type_block_.end" br label %ifcont else: ; preds = %.entry %18 = alloca i1, align 1 %19 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %20 = bitcast %"~unlimited_polymorphic_type"* %19 to i8* %21 = call i8* @__lfortran_dynamic_cast(i8* %20, i8* bitcast ({ i8*, i8* }* @_Type_Info_integer_4 to i8*), i1 true) %22 = icmp ne i8* %21, null store i1 %22, i1* %18, align 1 %23 = load i1, i1* %18, align 1 br i1 %23, label %then1, label %else2 then1: ; preds = %else br label %"~select_type_block_1.start" "~select_type_block_1.start": ; preds = %then1 %24 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %24, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %"~select_type_block_1.end" "~select_type_block_1.end": ; preds = %"~select_type_block_1.start" br label %"FINALIZE_SYMTABLE_~select_type_block_1" "FINALIZE_SYMTABLE_~select_type_block_1": ; preds = %"~select_type_block_1.end" br label %ifcont else2: ; preds = %else %25 = alloca i1, align 1 %26 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %27 = bitcast %"~unlimited_polymorphic_type"* %26 to i8* %28 = call i8* @__lfortran_dynamic_cast(i8* %27, i8* bitcast ({ i8*, i8* }* @_Type_Info_real_4 to i8*), i1 true) %29 = icmp ne i8* %28, null store i1 %29, i1* %25, align 1 %30 = load i1, i1* %25, align 1 br i1 %30, label %then3, label %else4 then3: ; preds = %else2 br label %"~select_type_block_2.start" "~select_type_block_2.start": ; preds = %then3 %31 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %31, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %"~select_type_block_2.end" "~select_type_block_2.end": ; preds = %"~select_type_block_2.start" br label %"FINALIZE_SYMTABLE_~select_type_block_2" "FINALIZE_SYMTABLE_~select_type_block_2": ; preds = %"~select_type_block_2.end" br label %ifcont else4: ; preds = %else2 br label %"~select_type_block_3.start" "~select_type_block_3.start": ; preds = %else4 %32 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %32, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %"~select_type_block_3.end" "~select_type_block_3.end": ; preds = %"~select_type_block_3.start" br label %"FINALIZE_SYMTABLE_~select_type_block_3" "FINALIZE_SYMTABLE_~select_type_block_3": ; preds = %"~select_type_block_3.end" br label %ifcont ifcont: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_3", %"FINALIZE_SYMTABLE_~select_type_block_2", %"FINALIZE_SYMTABLE_~select_type_block_1", %"FINALIZE_SYMTABLE_~select_type_block_" call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate: ; preds = %return br label %Finalize_Variable_var Finalize_Variable_var: ; preds = %FINALIZE_SYMTABLE_unlimited_polymorphic_intrinsic_type_allocate %33 = load %"~unlimited_polymorphic_type"*, %"~unlimited_polymorphic_type"** %var, align 8 %34 = icmp ne %"~unlimited_polymorphic_type"* %33, null br i1 %34, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_var %35 = getelementptr %"~unlimited_polymorphic_type", %"~unlimited_polymorphic_type"* %33, i32 0, i32 1 %36 = load %"~unlimited_polymorphic_type"*, i8** %35, align 8 %37 = icmp eq %"~unlimited_polymorphic_type"* %33, null br i1 %37, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %38 = bitcast %"~unlimited_polymorphic_type"* %33 to i8* call void @_lfortran_free(i8* %38) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_var br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_integer_8(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to i64* %3 = bitcast i8* %1 to i64* %4 = load i64, i64* %2, align 4 store i64 %4, i64* %3, align 4 ret void } declare i8* @__lfortran_dynamic_cast(i8*, i8*, i1) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() declare void @_lfortran_free(i8*) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-redeclaration1-b66ed3a.json0000664000175000017500000000074615141516316026445 0ustar alastairalastair{ "basename": "asr-redeclaration1-b66ed3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/redeclaration1.f90", "infile_hash": "4d6cab928e80a2d41ed8e5b4f018b5bd36eab2f6e7bf9572486280b2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-redeclaration1-b66ed3a.stderr", "stderr_hash": "9065758617b52d0d612d6fb388037f17558d47874fc3409dbbf2c574", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-classes2-f926d51.json0000664000175000017500000000072015141516316025312 0ustar alastairalastair{ "basename": "llvm-classes2-f926d51", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/classes2.f90", "infile_hash": "2cfac3880e7182601f0b4be7f9818327edf969abff5d13be53cbf23d", "outfile": null, "outfile_hash": null, "stdout": "llvm-classes2-f926d51.stdout", "stdout_hash": "23aefb237cdf12153fca4e3be4a0a08e5feb149551669caf4dafda87", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_37-2c7ae83.json0000664000175000017500000000077415141516316026660 0ustar alastairalastair{ "basename": "asr_openmp-openmp_37-2c7ae83", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_37.f90", "infile_hash": "700b2c6afb1ba72344e8c45cd51aa4bc69919c5b06c79e07cc73ca04", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_37-2c7ae83.stdout", "stdout_hash": "0e6b9a17b85b02ba54cedc02601d355ea1b08e7cb82441253d8a000b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-implicit_check-4f0391f.stdout0000664000175000017500000000105315141516316026724 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec A H ) (LetterSpec O Z )] )] () )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-associate_01-aa0fe46.stdout0000664000175000017500000000120015141516316027032 0ustar alastairalastairprogram associate_01 implicit none real, allocatable :: a(:), b(:,:), c(:,:,:) real, pointer :: x(:), y(:,:,:) real :: a_1, c_234, c_121 integer :: n a_1 = 0 n = 10 allocate(a(5)) allocate(b(n, n), c(n, 5, n)) 1 loop: associate (x => a, y => c, z => c(:, 2, :)) x(1) = a_1 + 5 y(2, 3, 4) = 3 z(1, 1) = 17 if (size(z) /= 100) then error stop end if end associate loop a_1 = a(1) if (a(1) == 5) then go to 1 end if c_234 = c(2, 3, 4) c_121 = c(1, 2, 1) if (a_1 /= 10.) then error stop end if if (c_234 /= 3.) then error stop end if if (c_121 /= 17.) then error stop end if end program associate_01 lfortran-lfortran-2f73434/tests/reference/llvm-derived_types_32-4684b97.stdout0000664000175000017500000004722715141516316027262 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [4 x i8] c"(g0)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @serialization_info = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 @string_const_data.1 = private constant [1 x i8] c" " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [7 x i8] c"S-DESC\00", align 1 @4 = private unnamed_addr constant [93 x i8] c"At 30:10 of file tests/../integration_tests/derived_types_32.f90\0AArgument %d is unallocated.\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.4 = private constant [18 x i8] c"10.000000000000000" @string_const.5 = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data.4, i32 0, i32 0), i64 18 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @_lcompilers_len_trim_str(%string_descriptor* %str) { .entry: %result = alloca i32, align 4 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 4 %2 = trunc i64 %1 to i32 store i32 %2, i32* %result, align 4 %3 = load i32, i32* %result, align 4 %4 = icmp ne i32 %3, 0 br i1 %4, label %then, label %else2 then: ; preds = %.entry br label %loop.head loop.head: ; preds = %ifcont, %then %5 = load i32, i32* %result, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = sext i32 %5 to i64 %9 = sub i64 %8, 1 %10 = getelementptr i8, i8* %7, i64 %9 %StringItem = alloca %string_descriptor, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 0 store i8* %10, i8** %11, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 1 store i64 1, i64* %12, align 4 %13 = getelementptr %string_descriptor, %string_descriptor* %StringItem, i32 0, i32 0 %14 = load i8*, i8** %13, align 8 %15 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 %16 = load i8, i8* %14, align 1 %17 = load i8, i8* %15, align 1 %18 = icmp eq i8 %16, %17 br i1 %18, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %19 = load i32, i32* %result, align 4 %20 = sub i32 %19, 1 store i32 %20, i32* %result, align 4 %21 = load i32, i32* %result, align 4 %22 = icmp eq i32 %21, 0 br i1 %22, label %then1, label %else then1: ; preds = %loop.body br label %loop.end unreachable_after_exit: ; No predecessors! br label %ifcont else: ; preds = %loop.body br label %ifcont ifcont: ; preds = %else, %unreachable_after_exit br label %loop.head loop.end: ; preds = %then1, %loop.head br label %ifcont3 else2: ; preds = %.entry br label %ifcont3 ifcont3: ; preds = %else2, %loop.end br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE__lcompilers_len_trim_str FINALIZE_SYMTABLE__lcompilers_len_trim_str: ; preds = %return %23 = load i32, i32* %result, align 4 ret i32 %23 } define void @_lcompilers_trim_str(%string_descriptor* %str, %string_descriptor* %result) { .entry: %0 = call i32 @_lcompilers_len_trim_str(%string_descriptor* %str) %1 = sext i32 %0 to i64 %2 = sub i64 %1, 1 %3 = add i64 %2, 1 %4 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %5 = load i8*, i8** %4, align 8 %StrSliceGEP = getelementptr i8, i8* %5, i64 0 %StrSlice_StrView = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %3, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %result, i32 0, i32 0 %9 = getelementptr %string_descriptor, %string_descriptor* %result, i32 0, i32 1 %10 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %13 = load i64, i64* %12, align 4 call void @_lfortran_strcpy(i8** %8, i64* %9, i8 0, i8 0, i8* %11, i64 %13) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_trim_str FINALIZE_SYMTABLE__lcompilers_trim_str: ; preds = %return ret void } define void @__module_testdrive_derived_types_32_real_dp_to_string(double* %val, %string_descriptor* %string) { .entry: %__libasr__created__var__2_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__2_return_slot, align 1 %buffer = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %buffer, align 1 %0 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 1 store i64 128, i64* %0, align 4 %1 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %2 = call i8* @_lfortran_malloc(i64 128) store i8* %2, i8** %1, align 8 %buffer_len = alloca i32, align 4 store i32 128, i32* %buffer_len, align 4 %3 = load %string_descriptor, %string_descriptor* %string, align 1 %4 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %5 = load i8*, i8** %4, align 8 %6 = icmp ne i8* %5, null br i1 %6, label %then, label %else then: ; preds = %.entry %7 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %8 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 1 %9 = load i8*, i8** %7, align 8 call void @_lfortran_free(i8* %9) store i8* null, i8** %7, align 8 store i64 0, i64* %8, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %10 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %11 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 1 %12 = alloca i32*, align 8 store i32* null, i32** %12, align 8 %13 = load i32*, i32** %12, align 8 %14 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %15 = alloca i64, align 8 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %14, i64 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %15, i32 0, i32 0, double* %val) %17 = load i64, i64* %15, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %23 = load i64, i64* %22, align 4 call void (i8**, i8, i8, i64*, i32*, i8*, i64, ...) @_lfortran_string_write(i8** %10, i8 0, i8 0, i64* %11, i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @2, i32 0, i32 0), i64 2, i8* %21, i64 %23) %24 = icmp eq i8* %16, null br i1 %24, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %16) br label %free_done free_done: ; preds = %free_nonnull, %ifcont %25 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %26 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %27 = load i8*, i8** %25, align 8 call void @_lfortran_free(i8* %27) store i8* null, i8** %25, align 8 store i64 0, i64* %26, align 4 %28 = call i32 @_lcompilers_len_trim_str(%string_descriptor* %buffer) %29 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %30 = load i8*, i8** %29, align 8 %31 = icmp ne i8* %30, null br i1 %31, label %then1, label %else2 then1: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %free_done br label %ifcont3 ifcont3: ; preds = %else2, %then1 %32 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %33 = sext i32 %28 to i64 %34 = call i8* @_lfortran_string_malloc(i64 %33) store i8* %34, i8** %32, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %36 = sext i32 %28 to i64 store i64 %36, i64* %35, align 4 call void @_lcompilers_trim_str(%string_descriptor* %buffer, %string_descriptor* %__libasr__created__var__2_return_slot) %37 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 0 %38 = getelementptr %string_descriptor, %string_descriptor* %string, i32 0, i32 1 %39 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %42 = load i64, i64* %41, align 4 call void @_lfortran_strcpy(i8** %37, i64* %38, i8 1, i8 1, i8* %40, i64 %42) br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_real_dp_to_string FINALIZE_SYMTABLE_real_dp_to_string: ; preds = %return br label %Finalize_Variable___libasr__created__var__2_return_slot Finalize_Variable___libasr__created__var__2_return_slot: ; preds = %FINALIZE_SYMTABLE_real_dp_to_string %43 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 %45 = icmp eq i8* %44, null br i1 %45, label %free_done5, label %free_nonnull4 free_nonnull4: ; preds = %Finalize_Variable___libasr__created__var__2_return_slot call void @_lfortran_free(i8* %44) br label %free_done5 free_done5: ; preds = %free_nonnull4, %Finalize_Variable___libasr__created__var__2_return_slot br label %Finalize_Variable_buffer Finalize_Variable_buffer: ; preds = %free_done5 %46 = getelementptr %string_descriptor, %string_descriptor* %buffer, i32 0, i32 0 %47 = load i8*, i8** %46, align 8 %48 = icmp eq i8* %47, null br i1 %48, label %free_done7, label %free_nonnull6 free_nonnull6: ; preds = %Finalize_Variable_buffer call void @_lfortran_free(i8* %47) br label %free_done7 free_done7: ; preds = %free_nonnull6, %Finalize_Variable_buffer ret void } declare i8* @_lfortran_malloc(i64) declare void @_lfortran_free(i8*) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_string_write(i8**, i8, i8, i64*, i32*, i8*, i64, ...) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_string_malloc(i64) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__libasr__created__var__0_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 %__libasr__created__var__1_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__1_return_slot, align 1 %value = alloca double, align 8 store double 1.000000e+01, double* %value, align 8 %2 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %3 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %4 = load i8*, i8** %2, align 8 call void @_lfortran_free(i8* %4) store i8* null, i8** %2, align 8 store i64 0, i64* %3, align 4 call void @__module_testdrive_derived_types_32_real_dp_to_string(double* %value, %string_descriptor* %__libasr__created__var__0_return_slot) %5 = alloca i64, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = ptrtoint i8* %7 to i64 %9 = icmp eq i64 %8, 0 br i1 %9, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @4, i32 0, i32 0), i32 1) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %10 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = load %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 %13 = alloca %string_descriptor, align 8 store %string_descriptor %12, %string_descriptor* %13, align 1 %14 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @serialization_info.3, i32 0, i32 0), i64* %5, i32 0, i32 1, i64 %11, %string_descriptor* %13) %15 = load i64, i64* %5, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %15, i64* %17, align 4 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %21 = load i64, i64* %20, align 4 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %14) br label %free_done free_done: ; preds = %free_nonnull, %ifcont %24 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %25 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %26 = load i8*, i8** %24, align 8 call void @_lfortran_free(i8* %26) store i8* null, i8** %24, align 8 store i64 0, i64* %25, align 4 call void @__module_testdrive_derived_types_32_real_dp_to_string(double* %value, %string_descriptor* %__libasr__created__var__1_return_slot) %27 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %28 = load i8*, i8** %27, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %30 = load i64, i64* %29, align 4 %31 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.5, i32 0, i32 0), align 8 %32 = call i32 @str_compare(i8* %28, i64 %30, i8* %31, i64 18) %33 = icmp ne i32 %32, 0 br i1 %33, label %then1, label %else then1: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont2 else: ; preds = %free_done br label %ifcont2 ifcont2: ; preds = %else, %then1 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont2 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return br label %Finalize_Variable___libasr__created__var__0_return_slot Finalize_Variable___libasr__created__var__0_return_slot: ; preds = %FINALIZE_SYMTABLE_main %34 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %35 = load i8*, i8** %34, align 8 %36 = icmp eq i8* %35, null br i1 %36, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %Finalize_Variable___libasr__created__var__0_return_slot call void @_lfortran_free(i8* %35) br label %free_done4 free_done4: ; preds = %free_nonnull3, %Finalize_Variable___libasr__created__var__0_return_slot br label %Finalize_Variable___libasr__created__var__1_return_slot Finalize_Variable___libasr__created__var__1_return_slot: ; preds = %free_done4 %37 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = icmp eq i8* %38, null br i1 %39, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %Finalize_Variable___libasr__created__var__1_return_slot call void @_lfortran_free(i8* %38) br label %free_done6 free_done6: ; preds = %free_nonnull5, %Finalize_Variable___libasr__created__var__1_return_slot ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i32 @str_compare(i8*, i64, i8*, i64) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/fortran-int_to_int_cast_fortran_codegen-913a36c.json0000664000175000017500000000103615141516316032665 0ustar alastairalastair{ "basename": "fortran-int_to_int_cast_fortran_codegen-913a36c", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/int_to_int_cast_fortran_codegen.f90", "infile_hash": "4993e4b5ba22668cdfb76bf75a291c41d074af44ea3bd1bd143dbcd0", "outfile": null, "outfile_hash": null, "stdout": "fortran-int_to_int_cast_fortran_codegen-913a36c.stdout", "stdout_hash": "1b62de2ca1ecadb88968755fa090fb1bd3bd1233abe3cce6070f669e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-int_dp-41a64fa.json0000664000175000017500000000073415141516316024736 0ustar alastairalastair{ "basename": "asr-int_dp-41a64fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp.f90", "infile_hash": "f59edf2644a27d68d7127283dbb961288e4041e2de16284795b100de", "outfile": null, "outfile_hash": null, "stdout": "asr-int_dp-41a64fa.stdout", "stdout_hash": "e0797466c1d5bd135e4996d16c23e3595a460020e976eb7851b1388a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-print4-e3cf30b.stdout0000664000175000017500000000114315141516316025343 0ustar alastairalastair20000000000000000 22 33 F 1 1 1 1 1 1 1 1 1 1 (2.00000000,3.00000000) 1 1 1 1 1 1 1 1 1 1 HelloLFortran HelloLFortran HelloLFortran HelloLComp 20000000000000000 20000000000000000 20000000000000000 HelloLFortran HelloLFortran HelloLFortran med med med med med med med med med med 22 10.300000000000001 T T T T T T T T T F 10.3000002 F 232 string string 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 1 1 1 1 1 1 here HelloLFortran HelloLFortran F lfortran-lfortran-2f73434/tests/reference/asr-interface_05-5639d22.stdout0000664000175000017500000004320115141516316026142 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_05: (Program (SymbolTable 5 { a: (ExternalSymbol 5 a 2 a interface_05_mod [] a Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_05_mod [] a1 Public ), a2@a: (ExternalSymbol 5 a2@a 2 a2 interface_05_mod [] a2 Public ), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_05_mod [] a1 Private ), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_05_mod [] a2 Private ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) interface_05 [interface_05_mod] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 5 i) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_05_mod: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1 2 a2] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (Variable 3 a1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a1 (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 3 a1) Public .false. .false. () ), a2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 4 a2 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a2 (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) () .false. .false. )] (Var 4 a2) Public .false. .false. () ) }) interface_05_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-logical3-b6316c6.stdout0000664000175000017500000003216515141516316025456 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical3: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) logical3 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 1 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 1 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 2 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 2 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Xor (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line xor - Condition is true" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line xor - Condition is false" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (Assignment (Var 2 a) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (If () (LogicalNot (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) (Logical 4) () ) [(Print (StringConstant "Line 3 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 3 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4) () ) [(Print (StringConstant "Line 4 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 4 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 b) Eqv (Var 2 a) (Logical 4) () ) [(Print (StringConstant "Line 5 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 5 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 6 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 6 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 7 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 7 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] ) (If () (LogicalBinOp (Var 2 a) Xor (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 8 xor - Condition is true" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [(Print (StringConstant "Line 8 xor - Condition is false" (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-doloop_08-f0d8fe6.json0000664000175000017500000000073615141516316025701 0ustar alastairalastair{ "basename": "julia-doloop_08-f0d8fe6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_08-f0d8fe6.stdout", "stdout_hash": "b8a7f17b6f37fec4c058c96909857db7668881ee3b78bd2f9815feb9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine7-e0b863b.json0000664000175000017500000000071715141516316026272 0ustar alastairalastair{ "basename": "julia-subroutine7-e0b863b", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine7-e0b863b.stdout", "stdout_hash": "2399ab9cb3fe2b65500fd1f09c5ce34b0cfc6a0bc2d07ad844e98ba8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_01-6c675be.stderr0000664000175000017500000000031215141516316025243 0ustar alastairalastairsemantic error: `kind` argument of `aint` intrinsic must be a scalar --> tests/errors/kind_01.f90:3:36 | 3 | print *, aint([1.0, 2.0, 3.0], [4, 4]) | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-flush_invalid_kwarg1-9fc0c7b.json0000664000175000017500000000077015141516316027653 0ustar alastairalastair{ "basename": "asr-flush_invalid_kwarg1-9fc0c7b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/flush_invalid_kwarg1.f90", "infile_hash": "bdc773dad035cc26560f79155d871b9ca6c927b0f94ed47ab162d321", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-flush_invalid_kwarg1-9fc0c7b.stderr", "stderr_hash": "dba53e91602bf50354de524fc4de3525c7a64d318761b9fac931cfed", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-optional_argument_subroutine_in_type-0d81d24.stdout0000664000175000017500000002176315141516316033514 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { 1_test_type_test_subroutine: (ExternalSymbol 5 1_test_type_test_subroutine 3 test_subroutine test_type [] test_subroutine Public ), test_subroutine: (ExternalSymbol 5 test_subroutine 2 test_subroutine test_module [] test_subroutine Public ), test_type: (ExternalSymbol 5 test_type 2 test_type test_module [] test_type Public ), test_type_instance: (Variable 5 test_type_instance [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 test_type Source Public Required .false. .false. .false. () .false. .false. ) }) main [test_module] [(SubroutineCall 5 1_test_type_test_subroutine () [(())] (Var 5 test_type_instance) .false. )] ), test_module: (Module (SymbolTable 2 { test_subroutine: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) test_subroutine (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Print (StringConstant "Hello World" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), test_type: (Struct (SymbolTable 3 { test_real_value: (Variable 3 test_real_value [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), test_subroutine: (StructMethodDeclaration 3 test_subroutine () test_subroutine 2 test_subroutine Source .false. .true. ) }) test_type (StructType [(Real 4)] [] .true. .false. ) [] [test_real_value] [] Source Public .false. .false. [] () () ) }) test_module () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor22-17078cd.json0000664000175000017500000000077315141516316030552 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor22-17078cd", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor22.f90", "infile_hash": "e389d649c7f9f50187334845e9058801aef996346232815c3a6a5304", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor22-17078cd.stdout", "stdout_hash": "59c0eb2534d3fe294ceb31c9d8eb3b993e640c1cc38c76b8ae061dca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_03-2eacab7.stdout0000664000175000017500000001277015141516316026144 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_03_a_b() { .entry: %x = alloca float, align 4 store float 6.000000e+00, float* %x, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %1 = load float, float* %x, align 4 store float %1, float* @__module___lcompilers_created__nested_context__b__x, align 4 call void @b.__module_nested_03_a_c() %2 = load float, float* @__module___lcompilers_created__nested_context__b__x, align 4 store float %2, float* %x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_03_a_c() { .entry: %0 = alloca i64, align 8 %1 = alloca i32, align 4 store i32 5, i32* %1, align 4 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %1) %3 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = alloca i64, align 8 %13 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %12, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__x) %14 = load i64, i64* %12, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_03_a_b() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_03 FINALIZE_SYMTABLE_nested_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-save3-025da43.json0000664000175000017500000000070415141516316024413 0ustar alastairalastair{ "basename": "asr-save3-025da43", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/save3.f90", "infile_hash": "73a25f7c7513eff87c70b3f4e4d291178ff58078c3f57c81f356d77f", "outfile": null, "outfile_hash": null, "stdout": "asr-save3-025da43.stdout", "stdout_hash": "95da6dda5276485632a02af6055ac462d9082c3c975b90968308293f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_11-c169ea7.stdout0000664000175000017500000003111115141516316027203 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_11: (Module (SymbolTable 2 { 1_y_backslash: (ExternalSymbol 2 1_y_backslash 3 backslash y [] backslash Public ), type_y: (Variable 2 type_y [] Local (StructConstant 2 y [((StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) (StructConstant 2 y [((StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) Parameter (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) 2 y Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [type_y] Local (IntrinsicElementalFunction StringConcat [(StringConstant "lf" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 2 type_y) 2 1_y_backslash (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Struct (SymbolTable 3 { backslash: (Variable 3 backslash [] Local (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) y (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) [] [backslash] [] Source Public .false. .false. [] () () ) }) derived_types_11 () [] .false. .false. .false. ), main: (Program (SymbolTable 4 { 1_y_backslash: (ExternalSymbol 4 1_y_backslash 3 backslash y [] backslash Public ), type_y: (ExternalSymbol 4 type_y 2 type_y derived_types_11 [] type_y Public ), x: (ExternalSymbol 4 x 2 x derived_types_11 [] x Public ), y: (ExternalSymbol 4 y 2 y derived_types_11 [] y Public ) }) main [derived_types_11] [(If () (StringCompare (StructInstanceMember (Var 4 type_y) 4 1_y_backslash (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) NotEq (StringConstant "\\" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (StringCompare (Var 4 x) NotEq (StringConstant "lf\\" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr1-213371d.stdout0000664000175000017500000000371615141516316027665 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 2 f1) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-callback_02-41bc7d7.json0000664000175000017500000000075615141516316025714 0ustar alastairalastair{ "basename": "llvm-callback_02-41bc7d7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_02.f90", "infile_hash": "880452ed794b4467313ba9a87318b17fe757a084b2a39129209153d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_02-41bc7d7.stdout", "stdout_hash": "747bd8d23147e75ae8e838f774de4162699312ab2d62c8e87bdaf967", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce2-1f96d95.json0000664000175000017500000000076415141516316027704 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce2-1f96d95", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce2.f90", "infile_hash": "bfbb329c50d12cea347c298fcc5ba3ee9f192b8b43de74deccf70615", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce2-1f96d95.stdout", "stdout_hash": "0526bbede1282ffb3dc2d117dfb3ad0c5d4fe1c60e1f5a486173c266", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_complex-16f8004.json0000664000175000017500000000101515141516316031034 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_complex-16f8004", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_complex.f90", "infile_hash": "205c807423fafa882814132de129c632af12128a0a16a8ef7cd4b941", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_complex-16f8004.stderr", "stderr_hash": "fef4a9d3ffcfe5d1434e10a7d30deff87b0fa9a306a82362b4c68088", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err3-a7ea818.json0000664000175000017500000000076015141516316027452 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err3-a7ea818", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err3.f90", "infile_hash": "c5d782ebbaa6d2e7fef698e841091485950442443d6ea8cd0ac62351", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err3-a7ea818.stderr", "stderr_hash": "c4a230a12908daec8eab609f7b5a75011ec1d76b04a8d3e8fbf0cd61", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-functions_41-1e43fd0.stdout0000664000175000017500000000371315141516316026350 0ustar alastairalastair(TranslationUnit [(Program functions_41 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 notrecursive_sub [] [] [] [] () ) (Print 0 () [(FuncCallOrArray notrecursive_fun [] [] [] [] [] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine notrecursive_sub [] [(SimpleAttribute AttrNonRecursive )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "This is a non-recursive subroutine" ())] () )] [] [] ) (Function notrecursive_fun [] [(SimpleAttribute AttrNonRecursive ) (AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Print 0 () [(String "This is a non-recursive function" ())] () ) (Assignment 0 notrecursive_fun 1 () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-allocate_04-68facec.stdout0000664000175000017500000002463715141516316026302 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_04: (Program (SymbolTable 2 { c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), message: (Variable 2 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), num: (Variable 2 num [] Local () () Default (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 2 string [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) allocate_04 [] [(Allocate [((Var 2 string) [] (IntegerConstant 8 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 2 message) [] (IntegerConstant 20 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 num) (StringConstant "lfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 string) (IntrinsicElementalFunction StringTrim [(Var 2 num)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "lfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 num) (StringConstant "lfortran working" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 message) (StringSection (Var 2 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 2 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 2 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 message)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-bindc2-62a702e.stdout0000664000175000017500000005755615141516316025131 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc2: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), newshape: (Variable 2 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), xv: (Variable 2 xv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ) }) bindc2 [iso_c_binding] [(Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 2 x) (ArrayPhysicalCast (Var 2 xv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 xv) () (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (Var 2 newshape) () ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 xv) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 xv) () (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArraySize (Var 2 x) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 x) () (Integer 4) () ) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-implicit1-e201262.stdout0000664000175000017500000005347315141516316025572 0ustar alastairalastair(TranslationUnit [(Program implicit1 (TriviaNode [(EndOfLine) (Comment "! AST only" )] [] ) [] [(ImplicitNone [] () ) (ImplicitNone [] () ) (ImplicitNone [] () ) (ImplicitNone [(ImplicitNoneExternal 0 )] () ) (ImplicitNone [(ImplicitNoneType)] () ) (ImplicitNone [(ImplicitNoneExternal 0 ) (ImplicitNoneType)] () ) (ImplicitNone [(ImplicitNoneType) (ImplicitNoneExternal 0 )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeReal [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() 8 Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeReal [(() 8 Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [] () () None ) [(LetterSpec () c ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(() id Value)] () () None ) [(LetterSpec a z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec i n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () i ) (LetterSpec () j ) (LetterSpec () k ) (LetterSpec () l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () i ) (LetterSpec j l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 8 Value)] () () None ) [(LetterSpec () i ) (LetterSpec j l ) (LetterSpec () m ) (LetterSpec () n )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec () A ) (LetterSpec () C )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 4 Value)] () () None ) [(LetterSpec () C ) (LetterSpec D x )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(() 4 Value)] () () None ) [(LetterSpec () C ) (LetterSpec D x )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeLogical [] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() 4 Value)] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(() 4 Value)] () () None ) [(LetterSpec () l ) (LetterSpec u z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() dp Value)] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () C )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() 4 Value)] () () None ) [(LetterSpec () z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(() 4 Value)] () () None ) [(LetterSpec () z )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeType [] () BLOB None ) [(LetterSpec () A )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeClass [] () X None ) [(LetterSpec A b )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Implicit [(ImplicitSpec (AttrType TypeReal [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeReal [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeReal [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeReal [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeInteger [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeInteger [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeInteger [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeLogical [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeLogical [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeLogical [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeLogical [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeComplex [(kind 4 Value)] () () None ) [(LetterSpec () a )] ) (ImplicitSpec (AttrType TypeComplex [(() (+ 4 4) Value)] () () None ) [(LetterSpec () b )] ) (ImplicitSpec (AttrType TypeComplex [(() d Value)] () () None ) [(LetterSpec () d )] ) (ImplicitSpec (AttrType TypeComplex [(() (FuncCallOrArray d [] [(() 2 () 0)] [] [] [] ) Value)] () () None ) [(LetterSpec a z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(kind c_char Value) (len 4 Value)] () () None ) [(LetterSpec () a )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(len 4 Value) (kind c_char Value)] () () None ) [(LetterSpec () a )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(kind c_char Value)] () () None ) [(LetterSpec () a )] )] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array_03-a79d86f.json0000664000175000017500000000072415141516316025122 0ustar alastairalastair{ "basename": "asr-array_03-a79d86f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_03.f90", "infile_hash": "19770180604e3013e99175b497b5992be18301c5f8a91174421a9141", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_03-a79d86f.stderr", "stderr_hash": "051376a2fbb500d15ca55738c4ada5da3d63802af41092985da8580c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-entry1-5f14c6d.json0000664000175000017500000000072215141516316025366 0ustar alastairalastair{ "basename": "ast_f90-entry1-5f14c6d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-entry1-5f14c6d.stdout", "stdout_hash": "e121152a4ada136406c6f0cc3ea206189fc7fbea0cd3d5cb1a401bcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-program3-32749e4.json0000664000175000017500000000067215141516316024524 0ustar alastairalastair{ "basename": "c-program3-32749e4", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "c-program3-32749e4.stdout", "stdout_hash": "dca2659bdfaea8181b9d34cd7070e45eb52d551e9f4b5f4c40fd5529", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-types_07-54d4a85.stdout0000664000175000017500000001606115141516316025436 0ustar alastairalastair(TranslationUnit [(Program types_07 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(y [] [] () x Arrow ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrTarget )] [(a [(1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(b [(() () DimensionExpr)] [] () a Arrow ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine g [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine h [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len 80 Value)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 80 Value)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] ) (Subroutine m [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len (+ 40 40) Value)] () () None ) [(AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() (- 100 20) Value)] () () None ) [(AttrIntent In )] [(s2 [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast-template_02-80b38d0.stdout0000664000175000017500000003226615141516316026077 0ustar alastairalastair(TranslationUnit [(Module template_02_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Requirement eq [t ne] [(DerivedType t [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function ne [(lhs) (rhs)] [] () () () [] [] [] [(Declaration (AttrType TypeType [] () t None ) [(AttrIntent In )] [(lhs [] [] () () None ()) (rhs [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(ne [] [] () () None ())] () )] [] [] [] )] ) (Template change_positions_tmpl [t ne] [(Require [(UnitRequire eq [(AttrNamelist t ) (AttrNamelist ne )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(change_positions_t [] [] () () None ())] () )] [(Function change_positions_t [(vec)] [] mask () () [] [] [] [(Declaration (AttrType TypeType [] () t None ) [(AttrIntent In )] [(vec [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(pos [(() () DimensionExpr)] [] () () None ()) (mask [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 n (FuncCallOrArray size [] [(() vec () 0)] [] [] [] ) () ) (Allocate 0 [(() (FuncCallOrArray pos [] [(() n () 0)] [] [] [] ) () 0)] [] () ) (If 0 () (< n 1) [(Return 0 () () )] [] () () () ) (Assignment 0 pos 0 () ) (Assignment 0 (FuncCallOrArray pos [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 j 1 () ) (DoLoop 0 () 0 i 2 n () [(If 0 () (FuncCallOrArray ne [] [(() (FuncCallOrArray vec [] [(() i () 0)] [] [] [] ) () 0) (() (FuncCallOrArray vec [] [(() (- i 1) () 0)] [] [] [] ) () 0)] [] [] [] ) [(Assignment 0 j (+ j 1) () ) (Assignment 0 (FuncCallOrArray pos [] [(() j () 0)] [] [] [] ) i () )] [] () () () )] () () ) (Allocate 0 [(() (FuncCallOrArray mask [] [(() j () 0)] [] [] [] ) () 0)] [] () ) (DoLoop 0 () 0 i 1 j () [(Assignment 0 (FuncCallOrArray mask [] [(() i () 0)] [] [] [] ) (FuncCallOrArray pos [] [(() i () 0)] [] [] [] ) () )] () () )] [] [] )] )] [] [] ) (Program template_02 () [(Use [] template_02_m [] .false. () )] [(ImplicitNone [] () )] [(Instantiate change_positions_tmpl [(AttrType TypeInteger [] () () None ) (AttrIntrinsicOperator NOTEQ )] [(UseSymbol change_positions_t change_positions_int )] ) (Instantiate change_positions_tmpl [(AttrType TypeCharacter [] () () None ) (AttrIntrinsicOperator NOTEQ )] [(UseSymbol change_positions_t change_positions_chr )] )] [(Print 0 () [(FuncCallOrArray change_positions_int [] [(() (ArrayInitializer () () [3 3 6 2 2 2 1] ) () 0)] [] [] [] )] () ) (Print 0 () [(FuncCallOrArray change_positions_chr [] [(() (ArrayInitializer () () [(String "a" ()) (String "a" ()) (String "b" ()) (String "p" ()) (String "p" ()) (String "p" ()) (String "o" ())] ) () 0)] [] [] [] )] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr4-ffedfc3.json0000664000175000017500000000070715141516316025142 0ustar alastairalastair{ "basename": "llvm-expr4-ffedfc3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr4-ffedfc3.stdout", "stdout_hash": "c5d214cc13a2d3f1f902e923cd175b4fd213dc79930fba1b119d9925", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_array_04-ed63449.stdout0000664000175000017500000015151715141516316027310 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 9 { default_behavior: (ExternalSymbol 9 default_behavior 2 default_behavior reverse_m [] default_behavior Public ), reverse_tmpl: (ExternalSymbol 9 reverse_tmpl 2 reverse_tmpl reverse_m [] reverse_tmpl Public ), test_reverse: (ExternalSymbol 9 test_reverse 2 test_reverse reverse_m [] test_reverse Public ) }) main [reverse_m] [(SubroutineCall 9 test_reverse () [] () .false. )] ), reverse_m: (Module (SymbolTable 2 { default_behavior: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) default_behavior [t] [] ), reverse_tmpl: (Template (SymbolTable 4 { reverse: (Function (SymbolTable 6 { arr: (Variable 6 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 6 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) reverse (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [swap] [(Var 6 arr)] [(DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (ArraySize (Var 6 arr) () (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 6 j) (IntegerBinOp (IntegerBinOp (ArraySize (Var 6 arr) () (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (Var 6 i) (Integer 4) () ) () .false. .false. ) (SubroutineCall 4 swap () [((ArrayItem (Var 6 arr) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 6 arr) [(() (Var 6 j) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] () Public .false. .false. () ), swap: (Function (SymbolTable 5 { tmp: (Variable 5 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 tmp) (Var 5 x) () .false. .false. ) (Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Assignment (Var 5 y) (Var 5 tmp) () .false. .false. )] () Private .false. .false. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) reverse_tmpl [t] [(Require default_behavior [t] )] ), test_reverse: (Function (SymbolTable 7 { __asr_swap: (Function (SymbolTable 10 { tmp: (Variable 10 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 10 x [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 tmp) (Var 10 x) () .false. .false. ) (Assignment (Var 10 x) (Var 10 y) () .false. .false. ) (Assignment (Var 10 y) (Var 10 tmp) () .false. .false. )] () Private .false. .false. () ), a: (Variable 7 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), ireverse: (Function (SymbolTable 8 { arr: (Variable 8 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 8 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 8 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ireverse (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_swap] [(Var 8 arr)] [(DoLoop () ((Var 8 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (ArraySize (Var 8 arr) () (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 8 j) (IntegerBinOp (IntegerBinOp (ArraySize (Var 8 arr) () (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (Var 8 i) (Integer 4) () ) () .false. .false. ) (SubroutineCall 7 __asr_swap () [((ArrayItem (Var 8 arr) [(() (Var 8 i) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 8 arr) [(() (Var 8 j) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] () Public .false. .false. () ) }) test_reverse (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 7 a) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (SubroutineCall 7 ireverse () [((ArrayPhysicalCast (Var 7 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringFormat () [(Var 7 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 7 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) reverse_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-use_statement-bb26ff2.json0000664000175000017500000000073415141516316026426 0ustar alastairalastair{ "basename": "ast-use_statement-bb26ff2", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/use_statement.f90", "infile_hash": "84a9de2e41ec72897bdf0e9ab42eec3c608a26d3636a9e34c20430a1", "outfile": null, "outfile_hash": null, "stdout": "ast-use_statement-bb26ff2.stdout", "stdout_hash": "5ca4b60754373f47b413fe4ba555f64191106b6692c796a8a9f8b6f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_01-9ec8e71.stderr0000664000175000017500000000027415141516316030555 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/operator_overloading_01.f90:28:9 | 28 | endif | ^^^^^ help: write this as 'end if' lfortran-lfortran-2f73434/tests/reference/ast-array4-3d07222.json0000664000175000017500000000070715141516316024522 0ustar alastairalastair{ "basename": "ast-array4-3d07222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array4.f90", "infile_hash": "b2300c4e8589cce700b9cd43cbfb88576774e3262afa4c469c09b7d0", "outfile": null, "outfile_hash": null, "stdout": "ast-array4-3d07222.stdout", "stdout_hash": "b434ad8e2b33453b08d82ba52bc74d109ae1a42aa1a7b8ee06550ca0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-error_stop_04-8f1e721.stderr0000664000175000017500000000001615141516316026453 0ustar alastairalastairERROR STOP hi lfortran-lfortran-2f73434/tests/reference/julia-modules_11-bb73359.stdout0000664000175000017500000000034215141516316026245 0ustar alastairalastairmodule modules_11_module11 function access_internally() println("i = ", " ", i) end end using Main.modules_11_module11: access_internally function main() println("j = ", " ", j) access_internally() end main() lfortran-lfortran-2f73434/tests/reference/ast_f90-forall1-88e2780.stderr0000664000175000017500000000057615141516316025716 0ustar alastairalastairstyle suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:9:33 | 9 | forall (i=1:n, j=1:m, A(i,j).NE.0) & | ^^^^ help: write this as '/=' style suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:36:34 | 36 | inner: forall (j=1:100, i.NE.j) | ^^^^ help: write this as '/=' lfortran-lfortran-2f73434/tests/reference/llvm-legacy_array_sections_01-2515c0f.json0000664000175000017500000000102515141516316030430 0ustar alastairalastair{ "basename": "llvm-legacy_array_sections_01-2515c0f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/legacy_array_sections_01.f90", "infile_hash": "90cec79afc88ad4e171e9ff3c6f8612e820b4906e444054346abdf34", "outfile": null, "outfile_hash": null, "stdout": "llvm-legacy_array_sections_01-2515c0f.stdout", "stdout_hash": "f7a801cca450fa6f6628b190d20475170692255f5a4bb9848c214d3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-scopes1-502009a.stdout0000664000175000017500000001276515141516316025250 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { scopes1: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 2 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) scopes1 [] [(Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 f () [((Var 2 i))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface2-5630d9d.stdout0000664000175000017500000002427715141516316027706 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface2: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { f_arg_0: (Variable 3 f_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 3 f_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f_arg_0)] [] (Var 3 f_return_var_name) Public .false. .false. () ), g: (Function (SymbolTable 4 { g_arg_0: (Variable 4 g_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), g_arg_1: (Variable 4 g_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), g_return_var_name: (Variable 4 g_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [(Integer 4) (Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 g_arg_0) (Var 4 g_arg_1)] [] (Var 4 g_return_var_name) Public .false. .false. () ) }) implicit_interface2 [] [(Print (StringFormat () [(FunctionCall 2 f () [((IntegerConstant 5 (Integer 4) Decimal))] (Real 8) () () ) (FunctionCall 2 g () [((IntegerConstant 1 (Integer 4) Decimal)) ((RealConstant 3.000000 (Real 4) ))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-template_03b-6812e13.stdout0000664000175000017500000005147415141516316026165 0ustar alastairalastair(TranslationUnit [(Program template_03 (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [] [] [(Requirement op [T U V op] [(DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType U [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType V [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function op [(a) (b)] [(SimpleAttribute AttrElemental )] op () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () U None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () V None ) [] [(op [] [] () () None ())] () )] [] [] [] )] ) (Template axpy_tmpl [T U V W plus times] [(Declaration () [(SimpleAttribute AttrPublic )] [(axpy [] [] () () None ())] () ) (Require [(UnitRequire op [(AttrNamelist V ) (AttrNamelist W ) (AttrNamelist V ) (AttrNamelist plus )] )] ) (Require [(UnitRequire op [(AttrNamelist T ) (AttrNamelist U ) (AttrNamelist W ) (AttrNamelist times )] )] )] [(Subroutine axpy [(a) (x) (y)] [] () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () U None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] () V None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () )] [(Assignment 0 y (FuncCallOrArray plus [] [(() y () 0) (() (FuncCallOrArray times [] [(() a () 0) (() x () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] )] [(SubroutineCall 0 f [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function my_mul [(a) (b)] [(SimpleAttribute AttrElemental )] op () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [] [(op [] [] () () None ())] () )] [(Assignment 0 op (* a b) () )] [] [] ) (Function my_add [(a) (b)] [(SimpleAttribute AttrElemental )] op () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(op [] [] () () None ())] () )] [(Assignment 0 op (+ a b) () )] [] [] ) (Subroutine my_axpy [(a) (x) (y)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () )] [(Assignment 0 y (FuncCallOrArray my_add [] [(() y () 0) (() (FuncCallOrArray my_mul [] [(() a () 0) (() x () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] ) (Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(sp [] [] () (FuncCallOrArray kind [] [(() (Real "1.0") () 0)] [] [] [] ) Equal ()) (dp [] [] () (FuncCallOrArray kind [] [(() (Real "1.d0") () 0)] [] [] [] ) Equal ())] () ) (Instantiate axpy_tmpl [(AttrType TypeReal [(() sp Value)] () () None ) (AttrType TypeInteger [] () () None ) (AttrType TypeReal [(() dp Value)] () () None ) (AttrType TypeReal [(() sp Value)] () () None ) (AttrIntrinsicOperator PLUS ) (AttrIntrinsicOperator STAR )] [] ) (Declaration (AttrType TypeReal [(() sp Value)] () () None ) [] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [(1 3 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(y [(1 3 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 a (Real "0.5") () ) (Assignment 0 x 2 () ) (Assignment 0 y 2 () ) (SubroutineCall 0 axpy [] [(() a () 0) (() x () 0) (() y () 0)] [] [] (TriviaNode [] [(EndOfLine) (Comment "! call my_axpy(a, x, y) ! non-generic does not work too" )] ) )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence3-3737d89.stdout0000664000175000017500000000037415141516316031521 0ustar alastairalastair[{"kind":0,"location":{"range":{"start":{"character":9,"line":6},"end":{"character":13,"line":6}},"uri":"uri"},"name":"main"},{"kind":0,"location":{"range":{"start":{"character":13,"line":8},"end":{"character":17,"line":8}},"uri":"uri"},"name":"main"}]lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_04-524ec3a.json0000664000175000017500000000076115141516316026151 0ustar alastairalastair{ "basename": "asr-intrinsics_04-524ec3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_04.f90", "infile_hash": "1e045fd457f9f94ff18fafe47e159dd705201527893232761f0d06e8", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_04-524ec3a.stdout", "stdout_hash": "ffa7e3578ebd7d9b8bf411a37d2c90901fba26cbe92fcde616040fe8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-coarray_01-5f111e4.json0000664000175000017500000000073215141516316025337 0ustar alastairalastair{ "basename": "asr-coarray_01-5f111e4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/coarray_01.f90", "infile_hash": "29a734e25fedee38f4866f94dd2b329d1fa657ca46f397d6d4918b7a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-coarray_01-5f111e4.stderr", "stderr_hash": "3928170549934918b2f427ac19c1b9652fc5eb82c4ddc4d9de314d39", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-if_04-7f1b69d.json0000664000175000017500000000104515141516316024374 0ustar alastairalastair{ "basename": "ast-if_04-7f1b69d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/if_04.f90", "infile_hash": "dc3029f2df7281746bd116d435ee39913201c693d801c2e53aca3886", "outfile": null, "outfile_hash": null, "stdout": "ast-if_04-7f1b69d.stdout", "stdout_hash": "600a6854a444ffce0dbf60489f9c9f924f43e1d9cb44fa151a35eb10", "stderr": "ast-if_04-7f1b69d.stderr", "stderr_hash": "8b854a8be811f407b5f543a37121d6b73b7265ed8b67dc1c76a42d63", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-assign_01-40d16c6.stderr0000664000175000017500000000035215141516316025514 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/assign_01.f90:5:5 | 5 | x = 1 | ^^^^^ assignment here | 4 | integer, parameter :: x = 2 | ~~~~~ declared as constant lfortran-lfortran-2f73434/tests/reference/asr-allocate_02-3c0d7c8.json0000664000175000017500000000075315141516316025554 0ustar alastairalastair{ "basename": "asr-allocate_02-3c0d7c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_02.f90", "infile_hash": "48b2bafd986dab617432d61a945379fc43a1e14588e41a1de1d2c148", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_02-3c0d7c8.stdout", "stdout_hash": "6bdde0443c42f351feb8f44684fef8220765d7780e34b2ded6e3f02f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array14-c9f6829.stdout0000664000175000017500000000015415141516316025274 0ustar alastairalastair5.00000000 -1.00000000 3.00000000 4.00000000 2.00000000 5.00000000 -1.00000000 3.00000000 lfortran-lfortran-2f73434/tests/reference/asr-expr6-7f62240.json0000664000175000017500000000070415141516316024366 0ustar alastairalastair{ "basename": "asr-expr6-7f62240", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "asr-expr6-7f62240.stdout", "stdout_hash": "9bd204c72324e1f93240bc5cb6fbbc76f8ab14206ccb03c272c41592", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-integer_to_real_cast_in_comparison-a6f3411.stdout0000664000175000017500000000043215141516316033726 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = 8 contains elemental real(8) function dabs(x) result(r) real(8), intent(in) :: x if (x > real(0, kind=8)) then r = x else r = real(0, kind=8) - x end if end function dabs end program expr2 lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_if_01-6989548.json0000664000175000017500000000101615141516316031207 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_if_01-6989548", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_if_01.f90", "infile_hash": "6ba01febd1bb652d6b58e8814b8d9c3b50c046aaf52e9408ad8460d8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_if_01-6989548.stderr", "stderr_hash": "a040d9cf52405419b555ef9d5260111307594adc4e5da23e24993d6b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_02-6e04a0b.json0000664000175000017500000000076415141516316026300 0ustar alastairalastair{ "basename": "asr-select_type_02-6e04a0b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_02.f90", "infile_hash": "67a97c746280c55753fa1c0adfc9813a240d797752915300d102f79e", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_02-6e04a0b.stdout", "stdout_hash": "8be67de36096226ed73509f5b0b4a0a911c9c48a4480342fe3214b68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_01-2ba20d5.stdout0000664000175000017500000000145015141516316027645 0ustar alastairalastairmodule derived_types_01_m_01 implicit none type :: X real :: r integer :: i end type X type :: Y complex :: c type(X) :: d end type Y contains subroutine set(a) type(X), intent(out) :: a a%i = 1 a%r = 1.5 end subroutine set end module derived_types_01_m_01 module derived_types_01_m_02 use derived_types_01_m_01, only: Y implicit none type :: Z complex :: k type(Y) :: l end type Z end module derived_types_01_m_02 program derived_types_01 use derived_types_01_m_02, only: Z use derived_types_01_m_01, only: X, set implicit none type(X) :: b type(Z) :: c b%i = 5 b%r = 3.5 print *, b%i, b%r call set(b) print *, b%i, b%r c%l%d%r = 2.0 c%l%d%i = 2 c%k = (2.0, 2.0) print *, c%l%d%r, c%l%d%i, c%k call set(c%l%d) print *, c%l%d%r, c%l%d%i, c%k end program derived_types_01 lfortran-lfortran-2f73434/tests/reference/asr-select_type_04-e8b402f.json0000664000175000017500000000076415141516316026313 0ustar alastairalastair{ "basename": "asr-select_type_04-e8b402f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_04.f90", "infile_hash": "901a8af19672501e52484cba169d1249539f51e0a8f928a0851445dc", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_04-e8b402f.stdout", "stdout_hash": "e5090155baf9f05b6b60e0f93581488d6ac399aacd5343ed72d5fa01", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-style1-3d16af1.json0000664000175000017500000000112515141516316030267 0ustar alastairalastair{ "basename": "asr_disable_warnings-style1-3d16af1", "cmd": "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_warnings-style1-3d16af1.stdout", "stdout_hash": "a3eb4caf18d259ea43790a9a498e716a8714031f6a17875cae6bcf2b", "stderr": "asr_disable_warnings-style1-3d16af1.stderr", "stderr_hash": "7e4725fb2dcc881cc51b72f969ee1447e25fc88c5da229c04b2ed016", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_08-1848d3c.stdout0000664000175000017500000001020015141516316026216 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_08: (Module (SymbolTable 2 { sub: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub (FunctionType [(Integer 4) (Integer 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [] () Public .false. .false. () ) }) interface_08 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_12-4cdd01e.stderr0000664000175000017500000000043615141516316030236 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'f_integer____0'. Tried to match size 3 of dimension 1 of argument number 3, but expected size is 2 --> tests/errors/array_bounds_check_12.f90:8:5 | 8 | e = f(a) | ^ | 8 | e = f(a) | ~ Expected range 1:2, got 3 lfortran-lfortran-2f73434/tests/reference/asr-implicit_check-32a1dba.stdout0000664000175000017500000000053315141516316027045 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-case_02-e255e0e.json0000664000175000017500000000073015141516316025214 0ustar alastairalastair{ "basename": "julia-case_02-e255e0e", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "julia-case_02-e255e0e.stdout", "stdout_hash": "b2e881f17018dd9a8a90b5a6a42e2df58a22fd7b70b6e85eff85a6f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-nullify1-b3931cb.json0000664000175000017500000000073015141516316025700 0ustar alastairalastair{ "basename": "ast_f90-nullify1-b3931cb", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/nullify1.f90", "infile_hash": "f996667719f3f2215e2bf25d7fe502ab13f032f4d8b29b0a3f1329d1", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-nullify1-b3931cb.stdout", "stdout_hash": "a87cb1b05a7d04e6a08460e5e2c0abc36d3edd72ff3a2ccc357b74ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program4-c375e95.json0000664000175000017500000000071515141516316025153 0ustar alastairalastair{ "basename": "ast-program4-c375e95", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "ast-program4-c375e95.stdout", "stdout_hash": "6c5ae1776ad2be9c144a535ac45425320485db2f751a1001565917bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit1-5bea864.stdout0000664000175000017500000000145315141516316030140 0ustar alastairalastair(TranslationUnit [(Program main () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 1 () ) (If 0 () (<= a 1) [(Print 0 () [(String "h" ())] () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules2-98d8120.json0000664000175000017500000000071515141516316025063 0ustar alastairalastair{ "basename": "asr-modules2-98d8120", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules2.f90", "infile_hash": "3f2cf619d97820f4371479e1b19d3aaeddb359d806107c1761fb7cfb", "outfile": null, "outfile_hash": null, "stdout": "asr-modules2-98d8120.stdout", "stdout_hash": "f561b6a7e31267d33e5d57648bef9fd12707c317d74ead7c9b0905ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_53-2d03c61.stdout0000664000175000017500000000021315141516316025554 0ustar alastairalastair"efghijkl " "efghijkl " "efghijkl " "abcdefghijkl" "defg" "efghijkl " "abcdefghijkl" "defg" "efghijkl" "defg" All tests passed lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr3-c9c0bd7.json0000664000175000017500000000076415141516316027545 0ustar alastairalastair{ "basename": "pass_global_stmts-expr3-c9c0bd7", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr3-c9c0bd7.stdout", "stdout_hash": "2c51e7b19933ad1125d486e557320e7ab6a1547f0a65002d684f1702", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-stop1-ed69fc4.json0000664000175000017500000000070415141516316024624 0ustar alastairalastair{ "basename": "ast-stop1-ed69fc4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/stop1.f90", "infile_hash": "356601f3f1d56abfa1b7d00130c2067cbf3d450b3c563a900ff9ccd5", "outfile": null, "outfile_hash": null, "stdout": "ast-stop1-ed69fc4.stdout", "stdout_hash": "c9efbabbd41a9f8f11ef5351f3f345709ead7f57b2a37d6128aacf65", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arithmetic_if1-f119c2a.stderr0000664000175000017500000000022715141516316026700 0ustar alastairalastairsemantic error: Arithmetic if (x) requires an integer or real for `x` --> tests/errors/arithmetic_if1.f90:5:5 | 5 | if ("yy") 1, 2, 3 | ^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-classes1-d55a38c.stdout0000664000175000017500000001510715141516316025743 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %base_class = type <{ i32 (...)**, %base* }> %base = type { i32 } %string_descriptor = type <{ i8*, i64 }> @_Name_base = private unnamed_addr constant [5 x i8] c"base\00", align 1 @_Type_Info_base = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_Name_base, i32 0, i32 0) }, align 8 @_VTable_base = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_base to i8*), i8* bitcast (void (i8*, i8*)* @_copy_xx_base to i8*), i8* bitcast (void (i8**)* @_allocate_struct_xx_base to i8*), i8* bitcast (void (%base_class*)* @__module_xx_show_x to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_xx_show_x(%base_class* %this) { .entry: %0 = getelementptr %base_class, %base_class* %this, i32 0, i32 1 %1 = load %base*, %base** %0, align 8 %2 = getelementptr %base, %base* %1, i32 0, i32 0 store i32 12, i32* %2, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_show_x FINALIZE_SYMTABLE_show_x: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %b = alloca %base, align 8 %2 = getelementptr %base, %base* %b, i32 0, i32 0 %3 = getelementptr %base, %base* %b, i32 0, i32 0 store i32 10, i32* %3, align 4 %4 = alloca %base_class, align 8 %5 = getelementptr %base_class, %base_class* %4, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_base, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %base_class, %base_class* %4, i32 0, i32 1 store %base* %b, %base** %6, align 8 call void @__module_xx_show_x(%base_class* %4) %7 = alloca i64, align 8 %8 = getelementptr %base, %base* %b, i32 0, i32 0 %9 = load i32, i32* %8, align 4 %10 = alloca i32, align 4 store i32 %9, i32* %10, align 4 %11 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %7, i32 0, i32 0, i32* %10) %12 = load i64, i64* %7, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 4 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry %21 = getelementptr %base, %base* %b, i32 0, i32 0 %22 = load i32, i32* %21, align 4 %23 = icmp ne i32 %22, 12 br i1 %23, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) define linkonce_odr void @_copy_xx_base(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %base* %3 = bitcast i8* %1 to %base* %4 = getelementptr %base, %base* %2, i32 0, i32 0 %5 = load i32, i32* %4, align 4 %6 = getelementptr %base, %base* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store i32 %5, i32* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_xx_base(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %base_class* %4 = bitcast %base_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_base, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %base_class, %base_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %base* store %base* %7, %base** %5, align 8 %8 = getelementptr %base, %base* %7, i32 0, i32 0 ret void } declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/ast-expr4-2704d50.json0000664000175000017500000000070415141516316024361 0ustar alastairalastair{ "basename": "ast-expr4-2704d50", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "ast-expr4-2704d50.stdout", "stdout_hash": "c8fbb30ee5363d9bffb89512e41746ad1608c82d2fc923afcaf7c83a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_01-81f01a2.json0000664000175000017500000000073615141516316025517 0ustar alastairalastair{ "basename": "julia-arrays_01-81f01a2", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_01-81f01a2.stdout", "stdout_hash": "bc2771e2dedd62f7531756913234c46ef6e75d6392e397abdb3df43f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor19-6d76e11.stdout0000664000175000017500000000055715141516316031131 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor19: (Program (SymbolTable 2 { }) preprocessor19 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_02-f2b519f.stderr0000664000175000017500000000022615141516316025436 0ustar alastairalastairsemantic error: Empty array constructor is not allowed --> tests/errors/array_02.f90:4:12 | 4 | print *, [[[], [[]]], [[]], []] | ^^ lfortran-lfortran-2f73434/tests/reference/asr-implicit9-b56b139.stderr0000664000175000017500000000176015141516316025643 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit9.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit9.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit9.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit9.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit9.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit9.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr-modules_06-821cc56.json0000664000175000017500000000072315141516316025361 0ustar alastairalastair{ "basename": "asr-modules_06-821cc56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_06.f90", "infile_hash": "7699c2084686f687c1681ea9d088f613f3530b48449a37df5fc1cdce", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-821cc56.stdout", "stdout_hash": "660570cce140af66fe988a84cd4d5000321d08d4ba3504216a61d585", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor13-d951787.json0000664000175000017500000000077315141516316030505 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor13-d951787", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor13.f90", "infile_hash": "a846ad5320eb7082135106ba078c94cc21b41c4365d735839474f3ed", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor13-d951787.stdout", "stdout_hash": "a9bd047597c370cc1016aa2932f3ca2bae71c65f2d13b8d593f360bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do3-54790e3.json0000664000175000017500000000067615141516316024027 0ustar alastairalastair{ "basename": "ast-do3-54790e3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do3.f90", "infile_hash": "d72fb0f1c786740923a8ad6646a4d581704710df3ddfd528b2c96564", "outfile": null, "outfile_hash": null, "stdout": "ast-do3-54790e3.stdout", "stdout_hash": "8fe38ca61c9279e373f238d0655a66f1d8cbee71be27a53d10a8cde5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-entry1-3075e81.json0000664000175000017500000000075615141516316024555 0ustar alastairalastair{ "basename": "asr-entry1-3075e81", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "asr-entry1-3075e81.stdout", "stdout_hash": "a6af926b082bde6f7a398433bbe3abf465ef540f1131a3ee919addec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-if_05-865c1b8.json0000664000175000017500000000071415141516316024321 0ustar alastairalastair{ "basename": "wat-if_05-865c1b8", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/if_05.f90", "infile_hash": "e17354307d88b9239319cbfd5ce6b117fd24e4aa2998deee3d8fe695", "outfile": null, "outfile_hash": null, "stdout": "wat-if_05-865c1b8.stdout", "stdout_hash": "5a6e95799d5aae339443d63295d7be6721472c9cdfaef1be882b86d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sign_from_value-b974070.stdout0000664000175000017500000011117615141516316027062 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), arr: (Variable 2 arr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (IntegerConstant -3 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), epsidp: (Variable 2 epsidp [] Local (Cast (IntegerConstant 16 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 16 (Integer 8) Decimal) ) (IntegerConstant 16 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), epsisp: (Variable 2 epsisp [] Local (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), epsrdp: (Variable 2 epsrdp [] Local (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), epsrsp: (Variable 2 epsrsp [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ixdp: (Variable 2 ixdp [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) ) (IntegerConstant 5 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), ixsp: (Variable 2 ixsp [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rxdp: (Variable 2 rxdp [] Local (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (RealConstant 5.500000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), rxsp: (Variable 2 rxsp [] Local (RealConstant 5.500000 (Real 4) ) (RealConstant 5.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (Cast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -2.000000 (Real 4) ) ) (RealConstant -2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) ) (RealConstant -3.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign [] [(Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 epsrsp)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (Var 2 epsrsp) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Add (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (Var 2 epsrdp)] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Sub (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixsp) (IntegerBinOp (Var 2 ixsp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 epsisp)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixsp) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (RealUnaryMinus (Var 2 epsrdp) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Add (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixdp) (IntegerBinOp (Var 2 ixdp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 8) Decimal) (Var 2 epsidp)] 0 (Integer 8) () ) (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixdp) NotEq (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 c) (IntegerBinOp (Var 2 a) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 b)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 c) NotEq (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 arr) (ArrayConstant 20 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00, 5.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ArrayItem (Var 2 arr) [(() (IntrinsicElementalFunction Int [(RealBinOp (Var 2 x) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 y)] 0 (Real 4) () ) (Real 4) () )] 0 (Integer 4) () ) ())] (Real 4) ColMajor () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 2 z) NotEq (ArrayItem (Var 2 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_op_simplifier_test-ba92920.json0000664000175000017500000000077515141516316030506 0ustar alastairalastair{ "basename": "asr-array_op_simplifier_test-ba92920", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array_op_simplifier_test.f90", "infile_hash": "c0b02cecb6f724cd809c6ed591f08c805e9d87dc0635842a5eca99be", "outfile": null, "outfile_hash": null, "stdout": "asr-array_op_simplifier_test-ba92920.stdout", "stdout_hash": "e01a7907227e9d12ed3a7f1c4cdf2716b7127fde0221f3f716f0e25f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_31-cd9bfef.json0000664000175000017500000000075015141516316025666 0ustar alastairalastair{ "basename": "asr-modules_31-cd9bfef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_31.f90", "infile_hash": "871002e4224f4001cd7df45deab32b4ac08b22d4f6358d4965afddfe", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_31-cd9bfef.stdout", "stdout_hash": "8df6ed9e93183836b94e6fe10db541ed2f774c43b08fcef1df4176f5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_07-71c3c47.json0000664000175000017500000000075015141516316025361 0ustar alastairalastair{ "basename": "asr-complex_07-71c3c47", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_07.f90", "infile_hash": "fb49a785b3424190cd1c321680f4566fa5dc0ea30569ab7624004d2f", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_07-71c3c47.stdout", "stdout_hash": "be762e7f5b90f81210ee7dee9a97058822c9591c190a1d4e9cd876b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-callback_01-facbb46.stdout0000664000175000017500000001002715141516316026410 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_callback_01_cb(float (float*)* %f, float* %a, float* %b) { .entry: %cb = alloca float, align 4 %0 = load float, float* %b, align 4 %1 = load float, float* %a, align 4 %2 = fsub float %0, %1 %3 = call float %f(float* %a) %4 = fadd float %2, %3 %5 = call float %f(float* %b) %6 = fadd float %4, %5 store float %6, float* %cb, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return %7 = load float, float* %cb, align 4 ret float %7 } declare float @f(float*) define void @__module_callback_01_foo(float* %c, float* %d) { .entry: %0 = alloca i64, align 8 %1 = call float @__module_callback_01_cb(float (float*)* @foo.__module_callback_01_f, float* %c, float* %d) %2 = alloca float, align 4 store float %1, float* %2, align 4 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, float* %2) %4 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return ret void } define float @foo.__module_callback_01_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_01_foo(float* %call_arg_value, float* %call_arg_value1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-associate1-6e54e23.json0000664000175000017500000000073615141516316026126 0ustar alastairalastair{ "basename": "ast_f90-associate1-6e54e23", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/associate1.f90", "infile_hash": "1f90b3ef799fb354098ee524279bb2b71bf3813b43f2269fb014ec0d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-associate1-6e54e23.stdout", "stdout_hash": "3010424cbebfcb66eb3ba928c4072d2c8b2e4cdeb594252569fd102a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-open_invalid_kwarg1-6af4cc2.stderr0000664000175000017500000000027515141516316030020 0ustar alastairalastairsemantic error: Invalid argument `hello` supplied --> tests/errors/open_invalid_kwarg1.f90:4:5 | 4 | OPEN(file="numbers", hello="world") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-interface_10-e9eb6ea.stdout0000664000175000017500000002206415141516316026444 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_10: (Program (SymbolTable 4 { chars: (ExternalSymbol 4 chars 2 chars interface_10_m [] chars Public ), chars@identity: (ExternalSymbol 4 chars@identity 2 identity interface_10_m [] identity Private ), identity: (ExternalSymbol 4 identity 2 identity interface_10_m [] identity Public ), x: (Variable 4 x [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) interface_10 [interface_10_m] [(Assignment (Var 4 x) (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] () .false. ) (Print (Var 4 x) )] ), interface_10_m: (Module (SymbolTable 2 { chars: (GenericProcedure 2 chars [2 identity] Public ), identity: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Out () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) identity (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 y) (Var 3 x) () .false. .false. )] () Public .false. .false. () ) }) interface_10_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_01-bab3e60.stdout0000664000175000017500000000013215141516316026026 0ustar alastairalastairprogram goto_01 implicit none integer :: a a = 5 go to 1 1 print *, a end program goto_01 lfortran-lfortran-2f73434/tests/reference/ast-assign_to2-d8aade7.stdout0000664000175000017500000000124415141516316026250 0ustar alastairalastair(TranslationUnit [(Program assign2 () [] [] [] [(If 100 () (< 0 1) [(Assign 0 101 k () )] [] () () () ) (GoTo 0 k () [100 101] () ) (Print 0 () [(String "no" ())] () ) (Print 101 () [(String "yes" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_mul_test-5a74811.json0000664000175000017500000000077515141516316027102 0ustar alastairalastair{ "basename": "llvm-complex_mul_test-5a74811", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_mul_test.f90", "infile_hash": "908ba75c567d6ff4ba0e42cba3e974999d00e5d24710f4649ac212d6", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_mul_test-5a74811.stdout", "stdout_hash": "c9d604b2d28347fae93b8e1a6a19139d3abf802808dd32b31156d011", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit10-f531a25.stderr0000664000175000017500000000071715141516316025707 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit10.f90:6:1 | 6 | real*8 :: g, h, i | ^^^^^^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit10.f90:8:1 | 8 | complex*8 :: l, m | ^^^^^^^^^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit10.f90:9:1 | 9 | complex *16 :: n | ^^^^^^^^^^^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr-logical1-fd6d5c4.stdout0000664000175000017500000000605715141516316025622 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) logical1 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 a) (Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_openmp-pragma1-f8a3fde.stdout0000664000175000017500000001433515141516316027116 0ustar alastairalastair(TranslationUnit [(Subroutine a1 [(n) (A) (B)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(A [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(B [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Pragma 0 OMPPragma .false. "parallel do" [] () ) (DoLoop 0 () 0 i 2 N () [(Assignment 0 (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) (/ (+ (FuncCallOrArray A [] [(() i () 0)] [] [] [] ) (FuncCallOrArray A [] [(() (- i 1) () 0)] [] [] [] )) 2) () )] () () ) (Pragma 0 OMPPragma .true. "parallel do" [] () )] [] [] ) (Subroutine parallel_sum [(n) (a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(partial_sum [] [] () () None ()) (total_sum [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 partial_sum 0 () ) (Assignment 0 total_sum 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Pragma 0 OMPPragma .false. "parallel" [(String "private(partial_sum)" ()) (String "shared(total_sum)" ())] () ) (Pragma 0 OMPPragma .false. "do" [] () ) (DoLoop 0 () 0 i 1 n () [(Assignment 0 partial_sum (+ partial_sum (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Pragma 0 OMPPragma .true. "do" [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! TODO:" ) (Comment "! !$omp critical" ) (Comment "! total_sum = total_sum + partial_sum" ) (Comment "! !$omp end critical" )] ) ) (Pragma 0 OMPPragma .true. "parallel" [] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface3-7ef92cc.stdout0000664000175000017500000002510515141516316031240 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ssyr2: (Function (SymbolTable 2 { info: (Variable 2 info [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), lsame: (Function (SymbolTable 5 { lsame_arg_0: (Variable 5 lsame_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. ), lsame_arg_1: (Variable 5 lsame_arg_1 [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. ), lsame_return_var_name: (Variable 5 lsame_return_var_name [] ReturnVar () () Default (Logical 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) lsame (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (Logical 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 lsame_arg_0) (Var 5 lsame_arg_1)] [] (Var 5 lsame_return_var_name) Public .false. .false. () ), uplo: (Variable 2 uplo [] Unspecified () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) ssyr2 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 uplo)] [(Assignment (Var 2 info) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (If () (LogicalBinOp (LogicalNot (FunctionCall 2 lsame () [((Var 2 uplo)) ((StringConstant "U" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Logical 4) () () ) (Logical 4) () ) And (LogicalNot (FunctionCall 2 lsame () [((Var 2 uplo)) ((StringConstant "L" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Logical 4) () () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 info) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] [(Assignment (Var 2 info) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/tokens-expr7-bf90751.stdout0000664000175000017500000000026515141516316025543 0ustar alastairalastair(TOKEN "integer" 5_int32) (NEWLINE) (TOKEN "integer" 5_int64) (NEWLINE) (TOKEN "integer" 5_l) (NEWLINE) (TOKEN "integer" 5__l_3) (NEWLINE) (TOKEN "integer" 5__l_3_) (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/ast_json-special_chars_json-219ee5a.json0000664000175000017500000000077515141516316030357 0ustar alastairalastair{ "basename": "ast_json-special_chars_json-219ee5a", "cmd": "lfortran --show-ast --no-indent --json {infile} -o {outfile}", "infile": "tests/special_chars_json.f90", "infile_hash": "f1aaa183ee7d224a4f0e158546c6f3077e139ee963f833a4c37394d5", "outfile": null, "outfile_hash": null, "stdout": "ast_json-special_chars_json-219ee5a.stdout", "stdout_hash": "0dbe25709b76c1d48d417076eca4cdc65f0a05ca07acc2b1ec206b68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-iostat_non_scalar_value-7d45a6f.stderr0000664000175000017500000000026115141516316030716 0ustar alastairalastairsemantic error: `iostat` must be scalar --> tests/errors/iostat_non_scalar_value.f90:7:5 | 7 | read(buffer, *, iostat=ios(1:1)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-format_31-1180df5.json0000664000175000017500000000071515141516316025214 0ustar alastairalastair{ "basename": "run-format_31-1180df5", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_31.f90", "infile_hash": "16cf5f2372e58cc6b16e9f140d536320002acde81156b900a6842ad7", "outfile": null, "outfile_hash": null, "stdout": "run-format_31-1180df5.stdout", "stdout_hash": "469665b03abe83cdba83a7523e4dd7bfee4ff798b543a1d34430a0a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-logical1-ef567ea.json0000664000175000017500000000072515141516316025256 0ustar alastairalastair{ "basename": "wat-logical1-ef567ea", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "wat-logical1-ef567ea.stdout", "stdout_hash": "cd583abecbaf0765bb5bcdafc4ed73f3b5a5b12eff48b3ff164bd75a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-abort_01-7212a3d.stdout0000664000175000017500000000217415141516316025543 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define void @_lcompilers_abort_() { .entry: call void @_lfortran_abort() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_abort_ FINALIZE_SYMTABLE__lcompilers_abort_: ; preds = %return ret void } declare void @_lfortran_abort() define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br i1 false, label %then, label %else then: ; preds = %.entry call void @_lcompilers_abort_() br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_abort1 FINALIZE_SYMTABLE_abort1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-no_prescan_include1-6ceca31.json0000664000175000017500000000075615141516316027461 0ustar alastairalastair{ "basename": "ast-no_prescan_include1-6ceca31", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include1.f90", "infile_hash": "075cc762767052e5ea227f825822032faad3fcaafa60bfbeb742a537", "outfile": null, "outfile_hash": null, "stdout": "ast-no_prescan_include1-6ceca31.stdout", "stdout_hash": "d0341527edca7d037cb312e17f728806edde600e04ff6910c5e792a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop2-a8638e0.stdout0000664000175000017500000000003015141516316027206 0ustar alastairalastairHello Hello Hello lfortran-lfortran-2f73434/tests/reference/ast-selectrank1-5d08637.stdout0000664000175000017500000001310715141516316026120 0ustar alastairalastair(TranslationUnit [(Subroutine process [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [(() () AssumedRank)] [] () () None ())] () )] [(SelectRank 0 () () x [(RankExpr 0 () [(Assignment 0 x 0 () )] ) (RankExpr 2 () [(If 0 () (>= (FuncCallOrArray size [] [(() x () 0) (() 2 () 0)] [] [] [] ) 2) [(Assignment 0 (FuncCallOrArray x [] [(() () 1 0) (() 2 () 0)] [] [] [] ) 2 () )] [] () () () )] ) (RankDefault () [(Print 0 () [(String "i did not expect rank" ()) (FuncCallOrArray rank [] [(() x () 0)] [] [] [] ) (String "shape" ()) (FuncCallOrArray shape [] [(() x () 0)] [] [] [] )] () ) (ErrorStop 0 (String "process bad arg" ()) () () )] )] () () ) (Return 0 () () )] [] [] ) (Subroutine initialize [(arg) (size)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrContiguous )] [(arg [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(size [] [] () () None ()) (i [] [] () () None ())] () )] [(SelectRank 0 () () arg [(RankExpr 0 (TriviaNode [] [(EOLComment "! special case the scalar case" )] ) [(Assignment 0 arg (Real "0.0") () )] ) (RankStar () [(DoLoop 0 () 0 i 1 size () [(Assignment 0 (FuncCallOrArray arg [] [(() i () 0)] [] [] [] ) (Real "0.0") () )] () () )] )] () () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-arrays_09-5096a19.stdout0000664000175000017500000000256315141516316025517 0ustar alastairalastair(TranslationUnit [(Program arrays_09 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 10 Value)] () () None ) [] [(a [(1 1 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) (String "Substring" ()) () ) (If 0 () (/= (FuncCallOrArray a [] [(() 1 () 0)] [] [(4 9 1 0)] [] ) (String "string" ())) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-cmd_02-ba58262.json0000664000175000017500000000073415141516316024450 0ustar alastairalastair{ "basename": "asr-cmd_02-ba58262", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cmd_02.f90", "infile_hash": "fc31fcafc39673c2cf4b192ea1cca649f864901bbc9b910f442cb5f9", "outfile": null, "outfile_hash": null, "stdout": "asr-cmd_02-ba58262.stdout", "stdout_hash": "4a526b057eb956b839c25838379026752c085940ebf1d3d5e2a3cfe6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program1-17e5471.stdout0000664000175000017500000000466615141516316025441 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program1: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) program1 [] [(Assignment (Var 2 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_35-5fba3e7.stdout0000664000175000017500000004632415141516316026104 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2_21: (Module (SymbolTable 2 { get_args_fixed_length_a_array: (Function (SymbolTable 3 { place: (Variable 3 place [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), strings: (Variable 3 strings [] Unspecified () () Default (Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), strings_a: (Variable 3 strings_a [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_args_fixed_length_a_array (FunctionType [(Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 strings)] [(Allocate [((Var 3 strings_a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] (IntegerConstant 5 (Integer 4) Decimal) () ())] () () () ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (StringLen (ArrayItem (Var 3 strings_a) [(() (ArrayBound (Var 3 strings_a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) LtE (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 3 strings) (Var 3 strings_a) () .false. .false. )] [(Assignment (Var 3 strings) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] )] [] ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 3 strings) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] [] )] () Public .false. .false. () ) }) m_cli2_21 () [] .false. .false. .false. ), modules_35: (Program (SymbolTable 4 { get_args_fixed_length_a_array: (ExternalSymbol 4 get_args_fixed_length_a_array 2 get_args_fixed_length_a_array m_cli2_21 [] get_args_fixed_length_a_array Public ), string: (Variable 4 string [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_35 [m_cli2_21] [(Allocate [((Var 4 string) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] () () ())] () () () ) (Print (StringConstant "executing modules_35" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 4 get_args_fixed_length_a_array () [((Var 4 string))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-implicit1-e201262.stderr0000664000175000017500000000157015141516316025542 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit1.f90:13:14 | 13 | implicit real*8 (a-h,o-z) | ^ help: write this as 'real(8)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit1.f90:25:17 | 25 | implicit integer*8 (i,j-l,m,n) | ^ help: write this as 'integer(8)' style suggestion: Use integer(4) instead of integer*4 --> tests/implicit1.f90:27:17 | 27 | IMPLICIT INTEGER*4 (C, D-x) | ^ help: write this as 'integer(4)' style suggestion: Use logical(4) instead of logical*4 --> tests/implicit1.f90:32:17 | 32 | implicit logical*4 (l, u-z) | ^ help: write this as 'logical(4)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit1.f90:38:17 | 38 | implicit complex*8 (z) | ^ help: write this as 'complex(4)' lfortran-lfortran-2f73434/tests/reference/wat-types_15-abe4006.json0000664000175000017500000000072515141516316025133 0ustar alastairalastair{ "basename": "wat-types_15-abe4006", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_15.f90", "infile_hash": "f21a7fe2af97a1bb6a0750efddbb764348cdbf7a6c1c1b3354c96cf0", "outfile": null, "outfile_hash": null, "stdout": "wat-types_15-abe4006.stdout", "stdout_hash": "212f309195060625e637ed1db1c6b4bf9724038db7c3982c246d1a7e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface_03-c3dfda4.json0000664000175000017500000000075615141516316026073 0ustar alastairalastair{ "basename": "ast-interface_03-c3dfda4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_03.f90", "infile_hash": "23a67d0f38f0787a9de82a2324e52305487cfa1700eb928a728547f1", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_03-c3dfda4.stdout", "stdout_hash": "d19fd36deb8655aab26e728403cb6294eb1a20c7b842cc27e0dbec72", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_call2-28c0b82.json0000664000175000017500000000100515141516316026572 0ustar alastairalastair{ "basename": "asr-fixed_form_call2-28c0b82", "cmd": "lfortran --fixed-form --implicit-interface --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_call2.f", "infile_hash": "94899bb360f6a9205dc9fe3c76e28e8c04775b011747845b84950eb3", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_call2-28c0b82.stdout", "stdout_hash": "32d402ab5924f640d0425548951b95448215520730a6b708081d5918", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-array3-ab6fef3.stdout0000664000175000017500000000031615141516316025714 0ustar alastairalastairfunction main() local a::Array{Float32, 1} local b::Array{Float32, 1} a .= [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] b .= [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] end main() lfortran-lfortran-2f73434/tests/reference/asr-modules_30-9f519b4.json0000664000175000017500000000075015141516316025366 0ustar alastairalastair{ "basename": "asr-modules_30-9f519b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_30.f90", "infile_hash": "67f0b94d2f606b63e519e78e67c92749de98b41c7af3df2d959e9df6", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_30-9f519b4.stdout", "stdout_hash": "b7ef1f546f8347e69361b28fae5e2aa731c315bbc87ffed8bd0d1ef4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_02-bc2a3b9.stdout0000664000175000017500000001464015141516316025721 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_02: (Program (SymbolTable 2 { firstname: (Variable 2 firstname [] Local () () Default (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), greetings: (Variable 2 greetings [] Local () () Default (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), surname: (Variable 2 surname [] Local () () Default (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), title: (Variable 2 title [] Local () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_02 [] [(Assignment (Var 2 title) (StringConstant "Mr. " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 firstname) (StringConstant "Rowan " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 surname) (StringConstant "Atkinson" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 greetings) (StringConstant "A big hello from Mr. Bean" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Here is " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 title) (Var 2 firstname) (Var 2 surname)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (Var 2 greetings) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr3-3036522.json0000664000175000017500000000070715141516316024465 0ustar alastairalastair{ "basename": "llvm-expr3-3036522", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr3-3036522.stdout", "stdout_hash": "17240f37530e5204fe380b36343d95f3378c0cd1059d03a7cef8a10f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-types_16-57fa580.stdout0000664000175000017500000002244215141516316025443 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param f32 f32) (result f32))) (type (;3;) (func (param f64) (result f64))) (type (;4;) (func (param) (result f32))) (type (;5;) (func (param) (result f32))) (type (;6;) (func (param) (result f64))) (type (;7;) (func (param f64) (result f64))) (type (;8;) (func (param) (result))) (type (;9;) (func (param i64) (result))) (type (;10;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param f32 f32) (result f32) (local f32) local.get 0 local.get 1 f32.add local.set 2 local.get 2 return ) (func $3 (type 3) (param f64) (result f64) (local f64 f64) call 6 local.set 2 local.get 2 local.get 0 call 7 f64.mul local.set 1 local.get 1 return ) (func $4 (type 4) (param) (result f32) (local f32) f32.const -2.500000 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result f32) (local f32) f32.const 3.140000 local.set 0 local.get 0 return ) (func $6 (type 6) (param) (result f64) (local f64) f64.const 3.140000 local.set 0 local.get 0 return ) (func $7 (type 7) (param f64) (result f64) (local f64) local.get 0 local.get 0 f64.mul local.set 1 local.get 1 return ) (func $8 (type 8) (param) (result) (local i32) i32.const 8 local.set 0 f32.const -2.300000 f32.const 5.600000 call 2 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 5 f64.promote_f32 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 6 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop f64.const 5.000000 call 3 call 10 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $9 (type 9) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $10 (type 10) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 9 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 9 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "add_floats" (func 2)) (export "computecirclearea" (func 3)) (export "get_neg_f32" (func 4)) (export "get_pi" (func 5)) (export "get_pi_64" (func 6)) (export "sqr" (func 7)) (export "_start" (func 8)) (export "print_i64" (func 9)) (export "print_f64" (func 10)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_open_close_read_write-a696eca.json0000664000175000017500000000105215141516316032343 0ustar alastairalastair{ "basename": "asr-intrinsics_open_close_read_write-a696eca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_open_close_read_write.f90", "infile_hash": "8e24a004c0e3b808c25b3f9037daca1bd1f7581b98199f50f3404e2e", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_open_close_read_write-a696eca.stdout", "stdout_hash": "560cb4dbeadd00174e74eb341792b64a2d0d142558fd4e525319bfd2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matmul_01-7b0b0c2.json0000664000175000017500000000074515141516316025253 0ustar alastairalastair{ "basename": "asr-matmul_01-7b0b0c2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matmul_01.f90", "infile_hash": "ec3292a2c15be93d0603a137188615c65b2ac61e21b928e5ac85740b", "outfile": null, "outfile_hash": null, "stdout": "asr-matmul_01-7b0b0c2.stdout", "stdout_hash": "3ec81f0796a1f9461bf31966f700126d6cfe875c66b3cb6a0a9d9ea2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_35-3cec85a.stdout0000664000175000017500000000006515141516316025732 0ustar alastairalastair a b c d e f g h i j k l m n o p q r s t u v w x y z lfortran-lfortran-2f73434/tests/reference/asr-incorrect_number_args_subroutine-126ac8b.json0000664000175000017500000000103415141516316032306 0ustar alastairalastair{ "basename": "asr-incorrect_number_args_subroutine-126ac8b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_number_args_subroutine.f90", "infile_hash": "9f8831c31b6db61388a9bd52b8dbbc41806e77a125bcd3988587b34b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_number_args_subroutine-126ac8b.stderr", "stderr_hash": "8a32ff11fe84eec3e2ceb96907bdfd6f0a07253dee9905138cbdadd9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-recursion_01-95eb32d.stdout0000664000175000017500000001371215141516316026537 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @__module_recursion_01_n = global i32 0 @__module_recursion_01_x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data = private constant [4 x i8] c"x = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_recursion_01_sub1(i32* %x) { .entry: %0 = load i32, i32* %x, align 4 %1 = load i32, i32* @__module_recursion_01_n, align 4 %2 = icmp slt i32 %0, %1 br i1 %2, label %then, label %else then: ; preds = %.entry %3 = load i32, i32* %x, align 4 %4 = add i32 %3, 1 store i32 %4, i32* %x, align 4 %5 = alloca i64, align 8 %6 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %5, i32 0, i32 0, %string_descriptor* @string_const, i32* %x) %7 = load i64, i64* %5, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 4 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %then call void @_lfortran_free(i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %then %16 = load i32, i32* %x, align 4 store i32 %16, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 call void @sub1.__module_recursion_01_sub2() %17 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %17, i32* %x, align 4 call void @__module_recursion_01_sub1(i32* %x) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %free_done br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return ret void } define void @sub1.__module_recursion_01_sub2() { .entry: %0 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %1 = add i32 %0, 1 store i32 %1, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__sub1__x) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @__module_recursion_01_sub1(i32* @__module___lcompilers_created__nested_context__sub1__x) br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_sub2 FINALIZE_SYMTABLE_sub2: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 10, i32* @__module_recursion_01_n, align 4 call void @__module_recursion_01_sub1(i32* @__module_recursion_01_x) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-global_scope5-a66d166.stdout0000664000175000017500000000232515141516316026475 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_30-93f854c.json0000664000175000017500000000076115141516316026107 0ustar alastairalastair{ "basename": "asr-intrinsics_30-93f854c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_30.f90", "infile_hash": "f636055c273f8322c7536fbd9f338d63e85049bfbbe6b2499e78c92b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_30-93f854c.stdout", "stdout_hash": "9543a263ac39fa0fa4c9922761b2a5adde7ec63c71c04ba2f48eacbe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_01-3f7a7b3.json0000664000175000017500000000075015141516316025436 0ustar alastairalastair{ "basename": "ast-program_01-3f7a7b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_01.f90", "infile_hash": "917ed02637c7a6c4e5e5407a0ccf45b4ef6ff79355c5c080e53d97e9", "outfile": null, "outfile_hash": null, "stdout": "ast-program_01-3f7a7b3.stdout", "stdout_hash": "867f83fdbce2c8ce9974d72303acb6479da6661ba4ca19e35819626a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-array3-ab6fef3.json0000664000175000017500000000070015141516316025340 0ustar alastairalastair{ "basename": "julia-array3-ab6fef3", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "julia-array3-ab6fef3.stdout", "stdout_hash": "a68ff46f328c8936947ca83ff6d0bfabfff1d8283334d9c403b6c9e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external1-e4cf9f2.json0000664000175000017500000000072715141516316025462 0ustar alastairalastair{ "basename": "asr-external1-e4cf9f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/external1.f90", "infile_hash": "9a5c10d0c66199b1b204cf09800f3d42e148bbab537f5a633773a951", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-external1-e4cf9f2.stderr", "stderr_hash": "737052a65c4800908a370339dc8f81c9bd214d0f5bd40545ada41b35", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-use1-56851d0.stdout0000664000175000017500000000230015141516316024546 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [(Use [] iso_c_binding [(UseSymbol c_loc () ) (UseSymbol c_f_pointer () )] .true. () )] [] [] [] [(Print 0 () [(String "OK" ())] () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () () [(Use [] iso_c_binding [(UseSymbol c_loc () ) (UseSymbol c_f_pointer () )] .true. () )] [] [] [] [(Print 0 () [(String "OK" ())] () ) (Assignment 0 g 5 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_05-f639a33.json0000664000175000017500000000073615141516316025537 0ustar alastairalastair{ "basename": "julia-arrays_05-f639a33", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_05.f90", "infile_hash": "09eac1191b2e8a76fafedf1307b2d1240ffbc5f632c08afa847df805", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_05-f639a33.stdout", "stdout_hash": "c610b43606aff8e273a85df76f3bb842651b5613e1fa718c57ee8ce6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-goto_04-ac607ff.stdout0000664000175000017500000000210615141516316025705 0ustar alastairalastairfunction main() local a::Int32 local n::Int32 n = 2 a = 10 if n - 1 == 1 @goto label_1 elseif n - 1 == 2 @goto label_2 elseif n - 1 == 3 @goto label_3 end a = a + 5 @label label_1 a = a + 10 @label label_2 a = a + 20 @label label_3 a = a + 30 if a ≠ 70 println(Base.stderr, "ERROR STOP") exit(1) end if n + 1 == 1 @goto label_4 elseif n + 1 == 2 @goto label_5 elseif n + 1 == 3 @goto label_6 end a = a + 5 @label label_4 a = a + 40 @label label_5 a = a + 50 @label label_6 a = a + 60 if a ≠ 130 println(Base.stderr, "ERROR STOP") exit(1) end if n * n == 1 @goto label_7 elseif n * n == 2 @goto label_8 elseif n * n == 3 @goto label_9 end a = a + 5 @label label_7 a = a + 70 @label label_8 a = a + 80 @label label_9 a = a + 90 if a ≠ 375 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout0000664000175000017500000000526315141516316031365 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (Var 1 x) () .false. .false. )] (Var 2 f1) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_06-58f9b18.json0000664000175000017500000000074215141516316025071 0ustar alastairalastair{ "basename": "asr-types_06-58f9b18", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_06.f90", "infile_hash": "821a3f29390ed022c7e72bdf2e4f9bace059d335abe1d1b729ac6d22", "outfile": null, "outfile_hash": null, "stdout": "asr-types_06-58f9b18.stdout", "stdout_hash": "c3f28aca85cef8f09de9d40fd949b0825703df4fd3d6498b7c4d1b66", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-program4-1796cb6.json0000664000175000017500000000101715141516316025137 0ustar alastairalastair{ "basename": "cpp-program4-1796cb6", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "cpp-program4-1796cb6.stdout", "stdout_hash": "c3ba4a8ff33090c0ec2d1b3cea398b2206468ae7ac724191ce735d81", "stderr": "cpp-program4-1796cb6.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_04-9570e2b.json0000664000175000017500000000075615141516316025657 0ustar alastairalastair{ "basename": "asr-interface_04-9570e2b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_04.f90", "infile_hash": "14368b65a65dffde9d8d8ed4bc45203d43a32e68739474d9f18fff8b", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_04-9570e2b.stdout", "stdout_hash": "9ad8b032d4d514581f6c6803e3323ec4d219a8fc6115f31ca0a7a8de", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-write5-2f63ce9.json0000664000175000017500000000065715141516316024736 0ustar alastairalastair{ "basename": "run-write5-2f63ce9", "cmd": "lfortran --no-color {infile}", "infile": "tests/write5.f90", "infile_hash": "5d5d604b32e128f6ff9c94fd138118f49b7df62bfb1350c28972bdf2", "outfile": null, "outfile_hash": null, "stdout": "run-write5-2f63ce9.stdout", "stdout_hash": "ca0d6046f91eef06f8c845b58b40e825a613312a36eb695abd033a34", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_12-43152e4.stdout0000664000175000017500000000037415141516316025504 0ustar alastairalastairtesting output using formatting 1 0.1230E+001 7.00 8.00 Hel T 12345678901234567890123456789012345678901234567890 1 2 3 4 5 1 0.1230E+001 7.00 8.00 Hel T end output formatting test lfortran-lfortran-2f73434/tests/reference/ast_f90-doloop_04-c0ab107.stdout0000664000175000017500000000135615141516316026301 0ustar alastairalastairprogram doloop_04 implicit none integer :: i, j, k j = 0 k = 2 do i = 1, 10, k j = j + i end do if (j /= 25) then error stop end if print *, j j = 0 k = -2 do i = 10, 1, k j = j + i end do if (j /= 30) then error stop end if print *, j j = 0 a: do i = 1, 10 j = j + i if (i == 2) then exit a end if end do a if (j /= 3) then error stop end if j = 0 b: do i = 1, 10, 2 j = j + i if (i == 3) then exit b end if end do b if (j /= 4) then error stop end if j = 0 i = 1 c: do j = j + i if (i == 2) then exit c end if i = i + 1 end do c if (j /= 3) then error stop end if !test-issue 746 k = 2 do i = 1, 10, k 100 continue end do end program doloop_04 lfortran-lfortran-2f73434/tests/reference/asr-modules4-22712cd.json0000664000175000017500000000071515141516316025132 0ustar alastairalastair{ "basename": "asr-modules4-22712cd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules4.f90", "infile_hash": "c257e4129464d80726be06e42e231c7266fb7675d48f7926c60c5199", "outfile": null, "outfile_hash": null, "stdout": "asr-modules4-22712cd.stdout", "stdout_hash": "2108b5d9fc7ab727736d0c02d3bfc3ac0e38a71f69813088f3b5ad55", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-allocate_01-ce7628b.stdout0000664000175000017500000000505315141516316026131 0ustar alastairalastair(TranslationUnit [(Program hello () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [(SimpleAttribute AttrAllocatable )] [(cmd [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(cmdlen [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(ierr [] [] () () None ())] () )] [(SubroutineCall 0 get_command [] [] [(length cmdlen)] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> cmdlen 0) [(Allocate 0 [((FuncCallOrArray character [] [(() cmdlen () 0)] [] [] [] ) () cmd 0)] [] () ) (SubroutineCall 0 get_command [] [(() cmd () 0)] [] [] () ) (Print 0 () [(String "hello " ()) cmd] () )] [] () () () ) (Deallocate 0 [(() cmd () 0)] [(stat ierr)] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-enum_decl_without_start_program-9ae6425.json0000664000175000017500000000103115141516316032065 0ustar alastairalastair{ "basename": "ast-enum_decl_without_start_program-9ae6425", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/enum_decl_without_start_program.f90", "infile_hash": "909085f2f597ac1a26957705cc3df72bd7773cebc9abb83269f1fea3", "outfile": null, "outfile_hash": null, "stdout": "ast-enum_decl_without_start_program-9ae6425.stdout", "stdout_hash": "ace71891d74fa8904e1c67e993d35d3b1e3a20bde48971021a537e3c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsic_implicit-b5b124f.json0000664000175000017500000000102215141516316027343 0ustar alastairalastair{ "basename": "asr-intrinsic_implicit-b5b124f", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/intrinsic_implicit.f90", "infile_hash": "ed6e88f0a941ebc8981bfc8f0218c8633c52270b3d5c8f94028eb980", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsic_implicit-b5b124f.stdout", "stdout_hash": "a4699a44c76a81fc0b11145ea93120e8bd5c107c98e5859d6d12d823", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sqrt_neg-5a20839.stderr0000664000175000017500000000023415141516316025475 0ustar alastairalastairsemantic error: Argument of `sqrt` has a negative argument --> tests/errors/sqrt_neg.f90:2:14 | 2 | print *, sqrt(-1.0) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-string_03-7320626.json0000664000175000017500000000074515141516316025056 0ustar alastairalastair{ "basename": "asr-string_03-7320626", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "asr-string_03-7320626.stdout", "stdout_hash": "aaec575f53a7f590e43f85519abe056a90f96d0f43b23f050a9f452b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-complex2-092502c.json0000664000175000017500000000072015141516316025230 0ustar alastairalastair{ "basename": "llvm-complex2-092502c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/complex2.f90", "infile_hash": "420a31c745b1be940871a88d76cfdc7432de5cbf6fe9f2e8bc87bf39", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex2-092502c.stdout", "stdout_hash": "b12cb88080f783ad78b1b4a658e9a0176643a8207d448beb03cd1b79", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07b-d39ea05.json0000664000175000017500000000111315141516316027151 0ustar alastairalastair{ "basename": "asr-template_error_07b-d39ea05", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07b.f90", "infile_hash": "fa616373619b81bb4f044d4f5c0a101bdf1a0a82dc4d06ec0c2cebf2", "outfile": null, "outfile_hash": null, "stdout": "asr-template_error_07b-d39ea05.stdout", "stdout_hash": "5315399175a049b2514d33fe1dbc3e638dbe37b65bc1404c3152f479", "stderr": "asr-template_error_07b-d39ea05.stderr", "stderr_hash": "b8948ddaa9675681c2db81e4683695ca01ef9f125c42cb0d2b1ae128", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_07-d5a6b4c.stdout0000664000175000017500000000017015141516316025711 0ustar alastairalastairfunction main() local x::Float32 = 3.29999995231628418e+00 + 6.00000000000000000e+00 println(x) end main() ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.stdoutlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000036621615141516316035023 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_45: (Program (SymbolTable 7 { compiler_name: (Variable 7 compiler_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flag: (ExternalSymbol 7 file_scope_flag 2 file_scope_flag modules_45_fpm_manifest_profile [] file_scope_flag Public ), get_flags: (ExternalSymbol 7 get_flags 2 get_flags modules_45_fpm_manifest_profile [] get_flags Public ), new_profile: (ExternalSymbol 7 new_profile 2 new_profile modules_45_fpm_manifest_profile [] new_profile Public ), os_type: (Variable 7 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), os_valid: (Variable 7 os_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_config_t: (ExternalSymbol 7 profile_config_t 2 profile_config_t modules_45_fpm_manifest_profile [] profile_config_t Public ), profile_name: (Variable 7 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), profiles: (Variable 7 profiles [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profindex: (Variable 7 profindex [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_45 [modules_45_fpm_manifest_profile] [(Allocate [((Var 7 profile_name) [] (IntegerConstant 40 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 7 compiler_name) [] (IntegerConstant 40 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 7 profiles) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 7 get_flags () [((Var 7 profile_name)) ((Var 7 compiler_name)) ((Var 7 os_type)) ((Var 7 profiles)) ((Var 7 profindex)) ((Var 7 os_valid))] () .false. )] ), modules_45_fpm_manifest_profile: (Module (SymbolTable 2 { file_scope_flag: (Struct (SymbolTable 3 { }) file_scope_flag (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), get_flags: (Function (SymbolTable 6 { __libasr_created_dummy_variable_: (Variable 6 __libasr_created_dummy_variable_ [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_1: (Variable 6 __libasr_created_dummy_variable_1 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_2: (Variable 6 __libasr_created_dummy_variable_2 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_3: (Variable 6 __libasr_created_dummy_variable_3 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_4: (Variable 6 __libasr_created_dummy_variable_4 [] Local () () Default (Array (StructType [] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_: (Variable 6 __libasr_created_variable_ [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_: (Variable 6 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_1: (Variable 6 __libasr_created_variable_pointer_1 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_2: (Variable 6 __libasr_created_variable_pointer_2 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_3: (Variable 6 __libasr_created_variable_pointer_3 [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_4: (Variable 6 __libasr_created_variable_pointer_4 [] Local () () Default (Pointer (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), c_flags: (Variable 6 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), compiler_name: (Variable 6 compiler_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 6 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), err_message: (Variable 6 err_message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_flags: (Variable 6 file_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_name: (Variable 6 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 6 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), flags: (Variable 6 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), ifile: (Variable 6 ifile [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ikey: (Variable 6 ikey [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), is_valid: (Variable 6 is_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), key_name: (Variable 6 key_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 6 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), os_type: (Variable 6 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), os_valid: (Variable 6 os_valid [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 6 profile_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), profiles: (Variable 6 profiles [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profindex: (Variable 6 profindex [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 6 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_flags (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [new_profile] [(Var 6 profile_name) (Var 6 compiler_name) (Var 6 os_type) (Var 6 profiles) (Var 6 profindex) (Var 6 os_valid)] [(If () (IntrinsicImpureFunction Allocated [(Var 6 flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_) (Var 6 flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_) (Var 6 __libasr_created_dummy_variable_) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 c_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_1) (Var 6 c_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_1) (Var 6 __libasr_created_dummy_variable_1) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 cxx_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_2) (Var 6 cxx_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_2) (Var 6 __libasr_created_dummy_variable_2) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 link_time_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_3) (Var 6 link_time_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_3) (Var 6 __libasr_created_dummy_variable_3) )] ) (If () (IntrinsicImpureFunction Allocated [(Var 6 file_scope_flags)] 0 (Logical 4) () ) [(Associate (Var 6 __libasr_created_variable_pointer_4) (Var 6 file_scope_flags) )] [(Associate (Var 6 __libasr_created_variable_pointer_4) (Var 6 __libasr_created_dummy_variable_4) )] ) (Assignment (ArrayItem (Var 6 profiles) [(() (Var 6 profindex) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) (FunctionCall 2 new_profile () [((Var 6 profile_name)) ((Var 6 compiler_name)) ((Var 6 os_type)) ((Var 6 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_1)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 c_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_2)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 cxx_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_3)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 link_time_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_pointer_4)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 6 file_scope_flags)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () )) ((Var 6 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. ) (Assignment (Var 6 profindex) (IntegerBinOp (Var 6 profindex) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), new_profile: (Function (SymbolTable 5 { __libasr_is_present_c_flags: (Variable 5 __libasr_is_present_c_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_cxx_flags: (Variable 5 __libasr_is_present_cxx_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_file_scope_flags: (Variable 5 __libasr_is_present_file_scope_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_flags: (Variable 5 __libasr_is_present_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_is_built_in: (Variable 5 __libasr_is_present_is_built_in [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_link_time_flags: (Variable 5 __libasr_is_present_link_time_flags [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), c_flags: (Variable 5 c_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), compiler: (Variable 5 compiler [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 5 cxx_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 5 file_scope_flags [] In () () Default (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), flags: (Variable 5 flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), is_built_in: (Variable 5 is_built_in [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 5 link_time_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), os_type: (Variable 5 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile: (Variable 5 profile [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 5 profile_name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_profile (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) (Logical 4) (Logical 4) (Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 profile_name) (Var 5 compiler) (Var 5 os_type) (Var 5 flags) (Var 5 __libasr_is_present_flags) (Var 5 c_flags) (Var 5 __libasr_is_present_c_flags) (Var 5 cxx_flags) (Var 5 __libasr_is_present_cxx_flags) (Var 5 link_time_flags) (Var 5 __libasr_is_present_link_time_flags) (Var 5 file_scope_flags) (Var 5 __libasr_is_present_file_scope_flags) (Var 5 is_built_in) (Var 5 __libasr_is_present_is_built_in)] [] (Var 5 profile) Public .false. .false. () ), profile_config_t: (Struct (SymbolTable 4 { c_flags: (Variable 4 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), compiler: (Variable 4 compiler [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 4 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 4 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), flags: (Variable 4 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), is_built_in: (Variable 4 is_built_in [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 4 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), os_type: (Variable 4 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 4 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) profile_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [profile_name compiler os_type flags c_flags cxx_flags link_time_flags file_scope_flags is_built_in] [] Source Public .false. .false. [] () () ) }) modules_45_fpm_manifest_profile () [modules_45_fpm_manifest_profile] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutines_04-c6808b6.stdout0000664000175000017500000000016215141516316027163 0ustar alastairalastairfunction print_int() local a::Int32 a = 5 println(a) end function main() print_int() end main() lfortran-lfortran-2f73434/tests/reference/llvm-common_linkage_separate_compilation_01-4003f83.stdout0000664000175000017500000000341515141516316033623 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %blk = type { i32 } @__module_file_common_block_blk_struct_instance_blk = common global %blk zeroinitializer @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [8 x i8] c"%s %d%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 5, i32* getelementptr inbounds (%blk, %blk* @__module_file_common_block_blk_struct_instance_blk, i32 0, i32 0), align 4 %2 = load i32, i32* getelementptr inbounds (%blk, %blk* @__module_file_common_block_blk_struct_instance_blk, i32 0, i32 0), align 4 %3 = icmp ne i32 %2, 5 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_common_linkage_separate_compilation_01 FINALIZE_SYMTABLE_common_linkage_separate_compilation_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-min_02-21863aa.stderr0000664000175000017500000000036115141516316025012 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/min_02.f90:4:14 | 4 | print *, min(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-lfortran-2f73434/tests/reference/asr-nested_02-8302041.stdout0000664000175000017500000001317615141516316025374 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_02: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_02_a [] b Public ) }) nested_02 [nested_02_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_02_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_02_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-assign_to2-127a642.json0000664000175000017500000000077215141516316025373 0ustar alastairalastair{ "basename": "asr-assign_to2-127a642", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to2.f90", "infile_hash": "a929e60f25d1d3c3b1ef485c7d9b5dca6f7bebcfffc66ed010f309d3", "outfile": null, "outfile_hash": null, "stdout": "asr-assign_to2-127a642.stdout", "stdout_hash": "bea58fd397762d792263c1599b6dbaaac4025cbeac8e38f99a1002e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_03-a66333c.stderr0000664000175000017500000000026315141516316031062 0ustar alastairalastairruntime error: Tried to access member of unallocated variable 'var' --> tests/errors/scalar_allocation_check_03.f90:10:14 | 10 | print *, var%x | ^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_31-9b91cfb.stdout0000664000175000017500000004541215141516316026615 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_31: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 2 w [] Local (RealUnaryMinus (RealConstant 1.000001 (Real 8) ) (Real 8) (RealConstant -1.000001 (Real 8) ) ) (RealConstant -1.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), w_ceil: (Variable 2 w_ceil [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 63.290001 (Real 4) ) (RealConstant 63.290001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x_ceil: (Variable 2 x_ceil [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (RealUnaryMinus (RealConstant 63.590000 (Real 4) ) (Real 4) (RealConstant -63.590000 (Real 4) ) ) (RealConstant -63.590000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y_ceil: (Variable 2 y_ceil [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (RealConstant 0.000001 (Real 8) ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z_ceil: (Variable 2 z_ceil [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_31 [] [(Assignment (Var 2 x_ceil) (Cast (IntrinsicElementalFunction Ceiling [(Var 2 x)] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 y_ceil) (Cast (IntrinsicElementalFunction Ceiling [(Var 2 y)] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 z_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 z)] 0 (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 w_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 w)] 0 (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 64.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4) Decimal) (Integer 4) (IntegerConstant -63 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -63.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 x_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 x_ceil)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y_ceil) (IntrinsicElementalFunction Ceiling [(Var 2 y_ceil)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 z_ceil)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 w_ceil)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-bin_op_complex_dp-26e149c.stdout0000664000175000017500000002347215141516316027445 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bin_op_complex_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin_op_complex_dp [] [(Assignment (Var 2 zero) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 4) (ComplexConstant 0.142857 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 8) (ComplexConstant 0.142857 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 v) (Cast (RealBinOp (RealConstant 1.000000 (Real 8) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) ) (Real 8) (RealConstant 0.142857 (Real 8) ) ) RealToComplex (Complex 8) (ComplexConstant 0.142857 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToComplex (Complex 4) (ComplexConstant 0.142857 0.000000 (Complex 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules1-d3dc674.stdout0000664000175000017500000004236115141516316025575 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { abc: (Module (SymbolTable 8 { f: (Function (SymbolTable 10 { match: (Variable 10 match [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 10 self [] In () () Default (StructType [] [] .false. .false. ) 8 t1 Source Public Optional .false. .false. .false. () .false. .false. ) }) f (FunctionType [(StructType [] [] .false. .false. )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 10 self)] [] (Var 10 match) Public .false. .false. () ), t1: (Struct (SymbolTable 9 { f: (StructMethodDeclaration 9 f () f 8 f Source .false. .false. ) }) t1 (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ) }) abc () [] .true. .false. .false. ), x: (Program (SymbolTable 2 { t2: (ExternalSymbol 2 t2 4 t2 y [] t2 Public ) }) x [y] [] ), y: (Module (SymbolTable 4 { sub: (Function (SymbolTable 6 { 1_t1_f: (ExternalSymbol 6 1_t1_f 9 f t1 [] f Public ), 1_t2_val: (ExternalSymbol 6 1_t2_val 5 val t2 [] val Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 t2 Source Public Required .false. .true. .false. () .false. .false. ) }) sub (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (FunctionCall 6 1_t1_f () [] (Logical 4) () (StructInstanceMember (Var 6 self) 6 1_t2_val (Allocatable (StructType [] [] .false. .false. ) ) () ) ) [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] () Public .false. .false. () ), t1: (ExternalSymbol 4 t1 8 t1 abc [] t1 Public ), t2: (Struct (SymbolTable 5 { val: (Variable 5 val [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 t1 Source Public Required .false. .false. .false. () .false. .false. ) }) t2 (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [val] [] Source Public .false. .false. [] () () ) }) y () [abc] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules3-8936416.json0000664000175000017500000000071515141516316025011 0ustar alastairalastair{ "basename": "asr-modules3-8936416", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules3.f90", "infile_hash": "048400a36375e708ad5f14c9f8b07ff0063f29e758b77290cbbfbd29", "outfile": null, "outfile_hash": null, "stdout": "asr-modules3-8936416.stdout", "stdout_hash": "472eb4947e246bb5f7c653e6426ed1ca71e3cc126d89552b2799690c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-implicit1-418fb10.json0000664000175000017500000000105715141516316025752 0ustar alastairalastair{ "basename": "ast_f90-implicit1-418fb10", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/implicit1.f90", "infile_hash": "8f316b7b5813cd7d2f663bd9aac929c0d2fdb42eccdc2ac798b0c3d5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-implicit1-418fb10.stdout", "stdout_hash": "a74dec58fd0cb5acc6ae97e5a60469284b76a4453f4214a4916107fb", "stderr": "ast_f90-implicit1-418fb10.stderr", "stderr_hash": "7040f573fd98c40ed1387403ecf33f749ead9159a50668621b3fb8ca", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_12-e72e066.json0000664000175000017500000000074515141516316025223 0ustar alastairalastair{ "basename": "asr-string_12-e72e066", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_12.f90", "infile_hash": "ba0e8d4d5c264402806c61ad398d62eaf5c9ddd47d86b173e5210342", "outfile": null, "outfile_hash": null, "stdout": "asr-string_12-e72e066.stdout", "stdout_hash": "72bcdaacb4245e84644927a7dc3c26597e01c329df18fbe9be9f579b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-type_mismatch1-550e457.stderr0000664000175000017500000000026215141516316026606 0ustar alastairalastairsemantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/type_mismatch1.f90:4:1 | 4 | x = "x" | ^ ^^^ type mismatch (integer and string) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_2-9ba55e7.stdout0000664000175000017500000000121215141516316031153 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { continue_compilation_ff_2: (Program (SymbolTable 2 { }) continue_compilation_ff_2 [] [(Print (StringConstant "This is a test program" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-matrix_01_transpose-fb3276a.json0000664000175000017500000000100315141516316027355 0ustar alastairalastair{ "basename": "asr-matrix_01_transpose-fb3276a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matrix_01_transpose.f90", "infile_hash": "c9aabbf171aad175f8ee167db7f8b9191537d7e2afe04ef4c669d615", "outfile": null, "outfile_hash": null, "stdout": "asr-matrix_01_transpose-fb3276a.stdout", "stdout_hash": "f06ecbef91d4f82bcec7c6d77955dd80f66b29ee75fdbd5194432c6f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-associate_04-8bcb3df.json0000664000175000017500000000075615141516316026110 0ustar alastairalastair{ "basename": "asr-associate_04-8bcb3df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_04.f90", "infile_hash": "902a12c91e1df67575c96534b3b5a55ca93e85aa0777e689ecc1334c", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_04-8bcb3df.stdout", "stdout_hash": "b807bd5a25117df74b587b1dfd569e5e3c1354529c0f0dbbd0232f98", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program1-caa9665.json0000664000175000017500000000071515141516316025222 0ustar alastairalastair{ "basename": "ast-program1-caa9665", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "ast-program1-caa9665.stdout", "stdout_hash": "0d118f67ddc1e7368ee04f80885a7ab69369f987486d8ea44a9ca808", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_40-9ce331f.json0000664000175000017500000000071515141516316025301 0ustar alastairalastair{ "basename": "run-format_40-9ce331f", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_40.f90", "infile_hash": "f9b072b2e5d881b866bc93f150f89a0e537fc8cb5b7efe6bd3519a9a", "outfile": null, "outfile_hash": null, "stdout": "run-format_40-9ce331f.stdout", "stdout_hash": "d2b1f734863fed5c473c2fc70a409e7f4744908c27934abff1b94ebb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout0000664000175000017500000003001015141516316030101 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f2: (Variable 2 f2 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f3: (Variable 2 f3 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f4: (Variable 2 f4 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f5: (Variable 2 f5 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f6: (Variable 2 f6 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f7: (Variable 2 f7 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f8: (Variable 2 f8 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f2) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f3) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f4) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f5) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f6) (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f7) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f8) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. )] (Var 2 f8) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-common2-64c97b2.stdout0000664000175000017500000006210415141516316025335 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 4 h [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_1 (StructType [] [] .true. .false. ) [] [a b h] [] Source Public .false. .false. [] () () ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_1 () [] .false. .false. .false. ), file_common_block_block_2: (Module (SymbolTable 5 { block_2: (Struct (SymbolTable 6 { c: (Variable 6 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 6 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_2 (StructType [] [] .true. .false. ) [] [c d] [] Source Public .false. .false. [] () () ), struct_instance_block_2: (Variable 5 struct_instance_block_2 [] Local () () Default (StructType [] [] .true. .false. ) 5 block_2 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_2 () [] .false. .false. .false. ), file_common_block_block_3: (Module (SymbolTable 7 { block_3: (Struct (SymbolTable 8 { e: (Variable 8 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 8 g [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_3 (StructType [] [] .true. .false. ) [] [e g] [] Source Public .false. .false. [] () () ), struct_instance_block_3: (Variable 7 struct_instance_block_3 [] Local () () Default (StructType [] [] .true. .false. ) 7 block_3 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_3 () [] .false. .false. .false. ), file_common_block_block_4: (Module (SymbolTable 9 { block_4: (Struct (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_4 (StructType [] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), struct_instance_block_4: (Variable 9 struct_instance_block_4 [] Local () () Default (StructType [] [] .true. .false. ) 9 block_4 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_4 () [] .false. .false. .false. ), file_common_block_block_5: (Module (SymbolTable 11 { block_5: (Struct (SymbolTable 12 { j: (Variable 12 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 12 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_5 (StructType [] [] .true. .false. ) [] [j k] [] Source Public .false. .false. [] () () ), struct_instance_block_5: (Variable 11 struct_instance_block_5 [] Local () () Default (StructType [] [] .true. .false. ) 11 block_5 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_5 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_57-fd2be24.stdout0000664000175000017500000000055315141516316025735 0ustar alastairalastairkind sp dp ep epsilon: 0.119E-0006 0.222E-0015 0.222E-0015 tiny : 0.118E-0037 0.223E-0307 0.223E-0307 huge : 0.340E+0039 0.180E+0309 0.180E+0309 epsilon: 1.19E-0007 2.22E-0016 2.22E-0016 tiny : 1.18E-0038 2.23E-0308 2.23E-0308 huge : 3.40E+0038 1.80E+0308 1.80E+0308 "0.22222E-200" " 0.22222-200" "2.22222E-201" " 2.22222-201" lfortran-lfortran-2f73434/tests/reference/asr-logical2-e35f19c.json0000664000175000017500000000074215141516316025165 0ustar alastairalastair{ "basename": "asr-logical2-e35f19c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "asr-logical2-e35f19c.stdout", "stdout_hash": "e09d5ccfacaef8d3aa19c89a67f1a6a666ac55af245c46a71e181110", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_03-54c2520.json0000664000175000017500000000072315141516316025267 0ustar alastairalastair{ "basename": "asr-modules_03-54c2520", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_03.f90", "infile_hash": "5d89fb6b763fc2ed81c7a0ebc21a9db4055f35adfb6c631054a0aab9", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_03-54c2520.stdout", "stdout_hash": "c69321a70c983344b0941e301b4d57f2210008fa7fb6ad04f726a188", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-external_03-c3442bb.stdout0000664000175000017500000000601715141516316026340 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @a(float (float*)* %f) { .entry: %call_arg_value = alloca float, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %call_arg_value, align 4 %0 = call float %f(float* %call_arg_value) store float %0, float* %r, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, float* %r) %3 = load i64, i64* %1, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } declare float @f(float*) define void @b() { .entry: call void @a(float (float*)* @f.1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare float @f.1(float*) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @b() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_external_03 FINALIZE_SYMTABLE_external_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-print_intrinsics-9b076f7.stdout0000664000175000017500000000013015141516316027376 0ustar alastairalastairpi=acos(-1.0_sp) =" 3.14159274 " pi=acos(-1.0_dp) =" 3.1415926535897931 " lfortran-lfortran-2f73434/tests/reference/asr-character_parameter_padding_trimming-ea91653.stdout0000664000175000017500000004520115141516316033347 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_parameter_padding_trimming: (Program (SymbolTable 2 { p_pad: (Variable 2 p_pad [] Local (ArrayConstant 12 ["2 ", "2 ", "2 "] (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 12 ["2 ", "2 ", "2 "] (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), p_trim: (Variable 2 p_trim [] Local (ArrayConstant 3 ["2", "2", "2"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 3 ["2", "2", "2"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x_pad: (Variable 2 x_pad [] Local (StringConstant "apple" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "apple " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), x_trim: (Variable 2 x_trim [] Local (StringConstant "apple" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ap" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), y_pad: (Variable 2 y_pad [] Local (StringConstant "Ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Ball " (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), y_trim: (Variable 2 y_trim [] Local (StringConstant "Ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Bal" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), z_pad: (Variable 2 z_pad [x_pad y_pad] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 2 x_pad) (Var 2 y_pad)] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apple Ball " (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 2 x_pad)] 0 (String 1 (IntegerConstant 26 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apple Ball apple " (String 1 (IntegerConstant 26 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "apple Ball apple " (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), z_trim: (Variable 2 z_trim [x_trim y_trim] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 2 x_trim) (Var 2 y_trim)] 0 (String 1 (IntegerConstant 5 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apBal" (String 1 (IntegerConstant 5 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 2 x_trim)] 0 (String 1 (IntegerConstant 7 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "apBalap" (String 1 (IntegerConstant 7 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "apBal" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) character_parameter_padding_trimming [] [(Print (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "|" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x_pad)] 0 (String 1 (IntegerConstant 9 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "|apple " (String 1 (IntegerConstant 9 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "|" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 10 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "|apple |" (String 1 (IntegerConstant 10 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) ) (Print (Var 2 y_pad) ) (Print (StringFormat () [(Var 2 p_pad)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (Var 2 x_trim) ) (Print (Var 2 y_trim) ) (Print (Var 2 z_trim) ) (Print (StringFormat () [(Var 2 p_trim)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit_check-94844d9.json0000664000175000017500000000106215141516316030510 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit_check-94844d9", "cmd": "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit_check.f", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit_check-94844d9.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run_dbg-runtime_stacktrace_01-c6f5e06.stderr0000664000175000017500000000044715141516316031046 0ustar alastairalastair File "tests/errors/runtime_stacktrace_01.f90", line 3 print *, main() File "tests/errors/runtime_stacktrace_01.f90", line 10 print *, g() File "tests/errors/runtime_stacktrace_01.f90", line 20 call f() File "tests/errors/runtime_stacktrace_01.f90", line 14 stop 1 STOP 1 lfortran-lfortran-2f73434/tests/reference/asr-derived_types_04-b960162.stdout0000664000175000017500000001741615141516316027053 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { debug: (Program (SymbolTable 5 { }) debug [] [] ), derived_types_04_bitset: (Module (SymbolTable 2 { all_abstract: (Function (SymbolTable 4 { all: (Variable 4 all [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] In () () Default (StructType [(Integer 8)] [] .false. .false. ) 2 bitset_type Source Public Required .false. .false. .false. () .false. .false. ) }) all_abstract (FunctionType [(StructType [(Integer 8)] [] .false. .false. )] (Logical 4) Source Interface () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] (Var 4 all) Public .false. .false. () ), bitset_type: (Struct (SymbolTable 3 { all: (StructMethodDeclaration 3 all self all_abstract 2 all_abstract Source .true. .false. ), num_bits: (Variable 3 num_bits [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. ) }) bitset_type (StructType [(Integer 8)] [] .true. .false. ) [] [num_bits] [] Source Private .false. .true. [] () () ) }) derived_types_04_bitset () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-string_03-fc56745.stdout0000664000175000017500000001070015141516316025573 0ustar alastairalastair(TranslationUnit [(Module string_03_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(len 5 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(intro [] [] () (String "I've " ()) Equal ())] () )] [] [] ) (Program string_03 () [(Use [] string_03_mod [(UseSymbol intro () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 8 Value)] () () None ) [] [(verb [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 5 Value)] () () None ) [] [(posit [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 4 Value)] () () None ) [] [(title [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 7 Value)] () () None ) [] [(last_name [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 29 Value)] () () None ) [] [(combined [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 verb (String "learned " ()) () ) (Assignment 0 posit (String "from " ()) () ) (Assignment 0 title (String "the " ()) () ) (Assignment 0 last_name (String "best" ()) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 combined (StrOp (StrOp (StrOp (StrOp (StrOp intro Concat verb ) Concat posit ) Concat title ) Concat last_name ) Concat (String "." ()) ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [combined] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_line_limit-0a3f0f0.json0000664000175000017500000000077715141516316030012 0ustar alastairalastair{ "basename": "ast-fixed_form_line_limit-0a3f0f0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_line_limit.f", "infile_hash": "474de788602ebc9fe11f04fe1962c667fa1ae3261c04710af3358dc9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_line_limit-0a3f0f0.stdout", "stdout_hash": "98d3ac76ca5cd9f5bc59f2fe37b490c60bade2b2284d51dece724258", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm_bind_js-d9f341f.stdout0000664000175000017500000000554515141516316026516 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32 i32 i32) (result))) (type (;3;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (import "js" "show_img" (func (;2;) (type 2))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $3 (type 3) (param) (result) (local i32 i32 i32) i32.const 600 local.set 0 i32.const 208 local.set 1 i32.const 450 local.set 2 local.get 2 local.get 0 local.get 1 call 2 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_dp_param-5efce36.stdout0000664000175000017500000000607215141516316027624 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %complex_8 = type <{ double, double }> %string_descriptor = type <{ i8*, i64 }> @complex_dp_param.u = internal global %complex_4 zeroinitializer @complex_dp_param.v = internal global %complex_8 zeroinitializer @complex_dp_param.zero = internal global %complex_8 zeroinitializer @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [24 x i8] c"{R4,R4},{R8,R8},{R8,R8}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 store %complex_4 <{ float 0x3FF0CCCCC0000000, float 0x3FF0CCCCC0000000 }>, %complex_4* @complex_dp_param.u, align 1 store %complex_8 <{ double 0x3FF0CCCCC0000000, double 1.050000e+00 }>, %complex_8* @complex_dp_param.v, align 1 store %complex_8 zeroinitializer, %complex_8* @complex_dp_param.zero, align 1 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %complex_4* @complex_dp_param.u, %complex_8* @complex_dp_param.v, %complex_8* @complex_dp_param.zero) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex_dp_param FINALIZE_SYMTABLE_complex_dp_param: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout0000664000175000017500000000277015141516316030507 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(m [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 k 1 () ) (Print 100 () [(String "hello" ())] () ) (Assignment 200 k (+ k 1) () ) (Assignment 0 m 1 () ) (Assignment 0 n 2 () ) (GoTo 0 () m [200 100] () ) (GoTo 0 () n [100 200] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_40-d3a41b5.json0000664000175000017500000000075015141516316025427 0ustar alastairalastair{ "basename": "asr-modules_40-d3a41b5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_40.f90", "infile_hash": "ac67135d17b966d74eb1c00c48de647510f0b5ae38596bce67d52958", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_40-d3a41b5.stdout", "stdout_hash": "9060254c51053977ef7711b2e84acaec911e78b9b409c2ba684064c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-expr8-613d1f3.json0000664000175000017500000000071715141516316025131 0ustar alastairalastair{ "basename": "ast_f90-expr8-613d1f3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr8-613d1f3.stdout", "stdout_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_19-d880475.json0000664000175000017500000000074515141516316025157 0ustar alastairalastair{ "basename": "asr-string_19-d880475", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_19.f90", "infile_hash": "d8a26562a756345bdab3a05085b09fadef2c3113a092b362b278b648", "outfile": null, "outfile_hash": null, "stdout": "asr-string_19-d880475.stdout", "stdout_hash": "324898cfcd50ddc37cb484c3f62399af97ce9585cc6327d6f664687a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-types_13-ddae644.json0000664000175000017500000000110015141516316025661 0ustar alastairalastair{ "basename": "ast_f90-types_13-ddae644", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/types_13.f90", "infile_hash": "0386b3b949293ae071687d72cec51980cbdce80908080fa69e19a807", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-types_13-ddae644.stdout", "stdout_hash": "ee7a7331545300956ac247f224c390a27caf81b3752a68562c6eff59", "stderr": "ast_f90-types_13-ddae644.stderr", "stderr_hash": "44623a78eb46ca78c3622e964b0d57198c877bd80dad64fca178c250", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_03-d9fd880.json0000664000175000017500000000102215141516316030403 0ustar alastairalastair{ "basename": "llvm-operator_overloading_03-d9fd880", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_03.f90", "infile_hash": "3340e64f6a134b16739a00f54087bb1816f1e6876ec32e6170275e19", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_03-d9fd880.stdout", "stdout_hash": "fc812db044e4bb23e3a9758b48d05a36afc2c30b316ec8e54864f9af", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_02-35381bd.json0000664000175000017500000000100015141516316027054 0ustar alastairalastair{ "basename": "asr-template_simple_02-35381bd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_02.f90", "infile_hash": "c0588c6676de96e6fa5c9b2a4889eb393e900f8dbb27a68f463e14fd", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_02-35381bd.stdout", "stdout_hash": "657dd4fc725aeefa1d57b12d2972d3d83b6b761b4a3f5a9f96868a02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_generic_procedure_same_name-708e46e.json0000664000175000017500000000104415141516316033121 0ustar alastairalastair{ "basename": "asr-interface_generic_procedure_same_name-708e46e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/interface_generic_procedure_same_name.f90", "infile_hash": "29ffbcf68bc154604f8f4e5acd8bb8776602725ac76db9608e253dc0", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_generic_procedure_same_name-708e46e.stdout", "stdout_hash": "e5d427ebabb19f51513a7ee8f8c015bc804c56d6b72dd505e43db9b1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-variables_03-4ba9d62.stdout0000664000175000017500000001015715141516316026476 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %b = alloca i1, align 1 %x = alloca i32, align 4 store i32 2, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp ne i32 %2, 2 store i1 %3, i1* %b, align 1 %4 = load i1, i1* %b, align 1 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %5 = load i32, i32* %x, align 4 %6 = icmp eq i32 %5, 2 store i1 %6, i1* %b, align 1 %7 = load i1, i1* %b, align 1 %8 = xor i1 %7, true br i1 %8, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %9 = load i32, i32* %x, align 4 %10 = icmp eq i32 %9, 2 %11 = xor i1 %10, true store i1 %11, i1* %b, align 1 %12 = load i1, i1* %b, align 1 br i1 %12, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %13 = load i32, i32* %x, align 4 %14 = icmp eq i32 %13, 2 store i1 %14, i1* %b, align 1 %15 = load i1, i1* %b, align 1 %16 = xor i1 %15, true store i1 %16, i1* %b, align 1 %17 = load i1, i1* %b, align 1 br i1 %17, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont9 br label %FINALIZE_SYMTABLE_variables_03 FINALIZE_SYMTABLE_variables_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-select_type1-36bfefb.json0000664000175000017500000000073115141516316026230 0ustar alastairalastair{ "basename": "ast-select_type1-36bfefb", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/select_type1.f90", "infile_hash": "0484f169388676238c1bdf4ae9e9041b66ca05da7dc95a32c57a6003", "outfile": null, "outfile_hash": null, "stdout": "ast-select_type1-36bfefb.stdout", "stdout_hash": "65b4ce109adc6c3ca4a840222c8d64fd5bc1a2cfe1d5b421f481bacd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_01-204dfa1.stdout0000664000175000017500000006520715141516316026653 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { select_type_01: (Program (SymbolTable 2 { 1_base_i: (ExternalSymbol 2 1_base_i 3 i base [] i Public ), 1_child_j: (ExternalSymbol 2 1_child_j 4 j child [] j Public ), base: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) base (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), base_target: (Variable 2 base_target [] Local (StructConstructor 2 base [((IntegerConstant 10 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () ) () Default (StructType [(Integer 4)] [] .true. .false. ) 2 base Source Public Required .false. .true. .false. () .false. .false. ), bptr: (Variable 2 bptr [] Local () () Default (Pointer (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. ), child: (Struct (SymbolTable 4 { j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) child (StructType [(Integer 4)] [] .true. .false. ) [] [j] [] Source Public .false. .false. [] () 2 base ), child_target: (Variable 2 child_target [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 child Source Public Required .false. .true. .false. () .false. .false. ), perform_select_type: (Function (SymbolTable 5 { bptr: (Variable 5 bptr [] Unspecified () () Default (Pointer (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. ), ~select_type_block_: (Block (SymbolTable 6 { 1_base_i: (ExternalSymbol 6 1_base_i 3 i base [] i Public ) }) ~select_type_block_ [(Print (StringFormat () [(StringConstant "base type: component value: " (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 bptr) 6 1_base_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Var 5 bptr) 6 1_base_i (Integer 4) () ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_1: (Block (SymbolTable 7 { 1_base_i: (ExternalSymbol 7 1_base_i 3 i base [] i Public ), 1_child_j: (ExternalSymbol 7 1_child_j 4 j child [] j Public ) }) ~select_type_block_1 [(Print (StringFormat () [(StringConstant "child type: component values: " (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 bptr) 7 1_base_i (Integer 4) () ) (StructInstanceMember (Var 5 bptr) 7 1_child_j (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Var 5 bptr) 7 1_base_i (Integer 4) () ) NotEq (IntegerConstant 20 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 5 bptr) 7 1_child_j (Integer 4) () ) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) perform_select_type (FunctionType [(Pointer (StructType [(Integer 4)] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 bptr)] [(SelectType (Var 5 bptr) () [(TypeStmtName 2 base [(BlockCall -1 5 ~select_type_block_ )] ) (TypeStmtName 2 child [(BlockCall -1 5 ~select_type_block_1 )] )] [] )] () Public .false. .false. () ) }) select_type_01 [] [(Assignment (Var 2 child_target) (StructConstructor 2 child [((IntegerConstant 20 (Integer 4) Decimal)) ((IntegerConstant 30 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () ) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 2 base_target) 2 1_base_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (Var 2 child_target) 2 1_base_i (Integer 4) () ) (StructInstanceMember (Var 2 child_target) 2 1_child_j (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Associate (Var 2 bptr) (Var 2 child_target) ) (SubroutineCall 2 perform_select_type () [((Var 2 bptr))] () .false. ) (Associate (Var 2 bptr) (Var 2 base_target) ) (SubroutineCall 2 perform_select_type () [((Var 2 bptr))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_ifdef_01-f746dbf.json0000664000175000017500000000102715141516316032152 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_ifdef_01-f746dbf", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_ifdef_01.f90", "infile_hash": "0911d913e173386c6ba5ddf05ff36c3c493ad69ab57bbb0c3a6e34dd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_ifdef_01-f746dbf.stderr", "stderr_hash": "1fd14f9256751ff3811111609342770a2754315951e5a34a932b52c7", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/julia-subroutines_02-8f01adf.json0000664000175000017500000000075515141516316026751 0ustar alastairalastair{ "basename": "julia-subroutines_02-8f01adf", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_02-8f01adf.stdout", "stdout_hash": "8567773fe3abad3c9bdd0b49f8168d14a0f3f8dd89860ecacf65e7bf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr2-74c7f32.stdout0000664000175000017500000000043215141516316025016 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_1-3be6d43.json0000664000175000017500000000075315141516316026032 0ustar alastairalastair{ "basename": "ast-fixed_form_1-3be6d43", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_1.f", "infile_hash": "20f5de5731f83348f8c0c349bd114289e4a854a74f41d0a9a0d35903", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_1-3be6d43.stderr", "stderr_hash": "5e8f3c9a30fc2cf296386482a81ce2b336d5efbd98ead7d9521cfd2b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/fortran-integer_to_real_cast_in_comparison-a6f3411.json0000664000175000017500000000104715141516316033360 0ustar alastairalastair{ "basename": "fortran-integer_to_real_cast_in_comparison-a6f3411", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/integer_to_real_cast_in_comparison.f90", "infile_hash": "d37d05e6da1fa8914cd0341fe2b8cd998a8b48328c9b01acd16f7d79", "outfile": null, "outfile_hash": null, "stdout": "fortran-integer_to_real_cast_in_comparison-a6f3411.stdout", "stdout_hash": "702b53ad8052a801eb60d9efedbb7b4f27d2ae9dad17a5a23ce33826", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-print5-c57814b.json0000664000175000017500000000065715141516316024654 0ustar alastairalastair{ "basename": "run-print5-c57814b", "cmd": "lfortran --no-color {infile}", "infile": "tests/print5.f90", "infile_hash": "c7ecd7e820fbd2c3b434da8df807991ee8fea817267da5645ec00ade", "outfile": null, "outfile_hash": null, "stdout": "run-print5-c57814b.stdout", "stdout_hash": "adc8db165d335320aa3947351bd6577e658800b43f152e3aaaa5e376", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine3b-4883d18.json0000664000175000017500000000073115141516316025757 0ustar alastairalastair{ "basename": "asr-subroutine3b-4883d18", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3b-4883d18.stdout", "stdout_hash": "d574ae32124bc9c50377f3e92e17c2f4c33618a82c8b77e8728edb93", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_10-b69c804.json0000664000175000017500000000074315141516316027556 0ustar alastairalastair{ "basename": "run-array_bounds_check_10-b69c804", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_10.f90", "infile_hash": "fd720e812db110a0b31e5f164979aceb42e7238f0e242337197a4883", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_10-b69c804.stderr", "stderr_hash": "f242dd06545df0bc8e3a0dcd0185dd823fcafde6ae0dc9175401eb05", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-type_conflict1-5097f3a.stderr0000664000175000017500000000031715141516316026663 0ustar alastairalastairsemantic error: Parameter attribute cannot be used with Target attribute --> tests/errors/type_conflict1.f90:3:5 | 3 | integer, parameter, target :: foo=4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-interface_01-b750ffe.stdout0000664000175000017500000000111315141516316027032 0ustar alastairalastairmodule interface_01_mod implicit none interface a module procedure a1 module procedure a2 end interface a contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine a1 subroutine a2(a) real, intent(inout) :: a a = a + 1 end subroutine a2 end module interface_01_mod program interface_01 use interface_01_mod, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) then error stop end if r = 6 call a(r) if (r /= 7) then error stop end if i = 7 call a(i) if (i /= 8) then error stop end if end program interface_01 lfortran-lfortran-2f73434/tests/reference/ast-comments1-213c55a.json0000664000175000017500000000072015141516316025301 0ustar alastairalastair{ "basename": "ast-comments1-213c55a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/comments1.f90", "infile_hash": "54490aafe8914e1e15517fbb3754ffa3d631fb2fd2241926a46aa79b", "outfile": null, "outfile_hash": null, "stdout": "ast-comments1-213c55a.stdout", "stdout_hash": "fcd83d753eb4d636130d6b1abe182f6aa5111fb30764419c1ad210e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-loop_test1-716ccb0.stdout0000664000175000017500000001571415141516316026126 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { do330i: (Variable 2 do330i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), kp: (Variable 2 kp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (Var 2 kp) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 kp) ()) [(DoLoop () ((Var 2 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Var 2 kp) ()) [(If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Gt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [(Print (StringFormat () [(Var 2 j) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (GoToTarget 320 320 )] [] ) (GoToTarget 330 330 )] [] ) (Assignment (Var 2 do330i) (IntegerConstant 15 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-goto_01-d8652f5.json0000664000175000017500000000073715141516316024673 0ustar alastairalastair{ "basename": "ast-goto_01-d8652f5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_01-d8652f5.stdout", "stdout_hash": "87b44936c3e0a16a746fecf5ad2074f9eac99ee5fa3a90ef21084662", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_op_6-030b24e.stdout0000664000175000017500000013660315141516316026174 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_op_5: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), asquare: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Unspecified () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) asquare (FunctionType [(Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () ) Add (Var 3 c) (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () ) () .false. .false. )] (Var 3 d) Public .false. .false. () ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), check: (Function (SymbolTable 4 { c: (Variable 4 c [] In () () Default (Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) check (FunctionType [(Array (Real 4) [(() ()) (() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 c)] [(DoLoop () ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4) ColMajor () ) NotEq (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) Add (Var 4 k) (Integer 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] )] () Public .false. .false. () ), d: (Variable 2 d [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_op_5 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4) () ) Add (IntegerBinOp (Var 2 j) Mul (Var 2 j) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 2 k) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 2 i) Mul (Var 2 k) (Integer 4) () ) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. )] [] )] [] )] [] ) (Assignment (Var 2 d) (FunctionCall 2 asquare () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. ) (SubroutineCall 2 check () [((ArrayPhysicalCast (Var 2 d) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_03_func-7271066.json0000664000175000017500000000075515141516316026407 0ustar alastairalastair{ "basename": "julia-arrays_03_func-7271066", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_03_func-7271066.stdout", "stdout_hash": "36668a9b901903a1f4bdf1ca84002218176776fbfd1b58563b5fbde4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-callback_01-21b53de.stdout0000664000175000017500000006220015141516316026061 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { callback_01: (Module (SymbolTable 2 { cb: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cb: (Variable 3 cb [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [] (Var 4 f) Public .false. .false. () ) }) cb (FunctionType [(FunctionType [(Real 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f) (Var 3 a) (Var 3 b)] [(Assignment (Var 3 cb) (RealBinOp (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4) () ) Add (FunctionCall 3 f () [((Var 3 a))] (Real 4) () () ) (Real 4) () ) Add (FunctionCall 3 f () [((Var 3 b))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 3 cb) Public .false. .false. () ), foo: (Function (SymbolTable 5 { c: (Variable 5 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 5 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 6 { f: (Variable 6 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 x)] [(Assignment (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (Var 6 x) (Real 4) () ) () .false. .false. )] (Var 6 f) Public .false. .false. () ) }) foo (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cb] [(Var 5 c) (Var 5 d)] [(Print (StringFormat () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) callback_01 () [callback_01] .false. .false. .false. ), main: (Program (SymbolTable 7 { cb: (ExternalSymbol 7 cb 2 cb callback_01 [] cb Public ), foo: (ExternalSymbol 7 foo 2 foo callback_01 [] foo Public ) }) main [callback_01] [(SubroutineCall 7 foo () [((RealConstant 1.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) ))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-where_01-cc363a1.json0000664000175000017500000000074215141516316025071 0ustar alastairalastair{ "basename": "ast-where_01-cc363a1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "ast-where_01-cc363a1.stdout", "stdout_hash": "eebceb97b9c4cc54625f9f2e2cebfba97056a8ecb0e41dae5f35ae3e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_01-da63075.json0000664000175000017500000000075015141516316025354 0ustar alastairalastair{ "basename": "ast-modules_01-da63075", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_01-da63075.stdout", "stdout_hash": "e69793d1058d360b1ba8c99a09834216a95939942da8317d7934bd88", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-submodule_01-2524ba9.json0000664000175000017500000000075615141516316025710 0ustar alastairalastair{ "basename": "ast-submodule_01-2524ba9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_01.f90", "infile_hash": "ed0ecc9003bb9cd8e6be1f4f77cd3e59f45d09f2ba2f64029dc3680e", "outfile": null, "outfile_hash": null, "stdout": "ast-submodule_01-2524ba9.stdout", "stdout_hash": "6b9e7e191e0c91ef601e0128b385676f8b1492b8e196073f9b3bd369", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-statement1-481e9b6.json0000664000175000017500000000075015141516316025500 0ustar alastairalastair{ "basename": "asr-statement1-481e9b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement1.f90", "infile_hash": "e27125e5f5fdb977cddd49bc08366334cf6ed0375a909614296fbb14", "outfile": null, "outfile_hash": null, "stdout": "asr-statement1-481e9b6.stdout", "stdout_hash": "62ad1da8b328d2f29b4c578b50769e0eebbea0767d3fe575a1c88337", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_pow_test-c556b63.stdout0000664000175000017500000001231015141516316027345 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 y) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 2.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 z) (ComplexBinOp (Var 2 x) Pow (Var 2 y) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_3-435a232.stderr0000664000175000017500000003576715141516316030332 0ustar alastairalastairsyntax error: Token '::' is unexpected here --> tests/errors/continue_compilation_3.f90:57:9 | 57 | rea :: test_real(12) | ^^ syntax error: Token ')' is unexpected here --> tests/errors/continue_compilation_3.f90:58:21 | 58 | real :: test_re() | ^ syntax error: The LFortran pragma !LF$ must be followed by a space --> tests/errors/continue_compilation_3.f90:171:9 | 171 | !LF$unroll 4 ! Error: Missing space after `!LF$` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Module 'continue_compilation_3_fake_module' modfile was not found --> tests/errors/continue_compilation_3.f90:48:5 | 48 | use continue_compilation_3_fake_module | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-rank arrays are not supported in print statements --> tests/errors/continue_compilation_3.f90:30:18 | 30 | print *, x | ^ semantic error: Assumed rank arrays cannot be used as `source` argument to reshape intrinsic --> tests/errors/continue_compilation_3.f90:31:26 | 31 | print *, reshape(x, [size(x)]) | ^ semantic error: Assumed-rank array `x` cannot be accessed outside a select rank block --> tests/errors/continue_compilation_3.f90:32:18 | 32 | print *, x(1) | ^^^^ semantic error: Assumed-rank array 'x' must be a dummy argument --> tests/errors/continue_compilation_3.f90:33:6 | 33 | x = [1, 2] | ^ semantic error: Comparison operations are not allowed on assumed-rank arrays ('x') --> tests/errors/continue_compilation_3.f90:34:19 | 34 | print *, (x /= [1, 2]) | ^^^^^^^^^^^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:68:26 | 68 | call intent_out_test(1) ! Error: literal constant with intent(out) | ^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:69:26 | 69 | call intent_out_test(x + 1) ! Error: expression with intent(out) | ^^^^^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:70:28 | 70 | call intent_inout_test(2) ! Error: literal constant with intent(inout) | ^ semantic error: Non-variable expression in variable definition context (actual argument to INTENT = OUT/INOUT) --> tests/errors/continue_compilation_3.f90:71:28 | 71 | call intent_inout_test(x * 2) ! Error: expression with intent(inout) | ^^^^^ semantic error: Type mismatch in argument `i`: expected `real(4)` but got `integer(4)` --> tests/errors/continue_compilation_3.f90:72:34 | 72 | call check_incompatible_type(i) ! Error: incompatible type passed | ^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:91:9 | 91 | a = [] | ^^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:93:16 | 93 | print *, [[[], [[]]], [[]], []] | ^^ semantic error: Empty array constructor is not allowed --> tests/errors/continue_compilation_3.f90:94:16 | 94 | print *, [[[], [[]]], []] | ^^ semantic error: Rank mismatch in array reference: the array `b` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:96:5 | 96 | b(:,:) = 1 | ^^^^^^ semantic error: Rank mismatch in array reference: the array `b` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:97:5 | 97 | b(:,:) = 2 | ^^^^^^ semantic error: Type member xx is not an array so it cannot be indexed. --> tests/errors/continue_compilation_3.f90:99:5 | 99 | y%xx(:) = 1 | ^^^^^^^ semantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `2` --> tests/errors/continue_compilation_3.f90:101:5 | 101 | str(1, 2)(:) = '1234' | ^^^^^^^^^^^^ semantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `3` --> tests/errors/continue_compilation_3.f90:102:5 | 102 | str(1,2,3)(:) = '1234' | ^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_3.f90:104:14 | 104 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_3.f90:105:14 | 105 | print *, [character(*) :: "a2", "b2", "ball2", "cat2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(3 and 2) --> tests/errors/continue_compilation_3.f90:107:5 | 107 | x1 = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(3 and 1) --> tests/errors/continue_compilation_3.f90:108:5 | 108 | x1 = reshape([1,2,3,4],[1,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Arithmetic if (x) requires an integer or real for `x` --> tests/errors/continue_compilation_3.f90:112:9 | 112 | if ("yy") 1, 2, 3 | ^^^^ semantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/continue_compilation_3.f90:119:9 | 119 | i = size(a1, 1, 4, kind=4) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/continue_compilation_3.f90:120:9 | 120 | i = size() | ^^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_3.f90:122:5 | 122 | x3 = 1 | ^^^^^^ assignment here | 55 | integer, parameter :: x3 = 2 | ~~~~~~ declared as constant semantic error: The end variable of the data implied do loop must be constants --> tests/errors/continue_compilation_3.f90:125:22 | 125 | data(a1(i), i=1, k) / 1, 2, 3 / | ^ semantic error: The increment variable of the data implied do loop must be a constant --> tests/errors/continue_compilation_3.f90:127:25 | 127 | data(a1(i), i=1, 3, k) / 1, 2, 3 / | ^ semantic error: The start variable of the data implied do loop must be constants --> tests/errors/continue_compilation_3.f90:129:19 | 129 | data(a1(i), i=k, 3) / 1, 2, 3 / | ^ semantic error: Variable 'foo' is not declared --> tests/errors/continue_compilation_3.f90:132:9 | 132 | i = foo | ^^^ 'foo' is undeclared semantic error: Invalid argument `end` supplied --> tests/errors/continue_compilation_3.f90:134:5 | 134 | rewind(end="world") | ^^^^^^^^^^^^^^^^^^^ semantic error: same_type_as is not implemented yet --> tests/errors/continue_compilation_3.f90:136:14 | 136 | print *, same_type_as(1.0, 1.0) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Sign must be the same --> tests/errors/continue_compilation_3.f90:138:14 | 138 | print *, sign(1, 1_8) | ^^^^^^^^^^^^ semantic error: Argument 1 of dabs must be of double precision real type --> tests/errors/continue_compilation_3.f90:140:13 | 140 | print*, dabs(1) | ^^^^^^^ semantic error: Argument of `sqrt` has a negative argument --> tests/errors/continue_compilation_3.f90:142:14 | 142 | print *, sqrt(-1.0) | ^^^^^^^^^^ semantic error: Binary numeric operators cannot be used on strings --> tests/errors/continue_compilation_3.f90:144:14 | 144 | print *, "a" + "b" | ^^^^^^^^^ help: use '//' for string concatenation semantic error: The first index in string section is less than 1 --> tests/errors/continue_compilation_3.f90:147:19 | 147 | print*, "s:", s(-1:4) | ^^^^^^^ semantic error: Substring `start` is less than one --> tests/errors/continue_compilation_3.f90:149:13 | 149 | print*, s1(-2:6) | ^^^^^^^^ semantic error: Substring end index exceeds the string length --> tests/errors/continue_compilation_3.f90:152:13 | 152 | print*, s1(1: 9) | ^^^^^^^^ semantic error: Substring end index at must be of type integer --> tests/errors/continue_compilation_3.f90:154:18 | 154 | print*, s1(1:5.2) | ^^^ semantic error: Substring start index at must be of type integer --> tests/errors/continue_compilation_3.f90:156:16 | 156 | print*, s1(1.1:5) | ^^^ semantic error: Substring stride must be of type integer --> tests/errors/continue_compilation_3.f90:158:19 | 158 | print*, s(1:5:2.2) | ^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_3.f90:160:5 | 160 | x = "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_3.f90:162:9 | 162 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_3.f90:162:5 | 162 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Subroutine `bpe` called as a function --> tests/errors/continue_compilation_3.f90:165:9 | 165 | i = bpe() | ^^^^^ semantic error: Variable 'xx' is not declared --> tests/errors/continue_compilation_3.f90:166:14 | 166 | print *, xx | ^^ 'xx' is undeclared semantic error: Variable 'test_re' is not declared --> tests/errors/continue_compilation_3.f90:167:5 | 167 | test_re = 1245.13 | ^^^^^^^ 'test_re' is undeclared semantic error: Array reference is not allowed on scalar variable --> tests/errors/continue_compilation_3.f90:168:5 | 168 | c(1) = 1 | ^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_3.f90:176:14 | 176 | print *, merge_bits(1, 2, 3_8) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_3.f90:177:14 | 177 | print *, merge_bits(merge_i,merge_j,merge_k) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:181:14 | 181 | print *, 5 .and. .true. | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:184:14 | 184 | print *, 3.14 .and. .false. | ^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:187:14 | 187 | print *, 5 .and. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:190:14 | 190 | print *, 5 .or. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:191:14 | 191 | print *, 5 .eqv. 6 | ^ semantic error: Right operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:192:28 | 192 | print *, .true. .neqv. 6 | ^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:193:14 | 193 | print *, 3.14 .and. "abcd" | ^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:194:14 | 194 | print *, "abcd" .neqv. "cdef" | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:195:14 | 195 | print *, 1 .neqv. 2 | ^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:196:14 | 196 | print *, [1,2,3] .and. .true. | ^^^^^^^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:197:14 | 197 | print *, [1.0, 2.0] .or. [3.0, 4.0] | ^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:198:14 | 198 | print *, "str1" .or. "str2" | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:199:14 | 199 | print *, "x" .and. .false. | ^^^ semantic error: Operand of .not. operator is string --> tests/errors/continue_compilation_3.f90:200:14 | 200 | print *, .NOT. "lf" | ^^^^^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:201:14 | 201 | print *, "8356" .or. 8356 | ^^^^^^ semantic error: Left operand must be LOGICAL or LOGICAL array --> tests/errors/continue_compilation_3.f90:202:14 | 202 | print *, "8356" .eqv. 8356.00 | ^^^^^^ semantic error: Left operand's array element type must be LOGICAL --> tests/errors/continue_compilation_3.f90:203:14 | 203 | print *, ['c', 'o', 'd', 'e'] .or. ['m', 'a', 's'] | ^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 7 and 2 in array constructor --> tests/errors/continue_compilation_3.f90:204:26 | 204 | print *, ["welcome", "to", "lf"] .and. "contributors" !even size diff of array element must be caught | ^^^^ semantic error: Argument of 'size' must be an array --> tests/errors/continue_compilation_3.f90:208:23 | 208 | print *, size(bpe) | ^^^ semantic error: Variable 'd' is not declared --> tests/errors/continue_compilation_3.f90:209:15 | 209 | bpe = d | ^ 'd' is undeclared semantic error: Assignment to subroutine is not allowed --> tests/errors/continue_compilation_3.f90:209:9 | 209 | bpe = d | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-interface_04-9570e2b.stdout0000664000175000017500000001713015141516316026222 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_04: (Program (SymbolTable 5 { a: (GenericProcedure 5 a [5 a1@a] Public ), a1@a: (ExternalSymbol 5 a1@a 2 a1 interface_04_mod1 [] a1 Public ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) interface_04 [interface_04_mod2] [(Assignment (Var 5 i) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 a1@a 5 a [((Var 5 i))] () .false. ) (If () (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), interface_04_mod1: (Module (SymbolTable 2 { a: (GenericProcedure 2 a [2 a1] Public ), a1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a1 (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) interface_04_mod1 () [] .false. .false. .false. ), interface_04_mod2: (Module (SymbolTable 4 { a: (ExternalSymbol 4 a 2 a interface_04_mod1 [] a Public ), a1: (ExternalSymbol 4 a1 2 a1 interface_04_mod1 [] a1 Public ) }) interface_04_mod2 () [interface_04_mod1] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_disable_style_suggestion-implicit10-c95f35e.json0000664000175000017500000000103415141516316032617 0ustar alastairalastair{ "basename": "ast_disable_style_suggestion-implicit10-c95f35e", "cmd": "lfortran --show-ast --no-style-suggestions --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "ast_disable_style_suggestion-implicit10-c95f35e.stdout", "stdout_hash": "e766eabc3b601ac842b0fcd05655fbf683b50e15864c4e269840b3e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-expr_11-8e5ae80.stderr0000664000175000017500000000024215141516316024732 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/expr_11.f90:3:5 | 3 | real*8 x | ^^^^^^ help: write this as 'real(8)' lfortran-lfortran-2f73434/tests/reference/cpp-arrays_04_func-68b1437.stdout0000664000175000017500000000344615141516316026521 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_3_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { float abs(float a); template float sum(T0* a); } // Implementations namespace { float abs(float a) { float r; std::cout<< "abs"< (float)(0)) { r = a; } else { r = -a; } return r; } template float sum(T0* a) { int32_t i; float r; std::cout<< "sum"<data->extent(0); i++) { r = r + a->data->operator[](i - a->dims[0].lower_bound); } return r; } void main2() { Kokkos::View a_data("a_data", 3); f32_3_1 a_value(&a_data); f32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; float b; a->data->operator[](1 - a->dims[0].lower_bound) = (float)(3); a->data->operator[](2 - a->dims[0].lower_bound) = (float)(2); a->data->operator[](3 - a->dims[0].lower_bound) = (float)(1); b = sum(a); if (abs(b - (float)(6)) > 9.99999974737875164e-06) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/pass_where-where_01-94e4416.stdout0000664000175000017500000007211415141516316026672 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { where_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) where_01 [] [(Assignment (Var 2 a) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-2, -2, -2, ...., -2, -2, -2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-3, -3, -3, ...., -3, -3, -3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit3-ffc1655.stderr0000664000175000017500000000023315141516316025713 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit3.f90:3:14 | 3 | implicit real*8 (k) | ^ help: write this as 'real(8)' lfortran-lfortran-2f73434/tests/reference/ast-open1-df87f77.stdout0000664000175000017500000000320515141516316025100 0ustar alastairalastair(TranslationUnit [(Program open1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Open 0 [] [(file (String "p_cc" ())) (newunit u)] () ) (Open 0 [task_lun] [(file taskfile)] () ) (Open 0 [] [(unit gmv_lun) (FILE fname) (IOSTAT ier) (POSITION (String "rewind" ()))] () ) (Open 0 [] [(newunit lun [(this [])]) (file outfile) (status (String "replace" ())) (iostat ios)] () ) (Open 0 [] [(unit 10) (file (String "test1.inp" ())) (position (String "rewind" ())) (action (String "read" ())) (status (String "old" ()))] () ) (Open 0 [] [(UNIT funit) (FILE tname) (STATUS fstat) (ACCESS (String "SEQUENTIAL" ())) (ACTION faction) (IOSTAT ierr)] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/wat-logical3-ce72150.stdout0000664000175000017500000003062715141516316025461 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 0 local.get 1 i32.or if i32.const 1 i32.const 300 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 336 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.xor if i32.const 1 i32.const 372 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 408 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end i32.const 0 local.set 0 i32.const 1 local.set 1 local.get 0 local.get 1 i32.and i32.eqz if i32.const 1 i32.const 448 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 484 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 1 local.get 0 i32.xor if i32.const 1 i32.const 520 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 556 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 1 local.get 0 i32.eq if i32.const 1 i32.const 592 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 628 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 1 local.set 0 i32.const 1 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 664 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 700 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.or if i32.const 1 i32.const 736 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 772 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable end local.get 0 local.get 1 i32.xor if i32.const 1 i32.const 808 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else i32.const 1 i32.const 848 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\1a\00\00\00") (data (;35;) (i32.const 216) "Line 1 - Condition is true ") (data (;36;) (i32.const 244) "\fc\00\00\00\0b\00\00\00") (data (;37;) (i32.const 252) "ERROR STOP\n ") (data (;38;) (i32.const 264) "\10\01\00\00\1b\00\00\00") (data (;39;) (i32.const 272) "Line 1 - Condition is false ") (data (;40;) (i32.const 300) "\34\01\00\00\1a\00\00\00") (data (;41;) (i32.const 308) "Line 2 - Condition is true ") (data (;42;) (i32.const 336) "\58\01\00\00\1b\00\00\00") (data (;43;) (i32.const 344) "Line 2 - Condition is false ") (data (;44;) (i32.const 372) "\7c\01\00\00\1c\00\00\00") (data (;45;) (i32.const 380) "Line xor - Condition is true") (data (;46;) (i32.const 408) "\a0\01\00\00\1d\00\00\00") (data (;47;) (i32.const 416) "Line xor - Condition is false ") (data (;48;) (i32.const 448) "\c8\01\00\00\1a\00\00\00") (data (;49;) (i32.const 456) "Line 3 - Condition is true ") (data (;50;) (i32.const 484) "\ec\01\00\00\1b\00\00\00") (data (;51;) (i32.const 492) "Line 3 - Condition is false ") (data (;52;) (i32.const 520) "\10\02\00\00\1a\00\00\00") (data (;53;) (i32.const 528) "Line 4 - Condition is true ") (data (;54;) (i32.const 556) "\34\02\00\00\1b\00\00\00") (data (;55;) (i32.const 564) "Line 4 - Condition is false ") (data (;56;) (i32.const 592) "\58\02\00\00\1a\00\00\00") (data (;57;) (i32.const 600) "Line 5 - Condition is true ") (data (;58;) (i32.const 628) "\7c\02\00\00\1b\00\00\00") (data (;59;) (i32.const 636) "Line 5 - Condition is false ") (data (;60;) (i32.const 664) "\a0\02\00\00\1a\00\00\00") (data (;61;) (i32.const 672) "Line 6 - Condition is true ") (data (;62;) (i32.const 700) "\c4\02\00\00\1b\00\00\00") (data (;63;) (i32.const 708) "Line 6 - Condition is false ") (data (;64;) (i32.const 736) "\e8\02\00\00\1a\00\00\00") (data (;65;) (i32.const 744) "Line 7 - Condition is true ") (data (;66;) (i32.const 772) "\0c\03\00\00\1b\00\00\00") (data (;67;) (i32.const 780) "Line 7 - Condition is false ") (data (;68;) (i32.const 808) "\30\03\00\00\1e\00\00\00") (data (;69;) (i32.const 816) "Line 8 xor - Condition is true ") (data (;70;) (i32.const 848) "\58\03\00\00\1f\00\00\00") (data (;71;) (i32.const 856) "Line 8 xor - Condition is false ") ) lfortran-lfortran-2f73434/tests/reference/ast-fmt1-3196894.json0000664000175000017500000000070115141516316024125 0ustar alastairalastair{ "basename": "ast-fmt1-3196894", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fmt1.f90", "infile_hash": "cc416a9bdea43f7844e35c44673a53dda17f3037acfc76ddef6f7c48", "outfile": null, "outfile_hash": null, "stdout": "ast-fmt1-3196894.stdout", "stdout_hash": "dfa5deb7f2db1f1d78856e3a6b1bc68b92705643f3a3206dbdc1fc30", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_04-1710dbc.stdout0000664000175000017500000021341115141516316026751 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_04: (Program (SymbolTable 12 { add_t: (ExternalSymbol 12 add_t 2 add_t template_add_04_m [] add_t Public ), r: (ExternalSymbol 12 r 2 r template_add_04_m [] r Public ), test_template: (ExternalSymbol 12 test_template 2 test_template template_add_04_m [] test_template Public ) }) template_add_04 [template_add_04_m] [(SubroutineCall 12 test_template () [] () .false. )] ), template_add_04_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 7 lfortran_tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (Var 5 mult) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 7 lfortran_tmp) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. ) (Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 z)) ((Var 7 lfortran_tmp))] (TypeParameter t ) () () ) () .false. .false. )] [] )] (Var 7 z) Public .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), mult: (Variable 5 mult [] Unspecified () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f mult] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .false. .false. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .false. .false. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), add_real: (Function (SymbolTable 11 { i: (Variable 11 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 11 lfortran_tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. ) (DoLoop () ((Var 11 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (Var 10 n) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 11 lfortran_tmp) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 z)) ((Var 11 lfortran_tmp))] (Real 4) () () ) () .false. .false. )] [] )] (Var 11 z) Public .false. .false. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_04_m () [template_add_04_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-implicit_check-4f0391f.json0000664000175000017500000000073715141516316026363 0ustar alastairalastair{ "basename": "ast-implicit_check-4f0391f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/implicit_check.f90", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "ast-implicit_check-4f0391f.stdout", "stdout_hash": "cf1c71b539cc3253680fa426242e31cd3f34bdf3f01d96a66c479b21", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-where_02-95cf592.json0000664000175000017500000000074215141516316025033 0ustar alastairalastair{ "basename": "asr-where_02-95cf592", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_02.f90", "infile_hash": "d77bcdf887423550fb6073875746e6b4af104d344e645f7f3753eb1d", "outfile": null, "outfile_hash": null, "stdout": "asr-where_02-95cf592.stdout", "stdout_hash": "2abe1a757691cecbcc596d52ba50ab7c2ff9d027ce3dadf95f12ca39", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-parameter1-e3995e7.stdout0000664000175000017500000000526215141516316026042 0ustar alastairalastair(TranslationUnit [(Subroutine dcstep [] [] () () [] [] [] [(Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(zero [] [] () () None ()) (p66 [] [] () () None ()) (two [] [] () () None ()) (three [] [] () () None ()) (s [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(zero [] [] () (Real "0.0d0") Equal ()) (p66 [] [] () (Real "0.66d0") Equal ()) (two [] [] () (Real "2.0d0") Equal ()) (three [] [] () (Real "3.0d0") Equal ())] () )] [(Assignment 0 s (FuncCallOrArray max [] [(() (FuncCallOrArray abs [] [(() three () 0)] [] [] [] ) () 0) (() (FuncCallOrArray abs [] [(() two () 0)] [] [] [] ) () 0) (() (FuncCallOrArray abs [] [(() p66 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err5-38d12de.stderr0000664000175000017500000000016015141516316027774 0ustar alastairalastairC preprocessor error: Unknown token '@' --> tests/errors/cpp_err5.f90:2:9 | 2 | #if 1 + @ 1 2 | ^ lfortran-lfortran-2f73434/tests/reference/ast-fixedform_assignment-58b5a6f.stdout0000664000175000017500000000370215141516316030257 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ()) (k [] [] () () None ())] () )] [(Assignment 0 a 1 () ) (Assignment 0 b 2 () ) (Assignment 0 c (/ (* a b) 2) () ) (Assignment 0 d (* c c) () ) (Print 0 () [a b c d] () ) (DoLoop 0 () 80 k 1 20 () [(Print 0 () [1] () )] () () ) (If 120 () (< a b) [(Assignment 0 a (* 2 b) () )] [(Assignment 0 b (* 33 c) () )] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/tokens-esub1-3e8b16d.json0000664000175000017500000000072415141516316025223 0ustar alastairalastair{ "basename": "tokens-esub1-3e8b16d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/errors/esub1.f90", "infile_hash": "93b7d715c14f2da952a8945b7ea7b16817b269880b156f00497dd7b1", "outfile": null, "outfile_hash": null, "stdout": "tokens-esub1-3e8b16d.stdout", "stdout_hash": "e49e323dc4149a6e283aa7f33d649fd490c58f1f0f808ee0393a0fd0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_do_loops-doloop_04-749d5f0.json0000664000175000017500000000101115141516316027260 0ustar alastairalastair{ "basename": "pass_do_loops-doloop_04-749d5f0", "cmd": "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "pass_do_loops-doloop_04-749d5f0.stdout", "stdout_hash": "fca779048708a71448146c5673088b2d092fe29253b1b4270d19c32f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-string_allocation_01-8484aaf.stderr0000664000175000017500000000006215141516316030050 0ustar alastairalastairLFORTRAN ERROR: Allocating string with length < 0 lfortran-lfortran-2f73434/tests/reference/asr-expr_07-ec2c3a6.stdout0000664000175000017500000000463215141516316025377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_07: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (RealBinOp (RealConstant 3.300000 (Real 4) ) Add (RealConstant 6.000000 (Real 4) ) (Real 4) (RealConstant 9.300000 (Real 4) ) ) (RealConstant 9.300000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) expr_07 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-assign_to3-fc49dae.json0000664000175000017500000000075115141516316025704 0ustar alastairalastair{ "basename": "ast-assign_to3-fc49dae", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to3.f", "infile_hash": "cef165b367ac19491dbe0628a23d1843039e77602c05b5554ae12997", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to3-fc49dae.stdout", "stdout_hash": "9419113ae2af72c6d911bf4e43dd06834b22bb98ae2adedbb1d407aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_simple_continue-dbefb27.json0000664000175000017500000000101615141516316031221 0ustar alastairalastair{ "basename": "ast-fixed_form_simple_continue-dbefb27", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_simple_continue.f", "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_simple_continue-dbefb27.stdout", "stdout_hash": "690b52c1969a7aea7bb29205f6db65f4354052f63b85fcc81c1338f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-floor_01-9103fc5.json0000664000175000017500000000074215141516316025025 0ustar alastairalastair{ "basename": "asr-floor_01-9103fc5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/floor_01.f90", "infile_hash": "ded4fcdd43f2c9f513539d73012a5e98b5b699ec077aa53214a7c77f", "outfile": null, "outfile_hash": null, "stdout": "asr-floor_01-9103fc5.stdout", "stdout_hash": "8c1be0b77ea1a8c7e117d5ae3e4112ebcd7adb7da52413edf3669c6e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-case_01-929583e.json0000664000175000017500000000073715141516316024563 0ustar alastairalastair{ "basename": "ast-case_01-929583e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "ast-case_01-929583e.stdout", "stdout_hash": "d8110d26d6efba1a8d1b7d7ee0ae2c5bb42a1a824d883f080b33d08e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c_target_omp-openmp_70-377d35b.stdout0000664000175000017500000000405715141516316027446 0ustar alastairalastair#include #include #include #include #include #include struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; int32_t __libasr_index_0_1; struct r32 a_value; struct r32* a = &a_value; float a_data[1000000]; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 1000000; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float b_data[1000000]; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 1000000; b->dims[0].stride = 1; int32_t i; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[(0 + (1 * (__libasr_index_0_ - 1)))] = (float)(5); } for (__libasr_index_0_1=((int32_t)a->dims[1-1].lower_bound); __libasr_index_0_1<=((int32_t) a->dims[1-1].length + a->dims[1-1].lower_bound - 1); __libasr_index_0_1++) { a->data[(0 + (1 * (__libasr_index_0_1 - 1)))] = (float)(0); } #pragma omp target map(tofrom: a->data[1:1000000]) map(tofrom: b->data[1:1000000]) #pragma omp teams #pragma omp distribute parallel for for (i=1; i<=1000000; i++) { a->data[(0 + (1 * (i - 1)))] = (float)(i) + b->data[(0 + (1 * (i - 1)))]*(float)(340); } printf("%f%s%f\n", a->data[(0 + (1 * (5 - 1)))], " ", b->data[(0 + (1 * (5 - 1)))]); if (a->data[(0 + (1 * (5 - 1)))] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[(0 + (1 * (5 - 1)))] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-lfortran-2f73434/tests/reference/asr-subroutines_02-597f5e1.json0000664000175000017500000000076415141516316026306 0ustar alastairalastair{ "basename": "asr-subroutines_02-597f5e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_02-597f5e1.stdout", "stdout_hash": "4d5424862adb32b6e6ba0d834c65f7a5d11ee4169b64debaee2320d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-empty-7fa10d2.stdout0000664000175000017500000000003215141516316025157 0ustar alastairalastair(TranslationUnit [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutines_04-cc5f6a4.json0000664000175000017500000000076415141516316026440 0ustar alastairalastair{ "basename": "ast-subroutines_04-cc5f6a4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_04-cc5f6a4.stdout", "stdout_hash": "8167f4e8be92666208a33f67fc50e8bf10a53e0da6c50a8a004d2540", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-data_01-dc2d917.json0000664000175000017500000000073715141516316024706 0ustar alastairalastair{ "basename": "ast-data_01-dc2d917", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_01.f90", "infile_hash": "a6123c6637d7c6bbbc1715d75b768d90e42d66aac038b3dcb00d2fb5", "outfile": null, "outfile_hash": null, "stdout": "ast-data_01-dc2d917.stdout", "stdout_hash": "401bbe2eabae7a5738f93c528ad8405fb94837c795dd5a916521b42c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-abs_01-0c0b4df.json0000664000175000017500000000071715141516316024611 0ustar alastairalastair{ "basename": "wat-abs_01-0c0b4df", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/abs_01.f90", "infile_hash": "36697d1e0196bbf7a46059f539b539a1454386697ab54a43e3c32791", "outfile": null, "outfile_hash": null, "stdout": "wat-abs_01-0c0b4df.stdout", "stdout_hash": "8248725e8ec936bf20fa8d03eefeb9388691eeb3e69e746776adf1df", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_with_exit-0c669e6.json0000664000175000017500000000077415141516316027631 0ustar alastairalastair{ "basename": "ast-fixed_form_with_exit-0c669e6", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_with_exit.f", "infile_hash": "96d9aae99e4783183d44514eb3229ae1d1879847d4722d605ae687f6", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_with_exit-0c669e6.stdout", "stdout_hash": "438fb8012f29766becc2f526e72e71043772617a0ae5c81a28566eb8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-team1-f402eac.json0000664000175000017500000000071715141516316025227 0ustar alastairalastair{ "basename": "ast_f90-team1-f402eac", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/team1.f90", "infile_hash": "c7d57807d2f91911de8beb317405307221c403b50c6abdec58484b8b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-team1-f402eac.stdout", "stdout_hash": "7deb5f0a6d28fb6d9050ae9329cb75b57d169ba8671f27f26c2a2fb5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-string_02-604c7cc.stdout0000664000175000017500000000470715141516316025652 0ustar alastairalastair(TranslationUnit [(Program string_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 15 Value)] () () None ) [] [(surname [] [] () () None ()) (firstname [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 6 Value)] () () None ) [] [(title [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 25 Value)] () () None ) [] [(greetings [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 title (String "Mr. " ()) () ) (Assignment 0 firstname (String "Rowan " ()) () ) (Assignment 0 surname (String "Atkinson" ()) () ) (Assignment 0 greetings (String "A big hello from Mr. Bean" ()) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Here is " ()) title firstname surname] () ) (Print 0 () [greetings] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-associate_01-4a4ac5c.json0000664000175000017500000000110115141516316026001 0ustar alastairalastair{ "basename": "ast-associate_01-4a4ac5c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_01.f90", "infile_hash": "dfa888bac25c6dcaf279aff9ac639b37179290e3a36f9e784b31fb83", "outfile": null, "outfile_hash": null, "stdout": "ast-associate_01-4a4ac5c.stdout", "stdout_hash": "fd2342eeb6a8ff17df60131b3255242cb31dd647cc095b7250766cd2", "stderr": "ast-associate_01-4a4ac5c.stderr", "stderr_hash": "1f6e46d80cfcc70f0d91ed20562c4d7c39b2990b877e7de481e73a19", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop1-1d0df34.stdout0000664000175000017500000000022215141516316027257 0ustar alastairalastair1 12.8999996 2 12.8999996 1 1 12.8999996 2 12.8999996 12.8999996 2 1 12.8999996 2 12.8999996 12.8999996 lfortran-lfortran-2f73434/tests/reference/asr-show_errors1-cc473c3.json0000664000175000017500000000075515141516316026124 0ustar alastairalastair{ "basename": "asr-show_errors1-cc473c3", "cmd": "lfortran --show-errors --continue-compilation --no-color {infile}", "infile": "tests/errors/show_errors1.f90", "infile_hash": "8170b98a784b460b9353a740f0f117160e3070b0f88fd4d9c98ebcaf", "outfile": null, "outfile_hash": null, "stdout": "asr-show_errors1-cc473c3.stdout", "stdout_hash": "50cedac153912dd18ac3a537a71a116e7a0d5281129eb7a670fa62b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_23-a731033.json0000664000175000017500000000074515141516316025123 0ustar alastairalastair{ "basename": "asr-arrays_23-a731033", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_23.f90", "infile_hash": "c1df25817ea3eccb99df382b51ecfda76c3129aba44ff3492a1826d8", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_23-a731033.stdout", "stdout_hash": "74cbb67a40e3d9d15afb4b0728603f8c5be8424742f9ab62911ad5c6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine5-d00e190.json0000664000175000017500000000072615141516316025664 0ustar alastairalastair{ "basename": "ast-subroutine5-d00e190", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine5-d00e190.stdout", "stdout_hash": "38c6bd29d447610e449fb3b1ff443b85a7bcda7848256da55a01262d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-program1-5e4637e.stdout0000664000175000017500000000126215141516316025510 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; i = 5; std::cout << i << std::endl; std::cout << i + 1 << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/llvm-callback_02-41bc7d7.stdout0000664000175000017500000001651515141516316026265 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.res = internal global float 0.000000e+00 define void @__module_callback_02_cb(float* %res, float* %a, float* %b, void (float*, float*)* %f) { .entry: call void %f(float* %a, float* %res) %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, float* %res) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void %f(float* %b, float* %res) %11 = alloca i64, align 8 %12 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %11, i32 0, i32 0, float* %res) %13 = load i64, i64* %11, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %13, i64* %15, align 4 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %19 = load i64, i64* %18, align 4 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %12) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %22 = load float, float* %b, align 4 %23 = load float, float* %a, align 4 %24 = fsub float %22, %23 %25 = load float, float* %res, align 4 %26 = fmul float %24, %25 store float %26, float* %res, align 4 %27 = alloca i64, align 8 %28 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %27, i32 0, i32 0, float* %res) %29 = load i64, i64* %27, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %29, i64* %31, align 4 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %35 = load i64, i64* %34, align 4 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %28) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return ret void } declare void @f(float*, float*) define float @__module_callback_02_foo(float* %c, float* %d, float* %res) { .entry: %foo = alloca float, align 4 call void @__module_callback_02_cb(float* %res, float* %c, float* %d, void (float*, float*)* @foo.__module_callback_02_f) %0 = load float, float* %res, align 4 store float %0, float* %foo, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return %1 = load float, float* %foo, align 4 ret float %1 } define void @foo.__module_callback_02_f(float* %x, float* %res) { .entry: %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %res, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 %2 = call float @__module_callback_02_foo(float* %call_arg_value, float* %call_arg_value1, float* @main.res) store float %2, float* @main.res, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-save3-025da43.stdout0000664000175000017500000000377615141516316025000 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { var: (Variable 2 var [] Local (RealConstant 0.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-template_03b-6812e13.json0000664000175000017500000000075615141516316025611 0ustar alastairalastair{ "basename": "ast-template_03b-6812e13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03b.f90", "infile_hash": "4285fa6069fdc8872b08ca46688ab8168abfe0c468a57c65818deeb6", "outfile": null, "outfile_hash": null, "stdout": "ast-template_03b-6812e13.stdout", "stdout_hash": "1abad015875ea997cf0f18b87b2c0022fd1bff651de2bd856c92e466", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-scopes1-502009a.json0000664000175000017500000000071215141516316024664 0ustar alastairalastair{ "basename": "asr-scopes1-502009a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/scopes1.f90", "infile_hash": "48ffe7d9bb1021077b7bec62634ec2682cbfc211123626d338ba0c9e", "outfile": null, "outfile_hash": null, "stdout": "asr-scopes1-502009a.stdout", "stdout_hash": "e32965196ef6383b622eeeb7c5e33fdb1d09d6088e787c65f4849386", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external_02-ab2b90d.stdout0000664000175000017500000002635515141516316026241 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cobyla: (Function (SymbolTable 2 { calcfc: (Function (SymbolTable 7 { calcfc_arg_0: (Variable 7 calcfc_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), con: (Variable 7 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) calcfc (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 calcfc_arg_0)] [] () Public .false. .false. () ) }) cobyla (FunctionType [(FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cobylb] [(Var 2 calcfc)] [(SubroutineCall 1 cobylb () [((Var 2 calcfc))] () .false. ) (Return)] () Public .false. .false. () ), cobylb: (Function (SymbolTable 4 { calcfc: (Function (SymbolTable 6 { calcfc_arg_0: (Variable 6 calcfc_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), con: (Variable 6 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) calcfc (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 calcfc_arg_0)] [] () Public .false. .false. () ), con: (Variable 4 con [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) cobylb (FunctionType [(FunctionType [] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 calcfc)] [(SubroutineCall 4 calcfc () [((Var 4 con))] () .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-coarrays_01-2b1221b.json0000664000175000017500000000072615141516316025514 0ustar alastairalastair{ "basename": "ast-coarrays_01-2b1221b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/coarrays_01.f90", "infile_hash": "933ef6b85aed33b834bb7b03ae1f635e2b6e4fd18eb8ec999593251f", "outfile": null, "outfile_hash": null, "stdout": "ast-coarrays_01-2b1221b.stdout", "stdout_hash": "b2b13730276747e55d35e91410f84c6cf5852e03a309ab14642bf85f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops3-1dce8fd.json0000664000175000017500000000077515141516316027242 0ustar alastairalastair{ "basename": "asr-implied_do_loops3-1dce8fd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops3.f90", "infile_hash": "77a6a1521629dd10e76d0ea911c82c418bdf86f5c4f6d7b45e9e7d23", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops3-1dce8fd.stdout", "stdout_hash": "3181d1e78373c9b241091e2462eaa212c922f750bd64cc6b7f5ffeae", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.stderrlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_020000664000175000017500000000031315141516316034406 0ustar alastairalastairsemantic error: Shapes for operands are not conformable --> tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f90:4:14 | 4 | print *, x1 .neqv. x2 | ^^ ^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-array9-25daf13.json0000664000175000017500000000072215141516316025344 0ustar alastairalastair{ "basename": "ast_f90-array9-25daf13", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array9.f90", "infile_hash": "7107510b84a7e22f82d8f1f61617c399bc53b8a0fb59a5453419889c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array9-25daf13.stdout", "stdout_hash": "6486b5f54278b27b328aaac980f8684d357725453a07c4497ca55640", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-preprocess_01-20f7efb.stdout0000664000175000017500000000652515141516316026610 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocess_01: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocess_01 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 18 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Else condition" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 2 x) (IntegerConstant 30 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntegerConstant 10000 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor20-4100cdf.stdout0000664000175000017500000000366515141516316031170 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor20: (Program (SymbolTable 2 { }) preprocessor20 [] [(Print (StringFormat () [(StringConstant "PI: " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (RealConstant 3.140000 (Real 4) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "negative one: " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-do1-a0276c3.stdout0000664000175000017500000000166515141516316024442 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 2 () [(DoLoop 0 () 2 j 1 3 () [(DoLoop 0 () 2 k 1 4 () [(Continue 2 () )] () () )] () () ) (Continue 1 () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-coarrays_02-ea9dc2c.stdout0000664000175000017500000002042315141516316026321 0ustar alastairalastair(TranslationUnit [(Program coarrays_02 (TriviaNode [(EndOfLine) (Comment "! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541" )] [] ) [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [] .false. () )] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(node [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EOLComment "! tree nodes that this image handles." )] ) ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(nc [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! node(i) has nc(i) children." )] ) ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(parent [(() () DimensionExpr)] [] () () None ()) (sub [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! the parent of node (i) is node (sub (i)) [parent (i)]." )] ) ) (Declaration (AttrType TypeType [] () event_type None ) [(SimpleAttribute AttrAllocatable )] [(done [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (status [] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! set up the tree, including allocation of all arrays." )] ) )] [(DoLoop 0 () 0 i 1 (FuncCallOrArray size [] [(() node () 0)] [] [] [] ) () [(If 0 () (> (FuncCallOrArray nc [] [(() i () 0)] [] [] [] ) 0) [(EventWait 0 (FuncCallOrArray done [] [(() i () 0)] [] [] [] ) [(AttrEventWaitKwArg until_count (FuncCallOrArray nc [] [(() i () 0)] [] [] [] ) ) (AttrStat status )] () ) (If 0 () (/= status 0) [(Exit 0 () () )] [] () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! process node, using data from children." )] ) ) (If 0 () (> (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) 0) [(EventPost 0 (CoarrayRef done [] [(() (FuncCallOrArray sub [] [(() i () 0)] [] [] [] ) () 0)] [] [(() (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) () CodimensionExpr)] [] ) [(AttrStat status )] () ) (If 0 () (/= status 0) [(Exit 0 () () )] [] () () () )] [] (TriviaNode [] [(EndOfLine) (Comment "! node is not the root." ) (Comment "! place result on image parent (i) for node node (sub) [parent (i)]" ) (Comment "! tell parent (i) that this has been done." )] ) () () )] (TriviaNode [] [(EndOfLine) (Comment "! wait for children to complete" )] ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_02-3ebca53.stderr0000664000175000017500000000035315141516316030234 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'y'. Tried to match size 4 of dimension 1 of LHS with size 3 of dimension 1 of RHS. --> tests/errors/array_bounds_check_02.f90:11:9 | 11 | y = [1, 2, 3] | ^ lfortran-lfortran-2f73434/tests/reference/tokens-esub2-4cb444d.stderr0000664000175000017500000000017315141516316025550 0ustar alastairalastairtokenizer error: Token '~' is not recognized --> tests/errors/esub2.f90:3:5 | 3 | x = ~1 | ^ token not recognized lfortran-lfortran-2f73434/tests/reference/asr-complex_02-af31c89.json0000664000175000017500000000075015141516316025437 0ustar alastairalastair{ "basename": "asr-complex_02-af31c89", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_02.f90", "infile_hash": "c5e28327787e2c4dd5e42cc1c527749eb2e7b7f27623222a118f3bbe", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_02-af31c89.stdout", "stdout_hash": "f138734edcbf0255024277b5834e88cfde3172399764afe84fc65a5c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_select_case-case_07-90772d0.json0000664000175000017500000000101415141516316027253 0ustar alastairalastair{ "basename": "pass_select_case-case_07-90772d0", "cmd": "lfortran --pass=select_case --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_07.f90", "infile_hash": "d24e71ceb6ad09214f850e8c025c9e3c26ca3ba21ee2f94dae6d8fed", "outfile": null, "outfile_hash": null, "stdout": "pass_select_case-case_07-90772d0.stdout", "stdout_hash": "71e23c9c419c5af1b5ef679d906a0a7382a63cb8489fb193418b272a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_17-17c3d46.json0000664000175000017500000000077215141516316026565 0ustar alastairalastair{ "basename": "asr-derived_types_17-17c3d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_17.f90", "infile_hash": "28433c27ffce2fdaa063d1519081b83d3567a558abf87f26d64558dc", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_17-17c3d46.stdout", "stdout_hash": "939ec953439f6fdc1f79177ed0df763ccd3480925d544b2eb4ade9b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_external_dedup_01-94a5d6b.stdout0000664000175000017500000003420415141516316033464 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 6 { a: (Variable 6 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_external_dedup_01: (Program (SymbolTable 2 { outer: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (ExternalSymbol 3 a1 6 a __lcompilers_created__nested_context__outer_ [] a Public ), a2: (ExternalSymbol 3 a2 6 a __lcompilers_created__nested_context__outer_ [] a Public ), inner1: (Function (SymbolTable 4 { a: (ExternalSymbol 4 a 6 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 a) (IntegerBinOp (Var 4 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), inner2: (Function (SymbolTable 5 { a: (ExternalSymbol 5 a 6 a __lcompilers_created__nested_context__outer_ [] a Public ) }) inner2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (Var 5 a) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a1) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 a2) (Var 3 a) () .false. .false. ) (SubroutineCall 3 inner1 () [] () .false. ) (Assignment (Var 3 a) (Var 3 a2) () .false. .false. ) (Assignment (Var 3 a2) (Var 3 a) () .false. .false. ) (SubroutineCall 3 inner2 () [] () .false. ) (Assignment (Var 3 a) (Var 3 a2) () .false. .false. )] () Public .false. .false. () ) }) nested_external_dedup_01 [] [(SubroutineCall 2 outer () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor22-17078cd.stdout0000664000175000017500000000233015141516316031112 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor22: (Program (SymbolTable 2 { }) preprocessor22 [] [(Print (StringConstant "Both VAR1 and VAR2 are defined." (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "At least one of VAR3 or VAR4 is defined." (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Exactly one of VAR5 or VAR6 is not defined." (String 1 (IntegerConstant 43 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-array8-f50328f.json0000664000175000017500000000072215141516316025273 0ustar alastairalastair{ "basename": "ast_f90-array8-f50328f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array8.f90", "infile_hash": "fee5e1c1b4525cfa5f4eb3102cbdfdb2959403009df4a8920e8d1347", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array8-f50328f.stdout", "stdout_hash": "9dcbe3770b73ad4694a29832a42ae6f7afb5a9d740a1532d932ed0d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine6-b93ebd0.stdout0000664000175000017500000000236215141516316026375 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void triad(T0* a, T1* b, float scalar, T2* c); // Implementations template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t j; int32_t n; int32_t n2; n = a->data->extent(0); n2 = b->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); Kokkos::parallel_for(Kokkos::RangePolicy(1, n2+1), KOKKOS_LAMBDA(const long j) { c->data->operator[](j - c->dims[0].lower_bound) = b->data->operator[](j - b->dims[0].lower_bound) + scalar; }); } lfortran-lfortran-2f73434/tests/reference/cpp-intrinsics_02-707a51a.stdout0000664000175000017500000000313515141516316026432 0ustar alastairalastair#include #include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static float x=sin( 1.50000000000000000e+00); double y; y = sin( 1.50000000000000000e+00); std::cout << x << " " << y << std::endl; if (fabs(x - 9.97494995594024658e-01) > 9.99999997475242708e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(x) - 8.40114891529083252e-01) > 9.99999997475242708e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(y - 9.97494995594024658e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(sin( 1.50000000000000000e+00) + (sin( 5.00000000000000000e-01 + sin( 5.00000000000000000e-01)))) - 9.67188417911529541e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (fabs(sin(sin(y) + (sin(x + sin(x)))) - 9.72761869430541992e-01) > 1.00000001168609742e-07) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-iostat_constant_integer-4f6f5d4.json0000664000175000017500000000100115141516316030412 0ustar alastairalastair{ "basename": "asr-iostat_constant_integer-4f6f5d4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/iostat_constant_integer.f90", "infile_hash": "75139205f9e51e237d4b413809a7001dd54192e2c243a3523c0236a5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-iostat_constant_integer-4f6f5d4.stderr", "stderr_hash": "ac3a5c6e466d47baa24ef5636670716a1804de34604e5dccba05b530", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-complex_sub_test-7959339.stdout0000664000175000017500000001565715141516316027416 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %2 = load %complex_4, %complex_4* %x, align 1 %3 = extractvalue %complex_4 %2, 0 %4 = extractvalue %complex_4 %2, 1 %5 = fsub float %3, 4.000000e+00 %6 = fsub float %4, 0.000000e+00 %7 = insertvalue %complex_4 undef, float %5, 0 %8 = insertvalue %complex_4 %7, float %6, 1 store %complex_4 %8, %complex_4* %x, align 1 %9 = load %complex_4, %complex_4* %x, align 1 %10 = extractvalue %complex_4 %9, 0 %11 = extractvalue %complex_4 %9, 1 %12 = fsub float 4.000000e+00, %10 %13 = fsub float 0.000000e+00, %11 %14 = insertvalue %complex_4 undef, float %12, 0 %15 = insertvalue %complex_4 %14, float %13, 1 store %complex_4 %15, %complex_4* %x, align 1 %16 = alloca i64, align 8 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %16, i32 0, i32 0, %complex_4* %x) %18 = load i64, i64* %16, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %17) br label %free_done free_done: ; preds = %free_nonnull, %.entry %27 = load %complex_4, %complex_4* %x, align 1 %28 = extractvalue %complex_4 %27, 0 %29 = extractvalue %complex_4 %27, 1 %30 = fsub float 2.000000e+00, %28 %31 = fsub float 0.000000e+00, %29 %32 = insertvalue %complex_4 undef, float %30, 0 %33 = insertvalue %complex_4 %32, float %31, 1 store %complex_4 %33, %complex_4* %x, align 1 %34 = alloca i64, align 8 %35 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %34, i32 0, i32 0, %complex_4* %x) %36 = load i64, i64* %34, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %35, i8** %37, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %36, i64* %38, align 4 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %40 = load i8*, i8** %39, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %42 = load i64, i64* %41, align 4 %43 = trunc i64 %42 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %40, i32 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %44 = icmp eq i8* %35, null br i1 %44, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %35) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %45 = load %complex_4, %complex_4* %x, align 1 %46 = extractvalue %complex_4 %45, 0 %47 = extractvalue %complex_4 %45, 1 %48 = fsub float %46, 0.000000e+00 %49 = fsub float %47, 3.000000e+00 %50 = insertvalue %complex_4 undef, float %48, 0 %51 = insertvalue %complex_4 %50, float %49, 1 store %complex_4 %51, %complex_4* %x, align 1 %52 = alloca i64, align 8 %53 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %52, i32 0, i32 0, %complex_4* %x) %54 = load i64, i64* %52, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %55 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %53, i8** %55, align 8 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %54, i64* %56, align 4 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %58 = load i8*, i8** %57, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %60 = load i64, i64* %59, align 4 %61 = trunc i64 %60 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %58, i32 %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %62 = icmp eq i8* %53, null br i1 %62, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %53) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 call void @_lpython_free_argv() br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-format_11-72f8b07.json0000664000175000017500000000103515141516316025215 0ustar alastairalastair{ "basename": "run-format_11-72f8b07", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_11.f90", "infile_hash": "e4276cc9be24aab8d11f4bc561afa3976e52e3f6c67dabdea56d0ae4", "outfile": null, "outfile_hash": null, "stdout": "run-format_11-72f8b07.stdout", "stdout_hash": "bc9f4848ffec7802600469ec345f84973a1e3420535ac8c5d0fffddd", "stderr": "run-format_11-72f8b07.stderr", "stderr_hash": "9c63ade47f347b4c61353d2af6e780092daa84d287747e19ac89fdf9", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics12-16f1580.json0000664000175000017500000000074015141516316025652 0ustar alastairalastair{ "basename": "asr-intrinsics12-16f1580", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics12.f90", "infile_hash": "c9cc798e66e3f673e1047fb55c47dc10fbff936e0d1d1c8dcc62b11b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics12-16f1580.stderr", "stderr_hash": "29df00272486b11796ce5fbf13088c12dc5c67225fa566bef976fe0e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-if_04-7f1b69d.stderr0000664000175000017500000000023715141516316024730 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/if_04.f90:25:1 | 25 | endif name | ^^^^^ help: write this as 'end if' lfortran-lfortran-2f73434/tests/reference/ast-modules_02-ed49715.json0000664000175000017500000000075015141516316025366 0ustar alastairalastair{ "basename": "ast-modules_02-ed49715", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_02.f90", "infile_hash": "a52fdcb19f500c43afdd1fde1f90d5df8d34f2283a39704ab599a87c", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_02-ed49715.stdout", "stdout_hash": "92242308d096d2217f9fccf7a789dea9f4e60d97bc080dbc142f6b8e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-doloop_02-9fcb598.json0000664000175000017500000000075015141516316025464 0ustar alastairalastair{ "basename": "llvm-doloop_02-9fcb598", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_02-9fcb598.stdout", "stdout_hash": "0f0cd6d7e799cea658271f9d22d69951d12ffa61a7f31634256275c8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit10-23a5156.stderr0000664000175000017500000000071715141516316025627 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit10.f90:6:1 | 6 | real*8 :: g, h, i | ^^^^^^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit10.f90:8:1 | 8 | complex*8 :: l, m | ^^^^^^^^^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit10.f90:9:1 | 9 | complex *16 :: n | ^^^^^^^^^^^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/pass_insert_deallocate-finalize_01-3efebdd.stdout0000664000175000017500000005107515141516316032307 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { finalize_01: (Program (SymbolTable 5 { arr: (Variable 5 arr [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), internal_sub: (Function (SymbolTable 6 { arr_real: (Variable 6 arr_real [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), bl: (Block (SymbolTable 7 { arr_in_block: (Variable 7 arr_in_block [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bl [(Exit bl ) (Return)] ), str: (Variable 6 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) internal_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(BlockCall -1 6 bl ) (WhileLoop () (LogicalConstant .true. (Logical 4) ) [(Return)] [] )] () Public .false. .false. () ), ss: (ExternalSymbol 5 ss 2 ss finalize_01_mod [] ss Public ), str: (Variable 5 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), test_01: (ExternalSymbol 5 test_01 2 test_01 finalize_01_mod [] test_01 Public ) }) finalize_01 [finalize_01_mod] [(Allocate [((Var 5 str) [] (IntegerConstant 10 (Integer 4) Decimal) () ())] () () () ) (SubroutineCall 5 ss () [] () .false. ) (SubroutineCall 5 internal_sub () [] () .false. ) (Return)] ), finalize_01_mod: (Module (SymbolTable 2 { ss: (Function (SymbolTable 4 { arr: (Variable 4 arr [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) ss (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Allocate [((Var 4 arr) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] () () ())] () () () ) (If () (LogicalConstant .true. (Logical 4) ) [(Return)] [(Return)] )] () Public .false. .false. () ), test_01: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), str: (Variable 3 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_01 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Allocate [((Var 3 str) [] (IntegerConstant 10 (Integer 4) Decimal) () ())] () () () ) (Return) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Return)] [] )] () Public .false. .false. () ) }) finalize_01_mod () [] .false. .false. .false. ) }) [] ) ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.jsonlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000000123415141516316035005 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_37.f90", "infile_hash": "38f6c4643686768ff7e53fc236694c9de56c70b63a8b18bc70765a20", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.stdout", "stdout_hash": "f5b8e01f394e5ddb540329986b066db30a4efdba431f3f719ca792ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr5-3c9d655.stdout0000664000175000017500000000146015141516316025030 0ustar alastairalastair(TranslationUnit [(Program expr_05 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (* (+ 2 3) 5) () ) (If 0 () (== x 25) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/cpp-string_01-e28a827.json0000664000175000017500000000073015141516316025212 0ustar alastairalastair{ "basename": "cpp-string_01-e28a827", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "cpp-string_01-e28a827.stdout", "stdout_hash": "35a0e3a03b47f026b9e1d8219a96b2deeb8ee332bbae88c1f418746a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_06-78489bb.json0000664000175000017500000000073015141516316025220 0ustar alastairalastair{ "basename": "julia-expr_06-78489bb", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_06.f90", "infile_hash": "86c5ce938c64e34b4a0d0c0005ed174ab091a74089c4e28d87f55945", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_06-78489bb.stdout", "stdout_hash": "2ed657c315a9bd7fe376394fb43251634c6805d135d464da42d2218a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-const_real_dp-fa55d4d.json0000664000175000017500000000076115141516316026363 0ustar alastairalastair{ "basename": "asr-const_real_dp-fa55d4d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_real_dp.f90", "infile_hash": "636cd3c6b6c703b943b251bba6439b2675cd69fb82cd65a43513e971", "outfile": null, "outfile_hash": null, "stdout": "asr-const_real_dp-fa55d4d.stdout", "stdout_hash": "cdaaa24c060e2a9b111cb2aa45bfc143179b6582b66cea025c26add8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-expr5-00f7fd9.stdout0000664000175000017500000000270315141516316025271 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp eq i32 %2, 25 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_expr_05 FINALIZE_SYMTABLE_expr_05: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-assign_to1-a6b7599.stdout0000664000175000017500000000707715141516316026050 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) main [] [(GoToTarget 1000 1000 ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Assignment (Var 2 k) (IntegerConstant 15 (Integer 4) Decimal) () .false. .false. )] [] ) (GoToTarget 100 100 ) (Select () (Var 2 k) [(CaseStmt [(IntegerConstant 100 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. ) (CaseStmt [(IntegerConstant 1000 (Integer 4) Decimal)] [(GoTo 1000 1000 )] .false. ) (CaseStmt [(IntegerConstant 15 (Integer 4) Decimal)] [(GoTo 15 15 )] .false. )] [] .false. ) (GoToTarget 15 15 ) (Print (StringConstant "run" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor2-1db2235.json0000664000175000017500000000077015141516316030452 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor2-1db2235", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor2.f90", "infile_hash": "0ad5c1e9977ab80f0d8872a378aa0927023ce0b47360bfedeea09364", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor2-1db2235.stdout", "stdout_hash": "c1c78c68e04363ee8d849acf427f01a8ad6784fccf98532e5754442c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-nullify_01-24b8fbc.json0000664000175000017500000000075015141516316025527 0ustar alastairalastair{ "basename": "ast-nullify_01-24b8fbc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify_01-24b8fbc.stdout", "stdout_hash": "3151e82d536a6ad5b4eae1384c401db1ca05db8acddf071442b86dcb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_13-3345127.stdout0000664000175000017500000005604515141516316026135 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_scan_module: (Module (SymbolTable 2 { test_scan_intrinsic: (Function (SymbolTable 3 { }) test_scan_intrinsic (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringFindSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) test_scan_module () [] .false. .false. .false. ), test_scan_verify: (Program (SymbolTable 4 { test_scan_intrinsic: (ExternalSymbol 4 test_scan_intrinsic 2 test_scan_intrinsic test_scan_module [] test_scan_intrinsic Public ), test_verify_intrinsic: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_verify_intrinsic (FunctionType [] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ao" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "foo" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c++" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "fortran" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Assignment (Var 5 r) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] (Var 5 r) Public .false. .false. () ) }) test_scan_verify [test_scan_module] [(SubroutineCall 4 test_scan_intrinsic () [] () .false. ) (Print (StringFormat () [(FunctionCall 4 test_verify_intrinsic () [] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_05-5a73322.stdout0000664000175000017500000001307515141516316026552 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca float, align 4 store float 0x3FF2CD9FC0000000, float* %x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %x) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry store float 0x3FF8B07560000000, float* %x, align 4 %13 = alloca i64, align 8 %14 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, float* %x) %15 = load i64, i64* %13, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %15, i64* %17, align 4 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %21 = load i64, i64* %20, align 4 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %14) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store float 0x3FE85EFAC0000000, float* %x, align 4 %24 = alloca i64, align 8 %25 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %24, i32 0, i32 0, float* %x) %26 = load i64, i64* %24, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %25, i8** %27, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %26, i64* %28, align 4 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %30 = load i8*, i8** %29, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %32 = load i64, i64* %31, align 4 %33 = trunc i64 %32 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %30, i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %34 = icmp eq i8* %25, null br i1 %34, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %25) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 call void @_lpython_free_argv() br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_intrinsics_05 FINALIZE_SYMTABLE_intrinsics_05: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-else1-9f4f4b8.stdout0000664000175000017500000000702315141516316025063 0ustar alastairalastair(TranslationUnit [(Subroutine fun1 [] [] () () [] [] [] [] [(If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [] () () () ) (Assignment 0 elsecs (/ bjv1 f2) () )] [] [] ) (Subroutine fun2 [] [] () () [] [] [] [] [(If 0 () (Logical .true.) [(Assignment 0 x 1 () ) (If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [] () () () ) (Assignment 0 elsecs (/ bjv1 f2) () )] [] () () () )] [] [] ) (Subroutine fun3 [] [] () () [] [] [] [] [(If 0 () (Logical .true.) [(Assignment 0 x 1 () ) (If 0 () (> (FuncCallOrArray abs [] [(() bjv0 () 0)] [] [] [] ) (FuncCallOrArray abs [] [(() bjv1 () 0)] [] [] [] )) [(Assignment 0 cs (/ bjv0 f) () )] [(Assignment 0 cs (/ bjv1 f2) () )] () () () )] [] () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-global_scope9-f638dd0.json0000664000175000017500000000073415141516316026213 0ustar alastairalastair{ "basename": "asr-global_scope9-f638dd0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope9-f638dd0.stdout", "stdout_hash": "8c92748982b3013be23662e3b2d970430db5b94ee8fa0be80d3674bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-fn4-83c4d1a.json0000664000175000017500000000071115141516316024624 0ustar alastairalastair{ "basename": "ast_f90-fn4-83c4d1a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fn4.f90", "infile_hash": "35fb507c50c885547daa8eef3f01aa0be9b3eb6db98d824ad6f51bc9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fn4-83c4d1a.stdout", "stdout_hash": "d3a07020fcd3d38933f01299e50000f5eae3e32ee3f21beccbea58b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-data1-01ffd6c.json0000664000175000017500000000071715141516316025217 0ustar alastairalastair{ "basename": "ast_f90-data1-01ffd6c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/data1.f90", "infile_hash": "958a14b00f4c624f5f8c444b2e93bcf090a57ee3c44143ec6671b5f6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-data1-01ffd6c.stdout", "stdout_hash": "21627f18756312556e43b286cdd1671677c03e63cdf6be55e0c5926c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-read1-a5fe5d5.stdout0000664000175000017500000000047515141516316025600 0ustar alastairalastairprogram read1 ! AST only tests read(*, *) a, b read(unit=*, fmt=*) a, b read(*, fmt=*) a, b read(*) b read(zone(1:3), "(i3)") hour read(u) b read(u, fmt=x) b, c, e read(*, fmt=x) b, c, e read(iunit, NML=invar, IOSTAT=ierr) read(UNIT=iunit, NML=invar, IOSTAT=ierr) read 10 read 10, A, B read *, size end program read1 lfortran-lfortran-2f73434/tests/reference/llvm-string_02-c37e098.stdout0000664000175000017500000002343415141516316025764 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [4 x i8] c"Mr. " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @string_const_data.1 = private constant [6 x i8] c"Rowan " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.1, i32 0, i32 0), i64 6 }> @string_const_data.3 = private constant [8 x i8] c"Atkinson" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.3, i32 0, i32 0), i64 8 }> @string_const_data.5 = private constant [25 x i8] c"A big hello from Mr. Bean" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([25 x i8], [25 x i8]* @string_const_data.5, i32 0, i32 0), i64 25 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [38 x i8] c"S-DESC-8,S-DESC-6,S-DESC-15,S-DESC-15\00", align 1 @string_const_data.7 = private constant [8 x i8] c"Here is " @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.7, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %firstname = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %firstname, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1 store i64 15, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 15) store i8* %4, i8** %3, align 8 %greetings = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %greetings, align 1 %5 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1 store i64 25, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %7 = call i8* @_lfortran_malloc(i64 25) store i8* %7, i8** %6, align 8 %surname = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %surname, align 1 %8 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1 store i64 15, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %10 = call i8* @_lfortran_malloc(i64 15) store i8* %10, i8** %9, align 8 %title = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 store i64 6, i64* %11, align 4 %12 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %13 = call i8* @_lfortran_malloc(i64 6) store i8* %13, i8** %12, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %15 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %14, i64* %15, i8 0, i8 0, i8* %16, i64 4) %17 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %18 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1 %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %17, i64* %18, i8 0, i8 0, i8* %19, i64 6) %20 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %21 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1 %22 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %20, i64* %21, i8 0, i8 0, i8* %22, i64 8) %23 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %24 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1 %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %23, i64* %24, i8 0, i8 0, i8* %25, i64 25) %26 = alloca i64, align 8 %27 = load %string_descriptor, %string_descriptor* %title, align 1 %28 = alloca %string_descriptor, align 8 store %string_descriptor %27, %string_descriptor* %28, align 1 %29 = load %string_descriptor, %string_descriptor* %firstname, align 1 %30 = alloca %string_descriptor, align 8 store %string_descriptor %29, %string_descriptor* %30, align 1 %31 = load %string_descriptor, %string_descriptor* %surname, align 1 %32 = alloca %string_descriptor, align 8 store %string_descriptor %31, %string_descriptor* %32, align 1 %33 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @serialization_info, i32 0, i32 0), i64* %26, i32 0, i32 0, %string_descriptor* @string_const.8, %string_descriptor* %28, %string_descriptor* %30, %string_descriptor* %32) %34 = load i64, i64* %26, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %33, i8** %35, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %34, i64* %36, align 4 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %40 = load i64, i64* %39, align 4 %41 = trunc i64 %40 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %38, i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %42 = icmp eq i8* %33, null br i1 %42, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %33) br label %free_done free_done: ; preds = %free_nonnull, %.entry %43 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %44, i32 25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_string_02 FINALIZE_SYMTABLE_string_02: ; preds = %return br label %Finalize_Variable_firstname Finalize_Variable_firstname: ; preds = %FINALIZE_SYMTABLE_string_02 %45 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0 %46 = load i8*, i8** %45, align 8 %47 = icmp eq i8* %46, null br i1 %47, label %free_done2, label %free_nonnull1 free_nonnull1: ; preds = %Finalize_Variable_firstname call void @_lfortran_free(i8* %46) br label %free_done2 free_done2: ; preds = %free_nonnull1, %Finalize_Variable_firstname br label %Finalize_Variable_greetings Finalize_Variable_greetings: ; preds = %free_done2 %48 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0 %49 = load i8*, i8** %48, align 8 %50 = icmp eq i8* %49, null br i1 %50, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %Finalize_Variable_greetings call void @_lfortran_free(i8* %49) br label %free_done4 free_done4: ; preds = %free_nonnull3, %Finalize_Variable_greetings br label %Finalize_Variable_surname Finalize_Variable_surname: ; preds = %free_done4 %51 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0 %52 = load i8*, i8** %51, align 8 %53 = icmp eq i8* %52, null br i1 %53, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %Finalize_Variable_surname call void @_lfortran_free(i8* %52) br label %free_done6 free_done6: ; preds = %free_nonnull5, %Finalize_Variable_surname br label %Finalize_Variable_title Finalize_Variable_title: ; preds = %free_done6 %54 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %55 = load i8*, i8** %54, align 8 %56 = icmp eq i8* %55, null br i1 %56, label %free_done8, label %free_nonnull7 free_nonnull7: ; preds = %Finalize_Variable_title call void @_lfortran_free(i8* %55) br label %free_done8 free_done8: ; preds = %free_nonnull7, %Finalize_Variable_title ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-func_arg_array-609769c.json0000664000175000017500000000074615141516316026327 0ustar alastairalastair{ "basename": "asr-func_arg_array-609769c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/func_arg_array.f90", "infile_hash": "585115ceaab8814376b2532bf714e97b7bfe97787c158d257d79b778", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-func_arg_array-609769c.stderr", "stderr_hash": "1c2ceda2d3debb6eeca06ba8de41d75291e63259a93986ffeae8b60a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-assign1-9565114.stdout0000664000175000017500000000031115141516316025160 0ustar alastairalastair(TranslationUnit [(Program assign1 () [] [] [] [(Assign 10 30 next () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-ishftc_size-1254b50.json0000664000175000017500000000073515141516316025630 0ustar alastairalastair{ "basename": "asr-ishftc_size-1254b50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ishftc_size.f90", "infile_hash": "5765a2202b476e6d0522df41163ba488707e3b506dd4870c1b0eb7b4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ishftc_size-1254b50.stderr", "stderr_hash": "9ce5eb1db3c8a9c92204d2bd13f6466f06e862c1b75c29dfe981a7d2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-interface2-98c9adf.json0000664000175000017500000000072315141516316025604 0ustar alastairalastair{ "basename": "ast-interface2-98c9adf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface2.f90", "infile_hash": "708e539c3b559554e522379a3dd84fbbef89eb01ea66bf9ded4a5fcb", "outfile": null, "outfile_hash": null, "stdout": "ast-interface2-98c9adf.stdout", "stdout_hash": "99b25f11bb30c1682ee9de59c3f1a104a40540dcb55bd25ad90b9c1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_32-b407b58.stdout0000664000175000017500000000036515141516316025572 0ustar alastairalastair0.33333E-99 ********* .33333E-99 0.33333E-99 0.33333E-99 0.33333E-99 0.30000E+201 ********* .30000+201 0.30000+201 0.30000+201 0.30000+201 0.33333E-200 ********* .33333-200 0.33333-200 0.33333-200 0.33333-200 ****** 3.00E+20 ********* lfortran-lfortran-2f73434/tests/reference/llvm-execute_command_line-0e9cd63.json0000664000175000017500000000076415141516316030027 0ustar alastairalastair{ "basename": "llvm-execute_command_line-0e9cd63", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/execute_command_line.f90", "infile_hash": "7a0db461a1008c62034590b9709aea78a170f8cfe3b3d9181dddee66", "outfile": null, "outfile_hash": null, "stdout": "llvm-execute_command_line-0e9cd63.stdout", "stdout_hash": "77a11bb89effe5460c6e08ed4d6034ddf3c3cc2a5287821317fc21c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_40-d3a41b5.stdout0000664000175000017500000006724715141516316026016 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_40: (Program (SymbolTable 8 { }) modules_40 [] [(Print (StringConstant "executing modules_40" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_40_tomlf_de_tokenizer: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 5 { de: (Variable 5 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. ), fill_stack: (Function (SymbolTable 6 { de: (Variable 6 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. ), stack: (Variable 6 stack [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), top: (Variable 6 top [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fill_stack (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [resize] [(Var 6 de) (Var 6 top) (Var 6 stack)] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (IntegerCompare (Var 6 top) GtE (ArraySize (Var 6 stack) () (Integer 4) () ) (Logical 4) () ) [(SubroutineCall 5 resize () [((Var 6 stack)) (())] () .false. )] [] )] [] )] () Public .false. .false. () ), resize: (Function (SymbolTable 7 { n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), stack: (Variable 7 stack [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ) }) resize (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 stack) (Var 7 n)] [] () Public .false. .false. () ) }) parse_select (FunctionType [(StructType [] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 de)] [] () Public .false. .false. () ), tfc: (Variable 2 tfc [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () ), toml_tokenizer: (Struct (SymbolTable 4 { parse_select: (StructMethodDeclaration 4 parse_select () parse_select 2 parse_select Source .false. .false. ) }) toml_tokenizer (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () ) }) modules_40_tomlf_de_tokenizer () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_int-3ed778d.stderr0000664000175000017500000000022415141516316027340 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_int.f90:3:13 | 3 | integer(*) a | ^ lfortran-lfortran-2f73434/tests/reference/ast_f90-fmt1-c767956.stdout0000664000175000017500000000100115141516316025231 0ustar alastairalastairreal(c_float) :: r real(c_float) :: r character(kind=c_char) :: c character(len=*) :: c character(len=*) :: c character(len=*, kind=c_char) :: c character(len=*, kind=c_char) :: c character(len=*, kind=c_char) :: c character(len=:) :: c character(len=:) :: c character(len=:, kind=c_char) :: c character(len=:, kind=c_char) :: c character(len=:, kind=c_char) :: c character(len=n) :: c character(len=n) :: c character(len=n, kind=c_char) :: c character(len=n, kind=c_char) :: c character(len=n, kind=c_char) :: c lfortran-lfortran-2f73434/tests/reference/run-format_58-475e064.stdout0000664000175000017500000000034615141516316025524 0ustar alastairalastairkind name sp dp ep kind: 4 8 8 epsilon: 1.19E-0007 2.22E-0016 2.22E-0016 tiny: 1.18E-0038 2.23E-0308 2.23E-0308 huge: 3.40E+0038 1.80E+0308 1.80E+0308 lfortran-lfortran-2f73434/tests/reference/ast-data_02-fe19614.stdout0000664000175000017500000002751015141516316025200 0ustar alastairalastair(TranslationUnit [(Program data2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (iarx [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ()) (iary [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [j] [5] )] () ) (Print 0 () [(String "1" ()) j] () ) (If 0 () (Logical .true.) [(Print 0 () [(String "2" ())] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 1 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 1) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 1 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 9) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 2 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 2 () 0) (() 1 () 0)] [] [] [] ) 1950) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 2 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 2 () 0) (() 1 () 0)] [] [] [] ) 1350) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iarx [] [(() 3 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iarx [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) 4350) [(ErrorStop 0 () () () )] [] () () () ) (Print 0 () [(FuncCallOrArray iary [] [(() 3 () 0) (() 1 () 0)] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray iary [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) 4) [(ErrorStop 0 () () () )] [] () () () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(String "3" ())] () )] () () () ) (Print 0 () [(String "4" ())] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950] )] () ) (Print 0 () [(String "5" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_04-2e3d8fb.json0000664000175000017500000000074315141516316027717 0ustar alastairalastair{ "basename": "run-array_bounds_check_04-2e3d8fb", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_04.f90", "infile_hash": "daa672fe4c03715eb861e1221cb21768fb0b297213ccbe906ea2871c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_04-2e3d8fb.stderr", "stderr_hash": "30aa52449ac7727852e82f05e4035b6cb360bc67a9e00aab4bd8bc1b", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-const_kind_02-7c339b9.json0000664000175000017500000000076115141516316026052 0ustar alastairalastair{ "basename": "asr-const_kind_02-7c339b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_kind_02.f90", "infile_hash": "34f9ee65cf6d3992d028dd2cb7b90c3150acc9bdc0c9d0f6cbdfb6ab", "outfile": null, "outfile_hash": null, "stdout": "asr-const_kind_02-7c339b9.stdout", "stdout_hash": "cca95f494ce6f68b07a96e854c7fb59cbe5c46528c9129228a5f3cf9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-legacy_array_sections_01-2515c0f.stdout0000664000175000017500000002657715141516316031024 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @1 = private unnamed_addr constant [191 x i8] c"At 5:8 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @3 = private unnamed_addr constant [192 x i8] c"At 18:1 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [215 x i8] c"At 19:8 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [5 x i8] c"[R8]\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @9 = private unnamed_addr constant [192 x i8] c"At 21:9 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @13 = private unnamed_addr constant [192 x i8] c"At 22:9 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @a(double* %w) { .entry: %icon = alloca i32, align 4 store i32 2, i32* %icon, align 4 %0 = load i32, i32* %icon, align 4 %1 = sub i32 %0, 1 %2 = mul i32 1, %1 %3 = add i32 0, %2 %4 = icmp slt i32 %0, 1 %5 = icmp sgt i32 %0, 5 %6 = or i1 %4, %5 br i1 %6, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 %0, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %7 = getelementptr inbounds double, double* %w, i32 %3 call void @b(double* %7) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %ifcont br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } define void @b(double* %con) { .entry: %0 = getelementptr inbounds double, double* %con, i32 3 store double -4.830000e+00, double* %0, align 8 %1 = getelementptr inbounds double, double* %con, i32 2 store double 3.140000e+00, double* %1, align 8 br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) define i32 @main(i32 %0, i8** %1) { .entry: %array_bound1 = alloca i32, align 4 %array_bound = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__libasr_index_0_ = alloca i32, align 4 %w = alloca [5 x double], align 8 br i1 true, label %then, label %else then: ; preds = %.entry store i32 1, i32* %array_bound, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %2 = load i32, i32* %array_bound, align 4 %3 = sub i32 %2, 1 store i32 %3, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont6, %ifcont %4 = load i32, i32* %__libasr_index_0_, align 4 %5 = add i32 %4, 1 br i1 true, label %then2, label %else3 then2: ; preds = %loop.head store i32 5, i32* %array_bound1, align 4 br label %ifcont4 else3: ; preds = %loop.head br label %ifcont4 ifcont4: ; preds = %else3, %then2 %6 = load i32, i32* %array_bound1, align 4 %7 = icmp sle i32 %5, %6 br i1 %7, label %loop.body, label %loop.end loop.body: ; preds = %ifcont4 %8 = load i32, i32* %__libasr_index_0_, align 4 %9 = add i32 %8, 1 store i32 %9, i32* %__libasr_index_0_, align 4 %10 = load i32, i32* %__libasr_index_0_, align 4 %11 = sub i32 %10, 1 %12 = mul i32 1, %11 %13 = add i32 0, %12 %14 = icmp slt i32 %10, 1 %15 = icmp sgt i32 %10, 5 %16 = or i1 %14, %15 br i1 %16, label %then5, label %ifcont6 then5: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 %10, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.body %17 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 %13 store double 1.390000e+00, double* %17, align 8 br label %loop.head loop.end: ; preds = %ifcont4 br i1 false, label %then7, label %ifcont8 then7: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([215 x i8], [215 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 5, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont8: ; preds = %loop.end %18 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0 call void @a(double* %18) %19 = alloca i64, align 8 %20 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0 %21 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @serialization_info, i32 0, i32 0), i64* %19, i32 1, i32 0, i64 5, double* %20) %22 = load i64, i64* %19, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %21, i8** %23, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %22, i64* %24, align 4 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %26 = load i8*, i8** %25, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %28 = load i64, i64* %27, align 4 %29 = trunc i64 %28 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %26, i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %30 = icmp eq i8* %21, null br i1 %30, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont8 call void @_lfortran_free(i8* %21) br label %free_done free_done: ; preds = %free_nonnull, %ifcont8 br i1 false, label %then9, label %ifcont10 then9: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 5, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont10: ; preds = %free_done %31 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 4 %32 = load double, double* %31, align 8 %33 = fsub double %32, -4.830000e+00 %34 = call double @llvm.fabs.f64(double %33) %35 = fcmp ogt double %34, 1.000000e-08 br i1 %35, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 br i1 false, label %then14, label %ifcont15 then14: ; preds = %ifcont13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 4, i32 1, i32 1, i32 5) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %36 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 3 %37 = load double, double* %36, align 8 %38 = fsub double %37, 3.140000e+00 %39 = call double @llvm.fabs.f64(double %38) %40 = fcmp ogt double %39, 1.000000e-10 br i1 %40, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont18 br label %FINALIZE_SYMTABLE_legacy_array_sections_01 FINALIZE_SYMTABLE_legacy_array_sections_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/asr-implicit4-704272e.stderr0000664000175000017500000000024315141516316025550 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit4.f90:2:15 | 2 | implicit real *8 (a-h,o-z) | ^ help: write this as 'real(8)' lfortran-lfortran-2f73434/tests/reference/asr-intrinsics2-68bbd81.json0000664000175000017500000000073515141516316025741 0ustar alastairalastair{ "basename": "asr-intrinsics2-68bbd81", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics2.f90", "infile_hash": "18272eb7d4e7827d39741404a0836223588b55b664a5f942dbe32bc8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics2-68bbd81.stderr", "stderr_hash": "9e1ca345c4d17cce3276faba38665c173144e3509b768eed5c3ebf92", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/cpp-do_concurrent_reduce-373b02e.json0000664000175000017500000000074415141516316027571 0ustar alastairalastair{ "basename": "cpp-do_concurrent_reduce-373b02e", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "cpp-do_concurrent_reduce-373b02e.stdout", "stdout_hash": "1c4394e166dc4bdd6b8f8af01fcf008a75fbeaa37aa849cd762d4e57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine3b-98faad7.json0000664000175000017500000000073115141516316026201 0ustar alastairalastair{ "basename": "ast-subroutine3b-98faad7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine3b.f90", "infile_hash": "0726b3cb8b3ba1a2fc624a4215146065a6ce9a6a0b460ebe40c172a5", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine3b-98faad7.stdout", "stdout_hash": "9871ce47e692f7a9d3f9f9effc38643f3e9c812b5fdfc430c711e1cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sole_intrinsic-3e826bd.stdout0000664000175000017500000001250115141516316027060 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { f: (Variable 2 f [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant -3.000000 (Real 4) ) ) (Complex 4) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) ) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (Var 2 f) (IntrinsicElementalFunction Cmplx [(IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) (ComplexConstant 3.000000 1.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 y) (IntrinsicElementalFunction Aimag [(Var 2 x)] 0 (Real 4) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor13-d951787.stdout0000664000175000017500000000737515141516316031063 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __xx_main: (Program (SymbolTable 2 { }) __xx_main [] [(Print (StringConstant "1 LFortran" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "3 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "4 LFortran 1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "42 LFortran 1" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1 Y is 1" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2 Y is 3" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "4 Y is 4" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 1-4" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "5 Y is not 1-4" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-interface_12-2e5ecb8.stdout0000664000175000017500000000213515141516316026545 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define void @find_fit(void ([1 x float]*)* %expr) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_find_fit FINALIZE_SYMTABLE_find_fit: ; preds = %return ret void } declare void @expr([1 x float]*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @find_fit(void ([1 x float]*)* @expression) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } define void @expression([1 x float]* %y) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_expression FINALIZE_SYMTABLE_expression: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp1-515bcd9.stderr0000664000175000017500000000024015141516316027121 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp1.f90:7:13 | 7 | print *, x, X123, y | ^^^^ 'z12345678' is undeclared lfortran-lfortran-2f73434/tests/reference/ast_f90-builtin1-21cf43e.json0000664000175000017500000000073015141516316025665 0ustar alastairalastair{ "basename": "ast_f90-builtin1-21cf43e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/builtin1.f90", "infile_hash": "8c200e5b6fa38354dabbf5be7d12f548fa4e99f58ac9225f50a77c8c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-builtin1-21cf43e.stdout", "stdout_hash": "7e50fe4824f4e910384c6c74c415f40dfbf6dc1d4fe89d0064499730", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-template_struct_01-f11e745.json0000664000175000017500000000100015141516316027113 0ustar alastairalastair{ "basename": "ast-template_struct_01-f11e745", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_struct_01.f90", "infile_hash": "f66f5d6abfb085636af3a1f278953ef2297f93f3a209002272e6d1f8", "outfile": null, "outfile_hash": null, "stdout": "ast-template_struct_01-f11e745.stdout", "stdout_hash": "c7e7f1e79dcb60b6a81cfaef5f9af653c36455b4b37c4bc73fd8a77b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name3-a06a374.stdout0000664000175000017500000000026415141516316030067 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":40,"line":2},"end":{"character":41,"line":2}},"uri":"tests/lookup_name3.f90"},"name":"ec","filename":"tests/lookup_name3.f90"}]lfortran-lfortran-2f73434/tests/reference/asr-derived_types_10-526e3f4.stdout0000664000175000017500000011462515141516316027135 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { my_module: (Module (SymbolTable 2 { finalize: (Function (SymbolTable 5 { self: (Variable 5 self [] InOut () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) finalize (FunctionType [(StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self)] [] () Public .false. .false. () ), my_super_type: (Struct (SymbolTable 3 { x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_super_type (StructType [(Integer 4)] [] .true. .false. ) [] [x] [] Source Public .false. .false. [] () () ), my_type: (Struct (SymbolTable 4 { g_proc: (GenericProcedure 4 g_proc [4 plus 4 unary] Public ), plus: (StructMethodDeclaration 4 plus () plus 2 plus Source .false. .false. ), proc: (StructMethodDeclaration 4 proc () print_something 2 print_something Source .false. .false. ), super: (Variable 4 super [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 my_super_type Source Public Required .false. .false. .false. () .false. .false. ), unary: (StructMethodDeclaration 4 unary () unary 2 unary Source .false. .false. ), x: (Variable 4 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 4 ~add [4 unary 4 plus] Public ) }) my_type (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) [my_super_type] [x super] [] Source Public .false. .false. [] () () ), plus: (Function (SymbolTable 9 { plus: (Variable 9 plus [] ReturnVar () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 9 self [] In () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. )] (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 9 self)] [] (Var 9 plus) Public .false. .false. () ), print_something: (Function (SymbolTable 6 { self: (Variable 6 self [] InOut () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), str: (Variable 6 str [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_something (FunctionType [(StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 str)] [(Print (Var 6 str) )] () Public .false. .false. () ), say_something: (Function (SymbolTable 7 { msg: (Variable 7 msg [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 7 self [] InOut () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) say_something (FunctionType [(StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self) (Var 7 msg)] [(Print (Var 7 msg) )] () Public .false. .false. () ), unary: (Function (SymbolTable 8 { self: (Variable 8 self [] In () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), unary: (Variable 8 unary [] ReturnVar () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) unary (FunctionType [(StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. ) (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .false. .false. )] (StructType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 self) (Var 8 x)] [] (Var 8 unary) Public .false. .false. () ) }) my_module () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-assign_to1-09e061a.json0000664000175000017500000000075015141516316025447 0ustar alastairalastair{ "basename": "ast-assign_to1-09e061a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to1.f90", "infile_hash": "a8a83c753ee6f6e22b44441dbf0e5d8e7f180ca811bcbe45e810b869", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to1-09e061a.stdout", "stdout_hash": "28352d183ead36b8ad9ad210d30041867d24b98f61f5b89f0813f6ad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_54-2dbd7b1.json0000664000175000017500000000074515141516316025360 0ustar alastairalastair{ "basename": "asr-string_54-2dbd7b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_54.f90", "infile_hash": "ac362ebe23bff5072f61252724ef01399d95e4783cbf9330a49acf86", "outfile": null, "outfile_hash": null, "stdout": "asr-string_54-2dbd7b1.stdout", "stdout_hash": "54bbe94919cb9b2d34bfe126747960a0f2233b318636207458162b7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-reserved_02-a00a6f2.stdout0000664000175000017500000000037015141516316026617 0ustar alastairalastairprogram reserved_02 implicit none if (integer() /= 1) then error stop end if contains integer function integer() integer :: function function = 5 function = function/function integer = function end function integer end program reserved_02 lfortran-lfortran-2f73434/tests/reference/run-format1-04216cf.json0000664000175000017500000000066215141516316024770 0ustar alastairalastair{ "basename": "run-format1-04216cf", "cmd": "lfortran --no-color {infile}", "infile": "tests/format1.f90", "infile_hash": "fa70c35913626736c8443dee08f1e2c9c39523470d040297c1e59259", "outfile": null, "outfile_hash": null, "stdout": "run-format1-04216cf.stdout", "stdout_hash": "e0a9db0126a3a86797227c856af06e1f2434bca3d65a767dce4bbad3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_04-90da47c.stderr0000664000175000017500000000030515141516316027200 0ustar alastairalastairsemantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 3 --> tests/errors/matrix_matmul_04.f90:5:21 | 5 | print *, matmul(a, b) | ^ lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope4-2d4061d.json0000664000175000017500000000101415141516316031037 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope4-2d4061d", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope4-2d4061d.stdout", "stdout_hash": "f570f7768c8cbfe084e5928747d564e1390221dc5db3e0e10ebb68c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07b-d39ea05.stderr0000664000175000017500000000034015141516316027504 0ustar alastairalastairwarning: Parameter combine is unused in semigroup --> tests/errors/template_error_07b.f90:6:5 - 9:1 | 6 | requirement semigroup(t, combine) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 9 | | ...^ lfortran-lfortran-2f73434/tests/reference/ast-array5-2cde105.stdout0000664000175000017500000000475015141516316025236 0ustar alastairalastair(TranslationUnit [(Program array5 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(e [(1 0 DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 b (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 c (ArrayInitializer (AttrType TypeReal [] () () None ) () [1 2 3] ) () ) (Assignment 0 e (ArrayInitializer (AttrType TypeReal [] () () None ) () [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop-d9fb32d.stdout0000664000175000017500000000343015141516316027456 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ()) (l [] [] () () None ()) (m [] [] () () None ()) (n [] [] () () None ())] () )] [(DoLoop 0 () 0 k 1 10 () [(Print 0 () [k] () )] () () ) (DoLoop 0 () 80 l 1 10 () [(Print 0 () [l] () )] () () ) (DoLoop 0 () 800 m 1 10 () [(Print 0 () [m] () )] () () ) (DoLoop 0 () 8000 n 1 10 () [(Print 0 () [n] () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-fn_call1-7e6ba0b.stdout0000664000175000017500000000601115141516316025565 0ustar alastairalastair(TranslationUnit [(FuncCallOrArray size [] [(() tvec () 0)] [(dim 2)] [] [] ) (FuncCallOrArray min [] [(() (FuncCallOrArray tvec [] [(() 2 () 0) (() i () 0)] [] [] [] ) () 0) (() (FuncCallOrArray tvec [] [(() 1 () 0) (() i () 0)] [] [] [] ) () 0)] [] [] [] ) (FuncCallOrArray a [] [(() 1 () 0) (() 2 () 0) (() 3 () 0)] [] [] [] ) (FuncCallOrArray f [] [(() a () 0) (() b () 0)] [(d (/ 5 2)) (c (+ 3 3))] [] [] ) (FuncCallOrArray A [] [(() i () 0) (() j () 0) (() k () 0)] [] [] [] ) (FuncCallOrArray X [] [(() i () 0)] [] [] [] ) (FuncCallOrArray X [] [(() () 1 0)] [] [] [] ) (FuncCallOrArray X [] [(a () 1 0)] [] [] [] ) (FuncCallOrArray X [] [(() b 1 0)] [] [] [] ) (FuncCallOrArray X [] [(a b 1 0)] [] [] [] ) (FuncCallOrArray X [] [(() () c 0)] [] [] [] ) (FuncCallOrArray X [] [(() () c 0)] [] [] [] ) (FuncCallOrArray X [] [(a () c 0)] [] [] [] ) (FuncCallOrArray X [] [(a () c 0)] [] [] [] ) (FuncCallOrArray X [] [(() b c 0)] [] [] [] ) (FuncCallOrArray X [] [(a b c 0)] [] [] [] ) (FuncCallOrArray X [] [(a b 1 0) (() () c 0) (a () 1 0) (a () c 0)] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-esub2-248f0df.json0000664000175000017500000000071315141516316024507 0ustar alastairalastair{ "basename": "ast-esub2-248f0df", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/esub2.f90", "infile_hash": "fb45951fe73ff1605633612371af0d19b7036b3aef93d6b084c33823", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-esub2-248f0df.stderr", "stderr_hash": "f34c7ceeeaa22d1c9075e3ff71d51db6bdcd53ddb1f0b3c39e05fc33", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor14-07dfdb5.json0000664000175000017500000000077315141516316030711 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor14-07dfdb5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor14.f90", "infile_hash": "ecfd32142988c081654be18462888b79f4d47174d63c9e2b37b5a3d1", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor14-07dfdb5.stdout", "stdout_hash": "c159a6dc10dd4805d33c65efeaacb63a6cbc4e6b8a00e25047cd4588", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-global_scope7-69a167f.json0000664000175000017500000000073715141516316026326 0ustar alastairalastair{ "basename": "llvm-global_scope7-69a167f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope7-69a167f.stdout", "stdout_hash": "de8d377df6b593e1c594b663e8d241e0fee7fbb646d1f0d1cd119555", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_generic_procedure_same_name-708e46e.stdout0000664000175000017500000001330215141516316033472 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { interface_generic_procedure_same_name: (Module (SymbolTable 2 { frexp: (GenericProcedure 2 frexp [2 frexp~genericprocedure] Public ), frexp~genericprocedure: (Function (SymbolTable 3 { n: (Variable 3 n [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Real 4) () Source Public Required .true. .false. .false. () .false. .false. ) }) frexp~genericprocedure (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 n)] [] (Var 3 r) Public .false. .false. () ) }) interface_generic_procedure_same_name () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-expr_05-3b5ec63.stdout0000664000175000017500000000430515141516316025313 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t a; int32_t b; int32_t c; bool l; int32_t x; a = 3; b = 4; c = 5; x = 2*3; x = (-2)*3; x = 2*(-3); x = (-2)*(-3); x = (-2)*(-3); x = -std::pow(2, 3); x = -std::pow(2, 3); x = -(2*3); x = std::pow(2, -3); x = a; x = a; x = a*b; x = (-a)*b; x = -(a*b); x = a*(-b); x = (-a)*(-b); x = a*b*c; x = (-a)*b*c; x = a*(-b)*c; x = a*b*(-c); x = (-a)*(-b)*(-c); x = 3 + 4*5; x = (3 + 4)*5; x = a*(b + 5*(c - b)); x = (3 - 2*a*b)*5; x = ((-2)*a*b + 3)*5; x = ((-2)*a*b + 3*b*a)*5; x = ((-2)*(a/b) + std::pow(a + (-b), 2))*5; x = (2*a*b + 3)*5; x = std::pow(a, 2) + 2*a*b + std::pow(b, 2); x = (a + b)*(a - b); x = std::pow(a + b, 2); x = (a + b)*(std::pow(a, 2) - a*b + std::pow(b, 2)); x = (a - b)*(a + b)*(std::pow(a, 2) + std::pow(b, 2)); x = 1/(a*b); x = 1/a*b; x = 1/a*b; x = 1/(a*b + 1); x = 1/a*b + 1; x = 1/a*b + 1; x = 2 - (-2); x = a - ((-b) - c); x = a - (-2)*b; x = c - (-2)/b; x = a - (2 + 3 + 4); x = a + (2 + 3 + 4); x = 2*a + a*b - (a*b + 2*a); x = 2*a + a*b - (a*b - 2*a); x = a - (b - (c - 1)); x = a - b; x = a - (b - c); x = a - b - c; x = -(a - ((-b) + ((-b) - (-b)*b))); x = -(3 + 5); x = -(a + 5); l = (std::pow(x, 3)*4 + a <= 4 || x < 5 && x < 6) == (true || !false && true); l = l || l && l; l = (l || l) && l; l = l && l || l; l = l && (l || l); l = l || !l && l; l = l || l && !l; l = l && l || !l; l = l && !l || l; l = l && !(l || l); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-derived_types_04-b960162.json0000664000175000017500000000077215141516316026477 0ustar alastairalastair{ "basename": "asr-derived_types_04-b960162", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_04.f90", "infile_hash": "13c015af7c2b6f870262990e64fc99bf67a725899bea8a9164aef657", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-b960162.stdout", "stdout_hash": "c670f9c3bf08fa357f3ed3ac620b8ca489005399c200cf554549806e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-case_03-b4597f9.json0000664000175000017500000000073015141516316025154 0ustar alastairalastair{ "basename": "julia-case_03-b4597f9", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "julia-case_03-b4597f9.stdout", "stdout_hash": "459246866bf743d18ebaef865b8bdcf461382930e4a850f5fe9ae164", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_sign_from_value-sign_from_value-ba1c944.stdout0000664000175000017500000011117615141516316032635 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), arr: (Variable 2 arr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (IntegerConstant -3 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), epsidp: (Variable 2 epsidp [] Local (Cast (IntegerConstant 16 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 16 (Integer 8) Decimal) ) (IntegerConstant 16 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), epsisp: (Variable 2 epsisp [] Local (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), epsrdp: (Variable 2 epsrdp [] Local (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) ) (RealConstant 0.000001 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), epsrsp: (Variable 2 epsrsp [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ixdp: (Variable 2 ixdp [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) ) (IntegerConstant 5 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), ixsp: (Variable 2 ixsp [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rxdp: (Variable 2 rxdp [] Local (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (RealConstant 5.500000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), rxsp: (Variable 2 rxsp [] Local (RealConstant 5.500000 (Real 4) ) (RealConstant 5.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (Cast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -2.000000 (Real 4) ) ) (RealConstant -2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) ) (RealConstant -3.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign [] [(Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 epsrsp)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxsp) (RealBinOp (Var 2 rxsp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (Var 2 epsrsp) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxsp) Add (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 epsrsp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (Var 2 epsrdp)] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Sub (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixsp) (IntegerBinOp (Var 2 ixsp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 epsisp)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixsp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixsp) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 rxdp) (RealBinOp (Var 2 rxdp) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 8) ) (RealUnaryMinus (Var 2 epsrdp) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 rxdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 rxdp) Add (Cast (RealConstant 5.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 5.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 2 epsrdp) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 ixdp) (IntegerBinOp (Var 2 ixdp) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 8) Decimal) (Var 2 epsidp)] 0 (Integer 8) () ) (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 ixdp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ixdp) NotEq (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 c) (IntegerBinOp (Var 2 a) Mul (IntrinsicElementalFunction Sign [(IntegerConstant 1 (Integer 4) Decimal) (Var 2 b)] 0 (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 c) NotEq (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 arr) (ArrayConstant 20 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00, 5.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ArrayItem (Var 2 arr) [(() (IntrinsicElementalFunction Int [(RealBinOp (Var 2 x) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 y)] 0 (Real 4) () ) (Real 4) () )] 0 (Integer 4) () ) ())] (Real 4) ColMajor () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 2 z) NotEq (ArrayItem (Var 2 arr) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-program_without_line_cc-b84ba02.json0000664000175000017500000000115115141516316030355 0ustar alastairalastair{ "basename": "asr-program_without_line_cc-b84ba02", "cmd": "lfortran --continue-compilation --show-asr --no-color {infile}", "infile": "tests/errors/program_without_line_cc.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": "asr-program_without_line_cc-b84ba02.stdout", "stdout_hash": "838a4952fcd6181858c1341cb3b521ce7fa43e9990d1bd2c1a5e902a", "stderr": "asr-program_without_line_cc-b84ba02.stderr", "stderr_hash": "5bf23eca2f01a20110dbbe0e400d96bb19ea04c284afe403a158d374", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/julia-case_01-cbdd0aa.json0000664000175000017500000000073015141516316025417 0ustar alastairalastair{ "basename": "julia-case_01-cbdd0aa", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "julia-case_01-cbdd0aa.stdout", "stdout_hash": "bceaf3bd0933e0a0cdc1c4e6075d0cef2a1ee608767d1fa2766106ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-doloop_01-5cd8bf1.stdout0000664000175000017500000005676515141516316025733 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_01 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 9 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 9 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) )) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-submodule_02-9152b7b.json0000664000175000017500000000075615141516316025712 0ustar alastairalastair{ "basename": "asr-submodule_02-9152b7b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_02.f90", "infile_hash": "9ccb7a7264e9e91b29172a78a9dd1ba10f228c6d32082b5391653881", "outfile": null, "outfile_hash": null, "stdout": "asr-submodule_02-9152b7b.stdout", "stdout_hash": "5ab04b4b49f83340b592a5a6f0d66a2d10f82593621ea569e3c891fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-integer_overflow-3cf26f8.stderr0000664000175000017500000000007315141516316027421 0ustar alastairalastairError: Value 2147483648 is out of integer(4) range (file). lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_int-32727cf.json0000664000175000017500000000100115141516316030237 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_int-32727cf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_int.f90", "infile_hash": "88f2a854337ac8e0390be39e5b44c18975e0f856ea3890c6fae450f1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_int-32727cf.stderr", "stderr_hash": "6369be31933d4052db4ff550d8bbcdebb553b26b36f166f0ff7c9f2e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-mre_segfault-52f14b4.json0000664000175000017500000000073715141516316026101 0ustar alastairalastair{ "basename": "run-mre_segfault-52f14b4", "cmd": "lfortran --continue-compilation --no-color {infile}", "infile": "tests/errors/mre_segfault.f90", "infile_hash": "4bbc5104cf76f77bbe94f0bd5a2d2c4558db0315332c74155842e58d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-mre_segfault-52f14b4.stderr", "stderr_hash": "4a8bc82ac1dcde5689eb3f0031b49058be8b83f63b8b62258c30220e", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_12-4cdd01e.json0000664000175000017500000000074315141516316027705 0ustar alastairalastair{ "basename": "run-array_bounds_check_12-4cdd01e", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_12.f90", "infile_hash": "4c372157b9d4aa36edb76a7e8441fd140bf39e30bd585e97bd03da65", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_12-4cdd01e.stderr", "stderr_hash": "53a9ef6bf50afe7138c6d386cd49b45197f746175213d3fbfe5ec099", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/pass_div_to_mul-div_to_mul-d0027c6.json0000664000175000017500000000102215141516316030132 0ustar alastairalastair{ "basename": "pass_div_to_mul-div_to_mul-d0027c6", "cmd": "lfortran --pass=div_to_mul --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/div_to_mul.f90", "infile_hash": "6c1d702f410e8db6aae79c37b446d7a2fd6295166902746ff799d239", "outfile": null, "outfile_hash": null, "stdout": "pass_div_to_mul-div_to_mul-d0027c6.stdout", "stdout_hash": "0d43f39efe124f88b79ca823b79233b36167d27f1b6815005dfc9f5c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_06-83a7aca.json0000664000175000017500000000075615141516316026063 0ustar alastairalastair{ "basename": "asr-functions_06-83a7aca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_06.f90", "infile_hash": "a20cae677eff1d64429785cf2a3bb41b5ef7dad2dccb1b5b3ab97858", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_06-83a7aca.stdout", "stdout_hash": "305361ba6987039e3fc1802d9536b490cdd287871b5bbd355924607b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format1-04216cf.stdout0000664000175000017500000000402515141516316025336 0ustar alastairalastairok b okb okb Success! Hello World! Success! Hello World! Success! Hello World! danc in themoon danc in themoon danc in themoon ab cdef ghi jkl qwerty 12 ab cdef ghi jkl qwerty 12 ab cdef ghi jkl qwerty 12 123 00456 012345 *** 123 00456 012345 *** 123 00456 012345 *** 0.12D+03 -0.123457D+03 0.12D+02 ******* 0.12D+03 -0.123457D+03 0.12D+02 ******* 0.12D+03 -0.123457D+03 0.12D+02 ******* -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -1.23D+02 12.34568D+01 -1.23D+01 1.23D+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 hello 5 6 7 8 hello 9 10 11 12 hello 13 14 1 2 3 4 hello 5 6 7 8 hello 9 10 11 12 hello 13 14 12345 -12345 12345 -12345 0.D+3 0.1D+3 0.12D+2 0.D+3 0.1D+3 0.12D+2 0.D+3 0.1D+3 0.12D+2 -0.D+3 -0.1D+3 -0.12D+2 -0.D+3 -0.1D+3 -0.12D+2 Hello 12345678.000 23.567801 .35 12345678.000 23.567801 .35 12345678.000 23.567801 .35 -12345678.000 ********* -.35 -12345678.000 ********* -.35 2.000000E+00 0.000000E+00 2.000000E+00 0.000000E+00 0.0000000000000000000012345 0.0000000000000000000012345 x:1.12 y:4.5E+00 x:1.12 y:4.5E+00 x:1.12 y:4.5E+00 x: 9.99E-01 x: 1.00E-01 x: 9.99E-01 x: 1.00E-01 x: 1.02212E-01 x: 1.02212E-01 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 -1.70139E+38 -1.25381E+38 8.69780E+37 -1.40706E+37 1.11501E+37 -9.56332E+37 0.000 0.000 -0.000 -0.000 -0.000 100.000000 100.000 "0." 19 21 19 21 19 21 19 21 19 21 foobar foobar foobar 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 19 Dates: 20 22 21 23 lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_2-9ba55e7.stderr0000664000175000017500000000027315141516316031142 0ustar alastairalastairtokenizer error: Expecting contains keyword before procedure definition --> tests/errors/continue_compilation_ff_2.f:3:7 | 3 | SUBROUTINE faulty_subroutine(a, b, c) | ^ lfortran-lfortran-2f73434/tests/reference/cpp-types_03-dc774f0.stdout0000664000175000017500000000135115141516316025501 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = 1.50000000000000000e+00; std::cout << r << std::endl; i = (int32_t)(r); std::cout << i << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-string1-f6332d9.stdout0000664000175000017500000006402115141516316025352 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_strings: (Module (SymbolTable 2 { c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_size_t: (ExternalSymbol 2 c_size_t 4 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), f_string: (GenericProcedure 2 f_string [2 f_string~genericprocedure 2 f_string_cptr 2 f_string_cptr_n] Public ), f_string_cptr: (Function (SymbolTable 13 { c_strlen: (Function (SymbolTable 14 { r: (Variable 14 r [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 14 s [] In () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ) }) c_strlen (FunctionType [(CPtr)] (Integer 8) BindC Interface "strlen" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 s)] [] (Var 14 r) Public .false. .false. () ), cptr: (Variable 13 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 13 lfortran_tmp [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. ), s: (Variable 13 s [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string_cptr (FunctionType [(CPtr)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string_cptr_n] [(Var 13 cptr)] [(Assignment (Var 13 lfortran_tmp) (FunctionCall 13 c_strlen () [((Var 13 cptr))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 13 s) (FunctionCall 2 f_string_cptr_n () [((Var 13 cptr)) ((Var 13 lfortran_tmp))] (String 1 (Var 13 lfortran_tmp) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 13 s) Public .false. .false. () ), f_string_cptr_n: (Function (SymbolTable 15 { cptr: (Variable 15 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. ), n: (Variable 15 n [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 15 s [n] ReturnVar () () Default (String 1 (Var 15 n) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string_cptr_n (FunctionType [(CPtr) (Integer 8)] (String 1 (FunctionParam 1 (Integer 8) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 cptr) (Var 15 n)] [] (Var 15 s) Public .false. .false. () ), f_string~genericprocedure: (Function (SymbolTable 12 { c_string: (Variable 12 c_string [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f_string: (Variable 12 f_string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string~genericprocedure (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 c_string)] [] (Var 12 f_string) Public .false. .false. () ), string_t: (Struct (SymbolTable 11 { s: (Variable 11 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () ) }) fpm_strings () [iso_c_binding fpm_strings] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-array1-d75d040.json0000664000175000017500000000067215141516316024577 0ustar alastairalastair{ "basename": "cpp-array1-d75d040", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "cpp-array1-d75d040.stdout", "stdout_hash": "be314eb769aa2ba39ff0c2c0571b53ea2ca385bc351a030f400f1c3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_35-10733ec.stdout0000664000175000017500000004733015141516316026450 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_35: (Program (SymbolTable 2 { l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), section: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) section (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1, 1, 1, 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 3 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1, 1, 1, 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 3 a) Eq (Var 3 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal)] 1 (Array (Logical 4) [(() ())] DescriptorArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (Var 3 a) Eq (Var 3 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal)] 1 (Array (Logical 4) [(() ())] DescriptorArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) intrinsics_35 [] [(Assignment (Var 2 l) (IntrinsicArrayFunction Any [(ArrayPhysicalCast (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 l)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 2 section () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-string_binop-415f1fa.stderr0000664000175000017500000000030515141516316026503 0ustar alastairalastairsemantic error: Binary numeric operators cannot be used on strings --> tests/errors/string_binop.f90:1:10 | 1 | print *, "a" + "b" | ^^^^^^^^^ help: use '//' for string concatenation lfortran-lfortran-2f73434/tests/reference/asr-maskr_negative-89183d3.stderr0000664000175000017500000000024115141516316026660 0ustar alastairalastairsemantic error: first argument of `maskr` must be nonnegative --> tests/errors/maskr_negative.f90:2:12 | 2 | print*, maskr(-24) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-global_scope6-3cbd5d2.stdout0000664000175000017500000000115315141516316027012 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-lfortran-2f73434/tests/reference/asr-associate_08-570ac7d.json0000664000175000017500000000075615141516316025753 0ustar alastairalastair{ "basename": "asr-associate_08-570ac7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_08.f90", "infile_hash": "fe4c6883ace491c70d3d4955fbef50400d4deca99db760f14537339d", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_08-570ac7d.stdout", "stdout_hash": "6ef4e9499b9ef8274a9e1774071423fd2ac6c13963344857f2985ad3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-forall1-50096b8.json0000664000175000017500000000103015141516316024660 0ustar alastairalastair{ "basename": "ast-forall1-50096b8", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/forall1.f90", "infile_hash": "c0bc2a81b478acca60180152012de1e4011f235afde816cb91804fb9", "outfile": null, "outfile_hash": null, "stdout": "ast-forall1-50096b8.stdout", "stdout_hash": "c323ece1ee8c9f36314ce9f04a847d34b9bad6f8b9c28971a85820a4", "stderr": "ast-forall1-50096b8.stderr", "stderr_hash": "4d905b6e8f90b9042def4e125077632dced461f1a0aeea1763458479", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_assgn_test-2643606.json0000664000175000017500000000107515141516316026247 0ustar alastairalastair{ "basename": "asr-dim_assgn_test-2643606", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/dim_assgn_test.f90", "infile_hash": "1aa9b8592b310c0a601a031ae7716b75aea5ee9f31645db207e99bee", "outfile": null, "outfile_hash": null, "stdout": "asr-dim_assgn_test-2643606.stdout", "stdout_hash": "b2d8de9ed20fdf2b67b2fd40fec8957d2938d924a9334387b9a6fac3", "stderr": "asr-dim_assgn_test-2643606.stderr", "stderr_hash": "7f0949fe00196320d96335fc4ef87d1dfb2831ecbc544435e0b7f2ed", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-case_03-c3a5078.json0000664000175000017500000000074215141516316025006 0ustar alastairalastair{ "basename": "llvm-case_03-c3a5078", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_03-c3a5078.stdout", "stdout_hash": "433cb208c3bc226f1385b9b8fae2e1d9dbe9b5ba2bbabc66c2de965a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-array2-4254183.stdout0000664000175000017500000000150415141516316025177 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [5 x float], align 4 %b = alloca [5 x float], align 4 %c = alloca [3 x i32], align 4 %d = alloca [2 x i8], align 1 %e = alloca [6 x float], align 4 %f = alloca [12 x i32], align 4 %g = alloca [10 x i8], align 1 %h = alloca [24 x float], align 4 %i = alloca [36 x i32], align 4 %j = alloca [20 x i8], align 1 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_array2 FINALIZE_SYMTABLE_array2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-continue_body_if_loop-670a23a.json0000664000175000017500000000077715141516316027755 0ustar alastairalastair{ "basename": "asr-continue_body_if_loop-670a23a", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/continue_body_if_loop.f", "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_body_if_loop-670a23a.stdout", "stdout_hash": "29939ad4407adc2f92fb57aca71d31b5dddb2d5fded168db4b4057e5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_05-ee2fdac.stdout0000664000175000017500000000324015141516316026051 0ustar alastairalastairfunction main() local a::Int32 local b::Int32 local c::Int32 local l::Bool local x::Int32 a = 3 b = 4 c = 5 x = 2 * 3 x = (-2) * 3 x = 2 * (-3) x = (-2) * (-3) x = (-2) * (-3) x = -2 ^ 3 x = -2 ^ 3 x = -(2 * 3) x = 2 ^ (-3) x = a x = a x = a * b x = (-a) * b x = -(a * b) x = a * (-b) x = (-a) * (-b) x = a * b * c x = (-a) * b * c x = a * (-b) * c x = a * b * (-c) x = (-a) * (-b) * (-c) x = 3 + 4 * 5 x = (3 + 4) * 5 x = a * (b + 5 * (c - b)) x = (3 - 2 * a * b) * 5 x = ((-2) * a * b + 3) * 5 x = ((-2) * a * b + 3 * b * a) * 5 x = ((-2) * a ÷ b + ((a + (-b)) ^ 2)) * 5 x = (2 * a * b + 3) * 5 x = (a ^ 2) + 2 * a * b + (b ^ 2) x = (a + b) * (a - b) x = (a + b) ^ 2 x = (a + b) * ((a ^ 2) - a * b + (b ^ 2)) x = (a - b) * (a + b) * ((a ^ 2) + (b ^ 2)) x = 1 ÷ (a * b) x = 1 ÷ a * b x = 1 ÷ a * b x = 1 ÷ (a * b + 1) x = 1 ÷ a * b + 1 x = 1 ÷ a * b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2) * b x = c - (-2) ÷ b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2 * a + a * b - (a * b + 2 * a) x = 2 * a + a * b - (a * b - 2 * a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b) * b)) x = -(3 + 5) x = -(a + 5) l = ((x ^ 3) * 4 + a ≤ 4 || x < 5 && x < 6) == (true || !false && true) l = l || l && l l = (l || l) && l l = l && l || l l = l && (l || l) l = l || !l && l l = l || l && !l l = l && l || !l l = l && !l || l l = l && !(l || l) end main() lfortran-lfortran-2f73434/tests/reference/asr-intrinsics6-1d3a4b4.json0000664000175000017500000000073515141516316025731 0ustar alastairalastair{ "basename": "asr-intrinsics6-1d3a4b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics6.f90", "infile_hash": "04d0ad73ff3a4a936bd1b527adf0b5382bd08abf7aa7d294b2d40b44", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics6-1d3a4b4.stderr", "stderr_hash": "2b18c9e2fcfa9ab0487783b1eeeee1a353f3ef6a36247a60d1b79bda", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-string_13-ae4df53.stdout0000664000175000017500000001554215141516316025733 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_13: (Program (SymbolTable 2 { ia0: (Variable 2 ia0 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "0" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 48 (Integer 4) Decimal) ) (IntegerConstant 48 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ia5: (Variable 2 ia5 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "5" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 53 (Integer 4) Decimal) ) (IntegerConstant 53 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ia9: (Variable 2 ia9 [] Local (IntrinsicElementalFunction Iachar [(StringConstant "9" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 57 (Integer 4) Decimal) ) (IntegerConstant 57 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_13 [] [(If () (IntegerCompare (Var 2 ia0) NotEq (IntegerConstant 48 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ia5) NotEq (IntegerConstant 53 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ia9) NotEq (IntegerConstant 57 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ia0) (Var 2 ia5) (Var 2 ia9)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_10-2bab681.stdout0000664000175000017500000000475315141516316025637 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_10: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_10 [] [(Allocate [((Var 2 x) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 x) (ArrayConstant 4 [1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-types_08-c70036f.stdout0000664000175000017500000000710115141516316025424 0ustar alastairalastair(TranslationUnit [(Program types_08 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine f [(i) (j)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrOptional ) (AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrOptional )] [(j [] [] () () None ())] () )] [] [] [] ) (Subroutine g [(i) (j)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrOptional ) (AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(AttrIntent In )] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrOptional )] [(j [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_01_size-b2012a6.stdout0000664000175000017500000000313015141516316027104 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 local size_a::Int32 local size_b::Int32 size_a = length(a) size_b = size(b)[1] if size_a ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:size_a a[i] = i + 10 end if a[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if a[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if a[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 11:10 + size_b b[i - 10] = i end if b[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end if b[4] ≠ 14 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:size_a b[i] = a[i] - 10 end if b[1] ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = b[1] + b[2] + b[3] + a[1] if b[4] ≠ 17 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = a[1] if b[4] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/llvm-subroutine3-fb7e0b8.stdout0000664000175000017500000000057215141516316026570 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @f() { .entry: %f = alloca i32, align 4 store i32 42, i32* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %0 = load i32, i32* %f, align 4 ret i32 %0 } lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor3-1a6f5d9.json0000664000175000017500000000077015141516316030550 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor3-1a6f5d9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor3.f90", "infile_hash": "58f83679f37f6f12b4b6df79723a6938e7bf118e3f12170ffe46a2d4", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor3-1a6f5d9.stdout", "stdout_hash": "95f8291ca6df4d52e75d24f797fa1d8b6cb81fb1cc1ca8d26d50c132", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutines_03-dde7b37.json0000664000175000017500000000075515141516316026760 0ustar alastairalastair{ "basename": "julia-subroutines_03-dde7b37", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_03.f90", "infile_hash": "432c4d3eb84ddddcc76b5371ed559a4688bf1e31676bb7e14c2aa3cf", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_03-dde7b37.stdout", "stdout_hash": "9e1b9f51357f697e89ce60e9a3a9772190dda70e5515ffd1862c6ff8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-team1-f0af498.stdout0000664000175000017500000001201715141516316025053 0ustar alastairalastair(TranslationUnit [(Program team1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Syntax check only(AST)" ) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeType [] () team_type None ) [] [(column [] [] () () None ()) (odd_even [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrCodimension [(1 n CodimensionExpr) (() () CodimensionStar)] )] [(co_array [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 2 DimensionExpr)] )] [(my_cosubscripts [] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray my_cosubscripts [] [(() () 1 0)] [] [] [] ) (FuncCallOrArray this_image [] [(() co_array () 0)] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (FormTeam 0 (FuncCallOrArray my_cosubscripts [] [(() 2 () 0)] [] [] [] ) column [(AttrNewIndex (FuncCallOrArray my_cosubscripts [] [(() 1 () 0)] [] [] [] ) )] () ) (SyncTeam 0 column [] () ) (ChangeTeam 0 () column [(CoarrayAssociation (CoarrayRef ca [] [] [] [(() () 1 CodimensionStar)] [] ) co_array )] [] [] (TriviaNode [] [(EndOfLine) (Comment "! segment 1" )] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (FormTeam 0 (- 2 (FuncCallOrArray mod [] [(() (FuncCallOrArray this_image [] [] [] [] [] ) () 0) (() 2 () 0)] [] [] [] )) odd_even [] () ) (ChangeTeam 0 () odd_even [] [] [] (TriviaNode [] [(EndOfLine) (Comment "! segment 2" )] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-nullify1-b3931cb.stdout0000664000175000017500000000014415141516316026250 0ustar alastairalastairprogram nullify1 ! Tests for syntax (AST) only: nullify(a) nullify(a, b, c, d) end program nullify1 lfortran-lfortran-2f73434/tests/reference/asr-types_04-056d321.json0000664000175000017500000000074215141516316024765 0ustar alastairalastair{ "basename": "asr-types_04-056d321", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "asr-types_04-056d321.stdout", "stdout_hash": "3ee2d478547300c80f0d4b911f9d1e2c846dd602c2424b82c4c820d0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_01-d48abaa.stdout0000664000175000017500000003546015141516316027056 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_01: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) subroutines_01 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerConstant 3 (Integer 4) Decimal)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) )) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 f () [((IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_11-dd72b29.json0000664000175000017500000000075015141516316025437 0ustar alastairalastair{ "basename": "asr-modules_11-dd72b29", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_11-dd72b29.stdout", "stdout_hash": "1404ae8dfa9758c02eb81adeb5c4ba19b9221cf986da078be8a4fad0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_04-ea50b75.json0000664000175000017500000000075615141516316026002 0ustar alastairalastair{ "basename": "asr-functions_04-ea50b75", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_04.f90", "infile_hash": "237775308ca559439958719781b889f95d15c69eb4126ff69abe6fb2", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_04-ea50b75.stdout", "stdout_hash": "d51cb2eae2649926e6e614595693acb1f456c98c02467c2e48337805", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_03-38b11b3.json0000664000175000017500000000075215141516316025330 0ustar alastairalastair{ "basename": "ast_f90-goto_03-38b11b3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_03.f90", "infile_hash": "2a8829b6e334f6c1619d1d9c772f871874336138a9aa68816641754c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_03-38b11b3.stdout", "stdout_hash": "87bacb0887ea120cb4930811b9bf2a93b1237134d50342241ad24cf5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-types_02-b5bfe0b.stdout0000664000175000017500000000133615141516316026022 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store i32 1, i32* %i, align 4 store float 1.000000e+00, float* %r, align 4 %2 = load i32, i32* %i, align 4 %3 = sitofp i32 %2 to float store float %3, float* %r, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_02 FINALIZE_SYMTABLE_types_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_03-f7a6efe.stdout0000664000175000017500000011431415141516316030735 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_01: (Program (SymbolTable 6 { f: (Variable 6 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), greater_than_inverse: (ExternalSymbol 6 greater_than_inverse 2 greater_than_inverse operator_overloading_01_overload_comp_m [] greater_than_inverse Public ), less_than_inverse: (ExternalSymbol 6 less_than_inverse 2 less_than_inverse operator_overloading_01_overload_comp_m [] less_than_inverse Public ), less_than_overload_use: (ExternalSymbol 6 less_than_overload_use 2 less_than_overload_use operator_overloading_01_overload_comp_m [] less_than_overload_use Public ), t: (Variable 6 t [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~gt: (ExternalSymbol 6 ~gt 2 ~gt operator_overloading_01_overload_comp_m [] ~gt Public ), ~lt: (ExternalSymbol 6 ~lt 2 ~lt operator_overloading_01_overload_comp_m [] ~lt Public ) }) operator_overloading_01 [operator_overloading_01_overload_comp_m] [(Print (StringFormat () [(StringConstant "T>T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 t) Gt (Var 6 t) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T>F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 t) Gt (Var 6 f) (Logical 4) (LogicalConstant .true. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F>T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 f) Gt (Var 6 t) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F>F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedCompare (Var 6 f) Gt (Var 6 f) (Logical 4) (LogicalConstant .false. (Logical 4) ) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T tests/errors/kind_string_of_int.f90:3:13 | 3 | integer('a') :: x | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-declaration1-880025a.stdout0000664000175000017500000001347615141516316026250 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { declaration1: (Module (SymbolTable 2 { arr: (Variable 2 arr [] Local (ArrayReshape (ArrayConstant 8 [1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (IntrinsicArrayFunction Shape [(ArrayPhysicalCast (Var 2 arr) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [(() ()) (() ())] FixedSizeArray ) () ) () Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) declaration1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do3-831f843.stderr0000664000175000017500000000030615141516316027041 0ustar alastairalastairsemantic error: The start variable of the data implied do loop must be constants --> tests/errors/data_implied_do3.f90:5:21 | 5 | data(iarx(i), i=k, 3) / 1, 2, 3 / | ^ lfortran-lfortran-2f73434/tests/reference/asr-flip_sign-a0cebd4.json0000664000175000017500000000074515141516316025571 0ustar alastairalastair{ "basename": "asr-flip_sign-a0cebd4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/flip_sign.f90", "infile_hash": "12739178c354710c6f6bbeb834508a7932ae385c1340b0c08bca8b8d", "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", "stdout_hash": "03c7183b90d024c9801d24ae9522426eaeb48efc397e73489108301b", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_03-1316a5f.stdoutlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_03-1310000664000175000017500000006144715141516316034261 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optional_03: (Program (SymbolTable 5 { __libasr_created_dummy_variable_: (Variable 5 __libasr_created_dummy_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_1: (Variable 5 __libasr_created_dummy_variable_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_dummy_variable_2: (Variable 5 __libasr_created_dummy_variable_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_: (Variable 5 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_1: (Variable 5 __libasr_created_variable_pointer_1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_2: (Variable 5 __libasr_created_variable_pointer_2 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), f1: (ExternalSymbol 5 f1 2 f1 optional_03_m [] f1 Public ), i: (Variable 5 i [] Local () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 5 lfortran_tmp [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), lfortran_tmp1: (Variable 5 lfortran_tmp1 [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), my_sub: (ExternalSymbol 5 my_sub 2 my_sub optional_03_m [] my_sub Public ) }) optional_03 [optional_03_m] [(Assignment (Var 5 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 i)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_) (Var 5 i) )] [(Associate (Var 5 __libasr_created_variable_pointer_) (Var 5 __libasr_created_dummy_variable_) )] ) (Assignment (Var 5 lfortran_tmp) (FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 i)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_1) (Var 5 lfortran_tmp) )] [(Associate (Var 5 __libasr_created_variable_pointer_1) (Var 5 __libasr_created_dummy_variable_1) )] ) (Assignment (Var 5 lfortran_tmp1) (FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_1)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp1)] 0 (Logical 4) () ) [(Associate (Var 5 __libasr_created_variable_pointer_2) (Var 5 lfortran_tmp1) )] [(Associate (Var 5 __libasr_created_variable_pointer_2) (Var 5 __libasr_created_dummy_variable_2) )] ) (SubroutineCall 5 my_sub () [((FunctionCall 5 f1 () [((Var 5 __libasr_created_variable_pointer_2)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 5 lfortran_tmp1)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () ))] () .false. )] ), optional_03_m: (Module (SymbolTable 2 { f1: (Function (SymbolTable 4 { __libasr_is_present_x: (Variable 4 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] ReturnVar () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f1 (FunctionType [(Integer 4) (Logical 4)] (Allocatable (Integer 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 __libasr_is_present_x)] [(Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .false. .false. () ), my_sub: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_sub (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Print (StringFormat () [(StringConstant "a =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) optional_03_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_39-1b897aa.stdout0000664000175000017500000000010515141516316025652 0ustar alastairalastair3.E+0 0.E+0 10.E+0 3.E+3 30.E+0 391.E+0 31.E+3 -5.E+0 12.E-6 100.E+9 lfortran-lfortran-2f73434/tests/reference/ast-if2-65737e5.json0000664000175000017500000000067615141516316024027 0ustar alastairalastair{ "basename": "ast-if2-65737e5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/if2.f90", "infile_hash": "7e5997e7b3a28044e5c2899900ea795edfd628c1ed4530afdf1aea0d", "outfile": null, "outfile_hash": null, "stdout": "ast-if2-65737e5.stdout", "stdout_hash": "5f295305024fda59a316f3bd169220cb153cf59821bb21982878f459", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit12-1826599.stderr0000664000175000017500000000176615141516316025577 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit12.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit12.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit12.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit12.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit12.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit12.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor5-fdb91a5.json0000664000175000017500000000077015141516316030626 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor5-fdb91a5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor5.f90", "infile_hash": "96309887c38d452524fc1048a69f630c58fd72edb53964e858ffd7dd", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor5-fdb91a5.stdout", "stdout_hash": "cd13e7af6dab54aa09d6f02c19a2258732ec4408cdf22f44a8563dc4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_ranks_allocatable_arr2-699f9ab.stderr0000664000175000017500000000025115141516316033145 0ustar alastairalastairsemantic error: Incompatible ranks 1 and 3 in assignment --> tests/errors/incompatible_ranks_allocatable_arr2.f90:10:5 | 10 | arr3 = arr1 | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-case_03-e03f722.stdout0000664000175000017500000002141615141516316025171 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) case03 [] [(Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 b) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 a) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 b) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 a) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_01_size-b2012a6.json0000664000175000017500000000075515141516316026545 0ustar alastairalastair{ "basename": "julia-arrays_01_size-b2012a6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_01_size-b2012a6.stdout", "stdout_hash": "96bd839b52ffb599968e87d55a73588f6b4b3c9c911a46a5d8dbe994", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-case_03-5c7be5c.json0000664000175000017500000000072215141516316024757 0ustar alastairalastair{ "basename": "cpp-case_03-5c7be5c", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_03-5c7be5c.stdout", "stdout_hash": "d27dc54101c6ffce41ad661c4c5023ce1e202d9440de3309d579a13b", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.jsonlfortran-lfortran-2f73434/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.js0000664000175000017500000000106615141516316034144 0ustar alastairalastair{ "basename": "fortran-complex_to_complex_cast_fortran_codegen-d2ad266", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/complex_to_complex_cast_fortran_codegen.f90", "infile_hash": "afdf4c4f3cfefb63f73acbec98dbc6286bca79bdc47f1e0649f737c4", "outfile": null, "outfile_hash": null, "stdout": "fortran-complex_to_complex_cast_fortran_codegen-d2ad266.stdout", "stdout_hash": "c3730ff36bdce5c26a57c58424409661eafc3bb2ebcf8482406f1479", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-maskl_incorrect_bit_size-62a84b0.stderr0000664000175000017500000000032415141516316030775 0ustar alastairalastairsemantic error: first argument of `maskl` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/maskl_incorrect_bit_size.f90:2:12 | 2 | print*, maskl(63) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/x86-program1-cd1a758.json0000664000175000017500000000057615141516316025063 0ustar alastairalastair{ "basename": "x86-program1-cd1a758", "cmd": "lfortran --no-color --backend=x86 {infile} -o output", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine8-af54645.stdout0000664000175000017500000000327215141516316026253 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [(SimpleAttribute AttrRecursive ) (SimpleAttribute AttrPure )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine b [] [(SimpleAttribute AttrPure ) (SimpleAttribute AttrElemental )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine c [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine d [] [(SimpleAttribute AttrPure ) (SimpleAttribute AttrRecursive )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Subroutine e [] [(SimpleAttribute AttrImpure ) (SimpleAttribute AttrElemental ) (SimpleAttribute AttrModule )] () () [] [] [] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-open1-9127585.stdout0000664000175000017500000000065015141516316025327 0ustar alastairalastairprogram open1 ! Tests for syntax (AST) only: open(file="p_cc", newunit=u) open(task_lun, file=taskfile) open(unit=gmv_lun, FILE=fname, IOSTAT=ier, POSITION="rewind") open(newunit=this%lun, file=outfile, status="replace", iostat=ios) open(unit=10, file="test1.inp", position="rewind", action="read", status="old") open(UNIT=funit, FILE=tname, STATUS=fstat, ACCESS="SEQUENTIAL", ACTION=faction, IOSTAT=ierr) end program open1 lfortran-lfortran-2f73434/tests/reference/wat-wasm_bind_js-d9f341f.json0000664000175000017500000000071415141516316026136 0ustar alastairalastair{ "basename": "wat-wasm_bind_js-d9f341f", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_bind_js.f90", "infile_hash": "e26eef4b7e209dcce2ee67f743a603d31dacb3a2f880959d0520ab0b", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_bind_js-d9f341f.stdout", "stdout_hash": "f8931d739d3d15c5609c413d1b5281a677ff5825751ee9fc9c296062", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fn4-eaaa354.json0000664000175000017500000000067615141516316024234 0ustar alastairalastair{ "basename": "ast-fn4-eaaa354", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn4.f90", "infile_hash": "35fb507c50c885547daa8eef3f01aa0be9b3eb6db98d824ad6f51bc9", "outfile": null, "outfile_hash": null, "stdout": "ast-fn4-eaaa354.stdout", "stdout_hash": "ff12bc86f5ff083889efe57574c7967ea9ceb848104a1d6dc8389389", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-entry_02-b8ee2e2.stdout0000664000175000017500000003745015141516316025567 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry_02: (Program (SymbolTable 5 { dummy: (Variable 5 dummy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) entry_02 [] [(Assignment (Var 5 dummy) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 1 x () [((Var 5 dummy))] () .false. ) (Assignment (Var 5 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 1 y () [((Var 5 dummy))] () .false. )] ), x: (Function (SymbolTable 2 { dummy: (Variable 2 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 2 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 dummy))] () .false. )] () Public .false. .false. () ), x_main__lcompilers: (Function (SymbolTable 4 { dummy: (Variable 4 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x_main__lcompilers (FunctionType [(Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 dummy)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Print (StringFormat () [(StringConstant "Printed using subroutine call: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Return) (GoToTarget 2 2 ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 4 dummy) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Return)] () Public .false. .false. () ), y: (Function (SymbolTable 3 { dummy: (Variable 3 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) y (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 3 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 3 dummy))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form5-66fddbd.stdout0000664000175000017500000000305315141516316026411 0ustar alastairalastair(TranslationUnit [(Function zdotc [(n) (d1x)] [(AttrType TypeComplex [(() 8 Value)] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(d1x [(() () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 2 Value)] () () None ) [] [(d2v [] [] () () None ())] () )] [(Assignment 0 d2v (String "AB" ()) () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-class_01-704dee8.json0000664000175000017500000000074215141516316025077 0ustar alastairalastair{ "basename": "asr-class_01-704dee8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_01.f90", "infile_hash": "d56b80167c24a798a3f70abbc77b31570b560e826ce6b96ab9476bab", "outfile": null, "outfile_hash": null, "stdout": "asr-class_01-704dee8.stdout", "stdout_hash": "d31d769df4eca9bbac3da68322898ec042d573ab6d407effe64e518a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_4-656a640.json0000664000175000017500000000075315141516316025676 0ustar alastairalastair{ "basename": "ast-fixed_form_4-656a640", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_4.f", "infile_hash": "ead212bbc34e4848d189561c4e6474149e4afb1bfeda6f7e46b90b12", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_4-656a640.stderr", "stderr_hash": "dd0de417e4cccdc2321f322a53b4aa0c212ae0ee3dbdaf980d13ec3a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_class_compare-e58def6.json0000664000175000017500000000102515141516316031013 0ustar alastairalastair{ "basename": "asr-polymorphic_class_compare-e58def6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/polymorphic_class_compare.f90", "infile_hash": "ed9ac85fcf47a406efa5f7672115ca698b4be28ba5c667c2371591fb", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_class_compare-e58def6.stdout", "stdout_hash": "cce6b194d0adec1f6a0ab59768c8e19eae0a6c90b9b90dfcea1e8733", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_01-9cd45b3.stdout0000664000175000017500000000032715141516316030602 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Print 0 () [(String "OK" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-case_04-60840db.json0000664000175000017500000000073715141516316024625 0ustar alastairalastair{ "basename": "ast-case_04-60840db", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_04.f90", "infile_hash": "55392e5b3b536591894e60672e49e61f8c579e20edb5d007f1f1afae", "outfile": null, "outfile_hash": null, "stdout": "ast-case_04-60840db.stdout", "stdout_hash": "1fc5c0ab5364c82ce3ec2aa1facd36f96483565eda873db022eb30ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-passing_array_01-b2bde68.json0000664000175000017500000000072415141516316026727 0ustar alastairalastair{ "basename": "run-passing_array_01-b2bde68", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/passing_array_01.f90", "infile_hash": "c4f23f8af4c7add1c1eeab42b957fd5885da76f668ca6b1b86660896", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-passing_array_01-b2bde68.stderr", "stderr_hash": "59aa29b7099f795300614c65d9ddb0c7314a7775a9d19e61a4c01e8d", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_07-ccfd81f.stdout0000664000175000017500000003504615141516316027362 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_05: (Program (SymbolTable 5 { }) derived_types_05 [] [] ), derived_types_07_stdlib_logger: (Module (SymbolTable 2 { final_logger: (Function (SymbolTable 4 { iostat: (Variable 4 iostat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), message: (Variable 4 message [] Local () () Default (String 1 (IntegerConstant 256 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] In () () Default (StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 4 unit [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) final_logger (FunctionType [(StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] () Public .false. .false. () ), logger_type: (Struct (SymbolTable 3 { add_blank_line: (Variable 3 add_blank_line [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), log_units: (Variable 3 log_units [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), max_width: (Variable 3 max_width [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) logger_type (StructType [(Logical 4) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) [] [add_blank_line log_units max_width] [] Source Private .false. .false. [] () () ) }) derived_types_07_stdlib_logger () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_sort_02-0aa4518.json0000664000175000017500000000077215141516316026563 0ustar alastairalastair{ "basename": "asr-template_sort_02-0aa4518", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_sort_02.f90", "infile_hash": "784d6d4e3ae91b1604cc477b388497c8298e6743c01bbefb61ecd409", "outfile": null, "outfile_hash": null, "stdout": "asr-template_sort_02-0aa4518.stdout", "stdout_hash": "9b9b37404ed6300f8725ee8ddb08cf1093a38ce21041d120e701289c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-block_data1-f3dfb1f.json0000664000175000017500000000074115141516316026450 0ustar alastairalastair{ "basename": "ast_f90-block_data1-f3dfb1f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/block_data1.f90", "infile_hash": "18c095bb88a2f3528ab34c788fd6a66b9294d38866605cfec26b8dfd", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block_data1-f3dfb1f.stdout", "stdout_hash": "e3f8296b8f94947d2df24e8ed679b5829e79a281be4b05efb60de201", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor18-618bfdc.stdout0000664000175000017500000000237515141516316031270 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor18: (Program (SymbolTable 2 { y: (Variable 2 y [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor18 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-global_scope1-dd9aaaa.json0000664000175000017500000000073415141516316026413 0ustar alastairalastair{ "basename": "ast-global_scope1-dd9aaaa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope1-dd9aaaa.stdout", "stdout_hash": "6fa8960cf7f538bc4b28ffb155c8afa72da87b32edf0fb758faffd2e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-save4-99c3220.json0000664000175000017500000000112115141516316027732 0ustar alastairalastair{ "basename": "asr_disable_warnings-save4-99c3220", "cmd": "lfortran --show-asr --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/save4.f90", "infile_hash": "8ad16d18b9282d4bb2812bf641878b7a6738e0e34c356b94ff01ef8a", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_warnings-save4-99c3220.stdout", "stdout_hash": "a3eb4caf18d259ea43790a9a498e716a8714031f6a17875cae6bcf2b", "stderr": "asr_disable_warnings-save4-99c3220.stderr", "stderr_hash": "e3013a477fb53db6747b4c2508286e403a3d023df3b260db13492ac4", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit2-f584754.json0000664000175000017500000000077415141516316027445 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit2-f584754", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit2.f", "infile_hash": "5300a387c8af9f01e109d5c3f7a9d8aa452020178f6e388e4bfcbce9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit2-f584754.stdout", "stdout_hash": "ec75ab5349993d3fbd8408b235e5fdd9c2d897b60b7d3d144b6d62d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface4-ad40742.stdout0000664000175000017500000001463015141516316025777 0ustar alastairalastair(TranslationUnit [(Module DOT (TriviaNode [(EndOfLine) (Comment "! Module for dot product of two real arrays of rank 1." ) (Comment "! The caller needs to ensure that exceptions do not cause halting." ) (Comment "! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf" )] [] ) [(Use [(SimpleAttribute AttrIntrinsic )] IEEE_EXCEPTIONS [] .false. () )] [] [(Declaration (AttrType TypeLogical [] () () None ) [] [(MATRIX_ERROR [] [] () (Logical .false.) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeaderDefinedOperator "dot" ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [MULT] [(SimpleAttribute AttrModule )] () )] )] [] [(Function MULT [(A) (B)] [(AttrType TypeReal [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(A [(() () DimensionExpr)] [] () () None ()) (B [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(I [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(OVERFLOW [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(If 0 () (/= (FuncCallOrArray SIZE [] [(() A () 0)] [] [] [] ) (FuncCallOrArray SIZE [] [(() B () 0)] [] [] [] )) [(Assignment 0 MATRIX_ERROR (Logical .true.) () ) (Return 0 () () )] [] () () (TriviaNode [] [(EndOfLine) (Comment "! The processor ensures that IEEE_OVERFLOW is quiet." ) (EndOfLine)] ) ) (Assignment 0 MULT (Real "0.0") () ) (DoLoop 0 () 0 I 1 (FuncCallOrArray SIZE [] [(() A () 0)] [] [] [] ) () [(Assignment 0 MULT (+ MULT (* (FuncCallOrArray A [] [(() I () 0)] [] [] [] ) (FuncCallOrArray B [] [(() I () 0)] [] [] [] ))) () )] () () ) (SubroutineCall 0 IEEE_GET_FLAG [] [(() IEEE_OVERFLOW () 0) (() OVERFLOW () 0)] [] [] () ) (If 0 () OVERFLOW [(Assignment 0 MATRIX_ERROR (Logical .true.) () )] [] () () () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-const_kind_01-90eb6ef.json0000664000175000017500000000076115141516316026206 0ustar alastairalastair{ "basename": "asr-const_kind_01-90eb6ef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/const_kind_01.f90", "infile_hash": "d4c0af9b90708f58d944586c06c948bea50408175f8b6edf852dd5c0", "outfile": null, "outfile_hash": null, "stdout": "asr-const_kind_01-90eb6ef.stdout", "stdout_hash": "bc22bfcae375a4d46054b237063027eab35224cd19ae605a03b2e9e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array12-cb81afc.json0000664000175000017500000000071215141516316025077 0ustar alastairalastair{ "basename": "asr-array12-cb81afc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array12.f90", "infile_hash": "b9b95dd8f4cf55a5f7617a1df8fcf515fb405c1cd64c198005f33617", "outfile": null, "outfile_hash": null, "stdout": "asr-array12-cb81afc.stdout", "stdout_hash": "bf36cd81ea46b5db84d101c71e17f7f82bca359f2acd77931e570aa6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-coarray_02-793f8b3.stderr0000664000175000017500000000023515141516316025707 0ustar alastairalastairsemantic error: Coarrays are not supported yet --> tests/errors/coarray_02.f90:2:5 | 2 | call event_query(1, 1, 1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-cast_node_m_value-8b7098f.json0000664000175000017500000000075015141516316027067 0ustar alastairalastair{ "basename": "asr-cast_node_m_value-8b7098f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/cast_node_m_value.f90", "infile_hash": "9935456d6f13100b0649b0da43367516a22c1d8d747656cc2e9ac9d3", "outfile": null, "outfile_hash": null, "stdout": "asr-cast_node_m_value-8b7098f.stdout", "stdout_hash": "e81fe3f24ddd52e4e798bb99868df159431053ef859feb4f89395d8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-subroutine3-fb7e0b8.json0000664000175000017500000000073115141516316026214 0ustar alastairalastair{ "basename": "llvm-subroutine3-fb7e0b8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutine3-fb7e0b8.stdout", "stdout_hash": "1b8de0cf26accff42321f768b112eeeb8263371239c1429bb9ad4709", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.json0000664000175000017500000000114215141516316031747 0ustar alastairalastair{ "basename": "asr_enable_style_suggestion-style1-a2fdd22", "cmd": "lfortran --std=f23 --style-suggestions --no-color {infile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": "asr_enable_style_suggestion-style1-a2fdd22.stdout", "stdout_hash": "b9b26c3fdb75ebc34cfc47d12c11351182a0284088440bead4ae1daf", "stderr": "asr_enable_style_suggestion-style1-a2fdd22.stderr", "stderr_hash": "0a91582db826ba18d127e9a1beca1da3483df9469fed545f6c902f35", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_01_pack-6c829d9.json0000664000175000017500000000076115141516316026037 0ustar alastairalastair{ "basename": "asr-array_01_pack-6c829d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_01_pack.f90", "infile_hash": "02d7dd22ece04cc492f6d7bb57b8d91a311419e3fab2294a2c809d22", "outfile": null, "outfile_hash": null, "stdout": "asr-array_01_pack-6c829d9.stdout", "stdout_hash": "6b2dd0ab41f8ef25297806a2d0d70623cf1ebe7c41e34abaec18bfc2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_03-b50b4bf.json0000664000175000017500000000071415141516316024407 0ustar alastairalastair{ "basename": "c-case_03-b50b4bf", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "c-case_03-b50b4bf.stdout", "stdout_hash": "a8e2f0b7e3fe6b1c06e9a7d82a477acae96293fd6eb0b0245481adb5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope7-d6ec187.json0000664000175000017500000000101415141516316031137 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope7-d6ec187", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope7-d6ec187.stdout", "stdout_hash": "dc49af2c0da1fa3f93a96f4043cf1db8cfa444ad6c435f5c8ee3a576", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program4-ba26fd1.stdout0000664000175000017500000007267415141516316025660 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program4: (Program (SymbolTable 2 { func1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), saved: (Variable 3 saved [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 saved) (RealBinOp (Var 3 saved) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 3 c) (RealBinOp (RealBinOp (RealBinOp (Var 3 c) Add (Var 3 a) (Real 4) () ) Add (Var 3 b) (Real 4) () ) Add (Var 3 saved) (Real 4) () ) () .false. .false. )] (Var 3 c) Public .false. .false. () ), func2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 4 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), saved1: (Variable 4 saved1 [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), saved2: (Variable 4 saved2 [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func2 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 saved1) (RealBinOp (Var 4 saved1) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 c) (RealBinOp (RealBinOp (RealBinOp (RealBinOp (RealBinOp (Var 4 d) Add (Var 4 c) (Real 4) () ) Add (Var 4 a) (Real 4) () ) Add (Var 4 b) (Real 4) () ) Add (Var 4 saved1) (Real 4) () ) Add (Var 4 saved2) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 saved2) (RealBinOp (Var 4 saved2) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 4 d) (RealBinOp (Var 4 d) Add (RealConstant 3.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 4 c) Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) program4 [] [(Assignment (Var 2 x) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "6.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "7.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "6.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "8.0 == " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-empty-cb5d1b4.stdout0000664000175000017500000000006515141516316025430 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" lfortran-lfortran-2f73434/tests/reference/asr-template_error_09-8d590f9.stderr0000664000175000017500000000034015141516316027302 0ustar alastairalastairsemantic error: Operator `==` undefined for the types in the expression `t == t` --> tests/errors/template_error_09.f90:21:20 | 21 | prop = bin(x,y) == bin(y,x) | ^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-associate_05-4641244.json0000664000175000017500000000075615141516316025526 0ustar alastairalastair{ "basename": "asr-associate_05-4641244", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_05.f90", "infile_hash": "d3e3285cba1bab5ce2798d7c376c75626b7e5d36b0e47dc62a16a0b1", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_05-4641244.stdout", "stdout_hash": "c8a5ecaa01a34d3fc9e0fa128880e805df9a492fca1a252a71a50243", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-derived_types_32-4684b97.json0000664000175000017500000000077515141516316026706 0ustar alastairalastair{ "basename": "llvm-derived_types_32-4684b97", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_32.f90", "infile_hash": "39d5cc6685aacdb41dd366f4a5147c66847cad929d59546701732401", "outfile": null, "outfile_hash": null, "stdout": "llvm-derived_types_32-4684b97.stdout", "stdout_hash": "af52e7ea3cfe6e387474ce9f2ced2d2478f026b0f0e60e4a4cfc8676", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_01-e42aa0d.json0000664000175000017500000000077615141516316026646 0ustar alastairalastair{ "basename": "asr-implicit_call_01-e42aa0d", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_01.f90", "infile_hash": "2ed640dba2654e545e8e66737ea33f5e1c943c7d894d9cfcacab7225", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_01-e42aa0d.stderr", "stderr_hash": "f9e8970a1b966caf17e63d203fe457cf7114d017867859c35849b3a9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-entry1-5b02d99.json0000664000175000017500000000070715141516316024635 0ustar alastairalastair{ "basename": "ast-entry1-5b02d99", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/entry1.f90", "infile_hash": "ca0b3d63526c84c42bb3f45badc8a6393867586040e33d02c7a8561c", "outfile": null, "outfile_hash": null, "stdout": "ast-entry1-5b02d99.stdout", "stdout_hash": "4c6a6e641b9d3ef172165d5ac73a9e8738a7ade595603197659a17e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-expr_08-74f99b7.json0000664000175000017500000000072215141516316024716 0ustar alastairalastair{ "basename": "wat-expr_08-74f99b7", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/expr_08.f90", "infile_hash": "f460199051316c12de52e28e19545464f7a017f68a9a9db6a590a328", "outfile": null, "outfile_hash": null, "stdout": "wat-expr_08-74f99b7.stdout", "stdout_hash": "57b3bcf972234bcd4dc79435b60a32707804678200403c8bbe8aaebe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-functions_14-f13c087.json0000664000175000017500000000076115141516316026107 0ustar alastairalastair{ "basename": "llvm-functions_14-f13c087", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_14.f90", "infile_hash": "5ab87388a802f87070be6ddbb2f9d862b4ac4cf7c07c2eafff2287f1", "outfile": null, "outfile_hash": null, "stdout": "llvm-functions_14-f13c087.stdout", "stdout_hash": "98080aa47cc7ec35859d4e8c8617cde80872dfddec8c28c06f5303cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-save4-99c3220.stderr0000664000175000017500000000046315141516316030274 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/save4.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/save4.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-template_struct_01-c320d7d.json0000664000175000017500000000100015141516316027163 0ustar alastairalastair{ "basename": "asr-template_struct_01-c320d7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_struct_01.f90", "infile_hash": "f66f5d6abfb085636af3a1f278953ef2297f93f3a209002272e6d1f8", "outfile": null, "outfile_hash": null, "stdout": "asr-template_struct_01-c320d7d.stdout", "stdout_hash": "140b910f823f0f2c1134c1482d4047adc06bb9162420b5ac02e15677", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_101-8ed52ae.json0000664000175000017500000000075315141516316025620 0ustar alastairalastair{ "basename": "llvm-arrays_101-8ed52ae", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_101.f90", "infile_hash": "2836e67268706a938da0f88016329436a3641b137b7f506855b0a304", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_101-8ed52ae.stdout", "stdout_hash": "9bab2360a85d1f2a375ea74932a0a92d81f3cdd1823a2a2bd451de96", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce-9789e1d.stdout0000664000175000017500000000030515141516316030643 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(+: s) s = s + a(i) end do end subroutine sum_reduce lfortran-lfortran-2f73434/tests/reference/fortran-real_to_integer_cast_fortran_codegen-d0b1495.json0000664000175000017500000000105515141516316033661 0ustar alastairalastair{ "basename": "fortran-real_to_integer_cast_fortran_codegen-d0b1495", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_integer_cast_fortran_codegen.f90", "infile_hash": "c22935c412aa471b719040d7dfe20e17562f068b634cfe1d80a82cbc", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_integer_cast_fortran_codegen-d0b1495.stdout", "stdout_hash": "bde59f8f082b356562ffd4aa721dad8c382393f080a05256c953f59e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-error_stop1-ccc2415.json0000664000175000017500000000075415141516316025742 0ustar alastairalastair{ "basename": "ast-error_stop1-ccc2415", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/error_stop1.f", "infile_hash": "4cc33f8c74237a43dc0babd1d81362d82c4e688fd2dfe008e32b73a2", "outfile": null, "outfile_hash": null, "stdout": "ast-error_stop1-ccc2415.stdout", "stdout_hash": "f00c7ead66b49ed45488f2d6a0c6824dae35ce6a5703f3c1fda6948f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine1-fdc40b3.json0000664000175000017500000000072615141516316026023 0ustar alastairalastair{ "basename": "ast-subroutine1-fdc40b3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine1-fdc40b3.stdout", "stdout_hash": "522465bcf29ea6cee23fd91313c1d21c73a291d11690341df76680ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c_target_cuda-openmp_71-261df19.stdout0000664000175000017500000001451015141516316027561 0ustar alastairalastair#include #include #include #include #include #include #ifdef USE_GPU #include #else #include"cuda_cpu_runtime.h" #endif struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations #ifdef USE_GPU __global__ #endif void compute_kernel_0(struct r32 *a, struct r32 *b, int i_n) { int i = blockIdx.x * blockDim.x + threadIdx.x + 1; if (i <= i_n) { a->data[((0 + (a->dims[0].stride * (i - a->dims[0].lower_bound))) + a->offset)] = (float)(i) + b->data[((0 + (b->dims[0].stride * (i - b->dims[0].lower_bound))) + b->offset)]*(float)(340); } } #ifndef USE_GPU void compute_kernel_0_wrapper(void **args) { struct r32 *a = *(struct r32**)args[0]; struct r32 *b = *(struct r32**)args[1]; int i_n = *(int*)args[2]; compute_kernel_0(a, b, i_n); } #endif #ifndef USE_GPU void compute_kernel_wrapper(void **args, void *func) { if (func == (void*)compute_kernel_0) { compute_kernel_0_wrapper(args); return; } fprintf(stderr, "Unknown kernel function\n"); exit(1); } #endif int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; struct r32 a_value; struct r32* a = &a_value; float *a_data; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 0; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float *b_data; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 0; b->dims[0].stride = 1; int32_t i; a->n_dims = 1; a->dims[0].lower_bound = 1; a->dims[0].length = 10000000; a->dims[0].stride = 1; a->data = (float*) _lfortran_malloc(1*a->dims[0].length*sizeof(float)); a->is_allocated = true; b->n_dims = 1; b->dims[0].lower_bound = 1; b->dims[0].length = 10000000; b->dims[0].stride = 1; b->data = (float*) _lfortran_malloc(1*b->dims[0].length*sizeof(float)); b->is_allocated = true; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[((0 + (b->dims[0].stride * (__libasr_index_0_ - b->dims[0].lower_bound))) + b->offset)] = (float)(5); } float *d_a_data = NULL; float *d_b_data = NULL; cudaError_t err; size_t a_data_size = a->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_a_data, a_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } size_t b_data_size = b->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_b_data, b_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_data, a->data, a_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_data, b->data, b_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 h_a_copy = *a; h_a_copy.data = d_a_data; struct r32 h_b_copy = *b; h_b_copy.data = d_b_data; struct r32 *d_a_struct = NULL; err = cudaMalloc((void**)&d_a_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 *d_b_struct = NULL; err = cudaMalloc((void**)&d_b_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_struct, &h_a_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_struct, &h_b_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } int i_n = 10000000; int threads_per_block = 256; int blocks = (i_n + threads_per_block - 1) / threads_per_block; dim3 grid_dim = {blocks, 1, 1}; dim3 block_dim = {threads_per_block, 1, 1}; void *kernel_args[] = {&d_a_struct, &d_b_struct, &i_n}; err = cudaLaunchKernel((void*)compute_kernel_0, grid_dim, block_dim, kernel_args, 0, NULL); if (err != cudaSuccess) { fprintf(stderr, "cudaLaunchKernel failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaDeviceSynchronize(); if (err != cudaSuccess) { fprintf(stderr, "cudaDeviceSynchronize failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(a->data, d_a_data, a_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(b->data, d_b_data, b_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } cudaFree(d_a_data); cudaFree(d_a_struct); cudaFree(d_b_data); cudaFree(d_b_struct); printf("%f%s%f\n", a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)], " ", b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)]); if (a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_28-7703b7d.json0000664000175000017500000000076115141516316026106 0ustar alastairalastair{ "basename": "asr-intrinsics_28-7703b7d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_28.f90", "infile_hash": "f45647d216365113f8bfc21ff79a6d9bad1d526431280aade87dd5b9", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_28-7703b7d.stdout", "stdout_hash": "1f8b0d5798b8d792961a8049b4a43c888b6cca134a4878974e59655b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind2-191347a.stderr0000664000175000017500000000017215141516316024661 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind2.f90:4:6 | 4 | real(*) a | ^ lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp6-556419a.json0000664000175000017500000000074415141516316026447 0ustar alastairalastair{ "basename": "asr_preprocess-cpp6-556419a", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp6.f90", "infile_hash": "656ffe7987384117872854f94922370f2be857b4aacef14bc6c74347", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp6-556419a.stderr", "stderr_hash": "5f480c0402858952c8e06d5fdc12736b09db6c1aaafc4cc7a3f0c897", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-functions_15-ce4c4bb.stdout0000664000175000017500000007307615141516316026520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_15: (Program (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 5 { f: (Variable 5 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 f) (IntrinsicElementalFunction Present [(Var 5 x)] 0 (Logical 4) () ) () .false. .false. )] (Var 5 f) Public .false. .false. () ), sub_1: (ExternalSymbol 4 sub_1 2 sub_1 functions_15_module_1 [] sub_1 Public ) }) functions_15 [functions_15_module_1] [(Assignment (Var 4 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 12.000000 (Real 4) )) ((IntegerConstant 5 (Integer 4) Decimal)) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) (()) (()) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) (()) ((IntegerConstant 78 (Integer 4) Decimal)) ((RealConstant 117.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 58.000000 (Real 4) )) (()) ((RealConstant 123.000000 (Real 4) ))] () .false. ) (Print (StringFormat () [(Var 4 a) (Var 4 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 4 a) NotEq (IntegerConstant 144288208 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 4 b) NotEq (RealConstant 1477476.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 4 f () [(())] (Logical 4) () () ) (FunctionCall 4 f () [((IntegerConstant 42 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_15_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] In () () Default (Real 4) () Source Public Optional .false. .false. .false. () .false. .false. ), e: (Variable 3 e [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), f: (Variable 3 f [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub_1 (FunctionType [(Integer 4) (Real 4) (Logical 4) (Real 4) (Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 e) (Var 3 f)] [(If () (IntrinsicElementalFunction Present [(Var 3 d)] 0 (Logical 4) () ) [(Assignment (Var 3 a) (Cast (RealBinOp (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (Var 3 d) (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 3 e)] 0 (Logical 4) () ) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] [(Assignment (Var 3 a) (Cast (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 3 e)] 0 (Logical 4) () ) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] )] () Public .false. .false. () ) }) functions_15_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit7-2fc9cda.stderr0000664000175000017500000000050115141516316026051 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit7.f90:4:14 | 4 | implicit real*8 (k) | ^ help: write this as 'real(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit7.f90:2:1 | 2 | implicit real (n) | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-derived_types_05-35150cd.json0000664000175000017500000000077215141516316026553 0ustar alastairalastair{ "basename": "asr-derived_types_05-35150cd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_05.f90", "infile_hash": "85f9d84172e5248d69383c57e1de14890ac154aec612e84a5253b502", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_05-35150cd.stdout", "stdout_hash": "045c13c65a2a20ec4d967d328d9f0c8825f4db8d424b325c37b2ff38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_29-75ca0a0.json0000664000175000017500000000071515141516316025273 0ustar alastairalastair{ "basename": "run-format_29-75ca0a0", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_29.f90", "infile_hash": "aa0372ac3a2fd155e624df2b5e21032f0fea28f9b97dedb127fdaeb7", "outfile": null, "outfile_hash": null, "stdout": "run-format_29-75ca0a0.stdout", "stdout_hash": "4dab09a4ac764306403c70a659731bc69757ed28b130ef1d2d1f46d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics3-a8fd035.stderr0000664000175000017500000000026115141516316026262 0ustar alastairalastairsemantic error: `pos` argument of `ibclr` intrinsic must be non-negative --> tests/errors/intrinsics3.f90:2:14 | 2 | print *, ibclr(1, -2) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-logical4-b4e6b33.stdout0000664000175000017500000000466115141516316025722 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"L,L,L\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i1, align 1 %b = alloca i1, align 1 %c = alloca i1, align 1 store i1 true, i1* %a, align 1 store i1 true, i1* %b, align 1 store i1 false, i1* %c, align 1 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i1* %a, i1* %b, i1* %c) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_logical4 FINALIZE_SYMTABLE_logical4: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-arrays_08_func-2759ced.stdout0000664000175000017500000006552615141516316026703 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_08_func: (Program (SymbolTable 2 { copy_from_to: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Out () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) copy_from_to (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), verify: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) verify (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 r) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 a) () (Integer 4) () ) ()) [(Assignment (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] [] )] (Var 4 r) Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_08_func [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (SubroutineCall 2 copy_from_to () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 y) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Assignment (Var 2 r) (FunctionCall 2 verify () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 y) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Logical 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalNot (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_04-056d321.stdout0000664000175000017500000003021215141516316025331 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_04: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_04 [] [(Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Mul (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Mul (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Add (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Add (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Add (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Sub (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Sub (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Sub (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Sub (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerBinOp (Var 2 i) Div (Var 2 i) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Div (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Div (Var 2 r) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (Var 2 r) Div (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-fma-8bc0756.json0000664000175000017500000000072315141516316024152 0ustar alastairalastair{ "basename": "asr-fma-8bc0756", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/fma.f90", "infile_hash": "e251a7a68d3ac5b04630dacfdd015452826bc4e6954b51124d815868", "outfile": null, "outfile_hash": null, "stdout": "asr-fma-8bc0756.stdout", "stdout_hash": "e65f3d8c3145cb25047f5424ba826f4ad2ff1fb0b19f7c1a0e37c85a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_03_transfer-4fcb3e2.stdout0000664000175000017500000000374715141516316027447 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_03_transfer: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 21432 (Integer 4) Decimal) (IntegerConstant 21432 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_03_transfer [] [(Print (StringFormat () [(BitCast (Var 2 x) (RealConstant 1.000000 (Real 4) ) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp5-4cb2070.json0000664000175000017500000000074415141516316026511 0ustar alastairalastair{ "basename": "asr_preprocess-cpp5-4cb2070", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp5.f90", "infile_hash": "832e876e424e62ff86e263b3f4b23c6915146d7945e1ffab15b38295", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp5-4cb2070.stderr", "stderr_hash": "d82165bd15ac925ce36d0a305b55e0ef8d8fc2ea38ad7aac95b0635c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics9-4da86d0.json0000664000175000017500000000073515141516316025744 0ustar alastairalastair{ "basename": "asr-intrinsics9-4da86d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics9.f90", "infile_hash": "8294de283855321ea1d1c2b9a944c6beaf51fe1891a8a08cb8dec654", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics9-4da86d0.stderr", "stderr_hash": "b9a8671e623444b8fd1abbf855824ec278aaa06a74993ae4faedfed4", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_06-1ab6665.stdout0000664000175000017500000005032115141516316026642 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_06: (Program (SymbolTable 7 { assign_large: (ExternalSymbol 7 assign_large 2 assign_large subroutines_06_bitset [] assign_large Public ), assign_logint8_large: (ExternalSymbol 7 assign_logint8_large 2 assign_logint8_large subroutines_06_bitset [] assign_logint8_large Public ), error_handler: (ExternalSymbol 7 error_handler 2 error_handler subroutines_06_bitset [] error_handler Public ), error_handler~genericprocedure: (ExternalSymbol 7 error_handler~genericprocedure 2 error_handler~genericprocedure subroutines_06_bitset [] error_handler~genericprocedure Public ), ~assign: (ExternalSymbol 7 ~assign 2 ~assign subroutines_06_bitset [] ~assign Public ) }) subroutines_06 [subroutines_06_bitset] [] ), subroutines_06_bitset: (Module (SymbolTable 2 { assign_large: (Function (SymbolTable 3 { set1: (Variable 3 set1 [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), set2: (Variable 3 set2 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) assign_large (FunctionType [(Integer 4) (Integer 4)] () Source Interface () .false. .true. .true. .false. .false. [] .false. ) [] [(Var 3 set1) (Var 3 set2)] [] () Public .false. .false. () ), assign_logint8_large: (Function (SymbolTable 4 { logical_vector: (Variable 4 logical_vector [] In () () Default (Array (Logical 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) assign_logint8_large (FunctionType [(Integer 4) (Array (Logical 4) [(() ())] DescriptorArray )] () Source Interface () .false. .true. .true. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 logical_vector)] [] () Public .false. .false. () ), error_handler: (GenericProcedure 2 error_handler [2 error_handler~genericprocedure] Public ), error_handler~genericprocedure: (Function (SymbolTable 6 { error: (Variable 6 error [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), message: (Variable 6 message [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), module: (Variable 6 module [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), procedure: (Variable 6 procedure [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), status: (Variable 6 status [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) error_handler~genericprocedure (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 6 message) (Var 6 error) (Var 6 status) (Var 6 module) (Var 6 procedure)] [(Print (StringFormat () [(Var 6 error) (Var 6 status)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), ~assign: (CustomOperator 2 ~assign [2 assign_large 2 assign_logint8_large] Public ) }) subroutines_06_bitset () [] .false. .false. .true. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-generic_name_01-d3550a6.stdout0000664000175000017500000004256415141516316027063 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %complextype_class = type <{ i32 (...)**, %complextype* }> %complextype = type { float, float } @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [27 x i8] c"Calling integer_add_subrout" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data, i32 0, i32 0), i64 27 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [24 x i8] c"Calling real_add_subrout" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([24 x i8], [24 x i8]* @string_const_data.1, i32 0, i32 0), i64 24 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Name_complextype = private unnamed_addr constant [12 x i8] c"complextype\00", align 1 @_Type_Info_complextype = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @_Name_complextype, i32 0, i32 0) }, align 8 @_VTable_complextype = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_complextype to i8*), i8* bitcast (void (i8*, i8*)* @_copy_complex_module_complextype to i8*), i8* bitcast (void (i8**)* @_allocate_struct_complex_module_complextype to i8*), i8* bitcast (void (%complextype_class*, i32*, i32*, %complextype*)* @__module_complex_module_integer_add_subrout to i8*), i8* bitcast (void (%complextype_class*, float*, float*, %complextype*)* @__module_complex_module_real_add_subrout to i8*)] }, align 8 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_complex_module_integer_add_subrout(%complextype_class* %this, i32* %r, i32* %i, %complextype* %sum) { .entry: %0 = getelementptr %complextype, %complextype* %sum, i32 0, i32 1 %1 = getelementptr %complextype, %complextype* %sum, i32 0, i32 0 %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %3 = getelementptr %complextype, %complextype* %sum, i32 0, i32 0 %4 = getelementptr %complextype_class, %complextype_class* %this, i32 0, i32 1 %5 = load %complextype*, %complextype** %4, align 8 %6 = getelementptr %complextype, %complextype* %5, i32 0, i32 0 %7 = load float, float* %6, align 4 %8 = load i32, i32* %r, align 4 %9 = sitofp i32 %8 to float %10 = fadd float %7, %9 store float %10, float* %3, align 4 %11 = getelementptr %complextype, %complextype* %sum, i32 0, i32 1 %12 = getelementptr %complextype_class, %complextype_class* %this, i32 0, i32 1 %13 = load %complextype*, %complextype** %12, align 8 %14 = getelementptr %complextype, %complextype* %13, i32 0, i32 1 %15 = load float, float* %14, align 4 %16 = load i32, i32* %i, align 4 %17 = sitofp i32 %16 to float %18 = fadd float %15, %17 store float %18, float* %11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_integer_add_subrout FINALIZE_SYMTABLE_integer_add_subrout: ; preds = %return ret void } define void @__module_complex_module_real_add_subrout(%complextype_class* %this, float* %r, float* %i, %complextype* %sum) { .entry: %0 = getelementptr %complextype, %complextype* %sum, i32 0, i32 1 %1 = getelementptr %complextype, %complextype* %sum, i32 0, i32 0 %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %2, i32 24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %3 = getelementptr %complextype, %complextype* %sum, i32 0, i32 0 %4 = getelementptr %complextype_class, %complextype_class* %this, i32 0, i32 1 %5 = load %complextype*, %complextype** %4, align 8 %6 = getelementptr %complextype, %complextype* %5, i32 0, i32 0 %7 = load float, float* %6, align 4 %8 = load float, float* %r, align 4 %9 = fadd float %7, %8 store float %9, float* %3, align 4 %10 = getelementptr %complextype, %complextype* %sum, i32 0, i32 1 %11 = getelementptr %complextype_class, %complextype_class* %this, i32 0, i32 1 %12 = load %complextype*, %complextype** %11, align 8 %13 = getelementptr %complextype, %complextype* %12, i32 0, i32 1 %14 = load float, float* %13, align 4 %15 = load float, float* %i, align 4 %16 = fadd float %14, %15 store float %16, float* %10, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_real_add_subrout FINALIZE_SYMTABLE_real_add_subrout: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca %complextype, align 8 %2 = getelementptr %complextype, %complextype* %a, i32 0, i32 1 %3 = getelementptr %complextype, %complextype* %a, i32 0, i32 0 %c = alloca %complextype, align 8 %4 = getelementptr %complextype, %complextype* %c, i32 0, i32 1 %5 = getelementptr %complextype, %complextype* %c, i32 0, i32 0 %fpone = alloca float, align 4 %fptwo = alloca float, align 4 %fpzero = alloca float, align 4 %ione = alloca i32, align 4 %izero = alloca i32, align 4 %negfpone = alloca float, align 4 store float 1.000000e+00, float* %fpone, align 4 store float 2.000000e+00, float* %fptwo, align 4 store float 0.000000e+00, float* %fpzero, align 4 store i32 1, i32* %ione, align 4 store i32 0, i32* %izero, align 4 store float -1.000000e+00, float* %negfpone, align 4 %6 = getelementptr %complextype, %complextype* %c, i32 0, i32 0 %7 = load float, float* %fpone, align 4 store float %7, float* %6, align 4 %8 = getelementptr %complextype, %complextype* %c, i32 0, i32 1 %9 = load float, float* %fptwo, align 4 store float %9, float* %8, align 4 %10 = alloca %complextype_class, align 8 %11 = getelementptr %complextype_class, %complextype_class* %10, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %11, align 8 %12 = getelementptr %complextype_class, %complextype_class* %10, i32 0, i32 1 store %complextype* %c, %complextype** %12, align 8 call void @__module_complex_module_integer_add_subrout(%complextype_class* %10, i32* %ione, i32* %izero, %complextype* %a) %13 = alloca i64, align 8 %14 = getelementptr %complextype, %complextype* %a, i32 0, i32 0 %15 = load float, float* %14, align 4 %16 = alloca float, align 4 store float %15, float* %16, align 4 %17 = getelementptr %complextype, %complextype* %a, i32 0, i32 1 %18 = load float, float* %17, align 4 %19 = alloca float, align 4 store float %18, float* %19, align 4 %20 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %13, i32 0, i32 0, float* %16, float* %19) %21 = load i64, i64* %13, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %20, i8** %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %21, i64* %23, align 4 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %27 = load i64, i64* %26, align 4 %28 = trunc i64 %27 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %25, i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %29 = icmp eq i8* %20, null br i1 %29, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %20) br label %free_done free_done: ; preds = %free_nonnull, %.entry %30 = getelementptr %complextype, %complextype* %a, i32 0, i32 0 %31 = load float, float* %30, align 4 %32 = fcmp une float %31, 2.000000e+00 br i1 %32, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %33 = getelementptr %complextype, %complextype* %a, i32 0, i32 1 %34 = load float, float* %33, align 4 %35 = fcmp une float %34, 2.000000e+00 br i1 %35, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %36 = alloca %complextype_class, align 8 %37 = getelementptr %complextype_class, %complextype_class* %36, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %37, align 8 %38 = getelementptr %complextype_class, %complextype_class* %36, i32 0, i32 1 store %complextype* %c, %complextype** %38, align 8 call void @__module_complex_module_real_add_subrout(%complextype_class* %36, float* %fpzero, float* %negfpone, %complextype* %a) %39 = alloca i64, align 8 %40 = getelementptr %complextype, %complextype* %a, i32 0, i32 0 %41 = load float, float* %40, align 4 %42 = alloca float, align 4 store float %41, float* %42, align 4 %43 = getelementptr %complextype, %complextype* %a, i32 0, i32 1 %44 = load float, float* %43, align 4 %45 = alloca float, align 4 store float %44, float* %45, align 4 %46 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.3, i32 0, i32 0), i64* %39, i32 0, i32 0, float* %42, float* %45) %47 = load i64, i64* %39, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %46, i8** %48, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %47, i64* %49, align 4 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %51 = load i8*, i8** %50, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %53 = load i64, i64* %52, align 4 %54 = trunc i64 %53 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %51, i32 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %55 = icmp eq i8* %46, null br i1 %55, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %ifcont3 call void @_lfortran_free(i8* %46) br label %free_done6 free_done6: ; preds = %free_nonnull5, %ifcont3 %56 = getelementptr %complextype, %complextype* %a, i32 0, i32 0 %57 = load float, float* %56, align 4 %58 = fcmp une float %57, 1.000000e+00 br i1 %58, label %then7, label %else8 then7: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %free_done6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %59 = getelementptr %complextype, %complextype* %a, i32 0, i32 1 %60 = load float, float* %59, align 4 %61 = fcmp une float %60, 1.000000e+00 br i1 %61, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont12 br label %FINALIZE_SYMTABLE_generic_name_01 FINALIZE_SYMTABLE_generic_name_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) define linkonce_odr void @_copy_complex_module_complextype(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %complextype* %3 = bitcast i8* %1 to %complextype* %4 = getelementptr %complextype, %complextype* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %complextype, %complextype* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %complextype, %complextype* %2, i32 0, i32 1 %8 = load float, float* %7, align 4 %9 = getelementptr %complextype, %complextype* %3, i32 0, i32 1 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 ret void } define linkonce_odr void @_allocate_struct_complex_module_complextype(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %complextype_class* %4 = bitcast %complextype_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_complextype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %complextype_class, %complextype_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 8, i1 false) %7 = bitcast i8* %6 to %complextype* store %complextype* %7, %complextype** %5, align 8 %8 = getelementptr %complextype, %complextype* %7, i32 0, i32 1 %9 = getelementptr %complextype, %complextype* %7, i32 0, i32 0 ret void } declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-loop_test1-716ccb0.json0000664000175000017500000000073615141516316025553 0ustar alastairalastair{ "basename": "asr-loop_test1-716ccb0", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", "infile_hash": "149b2f607c4d8b4b89d207ac9353585e75ab55fd9c2520f7da02ffee", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_test1-716ccb0.stdout", "stdout_hash": "eef9ea19fb6113b6cc46dce6508657fb3324d9df0a4c0570f449904a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_logical-6bf4989.json0000664000175000017500000000101515141516316031102 0ustar alastairalastair{ "basename": "asr-kind_invalid_int_of_logical-6bf4989", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_invalid_int_of_logical.f90", "infile_hash": "444c16d3b37a92613ff4136513d5b51910e6f9f2e75fd0347f1aec68", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_invalid_int_of_logical-6bf4989.stderr", "stderr_hash": "0703b2ebce8bb17026ed4528f568db013a8eda1f67d5b461d8e6fb3a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-common1-bbe229a.stderr0000664000175000017500000000024415141516316025440 0ustar alastairalastairsemantic error: Duplicate DIMENSION attribute specified --> tests/errors/common1.f90:3:20 | 3 | common /rowns/ rowns(209) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-array_size_02-94fb4d3.json0000664000175000017500000000074315141516316026143 0ustar alastairalastair{ "basename": "asr-array_size_02-94fb4d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_02.f90", "infile_hash": "dec46004e57793955ce8aada1f3ec5dd21b7f5abe9f436f1cd9a341d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_02-94fb4d3.stderr", "stderr_hash": "954027eda0ea7fcdede13263e3b29773db3374152d90a6b0f455d1c0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/julia-modules_12-09f81d9.stdout0000664000175000017500000000022515141516316026254 0ustar alastairalastairmodule module_12 end function main() a[5] = 5 if a[5] ≠ 5 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-nullify_03-e2c1d62.stdout0000664000175000017500000005631715141516316026026 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_nullify_03: (Module (SymbolTable 2 { mxdim: (Variable 2 mxdim [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), rp1d: (Struct (SymbolTable 3 { f: (Variable 3 f [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) rp1d (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [f] [] Source Public .false. .false. [] () () ), sds: (Struct (SymbolTable 4 { dims: (Variable 4 dims [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 4 f [] Local () () Default (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), hdf32: (Variable 4 hdf32 [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), ndim: (Variable 4 ndim [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), scales: (Variable 4 scales [] Local () () Default (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) 2 rp1d Source Public Required .false. .false. .false. () .false. .false. ) }) sds (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) ) (Logical 4) (Integer 4) (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) [] [ndim dims hdf32 scales f] [] Source Public .false. .false. [] () () ) }) module_nullify_03 () [] .false. .false. .false. ), nullify_03: (Program (SymbolTable 5 { 1_rp1d_f: (ExternalSymbol 5 1_rp1d_f 3 f rp1d [] f Public ), 1_sds_scales: (ExternalSymbol 5 1_sds_scales 4 scales sds [] scales Public ), rp1d: (ExternalSymbol 5 rp1d 2 rp1d module_nullify_03 [] rp1d Public ), s: (Variable 5 s [] Local () () Default (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Pointer (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) ) (Logical 4) (Integer 4) (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) 5 sds Source Public Required .false. .false. .false. () .false. .false. ), sds: (ExternalSymbol 5 sds 2 sds module_nullify_03 [] sds Public ) }) nullify_03 [module_nullify_03] [(Nullify [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout0000664000175000017500000000027415141516316031577 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Continue 0 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor11-dc5b2d5.json0000664000175000017500000000077315141516316030703 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor11-dc5b2d5", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor11.f90", "infile_hash": "dd7b363224d526463b7ce535007b839ea7d9264d1b28f7bf7bbf6e7b", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor11-dc5b2d5.stdout", "stdout_hash": "5ffb62fac3e94cd76864d0780e3a1ac21008c453de524da9f97860b6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-string_03-fc56745.json0000664000175000017500000000074515141516316025232 0ustar alastairalastair{ "basename": "ast-string_03-fc56745", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "ast-string_03-fc56745.stdout", "stdout_hash": "79fe0a00170474e0c40801f0d1861cf26afdfed4f29658e0a6075ee2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-string_10-ef0078f.json0000664000175000017500000000075015141516316025463 0ustar alastairalastair{ "basename": "llvm-string_10-ef0078f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_10.f90", "infile_hash": "bc81968bc899cbe447092923c9b089e1942c9ecf0bad33ee7145f2a9", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_10-ef0078f.stdout", "stdout_hash": "9f6f8f69006fc7abd0ed3575ba1c699f137d982eae286d0b8c041fd6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_assgn_test-4df3c08.json0000664000175000017500000000074615141516316026474 0ustar alastairalastair{ "basename": "asr-dim_assgn_test-4df3c08", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_assgn_test.f90", "infile_hash": "d645a2f1de1318c79a1e0d8013eeaf44cff21b86fa0371175e826334", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_assgn_test-4df3c08.stderr", "stderr_hash": "89c7bac1821ec608f839ec79381424c02e818b80683bddfd0036ca32", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-data3-0afaffe.stdout0000664000175000017500000007243415141516316025256 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { datatest: (Program (SymbolTable 2 { axva: (Variable 2 axva [] Local (ComplexConstant -234.229996 3.000000 (Complex 4) ) (ComplexConstant -234.229996 3.000000 (Complex 4) ) Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), axvb: (Variable 2 axvb [] Local (ComplexConstant 2.000000 -3.000000 (Complex 4) ) (ComplexConstant 2.000000 -3.000000 (Complex 4) ) Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon01: (Variable 2 ivon01 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon02: (Variable 2 ivon02 [] Local (IntegerConstant 76 (Integer 4) Decimal) (IntegerConstant 76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon03: (Variable 2 ivon03 [] Local (IntegerConstant 587 (Integer 4) Decimal) (IntegerConstant 587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon04: (Variable 2 ivon04 [] Local (IntegerConstant 9999 (Integer 4) Decimal) (IntegerConstant 9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon05: (Variable 2 ivon05 [] Local (IntegerConstant 21111 (Integer 4) Decimal) (IntegerConstant 21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon06: (Variable 2 ivon06 [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon07: (Variable 2 ivon07 [] Local (IntegerConstant 76 (Integer 4) Decimal) (IntegerConstant 76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon08: (Variable 2 ivon08 [] Local (IntegerConstant 587 (Integer 4) Decimal) (IntegerConstant 587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon09: (Variable 2 ivon09 [] Local (IntegerConstant 9999 (Integer 4) Decimal) (IntegerConstant 9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon10: (Variable 2 ivon10 [] Local (IntegerConstant 21111 (Integer 4) Decimal) (IntegerConstant 21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon11: (Variable 2 ivon11 [] Local (IntegerConstant -3 (Integer 4) Decimal) (IntegerConstant -3 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon12: (Variable 2 ivon12 [] Local (IntegerConstant -76 (Integer 4) Decimal) (IntegerConstant -76 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon13: (Variable 2 ivon13 [] Local (IntegerConstant -587 (Integer 4) Decimal) (IntegerConstant -587 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon14: (Variable 2 ivon14 [] Local (IntegerConstant -9999 (Integer 4) Decimal) (IntegerConstant -9999 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon15: (Variable 2 ivon15 [] Local (IntegerConstant -21111 (Integer 4) Decimal) (IntegerConstant -21111 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon16: (Variable 2 ivon16 [] Local (IntegerConstant 119 (Integer 4) Decimal) (IntegerConstant 119 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon17: (Variable 2 ivon17 [] Local (IntegerConstant 119 (Integer 4) Decimal) (IntegerConstant 119 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon18: (Variable 2 ivon18 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon19: (Variable 2 ivon19 [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivon20: (Variable 2 ivon20 [] Local (IntegerConstant -427 (Integer 4) Decimal) (IntegerConstant -427 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), vals: (Variable 2 vals [] Local (ArrayConstant 20 [2, 76, 587, 9999, 21111] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [2, 76, 587, 9999, 21111] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) datatest [] [(Assignment (Var 2 ivon01) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon02) (IntegerConstant 76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon03) (IntegerConstant 587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon04) (IntegerConstant 9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon05) (IntegerConstant 21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon06) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon07) (IntegerConstant 76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon08) (IntegerConstant 587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon09) (IntegerConstant 9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon10) (IntegerConstant 21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon11) (IntegerConstant -3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon12) (IntegerConstant -76 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon13) (IntegerConstant -587 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon14) (IntegerConstant -9999 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon15) (IntegerConstant -21111 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon16) (IntegerConstant 119 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon17) (IntegerConstant 119 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon18) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon19) (IntegerConstant 7 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 ivon20) (IntegerConstant -427 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 axva) (ComplexConstant -234.229996 3.000000 (Complex 4) ) () .false. .false. ) (Assignment (Var 2 axvb) (ComplexConstant 2.000000 -3.000000 (Complex 4) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_argument_casting_01-2274b4b.stdout0000664000175000017500000005777715141516316031521 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idz_realcomp: (Function (SymbolTable 2 { a: (Variable 2 a [n] Unspecified () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) idz_realcomp (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 a)] [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 12.500000 (Real 8) ) (IntrinsicArrayFunction Shape [(Var 2 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () ) () .false. .false. )] () Public .false. .false. () ), main: (Program (SymbolTable 3 { dp: (Variable 3 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), idzp_svd: (Function (SymbolTable 4 { isi: (Variable 4 isi [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ls: (Variable 4 ls [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 4 w [] Unspecified () () Default (Array (Complex 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), w_cast: (Variable 4 w_cast [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) idzp_svd (FunctionType [(Integer 4) (Array (Complex 8) [(() ())] UnboundedPointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [idz_realcomp] [(Var 4 ls) (Var 4 w)] [(Assignment (Var 4 isi) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (CPtrToPointer (PointerToCPtr (GetPointer (ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () ) (Pointer (Complex 8) ) () ) (CPtr) () ) (Var 4 w_cast) (ArrayConstant 4 [1000] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () ) (SubroutineCall 1 idz_realcomp () [((IntegerBinOp (Var 4 ls) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((ArrayPhysicalCast (Var 4 w_cast) DescriptorArray PointerArray (Pointer (Array (Real 8) [(() ())] PointerArray ) ) () ))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(ArrayItem (Var 4 w) [(() (Var 4 isi) ())] (Complex 8) ColMajor () )] 0 (Real 8) () ) Sub (RealConstant 12.500000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), w: (Variable 3 w [] Local () () Default (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(SubroutineCall 3 idzp_svd () [((IntegerConstant 5 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 3 w) FixedSizeArray UnboundedPointerArray (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] UnboundedPointerArray ) () ))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array3-7b1ab3b.json0000664000175000017500000000070715141516316024735 0ustar alastairalastair{ "basename": "asr-array3-7b1ab3b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "asr-array3-7b1ab3b.stdout", "stdout_hash": "469684f11b956c6fae89de89b0cc601a9fc426278de1bac215e1b4df", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-cpu_time_02_wasm-fa2b15f.json0000664000175000017500000000075515141516316026707 0ustar alastairalastair{ "basename": "wat-cpu_time_02_wasm-fa2b15f", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/cpu_time_02_wasm.f90", "infile_hash": "a1e29e7dd66632a416de6ea346443bea443af6734ccb35801c77cf09", "outfile": null, "outfile_hash": null, "stdout": "wat-cpu_time_02_wasm-fa2b15f.stdout", "stdout_hash": "0ca4269517c69a129d718045702784b3fb3462d6f70b3e15e0a1ce75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-return1-517cbf1.stderr0000664000175000017500000000071715141516316025420 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:8:11 | 8 | if (i .eq. a) return 1 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:9:11 | 9 | if (i .eq. b) return 2 | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/return1.f90:10:11 | 10 | if (i .eq. c) return 3 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-types_03-f0b782e.json0000664000175000017500000000074215141516316025135 0ustar alastairalastair{ "basename": "asr-types_03-f0b782e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "asr-types_03-f0b782e.stdout", "stdout_hash": "df6be4ce61ff472dd204f1d14f6dc39d1d6966b90cf9a1f4e2f0d67c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-case_02-cf1eb8d.json0000664000175000017500000000073715141516316025050 0ustar alastairalastair{ "basename": "ast-case_02-cf1eb8d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "ast-case_02-cf1eb8d.stdout", "stdout_hash": "2e5de1b8f68962eb6066ffec0ed52e76873db31cbbe5305b5104fac3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-flush2-9767ece.stderr0000664000175000017500000000103115141516316025230 0ustar alastairalastairwarning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:3:5 | 3 | call flush() | ^^^^^^^^^^^^ help: use the 'flush' statement instead warning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:5:5 | 5 | call flush(10) | ^^^^^^^^^^^^^^ help: use the 'flush' statement instead warning: The 'flush' intrinsic function is an LFortran extension --> tests/flush2.f90:6:5 | 6 | call flush() | ^^^^^^^^^^^^ help: use the 'flush' statement instead lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_01-33c47db.json0000664000175000017500000000116115141516316030370 0ustar alastairalastair{ "basename": "llvm-operator_overloading_01-33c47db", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_01.f90", "infile_hash": "f44f3172b4b5235b41deb5a4d4eaadc61a6b7c51e002a983889cf38f", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_01-33c47db.stdout", "stdout_hash": "754716c6e3bb76edac340539b4883be6abecd1b5c6d6786f0553813b", "stderr": "llvm-operator_overloading_01-33c47db.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-loop_test4-17c3803.json0000664000175000017500000000073615141516316025423 0ustar alastairalastair{ "basename": "ast-loop_test4-17c3803", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test4.f", "infile_hash": "c096d4180aaa691479e1ff9a28223a68a1bfbe4782d5d0fdce56cd96", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test4-17c3803.stdout", "stdout_hash": "bec01955a197e961a77bf19803429c0cba356f40029a4359f7a0bf38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-min_02-21863aa.stdout0000664000175000017500000000556515141516316025044 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { min_02: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) min_02 [] [(Print (StringFormat () [(IntrinsicElementalFunction Min [(Var 2 y) (Cast (Var 2 z) IntegerToInteger (Integer 8) () )] 0 (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-max_02-646ff6d.stderr0000664000175000017500000000036115141516316025114 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/max_02.f90:4:14 | 4 | print *, max(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-lfortran-2f73434/tests/reference/asr-bindc2-62a702e.json0000664000175000017500000000073415141516316024542 0ustar alastairalastair{ "basename": "asr-bindc2-62a702e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc2.f90", "infile_hash": "ac42ec8ae9572d40e2a2cff1d0f164d298724aaf2d6bc3644495919c", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc2-62a702e.stdout", "stdout_hash": "c847ca52f2081b2dff5658d2a043ae35ff34d8646058b501c2e200cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_04-e8b402f.stdout0000664000175000017500000011513415141516316026662 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { class_default_select_type: (Module (SymbolTable 12 { enum_stat: (Struct (SymbolTable 13 { fatal: (Variable 13 fatal [] Local (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant -1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), success: (Variable 13 success [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) enum_stat (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [success fatal] [] Source Public .false. .false. [] () () ), toml_stat: (Variable 12 toml_stat [] Local (StructConstant 12 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 12 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 12 enum_stat Source Public Required .false. .false. .false. () .false. .false. ) }) class_default_select_type () [] .true. .false. .false. ), class_default_select_type_user: (Module (SymbolTable 4 { 1_enum_stat: (ExternalSymbol 4 1_enum_stat 12 enum_stat class_default_select_type [] enum_stat Public ), check_table: (Function (SymbolTable 7 { tab: (Variable 7 tab [] Out () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) check_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 tab)] [(Print (StringConstant "inside check_table" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), get_table: (Function (SymbolTable 8 { ptr: (Variable 8 ptr [] Out () () Default (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 8 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 8 tmp [] Local () () Default (Pointer (StructType [(Real 4) (Integer 4)] [] .false. .false. ) ) 4 toml_value Source Public Required .false. .false. .false. () .false. .false. ), ~select_type_block_: (Block (SymbolTable 9 { 1_enum_stat_success: (ExternalSymbol 9 1_enum_stat_success 13 success 1_enum_stat [] success Public ) }) ~select_type_block_ [(Associate (Var 8 ptr) (Var 8 tmp) ) (If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 4 toml_stat) 9 1_enum_stat_success (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. )] [] )] ), ~select_type_block_1: (Block (SymbolTable 10 { 1_enum_stat_fatal: (ExternalSymbol 10 1_enum_stat_fatal 13 fatal 1_enum_stat [] fatal Public ) }) ~select_type_block_1 [(If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 4 toml_stat) 10 1_enum_stat_fatal (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. )] [] )] ) }) get_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. ) (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check_table] [(Var 8 table) (Var 8 ptr) (Var 8 stat)] [(Nullify [(Var 8 ptr)] ) (If () (PointerAssociated (Var 8 tmp) () (Logical 4) () ) [(SelectType (Var 8 tmp) () [(TypeStmtName 4 toml_table [(BlockCall -1 8 ~select_type_block_ )] )] [(BlockCall -1 8 ~select_type_block_1 )] )] [(SubroutineCall 4 check_table () [((Var 8 table))] () .false. )] )] () Public .false. .false. () ), toml_stat: (ExternalSymbol 4 toml_stat 12 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (Struct (SymbolTable 5 { implicit: (Variable 5 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), inline: (Variable 5 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () 4 toml_value ), toml_value: (Struct (SymbolTable 6 { float: (Variable 6 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), int: (Variable 6 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Real 4) (Integer 4)] [] .true. .false. ) [] [int float] [] Source Public .false. .false. [] () () ) }) class_default_select_type_user () [class_default_select_type] .true. .false. .false. ), class_default_select_type_user1: (Module (SymbolTable 2 { 1_enum_stat: (ExternalSymbol 2 1_enum_stat 12 enum_stat class_default_select_type [] enum_stat Public ), check_table: (ExternalSymbol 2 check_table 4 check_table class_default_select_type_user [] check_table Public ), get_table: (ExternalSymbol 2 get_table 4 get_table class_default_select_type_user [] get_table Public ), toml_stat: (ExternalSymbol 2 toml_stat 12 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (ExternalSymbol 2 toml_table 4 toml_table class_default_select_type_user [] toml_table Public ), toml_value: (ExternalSymbol 2 toml_value 4 toml_value class_default_select_type_user [] toml_value Public ) }) class_default_select_type_user1 () [class_default_select_type_user] .false. .false. .false. ), select_type4: (Program (SymbolTable 14 { }) select_type4 [] [(Print (StringConstant "running select_type4 main program" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-types_16-57fa580.json0000664000175000017500000000072515141516316025072 0ustar alastairalastair{ "basename": "wat-types_16-57fa580", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_16.f90", "infile_hash": "c130af47594694449f9ae111b8985bb8567fd26e86979d127d34257b", "outfile": null, "outfile_hash": null, "stdout": "wat-types_16-57fa580.stdout", "stdout_hash": "e7efdb76ed1f94383db835c81d3ec1480fcda1d05021e936889732f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr2-52dd466.stdout0000664000175000017500000000004115141516316025013 0ustar alastairalastair(TranslationUnit [(+ 5 3)] ) lfortran-lfortran-2f73434/tests/reference/asr-more_kwargs_than_acceptable_to_subroutine-a276855.json0000664000175000017500000000106715141516316034012 0ustar alastairalastair{ "basename": "asr-more_kwargs_than_acceptable_to_subroutine-a276855", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/more_kwargs_than_acceptable_to_subroutine.f90", "infile_hash": "53bcdc1ab7927132cd66432768e210576758731906f98e632f7d9874", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-more_kwargs_than_acceptable_to_subroutine-a276855.stderr", "stderr_hash": "17aa57c1237631cb4ad11a7f81f495e987f715d878fddd46a7b660c2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-critical1-98f603a.stdout0000664000175000017500000001241215141516316025635 0ustar alastairalastair(TranslationUnit [(Program critical1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(joblist [] [(() () CodimensionStar)] () () None ()) (job [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(IntegerSample [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 50 Value)] () () None ) [] [(Sample [] [] () () None ())] () )] [(If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(Read 0 () [(()) (())] [] [joblist] () )] [] () () () ) (SyncAll 0 [] () ) (DoLoop 0 () 0 () () () () [(Critical 0 () [] [(Assignment 0 job (CoarrayRef joblist [] [] [] [(() 1 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef joblist [] [] [] [(() 1 () CodimensionExpr)] [] ) (- job 1) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! >>>>>>>> Syntax check(AST) >>>>>>>>" )] ) ) (Critical 0 () [] [(Assignment 0 IntegerSample 0 () )] () () ) (Critical 0 () [(AttrStat IntegerSample )] [(Assignment 0 Sample (String "Error message" ()) () )] () () ) (Critical 0 () [(AttrErrmsg Sample )] [(Assignment 0 Sample (String "Error message" ()) () )] () (TriviaNode [] [(EndOfLine) (Comment "! <<<<<<<< Syntax check(AST) <<<<<<<<" ) (EndOfLine)] ) ) (If 0 () (> job 0) [(Assignment 0 b (+ (** a 2) (** b 2)) () )] [(Exit 0 () () )] () () () )] () () ) (SyncAll 0 [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_error_07-e57f5fc.stderr0000664000175000017500000000026515141516316027442 0ustar alastairalastairsemantic error: The number of parameters passed to 'r' is not correct --> tests/errors/template_error_07.f90:15:20 | 15 | require :: r(t) | ^^^^ lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp1-3056a3e.stdout0000664000175000017500000002207015141516316026704 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { increment_ctr: (Function (SymbolTable 2 { ctr: (Variable 2 ctr [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), local_ctr: (Variable 2 local_ctr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) increment_ctr (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 ctr)] [(OMPRegion Parallel [(OMPPrivate [(Var 2 i)] ) (OMPReduction ReduceAdd [(Var 2 local_ctr)] )] [(OMPRegion Do [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (Var 2 local_ctr) (IntegerBinOp (Var 2 local_ctr) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] )] )] ) (Assignment (Var 2 ctr) (IntegerBinOp (Var 2 ctr) Add (Var 2 local_ctr) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), openmp1: (Program (SymbolTable 3 { ctr: (Variable 3 ctr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Local (IntegerConstant 1000000 (Integer 4) Decimal) (IntegerConstant 1000000 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) openmp1 [] [(Assignment (Var 3 ctr) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 1 increment_ctr () [((Var 3 n)) ((Var 3 ctr))] () .false. ) (Print (StringFormat () [(Var 3 ctr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_01-4cfbf39.stderrlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_010000664000175000017500000000034515141516316034412 0ustar alastairalastairsemantic error: Shapes for operands are not conformable --> tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f90:3:13 | 3 | print *, x1 .neqv. [.true., .true.] | ^^ ^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor8-b01de63.stdout0000664000175000017500000000600715141516316031112 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor8: (Program (SymbolTable 2 { }) preprocessor8 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "__VERSION__ present" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_MAJOR__ present" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_MINOR__ present" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "__LFORTRAN_PATCHLEVEL__ present" (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "tests/preprocessor8.f90" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(IntegerConstant 19 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 20 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_05-321b5d3.stderr0000664000175000017500000000033515141516316025347 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05.f90:12:14 | 12 | allocate(type_01%x(1, 2)) | ^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_02-00d0664.json0000664000175000017500000000101015141516316026410 0ustar alastairalastair{ "basename": "asr-implicit_call_02-00d0664", "cmd": "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_02.f90", "infile_hash": "24e50b64e17b6d3a7a46f02ffb24d18897a171a4e81a77686a72a5d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_02-00d0664.stderr", "stderr_hash": "87fac225c2b103ecdb9cbd2fc4001bcdedd8065e39e4fbf48073b9c2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-mre_parameter-15f810f.json0000664000175000017500000000074215141516316026246 0ustar alastairalastair{ "basename": "run-mre_parameter-15f810f", "cmd": "lfortran --continue-compilation --no-color {infile}", "infile": "tests/errors/mre_parameter.f90", "infile_hash": "98f39f3110f80da2ce3dcae7c3d1a1bf53190249d4cb0d1f39f95e4e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-mre_parameter-15f810f.stderr", "stderr_hash": "01c4dff897b57fbb9191fb41026044183854c84d51c90c5b2231e15e", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_26-f10d0e6.stdout0000664000175000017500000002666515141516316026540 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_26: (Program (SymbolTable 4 { all_set: (ExternalSymbol 4 all_set 2 all_set stdlib_bitsets_64 [] all_set Public ), i: (Variable 4 i [] Local (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_26 [stdlib_bitsets_64] [(Print (StringFormat () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), stdlib_bitsets_64: (Module (SymbolTable 2 { all_set: (Function (SymbolTable 3 { num_bits: (Variable 3 num_bits [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pos: (Variable 3 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 3 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) all_set (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 num_bits)] [(Assignment (Var 3 res) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 3 pos) (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (LogicalNot (IntrinsicElementalFunction Btest [(Var 3 x) (Var 3 pos)] 0 (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] [] )] [] )] (Var 3 res) Public .false. .false. () ) }) stdlib_bitsets_64 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dprod_01-80a930c.stderr0000664000175000017500000000026715141516316025345 0ustar alastairalastairsemantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/dprod_01.f90:2:13 | 2 | print*, dprod(4.23_8, 4.3_8) | ^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-end_label-a678e8c.stdout0000664000175000017500000000242615141516316025760 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(GoTo 0 () 1 [] () ) (Continue 1 () )] [] [] ) (Function h [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 h 0 () ) (GoTo 0 () 1 [] () ) (Continue 1 () )] [] [] ) (Subroutine g [] [] () () [] [] [] [] [(If 0 () (Logical .true.) [(GoTo 0 () 1 [] () ) (Continue 1 () )] [] () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-string_assignment_01-9537046.json0000664000175000017500000000060515141516316027326 0ustar alastairalastair{ "basename": "run-string_assignment_01-9537046", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_assignment_01.f90", "infile_hash": "bc987cc37945c4f9f2bbc6e6e4b272dfeb091d95a56ab7fe5137cfa0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_05_cc-37bfc03.json0000664000175000017500000000075515141516316025554 0ustar alastairalastair{ "basename": "asr-array_05_cc-37bfc03", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/array_05_cc.f90", "infile_hash": "1dcd170461f4cffa125a95ce54171512f99cf95947be6665ba56b021", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_05_cc-37bfc03.stderr", "stderr_hash": "fb2430ac2eb05e0bb79ec0d1c97481fda53d7e1b8aee6d47a8b5cd08", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-template_travel_01-cd2b445.stdout0000664000175000017500000046726515141516316027543 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_01: (Program (SymbolTable 22 { add_real: (ExternalSymbol 22 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (ExternalSymbol 22 operations 5 operations template_travel_01_travel [] operations Public ), slash_real: (ExternalSymbol 22 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), test_template: (ExternalSymbol 22 test_template 18 test_template template_travel_01_m [] test_template Public ), travel_tmpl: (ExternalSymbol 22 travel_tmpl 5 travel_tmpl template_travel_01_travel [] travel_tmpl Public ) }) template_travel_01 [template_travel_01_m] [(SubroutineCall 22 test_template () [] () .false. )] ), template_travel_01_m: (Module (SymbolTable 18 { add_real: (ExternalSymbol 18 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (ExternalSymbol 18 operations 5 operations template_travel_01_travel [] operations Public ), slash_real: (ExternalSymbol 18 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), test_template: (Function (SymbolTable 19 { __asr_avg_s_from_t: (Function (SymbolTable 23 { avg: (Variable 23 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 23 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 23 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 23 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 23 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_avg_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 23 d1) (Var 23 t1) (Var 23 d2) (Var 23 t2)] [(Assignment (Var 23 avg) (FunctionCall 18 slash_real () [((FunctionCall 18 add_real () [((Var 23 d1)) ((Var 23 d2))] (Real 4) () () )) ((FunctionCall 18 add_real () [((Var 23 t1)) ((Var 23 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 23 avg) Public .false. .false. () ), avg_real_s_from_s: (Function (SymbolTable 21 { avg: (Variable 21 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 21 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 21 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 21 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 21 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr_avg_s_from_t] [(Var 21 d1) (Var 21 s1) (Var 21 d2) (Var 21 s2)] [(Assignment (Var 21 avg) (FunctionCall 19 __asr_avg_s_from_t () [((Var 21 d1)) ((FunctionCall 18 slash_real () [((Var 21 d1)) ((Var 21 s1))] (Real 4) () () )) ((Var 21 d2)) ((FunctionCall 18 slash_real () [((Var 21 d2)) ((Var 21 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 21 avg) Private .false. .false. () ), avg_real_s_from_t: (Function (SymbolTable 20 { avg: (Variable 20 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 20 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 20 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 20 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 20 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_real_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 20 d1) (Var 20 t1) (Var 20 d2) (Var 20 t2)] [(Assignment (Var 20 avg) (FunctionCall 18 slash_real () [((FunctionCall 18 add_real () [((Var 20 d1)) ((Var 20 d2))] (Real 4) () () )) ((FunctionCall 18 add_real () [((Var 20 t1)) ((Var 20 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 20 avg) Public .false. .false. () ), s1: (Variable 19 s1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 19 s2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 19 s1) (FunctionCall 19 avg_real_s_from_t () [((RealConstant 1.000000 (Real 4) )) ((RealConstant 3.000000 (Real 4) )) ((RealConstant 1.500000 (Real 4) )) ((RealConstant 4.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 19 s2) (FunctionCall 19 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((RealConstant 0.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((RealConstant 0.750000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 19 s1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "s2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 19 s2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (ExternalSymbol 18 travel_tmpl 5 travel_tmpl template_travel_01_travel [] travel_tmpl Public ) }) template_travel_01_m () [template_travel_01_math template_travel_01_travel template_travel_01_m] .false. .false. .false. ), template_travel_01_math: (Module (SymbolTable 2 { add_real: (Function (SymbolTable 3 { total: (Variable 3 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 total) (RealBinOp (Var 3 x) Add (Var 3 y) (Real 4) () ) () .false. .false. )] (Var 3 total) Public .false. .false. () ), slash_real: (Function (SymbolTable 4 { total: (Variable 4 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 total) (RealBinOp (Var 4 x) Div (Var 4 y) (Real 4) () ) () .false. .false. )] (Var 4 total) Public .false. .false. () ) }) template_travel_01_math () [] .false. .false. .false. ), template_travel_01_travel: (Module (SymbolTable 5 { add_real: (ExternalSymbol 5 add_real 2 add_real template_travel_01_math [] add_real Public ), operations: (Requirement (SymbolTable 6 { d: (Variable 6 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d_divided_by_s: (Function (SymbolTable 10 { d: (Variable 10 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 10 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 n) (Var 10 d)] [] (Var 10 quotient) Private .false. .false. () ), d_divided_by_t: (Function (SymbolTable 9 { d: (Variable 9 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 9 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 9 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 n) (Var 9 d)] [] (Var 9 quotient) Private .false. .false. () ), plus_d: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 7 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 7 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 total) Private .false. .false. () ), plus_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 8 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 total) Private .false. .false. () ), s: (Variable 6 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [] ), slash_real: (ExternalSymbol 5 slash_real 2 slash_real template_travel_01_math [] slash_real Public ), travel_tmpl: (Template (SymbolTable 11 { avg_s_from_s: (Function (SymbolTable 17 { avg: (Variable 17 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 17 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 17 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 17 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 17 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 17 d1) (Var 17 s1) (Var 17 d2) (Var 17 s2)] [(Assignment (Var 17 avg) (FunctionCall 11 avg_s_from_t () [((Var 17 d1)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d1)) ((Var 17 s1))] (TypeParameter t ) () () )) ((Var 17 d2)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d2)) ((Var 17 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 17 avg) Private .false. .false. () ), avg_s_from_t: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 16 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 16 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 16 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 16 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 16 d1) (Var 16 t1) (Var 16 d2) (Var 16 t2)] [(Assignment (Var 16 avg) (FunctionCall 11 d_divided_by_t () [((FunctionCall 11 plus_d () [((Var 16 d1)) ((Var 16 d2))] (TypeParameter d ) () () )) ((FunctionCall 11 plus_t () [((Var 16 t1)) ((Var 16 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 16 avg) Public .false. .false. () ), d: (Variable 11 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d_divided_by_s: (Function (SymbolTable 15 { d: (Variable 15 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 15 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 15 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 n) (Var 15 d)] [] (Var 15 quotient) Private .false. .false. () ), d_divided_by_t: (Function (SymbolTable 14 { d: (Variable 14 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 14 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 14 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 14 n) (Var 14 d)] [] (Var 14 quotient) Private .false. .false. () ), plus_d: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 12 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 12 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 total) Private .false. .false. () ), plus_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 13 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 total) Private .false. .false. () ), s: (Variable 11 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] )] ) }) template_travel_01_travel () [template_travel_01_math template_travel_01_travel] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-empty-6449c98.json0000664000175000017500000000070415141516316024500 0ustar alastairalastair{ "basename": "asr-empty-6449c98", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "asr-empty-6449c98.stdout", "stdout_hash": "664052099c78bf886fd473a09a261db8d03b9b161f9627f50671569c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_06-1cbc8a9.json0000664000175000017500000000075715141516316027103 0ustar alastairalastair{ "basename": "asr-template_error_06-1cbc8a9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_06.f90", "infile_hash": "2b64257bcef60714fb0f3ffe6eac5832664b957c001fdfad2238c161", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_06-1cbc8a9.stderr", "stderr_hash": "bb2807cb7bd5ec770c93e19e96535a404d5ffd6277814d2f741d1b06", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-external3-2aafcb3.stdout0000664000175000017500000003107215141516316026071 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { brcmp1: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), bcorr: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), bcorr_arg_0: (Variable 5 bcorr_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), bcorr_arg_1: (Variable 5 bcorr_arg_1 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), bcorr_return_var_name: (Variable 5 bcorr_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) bcorr (FunctionType [(Real 4) (Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 bcorr_arg_0) (Var 5 bcorr_arg_1)] [] (Var 5 bcorr_return_var_name) Public .false. .false. () ), brcmp1: (Variable 2 brcmp1 [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), exp: (Variable 2 exp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) brcmp1 (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 brcmp1) (IntrinsicElementalFunction Exp [(RealUnaryMinus (FunctionCall 2 bcorr () [((Var 2 a)) ((Var 2 b))] (Real 8) () () ) (Real 8) () )] 0 (Real 8) () ) () .false. .false. ) (Return)] (Var 2 brcmp1) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-arrays_09-721986f.stdout0000664000175000017500000000023115141516316026173 0ustar alastairalastairprogram arrays_09 implicit none character(len=10) :: a(1) a(1) = "Substring" if (a(1)(4:9) /= "string") then error stop end if end program arrays_09 lfortran-lfortran-2f73434/tests/reference/asr-associate_02-ca5c9ec.json0000664000175000017500000000075615141516316026107 0ustar alastairalastair{ "basename": "asr-associate_02-ca5c9ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_02.f90", "infile_hash": "d3505eea2e17cbf463e707ee2faf24aedf12a13ebb06fee4a5a1adfb", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_02-ca5c9ec.stdout", "stdout_hash": "c25772b8f78641b64dc0fd3e48a50bbcdbab38335f010bacd28e0b90", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-case_02-8557909.json0000664000175000017500000000073715141516316024504 0ustar alastairalastair{ "basename": "asr-case_02-8557909", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "asr-case_02-8557909.stdout", "stdout_hash": "bd1963486f263494701484f5946483c72aba71f9862a6e6a5d25d09d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_travel_01b-db46a56.stdout0000664000175000017500000051536115141516316027700 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_01b: (Program (SymbolTable 21 { operation: (ExternalSymbol 21 operation 2 operation template_travel_01b_m [] operation Public ), test_template: (ExternalSymbol 21 test_template 2 test_template template_travel_01b_m [] test_template Public ), travel_tmpl: (ExternalSymbol 21 travel_tmpl 2 travel_tmpl template_travel_01b_m [] travel_tmpl Public ) }) template_travel_01b [template_travel_01b_m] [(SubroutineCall 21 test_template () [] () .false. )] ), template_travel_01b_m: (Module (SymbolTable 2 { operation: (Requirement (SymbolTable 3 { a: (Variable 3 a [] In () () Default (TypeParameter a ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (TypeParameter b ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] In () () Default (TypeParameter c ) () Source Private Required .false. .false. .false. () .false. .false. ), op: (Function (SymbolTable 4 { l: (Variable 4 l [] In () () Default (TypeParameter a ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] In () () Default (TypeParameter b ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter c ) () Source Private Required .false. .false. .false. () .false. .false. ) }) op (FunctionType [(TypeParameter a ) (TypeParameter b )] (TypeParameter c ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 4 l) (Var 4 r)] [] (Var 4 res) Private .false. .false. () ) }) operation [a b c op] [] ), test_template: (Function (SymbolTable 12 { avg_integer_s_from_s: (Function (SymbolTable 20 { avg: (Variable 20 avg [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 20 d1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 20 d2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 20 s1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 20 s2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_integer_s_from_s (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~div_intrinsic1 avg_integer_s_from_t] [(Var 20 d1) (Var 20 s1) (Var 20 d2) (Var 20 s2)] [(Assignment (Var 20 avg) (FunctionCall 12 avg_integer_s_from_t () [((Var 20 d1)) ((FunctionCall 12 ~div_intrinsic1 () [((Var 20 d1)) ((Var 20 s1))] (Integer 4) () () )) ((Var 20 d2)) ((FunctionCall 12 ~div_intrinsic1 () [((Var 20 d2)) ((Var 20 s2))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 20 avg) Public .false. .false. () ), avg_integer_s_from_t: (Function (SymbolTable 19 { avg: (Variable 19 avg [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 19 d1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 19 d2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 19 t1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 19 t2 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_integer_s_from_t (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic1 ~div_intrinsic1] [(Var 19 d1) (Var 19 t1) (Var 19 d2) (Var 19 t2)] [(Assignment (Var 19 avg) (FunctionCall 12 ~div_intrinsic1 () [((FunctionCall 12 ~add_intrinsic1 () [((Var 19 d1)) ((Var 19 d2))] (Integer 4) () () )) ((FunctionCall 12 ~add_intrinsic1 () [((Var 19 t1)) ((Var 19 t2))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 19 avg) Public .false. .false. () ), avg_real_s_from_s: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 16 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 16 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 16 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 16 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~div_intrinsic avg_real_s_from_t] [(Var 16 d1) (Var 16 s1) (Var 16 d2) (Var 16 s2)] [(Assignment (Var 16 avg) (FunctionCall 12 avg_real_s_from_t () [((Var 16 d1)) ((FunctionCall 12 ~div_intrinsic () [((Var 16 d1)) ((Var 16 s1))] (Real 4) () () )) ((Var 16 d2)) ((FunctionCall 12 ~div_intrinsic () [((Var 16 d2)) ((Var 16 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 16 avg) Public .false. .false. () ), avg_real_s_from_t: (Function (SymbolTable 15 { avg: (Variable 15 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 15 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 15 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 15 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 15 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_real_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~div_intrinsic] [(Var 15 d1) (Var 15 t1) (Var 15 d2) (Var 15 t2)] [(Assignment (Var 15 avg) (FunctionCall 12 ~div_intrinsic () [((FunctionCall 12 ~add_intrinsic () [((Var 15 d1)) ((Var 15 d2))] (Real 4) () () )) ((FunctionCall 12 ~add_intrinsic () [((Var 15 t1)) ((Var 15 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 15 avg) Public .false. .false. () ), i1: (Variable 12 i1 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i2: (Variable 12 i2 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 12 s1 [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 12 s2 [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 12 ~add [12 ~add_intrinsic 12 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 13 { arg0: (Variable 13 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 13 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 13 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 13 arg0) (Var 13 arg1)] [(Assignment (Var 13 ret) (RealBinOp (Var 13 arg0) Add (Var 13 arg1) (Real 4) () ) () .false. .false. )] (Var 13 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 17 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 17 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (IntegerBinOp (Var 17 arg0) Add (Var 17 arg1) (Integer 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ), ~div: (CustomOperator 12 ~div [12 ~div_intrinsic 12 ~div_intrinsic1] Public ), ~div_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 14 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 14 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~div_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (RealBinOp (Var 14 arg0) Div (Var 14 arg1) (Real 4) () ) () .false. .false. )] (Var 14 ret) Public .false. .true. () ), ~div_intrinsic1: (Function (SymbolTable 18 { arg0: (Variable 18 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 18 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 18 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~div_intrinsic1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 18 arg0) (Var 18 arg1)] [(Assignment (Var 18 ret) (IntegerBinOp (Var 18 arg0) Div (Var 18 arg1) (Integer 4) () ) () .false. .false. )] (Var 18 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 12 s1) (FunctionCall 12 avg_real_s_from_t () [((RealConstant 1.000000 (Real 4) )) ((RealConstant 3.000000 (Real 4) )) ((RealConstant 1.500000 (Real 4) )) ((RealConstant 4.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 12 s2) (FunctionCall 12 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((Var 12 s1)) ((RealConstant 2.000000 (Real 4) )) ((Var 12 s1))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 12 i1) (FunctionCall 12 avg_integer_s_from_t () [((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 20 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 12 i2) (FunctionCall 12 avg_integer_s_from_s () [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 12 i1)) ((IntegerConstant 15 (Integer 4) Decimal)) ((Var 12 i1))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 s1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "s2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 s2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "i1=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 i1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "i2=" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 i2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (Template (SymbolTable 5 { avg_s_from_s: (Function (SymbolTable 11 { avg: (Variable 11 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 11 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 11 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 11 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 11 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 11 d1) (Var 11 s1) (Var 11 d2) (Var 11 s2)] [(Assignment (Var 11 avg) (FunctionCall 5 avg_s_from_t () [((Var 11 d1)) ((FunctionCall 5 d_divided_by_s () [((Var 11 d1)) ((Var 11 s1))] (TypeParameter t ) () () )) ((Var 11 d2)) ((FunctionCall 5 d_divided_by_s () [((Var 11 d2)) ((Var 11 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 11 avg) Public .false. .false. () ), avg_s_from_t: (Function (SymbolTable 10 { avg: (Variable 10 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 10 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 10 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 10 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 10 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 10 d1) (Var 10 t1) (Var 10 d2) (Var 10 t2)] [(Assignment (Var 10 avg) (FunctionCall 5 d_divided_by_t () [((FunctionCall 5 plus_d () [((Var 10 d1)) ((Var 10 d2))] (TypeParameter d ) () () )) ((FunctionCall 5 plus_t () [((Var 10 t1)) ((Var 10 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 10 avg) Public .false. .false. () ), d: (Variable 5 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d_divided_by_s: (Function (SymbolTable 9 { l: (Variable 9 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 9 r [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 l) (Var 9 r)] [] (Var 9 res) Private .false. .false. () ), d_divided_by_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 res) Private .false. .false. () ), plus_d: (Function (SymbolTable 6 { l: (Variable 6 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 6 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 6 l) (Var 6 r)] [] (Var 6 res) Private .false. .false. () ), plus_t: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 7 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 res) Private .false. .false. () ), s: (Variable 5 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operation [d plus_d] ) (Require operation [t plus_t] ) (Require operation [d t s d_divided_by_t] ) (Require operation [d s t d_divided_by_s] )] ) }) template_travel_01b_m () [template_travel_01b_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-data1-58e5b8d.stdout0000664000175000017500000004101015141516316025034 0ustar alastairalastair(TranslationUnit [(Program data1 () [] [] [(DerivedType person [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(age [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 20 Value)] () () None ) [] [(fullname [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeCharacter [(len 10 Value)] () () None ) [] [(myname [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(0 9 DimensionExpr)] )] [(miles [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 100 DimensionExpr) (1 100 DimensionExpr)] )] [(skew [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () person None ) [] [(yourname [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(sin3 [] [] () (FuncCallOrArray sin [] [(() (Real "3.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(cos3 [] [] () (FuncCallOrArray cos [] [(() (Real "3.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(s [(1 10 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(iarx [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ()) (iary [(1 3 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DataStmt 0 [(DataStmtSet [myname] [(String "xyz" ())] ) (DataStmtSet [miles] [0 0 0 0 0 0 0 0 0 0] )] () ) (DataStmt 0 [(DataStmtSet [age [(yourname [])] fullname [(yourname [])]] [35 (String "abc" ())] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j 1 k () )] (AttrType TypeInteger [(() 4 Value)] () () None ) k 1 10 () )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j 1 k k )] (AttrType TypeInteger [(() 4 Value)] () () None ) k 1 100 2 )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j (+ k 1) 10 () )] () k 1 3 () )] [(Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0")] )] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(DataImpliedDo [(FuncCallOrArray skew [] [(() k () 0) (() j () 0)] [] [] [] )] () j (+ k 1) 10 k )] () k 1 3 1 )] [(Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0") (Real "1.0")] )] () ) (DataStmt 0 [(DataStmtSet [s] [(Real "1.d0") (u- (Real "1.d0")) (Real "0.d0") (Real "0.d0") (Real "0.d0") (u- (Real "1.d0")) sin3 cos3 (Real "0.d0") (u- (Real "1.d0"))] )] () ) (Print 0 () [(String "Your name is: " ()) fullname [(yourname [])]] () ) (Print 0 () [(String "Your age is: " ()) age [(yourname [])]] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iarx [] [(() i () 0) (() 1 () 0)] [] [] [] ) (FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950 1350 4350 4] )] () ) (Print 0 () [(String "My name is: " ()) myname] () ) (DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray iary [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 3 () )] [1 9 1950] )] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/wat-doloop_03-e0c63db.json0000664000175000017500000000073015141516316025341 0ustar alastairalastair{ "basename": "wat-doloop_03-e0c63db", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_03-e0c63db.stdout", "stdout_hash": "162a4ee496e349a909153844aebdce1115a94616b57e3229d1f0e894", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-modules_04-d194daa.json0000664000175000017500000000073615141516316026177 0ustar alastairalastair{ "basename": "ast_f90-modules_04-d194daa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/modules_04.f90", "infile_hash": "001166d3ec02d038539957e7b333b2f02902687e96980e325831c745", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-modules_04-d194daa.stdout", "stdout_hash": "a33aa109e8bf97d4a69f413dd829f073fc2fd561ccac6cd380513752", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-int_to_complex_cast_in_comparison-2b60771.json0000664000175000017500000000104415141516316033161 0ustar alastairalastair{ "basename": "fortran-int_to_complex_cast_in_comparison-2b60771", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/int_to_complex_cast_in_comparison.f90", "infile_hash": "d941d05c4d0af6960eed2a5e192da5e3b6cef03b0467f23682b10222", "outfile": null, "outfile_hash": null, "stdout": "fortran-int_to_complex_cast_in_comparison-2b60771.stdout", "stdout_hash": "37055d5df652fc84b17fbe57f9161b5788a13a64bf991e5b0291d74c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutines_10-c3e0d28.stdout0000664000175000017500000000666615141516316026732 0ustar alastairalastair(TranslationUnit [(Program subroutines_10 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(SubroutineCall 0 subroutines_10_sub [] [(() x () 0) (() 3 () 0) (() () () 100) (() () () 200)] [] [] () ) (If 0 () (BoolOp (< x 0) And (> x 10) ) [(ErrorStop 0 () () () )] [] () () () ) (Stop 0 () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 100 () [(String "Negative input value" ())] () ) (ErrorStop 0 () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 200 () [(String "Input value too large" ())] () ) (ErrorStop 0 () () () )] [] ) (Subroutine subroutines_10_sub [(x) (i) (()) (())] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () )] [(If 0 () (< i 0) [(Return 0 1 () )] [] () () () ) (If 0 () (> i 10) [(Return 0 2 () )] [] () () () ) (Assignment 0 x i () )] [] [] )] ) ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.stdoutlfortran-lfortran-2f73434/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.st0000664000175000017500000001236615141516316034160 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope1-f174531.json0000664000175000017500000000101415141516316030762 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope1-f174531", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope1-f174531.stdout", "stdout_hash": "1bf4258b7533326ad5f9bb94cb95af845ae56eb1355b13e3d2f563e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-array7-6a2e4ab.json0000664000175000017500000000072215141516316025421 0ustar alastairalastair{ "basename": "ast_f90-array7-6a2e4ab", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array7.f90", "infile_hash": "e8a4f12c21d75c3eee1ba6cc82227a262f41e146ccfd34c1ffb12612", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array7-6a2e4ab.stdout", "stdout_hash": "576a988220de9b163a11b5a0101125bf2aad2be88ea6913e24c10d45", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine4-e2840c9.stdout0000664000175000017500000000170615141516316026242 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void triad(T0* a, T1* b, float scalar, T2* c); // Implementations template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t n; n = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); } lfortran-lfortran-2f73434/tests/reference/asr-derived_types_03-b1d32aa.stdout0000664000175000017500000004041015141516316027244 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_03: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 x Source Public Required .false. .false. .false. () .false. .false. ), x: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), y: (Function (SymbolTable 4 { a: (Struct (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), b: (Variable 4 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 4 a Source Public Required .false. .false. .false. () .false. .false. ) }) y (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), z: (Function (SymbolTable 6 { a: (Struct (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), b: (Variable 6 b [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 a Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) z (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 z) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 6 z) Public .false. .false. () ) }) derived_types_03 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-array3-a2f045b.json0000664000175000017500000000067215141516316024655 0ustar alastairalastair{ "basename": "cpp-array3-a2f045b", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "cpp-array3-a2f045b.stdout", "stdout_hash": "6770dd465ff4e4bf33927119661219194533beaa7d767bc85cb4faab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_01-6c675be.json0000664000175000017500000000072115141516316024715 0ustar alastairalastair{ "basename": "asr-kind_01-6c675be", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_01.f90", "infile_hash": "b5be2245f43395dd32e9fbc5f06c07ac6c70905e5b83bf65ca745c30", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_01-6c675be.stderr", "stderr_hash": "a4f46f313141003cd8a07b34744cfb6be4d780ac89b7bef22e149f74", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_08-52825a6.stdout0000664000175000017500000003753415141516316030443 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_08: (Program (SymbolTable 5 { 1_custom_int_value: (ExternalSymbol 5 1_custom_int_value 3 value custom_int [] value Public ), a: (Variable 5 a [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 5 custom_int Source Public Required .false. .false. .false. () .false. .false. ), custom_div: (ExternalSymbol 5 custom_div 2 custom_div operator_overloading_08_mod1 [] custom_div Public ), custom_int: (ExternalSymbol 5 custom_int 2 custom_int operator_overloading_08_mod1 [] custom_int Public ), ~div: (ExternalSymbol 5 ~div 2 ~div operator_overloading_08_mod1 [] ~div Public ) }) operator_overloading_08 [operator_overloading_08_mod1] [(Assignment (StructInstanceMember (Var 5 a) 5 1_custom_int_value (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(OverloadedBinOp (Var 5 a) Div (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () (FunctionCall 5 custom_div 5 ~div [((Var 5 a)) ((IntegerConstant 0 (Integer 4) Decimal))] (StructType [(Integer 4)] [] .true. .false. ) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), operator_overloading_08_mod1: (Module (SymbolTable 2 { custom_div: (Function (SymbolTable 4 { 1_custom_int_value: (ExternalSymbol 4 1_custom_int_value 3 value custom_int [] value Public ), a: (Variable 4 a [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 custom_int Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 custom_int Source Public Required .false. .false. .false. () .false. .false. ) }) custom_div (FunctionType [(StructType [(Integer 4)] [] .true. .false. ) (Integer 4)] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (StructInstanceMember (Var 4 res) 4 1_custom_int_value (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 4 a) 4 1_custom_int_value (Integer 4) () ) Div (IntegerBinOp (Var 4 b) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 4 res) Public .false. .false. () ), custom_int: (Struct (SymbolTable 3 { value: (Variable 3 value [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) custom_int (StructType [(Integer 4)] [] .true. .false. ) [] [value] [] Source Public .false. .false. [] () () ), ~div: (CustomOperator 2 ~div [2 custom_div] Public ) }) operator_overloading_08_mod1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-call_subroutine_without_type_01-1c100d1.json0000664000175000017500000000105215141516316032061 0ustar alastairalastair{ "basename": "llvm-call_subroutine_without_type_01-1c100d1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/call_subroutine_without_type_01.f90", "infile_hash": "ce99f763025dfbf26699804852ec0efd7bd0dca27e30830aded2fa9a", "outfile": null, "outfile_hash": null, "stdout": "llvm-call_subroutine_without_type_01-1c100d1.stdout", "stdout_hash": "a9cb391672da2c213e0dd82b2522d9ee38e651baf5e7163ed36747f8", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_integer_real_array_types-c665202.stderrlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_integer_real_array_types-c665200000664000175000017500000000032415141516316034243 0ustar alastairalastairsemantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/array_constructor_with_integer_real_array_types.f90:2:18 | 2 | print *, [1, [1., 2.]] | ^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/julia-subroutine1-87ec3af.stdout0000664000175000017500000000033615141516316026721 0ustar alastairalastairfunction g() local i::Int32 local x::Int32 x = 1 for i ∈ 1:10 x = x * i end end function h() local i::Int32 local x::Int32 x = 1 for i ∈ 1:10 x = i * x end end lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_33-816caef.json0000664000175000017500000000076115141516316026242 0ustar alastairalastair{ "basename": "asr-intrinsics_33-816caef", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_33.f90", "infile_hash": "e4ea9f413d213dd8fd6f6e412957737676b193db450eac1eda9f422f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_33-816caef.stdout", "stdout_hash": "4bcdc728e4632573254f06d232275d1370b44ccdb92a3c6f11275b4e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-program_cmake_01-caf8f48.stdout0000664000175000017500000000232715141516316027423 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"Hello" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_testfortran FINALIZE_SYMTABLE_testfortran: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce-9789e1d.json0000664000175000017500000000077415141516316030304 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce-9789e1d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce-9789e1d.stdout", "stdout_hash": "627a29e2f47039f5e4d9ec7862afb81be790dd9febc9f40a629b4c27", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_01-290187e.json0000664000175000017500000000074515141516316025116 0ustar alastairalastair{ "basename": "asr-nested_01-290187e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_01-290187e.stdout", "stdout_hash": "1fa7d10f392de7a9d369215693e519e84397cf77a5bfdb69a0d30a57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_25-0bdc4b7.json0000664000175000017500000000071515141516316025354 0ustar alastairalastair{ "basename": "run-format_25-0bdc4b7", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_25.f90", "infile_hash": "cb35907bcd56b0eb47a987a7dea054ef0a376978f17c94d49fa1b90f", "outfile": null, "outfile_hash": null, "stdout": "run-format_25-0bdc4b7.stdout", "stdout_hash": "c16842418a1b5859dc18ab87bcfdaac17a23e7073539f54a7f98378d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_negative_start_index-643e9c0.json0000664000175000017500000000101515141516316031175 0ustar alastairalastair{ "basename": "asr-string_negative_start_index-643e9c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_negative_start_index.f90", "infile_hash": "09f10d0a9225824440f331a87871a73e5536466c5984c305fbd1f982", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_negative_start_index-643e9c0.stderr", "stderr_hash": "32ee9a500a2be64222519c960c441f35d27a3057d5b1289fc1b22172", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-character_01-e8e453d.stderr0000664000175000017500000000051615141516316026260 0ustar alastairalastairwarning: The LHS character len=1 and the RHS character len=4 are not equal. --> tests/warnings/character_01.f90:3:5 | 3 | character(len=1, kind=1), parameter :: c_null_char = "ball" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-lfortran-2f73434/tests/reference/asr-array10-1f60f5f.json0000664000175000017500000000071215141516316024743 0ustar alastairalastair{ "basename": "asr-array10-1f60f5f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array10.f90", "infile_hash": "e8d36796501eef9e4d715dd3dbe300523148b047e92967b60757e132", "outfile": null, "outfile_hash": null, "stdout": "asr-array10-1f60f5f.stdout", "stdout_hash": "19e212898f44917848e845e201bdcf02f00382d7c8de3d7efe6ce435", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-modules_06-03c75b2.stdout0000664000175000017500000000645615141516316026122 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_modules_06_a_b() { .entry: %r = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) store i32 5, i32* %r, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %1 = load i32, i32* %r, align 4 ret i32 %1 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %2 = call i32 @__module_modules_06_a_b() store i32 %2, i32* %i, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32* %i) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_modules_06 FINALIZE_SYMTABLE_modules_06: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-exit1-29ee7ce.stdout0000664000175000017500000000001215141516316025165 0ustar alastairalastair1 2 3 4 5 lfortran-lfortran-2f73434/tests/reference/ast-case_05-a43ab42.json0000664000175000017500000000073715141516316024677 0ustar alastairalastair{ "basename": "ast-case_05-a43ab42", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "ast-case_05-a43ab42.stdout", "stdout_hash": "9d36536faa2e4cae2d23d1329b1936a93ae9054472f5c86310b38889", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-complex_02-0f52aa7.stdout0000664000175000017500000000447315141516316026007 0ustar alastairalastair(TranslationUnit [(Program complex_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () () None ()) (z [] [] () () None ()) (w [] [] () () None ()) (i_ [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 x (Complex (Real "1.0") (u- (Real "3.0"))) () ) (Assignment 0 a (Real "3.0") () ) (Assignment 0 b (Real "4.0") () ) (Assignment 0 i_ (Complex 0 1) () ) (Assignment 0 z (+ a (* i_ b)) () ) (Assignment 0 w (+ (+ a b) (* i_ (- a b))) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [x z w] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-modules_11-a28ab77.json0000664000175000017500000000075315141516316025625 0ustar alastairalastair{ "basename": "llvm-modules_11-a28ab77", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_11-a28ab77.stdout", "stdout_hash": "4043e15eaf8f261ffa24af0ca374e9c7130c25a64683144e77c9dc7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/obj-program_cmake_01-17bdeab.json0000664000175000017500000000063215141516316026711 0ustar alastairalastair{ "basename": "obj-program_cmake_01-17bdeab", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-maskl_negative-c92502f.stderr0000664000175000017500000000024115141516316026721 0ustar alastairalastairsemantic error: first argument of `maskl` must be nonnegative --> tests/errors/maskl_negative.f90:2:12 | 2 | print*, maskl(-24) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-implied_do_loops10-3298b64.stdout0000664000175000017500000000534515141516316027374 0ustar alastairalastair(TranslationUnit [(Program implied_do_loop10 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (DerivedType col [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(rgb [(1 3 DimensionExpr)] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () col None ) [] [(colours [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray rgb [(colours [])] [(() i () 0)] [] [] [] )] () i 1 3 () )] [1 2 3] )] () ) (Print 0 () [(String "colours%rgb : " ()) rgb [(colours [])]] () ) (If 0 () (FuncCallOrArray any [] [(() (/= rgb [(colours [])] (ArrayInitializer () () [1 2 3] )) () 0)] [] [] [] ) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-return_02-99fb0b3.stderr0000664000175000017500000000105215141516316026022 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:13:15 | 13 | if (i .EQ. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:17:15 | 17 | if (i .EQ. 2) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/return_02.f90:21:15 | 21 | if (i .EQ. 3) then | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/julia-if_05-2102585.json0000664000175000017500000000072215141516316024457 0ustar alastairalastair{ "basename": "julia-if_05-2102585", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/if_05.f90", "infile_hash": "e17354307d88b9239319cbfd5ce6b117fd24e4aa2998deee3d8fe695", "outfile": null, "outfile_hash": null, "stdout": "julia-if_05-2102585.stdout", "stdout_hash": "151c316fb5a19a14af5cced2a16b9efd1a65d8c4742084a5fe56fd9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-int_dp-9b89d9f.stdout0000664000175000017500000000453315141516316025525 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @int_dp.u = internal global i32 2147483647 @int_dp.v = internal global i64 2147483647 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* @int_dp.u, i64* @int_dp.v) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_int_dp FINALIZE_SYMTABLE_int_dp: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-types_13-76138b5.stderr0000664000175000017500000000474415141516316025342 0ustar alastairalastairstyle suggestion: Use character(5) instead of character*5 --> tests/../integration_tests/types_13.f90:30:5 | 30 | character*5 :: d | ^^^^^^^^^^^ help: write this as 'character(5)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:36:5 | 36 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:37:5 | 37 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:38:5 | 38 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:43:5 | 43 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:44:5 | 44 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:45:5 | 45 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:51:5 | 51 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:52:5 | 52 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:53:5 | 53 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:59:5 | 59 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:60:5 | 60 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:61:5 | 61 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' lfortran-lfortran-2f73434/tests/reference/asr-type_casting_01-4e8a892.json0000664000175000017500000000075115141516316026407 0ustar alastairalastair{ "basename": "asr-type_casting_01-4e8a892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_casting_01.f90", "infile_hash": "9385ba3715f01c20aaa23ba05b0a20383ed149344bc72e7ede478970", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_casting_01-4e8a892.stderr", "stderr_hash": "372b13217c84710fd3f0d667e77c8a2f2516da635a765fedc1858a4d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-callback_02-aec5457.json0000664000175000017500000000075315141516316025526 0ustar alastairalastair{ "basename": "asr-callback_02-aec5457", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_02.f90", "infile_hash": "880452ed794b4467313ba9a87318b17fe757a084b2a39129209153d3", "outfile": null, "outfile_hash": null, "stdout": "asr-callback_02-aec5457.stdout", "stdout_hash": "5876aeea8839562b6d89a65404e96f5e5a04156bf659c16dfcbab701", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-reserved_02-a00a6f2.json0000664000175000017500000000076615141516316026257 0ustar alastairalastair{ "basename": "ast_f90-reserved_02-a00a6f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/reserved_02.f90", "infile_hash": "f602644fa98db53850a49c69394e3e9eb664cd1250f81f954484c85e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-reserved_02-a00a6f2.stdout", "stdout_hash": "2cda8233c77ac420d2688c94e80e9c4fcfe12ab17c884a5d0f189929", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_15-7fde02a.stdout0000664000175000017500000006122115141516316027265 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_15_module_1: (Module (SymbolTable 2 { multiply: (Function (SymbolTable 4 { 1_t_1_i: (ExternalSymbol 4 1_t_1_i 3 i t_1 [] i Public ), j: (Variable 4 j [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. ) }) multiply (FunctionType [(StructType [(Real 4)] [] .false. .false. ) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 j)] [(Assignment (Var 4 res) (RealBinOp (StructInstanceMember (Var 4 self) 4 1_t_1_i (Real 4) () ) Mul (Var 4 j) (Real 4) () ) () .false. .false. )] (Var 4 res) Private .false. .false. () ), sqrt_subtract: (Function (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), j: (Variable 5 j [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 5 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), self: (Variable 5 self [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. ) }) sqrt_subtract (FunctionType [(StructType [(Real 4)] [] .false. .false. ) (Integer 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 j)] [(Assignment (Var 5 res) (RealBinOp (StructInstanceMember (Var 5 self) 5 1_t_1_i (Real 4) () ) Sub (RealBinOp (Cast (Var 5 j) IntegerToReal (Real 4) () ) Pow (RealConstant 0.500000 (Real 4) ) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 5 res) Private .false. .false. () ), t_1: (Struct (SymbolTable 3 { compute: (GenericProcedure 3 compute [3 multiply 3 sqrt_subtract] Public ), i: (Variable 3 i [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), multiply: (StructMethodDeclaration 3 multiply () multiply 2 multiply Source .false. .false. ), sqrt_subtract: (StructMethodDeclaration 3 sqrt_subtract () sqrt_subtract 2 sqrt_subtract Source .false. .false. ) }) t_1 (StructType [(Real 4)] [] .true. .false. ) [] [i] [] Source Private .false. .false. [] () () ) }) derived_types_15_module_1 () [] .false. .false. .false. ), name: (Program (SymbolTable 6 { 1_t_1_i: (ExternalSymbol 6 1_t_1_i 3 i t_1 [] i Public ), 1_t_1_multiply: (ExternalSymbol 6 1_t_1_multiply 3 multiply t_1 [] multiply Public ), 1_t_1_sqrt_subtract: (ExternalSymbol 6 1_t_1_sqrt_subtract 3 sqrt_subtract t_1 [] sqrt_subtract Public ), t_1: (ExternalSymbol 6 t_1 2 t_1 derived_types_15_module_1 [] t_1 Public ), type_1: (Variable 6 type_1 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 6 t_1 Source Public Required .false. .false. .false. () .false. .false. ) }) name [derived_types_15_module_1] [(Assignment (StructInstanceMember (Var 6 type_1) 6 1_t_1_i (Real 4) () ) (RealConstant 100.000000 (Real 4) ) () .false. .false. ) (If () (RealCompare (FunctionCall 6 1_t_1_multiply () [((RealConstant 5.000000 (Real 4) ))] (Real 4) () (Var 6 type_1) ) NotEq (Cast (IntegerConstant 500 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 500.000000 (Real 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (FunctionCall 6 1_t_1_sqrt_subtract () [((IntegerConstant 2500 (Integer 4) Decimal))] (Real 4) () (Var 6 type_1) ) NotEq (Cast (IntegerConstant 50 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 50.000000 (Real 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-comments1-213c55a.stdout0000664000175000017500000000166215141516316025660 0ustar alastairalastair(TranslationUnit [(Program comments1 (TriviaNode [(EndOfLine) (EndOfLine) (Comment "! Next line comment 0" )] [] ) [] [] [] [(Print 0 () [(String "1" ())] (TriviaNode [] [(EOLComment "! end of line comment 1" ) (Comment "! Next line comment 1" )] ) ) (Print 0 () [(String "2" ())] (TriviaNode [] [(EOLComment "! end of line comment 2" ) (Comment "! Next line comment 2" ) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-div_to_mul-3aaf3c0.json0000664000175000017500000000075015141516316025672 0ustar alastairalastair{ "basename": "asr-div_to_mul-3aaf3c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/div_to_mul.f90", "infile_hash": "6c1d702f410e8db6aae79c37b446d7a2fd6295166902746ff799d239", "outfile": null, "outfile_hash": null, "stdout": "asr-div_to_mul-3aaf3c0.stdout", "stdout_hash": "90633db326b14c521a0735959f825cc01f63cf0e04c705eb21dc82ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_11-dd72b29.stdout0000664000175000017500000001540315141516316026011 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_externally: (Program (SymbolTable 4 { access_internally: (ExternalSymbol 4 access_internally 2 access_internally modules_11_module11 [] access_internally Public ), i: (ExternalSymbol 4 i 2 i modules_11_module11 [] i Public ), j: (ExternalSymbol 4 j 2 j modules_11_module11 [] j Public ) }) access_externally [modules_11_module11] [(Print (StringFormat () [(StringConstant "j = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 4 access_internally () [] () .false. )] ), modules_11_module11: (Module (SymbolTable 2 { access_internally: (Function (SymbolTable 3 { }) access_internally (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "i = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), i: (Variable 2 i [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_11_module11 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_43-d01691f.json0000664000175000017500000000075015141516316025361 0ustar alastairalastair{ "basename": "asr-modules_43-d01691f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_43.f90", "infile_hash": "ee51c0425b99849f984c011dfe475584384af4099c822103232f5b9f", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_43-d01691f.stdout", "stdout_hash": "85d80a2c14af72eabba32ea5af4d5ad166613627e07325ff9bcc7ecc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-common2-1811464.json0000664000175000017500000000072515141516316024617 0ustar alastairalastair{ "basename": "ast-common2-1811464", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/common2.f", "infile_hash": "761ba9bcb69efc19ad1828c9ebc8deab710d02f98f6722736d6a4dd2", "outfile": null, "outfile_hash": null, "stdout": "ast-common2-1811464.stdout", "stdout_hash": "a4c08f6f4de3cee96ae4ee89d420bdeeaf16a21bb8a2d807bc848206", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-close1-0f44a73.json0000664000175000017500000000072215141516316025246 0ustar alastairalastair{ "basename": "ast_f90-close1-0f44a73", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/close1.f90", "infile_hash": "b6174b7e66a7b9dea6c59e0e40b1786dc0721bf2b248b292f3576c9c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-close1-0f44a73.stdout", "stdout_hash": "dcab72e31dd01f01a3831a1f9277aacb43b1ed6c1e786212b5dcbb65", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops2-98464d0.json0000664000175000017500000000077515141516316026745 0ustar alastairalastair{ "basename": "asr-implied_do_loops2-98464d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops2.f90", "infile_hash": "52395150c001e73afe37bfe9d3ea099d5e75e2704bd1733457496ad2", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops2-98464d0.stdout", "stdout_hash": "6ba930dd979697e226c0008d91a3a705ee1a643ce69d9e3f8b9d8c49", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_02_size-395cc3f.stdout0000664000175000017500000000121715141516316027213 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 local size_a4::Int32 local size_a8::Int64 local size_b4::Int32 local size_b8::Int64 size_a4 = length(a) size_b4 = size(b)[1] size_a8 = length(a) size_b8 = size(b)[1] if size_a4 ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b4 ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end if size_a8 ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end if size_b8 ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_12-b71f657.json0000664000175000017500000000101715141516316030135 0ustar alastairalastair{ "basename": "asr-operator_overloading_12-b71f657", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_12.f90", "infile_hash": "b9247e0fddab7797b86957ed5aa99372f5a365d96b082feafccac339", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_12-b71f657.stdout", "stdout_hash": "66af09fcadc3831bffd6be79415012b6a1b887fb36a42feb98e4cad9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine8-af54645.json0000664000175000017500000000072615141516316025703 0ustar alastairalastair{ "basename": "ast-subroutine8-af54645", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine8.f90", "infile_hash": "0773280a17582e4ee611300a1962aead9df772923af735456acb45a1", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine8-af54645.stdout", "stdout_hash": "3cada5129881227e5d8c744754db3c1dc3d62b162068d4ab76d8189f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_10-eb8bca7.json0000664000175000017500000000074515141516316025436 0ustar alastairalastair{ "basename": "asr-string_10-eb8bca7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_10.f90", "infile_hash": "bc81968bc899cbe447092923c9b089e1942c9ecf0bad33ee7145f2a9", "outfile": null, "outfile_hash": null, "stdout": "asr-string_10-eb8bca7.stdout", "stdout_hash": "1b8375aa941c37192221cfda2f7fe2f1c0fb3aa4fefa2bd11ea0687c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-block_02-82f9e5f.stderr0000664000175000017500000000026315141516316025427 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-intrinsics3-a8fd035.json0000664000175000017500000000073515141516316025736 0ustar alastairalastair{ "basename": "asr-intrinsics3-a8fd035", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics3.f90", "infile_hash": "4a1a87d1964e4fcaec28b46493e377b19c106ddf516e7eece19bf505", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics3-a8fd035.stderr", "stderr_hash": "9662b63070f3016d3239c26dc851585640cfeda7c75518af0882dae7", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-allocate_01-ce7628b.json0000664000175000017500000000072615141516316025562 0ustar alastairalastair{ "basename": "ast-allocate_01-ce7628b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/allocate_01.f90", "infile_hash": "7a28f6115b781d328be0829189ace20f4f862bf745740c6c78400225", "outfile": null, "outfile_hash": null, "stdout": "ast-allocate_01-ce7628b.stdout", "stdout_hash": "29fe560e6eae2987477bffd4880efd8abe5f9a4ba4b83312a889e625", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-substring-73a0b8e.json0000664000175000017500000000073315141516316026163 0ustar alastairalastair{ "basename": "ast_f90-substring-73a0b8e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/substring.f90", "infile_hash": "c8a378c73c450c69e6694f02f51b2e1706ee25ae2e9645c28fd98788", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-substring-73a0b8e.stdout", "stdout_hash": "12af24b0dac9f8a696bebaf4ff8b5fa0298864c7a410609252ed8a52", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-doloop_03-6b5d1e0.json0000664000175000017500000000073615141516316025600 0ustar alastairalastair{ "basename": "julia-doloop_03-6b5d1e0", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_03-6b5d1e0.stdout", "stdout_hash": "e5049a78686d8d34f28e845132e890ad2753d82aad418e8bb64f7314", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-doloop_03-9c463c5.json0000664000175000017500000000074515141516316025213 0ustar alastairalastair{ "basename": "asr-doloop_03-9c463c5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_03.f90", "infile_hash": "eafcb3d9dca52d81012b124f360aa148c946ed2e7ed8de07041aba1d", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_03-9c463c5.stdout", "stdout_hash": "728dd3fdb90d6d18af7d492d2e38b261756008d71a0a57a1e476ed8b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_39-89c7d0d.stdout0000664000175000017500000005347415141516316026042 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_39: (Program (SymbolTable 8 { build_model: (ExternalSymbol 8 build_model 2 build_model modules_39_fpm_39 [] build_model Public ), filewrite: (ExternalSymbol 8 filewrite 4 filewrite modules_39_module_fpm_filesystem_39 [] filewrite Public ), join_path: (ExternalSymbol 8 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39 [modules_39_fpm_39] [(SubroutineCall 8 build_model () [] () .false. ) (Print (StringConstant "executing modules_39" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_39_fpm_39: (Module (SymbolTable 2 { build_model: (Function (SymbolTable 7 { }) build_model (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 filewrite () [((FunctionCall 2 join_path () [((StringConstant "build" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant ".gitignore" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) (()) (()) (())] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () )) ((ArrayPhysicalCast (ArrayConstant 1 ["*"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor ) PointerArray DescriptorArray (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .false. .false. () ), filewrite: (ExternalSymbol 2 filewrite 4 filewrite modules_39_module_fpm_filesystem_39 [] filewrite Public ), join_path: (ExternalSymbol 2 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39_fpm_39 () [modules_39_module_fpm_filesystem_39] .false. .false. .false. ), modules_39_module_fpm_filesystem_39: (Module (SymbolTable 4 { filewrite: (Function (SymbolTable 5 { filedata: (Variable 5 filedata [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), filename: (Variable 5 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) filewrite (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 filename) (Var 5 filedata)] [] () Public .false. .false. () ), join_path: (Function (SymbolTable 6 { a1: (Variable 6 a1 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 6 a2 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a3: (Variable 6 a3 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), a4: (Variable 6 a4 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), a5: (Variable 6 a5 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), path: (Variable 6 path [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) join_path (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a1) (Var 6 a2) (Var 6 a3) (Var 6 a4) (Var 6 a5)] [] (Var 6 path) Public .false. .false. () ) }) modules_39_module_fpm_filesystem_39 () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-types_13-ddae644.stderr0000664000175000017500000000474415141516316026234 0ustar alastairalastairstyle suggestion: Use character(5) instead of character*5 --> tests/../integration_tests/types_13.f90:30:5 | 30 | character*5 :: d | ^^^^^^^^^^^ help: write this as 'character(5)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:36:5 | 36 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:37:5 | 37 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:38:5 | 38 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:43:5 | 43 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:44:5 | 44 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:45:5 | 45 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:51:5 | 51 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:52:5 | 52 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:53:5 | 53 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' style suggestion: Use integer(4) instead of integer*4 --> tests/../integration_tests/types_13.f90:59:5 | 59 | integer*4, value, intent(in) :: a | ^^^^^^^^^ help: write this as 'integer(4)' style suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/types_13.f90:60:5 | 60 | real*8, value, intent(in) :: b | ^^^^^^ help: write this as 'real(8)' style suggestion: Use logical(4) instead of logical*4 --> tests/../integration_tests/types_13.f90:61:5 | 61 | logical*4 :: c | ^^^^^^^^^ help: write this as 'logical(4)' lfortran-lfortran-2f73434/tests/reference/llvm-allocate_02-4f6b634.stdout0000664000175000017500000002055515141516316026237 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %array = type { i32*, i32, %dimension_descriptor*, i1, i32 } %dimension_descriptor = type { i32, i32, i32 } @0 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @1 = private unnamed_addr constant [92 x i8] c"At 5:5 of file tests/allocate_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @2 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @3 = private unnamed_addr constant [92 x i8] c"At 8:9 of file tests/allocate_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %arr = alloca %array*, align 8 store %array* null, %array** %arr, align 8 %arr_desc = alloca %array, align 8 %2 = getelementptr %array, %array* %arr_desc, i32 0, i32 2 %3 = alloca i32, align 4 store i32 1, i32* %3, align 4 %4 = load i32, i32* %3, align 4 %5 = alloca %dimension_descriptor, i32 %4, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i32 1, i32* %6, align 4 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i32 1, i32* %7, align 4 store %dimension_descriptor* %5, %dimension_descriptor** %2, align 8 %8 = getelementptr %array, %array* %arr_desc, i32 0, i32 4 store i32 1, i32* %8, align 4 %9 = getelementptr %array, %array* %arr_desc, i32 0, i32 0 store i32* null, i32** %9, align 8 store %array* %arr_desc, %array** %arr, align 8 %i = alloca i32, align 4 %10 = load %array*, %array** %arr, align 8 %11 = ptrtoint %array* %10 to i64 %12 = icmp eq i64 %11, 0 br i1 %12, label %merge_allocated, label %check_data check_data: ; preds = %.entry %13 = getelementptr %array, %array* %10, i32 0, i32 0 %14 = load i32*, i32** %13, align 8 %15 = ptrtoint i32* %14 to i64 %16 = icmp ne i64 %15, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %16, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %17 = load %array*, %array** %arr, align 8 %18 = getelementptr %array, %array* %17, i32 0, i32 1 store i32 0, i32* %18, align 4 %19 = getelementptr %array, %array* %17, i32 0, i32 2 %20 = load %dimension_descriptor*, %dimension_descriptor** %19, align 8 %21 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %20, i32 0 %22 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 0 %23 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 1 %24 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 2 store i32 1, i32* %22, align 4 store i32 1, i32* %23, align 4 store i32 1, i32* %24, align 4 %25 = getelementptr %array, %array* %17, i32 0, i32 0 %26 = call i8* @_lfortran_malloc(i64 4) %27 = bitcast i8* %26 to i32* store i32* %27, i32** %25, align 8 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %28 = load i32, i32* %i, align 4 %29 = add i32 %28, 1 %30 = icmp sle i32 %29, 1000000 br i1 %30, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %31 = load i32, i32* %i, align 4 %32 = add i32 %31, 1 store i32 %32, i32* %i, align 4 %33 = load %array*, %array** %arr, align 8 %34 = ptrtoint %array* %33 to i64 %35 = icmp eq i64 %34, 0 br i1 %35, label %merge_allocated2, label %check_data1 check_data1: ; preds = %loop.body %36 = getelementptr %array, %array* %33, i32 0, i32 0 %37 = load i32*, i32** %36, align 8 %38 = ptrtoint i32* %37 to i64 %39 = icmp ne i64 %38, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %loop.body %is_allocated3 = phi i1 [ false, %loop.body ], [ %39, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %40 = getelementptr %array, %array* %33, i32 0, i32 0 %41 = load i32*, i32** %40, align 8 %42 = bitcast i32* %41 to i8* call void @_lfortran_free(i8* %42) %43 = getelementptr %array, %array* %33, i32 0, i32 0 store i32* null, i32** %43, align 8 br label %ifcont5 else: ; preds = %merge_allocated2 br label %ifcont5 ifcont5: ; preds = %else, %then4 %44 = load %array*, %array** %arr, align 8 %45 = ptrtoint %array* %44 to i64 %46 = icmp eq i64 %45, 0 br i1 %46, label %merge_allocated7, label %check_data6 check_data6: ; preds = %ifcont5 %47 = getelementptr %array, %array* %44, i32 0, i32 0 %48 = load i32*, i32** %47, align 8 %49 = ptrtoint i32* %48 to i64 %50 = icmp ne i64 %49, 0 br label %merge_allocated7 merge_allocated7: ; preds = %check_data6, %ifcont5 %is_allocated8 = phi i1 [ false, %ifcont5 ], [ %50, %check_data6 ] br i1 %is_allocated8, label %then9, label %ifcont10 then9: ; preds = %merge_allocated7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %merge_allocated7 %51 = load %array*, %array** %arr, align 8 %52 = getelementptr %array, %array* %51, i32 0, i32 1 store i32 0, i32* %52, align 4 %53 = getelementptr %array, %array* %51, i32 0, i32 2 %54 = load %dimension_descriptor*, %dimension_descriptor** %53, align 8 %55 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %54, i32 0 %56 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 0 %57 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 1 %58 = getelementptr %dimension_descriptor, %dimension_descriptor* %55, i32 0, i32 2 store i32 1, i32* %56, align 4 store i32 1, i32* %57, align 4 store i32 1, i32* %58, align 4 %59 = getelementptr %array, %array* %51, i32 0, i32 0 %60 = call i8* @_lfortran_malloc(i64 4) %61 = bitcast i8* %60 to i32* store i32* %61, i32** %59, align 8 br label %loop.head loop.end: ; preds = %loop.head call void @_lpython_free_argv() br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_allocate_02 FINALIZE_SYMTABLE_allocate_02: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_allocate_02 %62 = load %array*, %array** %arr, align 8 %63 = icmp ne %array* %62, null br i1 %63, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_arr %64 = getelementptr %array, %array* %62, i32 0, i32 0 %65 = load i32*, i32** %64, align 8 %66 = icmp eq i32* %65, null br i1 %66, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %67 = bitcast i32* %65 to i8* call void @_lfortran_free(i8* %67) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_arr br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface5-fbe2fe9.json0000664000175000017500000000100315141516316027542 0ustar alastairalastair{ "basename": "asr-implicit_interface5-fbe2fe9", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface5.f90", "infile_hash": "d64e1ffc56e56861a453e4bb44844ddf1f61a1f8da9eedc4fcd3098e", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface5-fbe2fe9.stdout", "stdout_hash": "3debd5771c3a895fcaef1f72ef2611795b8097b55fe25ce60ad05d19", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common1-bbe229a.json0000664000175000017500000000072115141516316025106 0ustar alastairalastair{ "basename": "asr-common1-bbe229a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/common1.f90", "infile_hash": "8f3a2e387c1b0481198ba4f773ea74e1bed5023a9fb121822a194e6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-common1-bbe229a.stderr", "stderr_hash": "3cc7683d6060350e6774028f82341d10b6efd92fc722e7b5f71630cb", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-array8-f50328f.stdout0000664000175000017500000000015315141516316025642 0ustar alastairalastairprogram array8 implicit none character(len=255) :: a(4) character :: b(4)*255, c(4)*255 end program array8 lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_01-33c47db.stderr0000664000175000017500000000027415141516316030726 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/operator_overloading_01.f90:28:9 | 28 | endif | ^^^^^ help: write this as 'end if' lfortran-lfortran-2f73434/tests/reference/ast-end_module_name-8436c0b.json0000664000175000017500000000075115141516316026520 0ustar alastairalastair{ "basename": "ast-end_module_name-8436c0b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/end_module_name.f90", "infile_hash": "6afa73a63a26aac4e984bf10bda60bd5aeaa1cbc187f7239fa4e1c16", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-end_module_name-8436c0b.stderr", "stderr_hash": "0ed62e2f3e592782fe92886b47d10ad2a86c85f2619430b5242bf434", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-format_40-9ce331f.stdout0000664000175000017500000000007615141516316025652 0ustar alastairalastair3.E+0 0.E+0 1.E+1 3.E+3 3.E+1 4.E+2 3.E+4 -5.E+0 1.E-5 1.E+11 lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_39-f721e16.json0000664000175000017500000000076115141516316026106 0ustar alastairalastair{ "basename": "asr-intrinsics_39-f721e16", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_39.f90", "infile_hash": "f27f54c8f7027443ffce72d800b4fe7abc183483b295523d83b32adf", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_39-f721e16.stdout", "stdout_hash": "fe4b920518f82888690681f07175bd8f7617b898ac33223cbe2f84d2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-statement_02-daaef34.stdout0000664000175000017500000001315315141516316026477 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gscale: (Function (SymbolTable 2 { fpoint: (Function (SymbolTable 4 { fpoint_return_var_name: (Variable 4 fpoint_return_var_name [] ReturnVar () () Default (Real 4) 2 fpoint Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpoint (FunctionType [(Integer 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 i)] [(Assignment (Var 4 fpoint_return_var_name) (Cast (Var 4 i) IntegerToReal (Real 4) () ) () .false. .false. )] (Var 4 fpoint_return_var_name) Public .false. .false. () ) }) gscale (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), statement_02: (Program (SymbolTable 3 { }) statement_02 [] [(SubroutineCall 1 gscale () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-duplicate_module_procedures-3eaed23.json0000664000175000017500000000101515141516316031304 0ustar alastairalastair{ "basename": "asr-duplicate_module_procedures-3eaed23", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/duplicate_module_procedures.f90", "infile_hash": "3a9e11036265ddc79e565af9c00310f2d8d7235a45c7c805375832bd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-duplicate_module_procedures-3eaed23.stderr", "stderr_hash": "38d21afeae8536898184a80cf9b870afed4bd09bc105d7be51f34fbe", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-continue_body_if_loop-670a23a.stdout0000664000175000017500000001336215141516316030320 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_program_lfortran: (Program (SymbolTable 2 { j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 2 s [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) implicit_program_lfortran [] [(Assignment (Var 2 s) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(Assignment (Var 2 s) (RealBinOp (Var 2 s) Add (ArrayItem (Var 2 u) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) () .false. .false. ) (If () (RealCompare (Var 2 s) GtE (Cast (IntegerConstant 1000000 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1000000.000000 (Real 4) ) ) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 )] [] ) (Stop () ) (GoToTarget 2 2 )] ) }) [] ) ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.stderrlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.s0000664000175000017500000000041515141516316034233 0ustar alastairalastairsemantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/array_constructor_with_asterisk_in_type_spec.f90:2:14 | 2 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-recursion_03-3285725.stdout0000664000175000017500000003063215141516316026323 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-7,I4\00", align 1 @string_const_data = private constant [7 x i8] c"before:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data, i32 0, i32 0), i64 7 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [12 x i8] c"S-DESC-6,I4\00", align 1 @string_const_data.3 = private constant [6 x i8] c"after:" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.3, i32 0, i32 0), i64 6 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [12 x i8] c"S-DESC-9,I4\00", align 1 @string_const_data.6 = private constant [9 x i8] c"x in getx" @string_const.7 = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data.6, i32 0, i32 0), i64 9 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.8 = private constant [7 x i8] c"in sub1" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.8, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [12 x i8] c"S-DESC-3,I4\00", align 1 @string_const_data.11 = private constant [3 x i8] c"r =" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.11, i32 0, i32 0), i64 3 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_recursion_03_solver(i32 ()* %f, i32* %iter) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %f_val = alloca i32, align 4 %solver = alloca i32, align 4 %0 = call i32 %f() store i32 %0, i32* %f_val, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, %string_descriptor* @string_const, i32* %f_val) %3 = load i64, i64* %1, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %12 = load i32, i32* %iter, align 4 %13 = sub i32 %12, 1 store i32 %13, i32* %call_arg_value1, align 4 %14 = call i32 @__module_recursion_03_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %14, i32* %solver, align 4 %15 = call i32 %f() store i32 %15, i32* %f_val, align 4 %16 = alloca i64, align 8 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.2, i32 0, i32 0), i64* %16, i32 0, i32 0, %string_descriptor* @string_const.4, i32* %f_val) %18 = load i64, i64* %16, align 4 %stringFormat_desc2 = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %free_done call void @_lfortran_free(i8* %17) br label %free_done4 free_done4: ; preds = %free_nonnull3, %free_done br label %return return: ; preds = %free_done4 br label %FINALIZE_SYMTABLE_solver FINALIZE_SYMTABLE_solver: ; preds = %return %27 = load i32, i32* %solver, align 4 ret i32 %27 } declare i32 @f() define i32 @__module_recursion_03_solver_caller(i32 ()* %f, i32* %iter) { .entry: %solver_caller = alloca i32, align 4 %0 = call i32 @__module_recursion_03_solver(i32 ()* %f, i32* %iter) store i32 %0, i32* %solver_caller, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_solver_caller FINALIZE_SYMTABLE_solver_caller: ; preds = %return %1 = load i32, i32* %solver_caller, align 4 ret i32 %1 } declare i32 @f.1() define i32 @__module_recursion_03_sub1(i32* %y, i32* %iter) { .entry: %sub1 = alloca i32, align 4 %tmp = alloca i32, align 4 %x = alloca i32, align 4 %0 = load i32, i32* %y, align 4 store i32 %0, i32* %x, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.9, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %iter, align 4 %3 = icmp eq i32 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 1, i32* %sub1, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i32, i32* %x, align 4 store i32 %4, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %5 = call i32 @sub1.__module_recursion_03_getx() store i32 %5, i32* %tmp, align 4 %6 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %6, i32* %x, align 4 %7 = load i32, i32* %x, align 4 store i32 %7, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %8 = call i32 @__module_recursion_03_solver_caller(i32 ()* @sub1.__module_recursion_03_getx, i32* %iter) store i32 %8, i32* %sub1, align 4 %9 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %9, i32* %x, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return %10 = load i32, i32* %sub1, align 4 ret i32 %10 } define i32 @sub1.__module_recursion_03_getx() { .entry: %getx = alloca i32, align 4 %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.5, i32 0, i32 0), i64* %0, i32 0, i32 0, %string_descriptor* @string_const.7, i32* @__module___lcompilers_created__nested_context__sub1__x) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry %11 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %11, i32* %getx, align 4 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_getx FINALIZE_SYMTABLE_getx: ; preds = %return %12 = load i32, i32* %getx, align 4 ret i32 %12 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca i32, align 4 store i32 3, i32* %call_arg_value, align 4 store i32 3, i32* %call_arg_value1, align 4 %2 = call i32 @__module_recursion_03_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %2, i32* %r, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.10, i32 0, i32 0), i64* %3, i32 0, i32 0, %string_descriptor* @string_const.12, i32* %r) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-cmplx_03-6426707.json0000664000175000017500000000072415141516316024676 0ustar alastairalastair{ "basename": "asr-cmplx_03-6426707", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_03.f90", "infile_hash": "d3add6413f1936fbc8aed9a556247c1daceec2a468a4982648661973", "outfile": null, "outfile_hash": null, "stdout": "asr-cmplx_03-6426707.stdout", "stdout_hash": "df07bedff9fa5da2fedf067ac6c9fc6aae760e9d4947c5da87f9f891", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_04_func-9f59ad6.stdout0000664000175000017500000005220215141516316026667 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_04_func: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), abs: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) abs (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Print (StringConstant "abs" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) (Logical 4) () ) [(Assignment (Var 4 r) (Var 4 a) () .false. .false. )] [(Assignment (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4) () ) () .false. .false. )] )] (Var 4 r) Public .false. .false. () ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sum (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Print (StringConstant "sum" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Real 4) () ) () .false. .false. )] [] )] (Var 3 r) Public .false. .false. () ) }) arrays_04_func [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 b) (FunctionCall 2 sum () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) (Real 4) () ))] (Real 4) () () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-loop_test2-82d82ea.json0000664000175000017500000000073615141516316025564 0ustar alastairalastair{ "basename": "asr-loop_test2-82d82ea", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", "infile_hash": "b0c94f235f33da51d9037d0833df0c1ca4aaef4f3a3a29c9426ba51b", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_test2-82d82ea.stdout", "stdout_hash": "5a61041d16d5b6f7896977b9c417f929fc8db81e705b8c3a0b776911", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-merge_bits_run-9579699.json0000664000175000017500000000074615141516316026307 0ustar alastairalastair{ "basename": "asr-merge_bits_run-9579699", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/merge_bits_run.f90", "infile_hash": "1af0976e21bea2f1804946c6fc9338f4a28f5ed426b33ffe3b79c6b5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-merge_bits_run-9579699.stderr", "stderr_hash": "c2d5bf15339248ebc5a3de085cb8a04b5e8e755a24f9de55b60b8c76", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-print_01-63a0480.stdout0000664000175000017500000001067615141516316025520 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [15 x i8] c"I4,I4,I4,I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [15 x i8] c"I4,I4,I4,I4,I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %2 = alloca i64, align 8 %3 = alloca i32, align 4 store i32 1, i32* %3, align 4 %4 = alloca i32, align 4 store i32 3, i32* %4, align 4 %5 = load i32, i32* %x, align 4 %6 = add i32 25, %5 %7 = alloca i32, align 4 store i32 %6, i32* %7, align 4 %8 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %x, i32* %3, i32* %4, i32* %x, i32* %7) %9 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %8, i8** %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %9, i64* %11, align 4 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %13 = load i8*, i8** %12, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %15 = load i64, i64* %14, align 4 %16 = trunc i64 %15 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %13, i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %17 = icmp eq i8* %8, null br i1 %17, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %8) br label %free_done free_done: ; preds = %free_nonnull, %.entry %18 = alloca i64, align 8 %19 = alloca i32, align 4 store i32 1, i32* %19, align 4 %20 = alloca i32, align 4 store i32 3, i32* %20, align 4 %21 = load i32, i32* %x, align 4 %22 = add i32 25, %21 %23 = alloca i32, align 4 store i32 %22, i32* %23, align 4 %24 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @serialization_info.1, i32 0, i32 0), i64* %18, i32 0, i32 0, i32* %x, i32* %19, i32* %20, i32* %x, i32* %23) %25 = load i64, i64* %18, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %24, i8** %26, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %25, i64* %27, align 4 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %29 = load i8*, i8** %28, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %31 = load i64, i64* %30, align 4 %32 = trunc i64 %31 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %29, i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %33 = icmp eq i8* %24, null br i1 %33, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %24) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done call void @_lpython_free_argv() br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_print_01 FINALIZE_SYMTABLE_print_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp2-a8d63da.json0000664000175000017500000000074415141516316026657 0ustar alastairalastair{ "basename": "asr_preprocess-cpp2-a8d63da", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp2.f90", "infile_hash": "e4f9f303812209a53776ca76314834165cd4c21ccb47e1443169ce53", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp2-a8d63da.stderr", "stderr_hash": "da316951a0c26667c46ff6d3551f43dbee0947389a62c1a8774be659", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-array3-a030743.json0000664000175000017500000000070715141516316024517 0ustar alastairalastair{ "basename": "ast-array3-a030743", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "ast-array3-a030743.stdout", "stdout_hash": "cafa5a9c40c58eaa5ac75c6e901b6d75a9d9c33052274dd45be6c1ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutines_03-dde7b37.stdout0000664000175000017500000000160315141516316027322 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}, c::Int32, d::Int32) b[] = a + 1 + c + d end function main() local i::Int32 local j::Int32 local k::Int32 local l::Int32 i = 1 j = 1 k = 1 l = 1 __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__, k, l) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-bits1-e91f9ad.json0000664000175000017500000000070415141516316024574 0ustar alastairalastair{ "basename": "asr-bits1-e91f9ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/bits1.f90", "infile_hash": "c39794d54e8e96a492e045c7f8717eac0aa46c1d836f43a76816eb00", "outfile": null, "outfile_hash": null, "stdout": "asr-bits1-e91f9ad.stdout", "stdout_hash": "c441dd0c8b8afba3c0aba5e9192ccc72ea36e6a263c9de7a9e84edd9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_37-7eba027.json0000664000175000017500000000075015141516316025441 0ustar alastairalastair{ "basename": "asr-modules_37-7eba027", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_37.f90", "infile_hash": "38f6c4643686768ff7e53fc236694c9de56c70b63a8b18bc70765a20", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_37-7eba027.stdout", "stdout_hash": "c35ef2dff2c2f043fbf6316d7a3f44983958988547a01d63f126cf74", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sqrt_neg-5a20839.json0000664000175000017500000000072415141516316025147 0ustar alastairalastair{ "basename": "asr-sqrt_neg-5a20839", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/sqrt_neg.f90", "infile_hash": "15a7d352afe51615cd4dccb6177025a159d4a580e4e236cff0ecc4c2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-sqrt_neg-5a20839.stderr", "stderr_hash": "552d5a7fa70662e63c97de072539e61f808566312514dbc299b6782a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-parameter_03-d4df941.json0000664000175000017500000000075615141516316025760 0ustar alastairalastair{ "basename": "asr-parameter_03-d4df941", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_03.f90", "infile_hash": "5f60b01824232c9c934cf71ae5b7f4f54e51457361dc9fefb28092a5", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_03-d4df941.stdout", "stdout_hash": "d503364b7f6595a07423e3d609f238e48e21ddb1ab9b46fe0f6b608a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_bound_1-b0c2255.stdout0000664000175000017500000003650315141516316026476 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_bound_1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_bound_1 [] [(Print (StringFormat () [(ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 3 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 9 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 3 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 6 (Integer 4) Decimal) ) (ArrayBound (Var 2 b) (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 6 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 10 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_05-1440b57.stdout0000664000175000017500000000142115141516316030433 0ustar alastairalastair(TranslationUnit [(Subroutine x [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [(ImplicitNone [] () )] [] [(SubroutineCall 0 y [] [] [] [] () )] [] ) (Subroutine y [] [] () () [] [] [] [] [(Print 0 () [(String "x" ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_07-2d29eab.stdout0000664000175000017500000005127315141516316026436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_07: (Program (SymbolTable 8 { f_a: (ExternalSymbol 8 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 8 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (ExternalSymbol 8 f_c 6 f_c functions_07_c [] f_c Public ), p: (Variable 8 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 8 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_07 [functions_07_c] [(Assignment (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_07_a: (Module (SymbolTable 2 { f_a: (Function (SymbolTable 3 { u: (Variable 3 u [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_a (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 u)] [(Assignment (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 3 v) Public .false. .false. () ) }) functions_07_a () [] .false. .false. .false. ), functions_07_b: (Module (SymbolTable 4 { f_a: (ExternalSymbol 4 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (Function (SymbolTable 5 { x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_b (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4) () () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 5 y) Public .false. .false. () ) }) functions_07_b () [functions_07_a] .false. .false. .false. ), functions_07_c: (Module (SymbolTable 6 { f_a: (ExternalSymbol 6 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 6 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (Function (SymbolTable 7 { w: (Variable 7 w [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_c (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 w)] [(Assignment (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4) () () ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ) }) functions_07_c () [functions_07_b] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-max_01-415ceb0.stdout0000664000175000017500000000673515141516316025123 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { max_01: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) max_01 [] [(Assignment (Var 2 y) (RealConstant 5.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 z) (RealConstant 9.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Max [(Var 2 y) (Cast (Var 2 z) RealToReal (Real 8) () )] 0 (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dimension_02-2fc38c6.json0000664000175000017500000000074015141516316025754 0ustar alastairalastair{ "basename": "asr-dimension_02-2fc38c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dimension_02.f90", "infile_hash": "6f2688e5aabb8713f42f87a3cf9595b44940f71cea7b5947673e1355", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dimension_02-2fc38c6.stderr", "stderr_hash": "36369436635af024d38553b91e78f35d990be0fc8f5fe0defdaf7d5a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-integer16-eab0df9.stderr0000664000175000017500000000016715141516316025765 0ustar alastairalastairsyntax error: kind 16 is not supported yet. --> tests/errors/integer16.f90:2:2 | 2 | integer*16 x | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-interface3-6416a61.stdout0000664000175000017500000002657715141516316025736 0ustar alastairalastair(TranslationUnit [(Module interface3 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "!checks the syntax" )] ) )] [(Declaration () [(SimpleAttribute AttrPublic )] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ()) (() [] [] () () None (AttrAssignment)) (() [] [] () () None (AttrIntrinsicOperator PLUS )) (() [] [] () () None (AttrIntrinsicOperator AND )) (() [] [] () () None (AttrDefinedOperator "in" ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator STAR ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator DIV ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator DIV ))] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator CONCAT ))] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [sample] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderName A ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [sample] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderAssignment) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine LOGICAL_TO_NUMERIC [(N) (B)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(N [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrIntent In )] [(B [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeaderOperator PLUS ) () [(InterfaceModuleProcedure [union] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator MINUS ) () [(InterfaceModuleProcedure [difference] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator STAR ) () [(InterfaceModuleProcedure [intersection] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator DIV ) () [] ) (Interface (InterfaceHeaderOperator DIV ) () [] ) (Interface (InterfaceHeaderOperator POW ) () [] ) (Interface (InterfaceHeaderOperator EQ ) () [] ) (Interface (InterfaceHeaderOperator NOTEQ ) () [] ) (Interface (InterfaceHeaderOperator GT ) () [] ) (Interface (InterfaceHeaderOperator GTE ) () [] ) (Interface (InterfaceHeaderOperator LT ) () [] ) (Interface (InterfaceHeaderOperator LTE ) () [(InterfaceModuleProcedure [subset] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderOperator NOT ) () [] ) (Interface (InterfaceHeaderOperator AND ) () [] ) (Interface (InterfaceHeaderOperator OR ) () [] ) (Interface (InterfaceHeaderOperator EQV ) () [] ) (Interface (InterfaceHeaderOperator NEQV ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Interface (AbstractInterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Declaration () [(SimpleAttribute AttrPublic )] [(() [] [] () () None (AttrIntrinsicOperator CONCAT ))] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeaderOperator CONCAT ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (Interface (InterfaceHeaderWrite formatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [write_formatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderWrite unformatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [write_unformatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderRead formatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [read_formatted] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderRead unformatted ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [read_unformatted] [(SimpleAttribute AttrModule )] () )] )] [] [(Function f [(operator)] [] () () (TriviaNode [(EndOfLine) (Comment "! Currently parsed as an operator, but AST -> ASR phase can fix that:" )] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(() [] [] () () None (AttrIntrinsicOperator STAR ))] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_06-5ae916e.stdout0000664000175000017500000001226315141516316027216 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { abstract_type: (Module (SymbolTable 2 { subrout: (Function (SymbolTable 3 { a: (Variable 3 a [] Out () () Default (StructType [] [] .false. .true. ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () ) }) subrout (FunctionType [(StructType [] [] .false. .true. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [] () Public .false. .false. () ) }) abstract_type () [] .false. .false. .false. ), derived_types_01: (Program (SymbolTable 5 { }) derived_types_01 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-Same_type-928201f.json0000664000175000017500000000072715141516316025256 0ustar alastairalastair{ "basename": "asr-Same_type-928201f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/Same_type.f90", "infile_hash": "22088315b66fc8b2ed539e5c6d132f2d65c700a3e8bc03d433e36a41", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-Same_type-928201f.stderr", "stderr_hash": "abdf329c990bab35fa4cd3b438f2d71c7744c2bb99756939a15a03a3", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_without_newline-d50219b.json0000664000175000017500000000101615141516316031023 0ustar alastairalastair{ "basename": "ast-fixed_form_without_newline-d50219b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_without_newline.f", "infile_hash": "55ed393261e352904304d4b561daa9acd2e4e713f6ea4ebcc20d39cd", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_without_newline-d50219b.stdout", "stdout_hash": "78334f346126e16891ab514171e49249fd443692e7cdf5ad4431e6fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_namelist_01-c1be094.stdout0000664000175000017500000003464615141516316032300 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { __lcompilers_created__nested_context__outer_: (Module (SymbolTable 6 { i: (Variable 6 i [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nml: (Namelist 6 nml [6 i 6 x] ), x: (Variable 6 x [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __lcompilers_created__nested_context__outer_ () [] .false. .false. .false. ), nested_namelist_01: (Program (SymbolTable 5 { outer: (ExternalSymbol 5 outer 2 outer nested_namelist_01_mod [] outer Public ) }) nested_namelist_01 [nested_namelist_01_mod] [(SubroutineCall 5 outer () [] () .false. )] ), nested_namelist_01_mod: (Module (SymbolTable 2 { outer: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i1: (ExternalSymbol 3 i1 6 i __lcompilers_created__nested_context__outer_ [] i Public ), inner: (Function (SymbolTable 4 { nml: (ExternalSymbol 4 nml 6 nml __lcompilers_created__nested_context__outer_ [] nml Public ) }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(FileWrite 0 () () () () [] () () () .false. 4 nml () )] () Public .false. .false. () ), nml: (Namelist 3 nml [3 i 3 x] ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x1: (ExternalSymbol 3 x1 6 x __lcompilers_created__nested_context__outer_ [] x Public ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 x) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 3 i1) (Var 3 i) () .false. .false. ) (Assignment (Var 3 x1) (Var 3 x) () .false. .false. ) (SubroutineCall 3 inner () [] () .false. ) (Assignment (Var 3 i) (Var 3 i1) () .false. .false. ) (Assignment (Var 3 x) (Var 3 x1) () .false. .false. )] () Public .false. .false. () ) }) nested_namelist_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-bin_op_real_dp-21bb7e8.stdout0000664000175000017500000002077615141516316027002 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bin_op_real_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin_op_real_dp [] [(Assignment (Var 2 zero) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.142857 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 v) (RealBinOp (RealConstant 1.000000 (Real 8) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) ) (Real 8) (RealConstant 0.142857 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) (Real 4) (RealConstant 0.142857 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_04-114a023.stdout0000664000175000017500000000042515141516316025630 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [(ImplicitNone [] () )] [] [(Print 0 () [(String "hello world" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_complex-445a788.json0000664000175000017500000000077015141516316027530 0ustar alastairalastair{ "basename": "asr-kind_star_of_complex-445a788", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_complex.f90", "infile_hash": "ec644c8546cdd93e6feaaa8be9edac6c5dfc8f42193c206c9c240ec8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_complex-445a788.stderr", "stderr_hash": "bffec4de1d8e74c0e674f7c2ca35078168082073fea045f4f1f01176", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_init_expr-array13-db4fb0f.stdout0000664000175000017500000001413415141516316027716 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array13: (Program (SymbolTable 2 { __1_k: (Variable 2 __1_k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), numbers: (Variable 2 numbers [] Local () () Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array13 [] [(Assignment (Var 2 __1_k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 __1_k) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 __1_k) ())] (Integer 4) RowMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-complex_02-0f52aa7.json0000664000175000017500000000075015141516316025430 0ustar alastairalastair{ "basename": "ast-complex_02-0f52aa7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_02.f90", "infile_hash": "c5e28327787e2c4dd5e42cc1c527749eb2e7b7f27623222a118f3bbe", "outfile": null, "outfile_hash": null, "stdout": "ast-complex_02-0f52aa7.stdout", "stdout_hash": "f6bf1ebacd758b9b5d53183435894d2ac93b704c4a09a8a57a9995fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm1-8a138d6.json0000664000175000017500000000066715141516316024454 0ustar alastairalastair{ "basename": "wat-wasm1-8a138d6", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm1.f90", "infile_hash": "23d205c649ffca4c7d77e3b0e23240fbf79e99247a00dfa0d96efc81", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm1-8a138d6.stdout", "stdout_hash": "fc133e774eade4347cc44a2fa4caff9fdbbe21c41a053790183574c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutine9-60500c5.json0000664000175000017500000000074115141516316026263 0ustar alastairalastair{ "basename": "ast_f90-subroutine9-60500c5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/subroutine9.f90", "infile_hash": "7936a6a897f4c893828bca05987a6c387bcda279b2ac5f20199ffda3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutine9-60500c5.stdout", "stdout_hash": "dd9805b45fe88710ed0323934c97a79aeacfb32782cf2a1cb9f6540c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_2-1350599.json0000664000175000017500000000075315141516316025620 0ustar alastairalastair{ "basename": "ast-fixed_form_2-1350599", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_2.f", "infile_hash": "f8b865a6a1e302e28e80c6e5011c5559aaf98bbee4447a5c81881224", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_2-1350599.stderr", "stderr_hash": "7b184dd4766acb5cdb47e17fdcd61853d6f051afe375e80522e62bbf", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-nint_overflow-bf5738b.json0000664000175000017500000000074315141516316026366 0ustar alastairalastair{ "basename": "asr-nint_overflow-bf5738b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/nint_overflow.f90", "infile_hash": "887b0d5e99be9d33310deee68d28e0b7207e7e7c2ac8ede95f302925", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-nint_overflow-bf5738b.stderr", "stderr_hash": "3dfc23e5fabee4c3980707d1c40d9c9f9e241ca9c769becaa9c86f13", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/julia-expr_11-ab53b8f.stdout0000664000175000017500000000021615141516316025707 0ustar alastairalastairfunction main() local x::Float64 x = ( 2.00000000000000000e+00 * x + 1.00000000000000000e+00) / (x * (x + Float64(1))) end main() lfortran-lfortran-2f73434/tests/reference/asr-array1-20700fb.json0000664000175000017500000000070715141516316024572 0ustar alastairalastair{ "basename": "asr-array1-20700fb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "asr-array1-20700fb.stdout", "stdout_hash": "264291bb45cd587d18305cb22a1a595b14262983295219397413f3cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-ichar_01-a5284c8.stderr0000664000175000017500000000023415141516316025324 0ustar alastairalastairsemantic error: Argument 1 to Ichar must have length 1 --> tests/errors/ichar_01.f90:3:13 | 3 | print*, ichar("okay") | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-modules_25-b0e87c0.stdout0000664000175000017500000010225315141516316026011 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_25: (Program (SymbolTable 2 { toml_character_tokenizer: (ExternalSymbol 2 toml_character_tokenizer 4 toml_character_tokenizer tomlf_de_character [] toml_character_tokenizer Public ), toml_table: (ExternalSymbol 2 toml_table 8 toml_table tomlf_de_tokenizer_25 [] toml_table Public ), toml_tokenizer: (ExternalSymbol 2 toml_tokenizer 8 toml_tokenizer tomlf_de_tokenizer_25 [] toml_tokenizer Public ), toml_tokenizer_: (ExternalSymbol 2 toml_tokenizer_ 8 toml_tokenizer_ tomlf_de_tokenizer_25 [] toml_tokenizer_ Public ) }) module_25 [tomlf_de_character] [(Print (StringConstant "running module_25 program" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_de_character: (Module (SymbolTable 4 { next_token: (Function (SymbolTable 6 { de: (Variable 6 de [] InOut () () Default (StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 4 toml_character_tokenizer Source Private Required .false. .false. .false. () .false. .false. ), dot_is_token: (Variable 6 dot_is_token [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) next_token (FunctionType [(StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 de) (Var 6 dot_is_token)] [] () Private .false. .false. () ), toml_character_tokenizer: (Struct (SymbolTable 5 { conf: (Variable 5 conf [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), next_token: (StructMethodDeclaration 5 next_token () next_token 4 next_token Source .false. .false. ) }) toml_character_tokenizer (StructType [(Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [conf] [] Source Private .false. .false. [] () 4 toml_tokenizer ), toml_table: (ExternalSymbol 4 toml_table 8 toml_table tomlf_de_tokenizer_25 [] toml_table Public ), toml_tokenizer: (ExternalSymbol 4 toml_tokenizer 8 toml_tokenizer tomlf_de_tokenizer_25 [] toml_tokenizer Public ), toml_tokenizer_: (ExternalSymbol 4 toml_tokenizer_ 8 toml_tokenizer_ tomlf_de_tokenizer_25 [] toml_tokenizer_ Public ) }) tomlf_de_character () [tomlf_de_tokenizer_25] .true. .false. .false. ), tomlf_de_tokenizer_25: (Module (SymbolTable 8 { next_token: (Function (SymbolTable 12 { de: (Variable 12 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 8 toml_tokenizer Source Private Required .false. .false. .false. () .false. .false. ), dot_is_token: (Variable 12 dot_is_token [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) next_token (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) (Logical 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 de) (Var 12 dot_is_token)] [] () Private .false. .false. () ), parse_select: (Function (SymbolTable 13 { 1_toml_tokenizer_current: (ExternalSymbol 13 1_toml_tokenizer_current 10 current toml_tokenizer [] current Public ), de: (Variable 13 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 8 toml_tokenizer Source Private Required .false. .true. .false. () .false. .false. ), table: (Variable 13 table [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 8 toml_table Source Private Required .false. .false. .false. () .false. .false. ) }) parse_select (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 de)] [(Nullify [(Var 13 table)] ) (Associate (StructInstanceMember (Var 13 de) 13 1_toml_tokenizer_current (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () ) (Var 13 table) )] () Private .false. .false. () ), toml_table: (Struct (SymbolTable 9 { inline: (Variable 9 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Private .false. .false. [] () () ), toml_tokenizer: (Struct (SymbolTable 10 { current: (Variable 10 current [] Local (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 10 current) ) (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 10 current) ) Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 8 toml_table Source Private Required .false. .false. .false. () .false. .false. ), next_token: (StructMethodDeclaration 10 next_token () next_token 8 next_token Source .true. .false. ) }) toml_tokenizer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .true. .false. ) [toml_table] [current] [] Source Private .false. .true. [] () () ), toml_tokenizer_: (Struct (SymbolTable 11 { }) toml_tokenizer_ (StructType [] [] .true. .false. ) [] [] [] Source Private .false. .true. [] () 8 toml_tokenizer ) }) tomlf_de_tokenizer_25 () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-derived_types_03-268a4a4.stdout0000664000175000017500000000771515141516316027135 0ustar alastairalastair(TranslationUnit [(Program derived_types_03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine Y [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(DerivedType A [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () A None ) [] [(b [] [] () () None ())] () )] [] [] [] ) (Function Z [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(DerivedType A [] () [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () A None ) [] [(b [] [] () () None ())] () )] [(Assignment 0 Z 5 () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_21-af89e92.stdout0000664000175000017500000000011215141516316025652 0ustar alastairalastair42 42 is the answer 42 43 The touch is 42 degrees The touch is 42 lfortran-lfortran-2f73434/tests/reference/asr-template_sort_01-b412f73.json0000664000175000017500000000077215141516316026567 0ustar alastairalastair{ "basename": "asr-template_sort_01-b412f73", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_sort_01.f90", "infile_hash": "5e6f0ec6f2e9d533d188f1fa2a9b82e4c6f007962376a942c9e47b70", "outfile": null, "outfile_hash": null, "stdout": "asr-template_sort_01-b412f73.stdout", "stdout_hash": "0ae3e037ce1f23bda09c43a62f09524b40498143a25c68923443ddda", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-team1-f0af498.json0000664000175000017500000000070415141516316024502 0ustar alastairalastair{ "basename": "ast-team1-f0af498", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/team1.f90", "infile_hash": "c7d57807d2f91911de8beb317405307221c403b50c6abdec58484b8b", "outfile": null, "outfile_hash": null, "stdout": "ast-team1-f0af498.stdout", "stdout_hash": "96941664a3ca5f8afe52665681990109cfa0177a2d3d54d515f0ebd5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_number_args_function-1f6f6fa.json0000664000175000017500000000102615141516316032026 0ustar alastairalastair{ "basename": "asr-incorrect_number_args_function-1f6f6fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_number_args_function.f90", "infile_hash": "2ce169328c06c00519157a9d7abae8902aa7fa8d165958d8abe359f0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_number_args_function-1f6f6fa.stderr", "stderr_hash": "80c5bdc2270b2db7e4e1ab8899c12c9c1352e1089d22984a21133c1c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-block_01-98c37d0.stdout0000664000175000017500000003324615141516316025363 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { block_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), associate_block: (AssociateBlock (SymbolTable 3 { block: (Block (SymbolTable 4 { b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block [(Assignment (Var 4 b) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 4 c) (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant -3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntrinsicElementalFunction Cos [(RealBinOp (Var 4 b) Add (Var 4 c) (Real 4) () )] 0 (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. )] ), n: (Variable 3 n [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 3 n) (Var 2 a) ) (BlockCall -1 3 block )] ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_01 [] [(Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (If () (IntegerCompare (Var 2 b) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_01-e2ed4a5.json0000664000175000017500000000076715141516316026621 0ustar alastairalastair{ "basename": "llvm-subroutines_01-e2ed4a5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_01-e2ed4a5.stdout", "stdout_hash": "2af3c886f18d2a108de5b6e22ff43685f69b3e1eab9992088c344abf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce3-9c6ccff.json0000664000175000017500000000076415141516316030121 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce3-9c6ccff", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce3.f90", "infile_hash": "68244c7ec55a2abd3a98afa53cf637130918461cb0264902730a72b3", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce3-9c6ccff.stdout", "stdout_hash": "fedf187e13bfd5a66265908dbaf86807d3b5aaff55adbcfa82cf912c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_02-83f1d9f.json0000664000175000017500000000076715141516316026555 0ustar alastairalastair{ "basename": "llvm-subroutines_02-83f1d9f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_02.f90", "infile_hash": "0da20d4528bff96e6ec7497805bf54f1744384b5ab8de197c3e75432", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_02-83f1d9f.stdout", "stdout_hash": "75688d1068b991b52465d0338841d9b5037353e7bb2f2e767330595b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-contains1-58ed60a.stdout0000664000175000017500000002077515141516316025750 0ustar alastairalastair(TranslationUnit [(Program test23stars () [] [] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () (String "?" ()) Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ()) (k [] [] () () None ()) (n [(1 2 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [j k] [0 0] )] () ) (SubroutineCall 0 input [] [(() n () 0) (() (String "2*4" ()) () 0) (() b () 0) (() c () 0) (() d () 0) (() 666 () 0)] [] [] () ) (Write 0 [(()) ((String "(2i2,1x,a)" ()))] [] [(* (FuncCallOrArray n [] [(() 1 () 0)] [] [] [] ) j) (** (FuncCallOrArray n [] [(() 2 () 0)] [] [] [] ) k) b] () ) (Stop 0 () () () ) (Print 666 (String "(a)" ()) [(String " * error in n" ())] () ) (Print 0 (String "(*(i4))" ()) [n] () )] [(Subroutine input [(n) (a) (b) (c) (d) (r)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(n [(() () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [(AttrIntent In )] [(a [] [] () () DoubleAsterisk ())] () ) (Declaration (AttrType TypeCharacter [] () () DoubleAsterisk ) [(AttrIntent Out )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value)] () () None ) [(AttrIntent In )] [(d [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(ch [] [] () () None ())] () ) (Declaration (AttrType TypeClass [] () () Asterisk ) [(SimpleAttribute AttrAllocatable )] [(e [(() () DimensionExpr)] [] () () None ())] () )] [(SelectRank 0 () () d [(RankStar () [(Print 0 (String "(a)" ()) [(String "This should not be printed!" ())] () )] )] () () ) (Read 0 () [(a) (())] [(iostat i)] [(FuncCallOrArray n [] [(() 1 () 0)] [] [] [] ) (FuncCallOrArray n [] [(() 2 () 0)] [] [] [] )] () ) (If 0 () (/= i 0) [(Return 0 1 () )] [] () () () ) (Print 0 (String "(a)" ()) [(String "Enter anything to continue." ())] () ) (Read 0 () [(()) ((String "(a)" ()))] [(iostat i)] [ch] () ) (Write 0 [(b) ((String "(i1)" ()))] [(iostat i)] [666] () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_15-9f619ed.json0000664000175000017500000000074315141516316027653 0ustar alastairalastair{ "basename": "run-array_bounds_check_15-9f619ed", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_15.f90", "infile_hash": "ae2dee1b53ed7b6e4496aca841d2401fbe69cfcc430f41676ed79607", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_15-9f619ed.stderr", "stderr_hash": "a5eb2f5dba82c765dc766041bc50ddaa68eb9311d72da579260390de", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast_f90-types_13-ddae644.stdout0000664000175000017500000000330315141516316026241 0ustar alastairalastairprogram types_13 use iso_c_binding, only: c_int, c_double, c_char implicit none interface subroutine g(d) character*(*) :: d end subroutine g subroutine g2(d) character(len=*) :: d end subroutine g2 subroutine g3(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g3 subroutine g4(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g4 subroutine g5(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine g5 subroutine g6(d) character(len=5) :: d end subroutine g6 integer(c_int) function f1(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f1 integer(c_int) function f2(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f2 function f3(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f3 function f4(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer(4), value, intent(in) :: a real(8), value, intent(in) :: b logical(4) :: c end function f4 subroutine f5(a, b, c) bind(C, name="_cf5") import :: c_int import :: c_double integer(c_int) :: r integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b logical :: c end subroutine f5 end interface end program types_13 lfortran-lfortran-2f73434/tests/reference/llvm-nullify_01-810c9d3.json0000664000175000017500000000075315141516316025556 0ustar alastairalastair{ "basename": "llvm-nullify_01-810c9d3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "llvm-nullify_01-810c9d3.stdout", "stdout_hash": "d4ff6673331076c761c4df711bc43cb7f4445b65159db40423596b1c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_02-48f3a02.stdout0000664000175000017500000000102115141516316025672 0ustar alastairalastairprogram goto2 implicit none integer :: A A = 0 1 continue write(*, *) A = A + 1 if (A > 2) then go to 95 end if write(*, *) "A =", A, " Starting" if (A == 1) then go to 10 end if go to 20 10 continue write(*, *) "A =", A, " Got to 10" go to 30 20 continue write(*, *) "A =", A, " Got to 20" 30 continue write(*, *) "A =", A, " Got to 30" if (A == 2) then go to 99 end if go to 1 95 continue write(*, *) "A =", A, " Got to 95" 99 continue write(*, *) "A =", A, " Got to 99" stop " " end program goto2 lfortran-lfortran-2f73434/tests/reference/asr-entry2-a9679e0.json0000664000175000017500000000075615141516316024646 0ustar alastairalastair{ "basename": "asr-entry2-a9679e0", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/entry2.f90", "infile_hash": "8a9990154b2df25acf24c7fec7a8d5c1a984523e505e71caacf27c61", "outfile": null, "outfile_hash": null, "stdout": "asr-entry2-a9679e0.stdout", "stdout_hash": "1a37b35094fd6c951a21af39f49d9c994d8a1555bf07e81f012113eb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine5-272e7be.json0000664000175000017500000000071115141516316025744 0ustar alastairalastair{ "basename": "cpp-subroutine5-272e7be", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine5-272e7be.stdout", "stdout_hash": "af1e1aa50982757b2781271f2e6bdfdf657c3dd0937a7da523277c0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do1-0a89222.stdout0000664000175000017500000000675315141516316024367 0ustar alastairalastair(TranslationUnit [(DoLoop 0 () 0 i 1 5 () [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 () [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 2 [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 i 1 5 () [(Assignment 0 a (+ a i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 n 0 () ) (DoLoop 0 () 50 i 1 10 () [(Assignment 0 j i () ) (DoLoop 0 () 0 k 1 5 () [(Assignment 0 l k () ) (Assignment 0 n (+ n 1) (TriviaNode [] [(EOLComment "! this statement executes 50 times" )] ) )] () (TriviaNode [] [(EOLComment "! nonlabeled do inside a labeled do" )] ) ) (Continue 50 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-use_statement-bb26ff2.stdout0000664000175000017500000001236215141516316026777 0ustar alastairalastair(TranslationUnit [(Program use_statement (TriviaNode [(EndOfLine) (Comment "! AST" ) (Comment "! Syntax check only" )] [] ) [(Use [(SimpleAttribute AttrIntrinsic )] example [(UseSymbol rename name ) (UseSymbol RENAME NAME )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(IntrinsicOperator POW )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(IntrinsicOperator NOT )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(DefinedOperator "in" )] .true. () ) (Use [(SimpleAttribute AttrIntrinsic )] example [(RenameOperator "plus" "add" )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [] .false. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] EXAMPLE [] .false. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(UseAssignment)] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(IntrinsicOperator EQ )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(IntrinsicOperator OR )] .true. () ) (Use [(SimpleAttribute AttrNon_Intrinsic )] example [(DefinedOperator "definedoperator" )] .true. () ) (Use [] example [(IntrinsicOperator PLUS )] .true. () ) (Use [] example [(UseSymbol sample () )] .true. () ) (Use [] example [(UseSymbol rename sample )] .true. () ) (Use [] example [(IntrinsicOperator STAR )] .true. () ) (Use [] example [(IntrinsicOperator DIV )] .true. () ) (Use [] example [(IntrinsicOperator DIV )] .true. () ) (Use [] example [(IntrinsicOperator NOTEQ )] .true. () ) (Use [] example [(IntrinsicOperator GT )] .true. () ) (Use [] example [(IntrinsicOperator LTE )] .true. () ) (Use [] example [(IntrinsicOperator AND )] .true. () ) (Use [] example [(IntrinsicOperator EQV )] .true. () ) (Use [] example [(DefinedOperator "dot" )] .true. () ) (Use [] example [(UseWrite formatted )] .true. () ) (Use [] example [(UseRead unformatted )] .true. () ) (Use [] example [] .true. () ) (Use [] example [(RenameOperator "localDefop" "useDefop" ) (UseSymbol b a )] .false. () )] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-where_03-a34eed8.json0000664000175000017500000000074215141516316025163 0ustar alastairalastair{ "basename": "asr-where_03-a34eed8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_03.f90", "infile_hash": "987afee1a50b146dbe0bb5ebb0052fdc3bcef478e6a2409f78b5607f", "outfile": null, "outfile_hash": null, "stdout": "asr-where_03-a34eed8.stdout", "stdout_hash": "3fe7e48a09da37d5df5e294a46323a073c1cd21683566841a8665a66", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_01_transpose-fb3276a.stdout0000664000175000017500000017641415141516316027751 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matrix_01_tranpose: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) matrix_01_tranpose [] [(Assignment (Var 2 a) (ArrayReshape (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 b) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 3 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) ()) [(If () (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 b) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Integer 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 x) (Cast (ArrayReshape (ArrayConstant 100 [1, 2, 3, ...., 23, 24, 25] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 25 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [5, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 100 [1, 2, 3, ...., 23, 24, 25] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 100 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...., 2.30000000e+01, 2.40000000e+01, 2.50000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 y) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 5 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) Sub (ArrayItem (Var 2 y) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 d) (Cast (ArrayReshape (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) IntegerToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.0000000000000000e+00, 2.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 e) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 d) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 1 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 d) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 8) ColMajor () ) Sub (ArrayItem (Var 2 e) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Real 8) ColMajor () ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 c) (ArrayReshape (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) (Complex 4) (ComplexConstant 5.000000 6.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) (Complex 4) (ComplexConstant 7.000000 8.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [(1.00000000e+00, 2.00000000e+00), (3.00000000e+00, 4.00000000e+00), (5.00000000e+00, 6.00000000e+00), (7.00000000e+00, 8.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayPhysicalCast (ArrayConstant 8 [2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (Var 2 f) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Real [(ArrayItem (Var 2 f) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Aimag [(ArrayItem (Var 2 f) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Complex 4) ColMajor () )] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (Var 2 l) (ArrayBroadcast (LogicalConstant .true. (Logical 4) ) (ArrayConstant 8 [12, 31] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (Var 2 m) (IntrinsicArrayFunction Transpose [(ArrayPhysicalCast (Var 2 l) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 31 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 l) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 l) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 12 (Integer 4) Decimal) ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 l) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 l) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 31 (Integer 4) Decimal) ) ()) [(If () (LogicalBinOp (ArrayItem (Var 2 l) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) NEqv (ArrayItem (Var 2 m) [(() (Var 2 j) ()) (() (Var 2 i) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/fortran-int_to_complex_cast_in_comparison-2b60771.stdout0000664000175000017500000000045515141516316033537 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = 8 contains elemental complex(8) function dabs(x) result(r) complex(8), intent(in) :: x if (x /= cmplx(0, 0.0, kind=8)) then r = x else r = cmplx(0, 0.0, kind=8) - x end if end function dabs end program expr2 lfortran-lfortran-2f73434/tests/reference/asr-bindc3-91bce68.stdout0000664000175000017500000001614615141516316025213 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc3: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Pointer (Integer 2) ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 2) () Source Public Required .false. .true. .false. () .false. .false. ) }) bindc3 [iso_c_binding] [(CPtrToPointer (Var 2 queries) (Var 2 x) () () ) (Print (StringFormat () [(PointerToCPtr (Var 2 x) (CPtr) () ) (Var 2 queries)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Associate (Var 2 x) (Var 2 y) ) (Print (StringFormat () [(PointerToCPtr (Var 2 x) (CPtr) () ) (PointerToCPtr (GetPointer (Var 2 y) (Pointer (Integer 2) ) () ) (CPtr) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form5-66fddbd.json0000664000175000017500000000074115141516316026041 0ustar alastairalastair{ "basename": "ast-fixed_form5-66fddbd", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form5.f", "infile_hash": "a40b468e72a8562746dc8711312f496a7635144b26f7cfca248cb16e", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form5-66fddbd.stdout", "stdout_hash": "2440a38ffa8af1e22b1ad974a551f85538dfa9bdeac0a333d0798817", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_10-526e3f4.json0000664000175000017500000000074515141516316026561 0ustar alastairalastair{ "basename": "asr-derived_types_10-526e3f4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_10.f90", "infile_hash": "bef962bd9d9eddd888790f26dbec99567806aa15d47cac1ab04cc225", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_10-526e3f4.stdout", "stdout_hash": "7adb50f561ac31cbc66290ab3ae3e9bcf4e38a4b75a6a6de9085eef4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-iostat_non_scalar_value-7d45a6f.json0000664000175000017500000000100115141516316030355 0ustar alastairalastair{ "basename": "asr-iostat_non_scalar_value-7d45a6f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/iostat_non_scalar_value.f90", "infile_hash": "23f916f0f858452d7da668a9c4d49311f4b09b4eb80d4157d9c79411", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-iostat_non_scalar_value-7d45a6f.stderr", "stderr_hash": "1182d0e11afef20a9ffdc0f982544fb3647c2d72ddd8bea1ac20caec", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_02-1c20d1a.json0000664000175000017500000000076115141516316026134 0ustar alastairalastair{ "basename": "asr-intrinsics_02-1c20d1a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_02-1c20d1a.stdout", "stdout_hash": "926a2f05ed901d168275124289ff8d414bd009ff1b7eeb6ebc3f6c05", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-data2-10e42d7.json0000664000175000017500000000070415141516316024371 0ustar alastairalastair{ "basename": "asr-data2-10e42d7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/data2.f90", "infile_hash": "89ccb50e394ce2bf22af43e22184c4a457c3afee616586f6bbe24100", "outfile": null, "outfile_hash": null, "stdout": "asr-data2-10e42d7.stdout", "stdout_hash": "a8f87c5d9dad2af5ec194bb472755b73285189f35cfef8aa8b15bc1d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_05-321b5d3.json0000664000175000017500000000072415141516316025017 0ustar alastairalastair{ "basename": "asr-array_05-321b5d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_05.f90", "infile_hash": "b86286701e5ed9406c3ba31672b09bcf91a452a95ac041a8b2d4c33a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_05-321b5d3.stderr", "stderr_hash": "8b515c9bd2f970b2082c5f32b22d33101955e1ee395fc49eab2a160c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-do6-02ec641.json0000664000175000017500000000067615141516316024076 0ustar alastairalastair{ "basename": "ast-do6-02ec641", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do6.f90", "infile_hash": "47676f4b10ae9b305cb49d9ea4650d1e255a2b3506ab9001fc8f402c", "outfile": null, "outfile_hash": null, "stdout": "ast-do6-02ec641.stdout", "stdout_hash": "c607ebe43c0cb0237f5d50329ffa53b788ec4ca65e39c4d316eb8ecb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-where1-5c3f533.stdout0000664000175000017500000000112015141516316025620 0ustar alastairalastairprogram test implicit none integer :: x(2,2) = reshape([1, 2, 3, 4], [2, 2]) where (x == 1) x = 2 elsewhere where (x == 2) x = 3 elsewhere x = x*2 end where end where if (all(x == reshape([2, 3, 6, 8], [2, 2]))) then print *, "pass" else print *, "fail" end if where (x == 2) x = 3 elsewhere where (x == 3) x = 4 elsewhere where (x == 6) x = x*2 end where end where end where if (all(x == reshape([3, 4, 12, 8], [2, 2]))) then print *, "pass" else print *, "fail" end if end program test lfortran-lfortran-2f73434/tests/reference/asr-global_scope1-786a363.stdout0000664000175000017500000000113115141516316026407 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-expr_09-fa1b124.stdout0000664000175000017500000001520515141516316025317 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i64 i32 i64) i32.const 5 local.set 2 local.get 2 i32.const 2 drop local.get 2 i32.mul local.set 0 local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i64.const 5 local.set 3 local.get 3 i64.const 2 drop local.get 3 i64.mul local.set 1 local.get 3 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.const 25 i64.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/cpp-types_05-06dea62.stdout0000664000175000017500000000246715141516316025505 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = 1.00000000000000000e+00*(float)(2); r = (float)(2)* 1.00000000000000000e+00; r = (float)(2)*((float)(3) + 1.00000000000000000e+00); r = (float)(2)*( 3.00000000000000000e+00 - (float)(1)); r = (float)(1/2); r = 1.00000000000000000e+00/(float)(2); r = (float)(1)/ 2.00000000000000000e+00; i = (int32_t)( 1.00000000000000000e+00*(float)(2)); i = (int32_t)((float)(2)* 1.00000000000000000e+00); i = (int32_t)((float)(2)*((float)(3) + 1.00000000000000000e+00)); i = (int32_t)((float)(2)*( 3.00000000000000000e+00 - (float)(1))); i = 1/2; i = (int32_t)( 1.00000000000000000e+00/(float)(2)); i = (int32_t)((float)(1)/ 2.00000000000000000e+00); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/pass_sign_from_value-sign_from_value-ba1c944.json0000664000175000017500000000106015141516316032252 0ustar alastairalastair{ "basename": "pass_sign_from_value-sign_from_value-ba1c944", "cmd": "lfortran --pass=sign_from_value --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sign_from_value.f90", "infile_hash": "8dbaf3021ce3488c9846d4b6f9ffca21e9d2a2e6f4dfaa10cf7a844c", "outfile": null, "outfile_hash": null, "stdout": "pass_sign_from_value-sign_from_value-ba1c944.stdout", "stdout_hash": "87ec0ab0c65b6c6af4b2115bc8c6cc33066ee6e23b043d6af604bed4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-logical1-fd6d5c4.json0000664000175000017500000000074215141516316025244 0ustar alastairalastair{ "basename": "asr-logical1-fd6d5c4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "asr-logical1-fd6d5c4.stdout", "stdout_hash": "527653ad7373a515f530fbf637faa697c6cd829fc1b357ea12a7a849", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_04-951e966.stdout0000664000175000017500000035274415141516316027416 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_04: (Program (SymbolTable 14 { cast_integer: (ExternalSymbol 14 cast_integer 2 cast_integer template_simple_04_m [] cast_integer Public ), cast_r: (ExternalSymbol 14 cast_r 2 cast_r template_simple_04_m [] cast_r Public ), cast_real: (ExternalSymbol 14 cast_real 2 cast_real template_simple_04_m [] cast_real Public ), generic_sum: (ExternalSymbol 14 generic_sum 2 generic_sum template_simple_04_m [] generic_sum Public ), operator_r: (ExternalSymbol 14 operator_r 2 operator_r template_simple_04_m [] operator_r Public ), test_template: (ExternalSymbol 14 test_template 2 test_template template_simple_04_m [] test_template Public ) }) template_simple_04 [template_simple_04_m] [(SubroutineCall 14 test_template () [] () .false. )] ), template_simple_04_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 11 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 11 arg)] [(Assignment (Var 11 r) (Var 11 arg) () .false. .false. )] (Var 11 r) Public .false. .false. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 12 { arg: (Variable 12 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 12 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 arg)] [(Assignment (Var 12 r) (Cast (Var 12 arg) IntegerToReal (Real 4) () ) () .false. .false. )] (Var 12 r) Public .false. .false. () ), generic_sum: (Template (SymbolTable 7 { add: (Function (SymbolTable 8 { lhs: (Variable 8 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 8 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 lhs) (Var 8 rhs)] [] (Var 8 res) Public .false. .false. () ), cast: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Public .false. .false. () ), generic_sum: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 10 ~add [7 add] Public ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 10 a)] [(Assignment (Var 10 res) (FunctionCall 7 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) () (Integer 4) () ) ()) [(Assignment (Var 10 res) (OverloadedBinOp (Var 10 res) Add (ArrayItem (Var 10 a) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 7 add 10 ~add [((Var 10 res)) ((ArrayItem (Var 10 a) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] (Var 10 res) Public .false. .false. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { __instantiated_generic_sum: (Function (SymbolTable 16 { a: (Variable 16 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 16 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 16 a)] [(Assignment (Var 16 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 16 a) () (Integer 4) () ) ()) [(Assignment (Var 16 res) (OverloadedBinOp (Var 16 res) Add (ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 ~add_intrinsic 10 ~add [((Var 16 res)) ((ArrayItem (Var 16 a) [(() (Var 16 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] (Var 16 res) Public .false. .false. () ), __instantiated_generic_sum1: (Function (SymbolTable 18 { a: (Variable 18 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 18 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 18 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 18 a)] [(Assignment (Var 18 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 18 a) () (Integer 4) () ) ()) [(Assignment (Var 18 res) (OverloadedBinOp (Var 18 res) Add (ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 ~add_intrinsic1 10 ~add [((Var 18 res)) ((ArrayItem (Var 18 a) [(() (Var 18 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] (Var 18 res) Public .false. .false. () ), a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 17 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 17 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (RealBinOp (Var 17 arg0) Add (Var 17 arg1) (Real 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 __instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 13 s_i) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 13 s_r) Sub (Cast (IntegerConstant 55 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 55.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_simple_04_m () [template_simple_04_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_02-021cc51.json0000664000175000017500000000075315141516316025506 0ustar alastairalastair{ "basename": "asr-template_02-021cc51", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_02.f90", "infile_hash": "ced72b8e182313557b3b879bd14e860cc0d24eb74800baecbe858a70", "outfile": null, "outfile_hash": null, "stdout": "asr-template_02-021cc51.stdout", "stdout_hash": "4ef88aee12ad8b169b1a6ca4b4934fbb22c3ba1f58a5e2a6445ec693", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_47-bdbe527.stdout0000664000175000017500000004154515141516316026622 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_47: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 12 [.true., .true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_47 [] [(Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 8 [.true., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 8 [.true., .false.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 4 [.false.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstant 4 [.true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .true. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstructor [(IntegerCompare (IntegerConstant 1 (Integer 4) Decimal) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) )] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [.false., .true.] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) (LogicalConstant .false. (Logical 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayPhysicalCast (ArrayConstructor [(Var 2 l)] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 l) (IntrinsicArrayFunction All [(ArrayConstructor [(LogicalConstant .false. (Logical 4) ) (Var 2 a) (LogicalConstant .true. (Logical 4) )] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () )] 0 (Logical 4) () ) () .false. .false. ) (If () (Var 2 l) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_3-435a232.json0000664000175000017500000000101615141516316027754 0ustar alastairalastair{ "basename": "asr-continue_compilation_3-435a232", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_3.f90", "infile_hash": "3322ee2c45d9dfa92a3573ea256644c9591633ffd92521c1d6ac6e87", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_3-435a232.stderr", "stderr_hash": "4f7a7656de2632ac55731066e7f46c7c9e36e8403f0dc49ae7dcebbf", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_04_func-2fc0cbe.stdout0000664000175000017500000000122015141516316027315 0ustar alastairalastairfunction abs(a::Float32)::Float32 local r::Float32 println("abs") if a > Float32(0) r = a else r = -a end return r end function sum(a::Array{Float32, 1})::Float32 local i::Int32 local r::Float32 println("sum") r = Float32(0) for i ∈ 1:length(a) r = r + a[i] end return r end function main() local a::Array{Float32, 1} local b::Float32 a[1] = Float32(3) a[2] = Float32(2) a[3] = Float32(1) b = sum(Float32(a)) if abs(Float32(b - Float32(6))) > 9.99999974737875164e-06 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/llvm-derived_types_45-ae31b1c.json0000664000175000017500000000077515141516316027102 0ustar alastairalastair{ "basename": "llvm-derived_types_45-ae31b1c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_45.f90", "infile_hash": "e7e4e87444a93ff6319b6d19dac06c02b600da19c934e28fdc831374", "outfile": null, "outfile_hash": null, "stdout": "llvm-derived_types_45-ae31b1c.stdout", "stdout_hash": "b4435b2f653dd727492accbe652816ca097d681e7dc5f1d32affcd43", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr3-99b2959.json0000664000175000017500000000070415141516316024405 0ustar alastairalastair{ "basename": "asr-expr3-99b2959", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "asr-expr3-99b2959.stdout", "stdout_hash": "b4791977bbea408043148e197076e234e97174afb7ec92e59bfa538a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope5-a66d166.json0000664000175000017500000000073415141516316026126 0ustar alastairalastair{ "basename": "asr-global_scope5-a66d166", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope5-a66d166.stdout", "stdout_hash": "6e5df4bf62f85f10891256e169ba52c645276d2a46830cab91312e7e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_05-5502cc1.json0000664000175000017500000000110015141516316032477 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_05-5502cc1", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_05.f90", "infile_hash": "cf4cc8e65f95bcf5b5aacbb6d16d2aa40ef2f4c8442d1cb19b680a35", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_05-5502cc1.stdout", "stdout_hash": "25148213b9a05110a819257fd7dca232e7d01a5890ac19f681a7f661", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-goto_03-75b98c5.stdout0000664000175000017500000000544115141516316025246 0ustar alastairalastair(TranslationUnit [(Program goto_03 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (n [] [] () () None ())] () )] [(Assignment 0 n 2 () ) (Assignment 0 a 10 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (GoTo 0 () n [1 2 3] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 1 a (+ a 10) () ) (Assignment 2 a (+ a 20) () ) (Assignment 3 a (+ a 30) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= a 60) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assign 0 30 n (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (GoTo 0 n () [10 20 30] () ) (Assignment 10 a (* a a) () ) (Assignment 20 a (+ a a) () ) (Assignment 30 a (- a a) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= a 0) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit12-025d795.stderr0000664000175000017500000000224715141516316025642 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit12.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit12.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit12.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit12.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit12.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit12.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit12.f90:2:1 | 2 | implicit integer (b-c) | ^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-associate_01-aa0fe46.stderr0000664000175000017500000000025615141516316027025 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/associate_01.f90:18:8 | 18 | if(a(1).EQ.5) GO TO 1 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-char_arr_assignment-1f9a875.json0000664000175000017500000000075615141516316027434 0ustar alastairalastair{ "basename": "asr-char_arr_assignment-1f9a875", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/char_arr_assignment.f90", "infile_hash": "637e9e1637e9afbc3bcbf797c587b2b064dcf67eb215ce9f22fe5ade", "outfile": null, "outfile_hash": null, "stdout": "asr-char_arr_assignment-1f9a875.stdout", "stdout_hash": "d568fd2181038ef346b04b3d147525787ff948df40f7e92f756b2661", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_05-85bce3c.json0000664000175000017500000000075715141516316027104 0ustar alastairalastair{ "basename": "asr-template_error_05-85bce3c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_05.f90", "infile_hash": "d30f0b51c06d7edfa1071745f98110503353250d239694a17ffa3620", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_05-85bce3c.stderr", "stderr_hash": "348ee2447d9951d887bcc71ba1744ee9f44797c33a5b28ebd2d64bab", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-array_shape_01-214f2d0.stderr0000664000175000017500000000027515141516316026525 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 1(3 and 2) --> tests/errors/array_shape_01.f90:3:1 | 3 | x = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-external1-93d8653.json0000664000175000017500000000076715141516316025251 0ustar alastairalastair{ "basename": "asr-external1-93d8653", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external1.f90", "infile_hash": "56b4ef88c341e64d20695ff19c022ba86a594ce1be597aa4624f694b", "outfile": null, "outfile_hash": null, "stdout": "asr-external1-93d8653.stdout", "stdout_hash": "86ac44a9a25c22b80080b9456ebd5173e2ad04064310b2e217818fcc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr_07-ec2c3a6.json0000664000175000017500000000073715141516316025030 0ustar alastairalastair{ "basename": "asr-expr_07-ec2c3a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_07.f90", "infile_hash": "3104b4735ed58e4c3d370db99249102fa43c866834c04484ea2b7bae", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_07-ec2c3a6.stdout", "stdout_hash": "037c146c63e2e8d793b2ad8d0facab3b0bcecf9af367eb215fa14b00", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-stdin_read_blank_lines_01-029176a.json0000664000175000017500000000061015141516316030311 0ustar alastairalastair{ "basename": "run-stdin_read_blank_lines_01-029176a", "cmd": "lfortran --no-color {infile}", "infile": "tests/stdin_read_blank_lines_01.f90", "infile_hash": "d9e3a87e9dbf9ed1dd379267bbfd108020fb16df86d961f6e2bd402e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_ranks_allocatable_arr1-5e5233d.stderr0000664000175000017500000000025615141516316033052 0ustar alastairalastairsemantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/incompatible_ranks_allocatable_arr1.f90:8:5 | 8 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/cpp-doloop_08-cf3820d.stdout0000664000175000017500000000144615141516316025636 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; i = 1; while (true) { i = i + 1; if (i == 10) { break; } } if (i != 10) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/ast-data1-58e5b8d.json0000664000175000017500000000070415141516316024470 0ustar alastairalastair{ "basename": "ast-data1-58e5b8d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/data1.f90", "infile_hash": "958a14b00f4c624f5f8c444b2e93bcf090a57ee3c44143ec6671b5f6", "outfile": null, "outfile_hash": null, "stdout": "ast-data1-58e5b8d.stdout", "stdout_hash": "8771085e2c96c4c9792a3dd6794b346bcc9318d13ed0ec3d91cc09f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_where-where_01-94e4416.json0000664000175000017500000000077515141516316026325 0ustar alastairalastair{ "basename": "pass_where-where_01-94e4416", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_01-94e4416.stdout", "stdout_hash": "3d8bd9c60c845483c1bc14d6b11e2670f3a925d154c2a48e862d4b73", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-doloop_04-c0ab107.json0000664000175000017500000000076015141516316025726 0ustar alastairalastair{ "basename": "ast_f90-doloop_04-c0ab107", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doloop_04-c0ab107.stdout", "stdout_hash": "f873113b1563c79019ea37160fdf4055c707217c0becce3b009a70f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor9-641e112.json0000664000175000017500000000077015141516316030402 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor9-641e112", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor9.f90", "infile_hash": "29602fb21e7b99077fe13064a66d8d0d714141266b33059fd7f37cf2", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor9-641e112.stdout", "stdout_hash": "7654096527ea6f3df6bc9eda85f931b9ca2423918e32f726b6e3718d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-global_scope3-45d8bdc.json0000664000175000017500000000073415141516316026266 0ustar alastairalastair{ "basename": "ast-global_scope3-45d8bdc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope3-45d8bdc.stdout", "stdout_hash": "a4607a718fd06859a1e6c80fa4f797a17bd2900ba09788612fd76d33", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-associate1-6e54e23.stdout0000664000175000017500000000026415141516316026473 0ustar alastairalastairassociate (x => y) end associate associate (x => (y)) end associate associate (x => y + z) end associate associate (x => -y) end associate call some_subroutine(x, (x)) x = f((x)) lfortran-lfortran-2f73434/tests/reference/llvm-logical3-4bbf8ea.json0000664000175000017500000000106515141516316025506 0ustar alastairalastair{ "basename": "llvm-logical3-4bbf8ea", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical3-4bbf8ea.stdout", "stdout_hash": "0ffd310a903e29d5d7cae3b5543002ce98d95cb3e64926dab4f4db3a", "stderr": "llvm-logical3-4bbf8ea.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_float_02-2681d16.stderr0000664000175000017500000000031115141516316026106 0ustar alastairalastairsemantic error: `mask` argument to `Sum` must be a scalar or array of logical type --> tests/errors/dim_float_02.f90:2:29 | 2 | print *, sum([1, 2, 3], 1, 1.1) | ^^^ lfortran-lfortran-2f73434/tests/reference/ast-nullify_01-24b8fbc.stdout0000664000175000017500000000321715141516316026101 0ustar alastairalastair(TranslationUnit [(Program nullify_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p1 [] [] () () None ()) (p2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(t1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Associate 0 p1 t1 () ) (Associate 0 p2 t1 () ) (Assignment 0 p1 1 () ) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_58-475e064.json0000664000175000017500000000071515141516316025153 0ustar alastairalastair{ "basename": "run-format_58-475e064", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_58.f90", "infile_hash": "f2170db3134d59fbefa690522bab88fc5f052e8a29518b7ef3814a2c", "outfile": null, "outfile_hash": null, "stdout": "run-format_58-475e064.stdout", "stdout_hash": "01411717970a71554dc0f09da55c75313b0232b0051bb64cd1ea4a53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_03-436c4e5.json0000664000175000017500000000075215141516316025305 0ustar alastairalastair{ "basename": "ast_f90-case_03-436c4e5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_03-436c4e5.stdout", "stdout_hash": "e3af8a21921e8d450ecd592961b7ca7e412454698b1ddbcbb34c3800", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-int_03-924441d.json0000664000175000017500000000073415141516316024422 0ustar alastairalastair{ "basename": "asr-int_03-924441d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_03.f90", "infile_hash": "69361b73ce809045078054701961e773c98f6ba5a26ef9240a24bb80", "outfile": null, "outfile_hash": null, "stdout": "asr-int_03-924441d.stdout", "stdout_hash": "46c02442ef708e08cb42606cce98fe3e517fd2404cd5574732861264", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-modules_36-53c9a79.json0000664000175000017500000000075315141516316025565 0ustar alastairalastair{ "basename": "llvm-modules_36-53c9a79", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_36.f90", "infile_hash": "81bd7e21e30c46c3779cc4c928723fbf58bcc748333a96faee9d0b96", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_36-53c9a79.stdout", "stdout_hash": "82dc73756a84fc0166a3dd42be144f9798e4d50cc34190e8bf48a3d6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit10-f531a25.stdout0000664000175000017500000006351215141516316025730 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d1: (Variable 2 d1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), e1: (Variable 2 e1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f1: (Variable 2 f1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 2 g [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [d1 e1 f1] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 f1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [e1] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 6.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 7.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-incompatible_rank_assign-a69f7b4.stderr0000664000175000017500000000025315141516316031050 0ustar alastairalastairsemantic error: Incompatible ranks `0` and `1` in assignment --> tests/errors/incompatible_rank_assign.f90:2:1 | 2 | integer :: x = [1,2,3] | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-write3-49c0266.stdout0000664000175000017500000000311215141516316025274 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [11 x i8] c"Hello World" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @2 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %nwrite = alloca i32, align 4 store i32 6, i32* %nwrite, align 4 store i32 6, i32* %nwrite, align 4 %2 = load i32, i32* %nwrite, align 4 %3 = alloca i32*, align 8 store i32* null, i32** %3, align 8 %4 = load i32*, i32** %3, align 8 %5 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void (i32, i32*, i8*, i64, ...) @_lfortran_file_write(i32 %2, i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i64 4, i8* %5, i64 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0), i64 1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_file_write(i32, i32*, i8*, i64, ...) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-nullify_02-1f0bd3a.stdout0000664000175000017500000001241015141516316026061 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nullify_02: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), p2: (Variable 2 p2 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), t1: (Variable 2 t1 [] Local () () Default (Real 4) () Source Public Required .false. .true. .false. () .false. .false. ), t2: (Variable 2 t2 [] Local () () Default (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ) }) nullify_02 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Assignment (Var 2 p1) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Associate (Var 2 p2) (Var 2 t2) ) (Assignment (Var 2 p2) (Cast (RealConstant 2.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) () .false. .false. ) (Nullify [(Var 2 p1) (Var 2 p2)] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_06-d802f54.stderr0000664000175000017500000000032215141516316027122 0ustar alastairalastairsemantic error: The argument `matrix_b` in `matmul` must be of rank 2, provided an array with rank, 1 --> tests/errors/matrix_matmul_06.f90:5:24 | 5 | print *, matmul(a, b) | ^ lfortran-lfortran-2f73434/tests/reference/asr-subroutine3-9c6f5d1.json0000664000175000017500000000073515141516316025757 0ustar alastairalastair{ "basename": "asr-subroutine3-9c6f5d1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine3.f90", "infile_hash": "7d760144ce6e5f0307d6d35c1d27ab357dc88df82f61cd5d6058d75f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine3-9c6f5d1.stderr", "stderr_hash": "ffe0a4412cffe166df5f25b690125e6886c03e45343fb76b900fd1fa", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-parameter_01-c88a516.json0000664000175000017500000000077115141516316026353 0ustar alastairalastair{ "basename": "ast_f90-parameter_01-c88a516", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/parameter_01.f90", "infile_hash": "3488de8c55d194f309a915223114321d8596fba6f63399b39ac1ad68", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-parameter_01-c88a516.stdout", "stdout_hash": "e4d94bf2282323117c969d5a2af64550a874845922eb0dbb64ad48aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_33-b589c22.json0000664000175000017500000000075015141516316025364 0ustar alastairalastair{ "basename": "asr-modules_33-b589c22", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_33.f90", "infile_hash": "223a997e090d900f7598fe1697a4edf3ea8e14342db03379fb7e7112", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_33-b589c22.stdout", "stdout_hash": "22eb045e3f077691338bc4dfa9c90977b77854b65ecb16775458e3fd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_02-af31c89.stdout0000664000175000017500000002534615141516316026020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i_: (Variable 2 i_ [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 2 w [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex_02 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealUnaryMinus (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant -3.000000 (Real 4) ) ) (Complex 4) (ComplexConstant 1.000000 -3.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealConstant 4.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 i_) (ComplexConstructor (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (Complex 4) (ComplexConstant 0.000000 1.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 z) (ComplexBinOp (Cast (Var 2 a) RealToComplex (Complex 4) () ) Add (ComplexBinOp (Var 2 i_) Mul (Cast (Var 2 b) RealToComplex (Complex 4) () ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Assignment (Var 2 w) (ComplexBinOp (Cast (RealBinOp (Var 2 a) Add (Var 2 b) (Real 4) () ) RealToComplex (Complex 4) () ) Add (ComplexBinOp (Var 2 i_) Mul (Cast (RealBinOp (Var 2 a) Sub (Var 2 b) (Real 4) () ) RealToComplex (Complex 4) () ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 z) (Var 2 w)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout0000664000175000017500000002145515141516316030151 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope6-278bd63.json0000664000175000017500000000101415141516316031054 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope6-278bd63", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope6-278bd63.stdout", "stdout_hash": "c400e8455327c3f052ae02a0187a37de763161d02a477d0e1cc6e79c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_04-39da8f9.json0000664000175000017500000000075015141516316025452 0ustar alastairalastair{ "basename": "llvm-nested_04-39da8f9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_04.f90", "infile_hash": "e1cee5ef2176599a2dccac3f59fc86ddc957a5f559f5edb7ddd710ca", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_04-39da8f9.stdout", "stdout_hash": "486d5525e5607fecc859b3bdbc0ff152311e628d778fd7c74e27b23c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-expr_05-1df98eb.json0000664000175000017500000000075315141516316025726 0ustar alastairalastair{ "basename": "fortran-expr_05-1df98eb", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "fortran-expr_05-1df98eb.stdout", "stdout_hash": "60e8f2848df482856cbe4de15d6d4c8f5af074491104be94623adf02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-line_continuation_03-8570dc1.stdout0000664000175000017500000001214315141516316030001 0ustar alastairalastair(TranslationUnit [(Program line_continuation_03 (TriviaNode [(EndOfLine) (Comment "! The same as line_continuation_02, but we do use & to split a token" )] [] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Here are the rules for & based on the § 6.3.2.4 (\"Free form statement" ) (Comment "! continuation\") in Fortran 2018 standard." ) (EndOfLine) (Comment "! The & character in a comment has no effect" ) (EndOfLine) (Comment "! The & character can be used to continue a line like this:" ) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! If it is used between tokens, then one can, but does not have to put another &" ) (Comment "! on the next line:" ) (EndOfLine)] ) ) (Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! One can continue strings also by treating them as tokens:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Unless the & is at the end of the line, it can be used as a regular" ) (Comment "! character in a string:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string can contain & as a regular character is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Even here: && <- there will be two &" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! One can put arbitrary comments and empty lines after & that will be skipped:" ) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [i] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! In strings the comment cannot be after the first &, but it can be on" ) (Comment "! subsequent lines:" ) (EndOfLine)] ) ) (Print 0 () [(String "some string is continued" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "*t" ()) (String "" ())] (TriviaNode [] [(EndOfLine) (Comment "!! call set_args ( \\' &" ) (Comment "!! & \\n" ) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-forall1-50096b8.stderr0000664000175000017500000000057615141516316025230 0ustar alastairalastairstyle suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:9:33 | 9 | forall (i=1:n, j=1:m, A(i,j).NE.0) & | ^^^^ help: write this as '/=' style suggestion: Use '/=' instead of '.ne.' --> tests/forall1.f90:36:34 | 36 | inner: forall (j=1:100, i.NE.j) | ^^^^ help: write this as '/=' lfortran-lfortran-2f73434/tests/reference/ast-parameter1-e3995e7.json0000664000175000017500000000072315141516316025466 0ustar alastairalastair{ "basename": "ast-parameter1-e3995e7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parameter1.f90", "infile_hash": "89e627eefd928ded810c79f57685b062a029d924767fffd996a7552d", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter1-e3995e7.stdout", "stdout_hash": "cc8e9ed0aa3ba9688a32f03206cef43fa33a3c5f2d2d60121b541ffc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_06-ecc9f3c.stdout0000664000175000017500000000431015141516316025052 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); static int32_t a = 1; const int32_t ap = 1; static int32_t b = 2; const int32_t bp = 2; static float c = 1.00000000000000000e+00; const float cp = 1.00000000000000000e+00; static float d = 2.00000000000000000e+00; const float dp = 2.00000000000000000e+00; const char* grade_fixed = "B"; int32_t marks; const int32_t marks_fixed = 94; if (grade_fixed == "A") { printf("%s\n","Excellent!"); } else if (grade_fixed == "B") { if (a == b) { printf("%s\n","a == b"); if (ap == bp) { printf("%s\n","ap == bp"); } else { printf("%s\n","ap /= bp"); } } else { if ((float)(ap) == cp) { printf("%s\n","ap == cp"); if (cp == dp) { printf("%s\n","cp == dp"); } else { printf("%s\n","cp /= dp"); } } else { if (c == d) { printf("%s\n","c == d"); } } } } else if (grade_fixed == "C") { printf("%s\n","Well done"); } else if (grade_fixed == "D") { printf("%s\n","You passed"); } else if (grade_fixed == "F") { printf("%s\n","Better try again"); } else { printf("%s\n","Invalid grade"); } printf("%s%s%s\n", "Your grade is ", " ", grade_fixed); marks = 94; if (marks >= 40 + bp) { printf("%s\n","Pass!"); } else if (marks <= 39 - ap) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (marks_fixed >= 40 + bp) { printf("%s\n","Pass!"); } else if (0 <= marks_fixed <= 39 - ap) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr2-22f4149.stdout0000664000175000017500000000434215141516316027671 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. )] (Var 2 f1) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/obj-program1-785a609.json0000664000175000017500000000056515141516316025055 0ustar alastairalastair{ "basename": "obj-program1-785a609", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-where1-5c3f533.json0000664000175000017500000000072215141516316025256 0ustar alastairalastair{ "basename": "ast_f90-where1-5c3f533", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/where1.f90", "infile_hash": "cd5e0b85aa90c2bb3dff3fdc1e1e563b601c361a4b57ba16db0bf051", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-where1-5c3f533.stdout", "stdout_hash": "c91657eeaef4fd0b4c18b234bc364630734714fd5b953b2c081c15b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-arrays_04_func-68b1437.json0000664000175000017500000000074715141516316026151 0ustar alastairalastair{ "basename": "cpp-arrays_04_func-68b1437", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_04_func-68b1437.stdout", "stdout_hash": "ddd04aef52e2c4430edf290f5f858a0e2eb8b3739714f9bd7aeaa55a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-associate_04-8bcb3df.stdout0000664000175000017500000004251215141516316026455 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_04: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), associate_block: (AssociateBlock (SymbolTable 3 { v: (Variable 3 v [] Local () () Default (Pointer (Real 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Assignment (Var 3 z) (RealBinOp (RealUnaryMinus (RealBinOp (RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) () ) Add (RealBinOp (Var 2 y) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) () ) (Real 4) () ) (Real 4) () ) Mul (IntrinsicElementalFunction Cos [(Var 2 theta)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Associate (Var 3 v) (Var 2 myreal) ) (Print (StringFormat () [(RealBinOp (Var 2 a) Add (Var 3 z) (Real 4) () ) (RealBinOp (Var 2 a) Sub (Var 3 z) (Real 4) () ) (Var 3 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 v) (RealBinOp (Var 3 v) Mul (RealConstant 4.600000 (Real 4) ) (Pointer (Real 4) ) () ) () .false. .false. )] ), myreal: (Variable 2 myreal [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), theta: (Variable 2 theta [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) associate_04 [] [(Assignment (Var 2 x) (RealConstant 0.420000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 0.350000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 myreal) (RealConstant 9.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 theta) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 a) (RealConstant 0.400000 (Real 4) ) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (Print (StringFormat () [(Var 2 myreal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (RealCompare (RealBinOp (Var 2 myreal) Sub (RealConstant 41.860001 (Real 4) ) (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) Or (RealCompare (RealBinOp (Var 2 myreal) Sub (RealConstant 41.860001 (Real 4) ) (Real 4) () ) Lt (RealUnaryMinus (RealConstant 0.000010 (Real 4) ) (Real 4) (RealConstant -0.000010 (Real 4) ) ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_18-e69cac3.stdout0000664000175000017500000003016315141516316027276 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_10: (Program (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), 1_t_1_t_1: (ExternalSymbol 5 1_t_1_t_1 2 t_1 derived_types_18_module_1 [] t_1 Public ), 1_t_2_r: (ExternalSymbol 5 1_t_2_r 4 r t_2 [] r Public ), t_1: (ExternalSymbol 5 t_1 2 t_1 derived_types_18_module_1 [] t_1 Public ), t_2: (ExternalSymbol 5 t_2 2 t_2 derived_types_18_module_1 [] t_2 Public ), type_1: (Variable 5 type_1 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 5 t_1 Source Public Required .false. .false. .false. () .false. .false. ), type_2: (Variable 5 type_2 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 t_2 Source Public Required .false. .false. .false. () .false. .false. ) }) derived_types_10 [derived_types_18_module_1] [(Assignment (StructInstanceMember (Var 5 type_1) 5 1_t_1_i (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 type_2) 5 1_t_1_t_1 (StructType [(Integer 4)] [] .true. .false. ) () ) (Var 5 type_1) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 type_2) 5 1_t_2_r (Real 4) () ) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 5 type_2) 5 1_t_1_i (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (StructInstanceMember (Var 5 type_2) 5 1_t_2_r (Real 4) () ) NotEq (RealConstant 10.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), derived_types_18_module_1: (Module (SymbolTable 2 { t_1: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), t_2: (Struct (SymbolTable 4 { r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) t_2 (StructType [(Real 4)] [] .true. .false. ) [] [r] [] Source Public .false. .false. [] () 2 t_1 ) }) derived_types_18_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-types_12-e6251f2.json0000664000175000017500000000075515141516316025536 0ustar alastairalastair{ "basename": "ast_f90-types_12-e6251f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/types_12.f90", "infile_hash": "d5db9207ff7ebb121312ebf448d4b591da2b645185b23095e2558455", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-types_12-e6251f2.stdout", "stdout_hash": "092938e0b8018bee2427490eec7cc4ad829780ff42bf09bd3a439de7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_16_module-4aac273.json0000664000175000017500000000101715141516316030173 0ustar alastairalastair{ "basename": "asr-derived_types_16_module-4aac273", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_16_module.f90", "infile_hash": "81550c6abc6abf36b4e475e6f0297fe376befa5adbc94ae398f33526", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_16_module-4aac273.stdout", "stdout_hash": "fe625074484bd3508e3f484755e135e4bc775dc153596296757c57f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-case_06-3550f46.stdout0000664000175000017500000000332615141516316025437 0ustar alastairalastairfunction main() local a::Int32 = 1 local ap::Int32 = 1 local b::Int32 = 2 local bp::Int32 = 2 local c::Float32 = 1.00000000000000000e+00 local cp::Float32 = 1.00000000000000000e+00 local d::Float32 = 2.00000000000000000e+00 local dp::Float32 = 2.00000000000000000e+00 local grade_fixed::String = "B" local marks::Int32 local marks_fixed::Int32 = 94 if grade_fixed == "A" println("Excellent!") elseif grade_fixed == "B" if a == b println("a == b") if ap == bp println("ap == bp") else println("ap /= bp") end else if Float32(ap) == cp println("ap == cp") if cp == dp println("cp == dp") else println("cp /= dp") end else if c == d println("c == d") end end end elseif grade_fixed == "C" println("Well done") elseif grade_fixed == "D" println("You passed") elseif grade_fixed == "F" println("Better try again") else println("Invalid grade") end println("Your grade is ", " ", grade_fixed) marks = 94 if marks ≥ 40 + bp println("Pass!") elseif marks ≤ 39 - ap println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) if marks_fixed ≥ 40 + bp println("Pass!") elseif 0 ≤ marks_fixed ≤ 39 - ap println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) end main() lfortran-lfortran-2f73434/tests/reference/ast-parameter_02-9547a35.json0000664000175000017500000000075615141516316025623 0ustar alastairalastair{ "basename": "ast-parameter_02-9547a35", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_02.f90", "infile_hash": "09e4b92d73bf1ea50001dc2926c14f213a0c8eda2c2e399f78df895e", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_02-9547a35.stdout", "stdout_hash": "a3c063bfbcd58db7a82a814ce3c9e77a11891489dec04ea2ae535b75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-callback_05-c86f2cc.json0000664000175000017500000000075615141516316026002 0ustar alastairalastair{ "basename": "llvm-callback_05-c86f2cc", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_05.f90", "infile_hash": "a8a0c2faf44ba52594875b5f834d1202280180be0317269c4ccfa8dd", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_05-c86f2cc.stdout", "stdout_hash": "4bf5bd68b479133644c4e5faeee65e0c16783a78475a378cdda6bb3b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-int_dp-9b89d9f.json0000664000175000017500000000073715141516316025156 0ustar alastairalastair{ "basename": "llvm-int_dp-9b89d9f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp.f90", "infile_hash": "f59edf2644a27d68d7127283dbb961288e4041e2de16284795b100de", "outfile": null, "outfile_hash": null, "stdout": "llvm-int_dp-9b89d9f.stdout", "stdout_hash": "b99a04e12012c7656a52111b1f72f8833e3a956afe11889bc22f32c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr9-ba35d31.json0000664000175000017500000000070415141516316024523 0ustar alastairalastair{ "basename": "ast-expr9-ba35d31", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr9.f90", "infile_hash": "72b98645e78d4c2860107f173940315443535270bca4d18d631ea006", "outfile": null, "outfile_hash": null, "stdout": "ast-expr9-ba35d31.stdout", "stdout_hash": "de77a271840bafcf1dcaebd0e0acacd145eeeb81c50c4b35efc52423", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_real-6cb0873.json0000664000175000017500000000076415141516316026216 0ustar alastairalastair{ "basename": "asr-arrays_01_real-6cb0873", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_real.f90", "infile_hash": "52d4b470c5523650dead5fa570d62db7293b9ecd23758e3cc4ba28c2", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_real-6cb0873.stdout", "stdout_hash": "6b0800097f736952323d55c4be266c859185ecd34b1d249d2a68d2b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program_variable-066cc64.stderr0000664000175000017500000000021615141516316027247 0ustar alastairalastairsemantic error: Variable 'foo' is not declared --> tests/errors/program_variable.f90:3:7 | 3 | bar = foo | ^^^ 'foo' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-private1-d8bb7ee.json0000664000175000017500000000074215141516316025365 0ustar alastairalastair{ "basename": "asr-private1-d8bb7ee", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/private1.f90", "infile_hash": "aab1af3d1d5589a3a229317b277fd53d15afd3db9d21a6f2306c111e", "outfile": null, "outfile_hash": null, "stdout": "asr-private1-d8bb7ee.stdout", "stdout_hash": "7de9c140070eaa31a9a077bcf7a98d56cfc247b41100105cf5ede93a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_class_in_derived_type-15eb7b6.json0000664000175000017500000000103015141516316032437 0ustar alastairalastair{ "basename": "asr-polymorphic_class_in_derived_type-15eb7b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/polymorphic_class_in_derived_type.f90", "infile_hash": "677dedbd26096d25f181bde9ec5de0e23794b2f2435c5ba79defa792", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_class_in_derived_type-15eb7b6.stdout", "stdout_hash": "4ebf01cede991bbc81476b9bca277fda99b25c80fbc5285d0b6848e8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex1-322879a.json0000664000175000017500000000071515141516316025061 0ustar alastairalastair{ "basename": "asr-complex1-322879a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/complex1.f90", "infile_hash": "3243c29c947c9700891971aae8780afac25cd01387e0307063f3928a", "outfile": null, "outfile_hash": null, "stdout": "asr-complex1-322879a.stdout", "stdout_hash": "9c32a7c1c94785dad567af6b08dc4a39379542baaf1bbd8d7d0f95c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-kokkos_program2-43a2cc6.json0000664000175000017500000000072515141516316026567 0ustar alastairalastair{ "basename": "cpp-kokkos_program2-43a2cc6", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/kokkos_program2.f90", "infile_hash": "bba0b0329c504e01dd099058af96e20a7fe00294f66456fe3da634e0", "outfile": null, "outfile_hash": null, "stdout": "cpp-kokkos_program2-43a2cc6.stdout", "stdout_hash": "7610bc2855457732fca191fca696bc1823650600eac03109d40ce92c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_02-8302041.json0000664000175000017500000000074515141516316025021 0ustar alastairalastair{ "basename": "asr-nested_02-8302041", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_02-8302041.stdout", "stdout_hash": "a005ffb3e2ffa723299e793bc1e88bb05dd9a74b525341d9fe4ba74c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_06-78489bb.stdout0000664000175000017500000000010615141516316025566 0ustar alastairalastairfunction main() local x::Int32 = 3 + 6 println(x) end main() lfortran-lfortran-2f73434/tests/reference/asr-case_06-f84222d.stdout0000664000175000017500000006513415141516316025204 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), grade_fixed: (Variable 2 grade_fixed [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), marks_fixed: (Variable 2 marks_fixed [] Local (IntegerConstant 94 (Integer 4) Decimal) (IntegerConstant 94 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cond_03 [] [(Select () (Var 2 grade_fixed) [(CaseStmt [(StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] .false. ) (CaseStmt [(StringConstant "C" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Well done" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "D" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "You passed" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "F" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Better try again" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [(Print (StringConstant "Invalid grade" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade_fixed)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Select () (Var 2 marks_fixed) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 0 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-common_06-4a72d58.stdout0000664000175000017500000001256415141516316025563 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { common_06: (Program (SymbolTable 5 { }) common_06 [] [(SubroutineCall 1 solsy () [] () .false. )] ), file_common_block_ls0001: (Module (SymbolTable 3 { ls0001: (Struct (SymbolTable 4 { rowns: (Variable 4 rowns [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 209 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) ls0001 (StructType [] [] .true. .false. ) [] [rowns] [] Source Public .false. .false. [] () () ), struct_instance_ls0001: (Variable 3 struct_instance_ls0001 [] Local () () Default (StructType [] [] .true. .false. ) 3 ls0001 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_ls0001 () [] .false. .false. .false. ), solsy: (Function (SymbolTable 2 { }) solsy (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err6-47462f4.json0000664000175000017500000000076015141516316027317 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err6-47462f4", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err6.f90", "infile_hash": "ac85436de6965d6e21140cdd72302a260de0f86538d86bd9b064a919", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err6-47462f4.stderr", "stderr_hash": "2b28f63b4ba3586c56a0b11dbd7597d09387b24d0002fcf81e9f02ae", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-program_without_line_cc-b84ba02.stdout0000664000175000017500000000036715141516316030736 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(Print (StringConstant "OK" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) lfortran-lfortran-2f73434/tests/reference/pass_where-where_04-2ee4397.json0000664000175000017500000000077515141516316026412 0ustar alastairalastair{ "basename": "pass_where-where_04-2ee4397", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_04.f90", "infile_hash": "48449a9af8d215a5a118d0776d25e23b7b310df89b1775164ddfde5e", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_04-2ee4397.stdout", "stdout_hash": "3900fea48e5edc676cb83d23c0115bd23f8866fca6452d5fe3a4ac38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-string_02-604c7cc.json0000664000175000017500000000074515141516316025277 0ustar alastairalastair{ "basename": "ast-string_02-604c7cc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "ast-string_02-604c7cc.stdout", "stdout_hash": "4469a9a38b538092272266e660fde089c2aa73a8bf5c3d3ff6db64a6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_02-1746f84.json0000664000175000017500000000100115141516316030046 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_02-1746f84", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_02.f90", "infile_hash": "4fbb3a440309d31eb008cd3fffcf541729477e6ac4fc23854bfa1f00", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_02-1746f84.stderr", "stderr_hash": "d8b1d8a2cb5740cc5f7d42b71949ed0ad6091a1b44477a4ddf915fde", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-modules_29-dc71c55.json0000664000175000017500000000075015141516316025446 0ustar alastairalastair{ "basename": "asr-modules_29-dc71c55", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_29.f90", "infile_hash": "2a9083651faf952ebe886324158cd55b4361b02439b525dd54c1935c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_29-dc71c55.stdout", "stdout_hash": "652c496f5adc797204edcb432d61d8e2fd18729af483178040154d5a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common2-64c97b2.json0000664000175000017500000000072515141516316024765 0ustar alastairalastair{ "basename": "asr-common2-64c97b2", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/common2.f", "infile_hash": "761ba9bcb69efc19ad1828c9ebc8deab710d02f98f6722736d6a4dd2", "outfile": null, "outfile_hash": null, "stdout": "asr-common2-64c97b2.stdout", "stdout_hash": "385e5e7bcb13c2d25b614dec3b6ced183f4f32334aaf1b8dc65433bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_ranks_allocatable_arr2-699f9ab.json0000664000175000017500000000104515141516316032615 0ustar alastairalastair{ "basename": "asr-incompatible_ranks_allocatable_arr2-699f9ab", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_ranks_allocatable_arr2.f90", "infile_hash": "ffa862b282f0003e81ae019d774be1b094305f8afe7aa07a8c4fb663", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_ranks_allocatable_arr2-699f9ab.stderr", "stderr_hash": "859149ac9cbf256cb5a4318dc74776437006cbfc2044128a51f94db8", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-kind1-5b1b058.json0000664000175000017500000000071315141516316024404 0ustar alastairalastair{ "basename": "asr-kind1-5b1b058", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind1.f90", "infile_hash": "0371199c5e18fe208acf627b9787e9b7af72a2a6cccec7c29d42d866", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind1-5b1b058.stderr", "stderr_hash": "7e1ce52c707fb3ba57006a1526151811ab0ccd83c63e67f6901a17e0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-statement_03-99c9cd3.stdout0000664000175000017500000001630215141516316026357 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cumchn: (Function (SymbolTable 2 { dble: (Variable 2 dble [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dg: (Function (SymbolTable 4 { dg_return_var_name: (Variable 4 dg_return_var_name [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dg (FunctionType [(Integer 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 i)] [(Assignment (Var 4 dg_return_var_name) (Cast (RealBinOp (RealConstant 2.000000 (Real 8) ) Mul (Cast (Var 4 i) IntegerToReal (Real 8) () ) (Real 8) () ) RealToReal (Real 4) () ) () .false. .false. )] (Var 4 dg_return_var_name) Public .false. .false. () ) }) cumchn (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), statement_03: (Program (SymbolTable 3 { }) statement_03 [] [(SubroutineCall 1 cumchn () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_28-7703b7d.stdout0000664000175000017500000002702315141516316026457 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { debug: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (IntegerConstant -20 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (IntegerConstant 30 (Integer 4) Decimal) (IntegerConstant 30 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (IntegerUnaryMinus (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) (IntegerConstant -40 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local (IntegerConstant 50 (Integer 4) Decimal) (IntegerConstant 50 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) debug [] [(If () (IntegerCompare (IntrinsicElementalFunction Min [(Var 2 a) (Var 2 b) (Var 2 c) (Var 2 d) (Var 2 e) (Var 2 f)] 0 (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) (IntegerConstant -40 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b) (Var 2 c) (Var 2 d) (Var 2 e) (Var 2 f)] 0 (Integer 4) (IntegerConstant 50 (Integer 4) Decimal) ) NotEq (IntegerConstant 50 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b)] 0 (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Min [(Var 2 a) (Var 2 b)] 0 (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Max [(Var 2 a) (Var 2 b) (Var 2 c)] 0 (Integer 4) (IntegerConstant 30 (Integer 4) Decimal) ) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-namelist_01-a0d2302.stdout0000664000175000017500000000016615141516316026532 0ustar alastairalastairprogram namelist1 implicit none integer :: N real :: t, x, Ecut namelist /domain/ N, t, x, Ecut end program namelist1 lfortran-lfortran-2f73434/tests/reference/asr-print_intrinsics-8e5d219.json0000664000175000017500000000074515141516316027017 0ustar alastairalastair{ "basename": "asr-print_intrinsics-8e5d219", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/print_intrinsics.f90", "infile_hash": "a18c84b05282913a620d056c8183e7e7ee364fcb4accdbc21f4d0b63", "outfile": null, "outfile_hash": null, "stdout": "asr-print_intrinsics-8e5d219.stdout", "stdout_hash": "b9afa7d3cd0b52deab70b406cc4d3c78b0ec190d175dd024d796222d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-write_01-c968b4a.stderr0000664000175000017500000000012515141516316025470 0ustar alastairalastairRuntime Error: Format mismatch between OPEN statement and WRITE statement on unit 1. lfortran-lfortran-2f73434/tests/reference/llvm-doloop_03-d4372bd.stdout0000664000175000017500000002727515141516316026031 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont3, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 10 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 %7 = load i32, i32* %j, align 4 %8 = load i32, i32* %i, align 4 %9 = add i32 %7, %8 store i32 %9, i32* %j, align 4 %10 = load i32, i32* %i, align 4 %11 = icmp eq i32 %10, 3 br i1 %11, label %then, label %else then: ; preds = %loop.body br label %ifcont else: ; preds = %loop.body br label %ifcont ifcont: ; preds = %else, %then %12 = load i32, i32* %i, align 4 %13 = icmp eq i32 %12, 2 br i1 %13, label %then1, label %else2 then1: ; preds = %ifcont br label %loop.end unreachable_after_exit: ; No predecessors! br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %unreachable_after_exit br label %loop.head loop.end: ; preds = %then1, %loop.head %14 = load i32, i32* %j, align 4 %15 = icmp ne i32 %14, 3 br i1 %15, label %then4, label %else5 then4: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end br label %ifcont6 ifcont6: ; preds = %else5, %then4 %16 = alloca i64, align 8 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %16, i32 0, i32 0, i32* %j) %18 = load i64, i64* %16, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free(i8* %17) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head7 loop.head7: ; preds = %ifcont12, %free_done %27 = load i32, i32* %i, align 4 %28 = add i32 %27, 1 %29 = icmp sle i32 %28, 10 br i1 %29, label %loop.body8, label %loop.end13 loop.body8: ; preds = %loop.head7 %30 = load i32, i32* %i, align 4 %31 = add i32 %30, 1 store i32 %31, i32* %i, align 4 %32 = load i32, i32* %i, align 4 %33 = icmp eq i32 %32, 2 br i1 %33, label %then9, label %else11 then9: ; preds = %loop.body8 br label %loop.end13 unreachable_after_exit10: ; No predecessors! br label %ifcont12 else11: ; preds = %loop.body8 br label %ifcont12 ifcont12: ; preds = %else11, %unreachable_after_exit10 %34 = load i32, i32* %j, align 4 %35 = load i32, i32* %i, align 4 %36 = add i32 %34, %35 store i32 %36, i32* %j, align 4 br label %loop.head7 loop.end13: ; preds = %then9, %loop.head7 %37 = load i32, i32* %j, align 4 %38 = icmp ne i32 %37, 1 br i1 %38, label %then14, label %else15 then14: ; preds = %loop.end13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont16 else15: ; preds = %loop.end13 br label %ifcont16 ifcont16: ; preds = %else15, %then14 %39 = alloca i64, align 8 %40 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %39, i32 0, i32 0, i32* %j) %41 = load i64, i64* %39, align 4 %stringFormat_desc17 = alloca %string_descriptor, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 0 store i8* %40, i8** %42, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 1 store i64 %41, i64* %43, align 4 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 0 %45 = load i8*, i8** %44, align 8 %46 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc17, i32 0, i32 1 %47 = load i64, i64* %46, align 4 %48 = trunc i64 %47 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %45, i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %49 = icmp eq i8* %40, null br i1 %49, label %free_done19, label %free_nonnull18 free_nonnull18: ; preds = %ifcont16 call void @_lfortran_free(i8* %40) br label %free_done19 free_done19: ; preds = %free_nonnull18, %ifcont16 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head20 loop.head20: ; preds = %ifcont24, %then22, %free_done19 %50 = load i32, i32* %i, align 4 %51 = add i32 %50, 1 %52 = icmp sle i32 %51, 10 br i1 %52, label %loop.body21, label %loop.end25 loop.body21: ; preds = %loop.head20 %53 = load i32, i32* %i, align 4 %54 = add i32 %53, 1 store i32 %54, i32* %i, align 4 %55 = load i32, i32* %i, align 4 %56 = icmp eq i32 %55, 2 br i1 %56, label %then22, label %else23 then22: ; preds = %loop.body21 br label %loop.head20 unreachable_after_cycle: ; No predecessors! br label %ifcont24 else23: ; preds = %loop.body21 br label %ifcont24 ifcont24: ; preds = %else23, %unreachable_after_cycle %57 = load i32, i32* %j, align 4 %58 = load i32, i32* %i, align 4 %59 = add i32 %57, %58 store i32 %59, i32* %j, align 4 br label %loop.head20 loop.end25: ; preds = %loop.head20 %60 = load i32, i32* %j, align 4 %61 = icmp ne i32 %60, 53 br i1 %61, label %then26, label %else27 then26: ; preds = %loop.end25 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont28 else27: ; preds = %loop.end25 br label %ifcont28 ifcont28: ; preds = %else27, %then26 %62 = alloca i64, align 8 %63 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %62, i32 0, i32 0, i32* %j) %64 = load i64, i64* %62, align 4 %stringFormat_desc29 = alloca %string_descriptor, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 0 store i8* %63, i8** %65, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 1 store i64 %64, i64* %66, align 4 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 0 %68 = load i8*, i8** %67, align 8 %69 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc29, i32 0, i32 1 %70 = load i64, i64* %69, align 4 %71 = trunc i64 %70 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %68, i32 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %72 = icmp eq i8* %63, null br i1 %72, label %free_done31, label %free_nonnull30 free_nonnull30: ; preds = %ifcont28 call void @_lfortran_free(i8* %63) br label %free_done31 free_done31: ; preds = %free_nonnull30, %ifcont28 call void @_lpython_free_argv() br label %return return: ; preds = %free_done31 br label %FINALIZE_SYMTABLE_doloop_03 FINALIZE_SYMTABLE_doloop_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-do7-8069d7a.stdout0000664000175000017500000000311415141516316024637 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %i = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 10 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 store i32 5, i32* %call_arg_value, align 4 %7 = call i32 @f(i32* %call_arg_value) store i32 %7, i32* %a, align 4 br label %loop.head loop.end: ; preds = %loop.head call void @_lpython_free_argv() br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_do7 FINALIZE_SYMTABLE_do7: ; preds = %return ret i32 0 } define i32 @f(i32* %a) { .entry: %f = alloca i32, align 4 %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load i32, i32* %f, align 4 ret i32 %2 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-allocate_04-68facec.json0000664000175000017500000000075315141516316025722 0ustar alastairalastair{ "basename": "asr-allocate_04-68facec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_04.f90", "infile_hash": "ae79e641a2ff12bf6ee5ec9a5d86305d62fc6cddef0454fe759962e0", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_04-68facec.stdout", "stdout_hash": "6c0392f0b0e5946c36725bee4f1949595ebc2e73f143a528e4c23d6e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fmt1-3196894.stdout0000664000175000017500000001270415141516316024504 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeReal [(kind c_float Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_float Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Star) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Star) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Star)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() () Colon) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Colon)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() n Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len n Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len n Value) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() n Value) (kind c_char Value)] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind c_char Value) (len n Value)] () () None ) [] [(c [] [] () () None ())] () )] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp4-0611905.stderr0000664000175000017500000000024515141516316026702 0ustar alastairalastairsemantic error: Variable 'z12345678' is not declared --> tests/errors/cpp4.f90:11:13 | 11 | print *, x, C123, y | ^^^^ 'z12345678' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-template_error_01a-13d8554.stderr0000664000175000017500000000111715141516316027343 0ustar alastairalastairsemantic error: Type mismatch in function call, the function expects 't' but 's' was provided --> tests/errors/template_error_01a.f90:74:55 | 74 | avg = avg_S_from_T(d1, D_divided_by_T(d1, s1), d2, D_divided_by_S(d2, s2)) | ^^ type 't' expected, but 's' provided | 45 | pure function D_divided_by_T(n, d) result(quotient) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 49 | end function | ...^^^^^^^^^^^^^^^^^^^^ function definition has parameter type 't' lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_interface-a8dfdb0.json0000664000175000017500000000077415141516316027773 0ustar alastairalastair{ "basename": "ast-fixed_form_interface-a8dfdb0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_interface.f", "infile_hash": "9848fe137b898d800534fae81911bcb039a52295d010b55bca47cdc2", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_interface-a8dfdb0.stdout", "stdout_hash": "d248372139adf9d7e84d3bcb74e631c8e691f7f3ee4ed3de7dd58a17", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics13-349f6ac.stderr0000664000175000017500000000025415141516316026352 0ustar alastairalastairsemantic error: All arguments to min0 must be of the same type --> tests/errors/intrinsics13.f90:2:14 | 2 | print *, min(12, 13.94) | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop3-52d2c18.stdout0000664000175000017500000000006015141516316027204 0ustar alastairalastairHello Hello Hello H H H Hello Hello Hello lfortran-lfortran-2f73434/tests/reference/asr-character2-bc7e2ce.json0000664000175000017500000000072315141516316025641 0ustar alastairalastair{ "basename": "asr-character2-bc7e2ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/character2.f90", "infile_hash": "97195d2054dbf5075a24b846fcd7dcc115ef93398243c901c04a3951", "outfile": null, "outfile_hash": null, "stdout": "asr-character2-bc7e2ce.stdout", "stdout_hash": "43c417037cfc75818859881c7e7a4a2f92a0a7f0d130e014d0feb65a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-case_06-57ebc6f.json0000664000175000017500000000072215141516316024766 0ustar alastairalastair{ "basename": "cpp-case_06-57ebc6f", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_06-57ebc6f.stdout", "stdout_hash": "05b1836d726e8b5e20a9bbf2bd15a6abb7c8b94a6cb980b8a71b2651", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor12-94ccea0.json0000664000175000017500000000077315141516316030704 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor12-94ccea0", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor12.f90", "infile_hash": "b445441cd8d1932e9ebd830003869fd98c73c8153b90a1fa71029316", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor12-94ccea0.stdout", "stdout_hash": "625dc8c4b11422678eda2f4e41caccad630432be6fcbe202b76c4c76", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-print_01-63a0480.json0000664000175000017500000000074515141516316025143 0ustar alastairalastair{ "basename": "llvm-print_01-63a0480", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/print_01.f90", "infile_hash": "060acad8d292efd077defbe08288b2a97e3c32803df2e0d62edd5654", "outfile": null, "outfile_hash": null, "stdout": "llvm-print_01-63a0480.stdout", "stdout_hash": "1d191ddacdb053bb995535adad4aa958d873d884cb4b8adfa4196dad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor4-0e1d0e4.stdout0000664000175000017500000000757015141516316031112 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor4: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor4 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.jsonlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000000123415141516316035005 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_45.f90", "infile_hash": "d68539c460764050c432f216e8ceed7eded8bf09258747500769b39e", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_45-db3a04a.stdout", "stdout_hash": "debf34ba0cfb789cbcde5612d8d0877f7a22a03eb2b433b078b51481", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bindc3-91bce68.json0000664000175000017500000000073415141516316024636 0ustar alastairalastair{ "basename": "asr-bindc3-91bce68", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc3.f90", "infile_hash": "d2305932b687641416dda5e45cb66123d72a7d2ca5449952e2379d3b", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc3-91bce68.stdout", "stdout_hash": "cf84dba4e56582986f6131dde9ccf6159b06874b03b4ab504c51234c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_no_prescan-no_prescan_include1-40f0957.stdout0000664000175000017500000000011715141516316032021 0ustar alastairalastair(TranslationUnit [(Include 0 "if1.f90" () )] ) lfortran-lfortran-2f73434/tests/reference/asr-stop-c3f410b.json0000664000175000017500000000070115141516316024434 0ustar alastairalastair{ "basename": "asr-stop-c3f410b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/stop.f90", "infile_hash": "4992b783d9f3aeee0fc682e7600ed3b3e57f5d9e8ea4ef63ab0bbb4d", "outfile": null, "outfile_hash": null, "stdout": "asr-stop-c3f410b.stdout", "stdout_hash": "cf93e08ba0f340b78266353ce006d91a53b915f36855ae8a5f20cf0a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_48-6cf0505.stdout0000664000175000017500000030362315141516316025742 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_48: (Program (SymbolTable 8 { 1_string_t_s: (ExternalSymbol 8 1_string_t_s 3 s string_t [] s Public ), cat_str_alloc: (Variable 8 cat_str_alloc [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), char_str: (Variable 8 char_str [] Local () () Default (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), char_str_alloc: (Variable 8 char_str_alloc [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), char_str_hash1: (Variable 8 char_str_hash1 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), char_str_hash2: (Variable 8 char_str_hash2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), char_str_hash3: (Variable 8 char_str_hash3 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), char_str_hash4: (Variable 8 char_str_hash4 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), fnv_1a: (ExternalSymbol 8 fnv_1a 2 fnv_1a modules_48_fpm_strings [] fnv_1a Public ), fnv_1a@fnv_1a_char: (ExternalSymbol 8 fnv_1a@fnv_1a_char 2 fnv_1a_char modules_48_fpm_strings [] fnv_1a_char Private ), fnv_1a_char: (ExternalSymbol 8 fnv_1a_char 2 fnv_1a_char modules_48_fpm_strings [] fnv_1a_char Public ), fnv_1a_string_t: (ExternalSymbol 8 fnv_1a_string_t 2 fnv_1a_string_t modules_48_fpm_strings [] fnv_1a_string_t Public ), is_fortran_name: (ExternalSymbol 8 is_fortran_name 2 is_fortran_name modules_48_fpm_strings [] is_fortran_name Public ), string_cat: (ExternalSymbol 8 string_cat 2 string_cat modules_48_fpm_strings [] string_cat Public ), string_t: (ExternalSymbol 8 string_t 2 string_t modules_48_fpm_strings [] string_t Public ), string_var: (Variable 8 string_var [] Local () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) 8 string_t Source Public Required .false. .false. .false. () .false. .false. ) }) modules_48 [modules_48_fpm_strings] [(Allocate [((Var 8 char_str_alloc) [] (IntegerConstant 40 (Integer 4) Decimal) () ())] () () () ) (Assignment (Var 8 char_str_alloc) (StringConstant "runningmodules_48_1" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (ArrayItem (Var 8 string_var) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 8 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 8 char_str_alloc) () .false. .false. ) (Assignment (Var 8 char_str) (StringConstant "runningmodules_48_2" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (ArrayItem (Var 8 string_var) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 8 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 8 char_str) () .false. .false. ) (Assignment (Var 8 char_str_hash1) (FunctionCall 8 fnv_1a@fnv_1a_char 8 fnv_1a [((Var 8 char_str)) ((IntegerConstant 2166136261 (Integer 8) Decimal))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 8 char_str_hash2) (FunctionCall 8 fnv_1a@fnv_1a_char 8 fnv_1a [((Var 8 char_str)) (())] (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 char_str_hash1) (Var 8 char_str_hash2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 8 char_str_hash1) NotEq (Var 8 char_str_hash2) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 8 char_str_hash3) (FunctionCall 8 fnv_1a_string_t () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 2166136261 (Integer 8) Decimal))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 8 char_str_hash4) (FunctionCall 8 fnv_1a_string_t () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Integer 8) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 char_str_hash3) (Var 8 char_str_hash4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 8 char_str_hash3) NotEq (Var 8 char_str_hash4) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 8 cat_str_alloc) (FunctionCall 8 string_cat () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((StringConstant ":" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 cat_str_alloc) (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 8 cat_str_alloc) NotEq (StringConstant "runningmodules_48_1:runningmodules_48_2" (String 1 (IntegerConstant 39 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () ) [(ErrorStop () )] [] ) (Assignment (Var 8 cat_str_alloc) (FunctionCall 8 string_cat () [((ArrayPhysicalCast (Var 8 string_var) FixedSizeArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. ) (Print (StringFormat () [(Var 8 cat_str_alloc) (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 8 cat_str_alloc) NotEq (StringConstant "runningmodules_48_1runningmodules_48_2" (String 1 (IntegerConstant 38 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (FunctionCall 8 is_fortran_name () [((Var 8 cat_str_alloc))] (Logical 4) () () ) (Logical 4) () ) [(ErrorStop () )] [] )] ), modules_48_fpm_strings: (Module (SymbolTable 2 { fnv_1a: (GenericProcedure 2 fnv_1a [2 fnv_1a_char 2 fnv_1a_string_t] Public ), fnv_1a_char: (Function (SymbolTable 4 { fnv_offset_32: (Variable 4 fnv_offset_32 [] Local (IntegerConstant 2166136261 (Integer 8) Decimal) (IntegerConstant 2166136261 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), fnv_prime_32: (Variable 4 fnv_prime_32 [] Local (IntegerConstant 16777619 (Integer 8) Decimal) (IntegerConstant 16777619 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), hash: (Variable 4 hash [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), input: (Variable 4 input [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), seed: (Variable 4 seed [] In () () Default (Integer 8) () Source Public Optional .false. .false. .false. () .false. .false. ) }) fnv_1a_char (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 8)] (Integer 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 input) (Var 4 seed)] [(If () (IntrinsicElementalFunction Present [(Var 4 seed)] 0 (Logical 4) () ) [(Assignment (Var 4 hash) (Var 4 seed) () .false. .false. )] [(Assignment (Var 4 hash) (Var 4 fnv_offset_32) () .false. .false. )] ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 input) (Integer 4) () ) ()) [(Assignment (Var 4 hash) (IntegerBinOp (IntrinsicElementalFunction Ieor [(Var 4 hash) (IntrinsicElementalFunction Iachar [(StringItem (Var 4 input) (Var 4 i) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () )] 0 (Integer 8) () )] 0 (Integer 8) () ) Mul (Var 4 fnv_prime_32) (Integer 8) () ) () .false. .false. )] [] )] (Var 4 hash) Public .false. .false. () ), fnv_1a_string_t: (Function (SymbolTable 5 { 1_string_t_s: (ExternalSymbol 5 1_string_t_s 3 s string_t [] s Public ), hash: (Variable 5 hash [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), input: (Variable 5 input [] In () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ), seed: (Variable 5 seed [] In () () Default (Integer 8) () Source Public Optional .false. .false. .false. () .false. .false. ) }) fnv_1a_string_t (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 8)] (Integer 8) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [fnv_1a_char] [(Var 5 input) (Var 5 seed)] [(Assignment (Var 5 hash) (FunctionCall 2 fnv_1a_char 2 fnv_1a [((StructInstanceMember (ArrayItem (Var 5 input) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 5 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 5 seed))] (Integer 8) () () ) () .false. .false. ) (DoLoop () ((Var 5 i) (IntegerConstant 2 (Integer 4) Decimal) (ArraySize (Var 5 input) () (Integer 4) () ) ()) [(Assignment (Var 5 hash) (FunctionCall 2 fnv_1a_char 2 fnv_1a [((StructInstanceMember (ArrayItem (Var 5 input) [(() (Var 5 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 5 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 5 hash))] (Integer 8) () () ) () .false. .false. )] [] )] (Var 5 hash) Public .false. .false. () ), is_fortran_name: (Function (SymbolTable 6 { allowed: (Variable 6 allowed [upper lower int] Local (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 6 upper) (Var 6 lower)] 0 (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (Var 6 int)] 0 (String 1 (IntegerConstant 62 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" (String 1 (IntegerConstant 62 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "_" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 63 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), int: (Variable 6 int [] Local (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), line: (Variable 6 line [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), lout: (Variable 6 lout [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), lower: (Variable 6 lower [] Local (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 6 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), upper: (Variable 6 upper [] Local (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) is_fortran_name (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 line)] [(Assignment (Var 6 name) (IntrinsicElementalFunction StringTrim [(Var 6 line)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (If () (IntegerCompare (StringLen (Var 6 name) (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 6 lout) (LogicalBinOp (LogicalBinOp (LogicalBinOp (LogicalConstant .true. (Logical 4) ) And (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(StringSection (Var 6 name) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () ) (IntrinsicElementalFunction StringConcat [(Var 6 lower) (Var 6 upper)] 0 (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 52 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) And (IntegerCompare (IntrinsicElementalFunction StringContainsSet [(Var 6 name) (Var 6 allowed) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) And (IntegerCompare (StringLen (Var 6 name) (Integer 4) () ) LtE (IntegerConstant 63 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] [(Assignment (Var 6 lout) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] (Var 6 lout) Public .false. .false. () ), string_cat: (Function (SymbolTable 7 { 1_string_t_s: (ExternalSymbol 7 1_string_t_s 3 s string_t [] s Public ), cat: (Variable 7 cat [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), delim: (Variable 7 delim [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), delim_str: (Variable 7 delim_str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), strings: (Variable 7 strings [] In () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ) }) string_cat (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (String 1 () AssumedLength DescriptorString)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 strings) (Var 7 delim)] [(If () (IntegerCompare (ArraySize (Var 7 strings) () (Integer 4) () ) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 7 cat) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Return)] [] ) (If () (IntrinsicElementalFunction Present [(Var 7 delim)] 0 (Logical 4) () ) [(Assignment (Var 7 delim_str) (Var 7 delim) () .false. .false. )] [(Assignment (Var 7 delim_str) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] ) (Assignment (Var 7 cat) (StructInstanceMember (ArrayItem (Var 7 strings) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 7 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4) Decimal) (ArraySize (Var 7 strings) () (Integer 4) () ) ()) [(Assignment (Var 7 cat) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 7 cat) (Var 7 delim_str)] 0 (String 1 () DeferredLength DescriptorString) () ) (StructInstanceMember (ArrayItem (Var 7 strings) [(() (Var 7 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) 7 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] (Var 7 cat) Public .false. .false. () ), string_t: (Struct (SymbolTable 3 { s: (Variable 3 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () ) }) modules_48_fpm_strings () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-block1-ff0f95d.json0000664000175000017500000000070715141516316024733 0ustar alastairalastair{ "basename": "ast-block1-ff0f95d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/block1.f90", "infile_hash": "195aaf0b0ae556975d0d7c84d1ff451d793614e176384294a288b08c", "outfile": null, "outfile_hash": null, "stdout": "ast-block1-ff0f95d.stdout", "stdout_hash": "af9b8a5af97f436f569bdda60c8632377c70b1bd1126c9086e2f62b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-doloop_05-9e48e13.stdout0000664000175000017500000000054615141516316026106 0ustar alastairalastairfunction main() local i::Int32 local j::Int32 @label label_1 j = 0 @label label_2 for i ∈ 1:10 @label label_3 if i == 2 continue end @label label_4 j = j + i end @label label_6 if j ≠ 53 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/run-print4-e3cf30b.json0000664000175000017500000000065715141516316025003 0ustar alastairalastair{ "basename": "run-print4-e3cf30b", "cmd": "lfortran --no-color {infile}", "infile": "tests/print4.f90", "infile_hash": "0235f98a0db81de70f604eae7df934c9cd8b7818f613d6c807d5cc45", "outfile": null, "outfile_hash": null, "stdout": "run-print4-e3cf30b.stdout", "stdout_hash": "62cea9160c3b6bedbe705dabe24acd23ac267d01a0f4b83d4bf5d015", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-program3-7ea69db.json0000664000175000017500000000070015141516316025274 0ustar alastairalastair{ "basename": "cpp-program3-7ea69db", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "cpp-program3-7ea69db.stdout", "stdout_hash": "c8b8c040cfc07de1aadf3edbe34874ccf76b0eac3f663741f1adab33", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-min_01-aa661b0.json0000664000175000017500000000105115141516316024527 0ustar alastairalastair{ "basename": "asr-min_01-aa661b0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/min_01.f90", "infile_hash": "e952b62303ec12acafb074d8692d387259ce4ad18384b48667e9369f", "outfile": null, "outfile_hash": null, "stdout": "asr-min_01-aa661b0.stdout", "stdout_hash": "fa04acd41e5de224eb42cd2926cd6feedab17b2b638f08ab75ef46d0", "stderr": "asr-min_01-aa661b0.stderr", "stderr_hash": "a02531d479d1f7f30892cce7008c18cfd36a995138e153c4e24dc068", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-print_09-8516006.json0000664000175000017500000000071215141516316024723 0ustar alastairalastair{ "basename": "run-print_09-8516006", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/print_09.f90", "infile_hash": "cc0837a65a4cfcf29013298ba39bcabf2d6d192481f6217948058034", "outfile": null, "outfile_hash": null, "stdout": "run-print_09-8516006.stdout", "stdout_hash": "946c99fcda935631d1d36bf64ca15fc08dbe0ac895176ffeae67bd2d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics9-4da86d0.stderr0000664000175000017500000000024715141516316026274 0ustar alastairalastairsemantic error: Kind of all the arguments of Iand must be the same --> tests/errors/intrinsics9.f90:4:14 | 4 | print *, iand(x, y) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout0000664000175000017500000000320615141516316031346 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_namelist_01-c1be094.json0000664000175000017500000000105515141516316031713 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_namelist_01-c1be094", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_namelist_01.f90", "infile_hash": "3ae593ad78ac4bbac6d58d1dd1f8ee532e6cf64aef681fa7f311c7e2", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_namelist_01-c1be094.stdout", "stdout_hash": "3b4c01dd49d8d107f1b0cc3ec8516e7b654c3b6117c31ebdcc4a14d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_module-3f800f0.stdout0000664000175000017500000000041215141516316027275 0ustar alastairalastair(TranslationUnit [(Module e () [] [] [] [] [] ) (Program main () [] [(ImplicitNone [] () )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-global_scope2-970a26a.stdout0000664000175000017500000000132715141516316026467 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_01-bab3e60.json0000664000175000017500000000075215141516316025465 0ustar alastairalastair{ "basename": "ast_f90-goto_01-bab3e60", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_01-bab3e60.stdout", "stdout_hash": "b7f05dcc2bee04b12eabf40a0d67c5983a88496688f4f397245ad01a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-flush2-9767ece.json0000664000175000017500000000102415141516316024700 0ustar alastairalastair{ "basename": "asr-flush2-9767ece", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/flush2.f90", "infile_hash": "e4912e2bc379b34e493cdd9c89f76794bb32113af915d2ca96793675", "outfile": null, "outfile_hash": null, "stdout": "asr-flush2-9767ece.stdout", "stdout_hash": "62fb9066a8ef9394996bc24e8fd331cca234bbba072fe0f42df13404", "stderr": "asr-flush2-9767ece.stderr", "stderr_hash": "9a387f3a8657746f5eb56f5e5a03771cfe161a73d9fb1a50cc03e6ae", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-protected_01-1f0c640.stderr0000664000175000017500000000024415141516316026215 0ustar alastairalastairsemantic error: Variable temp_c is PROTECTED and cannot appear in LHS of assignment --> tests/errors/protected_01.f90:19:3 | 19 | temp_c = 10 | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-doloop_04-6ff18c8.json0000664000175000017500000000074515141516316025301 0ustar alastairalastair{ "basename": "asr-doloop_04-6ff18c8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_04-6ff18c8.stdout", "stdout_hash": "70a766be64c7938022983c02f9dfa1dd9385cb9247c372d454fe3b62", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics10-ccd6322.json0000664000175000017500000000074015141516316026004 0ustar alastairalastair{ "basename": "asr-intrinsics10-ccd6322", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics10.f90", "infile_hash": "71c18b1007f67b59ecfe255092d42f662d34cd9e53bd53b154b0017c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics10-ccd6322.stderr", "stderr_hash": "5c7e6496799d08eb1c9ff3b805df252814360ecbee2833394b6fd122", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-implicit_argument_casting_01-0d962d9.stderr0000664000175000017500000000014015141516316031500 0ustar alastairalastairCannot use --disable-implicit-argument-casting and --implicit-argument-casting at the same time lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-style1-3d16af1.stdout0000664000175000017500000001236615141516316030651 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope3-00a245c.stdout0000664000175000017500000000071615141516316026643 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = add i32 %0, 1 store i32 %1, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-lfortran-2f73434/tests/reference/ast-program_cmake_02-d8d8f4d.stdout0000664000175000017500000000153315141516316027241 0ustar alastairalastair(TranslationUnit [(Program TESTFortran90 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(stop [] [] () () None ())] (TriviaNode [] [(Semicolon)] ) )] [(Assignment 0 stop 1 (TriviaNode [] [(Semicolon)] ) ) (WhileLoop 0 () (== stop 0) [] (TriviaNode [] [(Semicolon)] ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-dimension_02-2fc38c6.stderr0000664000175000017500000000032415141516316026304 0ustar alastairalastairsemantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/dimension_02.f90:3:26 | 3 | character, dimension(linelen) :: line | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-stop_03-897cacd.stderr0000664000175000017500000000001015141516316025400 0ustar alastairalastairSTOP hi lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_cc-78281a4.stdout0000664000175000017500000000015615141516316030610 0ustar alastairalastair(TranslationUnit [(Print 0 () [(String "OK" ())] () ) contains] ) lfortran-lfortran-2f73434/tests/reference/asr-template_simple_02-35381bd.stdout0000664000175000017500000041017215141516316027443 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_02: (Program (SymbolTable 14 { cast_r: (ExternalSymbol 14 cast_r 2 cast_r template_simple_02_m [] cast_r Public ), generic_sum: (ExternalSymbol 14 generic_sum 2 generic_sum template_simple_02_m [] generic_sum Public ), operator_r: (ExternalSymbol 14 operator_r 2 operator_r template_simple_02_m [] operator_r Public ), test_template: (ExternalSymbol 14 test_template 2 test_template template_simple_02_m [] test_template Public ) }) template_simple_02 [template_simple_02_m] [(SubroutineCall 14 test_template () [] () .false. )] ), template_simple_02_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .false. .false. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .false. .false. () ), generic_sum: (Template (SymbolTable 9 { add: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 10 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 10 lhs) (Var 10 rhs)] [] (Var 10 res) Private .false. .false. () ), cast: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 11 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 arg)] [] (Var 11 res) Private .false. .false. () ), generic_sum: (Function (SymbolTable 12 { arr: (Variable 12 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 12 arr)] [(Assignment (Var 12 n) (ArraySize (Var 12 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 12 res) (FunctionCall 9 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 12 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 12 res) (ArrayItem (Var 12 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(Assignment (Var 12 res) (FunctionCall 9 add () [((Var 12 res)) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 12 res) Public .false. .false. () ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { __instantiated_generic_sum: (Function (SymbolTable 16 { arr: (Variable 16 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 16 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 16 arr)] [(Assignment (Var 16 n) (ArraySize (Var 16 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 16 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 16 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 16 res) (ArrayItem (Var 16 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 16 n) ()) [(Assignment (Var 16 res) (FunctionCall 13 ~add_intrinsic () [((Var 16 res)) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 16 res) Public .false. .false. () ), __instantiated_generic_sum1: (Function (SymbolTable 18 { arr: (Variable 18 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 18 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 18 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 18 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 18 arr)] [(Assignment (Var 18 n) (ArraySize (Var 18 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 18 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 18 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 18 res) (ArrayItem (Var 18 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 18 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 18 n) ()) [(Assignment (Var 18 res) (FunctionCall 13 ~add_intrinsic1 () [((Var 18 res)) ((ArrayItem (Var 18 arr) [(() (Var 18 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 18 res) Public .false. .false. () ), __instantiated_generic_sum2: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 19 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum2 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 19 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 19 n) ()) [(Assignment (Var 19 res) (FunctionCall 13 ~add_intrinsic () [((Var 19 res)) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 19 res) Public .false. .false. () ), a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 17 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 17 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (RealBinOp (Var 17 arg0) Add (Var 17 arg1) (Real 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 __instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 13 s_i) (FunctionCall 13 __instantiated_generic_sum2 () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_02_m () [template_simple_02_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics15-76ae493.json0000664000175000017500000000074015141516316025745 0ustar alastairalastair{ "basename": "asr-intrinsics15-76ae493", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics15.f90", "infile_hash": "afc1933e8bca77d3f9caf7d466f010a578d93125b222309c194480a8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics15-76ae493.stderr", "stderr_hash": "ef97af68d4eb0d2d985d19d15914e508a21c6a3a4615b9c686359ae1", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-format_11-72f8b07.stdout0000664000175000017500000000011015141516316025557 0ustar alastairalastairtest writing a logical formatted write T F using print T F lfortran-lfortran-2f73434/tests/reference/llvm-doloop_01-a6563cb.stdout0000664000175000017500000010475315141516316026024 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.8 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 10 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 %7 = load i32, i32* %j, align 4 %8 = load i32, i32* %i, align 4 %9 = add i32 %7, %8 store i32 %9, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %10 = load i32, i32* %j, align 4 %11 = icmp ne i32 %10, 55 br i1 %11, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %12 = alloca i64, align 8 %13 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %12, i32 0, i32 0, i32* %j) %14 = load i64, i64* %12, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %14, i64* %16, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %13) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %j, align 4 store i32 11, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.body2, %free_done %23 = load i32, i32* %i, align 4 %24 = add i32 %23, -1 %25 = icmp sge i32 %24, 1 br i1 %25, label %loop.body2, label %loop.end3 loop.body2: ; preds = %loop.head1 %26 = load i32, i32* %i, align 4 %27 = add i32 %26, -1 store i32 %27, i32* %i, align 4 %28 = load i32, i32* %j, align 4 %29 = load i32, i32* %i, align 4 %30 = add i32 %28, %29 store i32 %30, i32* %j, align 4 br label %loop.head1 loop.end3: ; preds = %loop.head1 %31 = load i32, i32* %j, align 4 %32 = icmp ne i32 %31, 55 br i1 %32, label %then4, label %else5 then4: ; preds = %loop.end3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %33 = alloca i64, align 8 %34 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %33, i32 0, i32 0, i32* %j) %35 = load i64, i64* %33, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %34, i8** %36, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %35, i64* %37, align 4 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %39 = load i8*, i8** %38, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %41 = load i64, i64* %40, align 4 %42 = trunc i64 %41 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %39, i32 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %43 = icmp eq i8* %34, null br i1 %43, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %ifcont6 call void @_lfortran_free(i8* %34) br label %free_done9 free_done9: ; preds = %free_nonnull8, %ifcont6 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %loop.head10 loop.head10: ; preds = %loop.body11, %free_done9 %44 = load i32, i32* %i, align 4 %45 = add i32 %44, 2 %46 = icmp sle i32 %45, 9 br i1 %46, label %loop.body11, label %loop.end12 loop.body11: ; preds = %loop.head10 %47 = load i32, i32* %i, align 4 %48 = add i32 %47, 2 store i32 %48, i32* %i, align 4 %49 = load i32, i32* %j, align 4 %50 = load i32, i32* %i, align 4 %51 = add i32 %49, %50 store i32 %51, i32* %j, align 4 br label %loop.head10 loop.end12: ; preds = %loop.head10 %52 = load i32, i32* %j, align 4 %53 = icmp ne i32 %52, 25 br i1 %53, label %then13, label %else14 then13: ; preds = %loop.end12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %loop.end12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %54 = alloca i64, align 8 %55 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %54, i32 0, i32 0, i32* %j) %56 = load i64, i64* %54, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %55, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %56, i64* %58, align 4 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %62 = load i64, i64* %61, align 4 %63 = trunc i64 %62 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %60, i32 %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %64 = icmp eq i8* %55, null br i1 %64, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %ifcont15 call void @_lfortran_free(i8* %55) br label %free_done18 free_done18: ; preds = %free_nonnull17, %ifcont15 store i32 0, i32* %j, align 4 store i32 11, i32* %i, align 4 br label %loop.head19 loop.head19: ; preds = %loop.body20, %free_done18 %65 = load i32, i32* %i, align 4 %66 = add i32 %65, -2 %67 = icmp sge i32 %66, 1 br i1 %67, label %loop.body20, label %loop.end21 loop.body20: ; preds = %loop.head19 %68 = load i32, i32* %i, align 4 %69 = add i32 %68, -2 store i32 %69, i32* %i, align 4 %70 = load i32, i32* %j, align 4 %71 = load i32, i32* %i, align 4 %72 = add i32 %70, %71 store i32 %72, i32* %j, align 4 br label %loop.head19 loop.end21: ; preds = %loop.head19 %73 = load i32, i32* %j, align 4 %74 = icmp ne i32 %73, 25 br i1 %74, label %then22, label %else23 then22: ; preds = %loop.end21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %loop.end21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %75 = alloca i64, align 8 %76 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %75, i32 0, i32 0, i32* %j) %77 = load i64, i64* %75, align 4 %stringFormat_desc25 = alloca %string_descriptor, align 8 %78 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 0 store i8* %76, i8** %78, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 1 store i64 %77, i64* %79, align 4 %80 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 0 %81 = load i8*, i8** %80, align 8 %82 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc25, i32 0, i32 1 %83 = load i64, i64* %82, align 4 %84 = trunc i64 %83 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %81, i32 %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %85 = icmp eq i8* %76, null br i1 %85, label %free_done27, label %free_nonnull26 free_nonnull26: ; preds = %ifcont24 call void @_lfortran_free(i8* %76) br label %free_done27 free_done27: ; preds = %free_nonnull26, %ifcont24 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %loop.head28 loop.head28: ; preds = %loop.body29, %free_done27 %86 = load i32, i32* %i, align 4 %87 = add i32 %86, 2 %88 = icmp sle i32 %87, 10 br i1 %88, label %loop.body29, label %loop.end30 loop.body29: ; preds = %loop.head28 %89 = load i32, i32* %i, align 4 %90 = add i32 %89, 2 store i32 %90, i32* %i, align 4 %91 = load i32, i32* %j, align 4 %92 = load i32, i32* %i, align 4 %93 = add i32 %91, %92 store i32 %93, i32* %j, align 4 br label %loop.head28 loop.end30: ; preds = %loop.head28 %94 = load i32, i32* %j, align 4 %95 = icmp ne i32 %94, 25 br i1 %95, label %then31, label %else32 then31: ; preds = %loop.end30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont33 else32: ; preds = %loop.end30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 %96 = alloca i64, align 8 %97 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %96, i32 0, i32 0, i32* %j) %98 = load i64, i64* %96, align 4 %stringFormat_desc34 = alloca %string_descriptor, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 0 store i8* %97, i8** %99, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 1 store i64 %98, i64* %100, align 4 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 0 %102 = load i8*, i8** %101, align 8 %103 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc34, i32 0, i32 1 %104 = load i64, i64* %103, align 4 %105 = trunc i64 %104 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %102, i32 %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) %106 = icmp eq i8* %97, null br i1 %106, label %free_done36, label %free_nonnull35 free_nonnull35: ; preds = %ifcont33 call void @_lfortran_free(i8* %97) br label %free_done36 free_done36: ; preds = %free_nonnull35, %ifcont33 store i32 0, i32* %j, align 4 store i32 -2, i32* %i, align 4 br label %loop.head37 loop.head37: ; preds = %loop.body38, %free_done36 %107 = load i32, i32* %i, align 4 %108 = add i32 %107, 3 %109 = icmp sle i32 %108, 10 br i1 %109, label %loop.body38, label %loop.end39 loop.body38: ; preds = %loop.head37 %110 = load i32, i32* %i, align 4 %111 = add i32 %110, 3 store i32 %111, i32* %i, align 4 %112 = load i32, i32* %j, align 4 %113 = load i32, i32* %i, align 4 %114 = add i32 %112, %113 store i32 %114, i32* %j, align 4 br label %loop.head37 loop.end39: ; preds = %loop.head37 %115 = load i32, i32* %j, align 4 %116 = icmp ne i32 %115, 22 br i1 %116, label %then40, label %else41 then40: ; preds = %loop.end39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont42 else41: ; preds = %loop.end39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %117 = alloca i64, align 8 %118 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %117, i32 0, i32 0, i32* %j) %119 = load i64, i64* %117, align 4 %stringFormat_desc43 = alloca %string_descriptor, align 8 %120 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 0 store i8* %118, i8** %120, align 8 %121 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 1 store i64 %119, i64* %121, align 4 %122 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 0 %123 = load i8*, i8** %122, align 8 %124 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc43, i32 0, i32 1 %125 = load i64, i64* %124, align 4 %126 = trunc i64 %125 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %123, i32 %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) %127 = icmp eq i8* %118, null br i1 %127, label %free_done45, label %free_nonnull44 free_nonnull44: ; preds = %ifcont42 call void @_lfortran_free(i8* %118) br label %free_done45 free_done45: ; preds = %free_nonnull44, %ifcont42 store i32 0, i32* %j, align 4 store i32 13, i32* %i, align 4 br label %loop.head46 loop.head46: ; preds = %loop.body47, %free_done45 %128 = load i32, i32* %i, align 4 %129 = add i32 %128, -3 %130 = icmp sge i32 %129, 1 br i1 %130, label %loop.body47, label %loop.end48 loop.body47: ; preds = %loop.head46 %131 = load i32, i32* %i, align 4 %132 = add i32 %131, -3 store i32 %132, i32* %i, align 4 %133 = load i32, i32* %j, align 4 %134 = load i32, i32* %i, align 4 %135 = add i32 %133, %134 store i32 %135, i32* %j, align 4 br label %loop.head46 loop.end48: ; preds = %loop.head46 %136 = load i32, i32* %j, align 4 %137 = icmp ne i32 %136, 22 br i1 %137, label %then49, label %else50 then49: ; preds = %loop.end48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %loop.end48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 %138 = alloca i64, align 8 %139 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %138, i32 0, i32 0, i32* %j) %140 = load i64, i64* %138, align 4 %stringFormat_desc52 = alloca %string_descriptor, align 8 %141 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 0 store i8* %139, i8** %141, align 8 %142 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 1 store i64 %140, i64* %142, align 4 %143 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 0 %144 = load i8*, i8** %143, align 8 %145 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc52, i32 0, i32 1 %146 = load i64, i64* %145, align 4 %147 = trunc i64 %146 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %144, i32 %147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) %148 = icmp eq i8* %139, null br i1 %148, label %free_done54, label %free_nonnull53 free_nonnull53: ; preds = %ifcont51 call void @_lfortran_free(i8* %139) br label %free_done54 free_done54: ; preds = %free_nonnull53, %ifcont51 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head55 loop.head55: ; preds = %loop.body56, %free_done54 %149 = load i32, i32* %i, align 4 %150 = add i32 %149, 1 %151 = icmp sle i32 %150, 1 br i1 %151, label %loop.body56, label %loop.end57 loop.body56: ; preds = %loop.head55 %152 = load i32, i32* %i, align 4 %153 = add i32 %152, 1 store i32 %153, i32* %i, align 4 %154 = load i32, i32* %j, align 4 %155 = load i32, i32* %i, align 4 %156 = add i32 %154, %155 store i32 %156, i32* %j, align 4 br label %loop.head55 loop.end57: ; preds = %loop.head55 %157 = load i32, i32* %j, align 4 %158 = icmp ne i32 %157, 1 br i1 %158, label %then58, label %else59 then58: ; preds = %loop.end57 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont60 else59: ; preds = %loop.end57 br label %ifcont60 ifcont60: ; preds = %else59, %then58 %159 = alloca i64, align 8 %160 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.7, i32 0, i32 0), i64* %159, i32 0, i32 0, i32* %j) %161 = load i64, i64* %159, align 4 %stringFormat_desc61 = alloca %string_descriptor, align 8 %162 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 0 store i8* %160, i8** %162, align 8 %163 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 1 store i64 %161, i64* %163, align 4 %164 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 0 %165 = load i8*, i8** %164, align 8 %166 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc61, i32 0, i32 1 %167 = load i64, i64* %166, align 4 %168 = trunc i64 %167 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %165, i32 %168, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) %169 = icmp eq i8* %160, null br i1 %169, label %free_done63, label %free_nonnull62 free_nonnull62: ; preds = %ifcont60 call void @_lfortran_free(i8* %160) br label %free_done63 free_done63: ; preds = %free_nonnull62, %ifcont60 store i32 0, i32* %j, align 4 store i32 2, i32* %i, align 4 br label %loop.head64 loop.head64: ; preds = %loop.body65, %free_done63 %170 = load i32, i32* %i, align 4 %171 = add i32 %170, -1 %172 = icmp sge i32 %171, 1 br i1 %172, label %loop.body65, label %loop.end66 loop.body65: ; preds = %loop.head64 %173 = load i32, i32* %i, align 4 %174 = add i32 %173, -1 store i32 %174, i32* %i, align 4 %175 = load i32, i32* %j, align 4 %176 = load i32, i32* %i, align 4 %177 = add i32 %175, %176 store i32 %177, i32* %j, align 4 br label %loop.head64 loop.end66: ; preds = %loop.head64 %178 = load i32, i32* %j, align 4 %179 = icmp ne i32 %178, 1 br i1 %179, label %then67, label %else68 then67: ; preds = %loop.end66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont69 else68: ; preds = %loop.end66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 %180 = alloca i64, align 8 %181 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.8, i32 0, i32 0), i64* %180, i32 0, i32 0, i32* %j) %182 = load i64, i64* %180, align 4 %stringFormat_desc70 = alloca %string_descriptor, align 8 %183 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 0 store i8* %181, i8** %183, align 8 %184 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 1 store i64 %182, i64* %184, align 4 %185 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 0 %186 = load i8*, i8** %185, align 8 %187 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc70, i32 0, i32 1 %188 = load i64, i64* %187, align 4 %189 = trunc i64 %188 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %186, i32 %189, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) %190 = icmp eq i8* %181, null br i1 %190, label %free_done72, label %free_nonnull71 free_nonnull71: ; preds = %ifcont69 call void @_lfortran_free(i8* %181) br label %free_done72 free_done72: ; preds = %free_nonnull71, %ifcont69 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %loop.head73 loop.head73: ; preds = %loop.body74, %free_done72 %191 = load i32, i32* %i, align 4 %192 = add i32 %191, 1 %193 = icmp sle i32 %192, 0 br i1 %193, label %loop.body74, label %loop.end75 loop.body74: ; preds = %loop.head73 %194 = load i32, i32* %i, align 4 %195 = add i32 %194, 1 store i32 %195, i32* %i, align 4 %196 = load i32, i32* %j, align 4 %197 = load i32, i32* %i, align 4 %198 = add i32 %196, %197 store i32 %198, i32* %j, align 4 br label %loop.head73 loop.end75: ; preds = %loop.head73 %199 = load i32, i32* %j, align 4 %200 = icmp ne i32 %199, 0 br i1 %200, label %then76, label %else77 then76: ; preds = %loop.end75 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont78 else77: ; preds = %loop.end75 br label %ifcont78 ifcont78: ; preds = %else77, %then76 %201 = alloca i64, align 8 %202 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.9, i32 0, i32 0), i64* %201, i32 0, i32 0, i32* %j) %203 = load i64, i64* %201, align 4 %stringFormat_desc79 = alloca %string_descriptor, align 8 %204 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 0 store i8* %202, i8** %204, align 8 %205 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 1 store i64 %203, i64* %205, align 4 %206 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 0 %207 = load i8*, i8** %206, align 8 %208 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc79, i32 0, i32 1 %209 = load i64, i64* %208, align 4 %210 = trunc i64 %209 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %207, i32 %210, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) %211 = icmp eq i8* %202, null br i1 %211, label %free_done81, label %free_nonnull80 free_nonnull80: ; preds = %ifcont78 call void @_lfortran_free(i8* %202) br label %free_done81 free_done81: ; preds = %free_nonnull80, %ifcont78 store i32 0, i32* %j, align 4 store i32 1, i32* %i, align 4 br label %loop.head82 loop.head82: ; preds = %loop.body83, %free_done81 %212 = load i32, i32* %i, align 4 %213 = add i32 %212, -1 %214 = icmp sge i32 %213, 1 br i1 %214, label %loop.body83, label %loop.end84 loop.body83: ; preds = %loop.head82 %215 = load i32, i32* %i, align 4 %216 = add i32 %215, -1 store i32 %216, i32* %i, align 4 %217 = load i32, i32* %j, align 4 %218 = load i32, i32* %i, align 4 %219 = add i32 %217, %218 store i32 %219, i32* %j, align 4 br label %loop.head82 loop.end84: ; preds = %loop.head82 %220 = load i32, i32* %j, align 4 %221 = icmp ne i32 %220, 0 br i1 %221, label %then85, label %else86 then85: ; preds = %loop.end84 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont87 else86: ; preds = %loop.end84 br label %ifcont87 ifcont87: ; preds = %else86, %then85 %222 = alloca i64, align 8 %223 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.10, i32 0, i32 0), i64* %222, i32 0, i32 0, i32* %j) %224 = load i64, i64* %222, align 4 %stringFormat_desc88 = alloca %string_descriptor, align 8 %225 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 0 store i8* %223, i8** %225, align 8 %226 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 1 store i64 %224, i64* %226, align 4 %227 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 0 %228 = load i8*, i8** %227, align 8 %229 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc88, i32 0, i32 1 %230 = load i64, i64* %229, align 4 %231 = trunc i64 %230 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %228, i32 %231, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) %232 = icmp eq i8* %223, null br i1 %232, label %free_done90, label %free_nonnull89 free_nonnull89: ; preds = %ifcont87 call void @_lfortran_free(i8* %223) br label %free_done90 free_done90: ; preds = %free_nonnull89, %ifcont87 call void @_lpython_free_argv() br label %return return: ; preds = %free_done90 br label %FINALIZE_SYMTABLE_doloop_01 FINALIZE_SYMTABLE_doloop_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-class_04-290b898.json0000664000175000017500000000074515141516316025137 0ustar alastairalastair{ "basename": "llvm-class_04-290b898", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_04.f90", "infile_hash": "0ddf2718f32dd9cfea8c4f4c9c384902ac023b5792e9fc8ec4a7648f", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_04-290b898.stdout", "stdout_hash": "8d919cdedc347b5524780c9f5a832ded8ff8e49a0de2713a9c3a3526", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit2-d78b357.stderr0000664000175000017500000000026115141516316025637 0ustar alastairalastairsemantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit2.f90:2:1 | 2 | implicit real (a,b,c,d) | ^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_36-1cb3d03.json0000664000175000017500000000076115141516316026147 0ustar alastairalastair{ "basename": "asr-intrinsics_36-1cb3d03", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_36.f90", "infile_hash": "d820f4c73a9b761a514a15853acf89ef75e1f5a0d15492c529448710", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_36-1cb3d03.stdout", "stdout_hash": "f5fc701653157bb5ff393b18d7ebef0ed09c7e55a234c18e5aa933e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-string_assignment_02-84c751f.json0000664000175000017500000000074015141516316027467 0ustar alastairalastair{ "basename": "run-string_assignment_02-84c751f", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/string_assignment_02.f90", "infile_hash": "a08f7ec91c7fc4d516a9ec8775761fad679344425d3572773570b7aa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-string_assignment_02-84c751f.stderr", "stderr_hash": "b2f51d8ac6543f4597d29821577e8450ba74eeabb233d240b63efed8", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_05-0476e14.json0000664000175000017500000000075215141516316025224 0ustar alastairalastair{ "basename": "ast_f90-case_05-0476e14", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_05-0476e14.stdout", "stdout_hash": "ce09baab9a9372905328040da2ec2d35d9c2521bacbd3ed6ea3752fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_init_expr-array13-db4fb0f.json0000664000175000017500000000076115141516316027346 0ustar alastairalastair{ "basename": "pass_init_expr-array13-db4fb0f", "cmd": "lfortran --pass=init_expr --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array13.f90", "infile_hash": "9a8fc967d5ae775229d7d6e3fff0a1927b7bc3ec0b5209bedf864ff8", "outfile": null, "outfile_hash": null, "stdout": "pass_init_expr-array13-db4fb0f.stdout", "stdout_hash": "3eaddb004d9a89a5b21479adcadf080af50cf1da90b28575b9d02ace", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-character1-8679f4b.stdout0000664000175000017500000000427515141516316026016 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { xerror: (Function (SymbolTable 2 { mess: (Variable 2 mess [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) xerror (FunctionType [(String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 mess)] [(Print (StringItem (Var 2 mess) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () ) ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_28-9506bba.stdout0000664000175000017500000016223415141516316026021 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_git: (Module (SymbolTable 11 { git_target_branch: (Function (SymbolTable 13 { 1_git_target_t_object: (ExternalSymbol 13 1_git_target_t_object 12 object git_target_t [] object Public ), 1_git_target_t_url: (ExternalSymbol 13 1_git_target_t_url 12 url git_target_t [] url Public ), branch: (Variable 13 branch [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 13 self [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 11 git_target_t Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 13 url [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) git_target_branch (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 url) (Var 13 branch)] [(Assignment (StructInstanceMember (Var 13 self) 13 1_git_target_t_url (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 url) () .false. .false. ) (Assignment (StructInstanceMember (Var 13 self) 13 1_git_target_t_object (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 branch) () .false. .false. )] (Var 13 self) Public .false. .false. () ), git_target_t: (Struct (SymbolTable 12 { object: (Variable 12 object [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 12 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) git_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [url object] [] Source Public .false. .false. [] () () ) }) fpm_git () [] .true. .false. .false. ), fpm_manifest_dependency: (Module (SymbolTable 4 { dependency_config_t: (Struct (SymbolTable 5 { git: (Variable 5 git [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 git_target_t Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 5 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_config_t (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path git] [] Source Public .false. .false. [] () () ), error_t: (Struct (SymbolTable 6 { message: (Variable 6 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () ), git_target_branch: (ExternalSymbol 4 git_target_branch 11 git_target_branch fpm_git [] git_target_branch Public ), git_target_t: (ExternalSymbol 4 git_target_t 11 git_target_t fpm_git [] git_target_t Public ), new_dependencies: (Function (SymbolTable 8 { deps: (Variable 8 deps [] Out () () Default (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. ), error: (Variable 8 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. ), root: (Variable 8 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) new_dependencies (FunctionType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (StructType [(Logical 4)] [] .true. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 deps) (Var 8 table) (Var 8 root) (Var 8 error)] [] () Public .false. .false. () ), new_dependency: (Function (SymbolTable 9 { 1_dependency_config_t_git: (ExternalSymbol 9 1_dependency_config_t_git 5 git dependency_config_t [] git Public ), obj: (Variable 9 obj [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 9 self [] Out () () Default (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 9 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_dependency (FunctionType [(StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 self)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) [] () () ())] () () () )] [] ) (Assignment (StructInstanceMember (Var 9 self) 9 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (FunctionCall 4 git_target_branch () [((Var 9 url)) ((Var 9 obj))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. )] () Public .false. .false. () ), toml_table: (Struct (SymbolTable 7 { inline: (Variable 7 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () ) }) fpm_manifest_dependency () [fpm_git] .true. .false. .false. ), modules_28: (Program (SymbolTable 2 { dependency_config_t: (ExternalSymbol 2 dependency_config_t 4 dependency_config_t fpm_manifest_dependency [] dependency_config_t Public ), error_t: (ExternalSymbol 2 error_t 4 error_t fpm_manifest_dependency [] error_t Public ), git_target_branch: (ExternalSymbol 2 git_target_branch 11 git_target_branch fpm_git [] git_target_branch Public ), git_target_t: (ExternalSymbol 2 git_target_t 11 git_target_t fpm_git [] git_target_t Public ), new_dependencies: (ExternalSymbol 2 new_dependencies 4 new_dependencies fpm_manifest_dependency [] new_dependencies Public ), new_dependency: (ExternalSymbol 2 new_dependency 4 new_dependency fpm_manifest_dependency [] new_dependency Public ), toml_table: (ExternalSymbol 2 toml_table 4 toml_table fpm_manifest_dependency [] toml_table Public ) }) modules_28 [fpm_manifest_dependency] [(Print (StringConstant "running modules_28 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_add_02-1dafc5f.stdout0000664000175000017500000017664515141516316027140 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_02: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_02_m [] add_t Public ), func_arg_real: (ExternalSymbol 13 func_arg_real 2 func_arg_real template_add_02_m [] func_arg_real Public ), r: (ExternalSymbol 13 r 2 r template_add_02_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_02_m [] test_template Public ), ~add: (ExternalSymbol 13 ~add 2 ~add template_add_02_m [] ~add Public ) }) template_add_02 [template_add_02_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_02_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .false. .false. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .false. .false. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { add_real: (Function (SymbolTable 12 { x: (Variable 12 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 12 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 z) (FunctionCall 10 ~add_intrinsic () [((Var 12 x)) ((Var 12 y))] (Real 4) () () ) () .false. .false. )] (Var 12 z) Public .false. .false. () ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 10 ~add [10 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 11 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 11 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (RealBinOp (Var 11 arg0) Add (Var 11 arg1) (Real 4) () ) () .false. .false. )] (Var 11 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), ~add: (CustomOperator 2 ~add [2 func_arg_real] Public ) }) template_add_02_m () [template_add_02_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor16-b846504.json0000664000175000017500000000077315141516316030474 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor16-b846504", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor16.f90", "infile_hash": "706f1e5cb790684841189022e27d4df5631d981e6351e1c6fd390bcd", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor16-b846504.stdout", "stdout_hash": "23fa2d8fc374a24481d0ea1a812f9b1c3fc53a18ed15a8daf4741c3a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-template_02-80b38d0.json0000664000175000017500000000075315141516316025522 0ustar alastairalastair{ "basename": "ast-template_02-80b38d0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_02.f90", "infile_hash": "ced72b8e182313557b3b879bd14e860cc0d24eb74800baecbe858a70", "outfile": null, "outfile_hash": null, "stdout": "ast-template_02-80b38d0.stdout", "stdout_hash": "1af55dfe19c01438f38067b07640b9b320170a88e0a2242d0a1fbbc3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit3-ffc1655.json0000664000175000017500000000106215141516316025362 0ustar alastairalastair{ "basename": "asr-implicit3-ffc1655", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit3.f90", "infile_hash": "d420be5e23fbf051820b7bfefbf122bf9a2386da38e30d985d425f92", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit3-ffc1655.stdout", "stdout_hash": "d743acf7d40711fbfce0c934910c9e124e4d15c7cd2b2ebe69cbf045", "stderr": "asr-implicit3-ffc1655.stderr", "stderr_hash": "1a25b547a57dfefeb2ed4a563a1ef4bbac1be585cdb54cf977279ba1", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-if2-0c3bb72.stdout0000664000175000017500000000043315141516316025162 0ustar alastairalastairprogram expr2 implicit none integer :: x time = 12 if (time < 10) then ! Comment 1 print *, "Good morning" else if (time < 20) then ! Comment 2 print *, "Good day" else ! Comment 3 print *, "Good evening" end if end if ! Comment 4 end program expr2 lfortran-lfortran-2f73434/tests/reference/llvm-nested_05-0252368.json0000664000175000017500000000075015141516316025215 0ustar alastairalastair{ "basename": "llvm-nested_05-0252368", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_05.f90", "infile_hash": "83b55ebf01581813bce973f49d745813499ef9e09fc0b0a2111f8386", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_05-0252368.stdout", "stdout_hash": "1e42fac1d7b176e430d5802bb94911b062818662997ed191a36931c7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-constant_kinds-b9382b6.json0000664000175000017500000000073715141516316026436 0ustar alastairalastair{ "basename": "asr-constant_kinds-b9382b6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/constant_kinds.f90", "infile_hash": "c0be463eb7c2d21d76249ef9357c41398b5f61eb3c9fc1821e01469f", "outfile": null, "outfile_hash": null, "stdout": "asr-constant_kinds-b9382b6.stdout", "stdout_hash": "dbd07837701cb7a408f11ddb6dbca0efae5c1680a8824a8b989e6506", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_02_size-395cc3f.json0000664000175000017500000000075515141516316026650 0ustar alastairalastair{ "basename": "julia-arrays_02_size-395cc3f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_02_size.f90", "infile_hash": "38abe88ea3a7e82aa0d9dd390578cda301e16cccabaefeaab3650c5f", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_02_size-395cc3f.stdout", "stdout_hash": "1f0182af0a9d25042159e7bcd0d3ab266d9dd2fc11e5422a96353c91", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface_allocatable_array-38d4afe.json0000664000175000017500000000106615141516316033123 0ustar alastairalastair{ "basename": "asr-implicit_interface_allocatable_array-38d4afe", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface_allocatable_array.f90", "infile_hash": "a9a653a2021fb69c16b0b6a01c642010adcbb420c5a2936c34ebd6a1", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface_allocatable_array-38d4afe.stdout", "stdout_hash": "5bbc44002adcb0a4ba3d914be1226f6b0f74bb71e910ba1fdc0588a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr5-f0a7df6.stdout0000664000175000017500000000462715141516316025171 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) expr_05 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_class_compare-e58def6.stdout0000664000175000017500000006337015141516316031377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gftl2_integer32complex32map: (Module (SymbolTable 2 { map_s_iter_equal: (Function (SymbolTable 4 { 1_map_setiterator_i: (ExternalSymbol 4 1_map_setiterator_i 3 i map_setiterator [] i Public ), a: (Variable 4 a [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), eq: (Variable 4 eq [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) map_s_iter_equal (FunctionType [(StructType [(Integer 4)] [] .true. .false. ) (StructType [(Integer 4)] [] .true. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 eq) (IntegerCompare (StructInstanceMember (Var 4 a) 4 1_map_setiterator_i (Integer 4) () ) Eq (StructInstanceMember (Var 4 b) 4 1_map_setiterator_i (Integer 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 eq) Public .false. .false. () ), map_s_iter_not_equal: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (StructType [(Integer 4)] [] .false. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] In () () Default (StructType [(Integer 4)] [] .false. .false. ) 2 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), ne: (Variable 5 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) map_s_iter_not_equal (FunctionType [(StructType [(Integer 4)] [] .false. .false. ) (StructType [(Integer 4)] [] .false. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [map_s_iter_equal] [(Var 5 a) (Var 5 b)] [(Assignment (Var 5 ne) (OverloadedCompare (Var 5 a) Eq (Var 5 b) (Logical 4) () (FunctionCall 2 map_s_iter_equal 2 ~eq [((Var 5 a)) ((Var 5 b))] (Logical 4) () () ) ) () .false. .false. ) (Assignment (Var 5 ne) (LogicalNot (Var 5 ne) (Logical 4) () ) () .false. .false. )] (Var 5 ne) Public .false. .false. () ), map_setiterator: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) map_setiterator (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), ~eq: (CustomOperator 2 ~eq [2 map_s_iter_equal] Public ), ~noteq: (CustomOperator 2 ~noteq [2 map_s_iter_not_equal] Public ) }) gftl2_integer32complex32map () [] .false. .false. .false. ), polymorphic_class_compare: (Program (SymbolTable 6 { 1_map_setiterator_i: (ExternalSymbol 6 1_map_setiterator_i 3 i map_setiterator [] i Public ), iter1: (Variable 6 iter1 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), iter2: (Variable 6 iter2 [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 6 map_setiterator Source Public Required .false. .false. .false. () .false. .false. ), map_s_iter_equal: (ExternalSymbol 6 map_s_iter_equal 2 map_s_iter_equal gftl2_integer32complex32map [] map_s_iter_equal Public ), map_s_iter_not_equal: (ExternalSymbol 6 map_s_iter_not_equal 2 map_s_iter_not_equal gftl2_integer32complex32map [] map_s_iter_not_equal Public ), map_setiterator: (ExternalSymbol 6 map_setiterator 2 map_setiterator gftl2_integer32complex32map [] map_setiterator Public ), ~eq: (ExternalSymbol 6 ~eq 2 ~eq gftl2_integer32complex32map [] ~eq Public ), ~noteq: (ExternalSymbol 6 ~noteq 2 ~noteq gftl2_integer32complex32map [] ~noteq Public ) }) polymorphic_class_compare [gftl2_integer32complex32map] [(Assignment (StructInstanceMember (Var 6 iter1) 6 1_map_setiterator_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 iter2) 6 1_map_setiterator_i (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (OverloadedCompare (Var 6 iter1) NotEq (Var 6 iter2) (Logical 4) () (FunctionCall 6 map_s_iter_not_equal 6 ~noteq [((Var 6 iter1)) ((Var 6 iter2))] (Logical 4) () () ) ) [(ErrorStop (StringConstant "Error: iter1 and iter2 should be equal" (String 1 (IntegerConstant 38 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/obj-empty-d0abeda.json0000664000175000017500000000055715141516316025021 0ustar alastairalastair{ "basename": "obj-empty-d0abeda", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-uppercase1-b7c06b1.stdout0000664000175000017500000001523515141516316026102 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { uppercase1: (Module (SymbolTable 2 { sub: (Function (SymbolTable 3 { a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 a) (IntegerBinOp (IntegerBinOp (Var 3 a) Add (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) () ) Add (ArraySize (Var 2 y) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) uppercase1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/c_target_cuda-openmp_71-261df19.json0000664000175000017500000000100615141516316027204 0ustar alastairalastair{ "basename": "c_target_cuda-openmp_71-261df19", "cmd": "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_71.f90", "infile_hash": "3dc8c9d0a33e2b1fd1dd572fabf806b89547b85ec20bee4d0688d7c6", "outfile": null, "outfile_hash": null, "stdout": "c_target_cuda-openmp_71-261df19.stdout", "stdout_hash": "646ba74da9de99a7b9b462e41a25b507a39c5a1479c9c7304a0148d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-intent_01-6d96ec5.stdout0000664000175000017500000000673115141516316026042 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_dflt_intent_foo(float* %c, float* %d) { .entry: %e = alloca float, align 4 %g = alloca float, align 4 %0 = call float @foo.__module_dflt_intent_f(float* %c) store float %0, float* %e, align 4 %1 = call float @foo.__module_dflt_intent_f(float* %d) store float %1, float* %g, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo FINALIZE_SYMTABLE_foo: ; preds = %return ret void } define float @foo.__module_dflt_intent_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %f, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %f) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %13 = load float, float* %f, align 4 ret float %13 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 0.000000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_dflt_intent_foo(float* %call_arg_value, float* %call_arg_value1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-maskr_incorrect_bit_size-0d2cb26.stderr0000664000175000017500000000032315141516316031056 0ustar alastairalastairsemantic error: first argument of `maskr` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/maskr_incorrect_bit_size.f90:2:12 | 2 | print*, maskr(63) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-arrays_02_size-ab6ee62.stdout0000664000175000017500000002467415141516316026763 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_a4: (Variable 2 size_a4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_a8: (Variable 2 size_a8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), size_b4: (Variable 2 size_b4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_b8: (Variable 2 size_b8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01 [] [(Assignment (Var 2 size_a4) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b4) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_a8) (ArraySize (Var 2 a) () (Integer 8) (IntegerConstant 3 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b8) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 size_a4) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_a8) NotEq (IntegerConstant 3 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b8) NotEq (IntegerConstant 4 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-stop-866225f.stdout0000664000175000017500000000264715141516316025065 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @STOP = private unnamed_addr constant [5 x i8] c"STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i32, align 4 store i32 25, i32* %x, align 4 %2 = load i32, i32* %x, align 4 %3 = icmp eq i32 %2, 25 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @STOP, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 0) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_stop FINALIZE_SYMTABLE_stop: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-dfloat1-6063adb.stderr0000664000175000017500000000021715141516316025340 0ustar alastairalastairsemantic error: Argument of intrinsic must be an integer --> tests/errors/dfloat1.f90:3:10 | 3 | print *, dfloat(y) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_33-816caef.stdout0000664000175000017500000000545015141516316026613 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_29: (Program (SymbolTable 2 { }) intrinsics_29 [] [(Print (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "This is record 1." (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (TypeInquiry NewLine (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "This is record 1.\n" (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "This is record 2." (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 35 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "This is record 1.\nThis is record 2." (String 1 (IntegerConstant 35 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-where_01-c45f2da.json0000664000175000017500000000074215141516316025154 0ustar alastairalastair{ "basename": "asr-where_01-c45f2da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_01.f90", "infile_hash": "b3e2251e4cd263f14db0266759a9af716dce48521dcd2f1e6eadce17", "outfile": null, "outfile_hash": null, "stdout": "asr-where_01-c45f2da.stdout", "stdout_hash": "746b9a1d5f0d6acf9c7c8eca0a80d4a9d900b4c8809cb460066acbe4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-parameter_05-916c4d8.stdout0000664000175000017500000001160415141516316026250 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { paramter_05: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (Cast (RealConstant 5.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) ) (RealConstant 5.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) paramter_05 [] [(Print (StringFormat () [(Var 2 x) (Var 2 y) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_array_02-85b6b2e.json0000664000175000017500000000077515141516316027007 0ustar alastairalastair{ "basename": "asr-template_array_02-85b6b2e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_02.f90", "infile_hash": "cf1525abcafcfb764aa16e653d8b360adbfaa355edeac751105feacf", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_02-85b6b2e.stdout", "stdout_hash": "71890bd8c17d28b8310e5b38b11ff76c75a2671be413f987631c15c0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_17-29e01e3.json0000664000175000017500000000074515141516316025222 0ustar alastairalastair{ "basename": "asr-string_17-29e01e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_17.f90", "infile_hash": "ee31756f63bb7509c4031e19e1e0eedd026a2ab4fca1f1260a1eb32b", "outfile": null, "outfile_hash": null, "stdout": "asr-string_17-29e01e3.stdout", "stdout_hash": "585b4be9965dfc55ef4b2dc4e4eeb0cbf8f77161c213f1737689e654", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-complex_dp_param-5efce36.json0000664000175000017500000000077515141516316027257 0ustar alastairalastair{ "basename": "llvm-complex_dp_param-5efce36", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp_param.f90", "infile_hash": "0d4d9eaf5bcc2cee6a8b57ee6a66b5a10ced2edf6d64b5d2e2a0bcb8", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_dp_param-5efce36.stdout", "stdout_hash": "208f0903740833f342c5dc73f3b67ecca19de2469f8f4e8298e874f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-write3-49c0266.json0000664000175000017500000000071215141516316024726 0ustar alastairalastair{ "basename": "llvm-write3-49c0266", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/write3.f90", "infile_hash": "18ea0138e234c907c606aa064960397fc7dd75f1f2fab0ca42f74c13", "outfile": null, "outfile_hash": null, "stdout": "llvm-write3-49c0266.stdout", "stdout_hash": "4865d773e2191ecaaa6f5aafec5a158cd20bbbab56aaeeafaec489d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-character_03-a7476e8.stderr0000664000175000017500000000031415141516316026202 0ustar alastairalastairstyle suggestion: Use character() instead of character*() --> tests/warnings/character_03.f90:3:5 | 3 | character*(2+3) str | ^^^^^^^^^^^^^^^ help: write this as 'character()' lfortran-lfortran-2f73434/tests/reference/c-program4-d60edeb.json0000664000175000017500000000100715141516316025006 0ustar alastairalastair{ "basename": "c-program4-d60edeb", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "c-program4-d60edeb.stdout", "stdout_hash": "7befb0f20ab89ee4ccd2058f0418cd68b66c99d768f7e6113de89be5", "stderr": "c-program4-d60edeb.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.jsonlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.0000664000175000017500000000110315141516316034151 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_char_lengths-5ba8b29", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_char_lengths.f90", "infile_hash": "61dc3cb74e4af0fdc0ee167225903f7143b7f920c38c4f7c5c4bfc3a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_char_lengths-5ba8b29.stderr", "stderr_hash": "646eae0030ddaf3e0ef573ad8a04e67a143812eae6c2ff7e3a9e363c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope2-64078e2.json0000664000175000017500000000101415141516316030770 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope2-64078e2", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope2-64078e2.stdout", "stdout_hash": "d7b3176232edb4791e6d7846a68a89c2011ab8f70f288f0e72adbc0d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine5-e248afc.json0000664000175000017500000000072615141516316026034 0ustar alastairalastair{ "basename": "asr-subroutine5-e248afc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine5-e248afc.stdout", "stdout_hash": "7a08d62c516437889f87ef16aed8aac07462e9aaf6be7f1010d6a4fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-bindc1-345b88c.stdout0000664000175000017500000000126715141516316025313 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p = alloca void*, align 8 %x = alloca i32*, align 8 store i32* null, i32** %x, align 8 %2 = load i32*, i32** %x, align 8 %3 = bitcast i32* %2 to void* store void* %3, void** %p, align 8 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_bindc1 FINALIZE_SYMTABLE_bindc1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-empty-cb5d1b4.json0000664000175000017500000000070715141516316025062 0ustar alastairalastair{ "basename": "llvm-empty-cb5d1b4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "llvm-empty-cb5d1b4.stdout", "stdout_hash": "8dab27dbd03c6f8c81d2df05d3e26a0ba5b3e4adb0c15259446b09a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-assign_to1-a6b7599.json0000664000175000017500000000077215141516316025472 0ustar alastairalastair{ "basename": "asr-assign_to1-a6b7599", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to1.f90", "infile_hash": "a8a83c753ee6f6e22b44441dbf0e5d8e7f180ca811bcbe45e810b869", "outfile": null, "outfile_hash": null, "stdout": "asr-assign_to1-a6b7599.stdout", "stdout_hash": "62eba2ef130ed70afff44352366e6e111309c6442e7855aa440b0cad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_01-3aedbb0.stderr0000664000175000017500000000040315141516316026376 0ustar alastairalastairsemantic error: Argument(s) or return type mismatch in interface and implementation --> tests/errors/interface_01.f90:13:3 - 17:14 | 13 | module function e(x) | ^^^^^^^^^^^^^^^^^^^^... ... | 17 | end function | ...^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-subroutines_02-597f5e1.stdout0000664000175000017500000004773015141516316026663 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { subroutines_02: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), g: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 b) (IntegerBinOp (Var 4 a) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), h: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) h (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [g] [(Var 5 a) (Var 5 b)] [(SubroutineCall 2 g () [((Var 5 a)) ((Var 5 b))] () .false. )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) subroutines_02 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 f () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 g () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 2 h () [((Var 2 i)) ((Var 2 j))] () .false. ) (Print (StringFormat () [(Var 2 i) (Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_23-db1ffb5.stdout0000664000175000017500000002311315141516316026662 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_23: (Program (SymbolTable 2 { i32: (Variable 2 i32 [] Local (TypeInquiry Huge (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) ) (IntegerConstant 2147483647 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i64: (Variable 2 i64 [] Local (TypeInquiry Huge (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) ) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (TypeInquiry Huge (Real 4) (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) ) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (TypeInquiry Huge (Real 8) (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) ) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_23 [] [(Print (StringFormat () [(Var 2 i32) (Var 2 i64) (Var 2 y) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Huge (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) ) (TypeInquiry Huge (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 9223372036854775807 (Integer 8) Decimal) ) (TypeInquiry Huge (Real 4) (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 340282346638528859811704183484516925440.000000 (Real 4) ) ) (TypeInquiry Huge (Real 8) (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_05-fe28e11.stdout0000664000175000017500000075371115141516316026170 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_05: (Program (SymbolTable 16 { integer_minus: (Function (SymbolTable 27 { r: (Variable 27 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 27 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 27 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) integer_minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~sub_intrinsic] [(Var 27 x) (Var 27 y)] [(Assignment (Var 27 r) (FunctionCall 16 ~sub_intrinsic () [((Var 27 x)) ((Var 27 y))] (Integer 4) () () ) () .false. .false. )] (Var 27 r) Public .false. .false. () ), integer_plus: (Function (SymbolTable 18 { r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 18 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 18 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) integer_plus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 18 x) (Var 18 y)] [(Assignment (Var 18 r) (FunctionCall 16 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () ) () .false. .false. )] (Var 18 r) Public .false. .false. () ), integer_tmp_minus: (Template (SymbolTable 19 { g_minus: (Function (SymbolTable 20 { r: (Variable 20 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 20 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 20 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g_minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 20 x) (Var 20 y)] [(Assignment (Var 20 r) (FunctionCall 19 minus () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () ) () .false. .false. )] (Var 20 r) Public .false. .false. () ), minus: (Function (SymbolTable 21 { r: (Variable 21 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 21 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 21 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 21 x) (Var 21 y)] [] (Var 21 r) Public .false. .false. () ), t: (Variable 19 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_mult: (Template (SymbolTable 22 { mult: (Function (SymbolTable 23 { r: (Variable 23 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 23 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 23 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mult (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 23 x) (Var 23 y)] [] (Var 23 r) Public .false. .false. () ), t: (Variable 22 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_div: (Template (SymbolTable 24 { div: (Function (SymbolTable 25 { r: (Variable 25 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 25 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 25 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 25 x) (Var 25 y)] [] (Var 25 r) Public .false. .false. () ), t: (Variable 24 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) integer_tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ), integer_tmp_mult: (Template (SymbolTable 28 { mult: (Function (SymbolTable 29 { r: (Variable 29 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 29 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 29 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mult (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 29 x) (Var 29 y)] [] (Var 29 r) Public .false. .false. () ), t: (Variable 28 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_div: (Template (SymbolTable 30 { div: (Function (SymbolTable 31 { r: (Variable 31 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 31 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 31 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 31 x) (Var 31 y)] [] (Var 31 r) Public .false. .false. () ), t: (Variable 30 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) tmp_div [div] [(Require req [t div] )] ) }) integer_tmp_mult [mult] [(Require req [t mult] )] ), real_minus: (Function (SymbolTable 42 { r: (Variable 42 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 42 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 42 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) real_minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~sub_intrinsic1] [(Var 42 x) (Var 42 y)] [(Assignment (Var 42 r) (FunctionCall 16 ~sub_intrinsic1 () [((Var 42 x)) ((Var 42 y))] (Real 4) () () ) () .false. .false. )] (Var 42 r) Public .false. .false. () ), real_plus: (Function (SymbolTable 33 { r: (Variable 33 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 33 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 33 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) real_plus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic1] [(Var 33 x) (Var 33 y)] [(Assignment (Var 33 r) (FunctionCall 16 ~add_intrinsic1 () [((Var 33 x)) ((Var 33 y))] (Real 4) () () ) () .false. .false. )] (Var 33 r) Public .false. .false. () ), real_tmp_minus: (Template (SymbolTable 34 { g_minus: (Function (SymbolTable 35 { r: (Variable 35 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 35 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 35 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g_minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 35 x) (Var 35 y)] [(Assignment (Var 35 r) (FunctionCall 34 minus () [((Var 35 x)) ((Var 35 y))] (Real 4) () () ) () .false. .false. )] (Var 35 r) Public .false. .false. () ), minus: (Function (SymbolTable 36 { r: (Variable 36 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 36 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 36 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 36 x) (Var 36 y)] [] (Var 36 r) Public .false. .false. () ), t: (Variable 34 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_mult: (Template (SymbolTable 37 { mult: (Function (SymbolTable 38 { r: (Variable 38 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 38 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 38 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mult (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 38 x) (Var 38 y)] [] (Var 38 r) Public .false. .false. () ), t: (Variable 37 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_div: (Template (SymbolTable 39 { div: (Function (SymbolTable 40 { r: (Variable 40 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 40 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 40 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 40 x) (Var 40 y)] [] (Var 40 r) Public .false. .false. () ), t: (Variable 39 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) real_tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ), real_tmp_mult: (Template (SymbolTable 43 { mult: (Function (SymbolTable 44 { r: (Variable 44 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 44 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 44 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mult (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 44 x) (Var 44 y)] [] (Var 44 r) Public .false. .false. () ), t: (Variable 43 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_div: (Template (SymbolTable 45 { div: (Function (SymbolTable 46 { r: (Variable 46 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 46 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 46 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 46 x) (Var 46 y)] [] (Var 46 r) Public .false. .false. () ), t: (Variable 45 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) tmp_div [div] [(Require req [t div] )] ) }) real_tmp_mult [mult] [(Require req [t mult] )] ), req: (ExternalSymbol 16 req 2 req template_05_m [] req Public ), tmp: (ExternalSymbol 16 tmp 2 tmp template_05_m [] tmp Public ), ~add: (CustomOperator 16 ~add [16 ~add_intrinsic 16 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 17 { arg0: (Variable 17 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 17 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 17 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 17 arg0) (Var 17 arg1)] [(Assignment (Var 17 ret) (IntegerBinOp (Var 17 arg0) Add (Var 17 arg1) (Integer 4) () ) () .false. .false. )] (Var 17 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 32 { arg0: (Variable 32 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 32 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 32 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 32 arg0) (Var 32 arg1)] [(Assignment (Var 32 ret) (RealBinOp (Var 32 arg0) Add (Var 32 arg1) (Real 4) () ) () .false. .false. )] (Var 32 ret) Public .false. .true. () ), ~sub: (CustomOperator 16 ~sub [16 ~sub_intrinsic 16 ~sub_intrinsic1] Public ), ~sub_intrinsic: (Function (SymbolTable 26 { arg0: (Variable 26 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 26 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 26 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~sub_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 26 arg0) (Var 26 arg1)] [(Assignment (Var 26 ret) (IntegerBinOp (Var 26 arg0) Sub (Var 26 arg1) (Integer 4) () ) () .false. .false. )] (Var 26 ret) Public .false. .true. () ), ~sub_intrinsic1: (Function (SymbolTable 41 { arg0: (Variable 41 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 41 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 41 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~sub_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 41 arg0) (Var 41 arg1)] [(Assignment (Var 41 ret) (RealBinOp (Var 41 arg0) Sub (Var 41 arg1) (Real 4) () ) () .false. .false. )] (Var 41 ret) Public .false. .true. () ) }) template_05 [template_05_m] [] ), template_05_m: (Module (SymbolTable 2 { req: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 r) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) req [t op] [] ), tmp: (Template (SymbolTable 5 { g_plus: (Function (SymbolTable 15 { r: (Variable 15 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 15 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 15 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) g_plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [plus] [(Var 15 x) (Var 15 y)] [(Assignment (Var 15 r) (FunctionCall 5 plus () [((Var 15 x)) ((Var 15 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 15 r) Public .false. .false. () ), plus: (Function (SymbolTable 6 { r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 r) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_minus: (Template (SymbolTable 7 { g_minus: (Function (SymbolTable 14 { r: (Variable 14 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 14 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 14 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) g_minus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [minus] [(Var 14 x) (Var 14 y)] [(Assignment (Var 14 r) (FunctionCall 7 minus () [((Var 14 x)) ((Var 14 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 14 r) Public .false. .false. () ), minus: (Function (SymbolTable 8 { r: (Variable 8 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 8 x) (Var 8 y)] [] (Var 8 r) Public .false. .false. () ), plus: (Function (SymbolTable 9 { r: (Variable 9 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 9 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 9 x) (Var 9 y)] [] (Var 9 r) Public .false. .false. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_mult: (Template (SymbolTable 10 { mult: (Function (SymbolTable 11 { r: (Variable 11 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 11 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mult (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 11 x) (Var 11 y)] [] (Var 11 r) Public .false. .false. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp_div: (Template (SymbolTable 12 { div: (Function (SymbolTable 13 { r: (Variable 13 r [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 13 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 13 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 13 x) (Var 13 y)] [] (Var 13 r) Public .false. .false. () ), t: (Variable 12 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) tmp_div [div] [(Require req [t div] )] ) }) tmp_mult [mult] [(Require req [t mult] )] ) }) tmp_minus [minus] [(Require req [t minus] ) (Require req [t plus] )] ) }) tmp [t plus] [(Require req [t plus] )] ) }) template_05_m () [template_05_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-implicit_interface_04-9b6786e.json0000664000175000017500000000105015141516316027737 0ustar alastairalastair{ "basename": "llvm-implicit_interface_04-9b6786e", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/../integration_tests/implicit_interface_04.f90", "infile_hash": "1e053fba9f0cad92b7ae15056010bc8e173cf2b0f3ad9aad515de419", "outfile": null, "outfile_hash": null, "stdout": "llvm-implicit_interface_04-9b6786e.stdout", "stdout_hash": "fbd4fc084bd167933102601bd7109fe4c1892ede41301f1805189d60", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_commutative-45a3ac0.stdout0000664000175000017500000037106615141516316030265 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_commutative_m: (Module (SymbolTable 2 { alt_commutative_prop: (Template (SymbolTable 10 { bin: (Function (SymbolTable 11 { bin: (Variable 11 bin [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 11 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 x) (Var 11 y)] [] (Var 11 bin) Public .false. .false. () ), commutative_p: (Function (SymbolTable 13 { prop: (Variable 13 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 13 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 13 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) commutative_p (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [bin equal] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 prop) (OverloadedCompare (FunctionCall 10 bin () [((Var 13 x)) ((Var 13 y))] (Integer 4) () () ) Eq (FunctionCall 10 bin () [((Var 13 y)) ((Var 13 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 10 equal 10 ~eq [((FunctionCall 10 bin () [((Var 13 x)) ((Var 13 y))] (Integer 4) () () )) ((FunctionCall 10 bin () [((Var 13 y)) ((Var 13 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 13 prop) Public .false. .false. () ), equal: (Function (SymbolTable 12 { equal: (Variable 12 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) equal (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 12 x) (Var 12 y)] [] (Var 12 equal) Public .false. .false. () ), integer: (Variable 10 integer [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~eq: (CustomOperator 10 ~eq [10 equal] Public ) }) alt_commutative_prop [bin equal] [(Require magma_r [integer bin equal] )] ), commutative_prop: (Template (SymbolTable 6 { bin: (Function (SymbolTable 7 { bin: (Variable 7 bin [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 x) (Var 7 y)] [] (Var 7 bin) Public .false. .false. () ), commutative_p: (Function (SymbolTable 9 { prop: (Variable 9 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 9 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) commutative_p (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [bin equal] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 prop) (OverloadedCompare (FunctionCall 6 bin () [((Var 9 x)) ((Var 9 y))] (TypeParameter t ) () () ) Eq (FunctionCall 6 bin () [((Var 9 y)) ((Var 9 x))] (TypeParameter t ) () () ) (Logical 4) () (FunctionCall 6 equal 6 ~eq [((FunctionCall 6 bin () [((Var 9 x)) ((Var 9 y))] (TypeParameter t ) () () )) ((FunctionCall 6 bin () [((Var 9 y)) ((Var 9 x))] (TypeParameter t ) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 9 prop) Public .false. .false. () ), equal: (Function (SymbolTable 8 { equal: (Variable 8 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) equal (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 x) (Var 8 y)] [] (Var 8 equal) Public .false. .false. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ~eq: (CustomOperator 6 ~eq [6 equal] Public ) }) commutative_prop [t bin equal] [(Require magma_r [t bin equal] )] ), magma_r: (Requirement (SymbolTable 3 { bin: (Function (SymbolTable 4 { bin: (Variable 4 bin [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 bin) Public .false. .false. () ), equal: (Function (SymbolTable 5 { equal: (Variable 5 equal [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) equal (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 5 x) (Var 5 y)] [] (Var 5 equal) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) magma_r [t bin equal] [] ) }) template_commutative_m () [template_commutative_m] .false. .false. .false. ), test_template_commutative_p: (Program (SymbolTable 14 { alt_commutative_prop: (ExternalSymbol 14 alt_commutative_prop 2 alt_commutative_prop template_commutative_m [] alt_commutative_prop Public ), commutative_prop: (ExternalSymbol 14 commutative_prop 2 commutative_prop template_commutative_m [] commutative_prop Public ), int_minus_comm: (Function (SymbolTable 21 { prop: (Variable 21 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 21 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 21 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_minus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~sub_intrinsic ~eq_intrinsic] [(Var 21 x) (Var 21 y)] [(Assignment (Var 21 prop) (OverloadedCompare (FunctionCall 14 ~sub_intrinsic () [((Var 21 x)) ((Var 21 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~sub_intrinsic () [((Var 21 y)) ((Var 21 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 6 ~eq [((FunctionCall 14 ~sub_intrinsic () [((Var 21 x)) ((Var 21 y))] (Integer 4) () () )) ((FunctionCall 14 ~sub_intrinsic () [((Var 21 y)) ((Var 21 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 21 prop) Public .false. .false. () ), int_plus_comm: (Function (SymbolTable 18 { prop: (Variable 18 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 18 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 18 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_plus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~eq_intrinsic] [(Var 18 x) (Var 18 y)] [(Assignment (Var 18 prop) (OverloadedCompare (FunctionCall 14 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~add_intrinsic () [((Var 18 y)) ((Var 18 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 6 ~eq [((FunctionCall 14 ~add_intrinsic () [((Var 18 x)) ((Var 18 y))] (Integer 4) () () )) ((FunctionCall 14 ~add_intrinsic () [((Var 18 y)) ((Var 18 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 18 prop) Public .false. .false. () ), magma_r: (ExternalSymbol 14 magma_r 2 magma_r template_commutative_m [] magma_r Public ), minus_comm: (Function (SymbolTable 20 { prop: (Variable 20 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 20 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 20 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~sub_intrinsic ~eq_intrinsic] [(Var 20 x) (Var 20 y)] [(Assignment (Var 20 prop) (OverloadedCompare (FunctionCall 14 ~sub_intrinsic () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~sub_intrinsic () [((Var 20 y)) ((Var 20 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 10 ~eq [((FunctionCall 14 ~sub_intrinsic () [((Var 20 x)) ((Var 20 y))] (Integer 4) () () )) ((FunctionCall 14 ~sub_intrinsic () [((Var 20 y)) ((Var 20 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 20 prop) Public .false. .false. () ), plus_comm: (Function (SymbolTable 17 { prop: (Variable 17 prop [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 17 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 17 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) plus_comm (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [~add_intrinsic ~eq_intrinsic] [(Var 17 x) (Var 17 y)] [(Assignment (Var 17 prop) (OverloadedCompare (FunctionCall 14 ~add_intrinsic () [((Var 17 x)) ((Var 17 y))] (Integer 4) () () ) Eq (FunctionCall 14 ~add_intrinsic () [((Var 17 y)) ((Var 17 x))] (Integer 4) () () ) (Logical 4) () (FunctionCall 14 ~eq_intrinsic 10 ~eq [((FunctionCall 14 ~add_intrinsic () [((Var 17 x)) ((Var 17 y))] (Integer 4) () () )) ((FunctionCall 14 ~add_intrinsic () [((Var 17 y)) ((Var 17 x))] (Integer 4) () () ))] (Logical 4) () () ) ) () .false. .false. )] (Var 17 prop) Public .false. .false. () ), ~add: (CustomOperator 14 ~add [14 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 15 { arg0: (Variable 15 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 15 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 15 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 15 arg0) (Var 15 arg1)] [(Assignment (Var 15 ret) (IntegerBinOp (Var 15 arg0) Add (Var 15 arg1) (Integer 4) () ) () .false. .false. )] (Var 15 ret) Public .false. .true. () ), ~eq: (CustomOperator 14 ~eq [14 ~eq_intrinsic] Public ), ~eq_intrinsic: (Function (SymbolTable 16 { arg0: (Variable 16 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 16 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 16 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~eq_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 16 arg0) (Var 16 arg1)] [(Assignment (Var 16 ret) (IntegerCompare (Var 16 arg0) Eq (Var 16 arg1) (Logical 4) () ) () .false. .false. )] (Var 16 ret) Public .false. .true. () ), ~sub: (CustomOperator 14 ~sub [14 ~sub_intrinsic] Public ), ~sub_intrinsic: (Function (SymbolTable 19 { arg0: (Variable 19 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 19 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 19 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~sub_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 19 arg0) (Var 19 arg1)] [(Assignment (Var 19 ret) (IntegerBinOp (Var 19 arg0) Sub (Var 19 arg1) (Integer 4) () ) () .false. .false. )] (Var 19 ret) Public .false. .true. () ) }) test_template_commutative_p [template_commutative_m] [(Print (StringConstant "test commutative" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "plus_comm: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 plus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "int_plus_comm: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 int_plus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "minus_comm: " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 minus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "int_minus_comm: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 14 int_minus_comm () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutine7-58db221.json0000664000175000017500000000072615141516316025671 0ustar alastairalastair{ "basename": "asr-subroutine7-58db221", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine7-58db221.stdout", "stdout_hash": "d1bb2240040e66b85bf3d609d5ebc4d473932b7c2922088e7d78483f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_03_transfer-4fcb3e2.json0000664000175000017500000000077515141516316027074 0ustar alastairalastair{ "basename": "asr-array_03_transfer-4fcb3e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_03_transfer.f90", "infile_hash": "d554a75d7567a6aed407dae5c430c9dea3fa17c13fad6b7ffeecb8d0", "outfile": null, "outfile_hash": null, "stdout": "asr-array_03_transfer-4fcb3e2.stdout", "stdout_hash": "c5b9e2463e83bf5ee37008e6df69aafbe3884d263616281da226de0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format5-79b3b8f.stdout0000664000175000017500000000017315141516316025441 0ustar alastairalastair-8.4313095911723368E-001 -8.4313095911723368E-002 -8.4313095911723365E+001 10.00000047497451E-04 1.234567890123456E-03 lfortran-lfortran-2f73434/tests/reference/cpp-program3-7ea69db.stdout0000664000175000017500000000220015141516316025642 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { float func1(float a, float b); float func2(float a, float b); } // Implementations namespace { float func1(float a, float b) { float c; c = a + b; c = func2(c, c); return c; } float func2(float a, float b) { float c; c = a*b; return c; } void main2() { float x; float y; float z; x = 5.00000000000000000e+00; y = 2.00000000000000000e+00; z = x*y; std::cout << "10.0 ==" << " " << z << std::endl; z = func1(x, y); std::cout << "49.0 ==" << " " << z << std::endl; z = func2(x, y); std::cout << "10.0 ==" << " " << z << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_39-906d6cb.stdoutlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000007572015141516316035020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_39: (Program (SymbolTable 8 { build_model: (ExternalSymbol 8 build_model 2 build_model modules_39_fpm_39 [] build_model Public ), join_path: (ExternalSymbol 8 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39 [modules_39_fpm_39] [(SubroutineCall 8 build_model () [] () .false. ) (Print (StringConstant "executing modules_39" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_39_fpm_39: (Module (SymbolTable 2 { build_model: (Function (SymbolTable 7 { __libasr_created_variable_: (Variable 7 __libasr_created_variable_ [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_1: (Variable 7 __libasr_created_variable_1 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_2: (Variable 7 __libasr_created_variable_2 [] Local () () Default (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_model (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 filewrite_string____1 2 filewrite_string____1 [((FunctionCall 2 join_path () [((StringConstant "build" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant ".gitignore" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 7 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) )) ((Var 7 __libasr_created_variable_1)) ((LogicalConstant .false. (Logical 4) )) ((Var 7 __libasr_created_variable_2)) ((LogicalConstant .false. (Logical 4) ))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () )) ((ArrayConstant 1 ["*"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] () Public .false. .false. () ), filewrite_string____1: (ExternalSymbol 2 filewrite_string____1 4 filewrite_string____1 modules_39_module_fpm_filesystem_39 [] filewrite_string____1 Public ), join_path: (ExternalSymbol 2 join_path 4 join_path modules_39_module_fpm_filesystem_39 [] join_path Public ) }) modules_39_fpm_39 () [modules_39_module_fpm_filesystem_39] .false. .false. .false. ), modules_39_module_fpm_filesystem_39: (Module (SymbolTable 4 { filewrite_string____1: (Function (SymbolTable 9 { __1filedata: (Variable 9 __1filedata [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), filedata: (Variable 9 filedata [__1filedata] In () () Default (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (Var 9 __1filedata))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), filename: (Variable 9 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) filewrite_string____1 (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 filename) (Var 9 filedata) (Var 9 __1filedata)] [] () Public .false. .false. () ), join_path: (Function (SymbolTable 6 { __libasr_is_present_a3: (Variable 6 __libasr_is_present_a3 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_a4: (Variable 6 __libasr_is_present_a4 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_a5: (Variable 6 __libasr_is_present_a5 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (Variable 6 a1 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 6 a2 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a3: (Variable 6 a3 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a4: (Variable 6 a4 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), a5: (Variable 6 a5 [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 6 path [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) join_path (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4) (String 1 () AssumedLength DescriptorString) (Logical 4)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a1) (Var 6 a2) (Var 6 a3) (Var 6 __libasr_is_present_a3) (Var 6 a4) (Var 6 __libasr_is_present_a4) (Var 6 a5) (Var 6 __libasr_is_present_a5)] [] (Var 6 path) Public .false. .false. () ) }) modules_39_module_fpm_filesystem_39 () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop3-52d2c18.json0000664000175000017500000000071515141516316026642 0ustar alastairalastair{ "basename": "run-implied_do_loop3-52d2c18", "cmd": "lfortran --no-color {infile}", "infile": "tests/implied_do_loop3.f90", "infile_hash": "4440ff155783cf7ecb6270f5b95365da0cb08eb0a5d4997f008b5a35", "outfile": null, "outfile_hash": null, "stdout": "run-implied_do_loop3-52d2c18.stdout", "stdout_hash": "e5ed6b2560462ad761ad4c1d21a15281c018a7519b5fa493fc62f3fa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_5-f25edd8.json0000664000175000017500000000075315141516316026125 0ustar alastairalastair{ "basename": "ast-fixed_form_5-f25edd8", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_5.f", "infile_hash": "c978dce7f02ade3281b72a11001e4813cd7c3157f0efa065c8a137d2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_5-f25edd8.stderr", "stderr_hash": "868271d79402bdfa652f8d86b11303134261ca5a7c28edbbd97bf884", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-submodule_04-987b68b.stdout0000664000175000017500000004247115141516316026303 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { mod_submodule_04: (Module (SymbolTable 2 { map_open_entry: (Function (SymbolTable 4 { key: (Variable 4 key [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), map: (Variable 4 map [] InOut () () Default (StructType [] [] .false. .false. ) 2 open_hashmap_type Source Private Required .false. .false. .false. () .false. .false. ) }) map_open_entry (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 4 map) (Var 4 key)] [] () Private .false. .false. () ), open_hashmap_type: (Struct (SymbolTable 3 { map_entry: (StructMethodDeclaration 3 map_entry () map_open_entry 2 map_open_entry Source .false. .false. ) }) open_hashmap_type (StructType [] [] .true. .false. ) [] [] [] Source Private .false. .false. [] () () ) }) mod_submodule_04 () [] .false. .false. .true. ), submod_submodule_04: (Module (SymbolTable 5 { map_open_entry: (Function (SymbolTable 6 { i: (Variable 6 i [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), key: (Variable 6 key [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), map: (Variable 6 map [] InOut () () Default (StructType [] [] .false. .false. ) 5 open_hashmap_type Source Public Required .false. .false. .false. () .false. .false. ) }) map_open_entry (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 6 map) (Var 6 key)] [(Assignment (Var 6 key) (Var 6 i) () .false. .false. )] () Public .false. .false. () ), open_hashmap_type: (ExternalSymbol 5 open_hashmap_type 2 open_hashmap_type mod_submodule_04 [] open_hashmap_type Public ) }) submod_submodule_04 mod_submodule_04 [] .false. .false. .false. ), submodule_04: (Program (SymbolTable 7 { 1_open_hashmap_type_map_open_entry: (ExternalSymbol 7 1_open_hashmap_type_map_open_entry 3 map_entry open_hashmap_type [] map_entry Public ), key: (Variable 7 key [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), map: (Variable 7 map [] Local () () Default (StructType [] [] .true. .false. ) 7 open_hashmap_type Source Public Required .false. .false. .false. () .false. .false. ), open_hashmap_type: (ExternalSymbol 7 open_hashmap_type 2 open_hashmap_type mod_submodule_04 [] open_hashmap_type Public ) }) submodule_04 [mod_submodule_04] [(SubroutineCall 7 1_open_hashmap_type_map_open_entry () [((Var 7 key))] (Var 7 map) .false. ) (Print (StringFormat () [(Var 7 key)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 7 key) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-include1-f5bbd80.json0000664000175000017500000000074315141516316025253 0ustar alastairalastair{ "basename": "ast-include1-f5bbd80", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/include1.f", "infile_hash": "8606a1bd16c5601e19e650f13f967c53a9cf3480c8803e8dca078960", "outfile": null, "outfile_hash": null, "stdout": "ast-include1-f5bbd80.stdout", "stdout_hash": "ab9af3121ee5fe59dd50fa4363b8d43565de08b01e41da41f422ef62", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_17-17c3d46.stdout0000664000175000017500000004474315141516316027144 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_17: (Program (SymbolTable 8 { sub_2: (ExternalSymbol 8 sub_2 6 sub_2 derived_types_17_module_2 [] sub_2 Public ) }) derived_types_17 [derived_types_17_module_2] [(SubroutineCall 8 sub_2 () [] () .false. )] ), derived_types_17_module_1: (Module (SymbolTable 2 { add: (Function (SymbolTable 4 { 1_t_1_num: (ExternalSymbol 4 1_t_1_num 3 num t_1 [] num Public ), self: (Variable 4 self [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) Add (StructInstanceMember (Var 4 self) 4 1_t_1_num (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 4 self) Public .false. .false. () ), subtract: (Function (SymbolTable 5 { 1_t_1_num: (ExternalSymbol 5 1_t_1_num 3 num t_1 [] num Public ), self: (Variable 5 self [] ReturnVar () () Default (StructType [(Integer 4)] [] .true. .false. ) 2 t_1 Source Private Required .false. .false. .false. () .false. .false. ) }) subtract (FunctionType [] (StructType [(Integer 4)] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) Mul (StructInstanceMember (Var 5 self) 5 1_t_1_num (Integer 4) () ) (Integer 4) () ) () .false. .false. )] (Var 5 self) Public .false. .false. () ), t_1: (Struct (SymbolTable 3 { num: (Variable 3 num [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [num] [] Source Private .false. .false. [] () () ) }) derived_types_17_module_1 () [] .false. .false. .false. ), derived_types_17_module_2: (Module (SymbolTable 6 { add: (ExternalSymbol 6 add 2 add derived_types_17_module_1 [] add Public ), sub_2: (Function (SymbolTable 7 { }) sub_2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(FunctionCall 6 subtract () [] (StructType [(Integer 4)] [] .true. .false. ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 add () [] (StructType [(Integer 4)] [] .true. .false. ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), subtract: (ExternalSymbol 6 subtract 2 subtract derived_types_17_module_1 [] subtract Public ) }) derived_types_17_module_2 () [derived_types_17_module_1] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_20-771801a.stdout0000664000175000017500000005325415141516316026367 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_20: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 3.141593 (Real 4) ) ) (RealConstant 3.141593 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), pi_dp: (Variable 2 pi_dp [] Local (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant -1.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.141593 (Real 8) ) ) (RealConstant 3.141593 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) ) (RealConstant 0.300593 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y2: (Variable 2 y2 [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_20 [] [(Print (StringFormat () [(Var 2 pi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 pi_dp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 y) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (Var 2 y) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntegerBinOp (Var 2 y2) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 7.000000 (Real 4) ) ) Mul (RealConstant 7.000000 (Real 4) ) (Real 4) (RealConstant 49.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.300593 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(RealBinOp (RealBinOp (IntrinsicElementalFunction Cos [(RealBinOp (Var 2 x) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) (RealConstant 1.300593 (Real 4) ) )] 0 (Real 4) (RealConstant 0.266928 (Real 4) ) ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) (RealConstant 0.071250 (Real 4) ) ) Add (RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (Var 2 x) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) (RealConstant 1.300593 (Real 4) ) )] 0 (Real 4) (RealConstant 0.963717 (Real 4) ) ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) (RealConstant 0.928750 (Real 4) ) ) (Real 4) (RealConstant 1.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutine4-97a10ca.json0000664000175000017500000000074115141516316026421 0ustar alastairalastair{ "basename": "ast_f90-subroutine4-97a10ca", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutine4-97a10ca.stdout", "stdout_hash": "7365a34e3119440421689d70b57349810f249c0b112f567e6eb81d38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-recursion_02-76da7b3.json0000664000175000017500000000076115141516316026167 0ustar alastairalastair{ "basename": "llvm-recursion_02-76da7b3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_02.f90", "infile_hash": "2935948fa13844b5a3b169f1d6df99e22cd1329310ef7c6d0f152583", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_02-76da7b3.stdout", "stdout_hash": "510b963b4339df0ebeb5622d9de2da743245184d3b9682f530e52c81", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_03-1316a5f.jsonlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_03-1310000664000175000017500000000112115141516316034240 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-optional_03-1316a5f", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_03.f90", "infile_hash": "706b33a3f5e59ce5e07ca126a2b59cadd02456d4d1f759b068cb8ffe", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-optional_03-1316a5f.stdout", "stdout_hash": "a47eb2d83c8c7c88d0ee6f82e6d4ac517ff656d1eda086c2145b0c93", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sign_01-62b270e.json0000664000175000017500000000072115141516316024636 0ustar alastairalastair{ "basename": "asr-sign_01-62b270e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/sign_01.f90", "infile_hash": "78b92aca15be8ebd9ddd8d8238cf461f0845c7600f926b57e64c270a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-sign_01-62b270e.stderr", "stderr_hash": "dab94d75469b4260c70326c06698d247c7f9bbe6c0aeebd631d20ab0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-namelist_01-032372e.stdout0000664000175000017500000000304515141516316026005 0ustar alastairalastair(TranslationUnit [(Program namelist1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(t [] [] () () None ()) (x [] [] () () None ()) (Ecut [] [] () () None ())] () ) (Declaration () [(AttrNamelist domain )] [(N [] [] () () None ()) (t [] [] () () None ()) (x [] [] () () None ()) (Ecut [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-print1-a173a20.stdout0000664000175000017500000000021315141516316025627 0ustar alastairalastairprogram print1 implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program print1 lfortran-lfortran-2f73434/tests/reference/ast-fn4-eaaa354.stdout0000664000175000017500000001570415141516316024603 0ustar alastairalastair(TranslationUnit [(Function conform [(mold) (val) (dim)] [] () () () [] [] [] [(Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In )] [(mold [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeType [] () () Asterisk ) [(AttrIntent In ) (SimpleAttribute AttrOptional )] [(val [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In ) (SimpleAttribute AttrOptional )] [(dim [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(conform [] [] () () None ())] () )] [(If 0 () (FuncCallOrArray present [] [(() val () 0)] [] [] [] ) [(If 0 () (FuncCallOrArray present [] [(() dim () 0)] [] [] [] ) [(If 0 () (BoolOp (BoolOp (> dim 0) And (<= dim (FuncCallOrArray rank [] [(() mold () 0)] [] [] [] )) ) And (<= dim (FuncCallOrArray rank [] [(() val () 0)] [] [] [] )) ) [(Assignment 0 conform (== (FuncCallOrArray size [] [(() mold () 0)] [(dim dim)] [] [] ) (FuncCallOrArray size [] [(() val () 0)] [(dim dim)] [] [] )) () )] [(ErrorStop 0 (String "Runtime error: Illegal dim argument provided in conform" ()) () () )] () () () )] [(If 0 () (== (FuncCallOrArray rank [] [(() val () 0)] [] [] [] ) (FuncCallOrArray rank [] [(() mold () 0)] [] [] [] )) [(Assignment 0 conform (FuncCallOrArray all [] [(() (== (FuncCallOrArray shape [] [(() mold () 0)] [] [] [] ) (FuncCallOrArray shape [] [(() val () 0)] [] [] [] )) () 0)] [] [] [] ) () )] [(Assignment 0 conform (Logical .false.) () )] () () () )] () () () )] [(Assignment 0 conform (Logical .true.) () )] () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_1-c2d5950.stdout0000664000175000017500000010700115141516316031067 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { continue_compilation_1_mod: (Module (SymbolTable 2 { f: (Function (SymbolTable 3 { f: (Variable 3 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 f) (IntrinsicElementalFunction Present [(Var 3 x)] 0 (Logical 4) () ) () .false. .false. )] (Var 3 f) Public .false. .false. () ) }) continue_compilation_1_mod () [] .false. .false. .false. ), continue_compilation_ff: (Program (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), a_2: (Variable 4 a_2 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a_3: (Variable 4 a_3 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a_4: (Variable 4 a_4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), a_5: (Variable 4 a_5 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), circlearea: (Variable 4 circlearea [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i_1: (Variable 4 i_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i_2: (Variable 4 i_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i_3: (Variable 4 i_3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ij: (Variable 4 ij [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), image: (Variable 4 image [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 600 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 450 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), init_x: (Variable 4 init_x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j_1: (Variable 4 j_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), kindvar: (Variable 4 kindvar [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nx: (Variable 4 nx [] Local (IntegerConstant 600 (Integer 4) Decimal) (IntegerConstant 600 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ny: (Variable 4 ny [] Local (IntegerConstant 450 (Integer 4) Decimal) (IntegerConstant 450 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), shape: (Variable 4 shape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), size_a: (Variable 4 size_a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_a_2: (Variable 4 size_a_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), str: (Variable 4 str [] Local (StringConstant "Hello " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Hello " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 4 val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x_2: (Variable 4 x_2 [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), x_3: (Variable 4 x_3 [] Local () () Default (Allocatable (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), y_1: (Variable 4 y_1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), y_2: (Variable 4 y_2 [] Local () () Default (Pointer (Array (Integer 2) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), y_3: (Variable 4 y_3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y_4: (Variable 4 y_4 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) continue_compilation_ff [] [(FileClose 0 (IntegerConstant 200 (Integer 4) Decimal) () () () () ) (Assignment (Var 4 x_2) (StringConstant "u" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 4 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 4 i) Gt (IntrinsicElementalFunction Ichar [(Var 4 x_2)] 0 (Integer 4) () ) (Logical 4) () ) [] [] ) (Assignment (Var 4 size_a) (ArraySize (Var 4 a_2) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutines_09-83ddd2b.json0000664000175000017500000000076415141516316026442 0ustar alastairalastair{ "basename": "asr-subroutines_09-83ddd2b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_09.f90", "infile_hash": "3f6ea6213db107e0cec3cc74bd308164cc52607efc6f85e7a7a389aa", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_09-83ddd2b.stdout", "stdout_hash": "061208d3772dae1c56624f16e78b6dee4671b713094ab80715db10ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-parsing_01-c9b84fe.stdout0000664000175000017500000001147015141516316026074 0ustar alastairalastair(TranslationUnit [(Module submodule (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(complex [] [] () 1 Equal ())] () ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine function [(integer) (real)] [(SimpleAttribute AttrModule )] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(integer [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(real [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Submodule submodule () module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Procedure function [] [(SimpleAttribute AttrModule )] () [] [] [] [] [(Assignment 0 real (* 2 integer) () )] [] )] ) (Program program (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] submodule [(UseSymbol complex character ) (UseSymbol function subroutine )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integer [] [] () () None ()) (real [] [] () () None ())] () )] [(Assignment 0 integer character () ) (AssociateBlock 0 associate [(logical [] [] () character Arrow ()) (complex [] [] () real Arrow ())] [(SubroutineCall 0 subroutine [] [(() logical () 0) (() complex () 0)] [] [] () ) (Print 0 () [(Parenthesis complex )] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-private1-f9f97ce.json0000664000175000017500000000072415141516316025321 0ustar alastairalastair{ "basename": "asr-private1-f9f97ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/private1.f90", "infile_hash": "2d80d22188cbb5b29b17cef6855c9098194d5fe89b0bf9b14d7a8af2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-private1-f9f97ce.stderr", "stderr_hash": "cedaa206aa9e964748ccb604498e30d1fc7d09fbb7c67218381a600d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-format_23-fdedfdb.stdout0000664000175000017500000000137215141516316026154 0ustar alastairalastairBinary format for real(4): x1 (3.14): 1000000010010001111010111000011 x1 (3.14): ********** x1 (3.14): 1000000010010001111010111000011 y1 (-2.5): 11000000001000000000000000000000 y1 (-2.5): ********** y1 (-2.5): 11000000001000000000000000000000 z1 (0.0): 0 z1 (0.0): 0 Binary format for real(8): x8 (3.14): 100000000001001000111101011100001010001111010111000010100011111 x8 (3.14): ********** x8 (3.14): 100000000001001000111101011100001010001111010111000010100011111 y8 (-2.5): 1100000000000100000000000000000000000000000000000000000000000000 y8 (-2.5): ********** y8 (-2.5): 1100000000000100000000000000000000000000000000000000000000000000 z8 (0.0): 0 z8 (0.0): 0 lfortran-lfortran-2f73434/tests/reference/ast-expr2-52dd466.json0000664000175000017500000000070415141516316024450 0ustar alastairalastair{ "basename": "ast-expr2-52dd466", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "ast-expr2-52dd466.stdout", "stdout_hash": "7fec7d309068cf92ea67d34387514bd37ec3365d54bb020dd1682f4f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_type_04-0a4f388.stderr0000664000175000017500000000044715141516316026731 0ustar alastairalastairsemantic error: Passed object dummy argument my_object not found in function arguments --> tests/errors/derived_type_04.f90:7:9 | 7 | procedure(testing_interface), deferred, pass(my_object) :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-nullify_02-1c6befe.stdout0000664000175000017500000000460115141516316026161 0ustar alastairalastair(TranslationUnit [(Program nullify_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(p1 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrTarget )] [(t1 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrTarget )] [(t2 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Associate 0 p1 t1 () ) (Assignment 0 p1 1 () ) (Associate 0 p2 t2 () ) (Assignment 0 p2 (Real "2.") () ) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit13-56e851c.json0000664000175000017500000000106615141516316025370 0ustar alastairalastair{ "basename": "asr-implicit13-56e851c", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit13.f90", "infile_hash": "846836e213592204557603a57b6f7420ebd88db79c59d7a369174c36", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit13-56e851c.stdout", "stdout_hash": "638b9b5f788b1d1794061a63041405e7b63436b1c393fa46ed33c497", "stderr": "asr-implicit13-56e851c.stderr", "stderr_hash": "1c317cb7ffa7ec9485863562f58b639bdf60dca66cc82b65e6a7c57b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-types_01-dfa3d3c.stdout0000664000175000017500000000136115141516316025631 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { float r; r = 1.00000000000000000e+00; r = 1.50000000000000000e+00; r = 1.00000000000000000e+00; r = (float)(2); r = (double)(3); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/llvm-complex_div_test-0a2468c.stdout0000664000175000017500000002452715141516316027516 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %2 = load %complex_4, %complex_4* %x, align 1 %3 = extractvalue %complex_4 %2, 0 %4 = extractvalue %complex_4 %2, 1 %5 = call float @llvm.fabs.f32(float 4.000000e+00) %6 = call float @llvm.fabs.f32(float 0.000000e+00) %7 = fcmp oge float %5, %6 br i1 %7, label %complex_div_r_ge_s, label %complex_div_r_lt_s complex_div_r_ge_s: ; preds = %.entry %8 = fmul float %4, 0.000000e+00 %9 = fadd float %3, %8 %10 = fmul float %3, 0.000000e+00 %11 = fsub float %4, %10 %12 = fdiv float %9, 4.000000e+00 %13 = fdiv float %11, 4.000000e+00 br label %complex_div_cont complex_div_r_lt_s: ; preds = %.entry %14 = fmul float %3, 0x7FF0000000000000 %15 = fadd float %14, %4 %16 = fmul float %4, 0x7FF0000000000000 %17 = fsub float %16, %3 %18 = fdiv float %15, 0x7FF0000000000000 %19 = fdiv float %17, 0x7FF0000000000000 br label %complex_div_cont complex_div_cont: ; preds = %complex_div_r_lt_s, %complex_div_r_ge_s %20 = phi float [ %12, %complex_div_r_ge_s ], [ %18, %complex_div_r_lt_s ] %21 = phi float [ %13, %complex_div_r_ge_s ], [ %19, %complex_div_r_lt_s ] %22 = insertvalue %complex_4 undef, float %20, 0 %23 = insertvalue %complex_4 %22, float %21, 1 store %complex_4 %23, %complex_4* %x, align 1 %24 = alloca i64, align 8 %25 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %24, i32 0, i32 0, %complex_4* %x) %26 = load i64, i64* %24, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %25, i8** %27, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %26, i64* %28, align 4 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %30 = load i8*, i8** %29, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %32 = load i64, i64* %31, align 4 %33 = trunc i64 %32 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %30, i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %34 = icmp eq i8* %25, null br i1 %34, label %free_done, label %free_nonnull free_nonnull: ; preds = %complex_div_cont call void @_lfortran_free(i8* %25) br label %free_done free_done: ; preds = %free_nonnull, %complex_div_cont %35 = load %complex_4, %complex_4* %x, align 1 %36 = extractvalue %complex_4 %35, 0 %37 = extractvalue %complex_4 %35, 1 %38 = call float @llvm.fabs.f32(float %36) %39 = call float @llvm.fabs.f32(float %37) %40 = fcmp oge float %38, %39 br i1 %40, label %complex_div_r_ge_s1, label %complex_div_r_lt_s2 complex_div_r_ge_s1: ; preds = %free_done %41 = fdiv float %37, %36 %42 = fmul float %37, %41 %43 = fadd float %36, %42 %44 = fmul float 0.000000e+00, %41 %45 = fadd float 2.000000e+00, %44 %46 = fmul float 2.000000e+00, %41 %47 = fsub float 0.000000e+00, %46 %48 = fdiv float %45, %43 %49 = fdiv float %47, %43 br label %complex_div_cont3 complex_div_r_lt_s2: ; preds = %free_done %50 = fdiv float %36, %37 %51 = fmul float %36, %50 %52 = fadd float %37, %51 %53 = fmul float 2.000000e+00, %50 %54 = fadd float %53, 0.000000e+00 %55 = fmul float 0.000000e+00, %50 %56 = fsub float %55, 2.000000e+00 %57 = fdiv float %54, %52 %58 = fdiv float %56, %52 br label %complex_div_cont3 complex_div_cont3: ; preds = %complex_div_r_lt_s2, %complex_div_r_ge_s1 %59 = phi float [ %48, %complex_div_r_ge_s1 ], [ %57, %complex_div_r_lt_s2 ] %60 = phi float [ %49, %complex_div_r_ge_s1 ], [ %58, %complex_div_r_lt_s2 ] %61 = insertvalue %complex_4 undef, float %59, 0 %62 = insertvalue %complex_4 %61, float %60, 1 store %complex_4 %62, %complex_4* %x, align 1 %63 = alloca i64, align 8 %64 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %63, i32 0, i32 0, %complex_4* %x) %65 = load i64, i64* %63, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %64, i8** %66, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %65, i64* %67, align 4 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %71 = load i64, i64* %70, align 4 %72 = trunc i64 %71 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %69, i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %73 = icmp eq i8* %64, null br i1 %73, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %complex_div_cont3 call void @_lfortran_free(i8* %64) br label %free_done6 free_done6: ; preds = %free_nonnull5, %complex_div_cont3 %74 = load %complex_4, %complex_4* %x, align 1 %75 = extractvalue %complex_4 %74, 0 %76 = extractvalue %complex_4 %74, 1 %77 = fadd float %75, 0.000000e+00 %78 = fadd float %76, 3.000000e+00 %79 = insertvalue %complex_4 undef, float %77, 0 %80 = insertvalue %complex_4 %79, float %78, 1 %81 = extractvalue %complex_4 %80, 0 %82 = extractvalue %complex_4 %80, 1 %83 = call float @llvm.fabs.f32(float %81) %84 = call float @llvm.fabs.f32(float %82) %85 = fcmp oge float %83, %84 br i1 %85, label %complex_div_r_ge_s7, label %complex_div_r_lt_s8 complex_div_r_ge_s7: ; preds = %free_done6 %86 = fdiv float %82, %81 %87 = fmul float %82, %86 %88 = fadd float %81, %87 %89 = fmul float 0.000000e+00, %86 %90 = fadd float 1.000000e+00, %89 %91 = fmul float 1.000000e+00, %86 %92 = fsub float 0.000000e+00, %91 %93 = fdiv float %90, %88 %94 = fdiv float %92, %88 br label %complex_div_cont9 complex_div_r_lt_s8: ; preds = %free_done6 %95 = fdiv float %81, %82 %96 = fmul float %81, %95 %97 = fadd float %82, %96 %98 = fmul float 1.000000e+00, %95 %99 = fadd float %98, 0.000000e+00 %100 = fmul float 0.000000e+00, %95 %101 = fsub float %100, 1.000000e+00 %102 = fdiv float %99, %97 %103 = fdiv float %101, %97 br label %complex_div_cont9 complex_div_cont9: ; preds = %complex_div_r_lt_s8, %complex_div_r_ge_s7 %104 = phi float [ %93, %complex_div_r_ge_s7 ], [ %102, %complex_div_r_lt_s8 ] %105 = phi float [ %94, %complex_div_r_ge_s7 ], [ %103, %complex_div_r_lt_s8 ] %106 = insertvalue %complex_4 undef, float %104, 0 %107 = insertvalue %complex_4 %106, float %105, 1 store %complex_4 %107, %complex_4* %x, align 1 %108 = alloca i64, align 8 %109 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %108, i32 0, i32 0, %complex_4* %x) %110 = load i64, i64* %108, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %111 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %109, i8** %111, align 8 %112 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %110, i64* %112, align 4 %113 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %114 = load i8*, i8** %113, align 8 %115 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %116 = load i64, i64* %115, align 4 %117 = trunc i64 %116 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %114, i32 %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %118 = icmp eq i8* %109, null br i1 %118, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %complex_div_cont9 call void @_lfortran_free(i8* %109) br label %free_done12 free_done12: ; preds = %free_nonnull11, %complex_div_cont9 call void @_lpython_free_argv() br label %return return: ; preds = %free_done12 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_06-8523892.stdout0000664000175000017500000002425015141516316026321 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_06: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_06 [] [(Assignment (Var 2 x) (IntrinsicElementalFunction Asin [(RealConstant 0.841471 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Acos [(RealConstant 0.540302 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Atan [(RealConstant 1.557408 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (Cast (IntrinsicElementalFunction Atan [(RealConstant 1.557408 (Real 8) )] 0 (Real 8) (RealConstant 1.000000 (Real 8) ) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Asinh [(RealConstant 1.175201 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Acosh [(RealConstant 1.543081 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (IntrinsicElementalFunction Atanh [(RealConstant 0.761594 (Real 4) )] 0 (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_34-81f4937.json0000664000175000017500000000071515141516316025154 0ustar alastairalastair{ "basename": "run-format_34-81f4937", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_34.f90", "infile_hash": "f71b29e58cc9d9abb8bf7d458a509b83d1457839bb7b6d8ec3a51859", "outfile": null, "outfile_hash": null, "stdout": "run-format_34-81f4937.stdout", "stdout_hash": "aec31744f20adfa39680fe35eeb9097c6e60812f9bb44a0bf188bf7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_06-15c0eef.json0000664000175000017500000000076415141516316026425 0ustar alastairalastair{ "basename": "llvm-intrinsics_06-15c0eef", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", "infile_hash": "c551ff5e24ea7b1b86a697b75ab52b3a9fb897ec0ff8d13f6a8afba5", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_06-15c0eef.stdout", "stdout_hash": "b4b93905f6ee4168c20c7db3cab0e054539eb9cfee7d21f78347f796", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/enable_disable_style_suggestion-style1-55a065c.stderr0000664000175000017500000000011315141516316032760 0ustar alastairalastairCannot use --no-style-suggestions and --style-suggestions at the same time lfortran-lfortran-2f73434/tests/reference/ast_f90-flush1-1eb6a16.stdout0000664000175000017500000000022615141516316025707 0ustar alastairalastairprogram flush1 ! Tests for syntax (AST only): flush(10, IOSTAT=n) flush(20, IOMSG=n) flush(ERR=label) flush(30, UNIT=40) flush(50) end program flush1 lfortran-lfortran-2f73434/tests/reference/asr-bindc1-6cc9005.json0000664000175000017500000000073415141516316024544 0ustar alastairalastair{ "basename": "asr-bindc1-6cc9005", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc1.f90", "infile_hash": "b894bae3cff84c3540cc34d38c5e3e6c46197db6d93d5f0b48013a06", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc1-6cc9005.stdout", "stdout_hash": "51f710f0ed1c693b169aa58b6a7272914669a7ea4dea07b158c08aaa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_02_transfer-1bcc806.json0000664000175000017500000000077515141516316027011 0ustar alastairalastair{ "basename": "asr-array_02_transfer-1bcc806", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_02_transfer.f90", "infile_hash": "39a7e9746d898ab639aea38fe0e86585c820af2c036e57e4b1f1e556", "outfile": null, "outfile_hash": null, "stdout": "asr-array_02_transfer-1bcc806.stdout", "stdout_hash": "2c486dc018ede2d0221bb845dc9e7c3f2f80f70036925d3fbac91ff4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_53-2d03c61.json0000664000175000017500000000071515141516316025212 0ustar alastairalastair{ "basename": "run-format_53-2d03c61", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_53.f90", "infile_hash": "cd5f05a45b0a163eb5008226938721ba5184db235a8bd0db67612ccd", "outfile": null, "outfile_hash": null, "stdout": "run-format_53-2d03c61.stdout", "stdout_hash": "7f88900dfe9dc63503fb29bc345707eb63b078051cb9528e03a238e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-block_02-1362742.stderr0000664000175000017500000000026315141516316025504 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/fortran-int_to_int_cast_fortran_codegen-913a36c.stdout0000664000175000017500000000045715141516316033244 0ustar alastairalastairprogram implicitinttointcastexample implicit none integer(4) :: integervalue1 integer(8) :: integervalue2 integervalue1 = 10 integervalue2 = int(integervalue1, kind=8) print *, "Integer Value 1:", integervalue1 print *, "Integer Value 2 (Kind=8):", integervalue2 end program implicitinttointcastexample lfortran-lfortran-2f73434/tests/reference/llvm-case_01-09dad75.json0000664000175000017500000000074215141516316025067 0ustar alastairalastair{ "basename": "llvm-case_01-09dad75", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_01-09dad75.stdout", "stdout_hash": "0a95b21ef2014f0dfd2dcb5f90b0cf3560074ee97352227eb12c9ef0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_ranks_allocatable_arr1-5e5233d.json0000664000175000017500000000104515141516316032515 0ustar alastairalastair{ "basename": "asr-incompatible_ranks_allocatable_arr1-5e5233d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_ranks_allocatable_arr1.f90", "infile_hash": "4a722df84efd62e9189918fa08cc3c83b07a5e0212279b928445e50f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_ranks_allocatable_arr1-5e5233d.stderr", "stderr_hash": "79c08e23704f47177db0d6beec0f93b54006a5567f44b3424dc148be", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-allocate_01-d7a2337.json0000664000175000017500000000070515141516316025506 0ustar alastairalastair{ "basename": "run-allocate_01-d7a2337", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocate_01.f90", "infile_hash": "140c96f4a8e85df7ace3fb207f9e2f00cf47f9b6798cb542f0784e07", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocate_01-d7a2337.stderr", "stderr_hash": "673d30388144c3aaf7dbe2956f5cbca2423aeb195d7e0a98d9c6f7c1", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine7-27bdbfe.stdout0000664000175000017500000000206515141516316026466 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(b [] [] () () None ())] () )] [(Assignment 0 a (+ b 1) () ) (Assignment 0 b (+ a 1) () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-data_02-fe19614.json0000664000175000017500000000073715141516316024631 0ustar alastairalastair{ "basename": "ast-data_02-fe19614", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_02.f90", "infile_hash": "38cac3153aba0224cd8982c9326d700c6f0fa2425261d221953566e8", "outfile": null, "outfile_hash": null, "stdout": "ast-data_02-fe19614.stdout", "stdout_hash": "1fca4e02bfe22ed0bed40a004abbfcef5ef1a9c6942f670ab093b65c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm_unary_minus-81a29ff.stdout0000664000175000017500000001522315141516316027451 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param i64) (result i64))) (type (;4;) (func (param) (result i64))) (type (;5;) (func (param) (result))) (type (;6;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32) (result i32) (local i32) i32.const 0 local.get 0 i32.sub local.set 1 local.get 1 return ) (func $3 (type 3) (param i64) (result i64) (local i64) i64.const 0 local.get 0 i64.sub local.set 1 local.get 1 return ) (func $4 (type 4) (param) (result i64) (local i64) i64.const 1000000000000 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result) (local) i32.const 13 call 2 i64.extend_i32_s call 6 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i64.const 130000000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const -13 call 2 i64.extend_i32_s call 6 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i64.const -130000000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $6 (type 6) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "get_num_neg_i32" (func 2)) (export "get_num_neg_i64" (func 3)) (export "test_unary_minus" (func 4)) (export "_start" (func 5)) (export "print_i64" (func 6)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-common_04-b603709.stdout0000664000175000017500000006427115141516316025477 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_1 (StructType [] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_1 () [] .false. .false. .false. ), main: (Program (SymbolTable 2 { 1_block_1_a: (ExternalSymbol 2 1_block_1_a 4 a block_1 [] a Public ), 1_block_1_b: (ExternalSymbol 2 1_block_1_b 4 b block_1 [] b Public ), 1_block_1_c: (ExternalSymbol 2 1_block_1_c 4 c block_1 [] c Public ), block_1: (ExternalSymbol 2 block_1 3 block_1 file_common_block_block_1 [] block_1 Public ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), struct_instance_block_1: (ExternalSymbol 2 struct_instance_block_1 3 struct_instance_block_1 file_common_block_block_1 [] struct_instance_block_1 Public ) }) main [] [(Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayBroadcast (IntegerConstant 4 (Integer 4) Decimal) (ArrayConstant 4 [5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 20 [4, 4, 4, 4, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 d)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-private2-d3a4771.stderr0000664000175000017500000000022515141516316025466 0ustar alastairalastairsemantic error: Private variable `y` cannot be imported --> tests/errors/private2.f90:7:21 | 7 | use foo2, only: y | ^ lfortran-lfortran-2f73434/tests/reference/asr-modules_32-ca5fb91.json0000664000175000017500000000075015141516316025517 0ustar alastairalastair{ "basename": "asr-modules_32-ca5fb91", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_32.f90", "infile_hash": "221fc91ff53022d8a5c646c4a5ffa56eca2b1cbdf7a1f1474bbd3d18", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_32-ca5fb91.stdout", "stdout_hash": "d4187ef2143bc2f02b5cd882152644f781d9f8d9f256c66169c3ce06", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_06-847ca73.stdout0000664000175000017500000035156515141516316027152 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_datetime: (Module (SymbolTable 7 { date_to_string: (Function (SymbolTable 11 { 1_toml_date_day: (ExternalSymbol 11 1_toml_date_day 8 day toml_date [] day Public ), 1_toml_date_month: (ExternalSymbol 11 1_toml_date_month 8 month toml_date [] month Public ), 1_toml_date_year: (ExternalSymbol 11 1_toml_date_year 8 year toml_date [] year Public ), lhs: (Variable 11 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 11 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 7 toml_date Source Private Required .false. .false. .false. () .false. .false. ) }) date_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 lhs) (Var 11 rhs)] [(Allocate [((Var 11 lhs) [] (IntegerConstant 10 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 11 lhs) () () () [(StringFormat (StringConstant "(i4.4,\"-\",i2.2,\"-\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 11 rhs) 11 1_toml_date_year (Integer 4) () ) (StructInstanceMember (Var 11 rhs) 11 1_toml_date_month (Integer 4) () ) (StructInstanceMember (Var 11 rhs) 11 1_toml_date_day (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] () Private .false. .false. () ), datetime_to_string: (Function (SymbolTable 12 { 1_toml_date_date_to_string: (ExternalSymbol 12 1_toml_date_date_to_string 8 to_string toml_date [] to_string Public ), 1_toml_datetime_date: (ExternalSymbol 12 1_toml_datetime_date 9 date toml_datetime [] date Public ), 1_toml_datetime_time: (ExternalSymbol 12 1_toml_datetime_time 9 time toml_datetime [] time Public ), 1_toml_time_time_to_string: (ExternalSymbol 12 1_toml_time_time_to_string 10 to_string toml_time [] to_string Public ), lhs: (Variable 12 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 12 rhs [] In () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. ) 7 toml_datetime Source Private Required .false. .false. .false. () .false. .false. ), temporary: (Variable 12 temporary [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) datetime_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [time_to_string] [(Var 12 lhs) (Var 12 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 12 1_toml_date_date_to_string () [((Var 12 lhs))] (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) .false. ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 12 1_toml_time_time_to_string () [((Var 12 temporary))] (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) .false. ) (Assignment (Var 12 lhs) (IntrinsicElementalFunction StringConcat [(Var 12 lhs) (Var 12 temporary)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(Assignment (Var 12 lhs) (StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (SubroutineCall 7 time_to_string 7 time_to_string [((Var 12 lhs)) ((StructInstanceMember (Var 12 rhs) 12 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] () .false. ) .false. .false. )] [] )] )] () Private .false. .false. () ), new_toml_time: (Function (SymbolTable 13 { 1_toml_time_hour: (ExternalSymbol 13 1_toml_time_hour 10 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 13 1_toml_time_millisec 10 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 13 1_toml_time_minute 10 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 13 1_toml_time_second 10 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 13 1_toml_time_zone 10 zone toml_time [] zone Public ), hour: (Variable 13 hour [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), millisec: (Variable 13 millisec [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), minute: (Variable 13 minute [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), second: (Variable 13 second [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), self: (Variable 13 self [] ReturnVar () () Default (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. ), zone: (Variable 13 zone [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Private Optional .false. .false. .false. () .false. .false. ) }) new_toml_time (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 13 hour) (Var 13 minute) (Var 13 second) (Var 13 millisec) (Var 13 zone)] [(If () (IntrinsicElementalFunction Present [(Var 13 hour)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_hour (Integer 4) () ) (Var 13 hour) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 minute)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_minute (Integer 4) () ) (Var 13 minute) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 second)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_second (Integer 4) () ) (Var 13 second) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 millisec)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_millisec (Allocatable (Integer 4) ) () ) (Var 13 millisec) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 13 zone)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 13 self) 13 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 13 zone) () .false. .false. )] [] )] (Var 13 self) Private .false. .false. () ), time_to_string: (Function (SymbolTable 14 { 1_toml_time_hour: (ExternalSymbol 14 1_toml_time_hour 10 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 14 1_toml_time_millisec 10 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 14 1_toml_time_minute 10 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 14 1_toml_time_second 10 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 14 1_toml_time_zone 10 zone toml_time [] zone Public ), lhs: (Variable 14 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 14 rhs [] In () () Default (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. ) }) time_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 lhs) (Var 14 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_millisec (Allocatable (Integer 4) ) () )] 0 (Logical 4) () ) [(Allocate [((Var 14 lhs) [] (IntegerConstant 12 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 14 lhs) () () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2,\".\",i3.3)" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_second (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_millisec (Allocatable (Integer 4) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] [(Allocate [((Var 14 lhs) [] (IntegerConstant 8 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 14 lhs) () () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 14 rhs) 14 1_toml_time_second (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 14 lhs) (IntrinsicElementalFunction StringConcat [(Var 14 lhs) (IntrinsicElementalFunction StringTrim [(StructInstanceMember (Var 14 rhs) 14 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] () Private .false. .false. () ), toml_date: (Struct (SymbolTable 8 { day: (Variable 8 day [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), month: (Variable 8 month [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 8 to_string rhs date_to_string 7 date_to_string Source .false. .false. ), year: (Variable 8 year [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~assign: (CustomOperator 8 ~assign [8 to_string] Public ) }) toml_date (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [year month day] [] Source Private .false. .false. [] () () ), toml_datetime: (Struct (SymbolTable 9 { date: (Variable 9 date [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) 7 toml_date Source Private Required .false. .false. .false. () .false. .false. ), time: (Variable 9 time [] Local () () Default (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 toml_time Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 9 to_string rhs datetime_to_string 7 datetime_to_string Source .false. .false. ), ~assign: (CustomOperator 9 ~assign [9 to_string] Public ) }) toml_datetime (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [date time] [] Source Private .false. .false. [] () () ), toml_time: (Struct (SymbolTable 10 { hour: (Variable 10 hour [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), millisec: (Variable 10 millisec [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), minute: (Variable 10 minute [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), second: (Variable 10 second [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 10 to_string rhs time_to_string 7 time_to_string Source .false. .false. ), zone: (Variable 10 zone [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), ~assign: (CustomOperator 10 ~assign [10 to_string] Public ) }) toml_time (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [hour minute second millisec zone] [] Source Private .false. .false. [] () () ), ~toml_time: (GenericProcedure 7 ~toml_time [7 new_toml_time] Public ) }) tomlf_datetime () [tomlf_datetime] .true. .false. .false. ), tomlf_utils: (Module (SymbolTable 2 { convert_raw: (ExternalSymbol 2 convert_raw 4 convert_raw tomlf_utils_convert [] convert_raw Public ), new_toml_time@~toml_time: (ExternalSymbol 2 new_toml_time@~toml_time 7 new_toml_time tomlf_datetime [] new_toml_time Public ), toml_date: (ExternalSymbol 2 toml_date 7 toml_date tomlf_datetime [] toml_date Public ), toml_datetime: (ExternalSymbol 2 toml_datetime 7 toml_datetime tomlf_datetime [] toml_datetime Public ), toml_raw_to_timestamp: (ExternalSymbol 2 toml_raw_to_timestamp 4 toml_raw_to_timestamp tomlf_utils_convert [] toml_raw_to_timestamp Public ), toml_time: (ExternalSymbol 2 toml_time 7 toml_time tomlf_datetime [] toml_time Public ), ~toml_time: (ExternalSymbol 2 ~toml_time 7 ~toml_time tomlf_datetime [] ~toml_time Public ) }) tomlf_utils () [tomlf_utils_convert] .false. .false. .false. ), tomlf_utils_convert: (Module (SymbolTable 4 { convert_raw: (GenericProcedure 4 convert_raw [4 toml_raw_to_timestamp] Public ), new_toml_time@~toml_time: (ExternalSymbol 4 new_toml_time@~toml_time 7 new_toml_time tomlf_datetime [] new_toml_time Public ), toml_date: (ExternalSymbol 4 toml_date 7 toml_date tomlf_datetime [] toml_date Public ), toml_datetime: (ExternalSymbol 4 toml_datetime 7 toml_datetime tomlf_datetime [] toml_datetime Public ), toml_raw_to_timestamp: (Function (SymbolTable 5 { 1_toml_datetime_date: (ExternalSymbol 5 1_toml_datetime_date 9 date toml_datetime [] date Public ), dot_pos: (Variable 5 dot_pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), err: (Variable 5 err [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), first: (Variable 5 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), raw: (Variable 5 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 5 stat [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), timestamp: (Variable 5 timestamp [] Out () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) 4 toml_datetime Source Public Required .false. .false. .false. () .false. .false. ) }) toml_raw_to_timestamp (FunctionType [(String 1 () AssumedLength DescriptorString) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 raw) (Var 5 timestamp)] [(Assignment (Var 5 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 timestamp) 5 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) (StructConstructor 4 toml_date [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) () ) () .false. .false. ) (Assignment (Var 5 stat) (IntegerCompare (Var 5 err) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) () .false. .false. )] (Var 5 stat) Public .false. .false. () ), toml_time: (ExternalSymbol 4 toml_time 7 toml_time tomlf_datetime [] toml_time Public ), ~toml_time: (ExternalSymbol 4 ~toml_time 7 ~toml_time tomlf_datetime [] ~toml_time Public ) }) tomlf_utils_convert () [tomlf_datetime] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-string_14-861794e.json0000664000175000017500000000074515141516316025156 0ustar alastairalastair{ "basename": "asr-string_14-861794e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_14.f90", "infile_hash": "5cc44728083840d1d00b687489a0ef17523de1d11209ccb39b49f42f", "outfile": null, "outfile_hash": null, "stdout": "asr-string_14-861794e.stdout", "stdout_hash": "0531d8272493daa8c813ad19de7e9997bf303d0f80401c3c5e6d63af", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface3-4503c6d.json0000664000175000017500000000102515141516316027312 0ustar alastairalastair{ "basename": "asr-implicit_interface3-4503c6d", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface3.f90", "infile_hash": "6914373182ded05c9b4169762408bc670588735da361b66e2e7cfc2c", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface3-4503c6d.stdout", "stdout_hash": "34af99627f308d966ee800039bf99f8970721bee9b2a4c14498f8301", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_07-3e4ee40.stdout0000664000175000017500000000031315141516316030577 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(ErrorStop 0 () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-external_03-fe60427.stdout0000664000175000017500000002767015141516316026115 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 4 { f: (Function (SymbolTable 9 { f_arg_0: (Variable 9 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 9 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 f_arg_0)] [] (Var 9 f_return_var_name) Public .false. .false. () ), r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 f)] [(Assignment (Var 4 r) (FunctionCall 4 f () [((RealConstant 2.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 4 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), b: (Function (SymbolTable 2 { f: (Function (SymbolTable 8 { f_arg_0: (Variable 8 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 8 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 f_arg_0)] [] (Var 8 f_return_var_name) Public .false. .false. () ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [a] [] [(SubroutineCall 1 a () [((Var 2 f))] () .false. )] () Public .false. .false. () ), external_03: (Program (SymbolTable 6 { }) external_03 [] [(SubroutineCall 1 b () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err4-9f3b813.json0000664000175000017500000000076015141516316027374 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err4-9f3b813", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err4.f90", "infile_hash": "7562759fab91efdac8434ae7acf76334560c5235c769ef2c269782d9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err4-9f3b813.stderr", "stderr_hash": "35a4de2e06089dca4cd7a5883ca6df059946058807125341cc995627", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-bin_op_real_dp-21bb7e8.json0000664000175000017500000000076415141516316026424 0ustar alastairalastair{ "basename": "asr-bin_op_real_dp-21bb7e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_real_dp.f90", "infile_hash": "051ba0744595dc6c3079fa4dd5b8cf1ee0504f434ee5dd8eb64ad7cc", "outfile": null, "outfile_hash": null, "stdout": "asr-bin_op_real_dp-21bb7e8.stdout", "stdout_hash": "4a5d68c358a69c3bae1c32e0dded0a8eddc79be55407bba5f75b6056", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-boz_01-dedad59.stdout0000664000175000017500000002772315141516316025304 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { boz_01: (Program (SymbolTable 2 { boz_1: (Variable 2 boz_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), boz_2: (Variable 2 boz_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), boz_3: (Variable 2 boz_3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), boz_4: (Variable 2 boz_4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), boz_5: (Variable 2 boz_5 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), boz_6: (Variable 2 boz_6 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) boz_01 [] [(Assignment (Var 2 boz_1) (IntrinsicElementalFunction Int [(IntegerConstant 93 (Integer 4) Binary)] 0 (Integer 4) (IntegerConstant 93 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_2) (IntrinsicElementalFunction Int [(IntegerConstant 1255 (Integer 4) Octal)] 0 (Integer 4) (IntegerConstant 1255 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_3) (IntrinsicElementalFunction Int [(IntegerConstant 2748 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2748 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_4) (IntrinsicElementalFunction Int [(IntegerConstant 2541551403008843505 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2541551403008843505 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_5) (IntrinsicElementalFunction Int [(IntegerConstant 2541551403008843505 (Integer 4) Hex)] 0 (Integer 4) (IntegerConstant 2541551403008843505 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 boz_6) (IntrinsicElementalFunction Real [(RealConstant 0.000000 (Real 4) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (If () (IntegerCompare (Var 2 boz_4) NotEq (Var 2 boz_5) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_1) NotEq (IntegerConstant 93 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_2) NotEq (IntegerConstant 1255 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_3) NotEq (IntegerConstant 2748 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_4) NotEq (IntegerConstant 180150001 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 boz_5) NotEq (IntegerConstant 180150001 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 boz_1) (Var 2 boz_2) (Var 2 boz_3) (Var 2 boz_4) (Var 2 boz_5) (Var 2 boz_6)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-class_04-290b898.stdout0000664000175000017500000002235515141516316025511 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %foo_c = type { %foo_b, %bar_c } %foo_b = type { %foo_a, %bar_b } %foo_a = type { %bar_a } %bar_a = type { i32 } %bar_b = type { %bar_a, i32 } %bar_c = type { %bar_b, i32 } %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %foo = alloca %foo_c, align 8 %2 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 1 %3 = getelementptr %bar_c, %bar_c* %2, i32 0, i32 1 %4 = getelementptr %bar_c, %bar_c* %2, i32 0, i32 0 %5 = getelementptr %bar_b, %bar_b* %4, i32 0, i32 1 %6 = getelementptr %bar_b, %bar_b* %4, i32 0, i32 0 %7 = getelementptr %bar_a, %bar_a* %6, i32 0, i32 0 %8 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %9 = getelementptr %foo_b, %foo_b* %8, i32 0, i32 1 %10 = getelementptr %bar_b, %bar_b* %9, i32 0, i32 1 %11 = getelementptr %bar_b, %bar_b* %9, i32 0, i32 0 %12 = getelementptr %bar_a, %bar_a* %11, i32 0, i32 0 %13 = getelementptr %foo_b, %foo_b* %8, i32 0, i32 0 %14 = getelementptr %foo_a, %foo_a* %13, i32 0, i32 0 %15 = getelementptr %bar_a, %bar_a* %14, i32 0, i32 0 %16 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %17 = getelementptr %foo_b, %foo_b* %16, i32 0, i32 0 %18 = getelementptr %foo_a, %foo_a* %17, i32 0, i32 0 %19 = getelementptr %bar_a, %bar_a* %18, i32 0, i32 0 store i32 -20, i32* %19, align 4 %20 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %21 = getelementptr %foo_b, %foo_b* %20, i32 0, i32 1 %22 = getelementptr %bar_b, %bar_b* %21, i32 0, i32 1 store i32 9, i32* %22, align 4 %23 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 1 %24 = getelementptr %bar_c, %bar_c* %23, i32 0, i32 1 store i32 11, i32* %24, align 4 %25 = alloca i64, align 8 %26 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %27 = getelementptr %foo_b, %foo_b* %26, i32 0, i32 0 %28 = getelementptr %foo_a, %foo_a* %27, i32 0, i32 0 %29 = getelementptr %bar_a, %bar_a* %28, i32 0, i32 0 %30 = load i32, i32* %29, align 4 %31 = alloca i32, align 4 store i32 %30, i32* %31, align 4 %32 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %25, i32 0, i32 0, i32* %31) %33 = load i64, i64* %25, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %32, i8** %34, align 8 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %33, i64* %35, align 4 %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %37 = load i8*, i8** %36, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %39 = load i64, i64* %38, align 4 %40 = trunc i64 %39 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %41 = icmp eq i8* %32, null br i1 %41, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %32) br label %free_done free_done: ; preds = %free_nonnull, %.entry %42 = alloca i64, align 8 %43 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %44 = getelementptr %foo_b, %foo_b* %43, i32 0, i32 1 %45 = getelementptr %bar_b, %bar_b* %44, i32 0, i32 1 %46 = load i32, i32* %45, align 4 %47 = alloca i32, align 4 store i32 %46, i32* %47, align 4 %48 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %42, i32 0, i32 0, i32* %47) %49 = load i64, i64* %42, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %48, i8** %50, align 8 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %49, i64* %51, align 4 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %53 = load i8*, i8** %52, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %55 = load i64, i64* %54, align 4 %56 = trunc i64 %55 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %53, i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %57 = icmp eq i8* %48, null br i1 %57, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %48) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %58 = alloca i64, align 8 %59 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 1 %60 = getelementptr %bar_c, %bar_c* %59, i32 0, i32 1 %61 = load i32, i32* %60, align 4 %62 = alloca i32, align 4 store i32 %61, i32* %62, align 4 %63 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %58, i32 0, i32 0, i32* %62) %64 = load i64, i64* %58, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %63, i8** %65, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %64, i64* %66, align 4 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %68 = load i8*, i8** %67, align 8 %69 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %70 = load i64, i64* %69, align 4 %71 = trunc i64 %70 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %68, i32 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %72 = icmp eq i8* %63, null br i1 %72, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %63) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %73 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %74 = getelementptr %foo_b, %foo_b* %73, i32 0, i32 0 %75 = getelementptr %foo_a, %foo_a* %74, i32 0, i32 0 %76 = getelementptr %bar_a, %bar_a* %75, i32 0, i32 0 %77 = load i32, i32* %76, align 4 %78 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 0 %79 = getelementptr %foo_b, %foo_b* %78, i32 0, i32 1 %80 = getelementptr %bar_b, %bar_b* %79, i32 0, i32 1 %81 = load i32, i32* %80, align 4 %82 = add i32 %77, %81 %83 = getelementptr %foo_c, %foo_c* %foo, i32 0, i32 1 %84 = getelementptr %bar_c, %bar_c* %83, i32 0, i32 1 %85 = load i32, i32* %84, align 4 %86 = add i32 %82, %85 %87 = icmp ne i32 %86, 0 br i1 %87, label %then, label %else then: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done6 br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-complex2-5384cb2.stdout0000664000175000017500000001536115141516316025511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Add (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (RealConstant 2.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Add (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (ComplexBinOp (Cast (RealConstant 2.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Add (Var 2 x) (Complex 4) () ) Add (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-array7-6a2e4ab.stdout0000664000175000017500000000023015141516316025764 0ustar alastairalastairprogram array7 implicit double precision (A-H,O-Z) implicit integer (I-N) integer, parameter :: n = 10 dimension :: SJ(0:N), DJ(0:N) end program array7 lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing4-c338b90.json0000664000175000017500000000111615141516316026671 0ustar alastairalastair{ "basename": "asr-implicit_typing4-c338b90", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing4.f90", "infile_hash": "d21435f596cf1ccd2166742ff835bedb255e7b9cd1df878a3b041834", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing4-c338b90.stdout", "stdout_hash": "7090db6738711cfce68a86a5b320e09d649efb818dd1b2a67cd3cbe8", "stderr": "asr-implicit_typing4-c338b90.stderr", "stderr_hash": "8ff5644fd7cfa11e1ae5b3467201231583bf45ab58a69e68bd1fd1e8", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_08-b380a57.json0000664000175000017500000000075715141516316026744 0ustar alastairalastair{ "basename": "asr-template_error_08-b380a57", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_08.f90", "infile_hash": "5d3d6c8f03fb6c2313dbfeb16021c563f6773a29b22c094eee856765", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_08-b380a57.stderr", "stderr_hash": "d3128419db37e7b54e24f49d795253eec72b10eac45f72bf342b70ea", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_04-ba99aa1.stdout0000664000175000017500000000506315141516316027165 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @print_int() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_it FINALIZE_SYMTABLE_print_it: ; preds = %return ret i32 0 } define void @print_int() { .entry: %a = alloca i32, align 4 store i32 5, i32* %a, align 4 %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %a) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_print_int FINALIZE_SYMTABLE_print_int: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-string_02-c37e098.json0000664000175000017500000000075015141516316025407 0ustar alastairalastair{ "basename": "llvm-string_02-c37e098", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_02-c37e098.stdout", "stdout_hash": "3c3d50f742fc0f1d934e40637dd7d0c6c9c1bd94195e2fa7e4087297", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-merge_bits_run-9579699.stderr0000664000175000017500000000030115141516316026624 0ustar alastairalastairsemantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/merge_bits_run.f90:7:14 | 7 | print *, merge_bits(a, b, c) | ^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp7-cec734d.stderr0000664000175000017500000000025415141516316027214 0ustar alastairalastairsemantic error: Variable 'z12' is not declared --> tests/errors/cpp7.f90:116:21 | 116 | print *, "1aa", z12, 5 | ^^^ 'z12' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-common_04-b603709.json0000664000175000017500000000074515141516316025122 0ustar alastairalastair{ "basename": "asr-common_04-b603709", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_04.f90", "infile_hash": "b2b4a515f1cb59552a75dd35ac20fe972653540c29780d8c92214cbb", "outfile": null, "outfile_hash": null, "stdout": "asr-common_04-b603709.stdout", "stdout_hash": "ef336844bcbecb9502a451846ad57506fbf5442397c418169c0884d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-style1-3d16af1.stderr0000664000175000017500000000046515141516316030627 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-function_call1-0b992da.json0000664000175000017500000000073715141516316026371 0ustar alastairalastair{ "basename": "asr-function_call1-0b992da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/function_call1.f90", "infile_hash": "45acf463b1d977f1bdf3d9420205c7979fc03de58d60260cb37fd0bc", "outfile": null, "outfile_hash": null, "stdout": "asr-function_call1-0b992da.stdout", "stdout_hash": "85f4f67b3ef684927c9cba214916d4159cef9ec46edf693e84fefce3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_01b-e284c9a.stderr0000664000175000017500000000055115141516316027507 0ustar alastairalastairsemantic error: Template argument plus_t has not been declared in template specification. --> tests/errors/template_error_01b.f90:19:5 - 41:1 | 19 | template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 41 | | ...^ lfortran-lfortran-2f73434/tests/reference/asr-int_dp_param-19bf015.stdout0000664000175000017500000001135015141516316026404 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local (IntegerConstant 2147483647 (Integer 4) Decimal) (IntegerConstant 2147483647 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local (Cast (IntegerConstant 2147483647 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2147483647 (Integer 8) Decimal) ) (IntegerConstant 2147483647 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-select_type1-767380c.stdout0000664000175000017500000000074215141516316026765 0ustar alastairalastairprogram select_type1 implicit none select type (uptr=>iter%value()) type is (integer) print *, iter%key(), " = ", uptr type is (real) print *, iter%key(), " = ", uptr type is (character(len=*)) print *, iter%key(), " = ", uptr type is (point) print *, iter%key(), " = ", uptr class is (point2) print *, iter%key(), " = ", uptr class default print *, iter%key(), " = ", uptr end select end program select_type1 lfortran-lfortran-2f73434/tests/reference/julia-case_03-b4597f9.stdout0000664000175000017500000000101715141516316025524 0ustar alastairalastairfunction main() local a::Int32 = 1 local b::Int32 = 2 local marks::Int32 marks = 94 if marks ≥ 40 + b println("Pass!") elseif marks ≤ 39 - a println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) marks = -1 if marks ≥ 40 + b println("Pass!") elseif 0 ≤ marks ≤ 39 - a println("Failed!") else println("Invalid marks") end println("Your marks are ", " ", marks) end main() lfortran-lfortran-2f73434/tests/reference/asr-string_17-29e01e3.stdout0000664000175000017500000004713115141516316025573 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_17_string_module: (Module (SymbolTable 2 { len: (GenericProcedure 2 len [2 len_string] Public ), len_string: (Function (SymbolTable 4 { 1_string_type_raw: (ExternalSymbol 4 1_string_type_raw 3 raw string_type [] raw Public ), length: (Variable 4 length [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) len_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 4 string) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 4 length) (StringLen (StructInstanceMember (Var 4 string) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () ) () .false. .false. )] [(Assignment (Var 4 length) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] )] (Var 4 length) Public .false. .false. () ), maybe: (Function (SymbolTable 5 { 1_string_type_raw: (ExternalSymbol 5 1_string_type_raw 3 raw string_type [] raw Public ), maybe_string: (Variable 5 maybe_string [len_string string] ReturnVar () () Default (String 1 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) maybe (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (String 1 (FunctionCall 2 len_string 2 len [((FunctionParam 0 (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ))] (Integer 4) () () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [len_string] [(Var 5 string)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 5 maybe_string) (StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. )] [(Assignment (Var 5 maybe_string) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] )] (Var 5 maybe_string) Public .false. .false. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Private .false. .false. [] () () ) }) string_17_string_module () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr3-3036522.stdout0000664000175000017500000000224615141516316025036 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %__lfortran_evaluate_12 = alloca i32, align 4 %__lfortran_evaluate_13 = alloca i32, align 4 %__lfortran_evaluate_14 = alloca i32, align 4 %__lfortran_evaluate_15 = alloca i32, align 4 %__lfortran_evaluate_16 = alloca i32, align 4 %__lfortran_evaluate_17 = alloca i32, align 4 %__lfortran_evaluate_18 = alloca i32, align 4 store i32 5, i32* %__lfortran_evaluate_11, align 4 store i32 8, i32* %__lfortran_evaluate_12, align 4 store i32 16, i32* %__lfortran_evaluate_13, align 4 store i32 11, i32* %__lfortran_evaluate_14, align 4 store i32 2, i32* %__lfortran_evaluate_15, align 4 store i32 64, i32* %__lfortran_evaluate_16, align 4 store i32 8, i32* %__lfortran_evaluate_17, align 4 store i32 8, i32* %__lfortran_evaluate_18, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_18, align 4 ret i32 %0 } lfortran-lfortran-2f73434/tests/reference/llvm-doloop_02-9fcb598.stdout0000664000175000017500000002650615141516316026044 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %b = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 1, i32* %a, align 4 store i32 10, i32* %b, align 4 %2 = load i32, i32* %a, align 4 %3 = sub i32 %2, 1 store i32 %3, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %4 = load i32, i32* %i, align 4 %5 = add i32 %4, 1 %6 = load i32, i32* %b, align 4 %7 = icmp sle i32 %5, %6 br i1 %7, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %8 = load i32, i32* %i, align 4 %9 = add i32 %8, 1 store i32 %9, i32* %i, align 4 %10 = load i32, i32* %j, align 4 %11 = load i32, i32* %i, align 4 %12 = add i32 %10, %11 store i32 %12, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %13 = load i32, i32* %j, align 4 %14 = icmp ne i32 %13, 55 br i1 %14, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %15 = alloca i64, align 8 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %15, i32 0, i32 0, i32* %j) %17 = load i64, i64* %15, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %23 = load i64, i64* %22, align 4 %24 = trunc i64 %23 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %21, i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %25 = icmp eq i8* %16, null br i1 %25, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %16) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %a, align 4 store i32 0, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.end5, %free_done %26 = load i32, i32* %i, align 4 %27 = add i32 %26, 1 %28 = icmp sle i32 %27, 10 br i1 %28, label %loop.body2, label %loop.end6 loop.body2: ; preds = %loop.head1 %29 = load i32, i32* %i, align 4 %30 = add i32 %29, 1 store i32 %30, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head3 loop.head3: ; preds = %loop.body4, %loop.body2 %31 = load i32, i32* %j, align 4 %32 = add i32 %31, 1 %33 = icmp sle i32 %32, 10 br i1 %33, label %loop.body4, label %loop.end5 loop.body4: ; preds = %loop.head3 %34 = load i32, i32* %j, align 4 %35 = add i32 %34, 1 store i32 %35, i32* %j, align 4 %36 = load i32, i32* %a, align 4 %37 = load i32, i32* %i, align 4 %38 = sub i32 %37, 1 %39 = mul i32 %38, 10 %40 = add i32 %36, %39 %41 = load i32, i32* %j, align 4 %42 = add i32 %40, %41 store i32 %42, i32* %a, align 4 br label %loop.head3 loop.end5: ; preds = %loop.head3 br label %loop.head1 loop.end6: ; preds = %loop.head1 %43 = load i32, i32* %a, align 4 %44 = icmp ne i32 %43, 5050 br i1 %44, label %then7, label %else8 then7: ; preds = %loop.end6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %loop.end6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %45 = alloca i64, align 8 %46 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %45, i32 0, i32 0, i32* %a) %47 = load i64, i64* %45, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %46, i8** %48, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %47, i64* %49, align 4 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %51 = load i8*, i8** %50, align 8 %52 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %53 = load i64, i64* %52, align 4 %54 = trunc i64 %53 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %51, i32 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %55 = icmp eq i8* %46, null br i1 %55, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free(i8* %46) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 store i32 0, i32* %a, align 4 store i32 0, i32* %i, align 4 br label %loop.head13 loop.head13: ; preds = %loop.end17, %free_done12 %56 = load i32, i32* %i, align 4 %57 = add i32 %56, 1 %58 = icmp sle i32 %57, 10 br i1 %58, label %loop.body14, label %loop.end18 loop.body14: ; preds = %loop.head13 %59 = load i32, i32* %i, align 4 %60 = add i32 %59, 1 store i32 %60, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head15 loop.head15: ; preds = %loop.body16, %loop.body14 %61 = load i32, i32* %j, align 4 %62 = add i32 %61, 1 %63 = load i32, i32* %i, align 4 %64 = icmp sle i32 %62, %63 br i1 %64, label %loop.body16, label %loop.end17 loop.body16: ; preds = %loop.head15 %65 = load i32, i32* %j, align 4 %66 = add i32 %65, 1 store i32 %66, i32* %j, align 4 %67 = load i32, i32* %a, align 4 %68 = load i32, i32* %j, align 4 %69 = add i32 %67, %68 store i32 %69, i32* %a, align 4 br label %loop.head15 loop.end17: ; preds = %loop.head15 br label %loop.head13 loop.end18: ; preds = %loop.head13 %70 = load i32, i32* %a, align 4 %71 = icmp ne i32 %70, 220 br i1 %71, label %then19, label %else20 then19: ; preds = %loop.end18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 else20: ; preds = %loop.end18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %72 = alloca i64, align 8 %73 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %72, i32 0, i32 0, i32* %a) %74 = load i64, i64* %72, align 4 %stringFormat_desc22 = alloca %string_descriptor, align 8 %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 0 store i8* %73, i8** %75, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 1 store i64 %74, i64* %76, align 4 %77 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 0 %78 = load i8*, i8** %77, align 8 %79 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc22, i32 0, i32 1 %80 = load i64, i64* %79, align 4 %81 = trunc i64 %80 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %78, i32 %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %82 = icmp eq i8* %73, null br i1 %82, label %free_done24, label %free_nonnull23 free_nonnull23: ; preds = %ifcont21 call void @_lfortran_free(i8* %73) br label %free_done24 free_done24: ; preds = %free_nonnull23, %ifcont21 call void @_lpython_free_argv() br label %return return: ; preds = %free_done24 br label %FINALIZE_SYMTABLE_doloop_02 FINALIZE_SYMTABLE_doloop_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-assign_to1-e0b6dcb.stdout0000664000175000017500000000031115141516316026231 0ustar alastairalastair(TranslationUnit [(Program assign1 () [] [] [] [(Assign 10 10 next () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-int_03-924441d.stdout0000664000175000017500000003777715141516316025014 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_03: (Program (SymbolTable 2 { ans: (Variable 2 ans [] Local () () Default (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i4: (Variable 2 i4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i8: (Variable 2 i8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), w4: (Variable 2 w4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), w8: (Variable 2 w8 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_03 [] [(Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 8524933037632333570 (Integer 8) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerUnaryMinus (IntegerConstant 1069250973542918798 (Integer 8) Decimal) (Integer 8) (IntegerConstant -1069250973542918798 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerUnaryMinus (IntegerConstant 5123867065024149335 (Integer 8) Decimal) (Integer 8) (IntegerConstant -5123867065024149335 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 7303655603304982073 (Integer 8) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 ans) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 8) ColMajor () ) (IntegerConstant 5108441843522503546 (Integer 8) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 ans)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 w8) (ComplexConstructor (RealConstant 7.700000 (Real 8) ) (RealConstant 5.000000 (Real 8) ) (Complex 8) (ComplexConstant 7.700000 5.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 i4) (Cast (Var 2 w8) ComplexToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 i8) (Cast (Var 2 w8) ComplexToInteger (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i4) (Var 2 i8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i4) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i8) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 7 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 w4) (ComplexConstructor (RealConstant 7.700000 (Real 4) ) (RealConstant 5.000000 (Real 4) ) (Complex 4) (ComplexConstant 7.700000 5.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 i4) (Cast (Var 2 w4) ComplexToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 i8) (Cast (Var 2 w4) ComplexToInteger (Integer 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i4) (Var 2 i8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i4) NotEq (IntegerConstant 7 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i8) NotEq (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 7 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_39-89c7d0d.json0000664000175000017500000000075015141516316025456 0ustar alastairalastair{ "basename": "asr-modules_39-89c7d0d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_39.f90", "infile_hash": "f7ccaf8b5a3d38f726e5e5ea8fbd529c12fe8f7ce34e85944c882db7", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_39-89c7d0d.stdout", "stdout_hash": "5a1a92646a32c2d1b4f78f95eefdf1fce92aba9150f3c86b93040052", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_op_simplifier_test-ba92920.stdout0000664000175000017500000002011215141516316031042 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Allocate [((Var 2 d) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 d) (RealBinOp (RealBinOp (Var 2 a) Add (Var 2 b) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) Add (ArrayBroadcast (Var 2 c) (ArrayConstant 8 [5, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-pragma2-dd5bd9b.stdout0000664000175000017500000000122215141516316025525 0ustar alastairalastair(TranslationUnit [(Program pragma2 () [] [] [(DeclarationPragma LFortranPragma "attributes simd :: A" () ) (Declaration (AttrType TypeReal [] () () None ) [] [(A [(1 8 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 A 1 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-loop_test-5d89970.stderr0000664000175000017500000000021215141516316025675 0ustar alastairalastairsemantic error: Assignment to loop variable `i` is not allowed --> tests/errors/loop_test.f90:4:8 | 4 | i = i + 1 | ^ lfortran-lfortran-2f73434/tests/reference/asr-subroutines_09-83ddd2b.stdout0000664000175000017500000005700415141516316027012 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { a: (Variable 5 a [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 5 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), get_elem_table@get_value: (ExternalSymbol 5 get_elem_table@get_value 2 get_elem_table subroutines_09_tomlf_build_array [] get_elem_table Public ), get_elem_value_string@get_value: (ExternalSymbol 5 get_elem_value_string@get_value 2 get_elem_value_string subroutines_09_tomlf_build_array [] get_elem_value_string Public ), get_value: (ExternalSymbol 5 get_value 2 get_value subroutines_09_tomlf_build_array [] get_value Public ), get_value@get_elem_table: (ExternalSymbol 5 get_value@get_elem_table 2 get_elem_table subroutines_09_tomlf_build_array [] get_elem_table Private ), get_value@get_elem_value_string: (ExternalSymbol 5 get_value@get_elem_value_string 2 get_elem_value_string subroutines_09_tomlf_build_array [] get_elem_value_string Private ), pos: (Variable 5 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 5 ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [subroutines_09_tomlf_build_array] [(SubroutineCall 5 get_value@get_elem_table 5 get_value [((Var 5 a)) ((Var 5 pos)) ((Var 5 ptr)) ((Var 5 f))] () .false. ) (SubroutineCall 5 get_value@get_elem_value_string 5 get_value [((Var 5 f)) ((Var 5 pos)) ((Var 5 ptr)) (()) ((Var 5 f))] () .false. )] ), subroutines_09_tomlf_build_array: (Module (SymbolTable 2 { get_elem_table: (Function (SymbolTable 3 { array: (Variable 3 array [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pos: (Variable 3 pos [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ptr: (Variable 3 ptr [] Out () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), stat: (Variable 3 stat [] Out () () Default (Logical 4) () Source Private Optional .false. .false. .false. () .false. .false. ) }) get_elem_table (FunctionType [(Integer 4) (Integer 4) (Pointer (Integer 4) ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 array) (Var 3 pos) (Var 3 ptr) (Var 3 stat)] [(Nullify [(Var 3 ptr)] ) (Assignment (Var 3 stat) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Private .false. .false. () ), get_elem_value_string: (Function (SymbolTable 4 { array: (Variable 4 array [] InOut () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), def: (Variable 4 def [] Out () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), pos: (Variable 4 pos [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ptr: (Variable 4 ptr [] Out () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), stat: (Variable 4 stat [] Out () () Default (Logical 4) () Source Private Optional .false. .false. .false. () .false. .false. ) }) get_elem_value_string (FunctionType [(Logical 4) (Integer 4) (Pointer (Integer 4) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 array) (Var 4 pos) (Var 4 ptr) (Var 4 def) (Var 4 stat)] [(Nullify [(Var 4 ptr)] ) (Assignment (Var 4 stat) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Private .false. .false. () ), get_value: (GenericProcedure 2 get_value [2 get_elem_table 2 get_elem_value_string] Public ) }) subroutines_09_tomlf_build_array () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-string-0f0b404.json0000664000175000017500000000072215141516316025355 0ustar alastairalastair{ "basename": "ast_f90-string-0f0b404", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/string.f90", "infile_hash": "427cf41e07ff6d1217b77bfd2d033fbd8447ad0a4358727fdac3264d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-string-0f0b404.stdout", "stdout_hash": "d39423f35652c86c3df032820a4219f60d161614cd39e8eaa48a4b6b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-interface_01-b750ffe.json0000664000175000017500000000077115141516316026472 0ustar alastairalastair{ "basename": "ast_f90-interface_01-b750ffe", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-interface_01-b750ffe.stdout", "stdout_hash": "4d0222747e3813824dcd952e71a74279b38a6a0c576406f624e11190", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-assign-262a444.json0000664000175000017500000000070715141516316024607 0ustar alastairalastair{ "basename": "ast-assign-262a444", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/assign.f90", "infile_hash": "67fee149907196a73ab4db43412dfbf29304c02aa5f1ce2da476423e", "outfile": null, "outfile_hash": null, "stdout": "ast-assign-262a444.stdout", "stdout_hash": "7834f54e99990470c7a931169941a9378eba8a918ffe30f18a5bab50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-while_01-3496096.json0000664000175000017500000000074515141516316025056 0ustar alastairalastair{ "basename": "llvm-while_01-3496096", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/while_01.f90", "infile_hash": "41dfb6c31552489d495806f20788fe3012284c0d6afbbc686d400c42", "outfile": null, "outfile_hash": null, "stdout": "llvm-while_01-3496096.stdout", "stdout_hash": "78a37b2597d9198521a328ad0b27d6aeb5098fe2181ecce5ea95ce8f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_15b-09f8335.stdout0000664000175000017500000075057715141516316026045 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), modules_15b: (Module (SymbolTable 2 { c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public ), c_double_complex: (ExternalSymbol 2 c_double_complex 4 c_double_complex lfortran_intrinsic_iso_c_binding [] c_double_complex Public ), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public ), c_float_complex: (ExternalSymbol 2 c_float_complex 4 c_float_complex lfortran_intrinsic_iso_c_binding [] c_float_complex Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_int32_t: (ExternalSymbol 2 c_int32_t 4 c_int32_t lfortran_intrinsic_iso_c_binding [] c_int32_t Public ), c_int64_t: (ExternalSymbol 2 c_int64_t 4 c_int64_t lfortran_intrinsic_iso_c_binding [] c_int64_t Public ), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public ), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public ), call_fortran_f32: (Function (SymbolTable 49 { i: (Variable 49 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 49 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_f32 (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 49 i)] [] (Var 49 r) Public .false. .false. () ), call_fortran_f32_value: (Function (SymbolTable 50 { i: (Variable 50 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 50 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_f32_value (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 50 i)] [] (Var 50 r) Public .false. .false. () ), call_fortran_f64: (Function (SymbolTable 51 { i: (Variable 51 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 51 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_f64 (FunctionType [(Real 8)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 51 i)] [] (Var 51 r) Public .false. .false. () ), call_fortran_f64_value: (Function (SymbolTable 52 { i: (Variable 52 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 52 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_f64_value (FunctionType [(Real 8)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 52 i)] [] (Var 52 r) Public .false. .false. () ), call_fortran_i32: (Function (SymbolTable 43 { i: (Variable 43 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 43 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i32 (FunctionType [(Integer 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 43 i)] [] (Var 43 r) Public .false. .false. () ), call_fortran_i32_value: (Function (SymbolTable 44 { i: (Variable 44 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 44 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i32_value (FunctionType [(Integer 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 44 i)] [] (Var 44 r) Public .false. .false. () ), call_fortran_i32_value2: (Function (SymbolTable 45 { i: (Variable 45 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 45 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i32_value2 (FunctionType [(Integer 4)] (Integer 4) BindC Interface "call_fortran_i32_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 45 i)] [] (Var 45 r) Public .false. .false. () ), call_fortran_i64: (Function (SymbolTable 46 { i: (Variable 46 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 46 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i64 (FunctionType [(Integer 8)] (Integer 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 46 i)] [] (Var 46 r) Public .false. .false. () ), call_fortran_i64_value: (Function (SymbolTable 47 { i: (Variable 47 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 47 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i64_value (FunctionType [(Integer 8)] (Integer 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 47 i)] [] (Var 47 r) Public .false. .false. () ), call_fortran_i64_value2: (Function (SymbolTable 48 { i: (Variable 48 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 48 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) call_fortran_i64_value2 (FunctionType [(Integer 8)] (Integer 8) BindC Interface "call_fortran_i64_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 48 i)] [] (Var 48 r) Public .false. .false. () ), f_double_complex_value_return: (Function (SymbolTable 20 { b: (Variable 20 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 20 r [] ReturnVar () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_double_complex_value_return (FunctionType [(Complex 8)] (Complex 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 b)] [] (Var 20 r) Public .false. .false. () ), f_float_complex_value_return: (Function (SymbolTable 19 { b: (Variable 19 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 19 r [] ReturnVar () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_float_complex_value_return (FunctionType [(Complex 4)] (Complex 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 b)] [] (Var 19 r) Public .false. .false. () ), f_int_double: (Function (SymbolTable 12 { a: (Variable 12 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 12 b [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 12 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 a) (Var 12 b)] [] (Var 12 r) Public .false. .false. () ), f_int_double_complex: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 14 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 14 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double_complex (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 a) (Var 14 b)] [] (Var 14 r) Public .false. .false. () ), f_int_double_complex2: (Function (SymbolTable 16 { a: (Variable 16 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 16 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 16 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double_complex2 (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface "f_int_double_complex" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 a) (Var 16 b)] [] (Var 16 r) Public .false. .false. () ), f_int_double_complex_value: (Function (SymbolTable 18 { a: (Variable 18 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 18 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 18 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double_complex_value (FunctionType [(Integer 4) (Complex 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 a) (Var 18 b)] [] (Var 18 r) Public .false. .false. () ), f_int_double_value: (Function (SymbolTable 22 { a: (Variable 22 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 22 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 22 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double_value (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 a) (Var 22 b)] [] (Var 22 r) Public .false. .false. () ), f_int_double_value_name: (Function (SymbolTable 29 { a: (Variable 29 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 29 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 29 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_double_value_name (FunctionType [(Integer 4) (Real 8)] (Integer 4) BindC Interface "f_int_double_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 a) (Var 29 b)] [] (Var 29 r) Public .false. .false. () ), f_int_doublearray: (Function (SymbolTable 25 { b: (Variable 25 b [n] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 25 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 25 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 25 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_doublearray (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 n) (Var 25 b)] [] (Var 25 r) Public .false. .false. () ), f_int_doublearray_star: (Function (SymbolTable 28 { b: (Variable 28 b [] In () () Default (Array (Real 8) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 28 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 28 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_doublearray_star (FunctionType [(Integer 4) (Array (Real 8) [(() ())] PointerArray )] (Real 8) BindC Interface "f_int_doublearray" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 n) (Var 28 b)] [] (Var 28 r) Public .false. .false. () ), f_int_float: (Function (SymbolTable 11 { a: (Variable 11 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 11 b [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 11 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_float (FunctionType [(Integer 4) (Real 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 a) (Var 11 b)] [] (Var 11 r) Public .false. .false. () ), f_int_float_complex: (Function (SymbolTable 13 { a: (Variable 13 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 13 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 13 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_float_complex (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 a) (Var 13 b)] [] (Var 13 r) Public .false. .false. () ), f_int_float_complex2: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 15 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 15 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_float_complex2 (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface "f_int_float_complex" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 a) (Var 15 b)] [] (Var 15 r) Public .false. .false. () ), f_int_float_complex_value: (Function (SymbolTable 17 { a: (Variable 17 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 17 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 17 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_float_complex_value (FunctionType [(Integer 4) (Complex 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 a) (Var 17 b)] [] (Var 17 r) Public .false. .false. () ), f_int_float_value: (Function (SymbolTable 21 { a: (Variable 21 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 21 b [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 21 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_float_value (FunctionType [(Integer 4) (Real 4)] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 a) (Var 21 b)] [] (Var 21 r) Public .false. .false. () ), f_int_floatarray: (Function (SymbolTable 24 { b: (Variable 24 b [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 24 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 24 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 24 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_floatarray (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 n) (Var 24 b)] [] (Var 24 r) Public .false. .false. () ), f_int_floatarray_star: (Function (SymbolTable 27 { b: (Variable 27 b [] In () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 27 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 27 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_floatarray_star (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 27 n) (Var 27 b)] [] (Var 27 r) Public .false. .false. () ), f_int_intarray: (Function (SymbolTable 23 { b: (Variable 23 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 23 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 23 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 23 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_intarray (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] (Integer 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 n) (Var 23 b)] [] (Var 23 r) Public .false. .false. () ), f_int_intarray_star: (Function (SymbolTable 26 { b: (Variable 26 b [] In () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 26 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 26 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_int_intarray_star (FunctionType [(Integer 4) (Array (Integer 4) [(() ())] PointerArray )] (Integer 4) BindC Interface "f_int_intarray" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 n) (Var 26 b)] [] (Var 26 r) Public .false. .false. () ), f_string: (Function (SymbolTable 53 { r: (Variable 53 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 53 s [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string0] [(Var 53 s)] [(Assignment (Var 53 r) (FunctionCall 2 f_string0 () [((StringPhysicalCast (IntrinsicElementalFunction StringConcat [(Var 53 s) (Var 2 c_null_char)] 0 (String 1 () DeferredLength DescriptorString) () ) DescriptorString CChar (String 1 () ImplicitLength CChar) () ))] (Integer 4) () () ) () .false. .false. )] (Var 53 r) Public .false. .false. () ), f_string0: (Function (SymbolTable 42 { r: (Variable 42 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), s: (Variable 42 s [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f_string0 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar)] (Integer 4) BindC Interface "f_string" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 42 s)] [] (Var 42 r) Public .false. .false. () ), fortran_f32: (Function (SymbolTable 58 { i: (Variable 58 i [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 58 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_f32 (FunctionType [(Real 4)] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 58 i)] [(Assignment (Var 58 r) (RealBinOp (Var 58 i) Add (RealConstant 2.300000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 58 r) Public .false. .false. () ), fortran_f32_value: (Function (SymbolTable 59 { i: (Variable 59 i [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 59 r [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_f32_value (FunctionType [(Real 4)] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 59 i)] [(Assignment (Var 59 r) (RealBinOp (Var 59 i) Add (RealConstant 2.300000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 59 r) Public .false. .false. () ), fortran_f64: (Function (SymbolTable 60 { i: (Variable 60 i [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 60 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_f64 (FunctionType [(Real 8)] (Real 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 60 i)] [(Assignment (Var 60 r) (RealBinOp (Var 60 i) Add (RealConstant 2.300000 (Real 8) ) (Real 8) () ) () .false. .false. )] (Var 60 r) Public .false. .false. () ), fortran_f64_value: (Function (SymbolTable 61 { i: (Variable 61 i [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 61 r [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_f64_value (FunctionType [(Real 8)] (Real 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 61 i)] [(Assignment (Var 61 r) (RealBinOp (Var 61 i) Add (RealConstant 2.300000 (Real 8) ) (Real 8) () ) () .false. .false. )] (Var 61 r) Public .false. .false. () ), fortran_i32: (Function (SymbolTable 54 { i: (Variable 54 i [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 54 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_i32 (FunctionType [(Integer 4)] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 54 i)] [(Assignment (Var 54 r) (IntegerBinOp (Var 54 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 54 r) Public .false. .false. () ), fortran_i32_value: (Function (SymbolTable 55 { i: (Variable 55 i [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 55 r [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_i32_value (FunctionType [(Integer 4)] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 55 i)] [(Assignment (Var 55 r) (IntegerBinOp (Var 55 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 55 r) Public .false. .false. () ), fortran_i64: (Function (SymbolTable 56 { i: (Variable 56 i [] In () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 56 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_i64 (FunctionType [(Integer 8)] (Integer 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 56 i)] [(Assignment (Var 56 r) (IntegerBinOp (Var 56 i) Add (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) ) (Integer 8) () ) () .false. .false. )] (Var 56 r) Public .false. .false. () ), fortran_i64_value: (Function (SymbolTable 57 { i: (Variable 57 i [] In () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 57 r [] ReturnVar () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fortran_i64_value (FunctionType [(Integer 8)] (Integer 8) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 57 i)] [(Assignment (Var 57 r) (IntegerBinOp (Var 57 i) Add (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) ) (Integer 8) () ) () .false. .false. )] (Var 57 r) Public .false. .false. () ), sub_int_double: (Function (SymbolTable 31 { a: (Variable 31 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 31 b [] In () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 31 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_double (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 31 a) (Var 31 b) (Var 31 r)] [] () Public .false. .false. () ), sub_int_double_complex: (Function (SymbolTable 33 { a: (Variable 33 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 33 b [] In () () Default (Complex 8) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 33 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_double_complex (FunctionType [(Integer 4) (Complex 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 33 a) (Var 33 b) (Var 33 r)] [] () Public .false. .false. () ), sub_int_double_complex_value: (Function (SymbolTable 37 { a: (Variable 37 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 37 b [] In () () Default (Complex 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 37 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_double_complex_value (FunctionType [(Integer 4) (Complex 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 a) (Var 37 b) (Var 37 r)] [] () Public .false. .false. () ), sub_int_double_value: (Function (SymbolTable 35 { a: (Variable 35 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 35 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 35 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_double_value (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 35 a) (Var 35 b) (Var 35 r)] [] () Public .false. .false. () ), sub_int_double_value_name: (Function (SymbolTable 41 { a: (Variable 41 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 41 b [] In () () Default (Real 8) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 41 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_double_value_name (FunctionType [(Integer 4) (Real 8) (Integer 4)] () BindC Interface "sub_int_double_value" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 a) (Var 41 b) (Var 41 r)] [] () Public .false. .false. () ), sub_int_doublearray: (Function (SymbolTable 40 { b: (Variable 40 b [n] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 40 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 40 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 40 r [] Out () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_doublearray (FunctionType [(Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 40 n) (Var 40 b) (Var 40 r)] [] () Public .false. .false. () ), sub_int_float: (Function (SymbolTable 30 { a: (Variable 30 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 30 b [] In () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 30 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_float (FunctionType [(Integer 4) (Real 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 a) (Var 30 b) (Var 30 r)] [] () Public .false. .false. () ), sub_int_float_complex: (Function (SymbolTable 32 { a: (Variable 32 a [] In () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 32 b [] In () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), r: (Variable 32 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_float_complex (FunctionType [(Integer 4) (Complex 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 a) (Var 32 b) (Var 32 r)] [] () Public .false. .false. () ), sub_int_float_complex_value: (Function (SymbolTable 36 { a: (Variable 36 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 36 b [] In () () Default (Complex 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 36 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_float_complex_value (FunctionType [(Integer 4) (Complex 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 36 a) (Var 36 b) (Var 36 r)] [] () Public .false. .false. () ), sub_int_float_value: (Function (SymbolTable 34 { a: (Variable 34 a [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), b: (Variable 34 b [] In () () Default (Real 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 34 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_float_value (FunctionType [(Integer 4) (Real 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 a) (Var 34 b) (Var 34 r)] [] () Public .false. .false. () ), sub_int_floatarray: (Function (SymbolTable 39 { b: (Variable 39 b [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 39 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 39 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 39 r [] Out () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_floatarray (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Real 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 39 n) (Var 39 b) (Var 39 r)] [] () Public .false. .false. () ), sub_int_intarray: (Function (SymbolTable 38 { b: (Variable 38 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 38 n))] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), n: (Variable 38 n [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), r: (Variable 38 r [] Out () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub_int_intarray (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 n) (Var 38 b) (Var 38 r)] [] () Public .false. .false. () ) }) modules_15b () [iso_c_binding modules_15b] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutine7-58db221.stdout0000664000175000017500000000700315141516316026235 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b)] [(Assignment (Var 2 a) (IntegerBinOp (Var 2 b) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 b) (IntegerBinOp (Var 2 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_01_pack-6c829d9.stdout0000664000175000017500000002644315141516316026415 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_01_pack: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 2 s [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_01_pack [] [(Assignment (Var 2 m) (ArrayConstant 24 [1, 0, 0, 0, 5, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 p) (IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 s) (IntrinsicArrayFunction Shape [(IntrinsicArrayFunction Pack [(ArrayPhysicalCast (Var 2 m) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (IntegerCompare (Var 2 m) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] DescriptorArray ) () )] 2 (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 s) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 s) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutines_01-6bd865a.json0000664000175000017500000000075515141516316026676 0ustar alastairalastair{ "basename": "julia-subroutines_01-6bd865a", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_01-6bd865a.stdout", "stdout_hash": "1a10bfdbcc05571c7b053af46aa127b516726d5ebc056e1bddb222fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-class_procedure_extra_args-543ebdc.stderr0000664000175000017500000000035315141516316031467 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/class_procedure_extra_args.f90:30:33 | 30 | call myCircle%calculateArea(circleArea, 12) | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-implicit9-b56b139.stdout0000664000175000017500000005352715141516316025672 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 d) (Var 2 e)] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-while_02-3db2b04.stdout0000664000175000017500000002024115141516316025615 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = icmp slt i32 %2, 10 br i1 %3, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %4 = load i32, i32* %i, align 4 %5 = add i32 %4, 1 store i32 %5, i32* %i, align 4 %6 = load i32, i32* %j, align 4 %7 = load i32, i32* %i, align 4 %8 = add i32 %6, %7 store i32 %8, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %9 = load i32, i32* %j, align 4 %10 = icmp ne i32 %9, 55 br i1 %10, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %11 = load i32, i32* %i, align 4 %12 = icmp ne i32 %11, 10 br i1 %12, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head4 loop.head4: ; preds = %ifcont8, %ifcont3 %13 = load i32, i32* %i, align 4 %14 = icmp slt i32 %13, 10 br i1 %14, label %loop.body5, label %loop.end9 loop.body5: ; preds = %loop.head4 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 1 store i32 %16, i32* %i, align 4 %17 = load i32, i32* %i, align 4 %18 = icmp eq i32 %17, 2 br i1 %18, label %then6, label %else7 then6: ; preds = %loop.body5 br label %loop.end9 unreachable_after_exit: ; No predecessors! br label %ifcont8 else7: ; preds = %loop.body5 br label %ifcont8 ifcont8: ; preds = %else7, %unreachable_after_exit %19 = load i32, i32* %j, align 4 %20 = load i32, i32* %i, align 4 %21 = add i32 %19, %20 store i32 %21, i32* %j, align 4 br label %loop.head4 loop.end9: ; preds = %then6, %loop.head4 %22 = load i32, i32* %j, align 4 %23 = icmp ne i32 %22, 1 br i1 %23, label %then10, label %else11 then10: ; preds = %loop.end9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %loop.end9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %24 = load i32, i32* %i, align 4 %25 = icmp ne i32 %24, 2 br i1 %25, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 0, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head16 loop.head16: ; preds = %ifcont20, %then18, %ifcont15 %26 = load i32, i32* %i, align 4 %27 = icmp slt i32 %26, 10 br i1 %27, label %loop.body17, label %loop.end21 loop.body17: ; preds = %loop.head16 %28 = load i32, i32* %i, align 4 %29 = add i32 %28, 1 store i32 %29, i32* %i, align 4 %30 = load i32, i32* %i, align 4 %31 = icmp eq i32 %30, 2 br i1 %31, label %then18, label %else19 then18: ; preds = %loop.body17 br label %loop.head16 unreachable_after_cycle: ; No predecessors! br label %ifcont20 else19: ; preds = %loop.body17 br label %ifcont20 ifcont20: ; preds = %else19, %unreachable_after_cycle %32 = load i32, i32* %j, align 4 %33 = load i32, i32* %i, align 4 %34 = add i32 %32, %33 store i32 %34, i32* %j, align 4 br label %loop.head16 loop.end21: ; preds = %loop.head16 %35 = load i32, i32* %j, align 4 %36 = icmp ne i32 %35, 53 br i1 %36, label %then22, label %else23 then22: ; preds = %loop.end21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %loop.end21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %37 = load i32, i32* %i, align 4 %38 = icmp ne i32 %37, 10 br i1 %38, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont27 br label %FINALIZE_SYMTABLE_while_02 FINALIZE_SYMTABLE_while_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_10-cfca9b9.json0000664000175000017500000000076115141516316026320 0ustar alastairalastair{ "basename": "asr-intrinsics_10-cfca9b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_10.f90", "infile_hash": "574d28f0c6b85cf1bd1263ef8530e069cbe07753791f9e8bec6d939e", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_10-cfca9b9.stdout", "stdout_hash": "a0d6fe8b766f984784ba360a15f74ea46f31cf4913e6f4c5ada8e479", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce2-81246e2.stdout0000664000175000017500000000034515141516316030632 0ustar alastairalastairsubroutine sum_reduce(a, s, t) real, intent(in) :: a(:) real, intent(out) :: s, t integer :: N, i N = size(a) s = 0 t = 0 do concurrent (i = 1:N) reduce(+: s, t) s = s + a(i) t = t + a(i) end do end subroutine sum_reduce lfortran-lfortran-2f73434/tests/reference/asr-block_03-6c8fdd8.json0000664000175000017500000000074215141516316025154 0ustar alastairalastair{ "basename": "asr-block_03-6c8fdd8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_03.f90", "infile_hash": "3271e019be3575ad1c8280a5b50d7fccb0534f39241680ad66e6bc50", "outfile": null, "outfile_hash": null, "stdout": "asr-block_03-6c8fdd8.stdout", "stdout_hash": "2ae6e2dab3ba4f40e246f5194acc96bc789504742845c1fb2e1b69c3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_23-fdedfdb.json0000664000175000017500000000071515141516316025603 0ustar alastairalastair{ "basename": "run-format_23-fdedfdb", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_23.f90", "infile_hash": "ed10c322714afdc86cceeb03cfb60fce8c15d3b5e9c03df061e2ca56", "outfile": null, "outfile_hash": null, "stdout": "run-format_23-fdedfdb.stdout", "stdout_hash": "4a8f73290e4f60373242bec2b4360d8b5406de116f313eae712b6a57", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array6-fe9aa62.stdout0000664000175000017500000000626515141516316025334 0ustar alastairalastair(TranslationUnit [(Program array6 () [] [(ImplicitNone [] () )] [] [] [(Subroutine t [(n) (a) (b) (c) (d) (e)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a [(() () DimensionStar)] [] () () None ()) (b [(3 () DimensionStar)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 n DimensionExpr) (() () DimensionStar)] )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 n DimensionExpr) (4 () DimensionStar)] )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(e [(n () DimensionStar)] [] () () None ())] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast-loop_test2-c76adc4.stdout0000664000175000017500000002443215141516316026214 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(nq [] [] () () None ()) (m [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(wrk5 [(1 5 DimensionExpr)] [] () () None ()) (v [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(ve [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 5 DimensionExpr)] [] () () None ()) (vev [(1 3 DimensionExpr) (1 4 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(zero [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(l1 [] [] () () None ()) (j [] [] () () None ()) (l2 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(indx [] [] () () None ())] () )] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(Assignment 0 (FuncCallOrArray wrk5 [] [(() j () 0)] [] [] [] ) (FuncCallOrArray v [] [(() indx () 0) (() j () 0) (() l1 () 0)] [] [] [] ) () ) (Continue 110 () )] () () ) (DoLoop 0 () 120 j 1 m () [(Assignment 0 (FuncCallOrArray ve [] [(() indx () 0) (() l1 () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray wrk5 [] [(() j () 0)] [] [] [] ) () ) (Continue 120 () )] () () ) (Continue 140 () )] () () ) (Assignment 0 indx 1 () ) (Assignment 0 zero (Real "0.0d00") () ) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(Assignment 0 (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) zero () ) (DoLoop 0 () 210 j 1 m () [(Assignment 0 (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) (+ (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) (* (FuncCallOrArray ve [] [(() indx () 0) (() l1 () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray ve [] [(() indx () 0) (() l2 () 0) (() j () 0)] [] [] [] ))) () ) (Continue 210 () )] () () ) (Assignment 0 (FuncCallOrArray vev [] [(() l2 () 0) (() l1 () 0)] [] [] [] ) (FuncCallOrArray vev [] [(() l1 () 0) (() l2 () 0)] [] [] [] ) () ) (Continue 220 () )] () () ) (Continue 230 () )] () () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-logical3-b6316c6.stderr0000664000175000017500000000047715141516316025440 0ustar alastairalastairwarning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-lfortran-2f73434/tests/reference/c-doloop_08-2839ed5.stdout0000664000175000017500000000070015141516316025220 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t i; i = 1; while (true) { i = i + 1; if (i == 10) { break; } } if (i != 10) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-lfortran-2f73434/tests/reference/ast-array1-cceb5f3.json0000664000175000017500000000070715141516316025026 0ustar alastairalastair{ "basename": "ast-array1-cceb5f3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array1.f90", "infile_hash": "74ef23b0c6d49a710e5035ce53fa6899eb51ef5e5b693d15108744ca", "outfile": null, "outfile_hash": null, "stdout": "ast-array1-cceb5f3.stdout", "stdout_hash": "a9e4c3789a95cba14597a7b259d2e3edb7d8d63a7e22aad75e33e50f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external5-1198a6f.stdout0000664000175000017500000000604015141516316025666 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { ddet_c: (Function (SymbolTable 2 { }) ddet_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), ddet_r: (Function (SymbolTable 3 { ddet_c: (Function (SymbolTable 4 { }) ddet_c (FunctionType [] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) ddet_r (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-associate_02-ca5c9ec.stdout0000664000175000017500000003250615141516316026456 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_02: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), p2: (Variable 2 p2 [] Local () () Default (Pointer (Real 8) ) () Source Public Required .false. .false. .false. () .false. .false. ), p3: (Variable 2 p3 [] Local () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ), t2: (Variable 2 t2 [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .true. .false. () .false. .false. ), t3: (Variable 2 t3 [] Local (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 3.000000 (Complex 4) ) ) (ComplexConstant 2.000000 3.000000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .true. .false. () .false. .false. ) }) associate_02 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Associate (Var 2 p2) (Var 2 t2) ) (Associate (Var 2 p3) (Var 2 t3) ) (Assignment (Var 2 p1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 p2) (Cast (RealConstant 4.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 4.000000 (Real 8) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 t1) (Cast (RealBinOp (Var 2 p2) Add (Cast (Var 2 p1) IntegerToReal (Real 8) () ) (Pointer (Real 8) ) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 t1) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 p3) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Mul (Var 2 p3) (Pointer (Complex 4) ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 p3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 t3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-program1-17e5471.json0000664000175000017500000000071515141516316025057 0ustar alastairalastair{ "basename": "asr-program1-17e5471", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "asr-program1-17e5471.stdout", "stdout_hash": "7fb5b132c673c34395fb6a46a1125c1e63d1a1486f0a74c4f104c072", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_05-f939cc6.stdout0000664000175000017500000002323115141516316026023 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), print_vars: (Variable 3 print_vars [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_vars (FunctionType [(Real 4) (Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 print_vars) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 3 print_vars) Private .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-data_14-f20fec7.json0000664000175000017500000000073715141516316024771 0ustar alastairalastair{ "basename": "ast-data_14-f20fec7", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_14.f90", "infile_hash": "4e987e678805662bd06e097ae563cdf8ca232328721a0a707bf3557b", "outfile": null, "outfile_hash": null, "stdout": "ast-data_14-f20fec7.stdout", "stdout_hash": "677d4c10432f6b2e66b12eec93e4f1c9e0a61600d27237231a76a962", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-critical1-30285fa.json0000664000175000017500000000073315141516316025735 0ustar alastairalastair{ "basename": "ast_f90-critical1-30285fa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/critical1.f90", "infile_hash": "05948a8c6d4476986b19c2be2d0c40a9ebb19a2007eac02159ab9496", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-critical1-30285fa.stdout", "stdout_hash": "48974f54bfd4d0b18c37d27908777347b95b5905a24bb8b04ae0aaa9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-parsing_01-c9b84fe.json0000664000175000017500000000075015141516316025522 0ustar alastairalastair{ "basename": "ast-parsing_01-c9b84fe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parsing_01.f90", "infile_hash": "def9551071d9aa0cfd8163560e96b69ad76bc67a9830f2531e6752a5", "outfile": null, "outfile_hash": null, "stdout": "ast-parsing_01-c9b84fe.stdout", "stdout_hash": "b4ea95da6854b7d12c06c8db17b4118ca84b5344a57ffb401305b1b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_02-386b648.json0000664000175000017500000000075215141516316025233 0ustar alastairalastair{ "basename": "ast_f90-case_02-386b648", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_02-386b648.stdout", "stdout_hash": "287601388e018816a37bd53d489512a90322f78a6e2c91eee795bd68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_nested-5858841.json0000664000175000017500000000076715141516316026444 0ustar alastairalastair{ "basename": "asr-template_nested-5858841", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_nested.f90", "infile_hash": "b575d8ddebeed199be34078f7dfa99b5995ec81d1e730014775e9f5c", "outfile": null, "outfile_hash": null, "stdout": "asr-template_nested-5858841.stdout", "stdout_hash": "e8b5105da74c6311173b2c69299b0dc14566f388a670b22f46a5ba9a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-generic_name_01-9f2fd25.json0000664000175000017500000000076715141516316026416 0ustar alastairalastair{ "basename": "asr-generic_name_01-9f2fd25", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/generic_name_01.f90", "infile_hash": "cf72bd4f491d240363b4f763c22fc7dbd88483b3a7e5303471f65b40", "outfile": null, "outfile_hash": null, "stdout": "asr-generic_name_01-9f2fd25.stdout", "stdout_hash": "14979cdd5da42cc80c7db94ce984e8fc2e0c8edb14186f32cbad4a52", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp8-edc2b52.stderr0000664000175000017500000000022615141516316027206 0ustar alastairalastairsemantic error: Variable 'abcx' is not declared --> tests/errors/cpp8.f90:12:12 | 12 | print *, abcx | ^^^^ 'abcx' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-parameter_01-ee9f18c.stderr0000664000175000017500000000035515141516316026370 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/parameter_01.f90:3:5 | 3 | i = 3 | ^^^^^ assignment here | 2 | integer, parameter :: i = 2 | ~~~~~ declared as constant lfortran-lfortran-2f73434/tests/reference/asr-variable1-8ec1519.json0000664000175000017500000000074515141516316025262 0ustar alastairalastair{ "basename": "asr-variable1-8ec1519", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/variable1.f90", "infile_hash": "3c85fb2081cc769c834a0275f205cd79f767550a1cfa6e14eee6d48b", "outfile": null, "outfile_hash": null, "stdout": "asr-variable1-8ec1519.stdout", "stdout_hash": "0862ffd0284e79b361a55451cc316f20d43db1e75dc6548ef90889c8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-func_parameter_type_02-cef1ab3.json0000664000175000017500000000106315141516316030150 0ustar alastairalastair{ "basename": "asr-func_parameter_type_02-cef1ab3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/func_parameter_type_02.f90", "infile_hash": "ed02fab8e69756cf65ecfb2f1861cf6fb9628838d09b3ce6875e0ffd", "outfile": null, "outfile_hash": null, "stdout": "asr-func_parameter_type_02-cef1ab3.stdout", "stdout_hash": "fac0f27024144b01889f59ac999b6b2115061d22ecc34dcd106898c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_08-23f422a.json0000664000175000017500000000075615141516316025721 0ustar alastairalastair{ "basename": "asr-functions_08-23f422a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_08.f90", "infile_hash": "625582953de25dfa6d54c1e44d22b6e19394212ca99c252ca13236e2", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_08-23f422a.stdout", "stdout_hash": "462fd0ada92923913fb30e7068c8ba3ac84df0df7bc625cd9196d8c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-submodule_01-2524ba9.stdout0000664000175000017500000004723215141516316026261 0ustar alastairalastair(TranslationUnit [(Module m1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(DerivedType Base [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine sub1 [(i) (b)] [(SimpleAttribute AttrModule )] () (TriviaNode [(EOLComment "! Module procedure interface body for sub1" )] [] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Module m2 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m1" ) (EndOfLine)] ) )] [] [(Interface (InterfaceHeader) () [(InterfaceProc (Function func1 [] [(AttrType TypeReal [] () () None ) (SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Module procedure interface body for func1" )] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) ) (InterfaceProc (Function func2 [(b)] [(SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Module procedure interface body for func2" )] [] ) [] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(func2 [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Module m4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m1" )] ) )] [] [(DerivedType NewType [] () [(AttrExtends Base )] [(Declaration (AttrType TypeReal [] () () None ) [] [(j [] [] () () None ())] () )] [] )] [] [] ) (Submodule m1 () m1sub (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m4 [] .false. (TriviaNode [] [(EOLComment "! Use association of module m4" ) (EndOfLine)] ) )] [] [] [] [(Subroutine sub1 [(i) (b)] [(SimpleAttribute AttrModule )] () (TriviaNode [(EOLComment "! Implementation of sub1 declared in m1" )] [] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [(Print 0 () [(String "sub1" ()) i b] () )] [] [] )] ) (Submodule m2 () m2sub (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Function func1 [] [(AttrType TypeReal [] () () None ) (SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Implementation of func1 declared in m2" )] [] ) [] [] [] [] [(Assignment 0 func1 20 () )] [] [] )] ) (Submodule m2 m2sub m2sub2 (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Function func2 [(b)] [(SimpleAttribute AttrModule )] () () (TriviaNode [(EOLComment "! Implementation of func2 declared in m2" )] [] ) [] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(func2 [] [] () () None ())] () )] [(Assignment 0 func2 b () )] [] [] )] ) (Module m3 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine interfaceSub1 [(i) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] m1 [] .false. () )] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [(AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function interfaceFunc1 [] [(AttrType TypeReal [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) ) (InterfaceProc (Function interfaceFunc2 [(b)] [] () () () [(Use [] m1 [] .false. () )] [] [] [(Declaration (AttrType TypeType [] () Base None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Base None ) [] [(interfaceFunc2 [] [] () () None ())] () )] [] [] [] ) )] ) (DerivedType Container [] () [] [(Declaration (AttrType TypeProcedure [] () interfaceSub1 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp1 [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () interfaceFunc1 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp2 [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () interfaceFunc2 None ) [(SimpleAttribute AttrNoPass ) (SimpleAttribute AttrPointer )] [(pp3 [] [] () () None ())] () )] [] )] [] [] ) (Program example () [(Use [] m1 [] .false. () ) (Use [] m2 [] .false. () ) (Use [] m3 [] .false. () )] [] [(Declaration (AttrType TypeType [] () Container None ) [] [(c1 [] [] () () None ())] () )] [(Associate 0 pp1 [(c1 [])] sub1 () ) (Associate 0 pp2 [(c1 [])] func1 () ) (Associate 0 pp3 [(c1 [])] func2 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 pp1 [(c1 [])] [(() 10 () 0) (() (FuncCallOrArray Base [] [(() 11 () 0)] [] [] [] ) () 0)] [] [] () ) (Print 0 () [(String "func1" ()) (FuncCallOrArray int [] [(() (FuncCallOrArray pp2 [(c1 [])] [] [] [] [] ) () 0)] [] [] [] )] () ) (Print 0 () [(String "func2" ()) (FuncCallOrArray pp3 [(c1 [])] [(() (FuncCallOrArray Base [] [(() 5 () 0)] [] [] [] ) () 0)] [] [] [] )] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-bits1-e91f9ad.stdout0000664000175000017500000000716515141516316025155 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits1: (Program (SymbolTable 2 { arr2: (Variable 2 arr2 [] Local (ArrayConstant 24 [1042890, 20, 30] (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 24 [1042890, 20, 30] (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bits1 [] [(Print (StringFormat () [(IntrinsicElementalFunction Ibits [(Var 2 arr2) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Array (Integer 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-end_submodule_name-68b3188.stderr0000664000175000017500000000040415141516316027511 0ustar alastairalastairsyntax error: End submodule name does not match submodule name --> tests/errors/end_submodule_name.f90:17:1 - 24:17 | 17 | submodule (mother) daughter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 24 | end submodule son | ...^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-close1-d682580.json0000664000175000017500000000070715141516316024523 0ustar alastairalastair{ "basename": "ast-close1-d682580", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/close1.f90", "infile_hash": "b6174b7e66a7b9dea6c59e0e40b1786dc0721bf2b248b292f3576c9c", "outfile": null, "outfile_hash": null, "stdout": "ast-close1-d682580.stdout", "stdout_hash": "df91f2f167a94a06284e0716e9ffb3c54cbc28b3ca4059cfb59ecbcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_open_close_read_write-a696eca.stdout0000664000175000017500000005236115141516316032725 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { open_close_read_write: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ), msg: (Variable 2 msg [] Local (StringConstant "Some error occured" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Some error occured" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ), u_ptr: (Variable 2 u_ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) open_close_read_write [] [(Associate (Var 2 u_ptr) (Var 2 u) ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Mul (RealConstant 0.100000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 y) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (IntrinsicElementalFunction Sin [(ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () )] 0 (Real 4) () ) Mul (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Sub (IntrinsicElementalFunction Cos [(RealBinOp (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Div (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] ) (FileOpen 0 (Var 2 u_ptr) (StringConstant "open_close_read_write_data.dat" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "replace" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileWrite 0 (Var 2 u) () () () [(StringFormat (StringConstant "(10F8.2)" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 y) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] [] ) (FileClose 0 (IntegerConstant 1 (Integer 4) Decimal) (Var 2 u) (Var 2 msg) (IntegerConstant 999 (Integer 4) Decimal) () ) (GoToTarget 999 999 ) (FileOpen 999 (IntegerConstant 2 (Integer 4) Decimal) (StringConstant "open_close_read_write_data.dat" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileRead 0 (IntegerConstant 2 (Integer 4) Decimal) () () () () () () () [(ArrayItem (Var 2 p) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 q) [(() (Var 2 i) ())] (Real 4) ColMajor () )] () .true. () () )] [] ) (FileClose 0 (IntegerConstant 2 (Integer 4) Decimal) () () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) ()) [(FileWrite 0 () () () () [(StringFormat () [(ArrayItem (Var 2 p) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 q) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_int-32727cf.stderr0000664000175000017500000000022615141516316030601 0ustar alastairalastairsemantic error: Kind 3 is not supported for Integer --> tests/errors/kind_invalid_int_of_int.f90:3:13 | 3 | integer(3) :: x | ^ lfortran-lfortran-2f73434/tests/reference/ast-global_scope1-dd9aaaa.stdout0000664000175000017500000000040615141516316026760 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] ) lfortran-lfortran-2f73434/tests/reference/wat-doloop_02-1ee6409.stdout0000664000175000017500000002277615141516316025576 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32 i32 i32) i32.const 0 local.set 3 i32.const 1 local.set 0 i32.const 10 local.set 1 local.get 0 i32.const 1 i32.sub local.set 2 loop local.get 2 i32.const 1 i32.add local.get 1 i32.le_s if local.get 2 i32.const 1 i32.add local.set 2 local.get 3 local.get 2 i32.add local.set 3 br 1 else end end local.get 3 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 0 i32.const 1 i32.const 1 i32.sub local.set 2 loop local.get 2 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 2 i32.const 1 i32.add local.set 2 i32.const 1 i32.const 1 i32.sub local.set 3 loop local.get 3 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 3 i32.const 1 i32.add local.set 3 local.get 0 local.get 2 i32.const 1 i32.sub i32.const 10 i32.mul i32.add local.get 3 i32.add local.set 0 br 1 else end end br 1 else end end local.get 0 i32.const 5050 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 0 i32.const 1 i32.const 1 i32.sub local.set 2 loop local.get 2 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 2 i32.const 1 i32.add local.set 2 i32.const 1 i32.const 1 i32.sub local.set 3 loop local.get 3 i32.const 1 i32.add local.get 2 i32.le_s if local.get 3 i32.const 1 i32.add local.set 3 local.get 0 local.get 3 i32.add local.set 0 br 1 else end end br 1 else end end local.get 0 i32.const 220 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/c_target_omp-openmp_70-377d35b.json0000664000175000017500000000076315141516316027075 0ustar alastairalastair{ "basename": "c_target_omp-openmp_70-377d35b", "cmd": "lfortran --show-c --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_70.f90", "infile_hash": "4373476b7ee3c1e7a9ebb78dac9ef920a5fdd07050ed2ed2315212d8", "outfile": null, "outfile_hash": null, "stdout": "c_target_omp-openmp_70-377d35b.stdout", "stdout_hash": "9815679304f7f44d1d55eeecdd5857d44d7cbb9f589a80064d1feb12", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-array_bound_1-6741f43.json0000664000175000017500000000076415141516316026246 0ustar alastairalastair{ "basename": "llvm-array_bound_1-6741f43", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/array_bound_1.f90", "infile_hash": "38d2c1d99ad714fdaa387541310a78f8d3c4d7e19e93ed67a2dcf677", "outfile": null, "outfile_hash": null, "stdout": "llvm-array_bound_1-6741f43.stdout", "stdout_hash": "90a56309cd671f6476ca24d84fbdc1bf198043a410e3331c977308cb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit3-7f279ac.stdout0000664000175000017500000001166715141516316030156 0ustar alastairalastair(TranslationUnit [(Function c0 [(a)] [(AttrType TypeCharacter [] () () None )] () () () [] [] [] [] [] [] [] ) (Function c1 [(a)] [(AttrType TypeCharacter [(() 1 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function c11 [(a)] [(AttrType TypeCharacter [(() 11 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function c111 [(a)] [(AttrType TypeCharacter [(() 111 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cstar [(a)] [(AttrType TypeCharacter [] () () DoubleAsterisk )] () () () [] [] [] [] [] [] [] ) (Function i0 [(a)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [] [] [] ) (Function i4 [(a)] [(AttrType TypeInteger [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function i8 [(a)] [(AttrType TypeInteger [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function r0 [(a)] [(AttrType TypeReal [] () () None )] () () () [] [] [] [] [] [] [] ) (Function r4 [(a)] [(AttrType TypeReal [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function r8 [(a)] [(AttrType TypeReal [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm0 [(a)] [(AttrType TypeComplex [] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm4 [(a)] [(AttrType TypeComplex [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function cm8 [(a)] [(AttrType TypeComplex [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function l0 [(a)] [(AttrType TypeLogical [] () () None )] () () () [] [] [] [] [] [] [] ) (Function l1 [(a)] [(AttrType TypeLogical [(() 1 Value)] () () None )] () () () [] [] [] [] [] [] [] ) (Function l4 [(a)] [(AttrType TypeLogical [(() 4 Value)] () () None )] () () () [] [] [] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-case_05-8f778ac.stdout0000664000175000017500000001313315141516316025267 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_05: (Program (SymbolTable 2 { grade: (Variable 2 grade [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) case_05 [] [(Select () (Var 2 grade) [(CaseStmt [(StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [] .false. ) (CaseStmt [(StringConstant "C" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Well done" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "D" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "You passed" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(StringConstant "F" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] [(Print (StringConstant "Better try again" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [(Print (StringConstant "Invalid grade" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_3-53e9045.json0000664000175000017500000000075315141516316025700 0ustar alastairalastair{ "basename": "ast-fixed_form_3-53e9045", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_form_3.f", "infile_hash": "a2a456bea34619c96c4b8edc022e348d99c1b2828cb9f9cc7a4acf88", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-fixed_form_3-53e9045.stderr", "stderr_hash": "49c5a9403c7acd642202b780df57f156dd41009fb11f215c9c420956", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope3-57006df.json0000664000175000017500000000073415141516316026122 0ustar alastairalastair{ "basename": "asr-global_scope3-57006df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope3-57006df.stdout", "stdout_hash": "04d03140556a1adb2428cd72eaa925723cf5e32847aefba395c5c4ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-submodule_02-9152b7b.stdout0000664000175000017500000012374215141516316026264 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), points: (Module (SymbolTable 7 { point: (Struct (SymbolTable 8 { x: (Variable 8 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point (StructType [(Real 4) (Real 4)] [] .true. .false. ) [] [x y] [] Source Public .false. .false. [] () () ), point_dist_func: (Function (SymbolTable 9 { a: (Variable 9 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 9 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. ), distance: (Variable 9 distance [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point_dist_func (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. )] (Real 4) Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 9 a) (Var 9 b)] [] (Var 9 distance) Public .false. .false. () ), point_dist_subrout: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 10 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 7 point Source Public Required .false. .false. .false. () .false. .false. ), distance: (Variable 10 distance [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point_dist_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. ) (Real 4)] () Source Interface () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 10 a) (Var 10 b) (Var 10 distance)] [] () Public .false. .false. () ), rkind: (ExternalSymbol 7 rkind 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) points () [stdlib_kinds_submodule_02] .false. .false. .true. ), points_a: (Module (SymbolTable 11 { point: (ExternalSymbol 11 point 7 point points [] point Public ), point_dist_func: (Function (SymbolTable 12 { 1_point_x: (ExternalSymbol 12 1_point_x 8 x point [] x Public ), 1_point_y: (ExternalSymbol 12 1_point_y 8 y point [] y Public ), a: (Variable 12 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 12 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. ), distance: (Variable 12 distance [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point_dist_func (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 12 a) (Var 12 b)] [(Assignment (Var 12 distance) (IntrinsicElementalFunction Sqrt [(RealBinOp (RealBinOp (RealBinOp (StructInstanceMember (Var 12 a) 12 1_point_x (Real 4) () ) Sub (StructInstanceMember (Var 12 b) 12 1_point_x (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (RealBinOp (RealBinOp (StructInstanceMember (Var 12 a) 12 1_point_y (Real 4) () ) Sub (StructInstanceMember (Var 12 b) 12 1_point_y (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) () .false. .false. )] (Var 12 distance) Public .false. .false. () ), point_dist_subrout: (Function (SymbolTable 13 { 1_point_x: (ExternalSymbol 13 1_point_x 8 x point [] x Public ), 1_point_y: (ExternalSymbol 13 1_point_y 8 y point [] y Public ), a: (Variable 13 a [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 13 b [] In () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 11 point Source Public Required .false. .false. .false. () .false. .false. ), distance: (Variable 13 distance [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point_dist_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .true. .false. ) (StructType [(Real 4) (Real 4)] [] .true. .false. ) (Real 4)] () Source Implementation () .false. .false. .true. .false. .false. [] .false. ) [] [(Var 13 a) (Var 13 b) (Var 13 distance)] [(Assignment (Var 13 distance) (IntrinsicElementalFunction Sqrt [(RealBinOp (RealBinOp (RealBinOp (StructInstanceMember (Var 13 a) 13 1_point_x (Real 4) () ) Sub (StructInstanceMember (Var 13 b) 13 1_point_x (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (RealBinOp (RealBinOp (StructInstanceMember (Var 13 a) 13 1_point_y (Real 4) () ) Sub (StructInstanceMember (Var 13 b) 13 1_point_y (Real 4) () ) (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) () .false. .false. )] () Public .false. .false. () ), rkind: (ExternalSymbol 11 rkind 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) points_a points [] .false. .false. .false. ), stdlib_kinds_submodule_02: (Module (SymbolTable 2 { int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), rkind1: (ExternalSymbol 2 rkind1 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ) }) stdlib_kinds_submodule_02 () [iso_fortran_env] .false. .false. .false. ), submodules_02: (Program (SymbolTable 14 { }) submodules_02 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-string_54-06ad64c.json0000664000175000017500000000075015141516316025463 0ustar alastairalastair{ "basename": "llvm-string_54-06ad64c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_54.f90", "infile_hash": "ac362ebe23bff5072f61252724ef01399d95e4783cbf9330a49acf86", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_54-06ad64c.stdout", "stdout_hash": "d00c88ca36a87d39c38ce7ce9b4f0864ee20b150fff5c904dc0d2f32", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-read1-fd137ad.stdout0000664000175000017500000000453115141516316025112 0ustar alastairalastair(TranslationUnit [(Program read1 (TriviaNode [(EndOfLine) (Comment "! AST only tests" )] [] ) [] [] [] [(Read 0 () [(()) (())] [] [a b] () ) (Read 0 () [] [(unit ()) (fmt ())] [a b] () ) (Read 0 () [(())] [(fmt ())] [a b] () ) (Read 0 () [(())] [] [b] () ) (Read 0 () [((FuncCallOrArray zone [] [(1 3 1 0)] [] [] [] )) ((String "(i3)" ()))] [] [hour] () ) (Read 0 () [(u)] [] [b] () ) (Read 0 () [(u)] [(fmt x)] [b c e] () ) (Read 0 () [(())] [(fmt x)] [b c e] () ) (Read 0 () [(iunit)] [(NML invar) (IOSTAT ierr)] [] () ) (Read 0 () [] [(UNIT iunit) (NML invar) (IOSTAT ierr)] [] () ) (Read 0 10 [] [] [] () ) (Read 0 10 [] [] [A B] () ) (Read 0 () [] [] [size] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array10-1f60f5f.stdout0000664000175000017500000000574015141516316025322 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_arrays: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (ArrayConstant 20 [4, 9, 6, 12, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [4, 9, 6, 12, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) const_arrays [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-init_values-19dfa76.json0000664000175000017500000000075315141516316026017 0ustar alastairalastair{ "basename": "asr-init_values-19dfa76", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/init_values.f90", "infile_hash": "1cafced706fa2754f92f2d460867d6c84638fd10447df12f124fd419", "outfile": null, "outfile_hash": null, "stdout": "asr-init_values-19dfa76.stdout", "stdout_hash": "49a4d81f4b5d76c9f75d1c814fef2d6a60a24950cbbb5d4d33ad47ea", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_46-1b93fa8.stdout0000664000175000017500000052615315141516316027236 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), omp_task_mre: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) omp_task_mre [omp_lib] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (IntrinsicElementalFunction Real [(Var 2 i)] 0 (Real 4) () ) () .false. .false. )] [] ) (OMPRegion ParallelSections [(OMPShared [(Var 2 array)] )] [(OMPRegion Section [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(OMPRegion Task [(OMPFirstPrivate [(Var 2 i)] ) (OMPShared [(Var 2 array)] )] [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (IntrinsicElementalFunction Real [(Var 2 i)] 0 (Real 4) () ) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Task: i = " (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i) (StringConstant ", computed by thread " (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 2 omp_get_thread_num () [] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] [] )] ) (OMPRegion Section [] [(Print (StringConstant "All tasks submitted. Waiting for completion." (String 1 (IntegerConstant 44 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) (Print (StringConstant "Updated array:" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(Print (StringFormat () [(StringConstant "array(" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i) (StringConstant ") = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope5-fb3716b.json0000664000175000017500000000101415141516316031126 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope5-fb3716b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope5-fb3716b.stdout", "stdout_hash": "4a208cc8ed3d05ec7b11daa17f35dc18795e3c28b89cd1fd72b675fb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cmplx_03-6426707.stdout0000664000175000017500000000054315141516316025246 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cmplx_03: (Program (SymbolTable 2 { }) cmplx_03 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-modules_04-e9ab16a.stdout0000664000175000017500000000057515141516316026552 0ustar alastairalastairmodule modules_04_a implicit none contains subroutine b() print *, "b()" end subroutine b end module modules_04_a program modules_04 use, intrinsic :: iso_fortran_env implicit none call f() contains subroutine f() use modules_04_a, only: b call b() end subroutine f integer function g() use modules_04_a, only: b call b() g = 5 end function g end program modules_04 lfortran-lfortran-2f73434/tests/reference/run-array_shape_05-429216b.stderr0000664000175000017500000000033415141516316026473 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'a'. Tried to match size 2 of dimension 1 of LHS with size 1 of dimension 1 of RHS. --> tests/errors/array_shape_05.f90:10:5 | 10 | a = temp(i:j) | ^ lfortran-lfortran-2f73434/tests/reference/cpp-case_01-49038b7.json0000664000175000017500000000072215141516316024540 0ustar alastairalastair{ "basename": "cpp-case_01-49038b7", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_01-49038b7.stdout", "stdout_hash": "b22c3de85f810846a99eafc3497de1ba9ea408da0b550fd2fe63cf68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-types_03-ce710b0.json0000664000175000017500000000074515141516316025311 0ustar alastairalastair{ "basename": "llvm-types_03-ce710b0", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_03-ce710b0.stdout", "stdout_hash": "e2f0d503e2431267a6732a2da406ab9e00fbcf8ac4933b98d4cf69e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_float_01-74fa3d6.json0000664000175000017500000000074015141516316025724 0ustar alastairalastair{ "basename": "asr-dim_float_01-74fa3d6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_01.f90", "infile_hash": "b15ce785e0460bd8d3f111cc981afdabd70523ce10af75df7bed27d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_01-74fa3d6.stderr", "stderr_hash": "883990947388787ea67003fb63115abcad43853093179216ba3e4b44", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_interface_01-07d787f.stdout0000664000175000017500000057064715141516316030144 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_interface_01: (Program (SymbolTable 22 { cast_integer: (ExternalSymbol 22 cast_integer 2 cast_integer template_interface_01_m [] cast_integer Public ), cast_r: (ExternalSymbol 22 cast_r 2 cast_r template_interface_01_m [] cast_r Public ), cast_real: (ExternalSymbol 22 cast_real 2 cast_real template_interface_01_m [] cast_real Public ), operator_r: (ExternalSymbol 22 operator_r 2 operator_r template_interface_01_m [] operator_r Public ), simple_generic_sum: (ExternalSymbol 22 simple_generic_sum 2 simple_generic_sum template_interface_01_m [] simple_generic_sum Public ), sum_t: (ExternalSymbol 22 sum_t 2 sum_t template_interface_01_m [] sum_t Public ), test_template: (ExternalSymbol 22 test_template 2 test_template template_interface_01_m [] test_template Public ) }) template_interface_01 [template_interface_01_m] [(SubroutineCall 22 test_template () [] () .false. )] ), template_interface_01_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 11 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 11 arg)] [(Assignment (Var 11 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 11 res) Public .false. .false. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 12 { arg: (Variable 12 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 arg)] [(Assignment (Var 12 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 12 res) Public .false. .false. () ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) operator_r [t u v binary_func] [] ), simple_generic_sum: (Template (SymbolTable 13 { add: (Function (SymbolTable 14 { lhs: (Variable 14 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 14 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 14 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 14 lhs) (Var 14 rhs)] [] (Var 14 res) Public .false. .false. () ), cast: (Function (SymbolTable 15 { arg: (Variable 15 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 15 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 15 arg)] [] (Var 15 res) Public .false. .false. () ), simple_generic_sum: (Function (SymbolTable 16 { arr: (Variable 16 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 16 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 16 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 16 ~add [13 add] Public ) }) simple_generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 16 arr)] [(Assignment (Var 16 n) (ArraySize (Var 16 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 16 res) (FunctionCall 13 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 16 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 16 res) (ArrayItem (Var 16 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 16 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 16 n) ()) [(Assignment (Var 16 res) (OverloadedBinOp (Var 16 res) Add (ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 13 add 16 ~add [((Var 16 res)) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] [] )] (Var 16 res) Public .false. .false. () ), t: (Variable 13 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) simple_generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), sum_t: (Template (SymbolTable 7 { add: (Function (SymbolTable 8 { lhs: (Variable 8 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 8 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 8 lhs) (Var 8 rhs)] [] (Var 8 res) Public .false. .false. () ), cast: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Public .false. .false. () ), generic_sum: (Function (SymbolTable 10 { arr: (Variable 10 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 10 arr)] [(Assignment (Var 10 n) (ArraySize (Var 10 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 res) (FunctionCall 7 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 10 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 10 res) (ArrayItem (Var 10 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 10 n) ()) [(Assignment (Var 10 res) (OverloadedBinOp (Var 10 res) Add (ArrayItem (Var 10 arr) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ) (TypeParameter t ) () (FunctionCall 7 add 7 ~add [((Var 10 res)) ((ArrayItem (Var 10 arr) [(() (Var 10 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) ) () .false. .false. )] [] )] [] )] (Var 10 res) Public .false. .false. () ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 7 ~add [7 add] Public ) }) sum_t [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), test_template: (Function (SymbolTable 17 { __instantiated_simple_generic_sum: (Function (SymbolTable 23 { arr: (Variable 23 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 23 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 23 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 23 res [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_simple_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 23 arr)] [(Assignment (Var 23 n) (ArraySize (Var 23 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 23 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 23 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 23 res) (ArrayItem (Var 23 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 23 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 23 n) ()) [(Assignment (Var 23 res) (OverloadedBinOp (Var 23 res) Add (ArrayItem (Var 23 arr) [(() (Var 23 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic 16 ~add [((Var 23 res)) ((ArrayItem (Var 23 arr) [(() (Var 23 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 23 res) Public .false. .false. () ), __instantiated_simple_generic_sum1: (Function (SymbolTable 24 { arr: (Variable 24 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 24 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 24 res [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_simple_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 24 arr)] [(Assignment (Var 24 n) (ArraySize (Var 24 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 24 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 24 res) (ArrayItem (Var 24 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 24 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 24 n) ()) [(Assignment (Var 24 res) (OverloadedBinOp (Var 24 res) Add (ArrayItem (Var 24 arr) [(() (Var 24 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic1 16 ~add [((Var 24 res)) ((ArrayItem (Var 24 arr) [(() (Var 24 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 24 res) Public .false. .false. () ), ai: (Variable 17 ai [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), ar: (Variable 17 ar [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), generic_sum_integer: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 19 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (ArrayItem (Var 19 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 19 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 19 n) ()) [(Assignment (Var 19 res) (OverloadedBinOp (Var 19 res) Add (ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic 7 ~add [((Var 19 res)) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 19 res) Public .false. .false. () ), generic_sum_real: (Function (SymbolTable 21 { arr: (Variable 21 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 21 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 21 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 21 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 21 arr)] [(Assignment (Var 21 n) (ArraySize (Var 21 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 21 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 21 res) (ArrayItem (Var 21 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 21 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 21 n) ()) [(Assignment (Var 21 res) (OverloadedBinOp (Var 21 res) Add (ArrayItem (Var 21 arr) [(() (Var 21 i) ())] (Real 4) ColMajor () ) (TypeParameter t ) () (FunctionCall 17 ~add_intrinsic1 7 ~add [((Var 21 res)) ((ArrayItem (Var 21 arr) [(() (Var 21 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) ) () .false. .false. )] [] )] [] )] (Var 21 res) Public .false. .false. () ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ri: (Variable 17 ri [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rr: (Variable 17 rr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 17 ~add [17 ~add_intrinsic 17 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 18 { arg0: (Variable 18 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 18 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 18 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 18 arg0) (Var 18 arg1)] [(Assignment (Var 18 ret) (IntegerBinOp (Var 18 arg0) Add (Var 18 arg1) (Integer 4) () ) () .false. .false. )] (Var 18 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 20 { arg0: (Variable 20 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 20 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 20 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 20 arg0) (Var 20 arg1)] [(Assignment (Var 20 ret) (RealBinOp (Var 20 arg0) Add (Var 20 arg1) (Real 4) () ) () .false. .false. )] (Var 20 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 17 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 17 ai) [(() (Var 17 i) ())] (Integer 4) ColMajor () ) (Var 17 i) () .false. .false. ) (Assignment (ArrayItem (Var 17 ar) [(() (Var 17 i) ())] (Real 4) ColMajor () ) (Cast (Var 17 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 17 ri) (FunctionCall 17 generic_sum_integer () [((ArrayPhysicalCast (Var 17 ai) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 17 rr) (FunctionCall 17 generic_sum_real () [((ArrayPhysicalCast (Var 17 ar) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 17 ri)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 17 rr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 17 __instantiated_simple_generic_sum () [((ArrayPhysicalCast (Var 17 ai) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 17 __instantiated_simple_generic_sum1 () [((ArrayPhysicalCast (Var 17 ar) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_interface_01_m () [template_interface_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_04-bf080aa.stdout0000664000175000017500000000121615141516316030647 0ustar alastairalastair(TranslationUnit [(Subroutine sub [] [] () (TriviaNode [(Semicolon)] [(Semicolon)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-callback_03-0f44942.stdout0000664000175000017500000001523115141516316026121 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_callback_03_cb(float (float*)* %f, float* %a, float* %b) { .entry: %cb = alloca float, align 4 %0 = load float, float* %b, align 4 %1 = load float, float* %a, align 4 %2 = fsub float %0, %1 %3 = call float %f(float* %a) %4 = fadd float %2, %3 %5 = call float %f(float* %b) %6 = fadd float %4, %5 store float %6, float* %cb, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_cb FINALIZE_SYMTABLE_cb: ; preds = %return %7 = load float, float* %cb, align 4 ret float %7 } declare float @f(float*) define void @__module_callback_03_foo1(float* %c, float* %d) { .entry: %0 = alloca i64, align 8 %1 = call float @__module_callback_03_cb(float (float*)* @foo1.__module_callback_03_f, float* %c, float* %d) %2 = alloca float, align 4 store float %1, float* %2, align 4 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, float* %2) %4 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo1 FINALIZE_SYMTABLE_foo1: ; preds = %return ret void } define float @foo1.__module_callback_03_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float 2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } define void @__module_callback_03_foo2(float* %c, float* %d) { .entry: %0 = alloca i64, align 8 %1 = call float @__module_callback_03_cb(float (float*)* @foo2.__module_callback_03_f, float* %c, float* %d) %2 = alloca float, align 4 store float %1, float* %2, align 4 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %0, i32 0, i32 0, float* %2) %4 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_foo2 FINALIZE_SYMTABLE_foo2: ; preds = %return ret void } define float @foo2.__module_callback_03_f(float* %x) { .entry: %f = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = fmul float -2.000000e+00, %0 store float %1, float* %f, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return %2 = load float, float* %f, align 4 ret float %2 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca float, align 4 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_03_foo1(float* %call_arg_value, float* %call_arg_value1) store float 1.500000e+00, float* %call_arg_value, align 4 store float 2.000000e+00, float* %call_arg_value1, align 4 call void @__module_callback_03_foo2(float* %call_arg_value, float* %call_arg_value1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-complex3-001609d.stderr0000664000175000017500000000046415141516316025404 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/complex3.f90:2:1 | 2 | complex*16 :: x | ^^^^^^^^^^ help: write this as 'complex(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/complex3.f90:4:1 | 4 | complex*8 :: z | ^^^^^^^^^ help: write this as 'complex(4)' lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_external_dedup_01-94a5d6b.json0000664000175000017500000000107715141516316033115 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_external_dedup_01-94a5d6b", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_external_dedup_01.f90", "infile_hash": "2aab29c92da224e4546714887b85dfa6883b7ba509705159b438bf9a", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_external_dedup_01-94a5d6b.stdout", "stdout_hash": "7c2023bfde29fdb9f9587242e210ecbe4c0ce1c8f76031470ba424b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_03-3580222.stdout0000664000175000017500000001230715141516316026762 0ustar alastairalastair(TranslationUnit [(Program derived_types_03 (TriviaNode [(EndOfLine) (Comment "! AST only" )] [] ) [] [] [] [(DoLoop 0 () 0 nn 1 ndiag () [(Assignment 0 ing len [(diag [(() nn () 0)])] () ) (Allocate 0 [(() (FuncCallOrArray cell_id [(diag [(() nn () 0)])] [(() ing () 0)] [] [] [] ) () 0)] [(STAT ierr)] () ) (If 0 () (/= ierr 0) [(Return 0 () () )] [] () () () ) (Assignment 0 ndpwds (+ ndpwds (FuncCallOrArray SIZE [] [(() cell_id [(diag [(() nn () 0)])] () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 k 1 nz () [(DoLoop 0 () 0 j 1 ny () [(DoLoop 0 () 0 i 1 ichunk () [(Assignment 0 nn (- (+ (+ i j) k) 2) () ) (Assignment 0 (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) (+ (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) 1) () ) (Assignment 0 ing (FuncCallOrArray indx [] [(() nn () 0)] [] [] [] ) () ) (Assignment 0 ic [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] i () ) (Assignment 0 j [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] j () ) (Assignment 0 k [(diag [(() nn () 0)]) (cell_id [(() ing () 0)])] k () )] () () )] () () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-exit2-f1f3b2c.stdout0000664000175000017500000000001215141516316025151 0ustar alastairalastair1 2 3 4 5 lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_goto_select-6cc9882.json0000664000175000017500000000100215141516316030121 0ustar alastairalastair{ "basename": "ast-fixed_form_goto_select-6cc9882", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_goto_select.f", "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_goto_select-6cc9882.stdout", "stdout_hash": "d00834b66632f8c590999e8a3530f48d7249c7620377336fb120918e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-doloop_08-f0d8fe6.stdout0000664000175000017500000000034615141516316026247 0ustar alastairalastairfunction main() local i::Int32 i = 1 while true i = i + 1 if i == 10 break end end if i ≠ 10 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/run-format7-5662bc0.json0000664000175000017500000000066215141516316025000 0ustar alastairalastair{ "basename": "run-format7-5662bc0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format7.f90", "infile_hash": "2fa302a9dea408e1cee5ae34903a7ed59a6c729180d468f537a6caf5", "outfile": null, "outfile_hash": null, "stdout": "run-format7-5662bc0.stdout", "stdout_hash": "1953aa3f8f698f07a3be0ac613c646ed528adc664959cc638cabd693", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_06-8523892.json0000664000175000017500000000076115141516316025751 0ustar alastairalastair{ "basename": "asr-intrinsics_06-8523892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", "infile_hash": "c551ff5e24ea7b1b86a697b75ab52b3a9fb897ec0ff8d13f6a8afba5", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_06-8523892.stdout", "stdout_hash": "92ca1e49aea0352cf895cfe8554c44d22a7e0b5d1ff676cafc17bb8d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_float_03-ba04334.json0000664000175000017500000000074015141516316025630 0ustar alastairalastair{ "basename": "asr-dim_float_03-ba04334", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_03.f90", "infile_hash": "6ab0d9c80a8018b90b40b497e17a141b9c4deaec85ab09280876a6dc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_03-ba04334.stderr", "stderr_hash": "fcde64adbe1e43ad1d0ce306b227f5986ce2a9ad4b00ed6330d9deac", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_01b-e284c9a.json0000664000175000017500000000076215141516316027161 0ustar alastairalastair{ "basename": "asr-template_error_01b-e284c9a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_01b.f90", "infile_hash": "5ec3c47e5ccee449eb4e86e635ac1544b93a6be86f7ce1c332c97ddd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_01b-e284c9a.stderr", "stderr_hash": "78249ad975f5cc263d61ff3951e5c3f7eded7260e296bbabd430c29c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-pragma2-dd5bd9b.json0000664000175000017500000000071215141516316025157 0ustar alastairalastair{ "basename": "ast-pragma2-dd5bd9b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "ast-pragma2-dd5bd9b.stdout", "stdout_hash": "1febfc19f8f29330796a99c366561e071dbd1057b9114cc31e0c8a67", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout0000664000175000017500000001374115141516316030464 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 100 100 ) (Print (StringConstant "hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 200 200 ) (Assignment (Var 2 k) (IntegerBinOp (Var 2 k) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 n) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 m) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 200 200 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. )] [] .false. ) (Select () (Var 2 n) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 100 100 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 200 200 )] .false. )] [] .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_08-9988b1f.stdout0000664000175000017500000001725115141516316026474 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_08: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (TypeInquiry Tiny (Real 4) (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (RealConstant 0.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [b] Local (TypeInquiry Tiny (Real 8) (Var 2 b) (Real 8) (RealConstant 0.000000 (Real 8) ) ) (RealConstant 0.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (TypeInquiry Tiny (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (RealConstant 0.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_08 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_transfer_01-3dca715.stderr0000664000175000017500000000032015141516316027325 0ustar alastairalastairsemantic error: size argument to `transfer` intrinsic must be of Integer type. --> tests/errors/array_transfer_01.f90:5:29 | 5 | print *, transfer(a, 1, size_a) | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-openmp_36-256dd0e.stdout0000664000175000017500000001104315141516316025636 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { openmp_36: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 2 res [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) openmp_36 [] [(DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ())] [] [] [] [(Assignment (Var 2 res) (IntegerBinOp (Var 2 res) Add (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] ) (Print (StringFormat () [(Var 2 res)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_02-7a95ae7.json0000664000175000017500000000074215141516316025141 0ustar alastairalastair{ "basename": "asr-types_02-7a95ae7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "asr-types_02-7a95ae7.stdout", "stdout_hash": "cacfe668156963fbf8829b2f61f7b3d01080805b3ea084b8d5e34cce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/mod_to_asr-mod1-14-bb0bd17.stderr0000664000175000017500000000013315141516316026502 0ustar alastairalastairThe following argument was not expected: --no-indent Run with --help for more information. lfortran-lfortran-2f73434/tests/reference/asr-class_02-b56b852.json0000664000175000017500000000074215141516316025015 0ustar alastairalastair{ "basename": "asr-class_02-b56b852", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_02.f90", "infile_hash": "d9600a16766ae051943b344e946afd7523b8f9d66250d6cd908135cc", "outfile": null, "outfile_hash": null, "stdout": "asr-class_02-b56b852.stdout", "stdout_hash": "b4f9c630e072ece4496c4898f71d91738c42f3b7cf235bd620dbd0d6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-associate_01-4a4ac5c.stderr0000664000175000017500000000025615141516316026345 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/associate_01.f90:18:8 | 18 | if(a(1).EQ.5) GO TO 1 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/llvm-nullify_02-3c7ee61.stdout0000664000175000017500000000176515141516316026216 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca float*, align 8 store float* null, float** %p1, align 8 %p2 = alloca i32*, align 8 store i32* null, i32** %p2, align 8 %t1 = alloca float, align 4 %t2 = alloca i32, align 4 store float* %t1, float** %p1, align 8 %2 = load float*, float** %p1, align 8 store float 1.000000e+00, float* %2, align 4 store i32* %t2, i32** %p2, align 8 %3 = load i32*, i32** %p2, align 8 store i32 2, i32* %3, align 4 store float* null, float** %p1, align 8 store i32* null, i32** %p2, align 8 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nullify_02 FINALIZE_SYMTABLE_nullify_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/wat-if_04-1d3b97a.json0000664000175000017500000000103015141516316024362 0ustar alastairalastair{ "basename": "wat-if_04-1d3b97a", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/if_04.f90", "infile_hash": "dc3029f2df7281746bd116d435ee39913201c693d801c2e53aca3886", "outfile": null, "outfile_hash": null, "stdout": "wat-if_04-1d3b97a.stdout", "stdout_hash": "79a69e07bcecedfc95012ed1f1dcc4e012e1e7cbf351bd25c5f1ad20", "stderr": "wat-if_04-1d3b97a.stderr", "stderr_hash": "8b854a8be811f407b5f543a37121d6b73b7265ed8b67dc1c76a42d63", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-flush1-09001c8.stdout0000664000175000017500000000140315141516316025066 0ustar alastairalastair(TranslationUnit [(Program flush1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST only):" )] [] ) [] [] [] [(Flush 0 [10] [(IOSTAT n)] () ) (Flush 0 [20] [(IOMSG n)] () ) (Flush 0 [] [(ERR label)] () ) (Flush 0 [30] [(UNIT 40)] () ) (Flush 0 [50] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_01-a82b6b0.json0000664000175000017500000000076215141516316030606 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_01-a82b6b0", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_01.f90", "infile_hash": "6fbed4236f624f5378290445365914265a7e928f30530ce1fc09c955", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_01-a82b6b0.stderr", "stderr_hash": "3a4f8f9da1bd7cbb8c53e4e2d1d49d5dbc9387dd6538b472ee6d9ca3", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/wat-logical2-3eb78d2.stdout0000664000175000017500000000675615141516316025556 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 local.get 1 i32.and if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 244 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\1a\00\00\00") (data (;35;) (i32.const 216) "Line 1 - Condition is true ") (data (;36;) (i32.const 244) "\fc\00\00\00\1b\00\00\00") (data (;37;) (i32.const 252) "Line 1 - Condition is false ") ) lfortran-lfortran-2f73434/tests/reference/asr-modulo_01-b82bee9.stderr0000664000175000017500000000023415141516316025677 0ustar alastairalastairsemantic error: Second argument of modulo cannot be 0 --> tests/errors/modulo_01.f90:2:14 | 2 | print *, modulo(1, 0) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-associate_08-570ac7d.stdout0000664000175000017500000014654515141516316026333 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate2: (Program (SymbolTable 7 { 1_t_1_i: (ExternalSymbol 7 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 7 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), sub_1: (ExternalSymbol 7 sub_1 2 sub_1 associate_08_module_1 [] sub_1 Public ), sub_2: (ExternalSymbol 7 sub_2 2 sub_2 associate_08_module_1 [] sub_2 Public ), t_1: (ExternalSymbol 7 t_1 2 t_1 associate_08_module_1 [] t_1 Public ), t_2: (ExternalSymbol 7 t_2 2 t_2 associate_08_module_1 [] t_2 Public ), t_2_array: (Variable 7 t_2_array [] Local () () Default (Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) ) 7 t_2 Source Public Required .false. .false. .false. () .false. .false. ), type_1: (Variable 7 type_1 [] Local () () Default (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) 7 t_2 Source Public Required .false. .false. .false. () .false. .false. ) }) associate2 [associate_08_module_1] [(SubroutineCall 7 sub_1 () [((Var 7 type_1)) ((IntegerConstant 123 (Integer 4) Decimal))] () .false. ) (If () (IntegerCompare (StructInstanceMember (ArrayItem (StructInstanceMember (Var 7 type_1) 7 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 7 1_t_1_i (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 7 type_1) 7 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 7 1_t_1_i (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), associate_08_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 5 { 1_t_1_i: (ExternalSymbol 5 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 5 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), associate_block: (AssociateBlock (SymbolTable 8 { target: (Variable 8 target [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 8 target) (StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 type_1) 5 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 5 1_t_1_i (Integer 4) () ) ) (Assignment (Var 8 target) (Var 5 i) () .false. .false. )] ), i: (Variable 5 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), type_1: (Variable 5 type_1 [] InOut () () Default (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) 2 t_2 Source Public Required .false. .false. .false. () .false. .false. ) }) sub_1 (FunctionType [(StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 type_1) (Var 5 i)] [(Allocate [((StructInstanceMember (Var 5 type_1) 5 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (AssociateBlockCall 5 associate_block )] () Public .false. .false. () ), sub_2: (Function (SymbolTable 6 { 1_t_2_type_2: (ExternalSymbol 6 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), associate_block: (AssociateBlock (SymbolTable 9 { 1_t_1_i: (ExternalSymbol 9 1_t_1_i 3 i t_1 [] i Public ), 1_t_2_type_2: (ExternalSymbol 9 1_t_2_type_2 4 type_2 t_2 [] type_2 Public ), target: (Variable 9 target [] Local () () Default (Pointer (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ) 2 t_2 Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 9 target) (ArrayItem (Var 6 progress) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ColMajor () ) ) (Assignment (StructInstanceMember (ArrayItem (StructInstanceMember (Var 9 target) 9 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 9 1_t_1_i (Integer 4) () ) (IntegerConstant 345 (Integer 4) Decimal) () .false. .false. )] ), progress: (Variable 6 progress [] InOut () () Default (Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) ) 2 t_2 Source Public Required .false. .false. .false. () .false. .false. ) }) sub_2 (FunctionType [(Allocatable (Array (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 progress)] [(Allocate [((Var 6 progress) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((StructInstanceMember (ArrayItem (Var 6 progress) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .false. .false. ) ColMajor () ) 6 1_t_2_type_2 (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (AssociateBlockCall 6 associate_block )] () Public .false. .false. () ), t_1: (Struct (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) t_1 (StructType [(Integer 4)] [] .true. .false. ) [] [i] [] Source Public .false. .false. [] () () ), t_2: (Struct (SymbolTable 4 { type_2: (Variable 4 type_2 [] Local () () Default (Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 t_1 Source Public Required .false. .false. .false. () .false. .false. ) }) t_2 (StructType [(Pointer (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [type_2] [] Source Public .false. .false. [] () () ) }) associate_08_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_08-7f7acdd.stderr0000664000175000017500000000060515141516316030334 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'ff'. Tried to match size 5 of dimension 1 of argument number 1, but expected size is 100000 --> tests/errors/array_bounds_check_08.f90:4:3 | 4 | arr = ff() | ^^^ | 8 | function ff() result(res) | ~~ Here | 9 | integer :: res(100000) | ~~~~~~ Expected range 1:100000, got 5 lfortran-lfortran-2f73434/tests/reference/llvm-string_54-06ad64c.stdout0000664000175000017500000000460215141516316026034 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> define i32 @__module_string_54_mod_double_(i32* %x) { .entry: %ret = alloca i32, align 4 %0 = load i32, i32* %x, align 4 %1 = mul i32 %0, 2 store i32 %1, i32* %ret, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_double_ FINALIZE_SYMTABLE_double_: ; preds = %return %2 = load i32, i32* %ret, align 4 ret i32 %2 } define void @__module_string_54_mod_foo_sub(i32* %x, %string_descriptor* %char) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_foo_sub FINALIZE_SYMTABLE_foo_sub: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %char = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %char, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 1 store i64 10, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 10) store i8* %4, i8** %3, align 8 %x = alloca i32, align 4 store i32 10, i32* %x, align 4 call void @__module_string_54_mod_foo_sub(i32* %x, %string_descriptor* %char) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_string_54 FINALIZE_SYMTABLE_string_54: ; preds = %return br label %Finalize_Variable_char Finalize_Variable_char: ; preds = %FINALIZE_SYMTABLE_string_54 %5 = getelementptr %string_descriptor, %string_descriptor* %char, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = icmp eq i8* %6, null br i1 %7, label %free_done, label %free_nonnull free_nonnull: ; preds = %Finalize_Variable_char call void @_lfortran_free(i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %Finalize_Variable_char ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lpython_free_argv() declare void @_lfortran_free(i8*) lfortran-lfortran-2f73434/tests/reference/asr-bits_01-2906c1d.json0000664000175000017500000000073715141516316024647 0ustar alastairalastair{ "basename": "asr-bits_01-2906c1d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_01.f90", "infile_hash": "4fdd6c630a9f2559417372a42cca1dc1c98fa7af4e4a5442ebf9ca96", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_01-2906c1d.stdout", "stdout_hash": "cc11fd2915ee4a4307628d44a5216f208a71ff481cb5cf96019dcd4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-substring-73a0b8e.stdout0000664000175000017500000000031515141516316026530 0ustar alastairalastairprogram substring implicit none character(len=5) :: str character(len=5), parameter :: s = "Hello World"(7:11) str = "12345"(2:4) print *, str print *, s print *, "SubString"(4:9) end program substring lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_02-adb886e.stdout0000664000175000017500000001202615141516316031034 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [11 x i8] c"S-DESC-5,L\00", align 1 @string_const_data = private constant [5 x i8] c"tf=0:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [11 x i8] c"S-DESC-5,L\00", align 1 @string_const_data.2 = private constant [5 x i8] c"tf=1:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.2, i32 0, i32 0), i64 5 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_overload_assignment_m_logical_gets_integer(i1* %tf, i32* %i) { .entry: %0 = load i32, i32* %i, align 4 %1 = icmp eq i32 %0, 0 store i1 %1, i1* %tf, align 1 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_logical_gets_integer FINALIZE_SYMTABLE_logical_gets_integer: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %tf = alloca i1, align 1 store i32 0, i32* %call_arg_value, align 4 call void @__module_overload_assignment_m_logical_gets_integer(i1* %tf, i32* %call_arg_value) %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %string_descriptor* @string_const, i1* %tf) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 1, i32* %call_arg_value, align 4 call void @__module_overload_assignment_m_logical_gets_integer(i1* %tf, i32* %call_arg_value) %13 = alloca i64, align 8 %14 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, %string_descriptor* @string_const.3, i1* %tf) %15 = load i64, i64* %13, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %15, i64* %17, align 4 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %21 = load i64, i64* %20, align 4 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %14) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done call void @_lpython_free_argv() br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-subroutines_05-1398db3.json0000664000175000017500000000076415141516316026301 0ustar alastairalastair{ "basename": "asr-subroutines_05-1398db3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_05.f90", "infile_hash": "ebc35a303d7f8c4ccb4f617a439a6e897e997f69d8f7654730af4676", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_05-1398db3.stdout", "stdout_hash": "899e6aef3b1ae5070eff3fe503eb08ce57e0dcca7eb5cc651716f246", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-issue532-4bdd3b3.json0000664000175000017500000000071515141516316025121 0ustar alastairalastair{ "basename": "asr-issue532-4bdd3b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/issue532.f90", "infile_hash": "75f4785bea0a877f7a902640ffcc5d276bd955349ff3df1639d6e6b7", "outfile": null, "outfile_hash": null, "stdout": "asr-issue532-4bdd3b3.stdout", "stdout_hash": "d8a264da4ac7f6beac003c683ed48014d877b28c0cfe8b7505b2e2f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-block_01-98c37d0.json0000664000175000017500000000074215141516316025005 0ustar alastairalastair{ "basename": "asr-block_01-98c37d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_01.f90", "infile_hash": "e1008df68ca08f26a1d9f91a68ee7ec4e7744837a022b483c129a5c1", "outfile": null, "outfile_hash": null, "stdout": "asr-block_01-98c37d0.stdout", "stdout_hash": "3e19b440e9d572cf39a250dd3589a58f54ccd2fc738ee8e50361b850", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_01-075c0b7.stderr0000664000175000017500000000034115141516316025675 0ustar alastairalastairsemantic error: The first argument of `cmplx` intrinsic is of complex type, the second argument in this case must be absent --> tests/errors/complex_01.f90:4:14 | 4 | print *, cmplx(z, 1) | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-case_02-a38c2d8.stdout0000664000175000017500000007325515141516316025451 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [10 x i8] c"Excellent!" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data, i32 0, i32 0), i64 10 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [10 x i8] c"Very good!" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.1, i32 0, i32 0), i64 10 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [10 x i8] c"Well done!" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.3, i32 0, i32 0), i64 10 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [8 x i8] c"Not bad!" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.5, i32 0, i32 0), i64 8 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [11 x i8] c"You passed!" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.7, i32 0, i32 0), i64 11 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [17 x i8] c"Better try again!" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.9, i32 0, i32 0), i64 17 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [13 x i8] c"Invalid marks" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.11, i32 0, i32 0), i64 13 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.13 = private constant [15 x i8] c"Your marks are " @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.13, i32 0, i32 0), i64 15 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.15 = private constant [10 x i8] c"Excellent!" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.15, i32 0, i32 0), i64 10 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.17 = private constant [10 x i8] c"Very good!" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.17, i32 0, i32 0), i64 10 }> @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.19 = private constant [10 x i8] c"Well done!" @string_const.20 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.19, i32 0, i32 0), i64 10 }> @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.21 = private constant [8 x i8] c"Not bad!" @string_const.22 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.21, i32 0, i32 0), i64 8 }> @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.23 = private constant [11 x i8] c"You passed!" @string_const.24 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.23, i32 0, i32 0), i64 11 }> @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.25 = private constant [17 x i8] c"Better try again!" @string_const.26 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.25, i32 0, i32 0), i64 17 }> @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.27 = private constant [13 x i8] c"Invalid marks" @string_const.28 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.27, i32 0, i32 0), i64 13 }> @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.29 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.30 = private constant [15 x i8] c"Your marks are " @string_const.31 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.30, i32 0, i32 0), i64 15 }> @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.32 = private constant [10 x i8] c"Excellent!" @string_const.33 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.32, i32 0, i32 0), i64 10 }> @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.34 = private constant [10 x i8] c"Very good!" @string_const.35 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.34, i32 0, i32 0), i64 10 }> @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.36 = private constant [10 x i8] c"Well done!" @string_const.37 = private global %string_descriptor <{ i8* getelementptr inbounds ([10 x i8], [10 x i8]* @string_const_data.36, i32 0, i32 0), i64 10 }> @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.38 = private constant [8 x i8] c"Not bad!" @string_const.39 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.38, i32 0, i32 0), i64 8 }> @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.40 = private constant [11 x i8] c"You passed!" @string_const.41 = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data.40, i32 0, i32 0), i64 11 }> @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.42 = private constant [17 x i8] c"Better try again!" @string_const.43 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.42, i32 0, i32 0), i64 17 }> @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.44 = private constant [13 x i8] c"Invalid marks" @string_const.45 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.44, i32 0, i32 0), i64 13 }> @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.46 = private unnamed_addr constant [13 x i8] c"S-DESC-15,I4\00", align 1 @string_const_data.47 = private constant [15 x i8] c"Your marks are " @string_const.48 = private global %string_descriptor <{ i8* getelementptr inbounds ([15 x i8], [15 x i8]* @string_const_data.47, i32 0, i32 0), i64 15 }> @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %marks = alloca i32, align 4 %out = alloca i32, align 4 store i32 81, i32* %marks, align 4 %2 = load i32, i32* %marks, align 4 %3 = icmp sle i32 91, %2 %4 = load i32, i32* %marks, align 4 %5 = icmp sle i32 %4, 100 %6 = icmp eq i1 %3, false %7 = select i1 %6, i1 %3, i1 %5 br i1 %7, label %then, label %else then: ; preds = %.entry store i32 0, i32* %out, align 4 %8 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont15 else: ; preds = %.entry %9 = load i32, i32* %marks, align 4 %10 = icmp sle i32 81, %9 %11 = load i32, i32* %marks, align 4 %12 = icmp sle i32 %11, 90 %13 = icmp eq i1 %10, false %14 = select i1 %13, i1 %10, i1 %12 br i1 %14, label %then1, label %else2 then1: ; preds = %else store i32 1, i32* %out, align 4 %15 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %15, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont14 else2: ; preds = %else %16 = load i32, i32* %marks, align 4 %17 = icmp sle i32 71, %16 %18 = load i32, i32* %marks, align 4 %19 = icmp sle i32 %18, 80 %20 = icmp eq i1 %17, false %21 = select i1 %20, i1 %17, i1 %19 br i1 %21, label %then3, label %else4 then3: ; preds = %else2 store i32 2, i32* %out, align 4 %22 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %22, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont13 else4: ; preds = %else2 %23 = load i32, i32* %marks, align 4 %24 = icmp sle i32 61, %23 %25 = load i32, i32* %marks, align 4 %26 = icmp sle i32 %25, 70 %27 = icmp eq i1 %24, false %28 = select i1 %27, i1 %24, i1 %26 br i1 %28, label %then5, label %else6 then5: ; preds = %else4 store i32 3, i32* %out, align 4 %29 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %29, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont12 else6: ; preds = %else4 %30 = load i32, i32* %marks, align 4 %31 = icmp sle i32 41, %30 %32 = load i32, i32* %marks, align 4 %33 = icmp sle i32 %32, 60 %34 = icmp eq i1 %31, false %35 = select i1 %34, i1 %31, i1 %33 br i1 %35, label %then7, label %else8 then7: ; preds = %else6 store i32 4, i32* %out, align 4 %36 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %36, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) br label %ifcont11 else8: ; preds = %else6 %37 = load i32, i32* %marks, align 4 %38 = icmp sle i32 %37, 40 br i1 %38, label %then9, label %else10 then9: ; preds = %else8 store i32 5, i32* %out, align 4 %39 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %39, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) br label %ifcont else10: ; preds = %else8 store i32 6, i32* %out, align 4 %40 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %40, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else10, %then9 br label %ifcont11 ifcont11: ; preds = %ifcont, %then7 br label %ifcont12 ifcont12: ; preds = %ifcont11, %then5 br label %ifcont13 ifcont13: ; preds = %ifcont12, %then3 br label %ifcont14 ifcont14: ; preds = %ifcont13, %then1 br label %ifcont15 ifcont15: ; preds = %ifcont14, %then %41 = alloca i64, align 8 %42 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %41, i32 0, i32 0, %string_descriptor* @string_const.14, i32* %marks) %43 = load i64, i64* %41, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %42, i8** %44, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %43, i64* %45, align 4 %46 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %47 = load i8*, i8** %46, align 8 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %49 = load i64, i64* %48, align 4 %50 = trunc i64 %49 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %47, i32 %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %51 = icmp eq i8* %42, null br i1 %51, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont15 call void @_lfortran_free(i8* %42) br label %free_done free_done: ; preds = %free_nonnull, %ifcont15 %52 = load i32, i32* %out, align 4 %53 = icmp ne i32 %52, 1 br i1 %53, label %then16, label %else17 then16: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %free_done br label %ifcont18 ifcont18: ; preds = %else17, %then16 %54 = load i32, i32* %marks, align 4 %55 = icmp sle i32 91, %54 %56 = load i32, i32* %marks, align 4 %57 = icmp sle i32 %56, 100 %58 = icmp eq i1 %55, false %59 = select i1 %58, i1 %55, i1 %57 br i1 %59, label %then19, label %else20 then19: ; preds = %ifcont18 %60 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %60, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) br label %ifcont36 else20: ; preds = %ifcont18 %61 = load i32, i32* %marks, align 4 %62 = icmp sle i32 81, %61 %63 = load i32, i32* %marks, align 4 %64 = icmp sle i32 %63, 90 %65 = icmp eq i1 %62, false %66 = select i1 %65, i1 %62, i1 %64 br i1 %66, label %then21, label %else22 then21: ; preds = %else20 %67 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.18, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* %67, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) br label %ifcont35 else22: ; preds = %else20 %68 = load i32, i32* %marks, align 4 %69 = icmp sle i32 71, %68 %70 = load i32, i32* %marks, align 4 %71 = icmp sle i32 %70, 80 %72 = icmp eq i1 %69, false %73 = select i1 %72, i1 %69, i1 %71 br i1 %73, label %then23, label %else24 then23: ; preds = %else22 %74 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.20, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %74, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) br label %ifcont34 else24: ; preds = %else22 %75 = load i32, i32* %marks, align 4 %76 = icmp sle i32 61, %75 %77 = load i32, i32* %marks, align 4 %78 = icmp sle i32 %77, 70 %79 = icmp eq i1 %76, false %80 = select i1 %79, i1 %76, i1 %78 br i1 %80, label %then25, label %else26 then25: ; preds = %else24 %81 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.22, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* %81, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) br label %ifcont33 else26: ; preds = %else24 %82 = load i32, i32* %marks, align 4 %83 = icmp sle i32 41, %82 %84 = load i32, i32* %marks, align 4 %85 = icmp sle i32 %84, 60 %86 = icmp eq i1 %83, false %87 = select i1 %86, i1 %83, i1 %85 br i1 %87, label %then27, label %else28 then27: ; preds = %else26 %88 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.24, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %88, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) br label %ifcont32 else28: ; preds = %else26 %89 = load i32, i32* %marks, align 4 %90 = icmp sle i32 %89, 40 br i1 %90, label %then29, label %else30 then29: ; preds = %else28 %91 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.26, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* %91, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 1) br label %ifcont31 else30: ; preds = %else28 %92 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.28, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %92, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) br label %ifcont31 ifcont31: ; preds = %else30, %then29 br label %ifcont32 ifcont32: ; preds = %ifcont31, %then27 br label %ifcont33 ifcont33: ; preds = %ifcont32, %then25 br label %ifcont34 ifcont34: ; preds = %ifcont33, %then23 br label %ifcont35 ifcont35: ; preds = %ifcont34, %then21 br label %ifcont36 ifcont36: ; preds = %ifcont35, %then19 %93 = alloca i64, align 8 %94 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.29, i32 0, i32 0), i64* %93, i32 0, i32 0, %string_descriptor* @string_const.31, i32* %marks) %95 = load i64, i64* %93, align 4 %stringFormat_desc37 = alloca %string_descriptor, align 8 %96 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 store i8* %94, i8** %96, align 8 %97 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 store i64 %95, i64* %97, align 4 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 %99 = load i8*, i8** %98, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 %101 = load i64, i64* %100, align 4 %102 = trunc i64 %101 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* %99, i32 %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 1) %103 = icmp eq i8* %94, null br i1 %103, label %free_done39, label %free_nonnull38 free_nonnull38: ; preds = %ifcont36 call void @_lfortran_free(i8* %94) br label %free_done39 free_done39: ; preds = %free_nonnull38, %ifcont36 %104 = load i32, i32* %marks, align 4 %105 = icmp sle i32 91, %104 %106 = load i32, i32* %marks, align 4 %107 = icmp sle i32 %106, 100 %108 = icmp eq i1 %105, false %109 = select i1 %108, i1 %105, i1 %107 br i1 %109, label %then40, label %else41 then40: ; preds = %free_done39 %110 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.33, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %110, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) br label %ifcont57 else41: ; preds = %free_done39 %111 = load i32, i32* %marks, align 4 %112 = icmp sle i32 81, %111 %113 = load i32, i32* %marks, align 4 %114 = icmp sle i32 %113, 90 %115 = icmp eq i1 %112, false %116 = select i1 %115, i1 %112, i1 %114 br i1 %116, label %then42, label %else43 then42: ; preds = %else41 %117 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.35, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* %117, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1) br label %ifcont56 else43: ; preds = %else41 %118 = load i32, i32* %marks, align 4 %119 = icmp sle i32 71, %118 %120 = load i32, i32* %marks, align 4 %121 = icmp sle i32 %120, 80 %122 = icmp eq i1 %119, false %123 = select i1 %122, i1 %119, i1 %121 br i1 %123, label %then44, label %else45 then44: ; preds = %else43 %124 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.37, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %124, i32 10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) br label %ifcont55 else45: ; preds = %else43 %125 = load i32, i32* %marks, align 4 %126 = icmp sle i32 61, %125 %127 = load i32, i32* %marks, align 4 %128 = icmp sle i32 %127, 70 %129 = icmp eq i1 %126, false %130 = select i1 %129, i1 %126, i1 %128 br i1 %130, label %then46, label %else47 then46: ; preds = %else45 %131 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.39, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* %131, i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 1) br label %ifcont54 else47: ; preds = %else45 %132 = load i32, i32* %marks, align 4 %133 = icmp sle i32 41, %132 %134 = load i32, i32* %marks, align 4 %135 = icmp sle i32 %134, 60 %136 = icmp eq i1 %133, false %137 = select i1 %136, i1 %133, i1 %135 br i1 %137, label %then48, label %else49 then48: ; preds = %else47 %138 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.41, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %138, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) br label %ifcont53 else49: ; preds = %else47 %139 = load i32, i32* %marks, align 4 %140 = icmp sle i32 %139, 40 br i1 %140, label %then50, label %else51 then50: ; preds = %else49 %141 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.43, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* %141, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1) br label %ifcont52 else51: ; preds = %else49 %142 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.45, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* %142, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0), i32 1) br label %ifcont52 ifcont52: ; preds = %else51, %then50 br label %ifcont53 ifcont53: ; preds = %ifcont52, %then48 br label %ifcont54 ifcont54: ; preds = %ifcont53, %then46 br label %ifcont55 ifcont55: ; preds = %ifcont54, %then44 br label %ifcont56 ifcont56: ; preds = %ifcont55, %then42 br label %ifcont57 ifcont57: ; preds = %ifcont56, %then40 %143 = alloca i64, align 8 %144 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info.46, i32 0, i32 0), i64* %143, i32 0, i32 0, %string_descriptor* @string_const.48, i32* %marks) %145 = load i64, i64* %143, align 4 %stringFormat_desc58 = alloca %string_descriptor, align 8 %146 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 0 store i8* %144, i8** %146, align 8 %147 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 1 store i64 %145, i64* %147, align 4 %148 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 0 %149 = load i8*, i8** %148, align 8 %150 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc58, i32 0, i32 1 %151 = load i64, i64* %150, align 4 %152 = trunc i64 %151 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* %149, i32 %152, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 1) %153 = icmp eq i8* %144, null br i1 %153, label %free_done60, label %free_nonnull59 free_nonnull59: ; preds = %ifcont57 call void @_lfortran_free(i8* %144) br label %free_done60 free_done60: ; preds = %free_nonnull59, %ifcont57 call void @_lpython_free_argv() br label %return return: ; preds = %free_done60 br label %FINALIZE_SYMTABLE_case_02 FINALIZE_SYMTABLE_case_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_334-6d740cf.json0000664000175000017500000000076415141516316026251 0ustar alastairalastair{ "basename": "asr-intrinsics_334-6d740cf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_334.f90", "infile_hash": "9d3c71d960ed15ecd218cd0ba4b7bc62d11c3da94757e5cab5ffff7a", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_334-6d740cf.stdout", "stdout_hash": "5573bc127c1d1833032ce75dfbd839818ae129ce16bf9eb7970f458f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_string_of_int-ed0ec70.json0000664000175000017500000000076215141516316027414 0ustar alastairalastair{ "basename": "asr-kind_string_of_int-ed0ec70", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_string_of_int.f90", "infile_hash": "89b2b88221d506d791bc4b592e7d73c1c2eebad1b47a0bcd8a388ba0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_string_of_int-ed0ec70.stderr", "stderr_hash": "e7ad0c7055b862d2b628dbd827b39cac77dd6f3ef39025b02ff6a5fc", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics5-1cd2db1.stderr0000664000175000017500000000025015141516316026330 0ustar alastairalastairsemantic error: Kind of all the arguments of Ior must be the same --> tests/errors/intrinsics5.f90:2:14 | 2 | print *, ior(1, 1_8) | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/julia-goto_01-f5b96fb.stdout0000664000175000017500000000015515141516316025713 0ustar alastairalastairfunction main() local a::Int32 a = 5 @goto label_1 @label label_1 println(a) end main() lfortran-lfortran-2f73434/tests/reference/ast_f90-coarrays_02-6690b13.json0000664000175000017500000000074115141516316026127 0ustar alastairalastair{ "basename": "ast_f90-coarrays_02-6690b13", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/coarrays_02.f90", "infile_hash": "b8a582ffc5b086c98bf8f601c32831d648b199fc53bb272628421da9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-coarrays_02-6690b13.stdout", "stdout_hash": "31bedb4ad1e3124de8ff9221a5a7aa018f658570aba47133daf1d5b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_03-f21585a.json0000664000175000017500000000076415141516316026233 0ustar alastairalastair{ "basename": "asr-select_type_03-f21585a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_03.f90", "infile_hash": "decbcd228b2684e48b773166bdb84b545e301f4480a87f7bbc9bd762", "outfile": null, "outfile_hash": null, "stdout": "asr-select_type_03-f21585a.stdout", "stdout_hash": "fe68fa3f2fa83683080bc84f1332825626b34b540292b6bd2c3329f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_subroutine2-805f758.json0000664000175000017500000000077715141516316027676 0ustar alastairalastair{ "basename": "ast-fixedform_subroutine2-805f758", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_subroutine2.f", "infile_hash": "2b76a52df280016afbeef3e6ca5d5168c57d6672be8c784021104759", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_subroutine2-805f758.stdout", "stdout_hash": "e3b630950ab6b4df198f9d85b549a913d8555e29c0ee6f195ac6ccdd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_09-1e51ac7.json0000664000175000017500000000075615141516316026005 0ustar alastairalastair{ "basename": "asr-functions_09-1e51ac7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_09.f90", "infile_hash": "050352bd7c3ecc846699ec79fe6e09ed5b9515fba210bdbbf66355b0", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_09-1e51ac7.stdout", "stdout_hash": "ce81b0fb36fe1c0a75a0c1ff031484b8c04b6a19746e395f59c5ac9a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-init_values-b1d5491.stdout0000664000175000017500000001036215141516316026462 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %complex_4 = type <{ float, float }> @s_data = private global [4 x i8] c"left" @s = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @s_data, i32 0, i32 0), i64 4 }> @s1_data = private global [1 x i8] c"l" @s1 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @s1_data, i32 0, i32 0), i64 1 }> @s2_data = private global [3 x i8] c"eft" @s2 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @s2_data, i32 0, i32 0), i64 3 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [36 x i8] c"I4,I4,R4,{R4,R4},I4,L,L,R4,S-DESC-4\00", align 1 @string_const_data = private constant [4 x i8] c"left" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 store i32 1, i32* %i, align 4 %j = alloca i32, align 4 store i32 2, i32* %j, align 4 %a = alloca i32, align 4 store i32 3, i32* %a, align 4 %l = alloca i1, align 1 store i1 true, i1* %l, align 1 %b = alloca i1, align 1 store i1 true, i1* %b, align 1 %c = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %c, align 1 %r = alloca float, align 4 store float 4.000000e+00, float* %r, align 4 %r_minus = alloca float, align 4 store float -4.000000e+00, float* %r_minus, align 4 %2 = alloca i64, align 8 %3 = alloca i32, align 4 store i32 1, i32* %3, align 4 %4 = alloca i32, align 4 store i32 2, i32* %4, align 4 %5 = alloca float, align 4 store float 4.000000e+00, float* %5, align 4 %6 = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %6, align 1 %7 = alloca i32, align 4 store i32 3, i32* %7, align 4 %8 = alloca i1, align 1 store i1 true, i1* %8, align 1 %9 = alloca i1, align 1 store i1 true, i1* %9, align 1 %10 = alloca float, align 4 store float -4.000000e+00, float* %10, align 4 %11 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %3, i32* %4, float* %5, %complex_4* %6, i32* %7, i1* %8, i1* %9, float* %10, %string_descriptor* @string_const) %12 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 4 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_init_values FINALIZE_SYMTABLE_init_values: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/wat-abs_03-5d62cca.stdout0000664000175000017500000001420315141516316025164 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32) i32.const 2 local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 0 i32.lt_s if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 2 local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 0 i32.const 0 i32.lt_s if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_11-83e9417.json0000664000175000017500000000074315141516316027504 0ustar alastairalastair{ "basename": "run-array_bounds_check_11-83e9417", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_11.f90", "infile_hash": "05fad075d70118633353ec58606020f95cd7f4949cd6919b4236d347", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_11-83e9417.stderr", "stderr_hash": "59ce46229864a8675926df09344e853e054cd89345ee0f1d2bef6512", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast-forall1-50096b8.stdout0000664000175000017500000003611215141516316025242 0ustar alastairalastair(TranslationUnit [(Program forall1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Only for Syntax check" ) (EndOfLine) (Comment "!>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<<" )] ) )] [] [(ForAllSingle 0 () [(ConcurrentControl i 1 n () )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() i () 0)] [] [] [] ) (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n 3 ) (ConcurrentControl j 1 n 5 )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray SIN [] [(() (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n () ) (ConcurrentControl j 1 n () )] (/= i j) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray REAL [] [(() (+ i j) () 0)] [] [] [] ) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 n () ) (ConcurrentControl j 1 m () )] (/= (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) 0) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (/ 1 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] )) () ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 1000 () ) (ConcurrentControl j 1 1000 () )] (/= i j) (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () ) (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "!>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<<" )] ) ) (ForAll 0 () [(ConcurrentControl j 1 n () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(ForAllSingle 0 () [(ConcurrentControl i 1 j () )] () (Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray B [] [(() i () 0)] [] [] [] ) () ) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMul [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl i 3 (+ N 1) () ) (ConcurrentControl j 3 (+ N 1) () )] () [] [(Assignment 0 (FuncCallOrArray C [] [(() i () 0) (() j () 0)] [] [] [] ) (+ (FuncCallOrArray C [] [(() i () 0) (() (+ j 2) () 0)] [] [] [] ) (FuncCallOrArray C [] [(() i () 0) (() (- j 2) () 0)] [] [] [] )) () ) (Assignment 0 (FuncCallOrArray D [] [(() i () 0) (() j () 0)] [] [] [] ) (+ (+ (FuncCallOrArray C [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray C [] [(() (+ i 2) () 0) (() j () 0)] [] [] [] )) (FuncCallOrArray C [] [(() (- i 2) () 0) (() j () 0)] [] [] [] )) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 () [(ConcurrentControl x 1 100 () )] (> (FuncCallOrArray J [] [(() x () 0)] [] [] [] ) 0) [] [(Where 0 () (< (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 0) [(Assignment 0 (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 0 () )] [(Assignment 0 (FuncCallOrArray I [] [(() x () 0) (() () 1 0)] [] [] [] ) 1 () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (ForAll 0 outer [(ConcurrentControl i 1 100 () )] () [] [(ForAll 0 inner [(ConcurrentControl j 1 100 () )] (/= i j) [] [(Assignment 0 (FuncCallOrArray A [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray A [] [(() j () 0) (() i () 0)] [] [] [] ) () )] () () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-string_03-2cd8fec.stdout0000664000175000017500000006062615141516316026205 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 @string_const_data = private constant [8 x i8] c"learned " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data, i32 0, i32 0), i64 8 }> @string_const_data.1 = private constant [5 x i8] c"from " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.1, i32 0, i32 0), i64 5 }> @string_const_data.3 = private constant [4 x i8] c"the " @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.3, i32 0, i32 0), i64 4 }> @string_const_data.5 = private constant [4 x i8] c"best" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @string_const_data.7 = private constant [5 x i8] c"I've " @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.7, i32 0, i32 0), i64 5 }> @0 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @1 = private unnamed_addr constant [103 x i8] c"At 21:12 of file tests/../integration_tests/string_03.f90\0AArgument %d of subroutine %s is unallocated.\00", align 1 @2 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @3 = private unnamed_addr constant [103 x i8] c"At 21:12 of file tests/../integration_tests/string_03.f90\0AArgument %d of subroutine %s is unallocated.\00", align 1 @4 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @5 = private unnamed_addr constant [103 x i8] c"At 21:12 of file tests/../integration_tests/string_03.f90\0AArgument %d of subroutine %s is unallocated.\00", align 1 @6 = private unnamed_addr constant [25 x i8] c"_lcompilers_stringconcat\00", align 1 @7 = private unnamed_addr constant [103 x i8] c"At 21:12 of file tests/../integration_tests/string_03.f90\0AArgument %d of subroutine %s is unallocated.\00", align 1 @string_const_data.9 = private constant [1 x i8] c"." @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.9, i32 0, i32 0), i64 1 }> @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @_lcompilers_stringconcat(%string_descriptor* %s1, %string_descriptor* %s2, i32* %s1_len, i32* %s2_len, %string_descriptor* %concat_result) { .entry: %0 = load i32, i32* %s1_len, align 4 %1 = load i32, i32* %s2_len, align 4 %2 = add i32 %0, %1 %3 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %4 = load i8*, i8** %3, align 8 %5 = icmp ne i8* %4, null br i1 %5, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %6 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %7 = sext i32 %2 to i64 %8 = call i8* @_lfortran_string_malloc(i64 %7) store i8* %8, i8** %6, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 1 %10 = sext i32 %2 to i64 store i64 %10, i64* %9, align 4 %11 = load i32, i32* %s1_len, align 4 %12 = sext i32 %11 to i64 %13 = sub i64 %12, 1 %14 = add i64 %13, 1 %15 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %StrSliceGEP = getelementptr i8, i8* %16, i64 0 %StrSlice_StrView = alloca %string_descriptor, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %17, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %14, i64* %18, align 4 %19 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %20 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %21 = getelementptr %string_descriptor, %string_descriptor* %s1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %s1, i32 0, i32 1 %24 = load i64, i64* %23, align 4 call void @_lfortran_strcpy(i8** %19, i64* %20, i8 0, i8 0, i8* %22, i64 %24) %25 = load i32, i32* %s1_len, align 4 %26 = add i32 %25, 1 %27 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 1 %28 = load i64, i64* %27, align 4 %29 = trunc i64 %28 to i32 %30 = sext i32 %26 to i64 %31 = sext i32 %29 to i64 %32 = sub i64 %31, %30 %33 = add i64 %32, 1 %34 = getelementptr %string_descriptor, %string_descriptor* %concat_result, i32 0, i32 0 %35 = load i8*, i8** %34, align 8 %36 = sext i32 %26 to i64 %37 = sub i64 %36, 1 %StrSliceGEP1 = getelementptr i8, i8* %35, i64 %37 %StrSlice_StrView2 = alloca %string_descriptor, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 0 store i8* %StrSliceGEP1, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 1 store i64 %33, i64* %39, align 4 %40 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 0 %41 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView2, i32 0, i32 1 %42 = getelementptr %string_descriptor, %string_descriptor* %s2, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %s2, i32 0, i32 1 %45 = load i64, i64* %44, align 4 call void @_lfortran_strcpy(i8** %40, i64* %41, i8 0, i8 0, i8* %43, i64 %45) br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE__lcompilers_stringconcat FINALIZE_SYMTABLE__lcompilers_stringconcat: ; preds = %return ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_string_malloc(i64) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__libasr__created__var__0_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__0_return_slot, align 1 %__libasr__created__var__1_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__1_return_slot, align 1 %__libasr__created__var__2_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__2_return_slot, align 1 %__libasr__created__var__3_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__3_return_slot, align 1 %__libasr__created__var__4_return_slot = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %__libasr__created__var__4_return_slot, align 1 %combined = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %combined, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 1 store i64 29, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 29) store i8* %4, i8** %3, align 8 %last_name = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %last_name, align 1 %5 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 1 store i64 7, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %7 = call i8* @_lfortran_malloc(i64 7) store i8* %7, i8** %6, align 8 %posit = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %posit, align 1 %8 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 1 store i64 5, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %10 = call i8* @_lfortran_malloc(i64 5) store i8* %10, i8** %9, align 8 %title = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1 %11 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 store i64 4, i64* %11, align 4 %12 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %13 = call i8* @_lfortran_malloc(i64 4) store i8* %13, i8** %12, align 8 %verb = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %verb, align 1 %14 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 1 store i64 8, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %16 = call i8* @_lfortran_malloc(i64 8) store i8* %16, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %18 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 1 %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %17, i64* %18, i8 0, i8 0, i8* %19, i64 8) %20 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %21 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 1 %22 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %20, i64* %21, i8 0, i8 0, i8* %22, i64 5) %23 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %24 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1 %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %23, i64* %24, i8 0, i8 0, i8* %25, i64 4) %26 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %27 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 1 %28 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %26, i64* %27, i8 0, i8 0, i8* %28, i64 4) %29 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %30 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 1 %31 = load i8*, i8** %29, align 8 call void @_lfortran_free(i8* %31) store i8* null, i8** %29, align 8 store i64 0, i64* %30, align 4 store i32 5, i32* %call_arg_value, align 4 store i32 8, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* @string_const.8, %string_descriptor* %verb, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__0_return_slot) %32 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %33 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 1 %34 = load i8*, i8** %32, align 8 call void @_lfortran_free(i8* %34) store i8* null, i8** %32, align 8 store i64 0, i64* %33, align 4 %35 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = ptrtoint i8* %36 to i64 %38 = icmp eq i64 %37, 0 br i1 %38, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @1, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry store i32 13, i32* %call_arg_value, align 4 store i32 5, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__0_return_slot, %string_descriptor* %posit, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__1_return_slot) %39 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %40 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 1 %41 = load i8*, i8** %39, align 8 call void @_lfortran_free(i8* %41) store i8* null, i8** %39, align 8 store i64 0, i64* %40, align 4 %42 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = ptrtoint i8* %43 to i64 %45 = icmp eq i64 %44, 0 br i1 %45, label %then2, label %ifcont3 then2: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @3, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont3: ; preds = %ifcont store i32 18, i32* %call_arg_value, align 4 store i32 4, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__1_return_slot, %string_descriptor* %title, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__2_return_slot) %46 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %47 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 1 %48 = load i8*, i8** %46, align 8 call void @_lfortran_free(i8* %48) store i8* null, i8** %46, align 8 store i64 0, i64* %47, align 4 %49 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %50 = load i8*, i8** %49, align 8 %51 = ptrtoint i8* %50 to i64 %52 = icmp eq i64 %51, 0 br i1 %52, label %then4, label %ifcont5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @5, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 store i32 22, i32* %call_arg_value, align 4 store i32 7, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__2_return_slot, %string_descriptor* %last_name, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__3_return_slot) %53 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %54 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 1 %55 = load i8*, i8** %53, align 8 call void @_lfortran_free(i8* %55) store i8* null, i8** %53, align 8 store i64 0, i64* %54, align 4 %56 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %57 = load i8*, i8** %56, align 8 %58 = ptrtoint i8* %57 to i64 %59 = icmp eq i64 %58, 0 br i1 %59, label %then6, label %ifcont7 then6: ; preds = %ifcont5 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @7, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont7: ; preds = %ifcont5 store i32 29, i32* %call_arg_value, align 4 store i32 1, i32* %call_arg_value1, align 4 call void @_lcompilers_stringconcat(%string_descriptor* %__libasr__created__var__3_return_slot, %string_descriptor* @string_const.10, i32* %call_arg_value, i32* %call_arg_value1, %string_descriptor* %__libasr__created__var__4_return_slot) %60 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %61 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 1 %62 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %63 = load i8*, i8** %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 1 %65 = load i64, i64* %64, align 4 call void @_lfortran_strcpy(i8** %60, i64* %61, i8 0, i8 0, i8* %63, i64 %65) %66 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %67 = load i8*, i8** %66, align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %67, i32 29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %ifcont7 br label %FINALIZE_SYMTABLE_string_03 FINALIZE_SYMTABLE_string_03: ; preds = %return br label %Finalize_Variable___libasr__created__var__0_return_slot Finalize_Variable___libasr__created__var__0_return_slot: ; preds = %FINALIZE_SYMTABLE_string_03 %68 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0_return_slot, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = icmp eq i8* %69, null br i1 %70, label %free_done, label %free_nonnull free_nonnull: ; preds = %Finalize_Variable___libasr__created__var__0_return_slot call void @_lfortran_free(i8* %69) br label %free_done free_done: ; preds = %free_nonnull, %Finalize_Variable___libasr__created__var__0_return_slot br label %Finalize_Variable___libasr__created__var__1_return_slot Finalize_Variable___libasr__created__var__1_return_slot: ; preds = %free_done %71 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__1_return_slot, i32 0, i32 0 %72 = load i8*, i8** %71, align 8 %73 = icmp eq i8* %72, null br i1 %73, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %Finalize_Variable___libasr__created__var__1_return_slot call void @_lfortran_free(i8* %72) br label %free_done9 free_done9: ; preds = %free_nonnull8, %Finalize_Variable___libasr__created__var__1_return_slot br label %Finalize_Variable___libasr__created__var__2_return_slot Finalize_Variable___libasr__created__var__2_return_slot: ; preds = %free_done9 %74 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__2_return_slot, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = icmp eq i8* %75, null br i1 %76, label %free_done11, label %free_nonnull10 free_nonnull10: ; preds = %Finalize_Variable___libasr__created__var__2_return_slot call void @_lfortran_free(i8* %75) br label %free_done11 free_done11: ; preds = %free_nonnull10, %Finalize_Variable___libasr__created__var__2_return_slot br label %Finalize_Variable___libasr__created__var__3_return_slot Finalize_Variable___libasr__created__var__3_return_slot: ; preds = %free_done11 %77 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__3_return_slot, i32 0, i32 0 %78 = load i8*, i8** %77, align 8 %79 = icmp eq i8* %78, null br i1 %79, label %free_done13, label %free_nonnull12 free_nonnull12: ; preds = %Finalize_Variable___libasr__created__var__3_return_slot call void @_lfortran_free(i8* %78) br label %free_done13 free_done13: ; preds = %free_nonnull12, %Finalize_Variable___libasr__created__var__3_return_slot br label %Finalize_Variable___libasr__created__var__4_return_slot Finalize_Variable___libasr__created__var__4_return_slot: ; preds = %free_done13 %80 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__4_return_slot, i32 0, i32 0 %81 = load i8*, i8** %80, align 8 %82 = icmp eq i8* %81, null br i1 %82, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %Finalize_Variable___libasr__created__var__4_return_slot call void @_lfortran_free(i8* %81) br label %free_done15 free_done15: ; preds = %free_nonnull14, %Finalize_Variable___libasr__created__var__4_return_slot br label %Finalize_Variable_combined Finalize_Variable_combined: ; preds = %free_done15 %83 = getelementptr %string_descriptor, %string_descriptor* %combined, i32 0, i32 0 %84 = load i8*, i8** %83, align 8 %85 = icmp eq i8* %84, null br i1 %85, label %free_done17, label %free_nonnull16 free_nonnull16: ; preds = %Finalize_Variable_combined call void @_lfortran_free(i8* %84) br label %free_done17 free_done17: ; preds = %free_nonnull16, %Finalize_Variable_combined br label %Finalize_Variable_last_name Finalize_Variable_last_name: ; preds = %free_done17 %86 = getelementptr %string_descriptor, %string_descriptor* %last_name, i32 0, i32 0 %87 = load i8*, i8** %86, align 8 %88 = icmp eq i8* %87, null br i1 %88, label %free_done19, label %free_nonnull18 free_nonnull18: ; preds = %Finalize_Variable_last_name call void @_lfortran_free(i8* %87) br label %free_done19 free_done19: ; preds = %free_nonnull18, %Finalize_Variable_last_name br label %Finalize_Variable_posit Finalize_Variable_posit: ; preds = %free_done19 %89 = getelementptr %string_descriptor, %string_descriptor* %posit, i32 0, i32 0 %90 = load i8*, i8** %89, align 8 %91 = icmp eq i8* %90, null br i1 %91, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %Finalize_Variable_posit call void @_lfortran_free(i8* %90) br label %free_done21 free_done21: ; preds = %free_nonnull20, %Finalize_Variable_posit br label %Finalize_Variable_title Finalize_Variable_title: ; preds = %free_done21 %92 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0 %93 = load i8*, i8** %92, align 8 %94 = icmp eq i8* %93, null br i1 %94, label %free_done23, label %free_nonnull22 free_nonnull22: ; preds = %Finalize_Variable_title call void @_lfortran_free(i8* %93) br label %free_done23 free_done23: ; preds = %free_nonnull22, %Finalize_Variable_title br label %Finalize_Variable_verb Finalize_Variable_verb: ; preds = %free_done23 %95 = getelementptr %string_descriptor, %string_descriptor* %verb, i32 0, i32 0 %96 = load i8*, i8** %95, align 8 %97 = icmp eq i8* %96, null br i1 %97, label %free_done25, label %free_nonnull24 free_nonnull24: ; preds = %Finalize_Variable_verb call void @_lfortran_free(i8* %96) br label %free_done25 free_done25: ; preds = %free_nonnull24, %Finalize_Variable_verb ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_free(i8*) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-format_02-3deee60.stdout0000664000175000017500000000016215141516316026363 0ustar alastairalastairprogram format_02 implicit none integer :: i6, format(3) i6 = 2 format(i6) = 3 1 format(i6) end program format_02 lfortran-lfortran-2f73434/tests/reference/ast-modules_06-7f94d73.json0000664000175000017500000000072315141516316025377 0ustar alastairalastair{ "basename": "ast-modules_06-7f94d73", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/modules_06.f90", "infile_hash": "7699c2084686f687c1681ea9d088f613f3530b48449a37df5fc1cdce", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_06-7f94d73.stdout", "stdout_hash": "c0ee9e8b3a3b67c56ad2253ff4960b01353bf58c0c8433d1b1199f3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_01-a82b6b0.stderr0000664000175000017500000000005615141516316031134 0ustar alastairalastairruntime error: Variable 'x' is not allocated. lfortran-lfortran-2f73434/tests/reference/asr-case_02-8557909.stdout0000664000175000017500000004210615141516316025051 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_02: (Program (SymbolTable 2 { marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), out: (Variable 2 out [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) case_02 [] [(Assignment (Var 2 marks) (IntegerConstant 81 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Assignment (Var 2 out) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Assignment (Var 2 out) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 out) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerConstant 91 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) [(Print (StringConstant "Excellent!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 81 (Integer 4) Decimal) (IntegerConstant 90 (Integer 4) Decimal) [(Print (StringConstant "Very good!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 71 (Integer 4) Decimal) (IntegerConstant 80 (Integer 4) Decimal) [(Print (StringConstant "Well done!" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 61 (Integer 4) Decimal) (IntegerConstant 70 (Integer 4) Decimal) [(Print (StringConstant "Not bad!" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range (IntegerConstant 41 (Integer 4) Decimal) (IntegerConstant 60 (Integer 4) Decimal) [(Print (StringConstant "You passed!" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerConstant 40 (Integer 4) Decimal) [(Print (StringConstant "Better try again!" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-associate1-2443d15.json0000664000175000017500000000072315141516316025355 0ustar alastairalastair{ "basename": "ast-associate1-2443d15", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/associate1.f90", "infile_hash": "1f90b3ef799fb354098ee524279bb2b71bf3813b43f2269fb014ec0d", "outfile": null, "outfile_hash": null, "stdout": "ast-associate1-2443d15.stdout", "stdout_hash": "dbea42dbd5c861f08fccd9b1c0a0f8f8e00eee3a5a671ff65ecdd525", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_clojure-functions_10-476558d.json0000664000175000017500000000102415141516316027365 0ustar alastairalastair{ "basename": "asr_clojure-functions_10-476558d", "cmd": "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_10.f90", "infile_hash": "fe4afd6d0a7065df5d59b482ad1bc0447df5303dc8246e85aa192fe0", "outfile": null, "outfile_hash": null, "stdout": "asr_clojure-functions_10-476558d.stdout", "stdout_hash": "2086ca2c42981f07f57a87c585a8d9caaa1750c0465cfc3c1989c134", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_14-75884fe.json0000664000175000017500000000077215141516316026601 0ustar alastairalastair{ "basename": "asr-derived_types_14-75884fe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_14.f90", "infile_hash": "e48139c0e3c8b0587ad6aa57eb7d1790439bcf6b7b8318bdf1274c50", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_14-75884fe.stdout", "stdout_hash": "0d0149a8230b4a3780cbce1801cdfcc41021422e53165ad040820f05", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-merge_bits_comp-23a3e67.stderr0000664000175000017500000000031015141516316027063 0ustar alastairalastairsemantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/merge_bits_comp.f90:2:14 | 2 | print *, merge_bits(8, 12_8, 2) | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-derived_types_15-7fde02a.json0000664000175000017500000000077215141516316026720 0ustar alastairalastair{ "basename": "asr-derived_types_15-7fde02a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_15.f90", "infile_hash": "4a9c6de3f501d516ab583d590255d6ee6fa4080e40b889d5444eaf34", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_15-7fde02a.stdout", "stdout_hash": "c2ea472aea861b990ee5ef14b0105e471f3fd2c26d2c1bc8ff481b8b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing3-c82e537.json0000664000175000017500000000077615141516316026710 0ustar alastairalastair{ "basename": "asr-implicit_typing3-c82e537", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing3.f90", "infile_hash": "52031ab41770ad4bad18b3bb531777da6ece1a5be640043d6a1605d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing3-c82e537.stderr", "stderr_hash": "515c19327a17d5b2120b4d1677df5f90ccc9eab0b82be69c50a5f1fc", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err1-3303e2d.json0000664000175000017500000000076015141516316027355 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err1-3303e2d", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err1.f90", "infile_hash": "23e51783eb4369831ce46ce833eb9cc9515efc146635e9632539dd29", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err1-3303e2d.stderr", "stderr_hash": "ce8ab463670d35380fa53d05fada97fed07d89903bc9564e980c1022", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-ishftc_size-1254b50.stderr0000664000175000017500000000030615141516316026154 0ustar alastairalastairsemantic error: The SHIFT argument must be less than or equal to the of SIZE argument --> tests/errors/ishftc_size.f90:2:14 | 2 | print *, ishftc(10, 6, 4) | ^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-subroutines_03-9a95e25.stdout0000664000175000017500000001276115141516316026660 0ustar alastairalastair(TranslationUnit [(Program subroutines_03 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ()) (l [] [] () () None ())] () )] [(Assignment 0 i 1 () ) (Assignment 0 j 1 () ) (Assignment 0 k 1 () ) (Assignment 0 l 1 () ) (SubroutineCall 0 f [] [(() i () 0) (() j () 0) (() k () 0) (() l () 0)] [] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [(() i () 0) (() j () 0)] [(d l) (c k)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [] [(a i) (b j) (d l) (c k)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 f [] [] [(b j) (a i) (c k) (d l)] [] () ) (Print 0 () [j] () ) (If 0 () (/= j 4) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(b [] [] () () None ())] () )] [(Assignment 0 b (+ (+ (+ a 1) c) d) () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-cmplx_01-89b858d.stderr0000664000175000017500000000023115141516316025373 0ustar alastairalastairsemantic error: Missing actual argument 'x' in call to 'cmplx' --> tests/errors/cmplx_01.f90:3:9 | 3 | a = cmplx(y = 2) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_02-250a492.json0000664000175000017500000000100115141516316030051 0ustar alastairalastair{ "basename": "ast-program_without_line_02-250a492", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_02.f90", "infile_hash": "9879692314d25d3cb4e64d2849069dfde5f8bc21c8003300119e80b2", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_02-250a492.stdout", "stdout_hash": "cecb5013af867fa1849c74cf81134bb3505379e5153c7e8839a48508", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-mre_segfault-52f14b4.stderr0000664000175000017500000000046215141516316026426 0ustar alastairalastairsemantic error: Dimension mismatch in `allocate` statement. --> tests/errors/mre_segfault.f90:6:14 | 6 | allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mismatch in dimensions between allocated variable and `source` lfortran-lfortran-2f73434/tests/reference/llvm-nested_05-0252368.stdout0000664000175000017500000002721315141516316025571 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global i32 0 @__module___lcompilers_created__nested_context__b__y = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_05_a_b() { .entry: %x = alloca i32, align 4 %y = alloca float, align 4 store i32 6, i32* %x, align 4 store float 5.500000e+00, float* %y, align 4 %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %x) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry %11 = alloca i64, align 8 %12 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %11, i32 0, i32 0, float* %y) %13 = load i64, i64* %11, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %13, i64* %15, align 4 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %19 = load i64, i64* %18, align 4 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %12) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %22 = load i32, i32* %x, align 4 store i32 %22, i32* @__module___lcompilers_created__nested_context__b__x, align 4 %23 = load float, float* %y, align 4 store float %23, float* @__module___lcompilers_created__nested_context__b__y, align 4 call void @b.__module_nested_05_a_c() %24 = load i32, i32* @__module___lcompilers_created__nested_context__b__x, align 4 store i32 %24, i32* %x, align 4 %25 = load float, float* @__module___lcompilers_created__nested_context__b__y, align 4 store float %25, float* %y, align 4 %26 = alloca i64, align 8 %27 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %26, i32 0, i32 0, i32* %x) %28 = load i64, i64* %26, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %27, i8** %29, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %28, i64* %30, align 4 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %32 = load i8*, i8** %31, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %34 = load i64, i64* %33, align 4 %35 = trunc i64 %34 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %32, i32 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %36 = icmp eq i8* %27, null br i1 %36, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %27) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %37 = alloca i64, align 8 %38 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %37, i32 0, i32 0, float* %y) %39 = load i64, i64* %37, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %38, i8** %40, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %39, i64* %41, align 4 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %43 = load i8*, i8** %42, align 8 %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %45 = load i64, i64* %44, align 4 %46 = trunc i64 %45 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %47 = icmp eq i8* %38, null br i1 %47, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %38) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 br label %return return: ; preds = %free_done9 br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_05_a_c() { .entry: %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__b__x) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry %11 = alloca i64, align 8 %12 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %11, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__y) %13 = load i64, i64* %11, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %13, i64* %15, align 4 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %19 = load i64, i64* %18, align 4 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %12) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store i32 4, i32* @__module___lcompilers_created__nested_context__b__x, align 4 store float 3.500000e+00, float* @__module___lcompilers_created__nested_context__b__y, align 4 br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_05_a_b() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_05 FINALIZE_SYMTABLE_nested_05: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-preprocess_01-20f7efb.stderr0000664000175000017500000000166015141516316026564 0ustar alastairalastairwarning: #ifdef ignored --> tests/warnings/preprocess_01.f90:6:1 | 6 | #ifdef pqr | ^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #elif ignored --> tests/warnings/preprocess_01.f90:8:1 | 8 | #elif mno == 18 | ^^^^^^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #else ignored --> tests/warnings/preprocess_01.f90:10:1 | 10 | #else | ^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #endif ignored --> tests/warnings/preprocess_01.f90:13:1 | 13 | #endif | ^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: #define ignored --> tests/warnings/preprocess_01.f90:16:1 | 16 | #define abc(m, n) m + n | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the '--cpp' command line option to preprocess it warning: Unsupported macro --> tests/warnings/preprocess_01.f90:18:1 | 18 | #abcd | ^^^^^^ Ignored lfortran-lfortran-2f73434/tests/reference/cpp-case_05-96724df.stdout0000664000175000017500000000206015141516316025177 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static std::string grade="B"; if (grade == "A") { std::cout<< "Excellent!"< @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_02_a_b() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) call void @b.__module_nested_02_a_c() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_02_a_c() { .entry: %0 = alloca i64, align 8 %1 = alloca i32, align 4 store i32 5, i32* %1, align 4 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %1) %3 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_nested_02_a_b() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_02 FINALIZE_SYMTABLE_nested_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_23-db1ffb5.json0000664000175000017500000000076115141516316026315 0ustar alastairalastair{ "basename": "asr-intrinsics_23-db1ffb5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_23.f90", "infile_hash": "3e162c296e5df394ddaea3689028b9cb97cd97e8bf9fdc0296eb6697", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_23-db1ffb5.stdout", "stdout_hash": "c8337d79439b61bf9d9742fafc1e915690cbc2e991ee9868a7177d99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-associate_02-558b0e6.json0000664000175000017500000000076115141516316026052 0ustar alastairalastair{ "basename": "llvm-associate_02-558b0e6", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_02.f90", "infile_hash": "d3505eea2e17cbf463e707ee2faf24aedf12a13ebb06fee4a5a1adfb", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_02-558b0e6.stdout", "stdout_hash": "31bd1c1429c4acf74b8a5612df4254288b5bbcc1bdc6bc91fe9109fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_01-960dafe.json0000664000175000017500000000077215141516316026721 0ustar alastairalastair{ "basename": "asr-derived_types_01-960dafe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_01-960dafe.stdout", "stdout_hash": "c63e8c94cac1b40133569f1d0b99ce40743b4e7ace712c59589d2a0c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-end_submodule_name-68b3188.json0000664000175000017500000000076215141516316027166 0ustar alastairalastair{ "basename": "ast-end_submodule_name-68b3188", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/end_submodule_name.f90", "infile_hash": "f9039511b99302723f1272b756b90765abc5599941fddb1657b7fbd8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-end_submodule_name-68b3188.stderr", "stderr_hash": "a26340a4230e3b77a5d168d545fad2a8ad5ba9290ab1bf904c470390", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-open_invalid_kwarg1-6af4cc2.json0000664000175000017500000000076515141516316027472 0ustar alastairalastair{ "basename": "asr-open_invalid_kwarg1-6af4cc2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/open_invalid_kwarg1.f90", "infile_hash": "9895f5bfe883839c27fe278179fb6d79d198260a40cb9854f70539ce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-open_invalid_kwarg1-6af4cc2.stderr", "stderr_hash": "7ecd8f5906d20115acb3bf2fe83edfb36c417d7b97acf30c5e9e6c16", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-transfer_09-a440034.json0000664000175000017500000000075315141516316025447 0ustar alastairalastair{ "basename": "asr-transfer_09-a440034", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/transfer_09.f90", "infile_hash": "e76993559a0b5a14c872b6b2ee4229f7d830997c80a68a73a9a1ccad", "outfile": null, "outfile_hash": null, "stdout": "asr-transfer_09-a440034.stdout", "stdout_hash": "0d783ceaeddb725aa556f7eeb514ba8789c8410378fe35e7a329bfb9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_04-0d478be.json0000664000175000017500000000072315141516316025441 0ustar alastairalastair{ "basename": "asr-modules_04-0d478be", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_04.f90", "infile_hash": "001166d3ec02d038539957e7b333b2f02902687e96980e325831c745", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_04-0d478be.stdout", "stdout_hash": "c69321a70c983344b0941e301b4d57f2210008fa7fb6ad04f726a188", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_08-3680946.json0000664000175000017500000000077215141516316026435 0ustar alastairalastair{ "basename": "asr-derived_types_08-3680946", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_08.f90", "infile_hash": "4a51a56bca5f067223957705f8a8642e29e5decf9059e675b67d5df0", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_08-3680946.stdout", "stdout_hash": "68914149bb4fcbd2848e79b146dc62b1eccef0422edc6768a44473cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-no_prescan_include1-6ceca31.stdout0000664000175000017500000000362615141516316030031 0ustar alastairalastair(TranslationUnit [(Program if1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (== i 5) [(Print 0 () [(String "correct" ())] () )] [] () () () ) (If 0 () (== i 6) [(Print 0 () [(String "incorrect" ())] () )] [] () () () ) (Assignment 0 i (u- 2) () ) (Assignment 40 i (+ i 1) () ) (IfArithmetic 0 () i 50 60 70 () ) (Print 50 () [(String "i < 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 60 () [(String "i == 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 70 () [(String "i > 0" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_02-1c20d1a.stdout0000664000175000017500000004352215141516316026507 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_02: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) (RealConstant 0.997495 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_02 [] [(Assignment (Var 2 y) (Cast (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.997495 (Real 8) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 0.997495 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(Var 2 x)] 0 (Real 4) () ) Sub (RealConstant 0.840115 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 y) Sub (Cast (RealConstant 0.997495 (Real 4) ) RealToReal (Real 8) (RealConstant 0.997495 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.997495 (Real 4) ) ) Add (IntrinsicElementalFunction Sin [(RealBinOp (RealConstant 0.500000 (Real 4) ) Add (IntrinsicElementalFunction Sin [(RealConstant 0.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.479426 (Real 4) ) ) (Real 4) (RealConstant 0.979426 (Real 4) ) )] 0 (Real 4) (RealConstant 0.830177 (Real 4) ) ) (Real 4) (RealConstant 1.827672 (Real 4) ) )] 0 (Real 4) (RealConstant 0.967188 (Real 4) ) ) Sub (RealConstant 0.967188 (Real 4) ) (Real 4) (RealConstant -0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Sin [(RealBinOp (IntrinsicElementalFunction Sin [(Var 2 y)] 0 (Real 8) () ) Add (Cast (IntrinsicElementalFunction Sin [(RealBinOp (Var 2 x) Add (IntrinsicElementalFunction Sin [(Var 2 x)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) RealToReal (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 0.972762 (Real 4) ) RealToReal (Real 8) (RealConstant 0.972762 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-global_scope6-b11d04e.json0000664000175000017500000000073415141516316026172 0ustar alastairalastair{ "basename": "asr-global_scope6-b11d04e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope6-b11d04e.stdout", "stdout_hash": "9d3fcc521f23408bc5ddf5655d2d338ba014d0633cf391e27c60d227", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_kind-80c5bf4.stderr0000664000175000017500000000030715141516316033665 0ustar alastairalastairsemantic error: Element in `real(8)` array constructor is `real(4)` --> tests/errors/array_constructor_with_different_kind.f90:4:18 | 4 | print *, [x, [1., 2.]] | ^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-const_real_dp-fa55d4d.stdout0000664000175000017500000001334415141516316026735 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_real_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) const_real_dp [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 u) (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 v) (RealConstant 1.050000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 1.050000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 zero) (Var 2 v) (Var 2 x) (Var 2 u)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-nested_struct_proc_01-3b9017b.json0000664000175000017500000000101115141516316027600 0ustar alastairalastair{ "basename": "asr-nested_struct_proc_01-3b9017b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_struct_proc_01.f90", "infile_hash": "8a662720d113b97e4852f55c5784ac8f1397c5d43e1a49097bb18c4f", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_struct_proc_01-3b9017b.stdout", "stdout_hash": "272c604acd63f161dcc6976f9fdc6eb3edc07e620d31747cb3de0b26", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_dead_code_removal-case_06-e7f007f.stdout0000664000175000017500000004263515141516316031145 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), grade_fixed: (Variable 2 grade_fixed [] Local (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "B" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), marks: (Variable 2 marks [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), marks_fixed: (Variable 2 marks_fixed [] Local (IntegerConstant 94 (Integer 4) Decimal) (IntegerConstant 94 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cond_03 [] [(If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (Print (StringFormat () [(StringConstant "Your grade is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 grade_fixed)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 marks) (IntegerConstant 94 (Integer 4) Decimal) () .false. .false. ) (Select () (Var 2 marks) [(CaseStmt_Range (IntegerBinOp (IntegerConstant 40 (Integer 4) Decimal) Add (Var 2 bp) (Integer 4) (IntegerConstant 42 (Integer 4) Decimal) ) () [(Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (CaseStmt_Range () (IntegerBinOp (IntegerConstant 39 (Integer 4) Decimal) Sub (Var 2 ap) (Integer 4) (IntegerConstant 38 (Integer 4) Decimal) ) [(Print (StringConstant "Failed!" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(Print (StringConstant "Invalid marks" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Pass!" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Your marks are " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 marks)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_01-280d5b3.json0000664000175000017500000000075315141516316027060 0ustar alastairalastair{ "basename": "asr-dependency_test_01-280d5b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_01.f90", "infile_hash": "cfea9e80612bf56dfd74d8207d5291bad0aea56ade74a8da6d0be11d", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_01-280d5b3.stdout", "stdout_hash": "428499ca1c2747b736cc2f1e7b9876be8acc33cff7c63b3ec94b7207", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-save1-7ce7ccf.stdout0000664000175000017500000007660615141516316025237 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 7 { x: (Variable 7 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [] ), save_fun: (Function (SymbolTable 3 { save_fun: (Variable 3 save_fun [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_fun (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 save_fun) Public .false. .false. () ), save_module: (Module (SymbolTable 4 { fun_save: (Function (SymbolTable 6 { fun_save: (Variable 6 fun_save [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fun_save (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 fun_save) Public .false. .false. () ), sub_save: (Function (SymbolTable 5 { x: (Variable 5 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 5 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub_save (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), x: (Variable 4 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_module () [] .false. .false. .false. ), save_sub: (Function (SymbolTable 2 { x: (Variable 2 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-types_13-76138b5.stdout0000664000175000017500000006037515141516316025363 0ustar alastairalastair(TranslationUnit [(Program types_13 () [(Use [] iso_c_binding [(UseSymbol c_int () ) (UseSymbol c_double () ) (UseSymbol c_char () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine g [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [] () () DoubleAsterisk ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g2 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(len () Star)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g3 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(len () Star) (kind c_char Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g4 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(() () Star) (kind c_char Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g5 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_char] ImportDefault () )] [] [(Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Star)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine g6 [(d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [] [(d [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f1 [(a) (b) (c) (d)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f2 [(a) (b) (c) (d)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f3 [(a) (b) (c) (d)] [] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function f4 [(a) (b) (c) (d)] [] r (Bind [c] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() 4 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [(() 4 Value)] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine f5 [(a) (b) (c)] [] (Bind [C] [(name (String "_cf5" ()))] ) () [] [(Import [c_int] ImportDefault () ) (Import [c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_double Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(c [] [] () () None ())] () )] [] [] [] ) )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array_bound_1-b0c2255.json0000664000175000017500000000076115141516316026122 0ustar alastairalastair{ "basename": "asr-array_bound_1-b0c2255", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_bound_1.f90", "infile_hash": "38d2c1d99ad714fdaa387541310a78f8d3c4d7e19e93ed67a2dcf677", "outfile": null, "outfile_hash": null, "stdout": "asr-array_bound_1-b0c2255.stdout", "stdout_hash": "7e64bb02f6e2f99ae30b3d290a40d6a084700e83c13593e20d23afb6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-fixed_form1-f592417.stdout0000664000175000017500000000741715141516316026575 0ustar alastairalastairsubroutine dqawse(f, a, b, alfa, beta, integr, epsabs, epsrel, limit, result, abserr, neval, ier, alist, blist, rlist, elist, iord, last) double precision :: a, abserr, alfa, alist, area, area1, area12, area2, a1, a2, b, beta, blist, b1, b2, centre, dabs, dmax1, d1mach, elist, epmach, epsabs, epsrel, errbnd, errmax, error1, erro12, error2, errsum, f, resas1, resas2, result, rg, rh, ri, rj, rlist, uflow integer :: ier, integr, iord, iroff1, iroff2, k, last, limit, maxerr, nev, neval, nrmax external :: f dimension :: alist(limit), blist(limit), rlist(limit), elist(limit), iord(limit), ri(25), rj(25), rh(25), rg(25) epmach = d1mach(4) uflow = d1mach(1) ier = 6 neval = 0 last = 0 rlist(1) = 0.0d+00 elist(1) = 0.0d+00 iord(1) = 0 result = 0.0d+00 abserr = 0.0d+00 if (b <= a .or. epsabs == 0.0d+00 .and. epsrel < dmax1(0.5d+02*epmach, 0.5d-28) .or. alfa <= -0.1d+01 .or. beta <= -0.1d+01 .or. integr < 1 .or. integr > 4 .or. limit < 2) then go to 999 end if ier = 0 call dqmomo(alfa, beta, ri, rj, rg, rh, integr) centre = 0.5d+00*(b + a) call dqc25s(f, a, b, a, centre, alfa, beta, ri, rj, rg, rh, area1, error1, resas1, integr, nev) neval = nev call dqc25s(f, a, b, centre, b, alfa, beta, ri, rj, rg, rh, area2, error2, resas2, integr, nev) last = 2 neval = neval + nev result = area1 + area2 abserr = error1 + error2 errbnd = dmax1(epsabs, epsrel*dabs(result)) if (error2 > error1) then go to 10 end if alist(1) = a alist(2) = centre blist(1) = centre blist(2) = b rlist(1) = area1 rlist(2) = area2 elist(1) = error1 elist(2) = error2 go to 20 10 alist(1) = centre alist(2) = a blist(1) = b blist(2) = centre rlist(1) = area2 rlist(2) = area1 elist(1) = error2 elist(2) = error1 20 iord(1) = 1 iord(2) = 2 if (limit == 2) then ier = 1 end if if (abserr <= errbnd .or. ier == 1) then go to 999 end if errmax = elist(1) maxerr = 1 nrmax = 1 area = result errsum = abserr iroff1 = 0 iroff2 = 0 do last = 3, limit a1 = alist(maxerr) b1 = 0.5d+00*(alist(maxerr) + blist(maxerr)) a2 = b1 b2 = blist(maxerr) call dqc25s(f, a, b, a1, b1, alfa, beta, ri, rj, rg, rh, area1, error1, resas1, integr, nev) neval = neval + nev call dqc25s(f, a, b, a2, b2, alfa, beta, ri, rj, rg, rh, area2, error2, resas2, integr, nev) neval = neval + nev area12 = area1 + area2 erro12 = error1 + error2 errsum = errsum + erro12 - errmax area = area + area12 - rlist(maxerr) if (a == a1 .or. b == b2) then go to 30 end if if (resas1 == error1 .or. resas2 == error2) then go to 30 end if if (dabs(rlist(maxerr) - area12) < 0.1d-04*dabs(area12) .and. erro12 >= 0.99d+00*errmax) then iroff1 = iroff1 + 1 end if if (last > 10 .and. erro12 > errmax) then iroff2 = iroff2 + 1 end if 30 rlist(maxerr) = area1 rlist(last) = area2 errbnd = dmax1(epsabs, epsrel*dabs(area)) if (errsum <= errbnd) then go to 35 end if if (last == limit) then ier = 1 end if if (iroff1 >= 6 .or. iroff2 >= 20) then ier = 2 end if if (dmax1(dabs(a1), dabs(b2)) <= (0.1d+01 + 0.1d+03*epmach)*(dabs(a2) + 0.1d+04*uflow)) then ier = 3 end if 35 if (error2 > error1) then go to 40 end if alist(last) = a2 blist(maxerr) = b1 blist(last) = b2 elist(maxerr) = error1 elist(last) = error2 go to 50 40 alist(maxerr) = a2 alist(last) = a1 blist(last) = b1 rlist(maxerr) = area2 rlist(last) = area1 elist(maxerr) = error2 elist(last) = error1 50 call dqpsrt(limit, last, maxerr, errmax, elist, iord, nrmax) if (ier /= 0 .or. errsum <= errbnd) then go to 70 end if 60 continue end do 70 result = 0.0d+00 do k = 1, last result = result + rlist(k) 80 continue end do abserr = errsum 999 return end subroutine dqawse lfortran-lfortran-2f73434/tests/reference/ast-if2-65737e5.stdout0000664000175000017500000000352415141516316024373 0ustar alastairalastair(TranslationUnit [(Program expr2 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 time 12 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (< time 10) [(Print 0 () [(String "Good morning" ())] () )] [(If 0 () (< time 20) [(Print 0 () [(String "Good day" ())] () )] [(Print 0 () [(String "Good evening" ())] () )] () (TriviaNode [(EOLComment "! Comment 2" )] [(EOLComment "! Comment 3" )] ) () )] (TriviaNode [] [(EOLComment "! Comment 1" )] ) () (TriviaNode [] [(EOLComment "! Comment 4" ) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name1-9a3abcc.stdout0000664000175000017500000000026315141516316030304 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":3},"end":{"character":12,"line":3}},"uri":"tests/lookup_name1.f90"},"name":"x","filename":"tests/lookup_name1.f90"}]lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err6-47462f4.stderr0000664000175000017500000000021115141516316027640 0ustar alastairalastairC preprocessor error: Unexpected token '(', expected ')' --> tests/errors/cpp_err6.f90:2:13 | 2 | #if 1 + (1+2 ( | ^^^ lfortran-lfortran-2f73434/tests/reference/ast-do2-1ec601e.stderr0000664000175000017500000000040215141516316024467 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/do2.f90:5:1 | 5 | enddo | ^^^^^ help: write this as 'end do' style suggestion: Use 'end do' instead of 'enddo' --> tests/do2.f90:10:1 | 10 | enddo | ^^^^^ help: write this as 'end do' lfortran-lfortran-2f73434/tests/reference/asr-forall_01-11937e6.json0000664000175000017500000000074515141516316025113 0ustar alastairalastair{ "basename": "asr-forall_01-11937e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/forall_01.f90", "infile_hash": "a482aaee28abbbe45149c269745483f2ede65c21ea57212e6a647019", "outfile": null, "outfile_hash": null, "stdout": "asr-forall_01-11937e6.stdout", "stdout_hash": "bf74656889f375eed4ae027257d54c963389090a39862662cb22193d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-close1-0f44a73.stdout0000664000175000017500000000024415141516316025616 0ustar alastairalastairprogram close1 ! Tests for syntax (AST) only: close(u) close(unit=gmv_lun) close(unit=dxf%dunit, status="delete") close(UNIT=funit, IOSTAT=ierr) end program close1 lfortran-lfortran-2f73434/tests/reference/ast-case_01-929583e.stdout0000664000175000017500000001067315141516316025134 0ustar alastairalastair(TranslationUnit [(Program case_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [(() 8 Value)] () () None ) [] [(i [] [] () () None ()) (out [] [] () () None ())] () )] [(Assignment 0 i 4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Assignment 0 out 10 () ) (Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 )] () [(Assignment 0 out 20 () ) (Print 0 () [(String "2" ())] () )] ) (CaseStmt [(CaseCondExpr 3 )] () [(Assignment 0 out 30 () ) (Print 0 () [(String "3" ())] () )] ) (CaseStmt [(CaseCondExpr 4 )] () [(Assignment 0 out 40 () ) (Print 0 () [(String "4" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 40) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Assignment 0 out 11 () ) (Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 ) (CaseCondExpr 3 ) (CaseCondExpr 4 )] () [(Assignment 0 out 22 () ) (Print 0 () [(String "2,3,4" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 22) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_05-fe28e11.json0000664000175000017500000000075315141516316025606 0ustar alastairalastair{ "basename": "asr-template_05-fe28e11", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_05.f90", "infile_hash": "24c3ba37f04663194d5ce350c1ada395119516773d89212e1d2660d4", "outfile": null, "outfile_hash": null, "stdout": "asr-template_05-fe28e11.stdout", "stdout_hash": "b43f39fe56f0488a498f3659cd08ca3941225b1574991e072f98c039", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit3-016ebe4.json0000664000175000017500000000072715141516316025360 0ustar alastairalastair{ "basename": "asr-implicit3-016ebe4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit3.f90", "infile_hash": "81eb5c9f29f6bb8009a307265d8eee88678796bc4191a46a2dcca0c9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit3-016ebe4.stderr", "stderr_hash": "7c20bfccb68ceab2b01aa75a1e7bd53ccf182a26ca8906fa76142a7e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine3-8086030.stdout0000664000175000017500000000371515141516316026100 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 2 f) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_15-9f619ed.stderr0000664000175000017500000000020615141516316030177 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/array_bounds_check_15.f90:6:14 | 6 | print *, x | ^ lfortran-lfortran-2f73434/tests/reference/run-error_stop_04-8f1e721.json0000664000175000017500000000073115141516316026125 0ustar alastairalastair{ "basename": "run-error_stop_04-8f1e721", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/error_stop_04.f90", "infile_hash": "43fa904db7997988ab0d436e206706e0938feb0bf82ce0cbfec1fd67", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-error_stop_04-8f1e721.stderr", "stderr_hash": "03404f69d60aea2f0d4467699ed7e836de4bd9a3b4c7053c1419c68f", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-functions_15-ce4c4bb.json0000664000175000017500000000075615141516316026142 0ustar alastairalastair{ "basename": "asr-functions_15-ce4c4bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_15.f90", "infile_hash": "a12bb6ea6046f7462606bd7d550d6bc8a46655d6593d5a5e4425d051", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_15-ce4c4bb.stdout", "stdout_hash": "8c25ae4f25c29d30eba4a4d1e11f99cf339e76427ee4d9ec9f5918e6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-associate_03-68dfbc7.stdout0000664000175000017500000001317215141516316026571 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @associate_03.t1 = internal global i32 2 @associate_03.t2 = internal global i32 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* @associate_03.t1, i32* @associate_03.t2) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = load i32, i32* @associate_03.t1, align 4 %14 = load i32, i32* @associate_03.t2, align 4 %15 = icmp sgt i32 %13, %14 br i1 %15, label %then, label %else then: ; preds = %free_done store i32* @associate_03.t1, i32** %p1, align 8 br label %ifcont else: ; preds = %free_done store i32* @associate_03.t2, i32** %p1, align 8 br label %ifcont ifcont: ; preds = %else, %then %16 = alloca i64, align 8 %17 = load i32*, i32** %p1, align 8 %18 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32* %17) %19 = load i64, i64* %16, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %19, i64* %21, align 4 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %25 = load i64, i64* %24, align 4 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %ifcont call void @_lfortran_free(i8* %18) br label %free_done3 free_done3: ; preds = %free_nonnull2, %ifcont %28 = load i32*, i32** %p1, align 8 %29 = load i32, i32* %28, align 4 store i32 %29, i32* %i, align 4 %30 = load i32, i32* %i, align 4 %31 = load i32, i32* @associate_03.t2, align 4 %32 = icmp eq i32 %30, %31 br i1 %32, label %then4, label %else5 then4: ; preds = %free_done3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %free_done3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont6 br label %FINALIZE_SYMTABLE_associate_03 FINALIZE_SYMTABLE_associate_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/cpp-types_04-513a7e4.json0000664000175000017500000000072515141516316025050 0ustar alastairalastair{ "basename": "cpp-types_04-513a7e4", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_04-513a7e4.stdout", "stdout_hash": "0da727ad563ef43d5a8a91a69c4e298aebf6ea8c22d103cf88493afe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common_06-4a72d58.json0000664000175000017500000000074515141516316025210 0ustar alastairalastair{ "basename": "asr-common_06-4a72d58", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_06.f90", "infile_hash": "d770e487bb7df4c785092ea18e222d0bd79f616d66b2d39a4a76a04f", "outfile": null, "outfile_hash": null, "stdout": "asr-common_06-4a72d58.stdout", "stdout_hash": "dff42168136be81f07f3ad733a3431afd51e6a9340c902415ae4c311", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-forallloop_01-d1e2bfa.json0000664000175000017500000000076115141516316026272 0ustar alastairalastair{ "basename": "ast-forallloop_01-d1e2bfa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/forallloop_01.f90", "infile_hash": "d81387102a9ff31c123a828e4ead234d6971d67bca291dc5e40dc418", "outfile": null, "outfile_hash": null, "stdout": "ast-forallloop_01-d1e2bfa.stdout", "stdout_hash": "48cf8df7768c436b3f0e12b372d913c72075c901a90a83c2bc6fa213", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_struct_proc_01-3b9017b.stdout0000664000175000017500000021613315141516316030166 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { gftl2_integer32complex32orderedmap: (Module (SymbolTable 2 { character_kinds: (ExternalSymbol 2 character_kinds 4 character_kinds lfortran_intrinsic_iso_fortran_env [] character_kinds Public ), character_storage_size: (ExternalSymbol 2 character_storage_size 4 character_storage_size lfortran_intrinsic_iso_fortran_env [] character_storage_size Public ), compiler_options: (ExternalSymbol 2 compiler_options 4 compiler_options lfortran_intrinsic_iso_fortran_env [] compiler_options Public ), compiler_version: (ExternalSymbol 2 compiler_version 4 compiler_version lfortran_intrinsic_iso_fortran_env [] compiler_version Public ), error_unit: (ExternalSymbol 2 error_unit 4 error_unit lfortran_intrinsic_iso_fortran_env [] error_unit Public ), i32: (Variable 2 i32 [int32] Local (Var 2 int32) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), input_unit: (ExternalSymbol 2 input_unit 4 input_unit lfortran_intrinsic_iso_fortran_env [] input_unit Public ), int16: (ExternalSymbol 2 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 2 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), int8: (ExternalSymbol 2 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), integer32complex32orderedmap: (Struct (SymbolTable 9 { insert: (GenericProcedure 9 insert [9 insert_key_value] Public ), insert_key_value: (StructMethodDeclaration 9 insert_key_value () omap_insert_key_value 2 omap_insert_key_value Source .false. .false. ), map: (Variable 9 map [] Local () () Default (StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. ) 2 omap_map Source Private Required .false. .false. .false. () .false. .false. ) }) integer32complex32orderedmap (StructType [(StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) [omap_map] [map] [] Source Private .false. .false. [] () () ), integer_kinds: (ExternalSymbol 2 integer_kinds 4 integer_kinds lfortran_intrinsic_iso_fortran_env [] integer_kinds Public ), iostat_end: (ExternalSymbol 2 iostat_end 4 iostat_end lfortran_intrinsic_iso_fortran_env [] iostat_end Public ), iostat_eor: (ExternalSymbol 2 iostat_eor 4 iostat_eor lfortran_intrinsic_iso_fortran_env [] iostat_eor Public ), logical8: (ExternalSymbol 2 logical8 4 logical8 lfortran_intrinsic_iso_fortran_env [] logical8 Public ), logical_kinds: (ExternalSymbol 2 logical_kinds 4 logical_kinds lfortran_intrinsic_iso_fortran_env [] logical_kinds Public ), numeric_storage_size: (ExternalSymbol 2 numeric_storage_size 4 numeric_storage_size lfortran_intrinsic_iso_fortran_env [] numeric_storage_size Public ), omap_i_at_rc: (Function (SymbolTable 10 { 1_omap_map_stored_value: (ExternalSymbol 10 1_omap_map_stored_value 8 stored_value omap_map [] stored_value Public ), key: (Variable 10 key [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rc: (Variable 10 rc [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), this: (Variable 10 this [] In () () Default (StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .false. .false. ) 2 omap_map Source Public Required .false. .true. .false. () .false. .false. ) }) omap_i_at_rc (FunctionType [(StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .false. .false. ) (Integer 4) (Integer 4)] (Pointer (Complex 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 this) (Var 10 key) (Var 10 rc)] [(Associate (Var 10 res) (StructInstanceMember (Var 10 this) 10 1_omap_map_stored_value (Complex 4) () ) ) (Assignment (Var 10 rc) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 10 res) Public .false. .false. () ), omap_i_set: (Struct (SymbolTable 7 { }) omap_i_set (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), omap_insert_key_value: (Function (SymbolTable 11 { 1_integer32complex32orderedmap_map: (ExternalSymbol 11 1_integer32complex32orderedmap_map 9 map integer32complex32orderedmap [] map Public ), 1_omap_map_omap_i_at_rc: (ExternalSymbol 11 1_omap_map_omap_i_at_rc 8 at_rc omap_map [] at_rc Public ), 1_omap_map_stored_value: (ExternalSymbol 11 1_omap_map_stored_value 8 stored_value omap_map [] stored_value Public ), key: (Variable 11 key [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), status: (Variable 11 status [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), this: (Variable 11 this [] InOut () () Default (StructType [(StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. )] [] .false. .false. ) 2 integer32complex32orderedmap Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 11 tmp [] Local () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), tol: (Variable 11 tol [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), value: (Variable 11 value [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omap_insert_key_value (FunctionType [(StructType [(StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. )] [] .false. .false. ) (Integer 4) (Complex 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 this) (Var 11 key) (Var 11 value)] [(Assignment (StructInstanceMember (StructInstanceMember (Var 11 this) 11 1_integer32complex32orderedmap_map (StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. ) () ) 11 1_omap_map_stored_value (Complex 4) () ) (Var 11 value) () .false. .false. ) (Associate (Var 11 tmp) (FunctionCall 11 1_omap_map_omap_i_at_rc () [((Var 11 key)) ((Var 11 status))] (Pointer (Complex 4) ) () (StructInstanceMember (Var 11 this) 11 1_integer32complex32orderedmap_map (StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. ) () ) ) ) (If () (LogicalBinOp (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(Var 11 tmp)] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Real [(Var 11 value)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 11 tol) (Logical 4) () ) Or (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(Var 11 tmp)] 0 (Real 4) () ) Sub (IntrinsicElementalFunction Aimag [(Var 11 value)] 0 (Real 4) () ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 11 tol) (Logical 4) () ) (Logical 4) () ) [(Print (StringConstant "Test failed: tmp does not match value" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (ErrorStop () )] [] )] () Public .false. .false. () ), omap_map: (Struct (SymbolTable 8 { at: (GenericProcedure 8 at [8 at_rc] Public ), at_rc: (StructMethodDeclaration 8 at_rc () omap_i_at_rc 2 omap_i_at_rc Source .false. .false. ), stored_value: (Variable 8 stored_value [] Local () () Default (Complex 4) () Source Private Required .false. .false. .false. () .false. .false. ), tree: (Variable 8 tree [] Local () () Default (StructType [] [] .true. .false. ) 2 omap_i_set Source Private Required .false. .false. .false. () .false. .false. ) }) omap_map (StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. ) [omap_i_set] [tree stored_value] [] Source Private .false. .false. [] () () ), output_unit: (ExternalSymbol 2 output_unit 4 output_unit lfortran_intrinsic_iso_fortran_env [] output_unit Public ), r32: (Variable 2 r32 [real32] Local (Var 2 real32) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), real128: (ExternalSymbol 2 real128 4 real128 lfortran_intrinsic_iso_fortran_env [] real128 Public ), real32: (ExternalSymbol 2 real32 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), real64: (ExternalSymbol 2 real64 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), real_kinds: (ExternalSymbol 2 real_kinds 4 real_kinds lfortran_intrinsic_iso_fortran_env [] real_kinds Public ) }) gftl2_integer32complex32orderedmap () [iso_fortran_env gftl2_integer32complex32orderedmap] .false. .false. .false. ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), nested_struct_proc_01: (Program (SymbolTable 12 { 1_insert: (ExternalSymbol 12 1_insert 9 insert integer32complex32orderedmap [] insert Private ), 1_integer32complex32orderedmap_omap_insert_key_value: (ExternalSymbol 12 1_integer32complex32orderedmap_omap_insert_key_value 9 insert_key_value integer32complex32orderedmap [] insert_key_value Public ), character_kinds: (ExternalSymbol 12 character_kinds 4 character_kinds lfortran_intrinsic_iso_fortran_env [] character_kinds Public ), character_storage_size: (ExternalSymbol 12 character_storage_size 4 character_storage_size lfortran_intrinsic_iso_fortran_env [] character_storage_size Public ), compiler_options: (ExternalSymbol 12 compiler_options 4 compiler_options lfortran_intrinsic_iso_fortran_env [] compiler_options Public ), compiler_version: (ExternalSymbol 12 compiler_version 4 compiler_version lfortran_intrinsic_iso_fortran_env [] compiler_version Public ), error_unit: (ExternalSymbol 12 error_unit 4 error_unit lfortran_intrinsic_iso_fortran_env [] error_unit Public ), i32: (ExternalSymbol 12 i32 2 i32 gftl2_integer32complex32orderedmap [] i32 Public ), input_unit: (ExternalSymbol 12 input_unit 4 input_unit lfortran_intrinsic_iso_fortran_env [] input_unit Public ), int16: (ExternalSymbol 12 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int32: (ExternalSymbol 12 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 12 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), int8: (ExternalSymbol 12 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), integer32complex32orderedmap: (ExternalSymbol 12 integer32complex32orderedmap 2 integer32complex32orderedmap gftl2_integer32complex32orderedmap [] integer32complex32orderedmap Public ), integer_kinds: (ExternalSymbol 12 integer_kinds 4 integer_kinds lfortran_intrinsic_iso_fortran_env [] integer_kinds Public ), iostat_end: (ExternalSymbol 12 iostat_end 4 iostat_end lfortran_intrinsic_iso_fortran_env [] iostat_end Public ), iostat_eor: (ExternalSymbol 12 iostat_eor 4 iostat_eor lfortran_intrinsic_iso_fortran_env [] iostat_eor Public ), key: (Variable 12 key [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), logical8: (ExternalSymbol 12 logical8 4 logical8 lfortran_intrinsic_iso_fortran_env [] logical8 Public ), logical_kinds: (ExternalSymbol 12 logical_kinds 4 logical_kinds lfortran_intrinsic_iso_fortran_env [] logical_kinds Public ), my_map: (Variable 12 my_map [] Local () () Default (StructType [(StructType [(Complex 4) (StructType [] [] .true. .false. )] [] .true. .false. )] [] .true. .false. ) 12 integer32complex32orderedmap Source Public Required .false. .false. .false. () .false. .false. ), numeric_storage_size: (ExternalSymbol 12 numeric_storage_size 4 numeric_storage_size lfortran_intrinsic_iso_fortran_env [] numeric_storage_size Public ), omap_i_at_rc: (ExternalSymbol 12 omap_i_at_rc 2 omap_i_at_rc gftl2_integer32complex32orderedmap [] omap_i_at_rc Public ), omap_i_set: (ExternalSymbol 12 omap_i_set 2 omap_i_set gftl2_integer32complex32orderedmap [] omap_i_set Public ), omap_insert_key_value: (ExternalSymbol 12 omap_insert_key_value 2 omap_insert_key_value gftl2_integer32complex32orderedmap [] omap_insert_key_value Public ), omap_map: (ExternalSymbol 12 omap_map 2 omap_map gftl2_integer32complex32orderedmap [] omap_map Public ), output_unit: (ExternalSymbol 12 output_unit 4 output_unit lfortran_intrinsic_iso_fortran_env [] output_unit Public ), r32: (ExternalSymbol 12 r32 2 r32 gftl2_integer32complex32orderedmap [] r32 Public ), real128: (ExternalSymbol 12 real128 4 real128 lfortran_intrinsic_iso_fortran_env [] real128 Public ), real32: (ExternalSymbol 12 real32 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), real64: (ExternalSymbol 12 real64 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), real_kinds: (ExternalSymbol 12 real_kinds 4 real_kinds lfortran_intrinsic_iso_fortran_env [] real_kinds Public ), value: (Variable 12 value [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) nested_struct_proc_01 [gftl2_integer32complex32orderedmap] [(Assignment (Var 12 key) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 12 value) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (SubroutineCall 12 1_integer32complex32orderedmap_omap_insert_key_value 12 1_insert [((Var 12 key)) ((Var 12 value))] (Var 12 my_map) .false. ) (Print (StringConstant "Test passed" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-finalize_01-5496007.stdout0000664000175000017500000003562315141516316026115 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %array = type { i32*, i32, %dimension_descriptor*, i1, i32 } %dimension_descriptor = type { i32, i32, i32 } %string_descriptor = type <{ i8*, i64 }> %array.0 = type { float*, i32, %dimension_descriptor*, i1, i32 } @0 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @1 = private unnamed_addr constant [93 x i8] c"At 15:9 of file tests/finalize_01.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @__Wrong_allocation = private unnamed_addr constant [51 x i8] c"Attempting to allocate already allocated variable!\00", align 1 define void @__module_finalize_01_mod_ss() { .entry: %arr = alloca %array*, align 8 store %array* null, %array** %arr, align 8 %arr_desc = alloca %array, align 8 %0 = getelementptr %array, %array* %arr_desc, i32 0, i32 2 %1 = alloca i32, align 4 store i32 1, i32* %1, align 4 %2 = load i32, i32* %1, align 4 %3 = alloca %dimension_descriptor, i32 %2, align 8 %4 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 1 store i32 1, i32* %4, align 4 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 2 store i32 1, i32* %5, align 4 store %dimension_descriptor* %3, %dimension_descriptor** %0, align 8 %6 = getelementptr %array, %array* %arr_desc, i32 0, i32 4 store i32 1, i32* %6, align 4 %7 = getelementptr %array, %array* %arr_desc, i32 0, i32 0 store i32* null, i32** %7, align 8 store %array* %arr_desc, %array** %arr, align 8 %8 = load %array*, %array** %arr, align 8 %9 = ptrtoint %array* %8 to i64 %10 = icmp eq i64 %9, 0 br i1 %10, label %merge_allocated, label %check_data check_data: ; preds = %.entry %11 = getelementptr %array, %array* %8, i32 0, i32 0 %12 = load i32*, i32** %11, align 8 %13 = ptrtoint i32* %12 to i64 %14 = icmp ne i64 %13, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %14, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %15 = load %array*, %array** %arr, align 8 %16 = getelementptr %array, %array* %15, i32 0, i32 1 store i32 0, i32* %16, align 4 %17 = getelementptr %array, %array* %15, i32 0, i32 2 %18 = load %dimension_descriptor*, %dimension_descriptor** %17, align 8 %19 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %18, i32 0 %20 = getelementptr %dimension_descriptor, %dimension_descriptor* %19, i32 0, i32 0 %21 = getelementptr %dimension_descriptor, %dimension_descriptor* %19, i32 0, i32 1 %22 = getelementptr %dimension_descriptor, %dimension_descriptor* %19, i32 0, i32 2 store i32 1, i32* %20, align 4 store i32 1, i32* %21, align 4 store i32 10, i32* %22, align 4 %23 = getelementptr %array, %array* %15, i32 0, i32 0 %24 = call i8* @_lfortran_malloc(i64 40) %25 = bitcast i8* %24 to i32* store i32* %25, i32** %23, align 8 br i1 true, label %then1, label %else then1: ; preds = %ifcont br label %return unreachable_after_return: ; No predecessors! br label %ifcont3 else: ; preds = %ifcont br label %return unreachable_after_return2: ; No predecessors! br label %ifcont3 ifcont3: ; preds = %unreachable_after_return2, %unreachable_after_return br label %return return: ; preds = %ifcont3, %else, %then1 br label %FINALIZE_SYMTABLE_ss FINALIZE_SYMTABLE_ss: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_ss %26 = load %array*, %array** %arr, align 8 %27 = icmp ne %array* %26, null br i1 %27, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_arr %28 = getelementptr %array, %array* %26, i32 0, i32 0 %29 = load i32*, i32** %28, align 8 %30 = icmp eq i32* %29, null br i1 %30, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %31 = bitcast i32* %29 to i8* call void @_lfortran_free(i8* %31) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_arr br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %arr = alloca %array*, align 8 store %array* null, %array** %arr, align 8 %arr_desc = alloca %array, align 8 %2 = getelementptr %array, %array* %arr_desc, i32 0, i32 2 %3 = alloca i32, align 4 store i32 1, i32* %3, align 4 %4 = load i32, i32* %3, align 4 %5 = alloca %dimension_descriptor, i32 %4, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i32 1, i32* %6, align 4 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i32 1, i32* %7, align 4 store %dimension_descriptor* %5, %dimension_descriptor** %2, align 8 %8 = getelementptr %array, %array* %arr_desc, i32 0, i32 4 store i32 1, i32* %8, align 4 %9 = getelementptr %array, %array* %arr_desc, i32 0, i32 0 store i32* null, i32** %9, align 8 store %array* %arr_desc, %array** %arr, align 8 %str = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %str, align 1 %10 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = icmp ne i8* %11, null br i1 %12, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__Wrong_allocation, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %13 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %14 = call i8* @_lfortran_malloc(i64 10) store i8* %14, i8** %13, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 store i64 10, i64* %15, align 4 call void @__module_finalize_01_mod_ss() call void @internal_sub() br label %return unreachable_after_return: ; No predecessors! call void @_lpython_free_argv() br label %return return: ; preds = %unreachable_after_return, %ifcont br label %FINALIZE_SYMTABLE_finalize_01 FINALIZE_SYMTABLE_finalize_01: ; preds = %return br label %Finalize_Variable_arr Finalize_Variable_arr: ; preds = %FINALIZE_SYMTABLE_finalize_01 %16 = load %array*, %array** %arr, align 8 %17 = icmp ne %array* %16, null br i1 %17, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_arr %18 = getelementptr %array, %array* %16, i32 0, i32 0 %19 = load i32*, i32** %18, align 8 %20 = icmp eq i32* %19, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %21 = bitcast i32* %19 to i8* call void @_lfortran_free(i8* %21) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_arr br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done br label %Finalize_Variable_str Finalize_Variable_str: ; preds = %is_allocated.ifcont %22 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = icmp eq i8* %23, null br i1 %24, label %free_done2, label %free_nonnull1 free_nonnull1: ; preds = %Finalize_Variable_str call void @_lfortran_free(i8* %23) br label %free_done2 free_done2: ; preds = %free_nonnull1, %Finalize_Variable_str ret i32 0 } define void @internal_sub() { .entry: %arr_real = alloca %array.0*, align 8 store %array.0* null, %array.0** %arr_real, align 8 %arr_desc = alloca %array.0, align 8 %0 = getelementptr %array.0, %array.0* %arr_desc, i32 0, i32 2 %1 = alloca i32, align 4 store i32 2, i32* %1, align 4 %2 = load i32, i32* %1, align 4 %3 = alloca %dimension_descriptor, i32 %2, align 8 %4 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 1 store i32 1, i32* %4, align 4 %5 = getelementptr %dimension_descriptor, %dimension_descriptor* %3, i32 0, i32 2 store i32 1, i32* %5, align 4 store %dimension_descriptor* %3, %dimension_descriptor** %0, align 8 %6 = getelementptr %array.0, %array.0* %arr_desc, i32 0, i32 4 store i32 2, i32* %6, align 4 %7 = getelementptr %array.0, %array.0* %arr_desc, i32 0, i32 0 store float* null, float** %7, align 8 store %array.0* %arr_desc, %array.0** %arr_real, align 8 %str = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %str, align 1 br label %bl.start bl.start: ; preds = %.entry %arr_in_block = alloca %array*, align 8 store %array* null, %array** %arr_in_block, align 8 %arr_desc1 = alloca %array, align 8 %8 = getelementptr %array, %array* %arr_desc1, i32 0, i32 2 %9 = alloca i32, align 4 store i32 1, i32* %9, align 4 %10 = load i32, i32* %9, align 4 %11 = alloca %dimension_descriptor, i32 %10, align 8 %12 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 1 store i32 1, i32* %12, align 4 %13 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 2 store i32 1, i32* %13, align 4 store %dimension_descriptor* %11, %dimension_descriptor** %8, align 8 %14 = getelementptr %array, %array* %arr_desc1, i32 0, i32 4 store i32 1, i32* %14, align 4 %15 = getelementptr %array, %array* %arr_desc1, i32 0, i32 0 store i32* null, i32** %15, align 8 store %array* %arr_desc1, %array** %arr_in_block, align 8 br label %bl.end unreachable_after_exit: ; No predecessors! br label %return unreachable_after_return: ; No predecessors! br label %bl.end bl.end: ; preds = %unreachable_after_return, %bl.start br label %FINALIZE_SYMTABLE_bl FINALIZE_SYMTABLE_bl: ; preds = %bl.end br label %Finalize_Variable_arr_in_block Finalize_Variable_arr_in_block: ; preds = %FINALIZE_SYMTABLE_bl %16 = load %array*, %array** %arr_in_block, align 8 %17 = icmp ne %array* %16, null br i1 %17, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_arr_in_block %18 = getelementptr %array, %array* %16, i32 0, i32 0 %19 = load i32*, i32** %18, align 8 %20 = icmp eq i32* %19, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %21 = bitcast i32* %19 to i8* call void @_lfortran_free(i8* %21) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_arr_in_block br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done br label %loop.head loop.head: ; preds = %unreachable_after_return2, %is_allocated.ifcont br i1 true, label %loop.body, label %loop.end loop.body: ; preds = %loop.head br label %return unreachable_after_return2: ; No predecessors! br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end, %loop.body, %unreachable_after_exit br label %FINALIZE_SYMTABLE_internal_sub FINALIZE_SYMTABLE_internal_sub: ; preds = %return br label %Finalize_Variable_arr_real Finalize_Variable_arr_real: ; preds = %FINALIZE_SYMTABLE_internal_sub %22 = load %array.0*, %array.0** %arr_real, align 8 %23 = icmp ne %array.0* %22, null br i1 %23, label %is_allocated.then3, label %is_allocated.else6 is_allocated.then3: ; preds = %Finalize_Variable_arr_real %24 = getelementptr %array.0, %array.0* %22, i32 0, i32 0 %25 = load float*, float** %24, align 8 %26 = icmp eq float* %25, null br i1 %26, label %free_done5, label %free_nonnull4 free_nonnull4: ; preds = %is_allocated.then3 %27 = bitcast float* %25 to i8* call void @_lfortran_free(i8* %27) br label %free_done5 free_done5: ; preds = %free_nonnull4, %is_allocated.then3 br label %is_allocated.ifcont7 is_allocated.else6: ; preds = %Finalize_Variable_arr_real br label %is_allocated.ifcont7 is_allocated.ifcont7: ; preds = %is_allocated.else6, %free_done5 br label %Finalize_Variable_str Finalize_Variable_str: ; preds = %is_allocated.ifcont7 %28 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %29 = load i8*, i8** %28, align 8 %30 = icmp eq i8* %29, null br i1 %30, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %Finalize_Variable_str call void @_lfortran_free(i8* %29) br label %free_done9 free_done9: ; preds = %free_nonnull8, %Finalize_Variable_str ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-format_51-f69fffa.json0000664000175000017500000000071515141516316025455 0ustar alastairalastair{ "basename": "run-format_51-f69fffa", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_51.f90", "infile_hash": "a86b05c0e19461c4304d9f0bf1565f20cefa37495545476172f2485f", "outfile": null, "outfile_hash": null, "stdout": "run-format_51-f69fffa.stdout", "stdout_hash": "4e3a0f2dd04795c0f8bb0bebb173a9fbe57b062f953e36553f0d2a0d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_09-838f740.json0000664000175000017500000000073015141516316025137 0ustar alastairalastair{ "basename": "julia-expr_09-838f740", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_09.f90", "infile_hash": "3b99f849ef5412d7fbc16bc164307d14964150e05dd203596a3e6dd8", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_09-838f740.stdout", "stdout_hash": "dfc8fad1ddd91697f4084288a8ab590e5ca80090ec727762d13c7977", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-doloop_03-e0c63db.stdout0000664000175000017500000002131415141516316025713 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 local.get 0 i32.const 3 i32.eq if else end local.get 0 i32.const 2 i32.eq if br 1 else end br 1 else end end local.get 1 i32.const 3 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 0 i32.const 2 i32.eq if br 1 else end local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 0 i32.const 2 i32.eq if br 2 else end local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 53 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-more_kwargs_than_acceptable_to_subroutine-a276855.stderrlfortran-lfortran-2f73434/tests/reference/asr-more_kwargs_than_acceptable_to_subroutine-a276855.stde0000664000175000017500000000041015141516316033767 0ustar alastairalastairsemantic error: Procedure 'my_func' accepts 2 arguments, but 3 were provided --> tests/errors/more_kwargs_than_acceptable_to_subroutine.f90:4:5 | 4 | call my_func(y=1, x=2, z=1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments to 'my_func' lfortran-lfortran-2f73434/tests/reference/ast-do2-8eeb477.json0000664000175000017500000000072415141516316024165 0ustar alastairalastair{ "basename": "ast-do2-8eeb477", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/do2.f", "infile_hash": "004a5528e3fe66a7cc3f71ac1d14c359322161c682ed2d580f3de437", "outfile": null, "outfile_hash": null, "stdout": "ast-do2-8eeb477.stdout", "stdout_hash": "e20c32c7b24da96769d6bf8bf81ed2c7cffe6026f103cdbfe9c65e6c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_03-17a83b7.stdout0000664000175000017500000063653015141516316027457 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_03: (Program (SymbolTable 21 { cast_r: (ExternalSymbol 21 cast_r 2 cast_r template_simple_03_m [] cast_r Public ), generic_avg: (ExternalSymbol 21 generic_avg 2 generic_avg template_simple_03_m [] generic_avg Public ), generic_sum: (ExternalSymbol 21 generic_sum 2 generic_sum template_simple_03_m [] generic_sum Public ), operator_r: (ExternalSymbol 21 operator_r 2 operator_r template_simple_03_m [] operator_r Public ), test_template: (ExternalSymbol 21 test_template 2 test_template template_simple_03_m [] test_template Public ) }) template_simple_03 [template_simple_03_m] [(SubroutineCall 21 test_template () [] () .false. )] ), template_simple_03_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .false. .false. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .false. .false. () ), div_integer: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 9 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) div_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 9 lhs) (Var 9 rhs)] [(Assignment (Var 9 res) (IntegerBinOp (Var 9 lhs) Div (Var 9 rhs) (Integer 4) () ) () .false. .false. )] (Var 9 res) Private .false. .false. () ), div_real: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 10 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) div_real (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 10 lhs) (Var 10 rhs)] [(Assignment (Var 10 res) (RealBinOp (Var 10 lhs) Div (Cast (Var 10 rhs) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 10 res) Private .false. .false. () ), generic_avg: (Template (SymbolTable 15 { __instantiated_generic_sum: (Function (SymbolTable 22 { arr: (Variable 22 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 22 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 22 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 22 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 22 arr)] [(Assignment (Var 22 n) (ArraySize (Var 22 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 res) (FunctionCall 15 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 22 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 22 res) (ArrayItem (Var 22 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 22 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 22 n) ()) [(Assignment (Var 22 res) (FunctionCall 15 add () [((Var 22 res)) ((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 22 res) Public .false. .false. () ), add: (Function (SymbolTable 16 { lhs: (Variable 16 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 16 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 16 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 16 lhs) (Var 16 rhs)] [] (Var 16 res) Private .false. .false. () ), cast: (Function (SymbolTable 17 { arg: (Variable 17 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 17 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 17 arg)] [] (Var 17 res) Private .false. .false. () ), div: (Function (SymbolTable 18 { lhs: (Variable 18 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 18 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 18 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(TypeParameter t ) (Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 18 lhs) (Var 18 rhs)] [] (Var 18 res) Private .false. .false. () ), generic_avg: (Function (SymbolTable 19 { arr: (Variable 19 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 19 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_avg (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__instantiated_generic_sum div cast] [(Var 19 arr)] [(Assignment (Var 19 n) (ArraySize (Var 19 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 19 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 19 res) (FunctionCall 15 div () [((FunctionCall 15 __instantiated_generic_sum () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () ))] (TypeParameter t ) () () )) ((Var 19 n))] (TypeParameter t ) () () ) () .false. .false. )] [(Assignment (Var 19 res) (FunctionCall 15 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. )] )] (Var 19 res) Private .false. .false. () ), integer: (Variable 15 integer [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 15 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_avg [t add cast div] [(Require operator_r [t add] ) (Require cast_r [t cast] ) (Require operator_r [t integer div] )] ), generic_sum: (Template (SymbolTable 11 { add: (Function (SymbolTable 12 { lhs: (Variable 12 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 12 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 12 lhs) (Var 12 rhs)] [] (Var 12 res) Private .false. .false. () ), cast: (Function (SymbolTable 13 { arg: (Variable 13 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 13 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 13 arg)] [] (Var 13 res) Private .false. .false. () ), generic_sum: (Function (SymbolTable 14 { arr: (Variable 14 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 14 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 14 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 14 arr)] [(Assignment (Var 14 n) (ArraySize (Var 14 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 14 res) (FunctionCall 11 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 14 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 14 res) (ArrayItem (Var 14 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 14 n) ()) [(Assignment (Var 14 res) (FunctionCall 11 add () [((Var 14 res)) ((ArrayItem (Var 14 arr) [(() (Var 14 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 14 res) Public .false. .false. () ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 20 { __asr___instantiated_generic_sum: (Function (SymbolTable 25 { arr: (Variable 25 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 25 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 25 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 25 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_generic_sum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 25 arr)] [(Assignment (Var 25 n) (ArraySize (Var 25 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 25 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 25 res) (ArrayItem (Var 25 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 25 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 25 n) ()) [(Assignment (Var 25 res) (FunctionCall 20 ~add_intrinsic () [((Var 25 res)) ((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 25 res) Public .false. .false. () ), __asr___instantiated_generic_sum1: (Function (SymbolTable 28 { arr: (Variable 28 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 28 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 28 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 28 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_generic_sum1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 28 arr)] [(Assignment (Var 28 n) (ArraySize (Var 28 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 28 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 28 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 28 res) (ArrayItem (Var 28 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 28 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 28 n) ()) [(Assignment (Var 28 res) (FunctionCall 20 ~add_intrinsic1 () [((Var 28 res)) ((ArrayItem (Var 28 arr) [(() (Var 28 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 28 res) Public .false. .false. () ), __instantiated_generic_avg: (Function (SymbolTable 24 { arr: (Variable 24 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 24 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 24 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_avg (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr___instantiated_generic_sum div_integer cast_integer] [(Var 24 arr)] [(Assignment (Var 24 n) (ArraySize (Var 24 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 24 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 24 res) (FunctionCall 2 div_integer () [((FunctionCall 20 __asr___instantiated_generic_sum () [((ArrayPhysicalCast (Var 24 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () ))] (Integer 4) () () )) ((Var 24 n))] (Integer 4) () () ) () .false. .false. )] [(Assignment (Var 24 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. )] )] (Var 24 res) Private .false. .false. () ), __instantiated_generic_avg1: (Function (SymbolTable 27 { arr: (Variable 27 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 27 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 27 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 27 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_generic_avg1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr___instantiated_generic_sum1 div_real cast_real] [(Var 27 arr)] [(Assignment (Var 27 n) (ArraySize (Var 27 arr) () (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 27 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 27 res) (FunctionCall 2 div_real () [((FunctionCall 20 __asr___instantiated_generic_sum1 () [((ArrayPhysicalCast (Var 27 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () ))] (Real 4) () () )) ((Var 27 n))] (Real 4) () () ) () .false. .false. )] [(Assignment (Var 27 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. )] )] (Var 27 res) Private .false. .false. () ), a_i: (Variable 20 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), a_r: (Variable 20 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 20 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_i: (Variable 20 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_r: (Variable 20 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 20 ~add [20 ~add_intrinsic 20 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 23 { arg0: (Variable 23 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 23 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 23 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 23 arg0) (Var 23 arg1)] [(Assignment (Var 23 ret) (IntegerBinOp (Var 23 arg0) Add (Var 23 arg1) (Integer 4) () ) () .false. .false. )] (Var 23 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 26 { arg0: (Variable 26 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 26 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 26 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 26 arg0) (Var 26 arg1)] [(Assignment (Var 26 ret) (RealBinOp (Var 26 arg0) Add (Var 26 arg1) (Real 4) () ) () .false. .false. )] (Var 26 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 20 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 20 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 20 a_i) [(() (Var 20 i) ())] (Integer 4) ColMajor () ) (Var 20 i) () .false. .false. ) (Assignment (ArrayItem (Var 20 a_r) [(() (Var 20 i) ())] (Real 4) ColMajor () ) (Cast (Var 20 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 20 s_i) (FunctionCall 20 __instantiated_generic_avg () [((ArrayPhysicalCast (Var 20 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 20 s_r) (FunctionCall 20 __instantiated_generic_avg1 () [((ArrayPhysicalCast (Var 20 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 20 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_03_m () [template_simple_03_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_nested-5858841.stdout0000664000175000017500000020616315141516316027013 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_nested: (Program (SymbolTable 12 { add_t: (ExternalSymbol 12 add_t 2 add_t template_nested_m [] add_t Public ), r: (ExternalSymbol 12 r 2 r template_nested_m [] r Public ), test_template: (ExternalSymbol 12 test_template 2 test_template template_nested_m [] test_template Public ) }) template_nested [template_nested_m] [(SubroutineCall 12 test_template () [] () .false. )] ), template_nested_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), call_add_generic: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) call_add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [add_generic] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (FunctionCall 5 add_generic () [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 8 z) Private .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f] [(Require r [t f] )] ), func_arg_real: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 9 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (RealBinOp (Var 9 x) Add (Var 9 y) (Real 4) () ) () .false. .false. )] (Var 9 z) Private .false. .false. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { __asr_add_generic: (Function (SymbolTable 13 { x: (Variable 13 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 13 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 13 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_add_generic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 z) (FunctionCall 2 func_arg_real () [((Var 13 x)) ((Var 13 y))] (Real 4) () () ) () .false. .false. )] (Var 13 z) Public .false. .false. () ), a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), add_real: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_add_generic] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 10 __asr_add_generic () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. )] (Var 11 z) Private .false. .false. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_nested_m () [template_nested_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-attributes1-9309f25.stdout0000664000175000017500000002176515141516316026165 0ustar alastairalastair(TranslationUnit [(Program attributes1 (TriviaNode [(EndOfLine) (Comment "! test for AST(to fmt) only" )] [] ) [] [] [(Declaration (AttrType TypeCharacter [(len 4 Value)] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [(AttrIntent In )] [(str [] [] () () DoubleAsterisk ())] () ) (Declaration (AttrType TypeCharacter [(len 1 Value) (kind c_char Value)] () () None ) [(SimpleAttribute AttrTarget ) (AttrBind (Bind [C] [(name (String "_binary_fclKernels_cl_start" ()))] ) )] [(fclKernelStart [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 3 Value)] () () None ) [] [(c [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrVolatile )] [(d [] [] () () None ()) (e [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrExternal )] [(g [] [] () () None ())] () ) (Declaration () [(AttrEquivalence [([a (FuncCallOrArray c [] [(() 1 () 0)] [] [] [] )]) ([b (FuncCallOrArray c [] [(() 2 () 0)] [] [] [] )])] )] [] () ) (DerivedType details [] () [] [(Declaration () [(SimpleAttribute AttrSequence )] [] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(age [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 50 Value)] () () None ) [] [(name [] [] () () None ())] () )] [(DerivedTypeProc () [(AttrPass () )] [(UseSymbol sample name )] () )] ) (Declaration () [(SimpleAttribute AttrIntrinsic )] [(sin [] [] () () None ()) (cos [] [] () () None ())] () ) (Declaration (AttrType TypeDoublePrecision [] () () None ) [(AttrIntent In )] [(x [(() () AssumedRank)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeReal [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeInteger [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeCharacter [(len 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeLogical [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeType [] (AttrType TypeComplex [(kind 4 Value)] () () None ) () None ) [(SimpleAttribute AttrAllocatable )] [(x [(() () DimensionExpr)] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(zzrayc [] [] () () Slash ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_lapack_01-0d30f43.json0000664000175000017500000000100015141516316027007 0ustar alastairalastair{ "basename": "asr-template_lapack_01-0d30f43", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_lapack_01.f90", "infile_hash": "d79e24fee2aba2e6b98fffd327df1e6a264fdf9cc3e5ebc77b5822d0", "outfile": null, "outfile_hash": null, "stdout": "asr-template_lapack_01-0d30f43.stdout", "stdout_hash": "9c9775e0b3442dc30e943e724b0208bdf3a04d33e8b11f6662bb506f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-pragma2-a14de52.json0000664000175000017500000000066715141516316024453 0ustar alastairalastair{ "basename": "c-pragma2-a14de52", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "c-pragma2-a14de52.stdout", "stdout_hash": "a657ba049ef975e996c0b11ced85944ff0c0a5e3785154c82d55deff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cond_02-373a22a.stdout0000664000175000017500000003644515141516316025202 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cond_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cond_02 [] [(If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array2-e7997a8.json0000664000175000017500000000070715141516316024630 0ustar alastairalastair{ "basename": "asr-array2-e7997a8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "asr-array2-e7997a8.stdout", "stdout_hash": "a3f9effc262f9cd6cbec46a544e7abd28f58d3b96a3b2d6771b681d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-implied_do_loops10-3298b64.json0000664000175000017500000000100015141516316027003 0ustar alastairalastair{ "basename": "ast-implied_do_loops10-3298b64", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops10.f90", "infile_hash": "2efdc481b725ae1203d010683681aa7cefaa4284865b8a440a16e133", "outfile": null, "outfile_hash": null, "stdout": "ast-implied_do_loops10-3298b64.stdout", "stdout_hash": "d1bb53768035ce11f5784b1434b9702cddb727ab5b4aaed8d5079899", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-block1-f4e17ad.stdout0000664000175000017500000000103115141516316025741 0ustar alastairalastairprogram block1 implicit integer (a-z) integer :: B ! TODO: Fix this test case block ! use mod, only: example ! import, none ! !import, only: B B = 10 print *, B if (B == 10) then print *, "pass" end if end block end program block1 ! The variable B is implicitly declared in the scoping unit of the main program. ! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct. ! If the IMPORT, NONE statement is replaced with the IMPORT statement in the ! comment, the program is conformant. lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_with_exit-0c669e6.stdout0000664000175000017500000000161715141516316030177 0ustar alastairalastair(TranslationUnit [(Subroutine example [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 2 8 () [(If 0 () (== i 2) [(Exit 0 () () )] [] () () () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_35-5fba3e7.json0000664000175000017500000000075015141516316025524 0ustar alastairalastair{ "basename": "asr-modules_35-5fba3e7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_35.f90", "infile_hash": "5117017b03ab16e2fa34e13800ebd9e03539c4bd6ad2fafc1e543dbb", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_35-5fba3e7.stdout", "stdout_hash": "823cde2fb9e1e5025774af704c33eeed25b6cdc8300ec604d3845fa1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-multi_error1-6934f65.stderr0000664000175000017500000000016615141516316026320 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/multi_error1.f90:3:15 | 3 | integer :: x = | ^ lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout0000664000175000017500000000654615141516316031427 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. )] (Var 2 f1) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-empty-681c1d1.stdout0000664000175000017500000000456115141516316025121 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_kind-80c5bf4.json0000664000175000017500000000105315141516316033332 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_kind-80c5bf4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_kind.f90", "infile_hash": "1c99a99dd08ea6e1a907a41a63108fa742ed6e2802d9f8be88f23732", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_kind-80c5bf4.stderr", "stderr_hash": "ffe5660a2ce99c0aa55533f42cbad5016f892774b54ab3ac611c3361", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-implicit1-e201262.json0000664000175000017500000000104015141516316025200 0ustar alastairalastair{ "basename": "ast-implicit1-e201262", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/implicit1.f90", "infile_hash": "8f316b7b5813cd7d2f663bd9aac929c0d2fdb42eccdc2ac798b0c3d5", "outfile": null, "outfile_hash": null, "stdout": "ast-implicit1-e201262.stdout", "stdout_hash": "6f8c276efeb3e34064a8bea0f00cf4fe1e86341321e4026c644dec76", "stderr": "ast-implicit1-e201262.stderr", "stderr_hash": "7040f573fd98c40ed1387403ecf33f749ead9159a50668621b3fb8ca", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_08_func-ec93f58.json0000664000175000017500000000110415141516316026633 0ustar alastairalastair{ "basename": "julia-arrays_08_func-ec93f58", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_08_func.f90", "infile_hash": "31dc0eac87716ea184d20ac42f94636f0a25c0ee00022272c2b1327d", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_08_func-ec93f58.stdout", "stdout_hash": "142abaf81202a722df83c56984495eb6f1d3b6b174c8286c7de7d046", "stderr": "julia-arrays_08_func-ec93f58.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface-68156ec.stdout0000664000175000017500000006007115141516316031015 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { prho: (Function (SymbolTable 2 { alnorm: (Function (SymbolTable 4 { alnorm_arg_0: (Variable 4 alnorm_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), alnorm_arg_1: (Variable 4 alnorm_arg_1 [] Unspecified () () Default (Logical 4) () BindC Public Required .false. .false. .false. () .false. .false. ), alnorm_return_var_name: (Variable 4 alnorm_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) alnorm (FunctionType [(Real 8) (Logical 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 alnorm_arg_0) (Var 4 alnorm_arg_1)] [] (Var 4 alnorm_return_var_name) Public .false. .false. () ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), dgetrf: (Function (SymbolTable 5 { dgetrf_arg_0: (Variable 5 dgetrf_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), dgetrf_arg_1: (Variable 5 dgetrf_arg_1 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), dgetrf_arg_2: (Variable 5 dgetrf_arg_2 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) dgetrf (FunctionType [(Real 8) (Real 8) (Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dgetrf_arg_0) (Var 5 dgetrf_arg_1) (Var 5 dgetrf_arg_2)] [] () Public .false. .false. () ), one: (Variable 2 one [] Local (RealConstant 1.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), prho: (Variable 2 prho [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), six: (Variable 2 six [] Local (RealConstant 6.000000 (Real 8) ) (RealConstant 6.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), two: (Variable 2 two [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) prho (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 one) (RealConstant 1.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 two) (RealConstant 2.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 six) (RealConstant 6.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (IntrinsicElementalFunction Exp [(RealBinOp (Var 2 y) Div (Var 2 two) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4) ))] (Real 8) () () ) (Real 8) () ) () .false. .false. ) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] () .false. ) (If () (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4) () ) [(Assignment (Var 2 prho) (Var 2 zero) () .false. .false. )] [] ) (If () (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4) () ) [(Assignment (Var 2 prho) (Var 2 one) () .false. .false. )] [] ) (Return)] (Var 2 prho) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-rewind_inquire_flush-72b7f97.stdout0000664000175000017500000002320315141516316030214 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { rewind_inquire_flush: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ext: (Variable 2 ext [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), fm: (Variable 2 fm [] Local () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), ios: (Variable 2 ios [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), len: (Variable 2 len [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) rewind_inquire_flush [] [(FileRewind 0 (IntegerConstant 9 (Integer 4) Decimal) (Var 2 ios) (IntegerConstant 10 (Integer 4) Decimal) ) (FileInquire 0 () (StringConstant "file_b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () (Var 2 ext) () () () () () () () () () () () () () () () () () () () () () () () () () () () [] ) (FileInquire 0 (IntegerConstant 4 (Integer 4) Decimal) () (Var 2 ios) (IntegerConstant 20 (Integer 4) Decimal) () () () () () () () () (Var 2 fm) () () () () () () () () () () () () () () () () () () () [] ) (FileInquire 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () (Var 2 len) [(Var 2 a) (Var 2 b)] ) (GoToTarget 10 10 ) (Print (StringConstant "err rewind" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 20 20 ) (Print (StringConstant "err inquire" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_nestedloop_implicit-7cd720b.stdout0000664000175000017500000000174115141516316032146 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Print 20 () [1] () ) (DoLoop 0 () 0 k 1 10 () [(DoLoop 0 () 0 l 1 10 () [(Print 0 () [k l] () )] () () )] () () ) (If 0 () (> 0 1) [(GoTo 0 () 20 [] () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-kokkos_program2-8391215.json0000664000175000017500000000074215141516316026360 0ustar alastairalastair{ "basename": "asr-kokkos_program2-8391215", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/kokkos_program2.f90", "infile_hash": "bba0b0329c504e01dd099058af96e20a7fe00294f66456fe3da634e0", "outfile": null, "outfile_hash": null, "stdout": "asr-kokkos_program2-8391215.stdout", "stdout_hash": "285d68a0eda2f570a0a22cf41684e5b9dc01c45ac27adf544e2a3800", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-redeclaration1-9d7c988.stdout0000664000175000017500000000645515141516316026706 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { redeclare1: (Function (SymbolTable 2 { k: (Variable 2 k [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), piv: (Variable 2 piv [k] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 k))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) redeclare1 (FunctionType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 piv) (Var 2 k)] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-associate_01-aa0fe46.json0000664000175000017500000000112015141516316026462 0ustar alastairalastair{ "basename": "ast_f90-associate_01-aa0fe46", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/associate_01.f90", "infile_hash": "dfa888bac25c6dcaf279aff9ac639b37179290e3a36f9e784b31fb83", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-associate_01-aa0fe46.stdout", "stdout_hash": "50cf8571646cf55d99209c64d3395872288f6f03b1ade8b0546581ea", "stderr": "ast_f90-associate_01-aa0fe46.stderr", "stderr_hash": "1f6e46d80cfcc70f0d91ed20562c4d7c39b2990b877e7de481e73a19", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-expr_05-1df98eb.stdout0000664000175000017500000000247115141516316026276 0ustar alastairalastairprogram expr_05 implicit none integer(4) :: a integer(4) :: b integer(4) :: c logical(4) :: l integer(4) :: x a = 3 b = 4 c = 5 x = 2*3 x = (-2)*3 x = 2*(-3) x = (-2)*(-3) x = (-2)*(-3) x = -2**3 x = -2**3 x = -2*3 x = 2**(-3) x = a x = a x = a*b x = (-a)*b x = -a*b x = a*(-b) x = (-a)*(-b) x = a*b*c x = (-a)*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3 + 4*5 x = (3 + 4)*5 x = a*(b + 5*(c - b)) x = (3 - 2*a*b)*5 x = ((-2)*a*b + 3)*5 x = ((-2)*a*b + 3*b*a)*5 x = ((-2)*a/b + (a + (-b))**2)*5 x = (2*a*b + 3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = 1/a*b x = 1/((a*b + 1)) x = 1/a*b + 1 x = 1/a*b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2)*b x = c - (-2)/b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2*a + a*b - (a*b + 2*a) x = 2*a + a*b - (a*b - 2*a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b)*b)) x = -(3 + 5) x = -(a + 5) l = x**3*4 + a <= 4 .or. x < 5 .and. x < 6 .eqv. .true. .or. .not. .false. .and. .true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not. (l .or. l) end program expr_05 lfortran-lfortran-2f73434/tests/reference/asr-private1-f9f97ce.stderr0000664000175000017500000000020315141516316025643 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/private1.f90:21:5 | 21 | x = 5 | ^ 'x' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-statement1-60b7ed3.json0000664000175000017500000000072315141516316025550 0ustar alastairalastair{ "basename": "asr-statement1-60b7ed3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/statement1.f90", "infile_hash": "3d828667fda659d080d10043c790e05aa1fa73d1f920b2c4e38fe751", "outfile": null, "outfile_hash": null, "stdout": "asr-statement1-60b7ed3.stdout", "stdout_hash": "bd30cc32faef8560f7c4c871a3d72f6fc64eefb4633ef66b3e68b454", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-complex_01-e4954b1.stdout0000664000175000017500000000040115141516316026377 0ustar alastairalastairprogram complex_01 implicit none complex :: x = (1.0, -3.0) real, parameter :: a = 3.0, b = 4.0 complex :: y = (a, b) complex, parameter :: i_ = (0, 1) complex :: z = a + i_*b complex :: w = a + b + i_*(a - b) print *, x, y, z, w end program complex_01 lfortran-lfortran-2f73434/tests/reference/ast-if1-6e771a0.stdout0000664000175000017500000000350215141516316024433 0ustar alastairalastair(TranslationUnit [(Program if1 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (== i 5) [(Print 0 () [(String "correct" ())] () )] [] () () () ) (If 0 () (== i 6) [(Print 0 () [(String "incorrect" ())] () )] [] () () () ) (Assignment 0 i (u- 2) () ) (Assignment 40 i (+ i 1) () ) (IfArithmetic 0 () i 50 60 70 () ) (Print 50 () [(String "i < 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 60 () [(String "i == 0" ())] () ) (GoTo 0 () 40 [] () ) (Print 70 () [(String "i > 0" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutines_01-6bd865a.stdout0000664000175000017500000000236215141516316027243 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}) b[] = a + 1 end function main() local i::Int32 local j::Int32 i = 1 j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(3), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(1 + 2), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end j = 1 if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) f(Int32(i + 2), __j_ref__) j = __j_ref__[] println(j) if j ≠ 4 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops1-25d26db.json0000664000175000017500000000077515141516316027072 0ustar alastairalastair{ "basename": "asr-implied_do_loops1-25d26db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implied_do_loops1.f90", "infile_hash": "68e55531db4ca34fe61a1670dec525834de529c9d8ade7bac01f4046", "outfile": null, "outfile_hash": null, "stdout": "asr-implied_do_loops1-25d26db.stdout", "stdout_hash": "cc9d7aca49b6abfe4a97a82ac713e8edb4590ee3ea5f42136eaab89d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine6-265d498.json0000664000175000017500000000073515141516316025626 0ustar alastairalastair{ "basename": "asr-subroutine6-265d498", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine6.f90", "infile_hash": "5bc0c9df124afea67ceb9278de7bb1436d4f1b31ae40c6edddf5838c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine6-265d498.stderr", "stderr_hash": "42e57dd8f16b0aabba5ffbcdce0c8d55d48e2a88f797fd2bcd0ba90e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-const_real_dp-e0fca56.stdout0000664000175000017500000000515615141516316027121 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"R4,R8,R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca double, align 8 %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0.000000e+00, float* %zero, align 4 store double 0x3FF0CCCCC0000000, double* %u, align 8 store double 1.050000e+00, double* %v, align 8 store float 0x3FF0CCCCC0000000, float* %x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %zero, double* %v, float* %x, double* %u) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_const_real_dp FINALIZE_SYMTABLE_const_real_dp: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-float1-817e0db.stderr0000664000175000017500000000021415141516316025176 0ustar alastairalastairsemantic error: Argument of intrinsic must be an integer --> tests/errors/float1.f90:3:10 | 3 | print *, float(y) | ^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/pass_dead_code_removal-cond_02-69b6d7d.json0000664000175000017500000000103615141516316030575 0ustar alastairalastair{ "basename": "pass_dead_code_removal-cond_02-69b6d7d", "cmd": "lfortran --pass=dead_code_removal --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cond_02.f90", "infile_hash": "fc70f7e7943dfe505736cca5b8ff39a034a4a1a7f441d9bdf0a82662", "outfile": null, "outfile_hash": null, "stdout": "pass_dead_code_removal-cond_02-69b6d7d.stdout", "stdout_hash": "22c46eb8e1c5db607579adbb0e02053473c7de03aa73cf71c055dc32", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine9-8ecec78.stdout0000664000175000017500000000446715141516316026433 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [] ImportNone () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [] ImportAll () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine c [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine d [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine e [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Import [a b] ImportOnly () )] [(ImplicitNone [] () )] [] [] [] [] ) (Subroutine f [] [] () () [] [(Import [a b] ImportDefault () ) (Import [c] ImportDefault () ) (Import [d e f] ImportDefault () )] [(ImplicitNone [] () )] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/cpp-types_02-0b28cb7.stdout0000664000175000017500000000124115141516316025467 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; i = 1; r = (float)(1); r = (float)(i); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/run-format5-79b3b8f.json0000664000175000017500000000066215141516316025073 0ustar alastairalastair{ "basename": "run-format5-79b3b8f", "cmd": "lfortran --no-color {infile}", "infile": "tests/format5.f90", "infile_hash": "dfe2e9bd30c55ac5189bba5635ea01ad967e2729ac08c9e601cc6236", "outfile": null, "outfile_hash": null, "stdout": "run-format5-79b3b8f.stdout", "stdout_hash": "7927bd2893c83c5df50db8fb4e86dfcac7e4cab8199482ab5e619141", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce-58dd849.stdout0000664000175000017500000000455715141516316030201 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-doconcurrentloop_01-ebe9543.stdout0000664000175000017500000000077715141516316030432 0ustar alastairalastairprogram doconcurrentloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar*b(i) end do end subroutine triad end program doconcurrentloop_01 lfortran-lfortran-2f73434/tests/reference/ast-include_01-55ce778.stdout0000664000175000017500000000203415141516316025713 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "From B" ())] () ) (Print 0 () [(String "From C" ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "From A" ())] () )] [] [] ) (Program include_01 () [] [] [] [(SubroutineCall 0 a [] [] [] [] () ) (Print 0 () [(String "From Main" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics7-d1c02a1.stderr0000664000175000017500000000026615141516316026254 0ustar alastairalastairsemantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/intrinsics7.f90:2:14 | 2 | print *, hypot(1.0, 2.7_8) | ^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-shiftl1-0ff5448.stdout0000664000175000017500000000666715141516316025351 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { shiftl1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) shiftl1 [] [(Print (StringFormat () [(IntrinsicElementalFunction Shiftl [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Shiftl [(Var 2 x) (Var 2 y)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_09-afed6c8.stderr0000664000175000017500000000061115141516316030333 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands '__libasr_created__integer_binop_' and '__libasr_created_integer_binop_right_'. Tried to match size 3 of dimension 1 of '__libasr_created__integer_binop_' with size 2 of dimension 1 of '__libasr_created_integer_binop_right_'. --> tests/errors/array_bounds_check_09.f90:12:9 | 12 | e = a + b + f(a) | ^ lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing2-1e706a4.json0000664000175000017500000000077615141516316026676 0ustar alastairalastair{ "basename": "asr-implicit_typing2-1e706a4", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing2.f90", "infile_hash": "36b4bb1882db636cc72a4e0b458d197bd21563dac2e0aa0640803ca9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing2-1e706a4.stderr", "stderr_hash": "5a5d770bfc817e1cddf9a5567f3b695bcb88dffa5b3ffb694c57df41", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-save2-63c8bcc.stderr0000664000175000017500000000173615141516316025123 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:2:13 | 2 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:10:13 | 10 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:26:17 | 26 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save2.f90:34:17 | 34 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/asr-character_02-56bfff3.stderr0000664000175000017500000000056415141516316026344 0ustar alastairalastairwarning: The LHS character len=1 and the RHS character len=2 are not equal. --> tests/warnings/character_02.f90:2:5 | 2 | character(len=1, kind=1), parameter :: toml_base(4) = ["11", "21", "31", "$1"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor10-6279d1f.json0000664000175000017500000000077315141516316030554 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor10-6279d1f", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor10.f90", "infile_hash": "128670b190f1e59f40192f15434c3b8d7a85c15fbc901a72e7f7ebc3", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor10-6279d1f.stdout", "stdout_hash": "8620f523932d44584173618faae87ae481b65da55c369ebcd19e1754", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-nullify1-aaf5456.json0000664000175000017500000000071515141516316025232 0ustar alastairalastair{ "basename": "ast-nullify1-aaf5456", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/nullify1.f90", "infile_hash": "f996667719f3f2215e2bf25d7fe502ab13f032f4d8b29b0a3f1329d1", "outfile": null, "outfile_hash": null, "stdout": "ast-nullify1-aaf5456.stdout", "stdout_hash": "1aff21d1a0c7014a1b02f606be423bebcaa7ff75bf98f650e1d7179d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-stop1-c0d0295.stdout0000664000175000017500000000131415141516316025473 0ustar alastairalastairprogram stop1 implicit none ! AST only(Syntax check) integer :: stop = 15 integer :: errstop = 25 if (stop /= 15) then stop else if (errstop /= 25) then error stop end if end if if (stop /= 15) then stop "message" else if (errstop /= 25) then error stop "message" end if end if if (stop /= 15) then stop 0 else if (errstop /= 25) then error stop 0 end if end if if (stop /= 15) then stop, quiet = .true. else if (errstop /= 25) then error stop, quiet = .true. end if end if if (stop /= 15) then stop 1, quiet = .false. else if (errstop /= 25) then error stop 1, quiet = .false. end if end if end program stop1 lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do2-fc94c6e.json0000664000175000017500000000075415141516316026740 0ustar alastairalastair{ "basename": "asr-data_implied_do2-fc94c6e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do2.f90", "infile_hash": "4d1460374ba43c05e4fe5c98325127f075dba71e6caf69b8ad00e706", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do2-fc94c6e.stderr", "stderr_hash": "abf35a8c715ce96aa96eabb23d0bcdbedc417b1fc9dba47bdcb3bc77", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_do_loops-doloop_01-f2f0442.stdout0000664000175000017500000011734115141516316027631 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_01 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 9 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 22 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 0 (Integer 4) Decimal) Sub (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutine1-87ec3af.json0000664000175000017500000000071715141516316026353 0ustar alastairalastair{ "basename": "julia-subroutine1-87ec3af", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine1-87ec3af.stdout", "stdout_hash": "15113c36159149e36d4535dab345b908dda98baa5e81565b2a8354cd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-logical2-3eb78d2.json0000664000175000017500000000072515141516316025173 0ustar alastairalastair{ "basename": "wat-logical2-3eb78d2", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "wat-logical2-3eb78d2.stdout", "stdout_hash": "9f6a7ec0c7ce13ff0c127f744b65c94c58a44a42a8941216b85c0b56", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_01-290187e.stdout0000664000175000017500000002655315141516316025474 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_01: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_01_a [] b Public ), c: (Variable 5 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) nested_01 [nested_01_a] [(Assignment (Var 5 c) (FunctionCall 5 b () [] (Integer 4) () () ) () .false. .false. )] ), nested_01_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Function (SymbolTable 4 { d: (Variable 4 d [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) d (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "d()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 4 d) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 4 d) Public .false. .false. () ), e: (Variable 3 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 e) (FunctionCall 3 d () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 3 b) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 b) Public .false. .false. () ) }) nested_01_a () [nested_01_a] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_38-2731560.json0000664000175000017500000000077415141516316026434 0ustar alastairalastair{ "basename": "asr_openmp-openmp_38-2731560", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_38.f90", "infile_hash": "8e3b8810b1c59c6bcfb2111da045536db52041003a5491a5a87f3f73", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_38-2731560.stdout", "stdout_hash": "588ecf512047bef1590f437384c472cb7d4656f741c6d6c649701abc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_type1-c109ce6.stdout0000664000175000017500000002564715141516316026614 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type1: (Module (SymbolTable 2 { 1_enum_escape_newline: (ExternalSymbol 2 1_enum_escape_newline 3 newline enum_escape [] newline Public ), enum_escape: (Struct (SymbolTable 3 { newline: (Variable 3 newline [] Local (IntrinsicElementalFunction Achar [(IntegerConstant 10 (Integer 4) Decimal)] 0 (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) enum_escape (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) [] [newline] [] Source Public .false. .false. [] () () ), nl: (Variable 2 nl [toml_escape] Local (IntrinsicElementalFunction StringConcat [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 2 toml_escape) 2 1_enum_escape_newline (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] 0 (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant " \n" (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant " \n" (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 2 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), tfc: (Variable 2 tfc [] Local (IntrinsicElementalFunction SelectedCharKind [(StringConstant "DEFAULT" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), toml_escape: (Variable 2 toml_escape [] Local (StructConstant 2 enum_escape [((StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) (StructConstant 2 enum_escape [((StringConstant "\n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) ) Parameter (StructType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] [] .true. .false. ) 2 enum_escape Source Public Required .false. .false. .false. () .false. .false. ) }) derived_type1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-complex_mul_test-562260f.stdout0000664000175000017500000001357615141516316027271 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Mul (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Mul (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce2-81246e2.json0000664000175000017500000000077715141516316030272 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce2-81246e2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce2.f90", "infile_hash": "bfbb329c50d12cea347c298fcc5ba3ee9f192b8b43de74deccf70615", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce2-81246e2.stdout", "stdout_hash": "bbcc42fbbf554322cc2fd456d8893449132415622bd147312ca1f7e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_01c-a5654a9.stdout0000664000175000017500000013664115141516316027057 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01c: (Program (SymbolTable 11 { add_t: (ExternalSymbol 11 add_t 2 add_t template_add_01c_m [] add_t Public ), r: (ExternalSymbol 11 r 2 r template_add_01c_m [] r Public ), test_template: (ExternalSymbol 11 test_template 2 test_template template_add_01c_m [] test_template Public ) }) template_add_01c [template_add_01c_m] [(SubroutineCall 11 test_template () [] () .false. )] ), template_add_01c_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f] [(Require r [t f] )] ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 8 { add_generic: (Function (SymbolTable 10 { x: (Variable 10 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 10 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 z) (FunctionCall 8 ~add_intrinsic () [((Var 10 x)) ((Var 10 y))] (Integer 4) () () ) () .false. .false. )] (Var 10 z) Public .false. .false. () ), n: (Variable 8 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 8 ~add [8 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 9 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 9 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (IntegerBinOp (Var 9 arg0) Add (Var 9 arg1) (Integer 4) () ) () .false. .false. )] (Var 9 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 n) (FunctionCall 8 add_generic () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 8 n)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_01c_m () [template_add_01c_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-bccf386.json0000664000175000017500000000076715141516316027044 0ustar alastairalastair{ "basename": "asr-implicit_typing1-bccf386", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing1-bccf386.stdout", "stdout_hash": "a68abda956922b01fbee7277b0210aff958b009a2b30a80d03f32036", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-multi_error1-6934f65.json0000664000175000017500000000073115141516316025764 0ustar alastairalastair{ "basename": "ast-multi_error1-6934f65", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/multi_error1.f90", "infile_hash": "aae363b17603b231b2a906564a03365ce9a53952c754ea31187f352c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-multi_error1-6934f65.stderr", "stderr_hash": "05f5d41863982b1d7e082112c53b5ee1dece91489f6857e77a3c2e4e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-sync1-5d8b786.stdout0000664000175000017500000000052015141516316025501 0ustar alastairalastairprogram sync1 implicit none integer :: iam real :: x[*] iam = this_image() if (iam == 1) then x = 1.0 end if sync memory call external_sync() sync memory(stat = status) if (iam == 2) then write(*, *) x[1] end if if (this_image() == 1) then sync images(*) else sync images(1, stat = status) end if end program sync1 lfortran-lfortran-2f73434/tests/reference/julia-arrays_08_func-ec93f58.stderr0000664000175000017500000000032315141516316027167 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/arrays_08_func.f90:29:27 | 29 | r = r .and. (a(i) .eq. b(i)) | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/ast-interactive_parse_without_program_line-f2c0aaa.stdout0000664000175000017500000001123315141516316034207 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (FuncCallOrArray allocate [] [(() (FuncCallOrArray a [] [(() 10 () 0)] [] [] [] ) () 0)] [] [] [] ) (FuncCallOrArray deallocate [] [(() a () 0)] [] [] [] ) (FuncCallOrArray open [] [] [(unit 10) (file (String "test.txt" ())) (status (String "old" ()))] [] [] ) (FuncCallOrArray flush [] [(() 10 () 0)] [] [] [] ) (FuncCallOrArray close [] [] [(unit 10)] [] [] ) (FuncCallOrArray nullify [] [(() p () 0)] [] [] [] ) exit cycle return continue (Print 0 () [exit] () ) (Print 0 () [cycle] () ) (Print 0 () [return] () ) (Print 0 () [continue] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 exit [] [] [] [] () ) (SubroutineCall 0 cycle [] [] [] [] () ) (SubroutineCall 0 return [] [] [] [] () ) (SubroutineCall 0 continue [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) contains (Subroutine sub [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DoLoop 0 () 0 i 1 10 () [(Print 0 () [i] () ) (If 0 () (== i 5) [(Exit 0 () () )] [] () () () ) (If 0 () (== i 7) [(Cycle 0 () () )] [] () () () ) (If 0 () (== i 9) [(Return 0 () () )] [] () () () ) (If 0 () (== i 2) [(Continue 0 () )] [] () () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] ) end program] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_var_of_int-1199f59.stderr0000664000175000017500000000026015141516316027021 0ustar alastairalastairsemantic error: Parameter 'a' is a variable, which does not reduce to a constant expression --> tests/errors/kind_var_of_int.f90:4:10 | 4 | real(a) :: x | ^ lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do2-fc94c6e.stderr0000664000175000017500000000032415141516316027263 0ustar alastairalastairsemantic error: The increment variable of the data implied do loop must be a constant --> tests/errors/data_implied_do2.f90:5:27 | 5 | data(iarx(i), i=1, 3, k) / 1, 2, 3 / | ^ lfortran-lfortran-2f73434/tests/reference/asr-arrays_01-5f1c776.json0000664000175000017500000000074515141516316025220 0ustar alastairalastair{ "basename": "asr-arrays_01-5f1c776", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01-5f1c776.stdout", "stdout_hash": "0e6c5f61ed9df7f3835dcec56bf360aab8f653616cd4305d1c237f82", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cmplx_02-48bb125.stdout0000664000175000017500000000054315141516316025375 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cmplx_02: (Program (SymbolTable 2 { }) cmplx_02 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-interface1-1906de3.stdout0000664000175000017500000000231515141516316025777 0ustar alastairalastair(TranslationUnit [(Module interface1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeaderName randn ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [randn_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector_n] [(SimpleAttribute AttrModule )] () )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-callback_04-0d9515f.json0000664000175000017500000000075615141516316025640 0ustar alastairalastair{ "basename": "llvm-callback_04-0d9515f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_04.f90", "infile_hash": "cd24a6ca8ba324bbafcdf3751e8bbb545e3e5c9ce22ebba1bc12ba8c", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_04-0d9515f.stdout", "stdout_hash": "8dcd564fdf5ec80b4e603a9237fbc9d3c477a0755ab65583a70d7e9d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-optional_01-56b1b65.stdout0000664000175000017500000001134315141516316026101 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optmod: (Module (SymbolTable 2 { optional_argument: (Function (SymbolTable 3 { name: (Variable 3 name [] In () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ) }) optional_argument (FunctionType [(String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 name)] [(If () (IntrinsicElementalFunction Present [(Var 3 name)] 0 (Logical 4) () ) [(Print (IntrinsicElementalFunction StringConcat [(StringConstant "Hello " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 name)] 0 (String 1 (IntegerConstant 16 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) )] [(Print (StringConstant "Hello world!" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] () Public .false. .false. () ) }) optmod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_11-13a7587.stdout0000664000175000017500000000606415141516316026373 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_11: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [x] Local (IntrinsicElementalFunction Real [(Var 2 x)] 0 (Real 4) (RealConstant 3.000000 (Real 4) ) ) (RealConstant 3.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_11 [] [(Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-where_04-a7fce45.stdout0000664000175000017500000005437715141516316025553 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { absdiff: (Variable 3 absdiff [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), reldiff: (Variable 3 reldiff [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Assignment (Var 3 reldiff) (ArrayConstant 8 [0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 3 absdiff) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Where (RealCompare (FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () ) NotEq (RealConstant 0.000000 (Real 4) ) (Array (Logical 4) [(() ())] DescriptorArray ) () ) [(Assignment (Var 3 reldiff) (RealBinOp (ArrayBroadcast (Var 3 absdiff) (IntrinsicArrayFunction Shape [(IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) Div (IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 reldiff)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) solution (FunctionType [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000001e-01, 1.00000001e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .false. .false. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_complex-c90dbdd.json0000664000175000017500000000100015141516316027324 0ustar alastairalastair{ "basename": "llvm-arrays_01_complex-c90dbdd", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_complex.f90", "infile_hash": "2f81875039547fcf7eaa3375e4f99fbc8ef6d91ac2bb214c88cff999", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_complex-c90dbdd.stdout", "stdout_hash": "7885759604f1e9c1038b78b5a59e7454034e55d937a6e688e7092a33", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_03-6fa1dfa.stdout0000664000175000017500000003731515141516316026155 0ustar alastairalastair(TranslationUnit [(Module types (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(dp [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () )] [] [] ) (Module constants (TriviaNode [(EndOfLine) (Comment "! Some constants" )] [(EndOfLine) (EndOfLine)] ) [(Use [] types [(UseSymbol dp () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(pi [] [] () () None ()) (e_ [] [] () () None ()) (i_ [] [] () () None ()) (bohr2ang [] [] () () None ()) (ang2bohr [] [] () () None ()) (Ha2eV [] [] () () None ()) (kB [] [] () () None ()) (K2au [] [] () () None ()) (density2gcm3 [] [] () () None ()) (u2au [] [] () () None ()) (s2au [] [] () () None ()) (kJmol2Ha [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Constants contain more digits than double precision, so that" ) (Comment "! they are rounded correctly. Single letter constants contain underscore so" ) (Comment "! that they do not clash with user variables (\"e\" and \"i\" are frequently used as" ) (Comment "! loop variables)" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(pi [] [] () (Real "3.1415926535897932384626433832795_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(e_ [] [] () (Real "2.7182818284590452353602874713527_dp") Equal ())] () ) (Declaration (AttrType TypeComplex [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(i_ [] [] () (Complex 0 1) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Na [] [] () (Real "6.02214129e23_dp") Equal ())] (TriviaNode [] [(EOLComment "! Avogadro constant" ) (Comment "! Standard uncertainty 0.00000027 (Source: 2010 CODATA)" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Ha2eV [] [] () (Real "27.21138505_dp") Equal ())] (TriviaNode [] [(EOLComment "! 1 Ha = (1 * Ha2eV) eV" ) (Comment "! Standard uncertainty is 0.00000060 eV (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(J2Ha [] [] () (Real "2.29371248e17_dp") Equal ())] (TriviaNode [] [(EOLComment "! 1 J = (1 * J2Ha) Ha" ) (Comment "! Standard uncertainty is 0.00000010 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Reduced Planck constant" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(hbar [] [] () (Real "1.054571726e-34_dp") Equal ())] (TriviaNode [] [(EOLComment "! [J s]" ) (Comment "! Standard uncertainty is 0.000000047 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Covert Ha to cm^{-1} (energy equivalent)" ) (Comment "! 1 Ha = (1 * Ha2invcm) cm^{-1}" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(Ha2invcm [] [] () (Real "219474.6313708_dp") Equal ())] (TriviaNode [] [(EndOfLine) (Comment "! Standard uncertainty is 0.0000011 cm^{-1} (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kB [] [] () (Real "1.3806488e-23_dp") Equal ())] (TriviaNode [] [(EOLComment "! Boltzmann constant [J/K]" ) (Comment "! Standard uncertainty is 0.0000013 J/K (Source: 2010 CODATA)" ) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(me [] [] () (Real "9.10938291e-31_dp") Equal ())] (TriviaNode [] [(EOLComment "! electron rest mass [kg]" ) (Comment "! Standard uncertainty is 0.00000040 eV (Source: 2010 CODATA)" ) (EndOfLine) (Comment "! Converts K to a.u.:" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(K2au [] [] () (* J2Ha kB) Equal ())] (TriviaNode [] [(EOLComment "! 1 K = (1 * K2au) a.u." ) (EndOfLine) (Comment "! Conversion between Bohr (Hartree atomic units) and Angstrom" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(bohr2ang [] [] () (Real "0.529177249_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(ang2bohr [] [] () (/ 1 bohr2ang) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts eV to kcal/mol, it is assumed, that the number in eV is given per" ) (Comment "! molecule. 1 eV = (1 * eV2kcalmol) kcal/mol" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kcalmol2kJmol [] [] () (Real "4.184_dp") Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(kJmol2Ha [] [] () (/ (* 1000 J2Ha) Na) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts density from a.u. to g/cm^3" )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(density2gcm3 [] [] () (/ (* me (Real "1e3_dp")) (** (* bohr2ang (Real "1e-8_dp")) 3)) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts u (atomic mass unit) to a.u." )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(u2au [] [] () (/ 1 (* (* Na me) (Real "1e3_dp"))) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Converts s to a.u." )] ) ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrParameter )] [(s2au [] [] () (/ 1 (* J2Ha hbar)) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] ) (Program modules_03 () [(Use [] constants [(UseSymbol Ha2eV () )] .true. () )] [] [] [(Print 0 () [Ha2eV] () )] [] )] ) ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-functions_15-581089a.stdoutlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-functions_15-580000664000175000017500000011466015141516316034373 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_15: (Program (SymbolTable 4 { __libasr_created_variable_: (Variable 4 __libasr_created_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_1: (Variable 4 __libasr_created_variable_1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_2: (Variable 4 __libasr_created_variable_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_3: (Variable 4 __libasr_created_variable_3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_4: (Variable 4 __libasr_created_variable_4 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 5 { __libasr_is_present_x: (Variable 5 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 5 f [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Logical 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 __libasr_is_present_x)] [(Assignment (Var 5 f) (Var 5 __libasr_is_present_x) () .false. .false. )] (Var 5 f) Public .false. .false. () ), sub_1: (ExternalSymbol 4 sub_1 2 sub_1 functions_15_module_1 [] sub_1 Public ) }) functions_15 [functions_15_module_1] [(Assignment (Var 4 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 12.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) )) ((IntegerConstant 5 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((Var 4 __libasr_created_variable_1)) ((LogicalConstant .false. (Logical 4) )) ((Var 4 __libasr_created_variable_2)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 6.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .true. (Logical 4) )) ((Var 4 __libasr_created_variable_3)) ((LogicalConstant .false. (Logical 4) )) ((IntegerConstant 78 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((RealConstant 117.000000 (Real 4) ))] () .false. ) (SubroutineCall 4 sub_1 () [((Var 4 a)) ((Var 4 b)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 58.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) )) ((Var 4 __libasr_created_variable_4)) ((LogicalConstant .false. (Logical 4) )) ((RealConstant 123.000000 (Real 4) ))] () .false. ) (Print (StringFormat () [(Var 4 a) (Var 4 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 4 a) NotEq (IntegerConstant 144288208 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 4 b) NotEq (RealConstant 1477476.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 4 f () [((Var 4 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] (Logical 4) () () ) (FunctionCall 4 f () [((IntegerConstant 42 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) ))] (Logical 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_15_module_1: (Module (SymbolTable 2 { sub_1: (Function (SymbolTable 3 { __libasr_is_present_d: (Variable 3 __libasr_is_present_d [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_is_present_e: (Variable 3 __libasr_is_present_e [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 3 a [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 3 e [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 3 f [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub_1 (FunctionType [(Integer 4) (Real 4) (Logical 4) (Real 4) (Logical 4) (Integer 4) (Logical 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d) (Var 3 __libasr_is_present_d) (Var 3 e) (Var 3 __libasr_is_present_e) (Var 3 f)] [(If () (Var 3 __libasr_is_present_d) [(Assignment (Var 3 a) (Cast (RealBinOp (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) Add (Var 3 d) (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (If () (Var 3 __libasr_is_present_e) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] [(Assignment (Var 3 a) (Cast (RealBinOp (Var 3 b) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (If () (Var 3 __libasr_is_present_e) [(Assignment (Var 3 b) (RealBinOp (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) Add (Cast (Var 3 e) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] [(Assignment (Var 3 b) (RealBinOp (Var 3 b) Mul (Var 3 f) (Real 4) () ) () .false. .false. )] )] )] () Public .false. .false. () ) }) functions_15_module_1 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_ifdef_01-f746dbf.stderr0000664000175000017500000000016215141516316032503 0ustar alastairalastairC preprocessor error: Unterminated #ifdef --> tests/errors/unterminated_ifdef_01.f90:1:1 | 1 | #ifdef a | ^ lfortran-lfortran-2f73434/tests/reference/asr-common_03-9052466.json0000664000175000017500000000074515141516316025046 0ustar alastairalastair{ "basename": "asr-common_03-9052466", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_03.f90", "infile_hash": "c7d42ede7ccad177a6c3e7543d3db6f5812f3305a1059d85bf47952c", "outfile": null, "outfile_hash": null, "stdout": "asr-common_03-9052466.stdout", "stdout_hash": "d6337781ccff9d2f39ac09f2c710d3dc5bd0d7818f3f9b35fa8c2654", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-init_values-b1d5491.json0000664000175000017500000000075615141516316026117 0ustar alastairalastair{ "basename": "llvm-init_values-b1d5491", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/init_values.f90", "infile_hash": "1cafced706fa2754f92f2d460867d6c84638fd10447df12f124fd419", "outfile": null, "outfile_hash": null, "stdout": "llvm-init_values-b1d5491.stdout", "stdout_hash": "086315ed1dc32c8439263915c3fc2cc19dd7ea6fe75c2cb615c8b10e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-string_10-ef0078f.stdout0000664000175000017500000004236115141516316026040 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @c_data = private global [2 x i8] c"BC" @c = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @c_data, i32 0, i32 0), i64 2 }> @string_const_data = private constant [1 x i8] c"A" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data, i32 0, i32 0), i64 1 }> @string_const_data.1 = private constant [1 x i8] c"Z" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }> @string_const_data.3 = private constant [1 x i8] c"a" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.3, i32 0, i32 0), i64 1 }> @string_const_data.5 = private constant [1 x i8] c"z" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.5, i32 0, i32 0), i64 1 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [2 x i8] c"L\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.7 = private constant [2 x i8] c"@a" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.7, i32 0, i32 0), i64 2 }> @string_const_data.9 = private constant [1 x i8] c"A" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.9, i32 0, i32 0), i64 1 }> @string_const_data.11 = private constant [1 x i8] c"Z" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.11, i32 0, i32 0), i64 1 }> @string_const_data.13 = private constant [1 x i8] c"a" @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.13, i32 0, i32 0), i64 1 }> @string_const_data.15 = private constant [1 x i8] c"z" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.15, i32 0, i32 0), i64 1 }> @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.17 = private unnamed_addr constant [2 x i8] c"L\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.18 = private constant [2 x i8] c"a@" @string_const.19 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.18, i32 0, i32 0), i64 2 }> @string_const_data.20 = private constant [1 x i8] c"A" @string_const.21 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.20, i32 0, i32 0), i64 1 }> @string_const_data.22 = private constant [1 x i8] c"Z" @string_const.23 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.22, i32 0, i32 0), i64 1 }> @string_const_data.24 = private constant [1 x i8] c"a" @string_const.25 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.24, i32 0, i32 0), i64 1 }> @string_const_data.26 = private constant [1 x i8] c"z" @string_const.27 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.26, i32 0, i32 0), i64 1 }> @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.28 = private unnamed_addr constant [2 x i8] c"L\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @string_const_data.29 = private constant [3 x i8] c"sbs" @string_const.30 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.29, i32 0, i32 0), i64 3 }> @string_const_data.31 = private constant [3 x i8] c"sbs" @string_const.32 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.31, i32 0, i32 0), i64 3 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %is_alpha = alloca i1, align 1 %num = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %num, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 1 store i64 3, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 3) store i8* %4, i8** %3, align 8 %5 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %6 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %7 = call i32 @str_compare(i8* %5, i64 2, i8* %6, i64 1) %8 = icmp sge i32 %7, 0 %9 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %10 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 %11 = call i32 @str_compare(i8* %9, i64 2, i8* %10, i64 1) %12 = icmp sle i32 %11, 0 %13 = icmp eq i1 %8, false %14 = select i1 %13, i1 %8, i1 %12 %15 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 %17 = call i32 @str_compare(i8* %15, i64 2, i8* %16, i64 1) %18 = icmp sge i32 %17, 0 %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %20 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 %21 = call i32 @str_compare(i8* %19, i64 2, i8* %20, i64 1) %22 = icmp sle i32 %21, 0 %23 = icmp eq i1 %18, false %24 = select i1 %23, i1 %18, i1 %22 %25 = icmp eq i1 %14, false %26 = select i1 %25, i1 %24, i1 %14 store i1 %26, i1* %is_alpha, align 1 %27 = alloca i64, align 8 %28 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info, i32 0, i32 0), i64* %27, i32 0, i32 0, i1* %is_alpha) %29 = load i64, i64* %27, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %29, i64* %31, align 4 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %35 = load i64, i64* %34, align 4 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %28) br label %free_done free_done: ; preds = %free_nonnull, %.entry %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 1), i8 0, i8 0, i8* %38, i64 2) %39 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %40 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 %41 = call i32 @str_compare(i8* %39, i64 2, i8* %40, i64 1) %42 = icmp sge i32 %41, 0 %43 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %44 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 %45 = call i32 @str_compare(i8* %43, i64 2, i8* %44, i64 1) %46 = icmp sle i32 %45, 0 %47 = icmp eq i1 %42, false %48 = select i1 %47, i1 %42, i1 %46 %49 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %50 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.14, i32 0, i32 0), align 8 %51 = call i32 @str_compare(i8* %49, i64 2, i8* %50, i64 1) %52 = icmp sge i32 %51, 0 %53 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %54 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 %55 = call i32 @str_compare(i8* %53, i64 2, i8* %54, i64 1) %56 = icmp sle i32 %55, 0 %57 = icmp eq i1 %52, false %58 = select i1 %57, i1 %52, i1 %56 %59 = icmp eq i1 %48, false %60 = select i1 %59, i1 %58, i1 %48 store i1 %60, i1* %is_alpha, align 1 %61 = alloca i64, align 8 %62 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.17, i32 0, i32 0), i64* %61, i32 0, i32 0, i1* %is_alpha) %63 = load i64, i64* %61, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %62, i8** %64, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %63, i64* %65, align 4 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %67 = load i8*, i8** %66, align 8 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %69 = load i64, i64* %68, align 4 %70 = trunc i64 %69 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %67, i32 %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %71 = icmp eq i8* %62, null br i1 %71, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %62) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %72 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.19, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 1), i8 0, i8 0, i8* %72, i64 2) %73 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %74 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.21, i32 0, i32 0), align 8 %75 = call i32 @str_compare(i8* %73, i64 2, i8* %74, i64 1) %76 = icmp sge i32 %75, 0 %77 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %78 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.23, i32 0, i32 0), align 8 %79 = call i32 @str_compare(i8* %77, i64 2, i8* %78, i64 1) %80 = icmp sle i32 %79, 0 %81 = icmp eq i1 %76, false %82 = select i1 %81, i1 %76, i1 %80 %83 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %84 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.25, i32 0, i32 0), align 8 %85 = call i32 @str_compare(i8* %83, i64 2, i8* %84, i64 1) %86 = icmp sge i32 %85, 0 %87 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @c, i32 0, i32 0), align 8 %88 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.27, i32 0, i32 0), align 8 %89 = call i32 @str_compare(i8* %87, i64 2, i8* %88, i64 1) %90 = icmp sle i32 %89, 0 %91 = icmp eq i1 %86, false %92 = select i1 %91, i1 %86, i1 %90 %93 = icmp eq i1 %82, false %94 = select i1 %93, i1 %92, i1 %82 store i1 %94, i1* %is_alpha, align 1 %95 = alloca i64, align 8 %96 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.28, i32 0, i32 0), i64* %95, i32 0, i32 0, i1* %is_alpha) %97 = load i64, i64* %95, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %96, i8** %98, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %97, i64* %99, align 4 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %101 = load i8*, i8** %100, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %103 = load i64, i64* %102, align 4 %104 = trunc i64 %103 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %101, i32 %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %105 = icmp eq i8* %96, null br i1 %105, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %96) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %106 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %107 = load i8*, i8** %106, align 8 %StrSliceGEP = getelementptr i8, i8* %107, i64 0 %StrSlice_StrView = alloca %string_descriptor, align 8 %108 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %108, align 8 %109 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 3, i64* %109, align 4 %110 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %111 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %112 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.30, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %110, i64* %111, i8 0, i8 0, i8* %112, i64 3) %113 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %114 = load i8*, i8** %113, align 8 %115 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.32, i32 0, i32 0), align 8 %116 = call i32 @str_compare(i8* %114, i64 3, i8* %115, i64 3) %117 = icmp ne i32 %116, 0 br i1 %117, label %then, label %else then: ; preds = %free_done6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done6 br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_string_10 FINALIZE_SYMTABLE_string_10: ; preds = %return br label %Finalize_Variable_num Finalize_Variable_num: ; preds = %FINALIZE_SYMTABLE_string_10 %118 = getelementptr %string_descriptor, %string_descriptor* %num, i32 0, i32 0 %119 = load i8*, i8** %118, align 8 %120 = icmp eq i8* %119, null br i1 %120, label %free_done8, label %free_nonnull7 free_nonnull7: ; preds = %Finalize_Variable_num call void @_lfortran_free(i8* %119) br label %free_done8 free_done8: ; preds = %free_nonnull7, %Finalize_Variable_num ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare i32 @str_compare(i8*, i64, i8*, i64) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/c-case_06-ecc9f3c.json0000664000175000017500000000071415141516316024505 0ustar alastairalastair{ "basename": "c-case_06-ecc9f3c", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "c-case_06-ecc9f3c.stdout", "stdout_hash": "8e19967ceedef2f6dbbf7f2e51a9ea288093f820c09e381d8822f3e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-complex3-001609d.json0000664000175000017500000000103415141516316025044 0ustar alastairalastair{ "basename": "ast-complex3-001609d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/complex3.f90", "infile_hash": "29dfe84a66828ae3a5d79a29bb69d3fc83483f69e38a065f73773ca2", "outfile": null, "outfile_hash": null, "stdout": "ast-complex3-001609d.stdout", "stdout_hash": "9d4f9a9064017ecea50bb9b30751e4bc47092f00ea2fedf5f8fcdbb8", "stderr": "ast-complex3-001609d.stderr", "stderr_hash": "75638547efd9f494772ccf5e50d6be0bba3619d62d3004a9c6dcb288", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_03-a95b1f2.json0000664000175000017500000000100115141516316030175 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_03-a95b1f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_03.f90", "infile_hash": "a68b2276cc817ca2db41c25621904b778868e085b956002ce3efba83", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_03-a95b1f2.stderr", "stderr_hash": "e62bad036d6b387c4724af66f63526d9db27752fdabf6a16662dc60e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_09-0e83add.stdout0000664000175000017500000000065515141516316027276 0ustar alastairalastair(TranslationUnit [(Program type_parsing (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [] [] [(DerivedType SomeType [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-types_09-e7605c9.json0000664000175000017500000000074215141516316025072 0ustar alastairalastair{ "basename": "ast-types_09-e7605c9", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_09.f90", "infile_hash": "57d771f754443897c504c6507554917133b64bfc0c8c352317f63b2f", "outfile": null, "outfile_hash": null, "stdout": "ast-types_09-e7605c9.stdout", "stdout_hash": "a16eb108929c270be04a6362936aab1e8cca962e95fcea40035ba618", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_04-ea50b75.stdout0000664000175000017500000002542515141516316026353 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_04: (Program (SymbolTable 4 { int: (Variable 4 int [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), to_negative: (ExternalSymbol 4 to_negative 2 to_negative stdlib_int [] to_negative Public ), to_negative@to_negative~genericprocedure: (ExternalSymbol 4 to_negative@to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Private ), to_negative~genericprocedure: (ExternalSymbol 4 to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Public ) }) functions_04 [stdlib_int] [(If () (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4) () () ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4) () () ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), stdlib_int: (Module (SymbolTable 2 { to_negative: (GenericProcedure 2 to_negative [2 to_negative~genericprocedure] Public ), to_negative~genericprocedure: (Function (SymbolTable 3 { int: (Variable 3 int [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), neg_int: (Variable 3 neg_int [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) to_negative~genericprocedure (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 int)] [(If () (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4) () ) () .false. .false. )] [(Assignment (Var 3 neg_int) (Var 3 int) () .false. .false. )] )] (Var 3 neg_int) Public .false. .false. () ) }) stdlib_int () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-entry2-a9679e0.stdout0000664000175000017500000001546215141516316025217 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { prin: (Function (SymbolTable 3 { }) prin (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [prini_main__lcompilers] [] [(SubroutineCall 1 prini_main__lcompilers 1 prini_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal))] () .false. )] () Public .false. .false. () ), prini: (Function (SymbolTable 2 { }) prini (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [prini_main__lcompilers] [] [(SubroutineCall 1 prini_main__lcompilers 1 prini_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal))] () .false. )] () Public .false. .false. () ), prini_main__lcompilers: (Function (SymbolTable 4 { entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), messpr: (Function (SymbolTable 5 { }) messpr (FunctionType [] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) prini_main__lcompilers (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Return) (GoToTarget 2 2 ) (SubroutineCall 4 messpr () [] () .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-save2-63c8bcc.stdout0000664000175000017500000013721615141516316025145 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 7 { a: (Variable 7 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 7 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [] ), save_fun: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), save_fun: (Variable 3 save_fun [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_fun (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 save_fun) Public .false. .false. () ), save_module_2: (Module (SymbolTable 4 { a: (Variable 4 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), fun_save: (Function (SymbolTable 6 { a: (Variable 6 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 6 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), fun_save: (Variable 6 fun_save [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fun_save (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 fun_save) Public .false. .false. () ), sub_save: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 5 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub_save (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), x: (Variable 4 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_module_2 () [] .false. .false. .false. ), save_sub: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_19-26385d4.stdout0000664000175000017500000005231015141516316027057 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_module_19: (Module (SymbolTable 4 { check_proc: (Function (SymbolTable 7 { array: (Variable 7 array [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 4 child_value Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 7 ptr [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 4 toml_value Source Public Required .false. .false. .false. () .false. .false. ), ~select_type_block_: (Block (SymbolTable 8 { 1_child_value_ok: (ExternalSymbol 8 1_child_value_ok 5 ok child_value [] ok Public ) }) ~select_type_block_ [(If () (StructInstanceMember (Var 7 ptr) 8 1_child_value_ok (Logical 4) () ) [(Associate (Var 7 array) (Var 7 ptr) )] [(SubroutineCall 4 not_ok () [] () .false. ) (Return)] )] ), ~select_type_block_1: (Block (SymbolTable 9 { }) ~select_type_block_1 [(SubroutineCall 4 default_class () [] () .false. ) (Return)] ) }) check_proc (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [not_ok default_class] [] [(If () (PointerAssociated (Var 7 ptr) () (Logical 4) () ) [(SelectType (Var 7 ptr) () [(TypeStmtName 4 child_value [(BlockCall -1 7 ~select_type_block_ )] )] [(BlockCall -1 7 ~select_type_block_1 )] )] [] )] () Public .false. .false. () ), child_value: (Struct (SymbolTable 5 { ok: (Variable 5 ok [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) child_value (StructType [(Logical 4)] [] .true. .false. ) [] [ok] [] Source Public .false. .false. [] () 4 toml_value ), default_class: (Function (SymbolTable 10 { }) default_class (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "default class" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), new: (GenericProcedure 4 new [4 check_proc] Public ), not_ok: (Function (SymbolTable 11 { }) not_ok (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "not ok" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), toml_value: (Struct (SymbolTable 6 { key: (Variable 6 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () ) }) derived_types_module_19 () [] .true. .false. .false. ), derived_types_module_19_1: (Module (SymbolTable 2 { check_here: (Function (SymbolTable 12 { }) check_here (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 check_proc () [] () .false. )] () Public .false. .false. () ), check_proc: (ExternalSymbol 2 check_proc 4 check_proc derived_types_module_19 [] check_proc Public ) }) derived_types_module_19_1 () [derived_types_module_19] .false. .false. .false. ), main: (Program (SymbolTable 13 { }) main [] [(Print (StringConstant "running derived_types_19 main program" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-int_01-9bf3eb9.stderr0000664000175000017500000000036215141516316025177 0ustar alastairalastairsemantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/int_01.f90:2:54 | 2 | integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-expr4-ffedfc3.stdout0000664000175000017500000000210715141516316025507 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define float @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca float, align 4 %__lfortran_evaluate_12 = alloca float, align 4 %__lfortran_evaluate_13 = alloca float, align 4 %__lfortran_evaluate_14 = alloca float, align 4 %__lfortran_evaluate_15 = alloca float, align 4 %__lfortran_evaluate_16 = alloca float, align 4 store float 5.000000e+00, float* %__lfortran_evaluate_11, align 4 store float 8.000000e+00, float* %__lfortran_evaluate_12, align 4 store float 1.600000e+01, float* %__lfortran_evaluate_13, align 4 store float 1.100000e+01, float* %__lfortran_evaluate_14, align 4 store float 2.000000e+00, float* %__lfortran_evaluate_15, align 4 store float 6.400000e+01, float* %__lfortran_evaluate_16, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load float, float* %__lfortran_evaluate_16, align 4 ret float %0 } lfortran-lfortran-2f73434/tests/reference/ast_f90-common1-ee77de6.json0000664000175000017500000000072515141516316025612 0ustar alastairalastair{ "basename": "ast_f90-common1-ee77de6", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/common1.f90", "infile_hash": "d7a7a1f2f3dfe2e00668bce25dbd3dc8830df902ed2c7841ef1bc6e8", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-common1-ee77de6.stdout", "stdout_hash": "a72eaba3993b111d7c87901b45f818c96eb97ecb871752201a044547", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form2-ad2afae.stdout0000664000175000017500000000264515141516316026460 0ustar alastairalastair(TranslationUnit [(Program fixed_form2 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [(String "OK1" ()) (String "OK2" ())] () ) (Print 0 () [(String "OK1" ()) (String "OK2" ()) (String "OK3" ()) (String "OK4" ())] () ) (Print 0 () [(String "1" ())] () ) (Print 0 () [(String "2" ())] () ) (Print 0 () [(String "1" ()) (String "1 ! not comment finish string" ())] () ) (Print 0 () [(String "1" ()) (String "1 \" ' 2 \"\" 3 ! also not comment finish string" ())] () ) (Print 0 () [(String "1" ()) (String "1 ' \" 2 '' 3 ! also not comment finish string" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-case_05-8f778ac.json0000664000175000017500000000073715141516316024724 0ustar alastairalastair{ "basename": "asr-case_05-8f778ac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "asr-case_05-8f778ac.stdout", "stdout_hash": "a354565fe68e49a0d782be8c1dbea61e2a36a53ef9a4eb76f7620665", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_06-5f5f77a.stderr0000664000175000017500000000031115141516316025443 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `str` has rank `1`, but is referenced as rank `2` --> tests/errors/array_06.f90:5:5 | 5 | str(1, 2)(:) = '1234' | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-derived_types_07-c5a29e3.json0000664000175000017500000000074515141516316026644 0ustar alastairalastair{ "basename": "asr-derived_types_07-c5a29e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_07.f90", "infile_hash": "1113bb8810a8cabbaa2deaee33aa216082f6086f7cc9b8b2f34fd466", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-c5a29e3.stdout", "stdout_hash": "7b38ca197e0d6b72d9ce505e01914777dd63717cf283a36b8f4900d3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-data_12-3198178.json0000664000175000017500000000073715141516316024477 0ustar alastairalastair{ "basename": "ast-data_12-3198178", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_12.f90", "infile_hash": "80710a15ea7a648779263ef05c92564bd17392b333fcaeeef1880a91", "outfile": null, "outfile_hash": null, "stdout": "ast-data_12-3198178.stdout", "stdout_hash": "0c461794e6998f5ea8c2ada897af16902dcf4a3c5c7558be05af24b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout0000664000175000017500000000624615141516316031524 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-external_02-99f90be.json0000664000175000017500000000076515141516316026016 0ustar alastairalastair{ "basename": "llvm-external_02-99f90be", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_02.f90", "infile_hash": "229cee9d64d77be22b3786ec7d91c285922a45bcd94b40f9d7e0d2b9", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_02-99f90be.stdout", "stdout_hash": "a0d107e4850bdb69a6974cc7d86925f151ad4d8ad5eb237a9fb6ee3b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_do_loops-doloop_04-749d5f0.stdout0000664000175000017500000006441315141516316027650 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_04: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_04 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (Var 2 k) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 k) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 k) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) GtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Sub (Var 2 k) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 k) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 k) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) GtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop a (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit a )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop b (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(Exit b )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (WhileLoop c (LogicalConstant .true. (Logical 4) ) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit c )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (Var 2 k) (Integer 4) () ) () .false. .false. ) (WhileLoop () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 k) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) LtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (IntegerCompare (Var 2 k) LtE (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) And (IntegerCompare (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) GtE (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (Var 2 k) (Integer 4) () ) () .false. .false. ) (GoToTarget 100 100 )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-interactive_parse_without_program_line-f2c0aaa.json0000664000175000017500000000104715141516316033640 0ustar alastairalastair{ "basename": "ast-interactive_parse_without_program_line-f2c0aaa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interactive_parse_without_program_line.f90", "infile_hash": "c68088b59370c4f5a2dc3747e3ca0c7de19d0210a92e2043fb975b96", "outfile": null, "outfile_hash": null, "stdout": "ast-interactive_parse_without_program_line-f2c0aaa.stdout", "stdout_hash": "c5cd726198fbd61cca4cda6b959996173a445e2640f44b18f7511de0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_array_op-array15-079d0cd.json0000664000175000017500000000075615141516316027032 0ustar alastairalastair{ "basename": "pass_array_op-array15-079d0cd", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array15.f90", "infile_hash": "18924f1dcd04103b427c1fe1321fa206ef73add7548a17e61ea10df2", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-array15-079d0cd.stdout", "stdout_hash": "85ea6ef94b7613f7e9e2f2805ba99be139e784111005bf161f1cef90", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine6-f8dae3a.stdout0000664000175000017500000000056115141516316027001 0ustar alastairalastairfunction triad(a::Array{Float32, 1}, b::Array{Float32, 1}, scalar::Float32, c::Array{Float32, 1}) local i::Int32 local j::Int32 local n::Int32 local n2::Int32 n = length(a) n2 = length(b) Threads.@threads for i ∈ 1:n c[i] = a[i] + scalar * b[i] end Threads.@threads for j ∈ 1:n2 c[j] = b[j] + scalar end end lfortran-lfortran-2f73434/tests/reference/asr-character_01-e8e453d.json0000664000175000017500000000106515141516316025726 0ustar alastairalastair{ "basename": "asr-character_01-e8e453d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_01.f90", "infile_hash": "f952599c29229b99c5aca49cbb1e3ee4ff0dbd778b07ce826549ff4d", "outfile": null, "outfile_hash": null, "stdout": "asr-character_01-e8e453d.stdout", "stdout_hash": "eff9bb53d86ac3551db9693c998a267a7f62bb1b071a5b9ec14322f8", "stderr": "asr-character_01-e8e453d.stderr", "stderr_hash": "c65e821fd013fdfacc225b26b767527afdb4d228d8e60841a7d0349c", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-floor_02-5b70ee6.stdout0000664000175000017500000005262315141516316025467 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { floor_02: (Program (SymbolTable 2 { a1: (Variable 2 a1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 2 a2 [] Local (RealConstant 3.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a3: (Variable 2 a3 [] Local (RealConstant 3.700000 (Real 4) ) (RealConstant 3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b1: (Variable 2 b1 [] Local (RealUnaryMinus (RealConstant 3.300000 (Real 4) ) (Real 4) (RealConstant -3.300000 (Real 4) ) ) (RealConstant -3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b2: (Variable 2 b2 [] Local (RealUnaryMinus (RealConstant 3.500000 (Real 4) ) (Real 4) (RealConstant -3.500000 (Real 4) ) ) (RealConstant -3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b3: (Variable 2 b3 [] Local (RealUnaryMinus (RealConstant 3.700000 (Real 4) ) (Real 4) (RealConstant -3.700000 (Real 4) ) ) (RealConstant -3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x1: (Variable 2 x1 [a1] Local (IntrinsicElementalFunction Floor [(Var 2 a1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x2: (Variable 2 x2 [a2] Local (IntrinsicElementalFunction Floor [(Var 2 a2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x3: (Variable 2 x3 [a3] Local (IntrinsicElementalFunction Floor [(Var 2 a3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y1: (Variable 2 y1 [b1] Local (IntrinsicElementalFunction Floor [(Var 2 b1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y2: (Variable 2 y2 [b2] Local (IntrinsicElementalFunction Floor [(Var 2 b2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y3: (Variable 2 y3 [b3] Local (IntrinsicElementalFunction Floor [(Var 2 b3)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntegerConstant -4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) floor_02 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 x1) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 x2) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 x3) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 y1) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 y2) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (Var 2 y3) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 x1) (Var 2 x2) (Var 2 x3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 y1) (Var 2 y2) (Var 2 y3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-doloop_04-e25bf76.stdout0000664000175000017500000003573215141516316026036 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 store i32 0, i32* %j, align 4 store i32 2, i32* %k, align 4 %2 = load i32, i32* %k, align 4 %3 = sub i32 1, %2 store i32 %3, i32* %i, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %4 = load i32, i32* %k, align 4 %5 = icmp sgt i32 %4, 0 %6 = load i32, i32* %i, align 4 %7 = load i32, i32* %k, align 4 %8 = add i32 %6, %7 %9 = icmp sle i32 %8, 10 %10 = icmp eq i1 %5, false %11 = select i1 %10, i1 %5, i1 %9 %12 = load i32, i32* %k, align 4 %13 = icmp sle i32 %12, 0 %14 = load i32, i32* %i, align 4 %15 = load i32, i32* %k, align 4 %16 = add i32 %14, %15 %17 = icmp sge i32 %16, 10 %18 = icmp eq i1 %13, false %19 = select i1 %18, i1 %13, i1 %17 %20 = icmp eq i1 %11, false %21 = select i1 %20, i1 %19, i1 %11 br i1 %21, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %22 = load i32, i32* %i, align 4 %23 = load i32, i32* %k, align 4 %24 = add i32 %22, %23 store i32 %24, i32* %i, align 4 %25 = load i32, i32* %j, align 4 %26 = load i32, i32* %i, align 4 %27 = add i32 %25, %26 store i32 %27, i32* %j, align 4 br label %loop.head loop.end: ; preds = %loop.head %28 = load i32, i32* %j, align 4 %29 = icmp ne i32 %28, 25 br i1 %29, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %30 = alloca i64, align 8 %31 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %30, i32 0, i32 0, i32* %j) %32 = load i64, i64* %30, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %31, i8** %33, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %32, i64* %34, align 4 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %38 = load i64, i64* %37, align 4 %39 = trunc i64 %38 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %40 = icmp eq i8* %31, null br i1 %40, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %31) br label %free_done free_done: ; preds = %free_nonnull, %ifcont store i32 0, i32* %j, align 4 store i32 -2, i32* %k, align 4 %41 = load i32, i32* %k, align 4 %42 = sub i32 10, %41 store i32 %42, i32* %i, align 4 br label %loop.head1 loop.head1: ; preds = %loop.body2, %free_done %43 = load i32, i32* %k, align 4 %44 = icmp sgt i32 %43, 0 %45 = load i32, i32* %i, align 4 %46 = load i32, i32* %k, align 4 %47 = add i32 %45, %46 %48 = icmp sle i32 %47, 1 %49 = icmp eq i1 %44, false %50 = select i1 %49, i1 %44, i1 %48 %51 = load i32, i32* %k, align 4 %52 = icmp sle i32 %51, 0 %53 = load i32, i32* %i, align 4 %54 = load i32, i32* %k, align 4 %55 = add i32 %53, %54 %56 = icmp sge i32 %55, 1 %57 = icmp eq i1 %52, false %58 = select i1 %57, i1 %52, i1 %56 %59 = icmp eq i1 %50, false %60 = select i1 %59, i1 %58, i1 %50 br i1 %60, label %loop.body2, label %loop.end3 loop.body2: ; preds = %loop.head1 %61 = load i32, i32* %i, align 4 %62 = load i32, i32* %k, align 4 %63 = add i32 %61, %62 store i32 %63, i32* %i, align 4 %64 = load i32, i32* %j, align 4 %65 = load i32, i32* %i, align 4 %66 = add i32 %64, %65 store i32 %66, i32* %j, align 4 br label %loop.head1 loop.end3: ; preds = %loop.head1 %67 = load i32, i32* %j, align 4 %68 = icmp ne i32 %67, 30 br i1 %68, label %then4, label %else5 then4: ; preds = %loop.end3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %loop.end3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %69 = alloca i64, align 8 %70 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %69, i32 0, i32 0, i32* %j) %71 = load i64, i64* %69, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %70, i8** %72, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %71, i64* %73, align 4 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %77 = load i64, i64* %76, align 4 %78 = trunc i64 %77 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %75, i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %79 = icmp eq i8* %70, null br i1 %79, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %ifcont6 call void @_lfortran_free(i8* %70) br label %free_done9 free_done9: ; preds = %free_nonnull8, %ifcont6 store i32 0, i32* %j, align 4 store i32 0, i32* %i, align 4 br label %a.head a.head: ; preds = %ifcont12, %free_done9 %80 = load i32, i32* %i, align 4 %81 = add i32 %80, 1 %82 = icmp sle i32 %81, 10 br i1 %82, label %a.body, label %a.end a.body: ; preds = %a.head %83 = load i32, i32* %i, align 4 %84 = add i32 %83, 1 store i32 %84, i32* %i, align 4 %85 = load i32, i32* %j, align 4 %86 = load i32, i32* %i, align 4 %87 = add i32 %85, %86 store i32 %87, i32* %j, align 4 %88 = load i32, i32* %i, align 4 %89 = icmp eq i32 %88, 2 br i1 %89, label %then10, label %else11 then10: ; preds = %a.body br label %a.end unreachable_after_exit: ; No predecessors! br label %ifcont12 else11: ; preds = %a.body br label %ifcont12 ifcont12: ; preds = %else11, %unreachable_after_exit br label %a.head a.end: ; preds = %then10, %a.head %90 = load i32, i32* %j, align 4 %91 = icmp ne i32 %90, 3 br i1 %91, label %then13, label %else14 then13: ; preds = %a.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %a.end br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 0, i32* %j, align 4 store i32 -1, i32* %i, align 4 br label %b.head b.head: ; preds = %ifcont19, %ifcont15 %92 = load i32, i32* %i, align 4 %93 = add i32 %92, 2 %94 = icmp sle i32 %93, 10 br i1 %94, label %b.body, label %b.end b.body: ; preds = %b.head %95 = load i32, i32* %i, align 4 %96 = add i32 %95, 2 store i32 %96, i32* %i, align 4 %97 = load i32, i32* %j, align 4 %98 = load i32, i32* %i, align 4 %99 = add i32 %97, %98 store i32 %99, i32* %j, align 4 %100 = load i32, i32* %i, align 4 %101 = icmp eq i32 %100, 3 br i1 %101, label %then16, label %else18 then16: ; preds = %b.body br label %b.end unreachable_after_exit17: ; No predecessors! br label %ifcont19 else18: ; preds = %b.body br label %ifcont19 ifcont19: ; preds = %else18, %unreachable_after_exit17 br label %b.head b.end: ; preds = %then16, %b.head %102 = load i32, i32* %j, align 4 %103 = icmp ne i32 %102, 4 br i1 %103, label %then20, label %else21 then20: ; preds = %b.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont22 else21: ; preds = %b.end br label %ifcont22 ifcont22: ; preds = %else21, %then20 store i32 0, i32* %j, align 4 store i32 1, i32* %i, align 4 br label %c.head c.head: ; preds = %ifcont26, %ifcont22 br i1 true, label %c.body, label %c.end c.body: ; preds = %c.head %104 = load i32, i32* %j, align 4 %105 = load i32, i32* %i, align 4 %106 = add i32 %104, %105 store i32 %106, i32* %j, align 4 %107 = load i32, i32* %i, align 4 %108 = icmp eq i32 %107, 2 br i1 %108, label %then23, label %else25 then23: ; preds = %c.body br label %c.end unreachable_after_exit24: ; No predecessors! br label %ifcont26 else25: ; preds = %c.body br label %ifcont26 ifcont26: ; preds = %else25, %unreachable_after_exit24 %109 = load i32, i32* %i, align 4 %110 = add i32 %109, 1 store i32 %110, i32* %i, align 4 br label %c.head c.end: ; preds = %then23, %c.head %111 = load i32, i32* %j, align 4 %112 = icmp ne i32 %111, 3 br i1 %112, label %then27, label %else28 then27: ; preds = %c.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont29 else28: ; preds = %c.end br label %ifcont29 ifcont29: ; preds = %else28, %then27 store i32 2, i32* %k, align 4 %113 = load i32, i32* %k, align 4 %114 = sub i32 1, %113 store i32 %114, i32* %i, align 4 br label %loop.head30 loop.head30: ; preds = %goto_target, %ifcont29 %115 = load i32, i32* %k, align 4 %116 = icmp sgt i32 %115, 0 %117 = load i32, i32* %i, align 4 %118 = load i32, i32* %k, align 4 %119 = add i32 %117, %118 %120 = icmp sle i32 %119, 10 %121 = icmp eq i1 %116, false %122 = select i1 %121, i1 %116, i1 %120 %123 = load i32, i32* %k, align 4 %124 = icmp sle i32 %123, 0 %125 = load i32, i32* %i, align 4 %126 = load i32, i32* %k, align 4 %127 = add i32 %125, %126 %128 = icmp sge i32 %127, 10 %129 = icmp eq i1 %124, false %130 = select i1 %129, i1 %124, i1 %128 %131 = icmp eq i1 %122, false %132 = select i1 %131, i1 %130, i1 %122 br i1 %132, label %loop.body31, label %loop.end32 loop.body31: ; preds = %loop.head30 %133 = load i32, i32* %i, align 4 %134 = load i32, i32* %k, align 4 %135 = add i32 %133, %134 store i32 %135, i32* %i, align 4 br label %goto_target goto_target: ; preds = %loop.body31 br label %loop.head30 loop.end32: ; preds = %loop.head30 call void @_lpython_free_argv() br label %return return: ; preds = %loop.end32 br label %FINALIZE_SYMTABLE_doloop_04 FINALIZE_SYMTABLE_doloop_04: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops3-1dce8fd.stdout0000664000175000017500000006654615141516316027623 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop3: (Program (SymbolTable 2 { a: (Variable 2 a [j] Local (Cast (ArrayConstructor [(ImpliedDoLoop [(IntegerBinOp (Var 2 j) Mul (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3, 6, 9] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3, 6, 9] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [3.00000000e+00, 6.00000000e+00, 9.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 12 [3.00000000e+00, 6.00000000e+00, 9.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [j] Local (Cast (ArrayConstructor [(ImpliedDoLoop [(IntegerBinOp (Var 2 j) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 4, 6] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 4, 6] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2.00000000e+00, 4.00000000e+00, 6.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 12 [2.00000000e+00, 4.00000000e+00, 6.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) implied_do_loop3 [] [(Print (StringConstant "Loop 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(ImpliedDoLoop [(RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Real 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop 3" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(ImpliedDoLoop [(RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Real 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop4" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) (ImpliedDoLoop [(IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () )] (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Loop5" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) (ImpliedDoLoop [(IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () )] (Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine4-63e648f.json0000664000175000017500000000072615141516316025706 0ustar alastairalastair{ "basename": "ast-subroutine4-63e648f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine4-63e648f.stdout", "stdout_hash": "4a6262a6903ff0921272bbf98080c74b0039eed748f7eaacc59655c6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr2-74c7f32.json0000664000175000017500000000070415141516316024447 0ustar alastairalastair{ "basename": "asr-expr2-74c7f32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "asr-expr2-74c7f32.stdout", "stdout_hash": "779df0dc56c4f27596ee9aa22ba65b5c6579804be8c7d869981fe28d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-loop_test4-17c3803.stdout0000664000175000017500000001524115141516316025771 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [] [(DoLoop 0 () 240 k (- (+ 1 (/ 1 2)) (** 3 4)) mp () [(Assignment 0 (FuncCallOrArray con [] [(() k () 0)] [] [] [] ) (u- (FuncCallOrArray datmat [] [(() k () 0) (() np () 0)] [] [] [] )) () ) (DoLoop 0 () 220 j (/ (FuncCallOrArray f [] [] [] [] [] ) 2) n () [(Assignment 220 (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray datmat [] [(() k () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray con [] [(() k () 0)] [] [] [] )) () )] () () ) (DoLoop 0 () 240 i (/ (FuncCallOrArray f [] [(() 2 () 0) (() 3 () 0)] [(x 5) (z (String "o\"k'(" ()))] [] [] ) 2) n () [(Assignment 0 temp (Real "0.0d0") () ) (DoLoop 0 () 230 j (+ (+ (+ 1 2) (/ (+ 1 3) 4)) (FuncCallOrArray f [] [(() (+ 3 2) () 0)] [(k (+ 4 (FuncCallOrArray sum [] [(() (FuncCallOrArray a [] [(() () 1 0) (() () 1 0) (() () 1 0) (() 4 () 0)] [] [] [] ) () 0)] [] [] [] )))] [] [] )) n () [(Assignment 230 temp (+ temp (* (FuncCallOrArray w [] [(() j () 0)] [] [] [] ) (FuncCallOrArray simi [] [(() j () 0) (() i () 0)] [] [] [] ))) () )] () () ) (If 0 () (== k mp) [(Assignment 0 temp (u- temp) () )] [] () () () ) (Assignment 240 (FuncCallOrArray a [] [(() i () 0) (() k () 0)] [] [] [] ) temp () )] () () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-expr_06-2de4136.json0000664000175000017500000000073715141516316024671 0ustar alastairalastair{ "basename": "asr-expr_06-2de4136", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_06.f90", "infile_hash": "86c5ce938c64e34b4a0d0c0005ed174ab091a74089c4e28d87f55945", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_06-2de4136.stdout", "stdout_hash": "de2d293c25673589066c95a3a4f9caac82a3dddc6d56fe60f549a2c6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit6-061f8e3.stderr0000664000175000017500000000025615141516316025640 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit6.f90:3:17 | 3 | IMPLICIT COMPLEX*16 (C,Z) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr-block2-b06d9e1.json0000664000175000017500000000070715141516316024641 0ustar alastairalastair{ "basename": "asr-block2-b06d9e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/block2.f90", "infile_hash": "f226e55b99771ba4b72596b4730aff7cc4a90424918f2b71111d33f1", "outfile": null, "outfile_hash": null, "stdout": "asr-block2-b06d9e1.stdout", "stdout_hash": "ff85ce04b131f9844b0e57c2695dd9562ec69d0bc56806031821febe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-implied_do_loop2-a8638e0.json0000664000175000017500000000071515141516316026647 0ustar alastairalastair{ "basename": "run-implied_do_loop2-a8638e0", "cmd": "lfortran --no-color {infile}", "infile": "tests/implied_do_loop2.f90", "infile_hash": "9f1322fbfc43cf221a57e13012a98248cd6c507ae07b15388d5958d1", "outfile": null, "outfile_hash": null, "stdout": "run-implied_do_loop2-a8638e0.stdout", "stdout_hash": "56f680f2dc3802df62021dbd4fc18a2470cd6737c1f726578670814c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_assgn_test-2643606.stderr0000664000175000017500000000073315141516316026601 0ustar alastairalastairwarning: Dimensions are specified twice --> tests/warnings/dim_assgn_test.f90:2:19 | 2 | integer, private, dimension(2,2) :: a(2,2) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other warning: Dimensions are specified twice --> tests/warnings/dim_assgn_test.f90:3:19 | 3 | integer, private, dimension(2,2) :: b(2,3) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other lfortran-lfortran-2f73434/tests/reference/pass_array_op-modules_43-6930881.json0000664000175000017500000000101415141516316027300 0ustar alastairalastair{ "basename": "pass_array_op-modules_43-6930881", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_43.f90", "infile_hash": "ee51c0425b99849f984c011dfe475584384af4099c822103232f5b9f", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-modules_43-6930881.stdout", "stdout_hash": "5409788fab5988407b1fa2e569270aeeb029d05b53d37e2be1c97ccd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-types_05-aa71aa9.stdout0000664000175000017500000000212315141516316025737 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %r, align 4 store float 2.000000e+00, float* %r, align 4 store float 8.000000e+00, float* %r, align 4 store float 4.000000e+00, float* %r, align 4 store float 0.000000e+00, float* %r, align 4 store float 5.000000e-01, float* %r, align 4 store float 5.000000e-01, float* %r, align 4 store i32 2, i32* %i, align 4 store i32 2, i32* %i, align 4 store i32 8, i32* %i, align 4 store i32 4, i32* %i, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %i, align 4 store i32 0, i32* %i, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_05 FINALIZE_SYMTABLE_types_05: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-complex1-0e93fa9.json0000664000175000017500000000072015141516316025403 0ustar alastairalastair{ "basename": "llvm-complex1-0e93fa9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/complex1.f90", "infile_hash": "3243c29c947c9700891971aae8780afac25cd01387e0307063f3928a", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex1-0e93fa9.stdout", "stdout_hash": "547790e390958162ffabdde646d876992ca4a0c6d032b8fa61e80250", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_02-f576514.stdout0000664000175000017500000001531315141516316027055 0ustar alastairalastair(TranslationUnit [(Module derived_types_02_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(r8 [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType B [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType C [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [(AttrExtends B ) (SimpleAttribute AttrPublic )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [] [(r1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeType [] () C None ) [(SimpleAttribute AttrPointer )] [(cc [] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [(SimpleAttribute AttrPointer )] [(r2 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ()) (r3 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () )] [(DerivedTypeProc () [(SimpleAttribute AttrPrivate )] [(UseSymbol p1 () )] () ) (DerivedTypeProc () [] [(UseSymbol p2 () )] () )] )] [] [(Subroutine p1 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent Out )] [(this [] [] () () None ())] () )] [] [] [] ) (Subroutine p2 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () )] [] [] [] )] ) (Program derived_types_02 () [(Use [] derived_types_02_m [(UseSymbol X () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-cond_02-373a22a.json0000664000175000017500000000073715141516316024624 0ustar alastairalastair{ "basename": "asr-cond_02-373a22a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cond_02.f90", "infile_hash": "fc70f7e7943dfe505736cca5b8ff39a034a4a1a7f441d9bdf0a82662", "outfile": null, "outfile_hash": null, "stdout": "asr-cond_02-373a22a.stdout", "stdout_hash": "0867f432d959ea3682053ee483026c5652da43999b7e96cc98203ac2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_type_without_start_program-089810e.json0000664000175000017500000000104215141516316032536 0ustar alastairalastair{ "basename": "ast-derived_type_without_start_program-089810e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/derived_type_without_start_program.f90", "infile_hash": "868e3167deeaa36d65490e0f0763100113cd37df9967c7a3773a3f1c", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_type_without_start_program-089810e.stdout", "stdout_hash": "ba7b92d9ec5ddefee702708a00141c93e300cd5d0049cc1e64f61967", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program3-e2fc2d1.json0000664000175000017500000000071515141516316025274 0ustar alastairalastair{ "basename": "ast-program3-e2fc2d1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "ast-program3-e2fc2d1.stdout", "stdout_hash": "28e8f482d908b247c131cf7853fbb910625fa811fcaa5eb77dc81652", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_04-a817e0c.json0000664000175000017500000000076415141516316026353 0ustar alastairalastair{ "basename": "asr-subroutines_04-a817e0c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_04-a817e0c.stdout", "stdout_hash": "bee9f0ec16cdf3336d5229585fd142151aede93f46f4c840abfa5248", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_04-951e966.json0000664000175000017500000000100015141516316027015 0ustar alastairalastair{ "basename": "asr-template_simple_04-951e966", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_04.f90", "infile_hash": "9135d05a49e578d5ff97175ca90b5e578583d4b5c319d5997b257f85", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_04-951e966.stdout", "stdout_hash": "3dbb6175c133dd6064c9227d5b83f35cd7192fe45a908f4e945fb64c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-expr1-03e6c2a.json0000664000175000017500000000070715141516316024702 0ustar alastairalastair{ "basename": "llvm-expr1-03e6c2a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr1-03e6c2a.stdout", "stdout_hash": "1c723a8b541540fcb76e5dfd99229a857c29389615bf8381e01bf82b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor15-4cf95f9.stdout0000664000175000017500000000670615141516316031223 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor15: (Program (SymbolTable 2 { }) preprocessor15 [] [(Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 4" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 2" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-goto_01-f5b96fb.json0000664000175000017500000000073015141516316025341 0ustar alastairalastair{ "basename": "julia-goto_01-f5b96fb", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/goto_01.f90", "infile_hash": "a5108e90af7ae9a352b6ef368d3ccf4f3af85127a5ea50c9a937fe49", "outfile": null, "outfile_hash": null, "stdout": "julia-goto_01-f5b96fb.stdout", "stdout_hash": "3e679354658381502dd866afecd80e6005d5626b3ceb27253364e7b4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_type_03-a9e3c15.stderr0000664000175000017500000000037415141516316027004 0ustar alastairalastairsemantic error: Passed object dummy argument does not match function argument --> tests/errors/derived_type_03.f90:7:9 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-modules_13-6b5ac80.stdout0000664000175000017500000000606215141516316026174 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_module_13_f1() { .entry: %f1 = alloca i32, align 4 %0 = call i32 @__module_module_13_f2() store i32 %0, i32* %f1, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f1 FINALIZE_SYMTABLE_f1: ; preds = %return %1 = load i32, i32* %f1, align 4 ret i32 %1 } define i32 @__module_module_13_f2() { .entry: %f2 = alloca i32, align 4 store i32 5, i32* %f2, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f2 FINALIZE_SYMTABLE_f2: ; preds = %return %0 = load i32, i32* %f2, align 4 ret i32 %0 } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i32, align 4 %2 = call i32 @__module_module_13_f1() store i32 %2, i32* %f, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32* %f) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-nested_namelist_01-7fc4952.stdout0000664000175000017500000002170515141516316027446 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_namelist_01: (Program (SymbolTable 5 { outer: (ExternalSymbol 5 outer 2 outer nested_namelist_01_mod [] outer Public ) }) nested_namelist_01 [nested_namelist_01_mod] [(SubroutineCall 5 outer () [] () .false. )] ), nested_namelist_01_mod: (Module (SymbolTable 2 { outer: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), inner: (Function (SymbolTable 4 { }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(FileWrite 0 () () () () [] () () () .false. 3 nml () )] () Public .false. .false. () ), nml: (Namelist 3 nml [3 i 3 x] ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 x) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 3 inner () [] () .false. )] () Public .false. .false. () ) }) nested_namelist_01_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-use_02-fe85e54.json0000664000175000017500000000073415141516316024575 0ustar alastairalastair{ "basename": "asr-use_02-fe85e54", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/use_02.f90", "infile_hash": "2465d081695b10647ab035f666d8e103185c17953126f0aacfcc3ce3", "outfile": null, "outfile_hash": null, "stdout": "asr-use_02-fe85e54.stdout", "stdout_hash": "0ae1baaddf8f33a5557379432e64c9b3114bf3aa72121aed4d813369", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-array2-9a93c4d.stdout0000664000175000017500000000642115141516316025240 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_5_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_5_1(Kokkos::View* data_): data{data_} {}; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; f32_2_3_2(Kokkos::View* data_): data{data_} {}; }; struct i32_3_4_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; i32_3_4_2(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_4_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; f32_2_3_4_3(Kokkos::View* data_): data{data_} {}; }; struct i32_3_4_3_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; i32_3_4_3_3(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 5); f32_5_1 a_value(&a_data); f32_5_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 5; Kokkos::View b_data("b_data", 5); f32_5_1 b_value(&b_data); f32_5_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 5; Kokkos::View c_data("c_data", 3); i32_3_1 c_value(&c_data); i32_3_1* c = &c_value; c->dims[0].lower_bound = 1; c->dims[0].length = 3; Kokkos::View& d; Kokkos::View e_data("e_data", 6); f32_2_3_2 e_value(&e_data); f32_2_3_2* e = &e_value; e->dims[0].lower_bound = 1; e->dims[0].length = 2; e->dims[1].lower_bound = 1; e->dims[1].length = 3; Kokkos::View f_data("f_data", 12); i32_3_4_2 f_value(&f_data); i32_3_4_2* f = &f_value; f->dims[0].lower_bound = 1; f->dims[0].length = 3; f->dims[1].lower_bound = 1; f->dims[1].length = 4; Kokkos::View& g; Kokkos::View h_data("h_data", 24); f32_2_3_4_3 h_value(&h_data); f32_2_3_4_3* h = &h_value; h->dims[0].lower_bound = 1; h->dims[0].length = 2; h->dims[1].lower_bound = 1; h->dims[1].length = 3; h->dims[2].lower_bound = 1; h->dims[2].length = 4; Kokkos::View i_data("i_data", 36); i32_3_4_3_3 i_value(&i_data); i32_3_4_3_3* i = &i_value; i->dims[0].lower_bound = 1; i->dims[0].length = 3; i->dims[1].lower_bound = 1; i->dims[1].length = 4; i->dims[2].lower_bound = 1; i->dims[2].length = 3; Kokkos::View& j; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/ast_f90-case_04-42ea8ac.json0000664000175000017500000000075215141516316025440 0ustar alastairalastair{ "basename": "ast_f90-case_04-42ea8ac", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_04.f90", "infile_hash": "55392e5b3b536591894e60672e49e61f8c579e20edb5d007f1f1afae", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_04-42ea8ac.stdout", "stdout_hash": "fe42f48018828361259c0869c5760e8b8e41559b2015ca9ed6c10efa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-char1-046b501.stdout0000664000175000017500000000014615141516316025546 0ustar alastairalastairprogram char1 implicit none character(len=1, kind=1), parameter :: c_null_char = "" end program char1 lfortran-lfortran-2f73434/tests/reference/asr-intent_01-c1f267a.stdout0000664000175000017500000003727515141516316025650 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dflt_intent: (Module (SymbolTable 2 { foo: (Function (SymbolTable 3 { c: (Variable 3 c [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 3 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [(Assignment (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (Var 4 x) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 4 f)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 4 f) Public .false. .false. () ), g: (Variable 3 g [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) foo (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c) (Var 3 d)] [(Assignment (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4) () () ) () .false. .false. )] () Public .false. .false. () ) }) dflt_intent () [dflt_intent] .false. .false. .false. ), main: (Program (SymbolTable 5 { foo: (ExternalSymbol 5 foo 2 foo dflt_intent [] foo Public ) }) main [dflt_intent] [(SubroutineCall 5 foo () [((RealConstant 0.000000 (Real 4) )) ((RealConstant 2.000000 (Real 4) ))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format8-4e5a9c0.stdout0000664000175000017500000000020215141516316025423 0ustar alastairalastair 0.10000000000000000E-09 0.10000000000000000E-99 0.10000000000000000E+01 0.10000000000000000E+11 0.10000000000000000+101 lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_interface-a8dfdb0.stdout0000664000175000017500000002257115141516316030343 0ustar alastairalastair(TranslationUnit [(Program fixed_form_interface () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (arr [(1 5 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(output_unit [] [] () () None ())] () ) (DerivedType element [] () [] [(Declaration (AttrType TypeCharacter [(len 2 Value)] () () None ) [] [(symbol [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(atomic_number [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(atomic_mass [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(quantity [] [] () () None ())] () )] [] ) (DerivedType chemical_compound [] () [] [(Declaration (AttrType TypeCharacter [(len 30 Value)] () () None ) [] [(name [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len 10 Value)] () () None ) [] [(formula [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(molecular_weight [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () element None ) [(SimpleAttribute AttrAllocatable ) (AttrDimension [(() () DimensionExpr)] )] [(elements [] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine my_subroutine [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Function my_function [(b)] [] res () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(res [] [] () () None ())] () )] [] [] [] ) )] ) (Declaration (AttrType TypeInteger [] () () None ) [] [(num [] [] () 2 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(() () DimensionExpr)] ) (SimpleAttribute AttrAllocatable )] [(factors [] [] () () None ())] () )] [(Allocate 0 [(() (FuncCallOrArray factors [] [(() num () 0)] [] [] [] ) () 0)] [] () ) (Assignment 0 factors (ArrayInitializer () () [3 4] ) () ) (Deallocate 0 [(() factors () 0)] [] () ) (Format 1 "tr1,a" () ) (Print 0 1 [factors] () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 2 )] () [] [(Assignment 0 (FuncCallOrArray arr [] [(() i () 0)] [] [] [] ) i () )] () () ) (Flush 0 [output_unit] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing2-d87e21a.json0000664000175000017500000000076715141516316026762 0ustar alastairalastair{ "basename": "asr-implicit_typing2-d87e21a", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing2.f90", "infile_hash": "9bb19041ce5948de790924b6961da8d628b025835f6e14ff43c577c8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing2-d87e21a.stdout", "stdout_hash": "0fdf2b0b9f97ec205221fa42ca1c43e34e2eb49d4082f71ac7f6f9f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit4-704272e.json0000664000175000017500000000106215141516316025216 0ustar alastairalastair{ "basename": "asr-implicit4-704272e", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit4.f90", "infile_hash": "e6c1d3c3a3a1035d1b04865b063a479380fdb2a911cb4e4c19c67ff8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit4-704272e.stdout", "stdout_hash": "85ab2d869d37fc7af082bb76e5f710e043a548c7a2f7248f99a51e48", "stderr": "asr-implicit4-704272e.stderr", "stderr_hash": "60e6b5b71dd6e647e2f6504b3951ff2c5958e4517113087b2a3a448e", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor21-aded728.json0000664000175000017500000000077315141516316030712 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor21-aded728", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor21.f90", "infile_hash": "c56b907f2bb83ae0b8a1d585925a2f710a26f6252ca5e6a21bce4e16", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor21-aded728.stdout", "stdout_hash": "af102ef1d62b93c93996abd59428860a56209cb00364d6833cf92f84", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do4-f8e2956.stdout0000664000175000017500000000525315141516316024465 0ustar alastairalastair(TranslationUnit [(Program do4 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 0 j (+ j i) () ) (Continue 15 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 0 j (+ j i) () ) (Continue 20 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Assignment 0 k (+ k 1) () ) (Continue 31 () ) (Continue 35 () )] () () ) (Continue 33 () ) (Continue 30 () )] () () ) (Continue 40 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_19-26385d4.json0000664000175000017500000000077215141516316026513 0ustar alastairalastair{ "basename": "asr-derived_types_19-26385d4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_19.f90", "infile_hash": "a9da1104d322f3007a699fff0010dc79e402c02cb90ff428eee37db1", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_19-26385d4.stdout", "stdout_hash": "68bce5f0ae51a2b42182fc0d6afa2cd716acb34b830a0a82e62b4a7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-data_12-3198178.stdout0000664000175000017500000002321615141516316025045 0ustar alastairalastair(TranslationUnit [(Module data_12_module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (td [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ()) (z [] [] () () None ()) (c1 [(1 4 DimensionExpr)] [] () () None ()) (bf1 [] [] () () None ()) (xx90 [] [] () () None ()) (xx95 [] [] () () None ()) (b [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x td b] [1 4 3] )] () ) (DataStmt 0 [(DataStmtSet [y z] [(Real "2.0") (Real "3.0")] )] () ) (DataStmt 0 [(DataStmtSet [c1] [(Real "0.0") (Real "0.22") (u- (Real "0.14")) (u- (Real "0.21"))] )] () ) (DataStmt 0 [(DataStmtSet [bf1] [(Real "0.8")] ) (DataStmtSet [xx90 xx95] [(Real "0.55") (Real "0.62")] )] () )] [] ) (Program data_12_program () [(Use [] data_12_module [] .false. () )] [(ImplicitNone [] () )] [] [(Print 0 () [x] () ) (If 0 () (/= x 1) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [y] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- y (Real "2.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [z] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- z (Real "3.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] ) (Real "0.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] ) (Real "0.22")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (+ (FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] ) (Real "0.21")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [bf1] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- bf1 (Real "0.8")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [xx90] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx90 (Real "0.55")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [xx95] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx95 (Real "0.62")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-nullify_04-a75db8a.stdout0000664000175000017500000002133415141516316026103 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_nullify_04: (Module (SymbolTable 2 { scaled_data_structure: (Struct (SymbolTable 3 { one_d_real_pointer: (Variable 3 one_d_real_pointer [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) scaled_data_structure (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [one_d_real_pointer] [] Source Public .false. .false. [] () () ) }) module_nullify_04 () [] .false. .false. .false. ), nullify_04: (Program (SymbolTable 4 { 1_scaled_data_structure_one_d_real_pointer: (ExternalSymbol 4 1_scaled_data_structure_one_d_real_pointer 3 one_d_real_pointer scaled_data_structure [] one_d_real_pointer Public ), s: (Variable 4 s [] Local () () Default (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 scaled_data_structure Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 4 s2 [] Local () () Default (StructType [(Pointer (Array (Real 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 scaled_data_structure Source Public Required .false. .false. .false. () .false. .false. ), scaled_data_structure: (ExternalSymbol 4 scaled_data_structure 2 scaled_data_structure module_nullify_04 [] scaled_data_structure Public ) }) nullify_04 [module_nullify_04] [(Nullify [(StructInstanceMember (Var 4 s) 4 1_scaled_data_structure_one_d_real_pointer (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () )] ) (Nullify [(StructInstanceMember (Var 4 s2) 4 1_scaled_data_structure_one_d_real_pointer (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_12-b71f657.stdout0000664000175000017500000003041315141516316030510 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_operator_overloading_12: (Module (SymbolTable 2 { and: (Function (SymbolTable 4 { diagnosis: (Variable 4 diagnosis [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), lhs: (Variable 4 lhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) and (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (Var 4 diagnosis) (IntegerBinOp (Var 4 lhs) Add (Var 4 rhs) (Integer 4) () ) () .false. .false. )] (Var 4 diagnosis) Public .false. .false. () ), ~and: (CustomOperator 2 ~and [2 and] Public ) }) module_operator_overloading_12 () [] .false. .false. .true. ), operator_overloading_12: (Program (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), and@~and: (ExternalSymbol 5 and@~and 2 and module_operator_overloading_12 [] and Public ), b: (Variable 5 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 5 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~and: (ExternalSymbol 5 ~and 2 ~and module_operator_overloading_12 [] ~and Public ) }) operator_overloading_12 [module_operator_overloading_12] [(Assignment (Var 5 a) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 b) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 c) (OverloadedBoolOp (Var 5 a) And (Var 5 b) (Integer 4) () (FunctionCall 5 and@~and 5 ~and [((Var 5 a)) ((Var 5 b))] (Integer 4) () () ) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result of a .and. b is:" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 5 c) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-write_02-795afbb.stderr0000664000175000017500000000012515141516316025550 0ustar alastairalastairRuntime Error: Format mismatch between OPEN statement and WRITE statement on unit 1. lfortran-lfortran-2f73434/tests/reference/asr-kind2-191347a.json0000664000175000017500000000071315141516316024330 0ustar alastairalastair{ "basename": "asr-kind2-191347a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind2.f90", "infile_hash": "fe00584d15da135638cfe95fce629f431f82a273029cfb742ef534f3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind2-191347a.stderr", "stderr_hash": "eaa6cf89bba5d3dfb23b915a22737aa52e0c11aa01eae1a4e3e3e2e0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_11-c169ea7.json0000664000175000017500000000077215141516316026643 0ustar alastairalastair{ "basename": "asr-derived_types_11-c169ea7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_11.f90", "infile_hash": "6c5517cdf157d0235d0883eb1261c38a9a4b1d783a4c550e52f6c553", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_11-c169ea7.stdout", "stdout_hash": "e673b5e3f59c25929ea61962e930f5ab76c1f4d3324e1ec9f8efc0bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit8-5e681cf.stdout0000664000175000017500000001552715141516316025755 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [m] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m)] [(Assignment (Var 2 n) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 m) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dlgama_arg-bfbc025.json0000664000175000017500000000073215141516316025612 0ustar alastairalastair{ "basename": "asr-dlgama_arg-bfbc025", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dlgama_arg.f90", "infile_hash": "cca18dc8b2576ee299d7a12cc26cbd82f78f8a23463402f5a12df3f9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dlgama_arg-bfbc025.stderr", "stderr_hash": "f3a481568df855e9e746a861cc31c7673d66397eeb35bb0cba2ebec0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-forall1-88e2780.stdout0000664000175000017500000000210515141516316025723 0ustar alastairalastairprogram forall1 implicit none ! Only for Syntax check !>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<< forall (i = 1:n) A(i, i) = B(i) end forall forall (i = 1:n:3, j = 1:n:5) A(i, j) = SIN(A(j, i)) end forall forall (i = 1:n, j = 1:n, i /= j) A(i, j) = REAL(i + j) end forall forall (i = 1:n, j = 1:m, A(i, j) /= 0) A(i, j) = 1/A(i, j) end forall forall (i = 1:1000, j = 1:1000, i /= j) A(i, j) = A(j, i) end forall !>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<< forall (j = 1:n) shared(i) local(x) default(none) forall (i = 1:j) A(i, j) = B(i) end forall end forall forall (i = 1:N) reduce(*: s) s = s + a(i) end forall forall (i = 3:N + 1, j = 3:N + 1) C(i, j) = C(i, j + 2) + C(i, j - 2) D(i, j) = C(i, j) + C(i + 2, j) + C(i - 2, j) end forall forall (x = 1:100, J(x) > 0) where (I(x, :) < 0) I(x, :) = 0 elsewhere I(x, :) = 1 end where end forall outer: forall (i = 1:100) inner: forall (j = 1:100, i /= j) A(i, j) = A(j, i) end forall inner end forall outer end program forall1 lfortran-lfortran-2f73434/tests/reference/ast-loop_test1-7800c18.stdout0000664000175000017500000000425315141516316025771 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(kp [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (do330i [] [] () () None ())] () )] [(Assignment 0 kp 10 () ) (DoLoop 0 () 330 i 1 kp () [(DoLoop 0 () 320 j (+ i 1) kp () [(If 0 () (> 0 1) [(Print 0 () [i j] () )] [(Print 0 () [j i] () )] () () () ) (Continue 320 () )] () () ) (Continue 330 () )] () () ) (Assignment 0 do330i 15 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_30-3cec484.json0000664000175000017500000000071515141516316025300 0ustar alastairalastair{ "basename": "run-format_30-3cec484", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_30.f90", "infile_hash": "da7f05c58b0298c33f23e4d533088a0c03d4c7d6228754b678078450", "outfile": null, "outfile_hash": null, "stdout": "run-format_30-3cec484.stdout", "stdout_hash": "dede96036b887b05fd811783b62ff73cc065629594c23a049fab3dd3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-binop_03-d0adef1.json0000664000175000017500000000074515141516316025417 0ustar alastairalastair{ "basename": "llvm-binop_03-d0adef1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/binop_03.f90", "infile_hash": "40773874fce64382337a961de0452b96aa45b51534cabb1e1f791341", "outfile": null, "outfile_hash": null, "stdout": "llvm-binop_03-d0adef1.stdout", "stdout_hash": "fa00b91dde1dd3753ca446d0ba04d06ddae6b2020796161b9f9450b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-case_03-b14adab.json0000664000175000017500000000073715141516316025033 0ustar alastairalastair{ "basename": "ast-case_03-b14adab", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "ast-case_03-b14adab.stdout", "stdout_hash": "a895e1d914824f244fa736829111ef96d85f691b942756c0d4eaaf6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-types_01-dfa3d3c.json0000664000175000017500000000072515141516316025263 0ustar alastairalastair{ "basename": "cpp-types_01-dfa3d3c", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_01-dfa3d3c.stdout", "stdout_hash": "5509e317ac287508d7969e4fd85ef96cbdfb5877fc6fe71787ba05dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-expr8-613d1f3.stdout0000664000175000017500000000033515141516316025476 0ustar alastairalastairi = 123 j = 123456789824390874092509458720948720947502984752098457242092870987 k = 2*18446744073709551616 i = 123_i8 j = 123456789824390874092509458720948720947502984752098457242092870987_i8 k = 2*18446744073709551616_i8 lfortran-lfortran-2f73434/tests/reference/run-write_01-c968b4a.json0000664000175000017500000000067415141516316025147 0ustar alastairalastair{ "basename": "run-write_01-c968b4a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/write_01.f90", "infile_hash": "467bcb588e761b464036e6b211484c96b738855f975d3621d88ee707", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-write_01-c968b4a.stderr", "stderr_hash": "b65bc0d80ed3f38265702bfd48f891f579ea1c8ec54cef7c4f9f59ed", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-common_03-9052466.stdout0000664000175000017500000011407215141516316025416 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { common3: (Program (SymbolTable 5 { 1_b_e: (ExternalSymbol 5 1_b_e 7 e b [] e Public ), 1_sample_a: (ExternalSymbol 5 1_sample_a 4 a sample [] a Public ), 1_sample_b: (ExternalSymbol 5 1_sample_b 4 b sample [] b Public ), sample: (ExternalSymbol 5 sample 3 sample file_common_block_sample [] sample Public ), struct_instance_b: (ExternalSymbol 5 struct_instance_b 6 struct_instance_b file_common_block_b [] struct_instance_b Public ), struct_instance_sample: (ExternalSymbol 5 struct_instance_sample 3 struct_instance_sample file_common_block_sample [] struct_instance_sample Public ) }) common3 [] [(Assignment (StructInstanceMember (Var 5 struct_instance_sample) 5 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayConstant 8 [1.00000000e+01, 1.10000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 struct_instance_sample) 5 1_sample_b (Real 4) () ) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 struct_instance_b) 5 1_b_e (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 1 pass () [] () .false. )] ), file_common_block_b: (Module (SymbolTable 6 { b: (Struct (SymbolTable 7 { d: (Variable 7 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 7 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 7 f [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (StructType [] [] .true. .false. ) [] [d e f] [] Source Public .false. .false. [] () () ), struct_instance_b: (Variable 6 struct_instance_b [] Local () () Default (StructType [] [] .true. .false. ) 6 b Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_b () [] .false. .false. .false. ), file_common_block_blank#block: (Module (SymbolTable 8 { blank#block: (Struct (SymbolTable 9 { z1: (Variable 9 z1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z2: (Variable 9 z2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) blank#block (StructType [] [] .true. .false. ) [] [z1 z2] [] Source Public .false. .false. [] () () ), struct_instance_blank#block: (Variable 8 struct_instance_blank#block [] Local () () Default (StructType [] [] .true. .false. ) 8 blank#block Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_blank#block () [] .false. .false. .false. ), file_common_block_c: (Module (SymbolTable 10 { c: (Struct (SymbolTable 11 { c: (Variable 11 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 11 g [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 11 h [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 11 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) c (StructType [] [] .true. .false. ) [] [c g h j] [] Source Public .false. .false. [] () () ), struct_instance_c: (Variable 10 struct_instance_c [] Local () () Default (StructType [] [] .true. .false. ) 10 c Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_c () [] .false. .false. .false. ), file_common_block_sample: (Module (SymbolTable 3 { sample: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) sample (StructType [] [] .true. .false. ) [] [a b i] [] Source Public .false. .false. [] () () ), struct_instance_sample: (Variable 3 struct_instance_sample [] Local () () Default (StructType [] [] .true. .false. ) 3 sample Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_sample () [] .false. .false. .false. ), pass: (Function (SymbolTable 2 { 1_sample_a: (ExternalSymbol 2 1_sample_a 4 a sample [] a Public ), 1_sample_b: (ExternalSymbol 2 1_sample_b 4 b sample [] b Public ), e: (Variable 2 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sample: (ExternalSymbol 2 sample 3 sample file_common_block_sample [] sample Public ), struct_instance_sample: (ExternalSymbol 2 struct_instance_sample 3 struct_instance_sample file_common_block_sample [] struct_instance_sample Public ) }) pass (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_b (Real 4) () ) Sub (RealConstant 20.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_a (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (StructInstanceMember (Var 2 struct_instance_sample) 2 1_sample_b (Real 4) () ) (Var 2 e)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_05-fa1bde9.json0000664000175000017500000000074215141516316025275 0ustar alastairalastair{ "basename": "asr-types_05-fa1bde9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "asr-types_05-fa1bde9.stdout", "stdout_hash": "3041279b5c74d5a9c8e2ba5299483e98cdc018e4c1f0eedc024e5a48", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce3-fc55bd2.json0000664000175000017500000000077715141516316030512 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent_reduce3-fc55bd2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent_reduce3.f90", "infile_hash": "68244c7ec55a2abd3a98afa53cf637130918461cb0264902730a72b3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent_reduce3-fc55bd2.stdout", "stdout_hash": "ae638a94e59deec730a46c79af33d86ef2e155e208be9b1a81b43f8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-procedure_with_type-4c8ea35.stdout0000664000175000017500000001000215141516316030113 0ustar alastairalastair(TranslationUnit [(Program procedure_with_type () [] [] [(Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () doubleprecision None ) [(SimpleAttribute AttrPointer )] [(yb [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () integer None ) [(SimpleAttribute AttrPointer )] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () real None ) [(SimpleAttribute AttrPointer )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () complex None ) [(SimpleAttribute AttrPointer )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeProcedure [] () () None ) [(SimpleAttribute AttrPointer )] [(e [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-associate_03-bc2b027.json0000664000175000017500000000075615141516316025735 0ustar alastairalastair{ "basename": "asr-associate_03-bc2b027", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_03.f90", "infile_hash": "54a0fef1ee3727e70478189b60d108081d8e7760cadd89e8c99a8378", "outfile": null, "outfile_hash": null, "stdout": "asr-associate_03-bc2b027.stdout", "stdout_hash": "23cbea9e4eba25f6a4f28972f13eb6876926a4eefb0b094ebfcc3861", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_45-c69c75f.json0000664000175000017500000000075015141516316025457 0ustar alastairalastair{ "basename": "asr-modules_45-c69c75f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_45.f90", "infile_hash": "d68539c460764050c432f216e8ceed7eded8bf09258747500769b39e", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_45-c69c75f.stdout", "stdout_hash": "067b237e787befb352c1815132685358b0b37a4bad9a02f3ca5bd1dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_indent-subroutine1-41f648b.stdout0000664000175000017500000001575715141516316027616 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { g: (Function (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (IntegerBinOp (Var 2 x) Mul (Var 2 i) (Integer 4) () ) () .false. .false. )] [] )] () Public .false. .false. () ), h: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) h (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 3 x) (IntegerBinOp (Var 3 i) Mul (Var 3 x) (Integer 4) () ) () .false. .false. )] [] )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-implicit1-418fb10.stderr0000664000175000017500000000157015141516316026304 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit1.f90:13:14 | 13 | implicit real*8 (a-h,o-z) | ^ help: write this as 'real(8)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit1.f90:25:17 | 25 | implicit integer*8 (i,j-l,m,n) | ^ help: write this as 'integer(8)' style suggestion: Use integer(4) instead of integer*4 --> tests/implicit1.f90:27:17 | 27 | IMPLICIT INTEGER*4 (C, D-x) | ^ help: write this as 'integer(4)' style suggestion: Use logical(4) instead of logical*4 --> tests/implicit1.f90:32:17 | 32 | implicit logical*4 (l, u-z) | ^ help: write this as 'logical(4)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit1.f90:38:17 | 38 | implicit complex*8 (z) | ^ help: write this as 'complex(4)' lfortran-lfortran-2f73434/tests/reference/asr-array_size_05-bc7d72f.stderr0000664000175000017500000000037115141516316026554 0ustar alastairalastairsemantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/array_size_05.f90:6:27 | 6 | size_a = size(a, kind=kindvar, dim=1) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_34-c5cfc20.json0000664000175000017500000000076115141516316026233 0ustar alastairalastair{ "basename": "asr-intrinsics_34-c5cfc20", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_34.f90", "infile_hash": "b5ac9ea3ec2758f2b774401a5e70d007023974e74b9903bfb4bcb384", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_34-c5cfc20.stdout", "stdout_hash": "3a1796c7002cd27d654f77d1f74ab4a13282acbeda4a9fa5ccc2f425", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_37-20d0238.stdout0000664000175000017500000000022515141516316025501 0ustar alastairalastairThe answer is 42 Test 1: The answer is 42 43 44 45 Test 2: 43 44 45 A B 10 20 C D 30 40 Test 3: A B 10 20 C D 30 40 All tests passed! lfortran-lfortran-2f73434/tests/reference/ast-types_11-696c3ee.stdout0000664000175000017500000000264215141516316025517 0ustar alastairalastair(TranslationUnit [(Program types_11 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Enum [(AttrBind (Bind [c] [] ) )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Declaration () [(SimpleAttribute AttrEnumerator )] [(a [] [] () 1 Equal ())] () ) (Declaration () [(SimpleAttribute AttrEnumerator )] [(b [] [] () 2 Equal ())] () ) (Declaration () [(SimpleAttribute AttrEnumerator )] [(c [] [] () 3 Equal ())] () )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutines_10-779ade9.stdout0000664000175000017500000000073315141516316027416 0ustar alastairalastairprogram subroutines_10 implicit none real :: x call subroutines_10_sub(x, 3, *100, *200) if (x < 0 .and. x > 10) then error stop end if stop 100 print *, "Negative input value" error stop 200 print *, "Input value too large" error stop end program subroutines_10 subroutine subroutines_10_sub(x, i, *, *) real, intent(out) :: x integer, intent(in) :: i if (i < 0) then return 1 end if if (i > 10) then return 2 end if x = i end subroutine subroutines_10_sub lfortran-lfortran-2f73434/tests/reference/ast-format_02-1ba2faf.json0000664000175000017500000000074515141516316025412 0ustar alastairalastair{ "basename": "ast-format_02-1ba2faf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_02.f90", "infile_hash": "dcd9a1c68ffaff4df93d7299219c47741479f92da85570eb771f05b3", "outfile": null, "outfile_hash": null, "stdout": "ast-format_02-1ba2faf.stdout", "stdout_hash": "2eb18974f199efd31646dad32db608facf4c98ec2efe98a90ff55349", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_03-b5d4715.stderr0000664000175000017500000000041515141516316027262 0ustar alastairalastairsemantic error: The restriction argument func_arg_real should have a return value --> tests/errors/template_error_03.f90:33:33 | 33 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-protected_01-1f0c640.json0000664000175000017500000000074015141516316025664 0ustar alastairalastair{ "basename": "asr-protected_01-1f0c640", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/protected_01.f90", "infile_hash": "9926eecf56b25df5b111bb3788582f7f19d3aa5d834dade6ba8af123", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-protected_01-1f0c640.stderr", "stderr_hash": "dcbbda8d04894671e4e9444e4dde7d89c4878b38df53c130b1d0a731", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope3-a36d20b.json0000664000175000017500000000101415141516316031113 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope3-a36d20b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope3-a36d20b.stdout", "stdout_hash": "a28b0cffaa45bc603b65f8a38a389d2a460f53ca3eae8d0f07173d68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-empty-7fa10d2.json0000664000175000017500000000070415141516316024614 0ustar alastairalastair{ "basename": "ast-empty-7fa10d2", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "ast-empty-7fa10d2.stdout", "stdout_hash": "96f8556c9cb61453515e3955eedbbf2df06a14d49367a43b0ee0774e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_02-4e306e0.json0000664000175000017500000000075415141516316026567 0ustar alastairalastair{ "basename": "asr-matrix_matmul_02-4e306e0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_02.f90", "infile_hash": "79a17a2ff70856ec0617d9c468558fc401abfb6732095095410408e3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_02-4e306e0.stderr", "stderr_hash": "a3d0256f40ab6b1b00a04f00667f02e4aa265d08754118958a1d920c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_interface_01-07d787f.json0000664000175000017500000000101115141516316027541 0ustar alastairalastair{ "basename": "asr-template_interface_01-07d787f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_interface_01.f90", "infile_hash": "22d5402109d63586d3e6f850a5c5fb6cfb5bd8ecfde6fc55ddbd335e", "outfile": null, "outfile_hash": null, "stdout": "asr-template_interface_01-07d787f.stdout", "stdout_hash": "0f444033ebbe20c4a2c2c799172a4154a561fd5e67a82dfabe2927ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-save1-7ce7ccf.json0000664000175000017500000000102015141516316024640 0ustar alastairalastair{ "basename": "asr-save1-7ce7ccf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/save1.f90", "infile_hash": "31ce4257e5331284b595e9e0bc0e4ca574c7f6eeb09da89352d2040d", "outfile": null, "outfile_hash": null, "stdout": "asr-save1-7ce7ccf.stdout", "stdout_hash": "dfddab9680a23ef02767b2152f51789e6acacd94122b46578c35770f", "stderr": "asr-save1-7ce7ccf.stderr", "stderr_hash": "362961a1a43d595645ffcc7a74f7579aed4236b8f203d83f96be1b1b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_46-1b93fa8.json0000664000175000017500000000077415141516316026661 0ustar alastairalastair{ "basename": "asr_openmp-openmp_46-1b93fa8", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_46.f90", "infile_hash": "069734ce0ac51967b68f899b74ea0cf445af3d9647b786ac0d4af80b", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_46-1b93fa8.stdout", "stdout_hash": "63ba53a2004e6989a747bfff755aa5a96ad8bb967d3e4a264fdd4411", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_05-c35e0ac.stdout0000664000175000017500000000436715141516316026073 0ustar alastairalastair(TranslationUnit [(Module modules_05_mod (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter ) (SimpleAttribute AttrPublic )] [(a [] [] () 5 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(b [] [] () 6 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(c [] [] () 7 Equal ())] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(c [] [] () () None ())] () )] [] [] ) (Program modules_05 () [(Use [] modules_05_mod [(UseSymbol a () ) (UseSymbol c () )] .true. () )] [] [] [(Print 0 () [a c] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/pass_flip_sign-expr_13-e24d940.stdout0000664000175000017500000005747015141516316027464 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign_dead_code: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign_dead_code [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-floor_01-9103fc5.stdout0000664000175000017500000004361715141516316025406 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { floor_01: (Program (SymbolTable 2 { x1: (Variable 2 x1 [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x2: (Variable 2 x2 [] Local (RealConstant 3.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x3: (Variable 2 x3 [] Local (RealConstant 3.700000 (Real 4) ) (RealConstant 3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y1: (Variable 2 y1 [] Local (RealUnaryMinus (RealConstant 3.300000 (Real 4) ) (Real 4) (RealConstant -3.300000 (Real 4) ) ) (RealConstant -3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y2: (Variable 2 y2 [] Local (RealUnaryMinus (RealConstant 3.500000 (Real 4) ) (Real 4) (RealConstant -3.500000 (Real 4) ) ) (RealConstant -3.500000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y3: (Variable 2 y3 [] Local (RealUnaryMinus (RealConstant 3.700000 (Real 4) ) (Real 4) (RealConstant -3.700000 (Real 4) ) ) (RealConstant -3.700000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) floor_01 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x1)] 0 (Integer 8) (IntegerConstant 3 (Integer 8) Decimal) ) NotEq (IntegerConstant 3 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 x3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) Or (IntegerCompare (IntrinsicElementalFunction Floor [(Var 2 y3)] 0 (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) ) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -4 (Integer 8) Decimal) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Floor [(Var 2 x1)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 x2)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 x3)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction Floor [(Var 2 y1)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 y2)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) ) (IntrinsicElementalFunction Floor [(Var 2 y3)] 0 (Integer 4) (IntegerConstant -4 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-types_04-054550e.stdout0000664000175000017500000001020515141516316025342 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32 f32) f32.const 1.500000 local.set 1 i32.const 2 local.set 0 local.get 0 local.get 0 i32.mul f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.mul local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.mul local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.mul local.set 2 local.get 0 local.get 0 i32.add f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.add local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.add local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.add local.set 2 local.get 0 local.get 0 i32.sub f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.sub local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.sub local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.sub local.set 2 local.get 0 local.get 0 i32.div_s f32.convert_i32_s local.set 2 local.get 1 local.get 1 f32.div local.set 2 local.get 0 f32.convert_i32_s local.get 1 f32.div local.set 2 local.get 1 local.get 0 f32.convert_i32_s f32.div local.set 2 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_27-11ba39d.stdout0000664000175000017500000001500615141516316026523 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_27: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_27 [] [(Print (StringFormat () [(IntrinsicArrayFunction Shape [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(ArraySize (IntrinsicArrayFunction Shape [(IntegerConstant 42 (Integer 4) Decimal)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstructor [] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) ) () (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_arguments_02-bb6f3e2.json0000664000175000017500000000102215141516316030466 0ustar alastairalastair{ "basename": "asr-polymorphic_arguments_02-bb6f3e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/polymorphic_arguments_02.f90", "infile_hash": "56e8d7a53ae767686c5bb655fe9c19c37e8cf8112500fed026cd8dc1", "outfile": null, "outfile_hash": null, "stdout": "asr-polymorphic_arguments_02-bb6f3e2.stdout", "stdout_hash": "e03afb4feea524ffc421048ed45ae3a92c3839b9d2553230bf74d0cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing4-c338b90.stderr0000664000175000017500000000027515141516316027230 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit_typing4.f90:7:21 | 7 | IMPLICIT COMPLEX*16 (C,Z) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/julia-doloop_01-d646475.json0000664000175000017500000000073615141516316025453 0ustar alastairalastair{ "basename": "julia-doloop_01-d646475", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_01-d646475.stdout", "stdout_hash": "4463f4b217ca66cb02b92e602bbc6c93123245c65bf6f976c0fdc52f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-associate1-2443d15.stdout0000664000175000017500000000241715141516316025730 0ustar alastairalastair(TranslationUnit [(AssociateBlock 0 () [(x [] [] () y Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (Parenthesis y ) Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (+ y z) Arrow ())] [] () () ) (AssociateBlock 0 () [(x [] [] () (u- y) Arrow ())] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 some_subroutine [] [(() x () 0) (() (Parenthesis x ) () 0)] [] [] () ) (Assignment 0 x (FuncCallOrArray f [] [(() (Parenthesis x ) () 0)] [] [] [] ) () )] ) lfortran-lfortran-2f73434/tests/reference/run-write4-f453580.json0000664000175000017500000000065715141516316024572 0ustar alastairalastair{ "basename": "run-write4-f453580", "cmd": "lfortran --no-color {infile}", "infile": "tests/write4.f90", "infile_hash": "3ea1b036446d9c3c9948c04d5b3bba170d5163d80d23e55ae2249956", "outfile": null, "outfile_hash": null, "stdout": "run-write4-f453580.stdout", "stdout_hash": "53a3d179203f266f36431d4b08c3759a60fd29395f9c14e7097066d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-associate_03-bc2b027.stdout0000664000175000017500000001373415141516316026306 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p1: (Variable 2 p1 [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ), t2: (Variable 2 t2 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ) }) associate_03 [] [(Print (StringFormat () [(Var 2 t1) (Var 2 t2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 t1) Gt (Var 2 t2) (Logical 4) () ) [(Associate (Var 2 p1) (Var 2 t1) )] [(Associate (Var 2 p1) (Var 2 t2) )] ) (Print (StringFormat () [(Var 2 p1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (Var 2 p1) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (Var 2 t2) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-incorrect_allocate_for_array-b52ea30.json0000664000175000017500000000102015141516316031341 0ustar alastairalastair{ "basename": "asr-incorrect_allocate_for_array-b52ea30", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_allocate_for_array.f90", "infile_hash": "f60a82bb992ad3cff8f57805c5cae6793003e8814985af976f003a9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_allocate_for_array-b52ea30.stderr", "stderr_hash": "24447f7654ddd6077296652c946cb2297e5e050b1462240f1895a113", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-classes1-d55a38c.json0000664000175000017500000000072015141516316025365 0ustar alastairalastair{ "basename": "llvm-classes1-d55a38c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/classes1.f90", "infile_hash": "2854104a42f1abb2d3573afedab08ac340e19b7d5151166ce3291182", "outfile": null, "outfile_hash": null, "stdout": "llvm-classes1-d55a38c.stdout", "stdout_hash": "fece1bac846808f829dc4295801def5fd908a06d4b6a435594e1f720", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-allocate_03-495d621.stdout0000664000175000017500000030743415141516316026164 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %array = type { i32*, i32, %dimension_descriptor*, i1, i32 } %dimension_descriptor = type { i32, i32, i32 } %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @1 = private unnamed_addr constant [114 x i8] c"At 20:5 of file tests/../integration_tests/allocate_03.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @3 = private unnamed_addr constant [100 x i8] c"At 21:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @5 = private unnamed_addr constant [162 x i8] c"At 21:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @7 = private unnamed_addr constant [162 x i8] c"At 21:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @9 = private unnamed_addr constant [162 x i8] c"At 21:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @12 = private unnamed_addr constant [101 x i8] c"At 27:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @13 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @14 = private unnamed_addr constant [163 x i8] c"At 27:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @15 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @16 = private unnamed_addr constant [163 x i8] c"At 27:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @17 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @18 = private unnamed_addr constant [163 x i8] c"At 27:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @21 = private unnamed_addr constant [100 x i8] c"At 28:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @23 = private unnamed_addr constant [162 x i8] c"At 28:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @25 = private unnamed_addr constant [162 x i8] c"At 28:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @27 = private unnamed_addr constant [162 x i8] c"At 28:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @31 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @32 = private unnamed_addr constant [101 x i8] c"At 30:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @33 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @34 = private unnamed_addr constant [163 x i8] c"At 30:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @35 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @36 = private unnamed_addr constant [163 x i8] c"At 30:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @37 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @38 = private unnamed_addr constant [163 x i8] c"At 30:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @41 = private unnamed_addr constant [100 x i8] c"At 31:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @43 = private unnamed_addr constant [162 x i8] c"At 31:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @45 = private unnamed_addr constant [162 x i8] c"At 31:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @47 = private unnamed_addr constant [162 x i8] c"At 31:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @51 = private unnamed_addr constant [100 x i8] c"At 32:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @53 = private unnamed_addr constant [162 x i8] c"At 32:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @55 = private unnamed_addr constant [162 x i8] c"At 32:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"x\00", align 1 @57 = private unnamed_addr constant [162 x i8] c"At 32:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @59 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @61 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @62 = private unnamed_addr constant [101 x i8] c"At 40:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @63 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @64 = private unnamed_addr constant [163 x i8] c"At 40:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @65 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @66 = private unnamed_addr constant [163 x i8] c"At 40:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @67 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @68 = private unnamed_addr constant [163 x i8] c"At 40:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @71 = private unnamed_addr constant [100 x i8] c"At 41:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @73 = private unnamed_addr constant [162 x i8] c"At 41:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @75 = private unnamed_addr constant [162 x i8] c"At 41:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @77 = private unnamed_addr constant [162 x i8] c"At 41:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @79 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @81 = private unnamed_addr constant [100 x i8] c"At 42:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @82 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @83 = private unnamed_addr constant [162 x i8] c"At 42:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @85 = private unnamed_addr constant [162 x i8] c"At 42:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @87 = private unnamed_addr constant [162 x i8] c"At 42:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @89 = private unnamed_addr constant [113 x i8] c"At 8:5 of file tests/../integration_tests/allocate_03.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @93 = private unnamed_addr constant [100 x i8] c"At 10:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @94 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @95 = private unnamed_addr constant [162 x i8] c"At 10:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @97 = private unnamed_addr constant [162 x i8] c"At 10:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @98 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @99 = private unnamed_addr constant [162 x i8] c"At 10:5 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @100 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @101 = private unnamed_addr constant [100 x i8] c"At 13:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @102 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @103 = private unnamed_addr constant [162 x i8] c"At 13:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @104 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @105 = private unnamed_addr constant [162 x i8] c"At 13:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @106 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @107 = private unnamed_addr constant [162 x i8] c"At 13:9 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @108 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @109 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @110 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @111 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @112 = private unnamed_addr constant [101 x i8] c"At 14:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' is indexed but not allocated.\00", align 1 @113 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @114 = private unnamed_addr constant [163 x i8] c"At 14:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @115 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @116 = private unnamed_addr constant [163 x i8] c"At 14:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @117 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @118 = private unnamed_addr constant [163 x i8] c"At 14:14 of file tests/../integration_tests/allocate_03.f90\0AArray '%s' index out of bounds. Tried to access index %d of dimension %d, but valid range is %d to %d.\00", align 1 @119 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %array*, align 8 store %array* null, %array** %c, align 8 %arr_desc = alloca %array, align 8 %2 = getelementptr %array, %array* %arr_desc, i32 0, i32 2 %3 = alloca i32, align 4 store i32 3, i32* %3, align 4 %4 = load i32, i32* %3, align 4 %5 = alloca %dimension_descriptor, i32 %4, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i32 1, i32* %6, align 4 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i32 1, i32* %7, align 4 store %dimension_descriptor* %5, %dimension_descriptor** %2, align 8 %8 = getelementptr %array, %array* %arr_desc, i32 0, i32 4 store i32 3, i32* %8, align 4 %9 = getelementptr %array, %array* %arr_desc, i32 0, i32 0 store i32* null, i32** %9, align 8 store %array* %arr_desc, %array** %c, align 8 %r = alloca i32, align 4 %stat = alloca i32, align 4 store i32 1, i32* %stat, align 4 %10 = load %array*, %array** %c, align 8 %11 = ptrtoint %array* %10 to i64 %12 = icmp eq i64 %11, 0 br i1 %12, label %merge_allocated, label %check_data check_data: ; preds = %.entry %13 = getelementptr %array, %array* %10, i32 0, i32 0 %14 = load i32*, i32** %13, align 8 %15 = ptrtoint i32* %14 to i64 %16 = icmp ne i64 %15, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %16, %check_data ] br i1 %is_allocated, label %then, label %ifcont then: ; preds = %merge_allocated call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %17 = load %array*, %array** %c, align 8 %18 = getelementptr %array, %array* %17, i32 0, i32 1 store i32 0, i32* %18, align 4 %19 = getelementptr %array, %array* %17, i32 0, i32 2 %20 = load %dimension_descriptor*, %dimension_descriptor** %19, align 8 %21 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %20, i32 0 %22 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 0 %23 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 1 %24 = getelementptr %dimension_descriptor, %dimension_descriptor* %21, i32 0, i32 2 store i32 1, i32* %22, align 4 store i32 1, i32* %23, align 4 store i32 3, i32* %24, align 4 %25 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %20, i32 1 %26 = getelementptr %dimension_descriptor, %dimension_descriptor* %25, i32 0, i32 0 %27 = getelementptr %dimension_descriptor, %dimension_descriptor* %25, i32 0, i32 1 %28 = getelementptr %dimension_descriptor, %dimension_descriptor* %25, i32 0, i32 2 store i32 3, i32* %26, align 4 store i32 1, i32* %27, align 4 store i32 3, i32* %28, align 4 %29 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %20, i32 2 %30 = getelementptr %dimension_descriptor, %dimension_descriptor* %29, i32 0, i32 0 %31 = getelementptr %dimension_descriptor, %dimension_descriptor* %29, i32 0, i32 1 %32 = getelementptr %dimension_descriptor, %dimension_descriptor* %29, i32 0, i32 2 store i32 9, i32* %30, align 4 store i32 1, i32* %31, align 4 store i32 3, i32* %32, align 4 %33 = getelementptr %array, %array* %17, i32 0, i32 0 %34 = call i8* @_lfortran_malloc(i64 108) %35 = bitcast i8* %34 to i32* store i32* %35, i32** %33, align 8 store i32 0, i32* %stat, align 4 %36 = load i32, i32* %stat, align 4 %37 = icmp ne i32 %36, 0 br i1 %37, label %then1, label %else then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont2 else: ; preds = %ifcont br label %ifcont2 ifcont2: ; preds = %else, %then1 %38 = load %array*, %array** %c, align 8 %39 = ptrtoint %array* %38 to i64 %40 = icmp eq i64 %39, 0 br i1 %40, label %merge_allocated4, label %check_data3 check_data3: ; preds = %ifcont2 %41 = getelementptr %array, %array* %38, i32 0, i32 0 %42 = load i32*, i32** %41, align 8 %43 = ptrtoint i32* %42 to i64 %44 = icmp ne i64 %43, 0 br label %merge_allocated4 merge_allocated4: ; preds = %check_data3, %ifcont2 %is_allocated5 = phi i1 [ false, %ifcont2 ], [ %44, %check_data3 ] %45 = xor i1 %is_allocated5, true br i1 %45, label %then6, label %ifcont7 then6: ; preds = %merge_allocated4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @93, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont7: ; preds = %merge_allocated4 %46 = getelementptr %array, %array* %38, i32 0, i32 2 %47 = load %dimension_descriptor*, %dimension_descriptor** %46, align 8 %48 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %47, i32 0 %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %48, i32 0, i32 1 %50 = load i32, i32* %49, align 4 %51 = getelementptr %dimension_descriptor, %dimension_descriptor* %48, i32 0, i32 2 %52 = load i32, i32* %51, align 4 %53 = sub i32 1, %50 %54 = add i32 %50, %52 %55 = sub i32 %54, 1 %56 = icmp slt i32 1, %50 %57 = icmp sgt i32 1, %55 %58 = or i1 %56, %57 br i1 %58, label %then8, label %ifcont9 then8: ; preds = %ifcont7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @94, i32 0, i32 0), i32 1, i32 1, i32 %50, i32 %55) call void @exit(i32 1) unreachable ifcont9: ; preds = %ifcont7 %59 = getelementptr %dimension_descriptor, %dimension_descriptor* %48, i32 0, i32 0 %60 = load i32, i32* %59, align 4 %61 = mul i32 %60, %53 %62 = add i32 0, %61 %63 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %47, i32 1 %64 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 1 %65 = load i32, i32* %64, align 4 %66 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 2 %67 = load i32, i32* %66, align 4 %68 = sub i32 1, %65 %69 = add i32 %65, %67 %70 = sub i32 %69, 1 %71 = icmp slt i32 1, %65 %72 = icmp sgt i32 1, %70 %73 = or i1 %71, %72 br i1 %73, label %then10, label %ifcont11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @97, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0), i32 1, i32 2, i32 %65, i32 %70) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %74 = getelementptr %dimension_descriptor, %dimension_descriptor* %63, i32 0, i32 0 %75 = load i32, i32* %74, align 4 %76 = mul i32 %75, %68 %77 = add i32 %62, %76 %78 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %47, i32 2 %79 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 1 %80 = load i32, i32* %79, align 4 %81 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 2 %82 = load i32, i32* %81, align 4 %83 = sub i32 1, %80 %84 = add i32 %80, %82 %85 = sub i32 %84, 1 %86 = icmp slt i32 1, %80 %87 = icmp sgt i32 1, %85 %88 = or i1 %86, %87 br i1 %88, label %then12, label %ifcont13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @99, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @98, i32 0, i32 0), i32 1, i32 3, i32 %80, i32 %85) call void @exit(i32 1) unreachable ifcont13: ; preds = %ifcont11 %89 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 0 %90 = load i32, i32* %89, align 4 %91 = mul i32 %90, %83 %92 = add i32 %77, %91 %93 = getelementptr %array, %array* %38, i32 0, i32 1 %94 = load i32, i32* %93, align 4 %95 = add i32 %92, %94 %96 = getelementptr %array, %array* %38, i32 0, i32 0 %97 = load i32*, i32** %96, align 8 %98 = getelementptr inbounds i32, i32* %97, i32 %95 store i32 3, i32* %98, align 4 %99 = load %array*, %array** %c, align 8 %100 = ptrtoint %array* %99 to i64 %101 = icmp eq i64 %100, 0 br i1 %101, label %merge_allocated15, label %check_data14 check_data14: ; preds = %ifcont13 %102 = getelementptr %array, %array* %99, i32 0, i32 0 %103 = load i32*, i32** %102, align 8 %104 = ptrtoint i32* %103 to i64 %105 = icmp ne i64 %104, 0 br label %merge_allocated15 merge_allocated15: ; preds = %check_data14, %ifcont13 %is_allocated16 = phi i1 [ false, %ifcont13 ], [ %105, %check_data14 ] br i1 %is_allocated16, label %then17, label %else18 then17: ; preds = %merge_allocated15 %106 = getelementptr %array, %array* %99, i32 0, i32 0 %107 = load i32*, i32** %106, align 8 %108 = bitcast i32* %107 to i8* call void @_lfortran_free(i8* %108) %109 = getelementptr %array, %array* %99, i32 0, i32 0 store i32* null, i32** %109, align 8 br label %ifcont19 else18: ; preds = %merge_allocated15 br label %ifcont19 ifcont19: ; preds = %else18, %then17 call void @h(%array** %c) %110 = call i32 @g(%array** %c) store i32 %110, i32* %r, align 4 %111 = load %array*, %array** %c, align 8 %112 = ptrtoint %array* %111 to i64 %113 = icmp eq i64 %112, 0 br i1 %113, label %merge_allocated21, label %check_data20 check_data20: ; preds = %ifcont19 %114 = getelementptr %array, %array* %111, i32 0, i32 0 %115 = load i32*, i32** %114, align 8 %116 = ptrtoint i32* %115 to i64 %117 = icmp ne i64 %116, 0 br label %merge_allocated21 merge_allocated21: ; preds = %check_data20, %ifcont19 %is_allocated22 = phi i1 [ false, %ifcont19 ], [ %117, %check_data20 ] %118 = xor i1 %is_allocated22, true br i1 %118, label %then23, label %ifcont24 then23: ; preds = %merge_allocated21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @101, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @100, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont24: ; preds = %merge_allocated21 %119 = getelementptr %array, %array* %111, i32 0, i32 2 %120 = load %dimension_descriptor*, %dimension_descriptor** %119, align 8 %121 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %120, i32 0 %122 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 1 %123 = load i32, i32* %122, align 4 %124 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 2 %125 = load i32, i32* %124, align 4 %126 = sub i32 1, %123 %127 = add i32 %123, %125 %128 = sub i32 %127, 1 %129 = icmp slt i32 1, %123 %130 = icmp sgt i32 1, %128 %131 = or i1 %129, %130 br i1 %131, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @103, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @102, i32 0, i32 0), i32 1, i32 1, i32 %123, i32 %128) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %132 = getelementptr %dimension_descriptor, %dimension_descriptor* %121, i32 0, i32 0 %133 = load i32, i32* %132, align 4 %134 = mul i32 %133, %126 %135 = add i32 0, %134 %136 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %120, i32 1 %137 = getelementptr %dimension_descriptor, %dimension_descriptor* %136, i32 0, i32 1 %138 = load i32, i32* %137, align 4 %139 = getelementptr %dimension_descriptor, %dimension_descriptor* %136, i32 0, i32 2 %140 = load i32, i32* %139, align 4 %141 = sub i32 1, %138 %142 = add i32 %138, %140 %143 = sub i32 %142, 1 %144 = icmp slt i32 1, %138 %145 = icmp sgt i32 1, %143 %146 = or i1 %144, %145 br i1 %146, label %then27, label %ifcont28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @105, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @104, i32 0, i32 0), i32 1, i32 2, i32 %138, i32 %143) call void @exit(i32 1) unreachable ifcont28: ; preds = %ifcont26 %147 = getelementptr %dimension_descriptor, %dimension_descriptor* %136, i32 0, i32 0 %148 = load i32, i32* %147, align 4 %149 = mul i32 %148, %141 %150 = add i32 %135, %149 %151 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %120, i32 2 %152 = getelementptr %dimension_descriptor, %dimension_descriptor* %151, i32 0, i32 1 %153 = load i32, i32* %152, align 4 %154 = getelementptr %dimension_descriptor, %dimension_descriptor* %151, i32 0, i32 2 %155 = load i32, i32* %154, align 4 %156 = sub i32 1, %153 %157 = add i32 %153, %155 %158 = sub i32 %157, 1 %159 = icmp slt i32 1, %153 %160 = icmp sgt i32 1, %158 %161 = or i1 %159, %160 br i1 %161, label %then29, label %ifcont30 then29: ; preds = %ifcont28 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @107, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @106, i32 0, i32 0), i32 1, i32 3, i32 %153, i32 %158) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %162 = getelementptr %dimension_descriptor, %dimension_descriptor* %151, i32 0, i32 0 %163 = load i32, i32* %162, align 4 %164 = mul i32 %163, %156 %165 = add i32 %150, %164 %166 = getelementptr %array, %array* %111, i32 0, i32 1 %167 = load i32, i32* %166, align 4 %168 = add i32 %165, %167 %169 = getelementptr %array, %array* %111, i32 0, i32 0 %170 = load i32*, i32** %169, align 8 %171 = getelementptr inbounds i32, i32* %170, i32 %168 %172 = load i32, i32* %171, align 4 %173 = icmp ne i32 %172, 8 br i1 %173, label %then31, label %else32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @109, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @108, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont33 else32: ; preds = %ifcont30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 %174 = alloca i64, align 8 %175 = load %array*, %array** %c, align 8 %176 = ptrtoint %array* %175 to i64 %177 = icmp eq i64 %176, 0 br i1 %177, label %merge_allocated35, label %check_data34 check_data34: ; preds = %ifcont33 %178 = getelementptr %array, %array* %175, i32 0, i32 0 %179 = load i32*, i32** %178, align 8 %180 = ptrtoint i32* %179 to i64 %181 = icmp ne i64 %180, 0 br label %merge_allocated35 merge_allocated35: ; preds = %check_data34, %ifcont33 %is_allocated36 = phi i1 [ false, %ifcont33 ], [ %181, %check_data34 ] %182 = xor i1 %is_allocated36, true br i1 %182, label %then37, label %ifcont38 then37: ; preds = %merge_allocated35 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @112, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @111, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont38: ; preds = %merge_allocated35 %183 = getelementptr %array, %array* %175, i32 0, i32 2 %184 = load %dimension_descriptor*, %dimension_descriptor** %183, align 8 %185 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 0 %186 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 1 %187 = load i32, i32* %186, align 4 %188 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 2 %189 = load i32, i32* %188, align 4 %190 = sub i32 1, %187 %191 = add i32 %187, %189 %192 = sub i32 %191, 1 %193 = icmp slt i32 1, %187 %194 = icmp sgt i32 1, %192 %195 = or i1 %193, %194 br i1 %195, label %then39, label %ifcont40 then39: ; preds = %ifcont38 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @114, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @113, i32 0, i32 0), i32 1, i32 1, i32 %187, i32 %192) call void @exit(i32 1) unreachable ifcont40: ; preds = %ifcont38 %196 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 0 %197 = load i32, i32* %196, align 4 %198 = mul i32 %197, %190 %199 = add i32 0, %198 %200 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 1 %201 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 1 %202 = load i32, i32* %201, align 4 %203 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 2 %204 = load i32, i32* %203, align 4 %205 = sub i32 1, %202 %206 = add i32 %202, %204 %207 = sub i32 %206, 1 %208 = icmp slt i32 1, %202 %209 = icmp sgt i32 1, %207 %210 = or i1 %208, %209 br i1 %210, label %then41, label %ifcont42 then41: ; preds = %ifcont40 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @116, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @115, i32 0, i32 0), i32 1, i32 2, i32 %202, i32 %207) call void @exit(i32 1) unreachable ifcont42: ; preds = %ifcont40 %211 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 0 %212 = load i32, i32* %211, align 4 %213 = mul i32 %212, %205 %214 = add i32 %199, %213 %215 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 2 %216 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 1 %217 = load i32, i32* %216, align 4 %218 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 2 %219 = load i32, i32* %218, align 4 %220 = sub i32 1, %217 %221 = add i32 %217, %219 %222 = sub i32 %221, 1 %223 = icmp slt i32 1, %217 %224 = icmp sgt i32 1, %222 %225 = or i1 %223, %224 br i1 %225, label %then43, label %ifcont44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @118, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @117, i32 0, i32 0), i32 1, i32 3, i32 %217, i32 %222) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %226 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 0 %227 = load i32, i32* %226, align 4 %228 = mul i32 %227, %220 %229 = add i32 %214, %228 %230 = getelementptr %array, %array* %175, i32 0, i32 1 %231 = load i32, i32* %230, align 4 %232 = add i32 %229, %231 %233 = getelementptr %array, %array* %175, i32 0, i32 0 %234 = load i32*, i32** %233, align 8 %235 = getelementptr inbounds i32, i32* %234, i32 %232 %236 = load i32, i32* %235, align 4 %237 = alloca i32, align 4 store i32 %236, i32* %237, align 4 %238 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %174, i32 0, i32 0, i32* %237) %239 = load i64, i64* %174, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %240 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %238, i8** %240, align 8 %241 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %239, i64* %241, align 4 %242 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %243 = load i8*, i8** %242, align 8 %244 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %245 = load i64, i64* %244, align 4 %246 = trunc i64 %245 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @119, i32 0, i32 0), i8* %243, i32 %246, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @110, i32 0, i32 0), i32 1) %247 = icmp eq i8* %238, null br i1 %247, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont44 call void @_lfortran_free(i8* %238) br label %free_done free_done: ; preds = %free_nonnull, %ifcont44 call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_allocate_03 FINALIZE_SYMTABLE_allocate_03: ; preds = %return br label %Finalize_Variable_c Finalize_Variable_c: ; preds = %FINALIZE_SYMTABLE_allocate_03 %248 = load %array*, %array** %c, align 8 %249 = icmp ne %array* %248, null br i1 %249, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_c %250 = getelementptr %array, %array* %248, i32 0, i32 0 %251 = load i32*, i32** %250, align 8 %252 = icmp eq i32* %251, null br i1 %252, label %free_done46, label %free_nonnull45 free_nonnull45: ; preds = %is_allocated.then %253 = bitcast i32* %251 to i8* call void @_lfortran_free(i8* %253) br label %free_done46 free_done46: ; preds = %free_nonnull45, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_c br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done46 ret i32 0 } define void @f(%array** %c) { .entry: %0 = load %array*, %array** %c, align 8 %1 = load %array*, %array** %c, align 8 %2 = ptrtoint %array* %1 to i64 %3 = icmp eq i64 %2, 0 br i1 %3, label %merge_allocated, label %check_data check_data: ; preds = %.entry %4 = getelementptr %array, %array* %1, i32 0, i32 0 %5 = load i32*, i32** %4, align 8 %6 = ptrtoint i32* %5 to i64 %7 = icmp ne i64 %6, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %7, %check_data ] br i1 %is_allocated, label %then, label %else5 then: ; preds = %merge_allocated %8 = load %array*, %array** %c, align 8 %9 = ptrtoint %array* %8 to i64 %10 = icmp eq i64 %9, 0 br i1 %10, label %merge_allocated2, label %check_data1 check_data1: ; preds = %then %11 = getelementptr %array, %array* %8, i32 0, i32 0 %12 = load i32*, i32** %11, align 8 %13 = ptrtoint i32* %12 to i64 %14 = icmp ne i64 %13, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %then %is_allocated3 = phi i1 [ false, %then ], [ %14, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %15 = getelementptr %array, %array* %8, i32 0, i32 0 %16 = load i32*, i32** %15, align 8 %17 = bitcast i32* %16 to i8* call void @_lfortran_free(i8* %17) %18 = getelementptr %array, %array* %8, i32 0, i32 0 store i32* null, i32** %18, align 8 br label %ifcont else: ; preds = %merge_allocated2 br label %ifcont ifcont: ; preds = %else, %then4 br label %ifcont6 else5: ; preds = %merge_allocated br label %ifcont6 ifcont6: ; preds = %else5, %ifcont %19 = load %array*, %array** %c, align 8 %20 = ptrtoint %array* %19 to i64 %21 = icmp eq i64 %20, 0 br i1 %21, label %merge_allocated8, label %check_data7 check_data7: ; preds = %ifcont6 %22 = getelementptr %array, %array* %19, i32 0, i32 0 %23 = load i32*, i32** %22, align 8 %24 = ptrtoint i32* %23 to i64 %25 = icmp ne i64 %24, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %ifcont6 %is_allocated9 = phi i1 [ false, %ifcont6 ], [ %25, %check_data7 ] br i1 %is_allocated9, label %then10, label %ifcont11 then10: ; preds = %merge_allocated8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont11: ; preds = %merge_allocated8 %26 = load %array*, %array** %c, align 8 %27 = ptrtoint %array* %26 to i32 %28 = icmp eq i32 %27, 0 br i1 %28, label %then12, label %else13 then12: ; preds = %ifcont11 %29 = call i8* @_lfortran_malloc(i64 32) call void @llvm.memset.p0i8.i32(i8* %29, i8 0, i32 32, i1 false) %30 = bitcast i8* %29 to %array* %31 = call i8* @_lfortran_malloc(i64 36) call void @llvm.memset.p0i8.i32(i8* %31, i8 0, i32 36, i1 false) %32 = getelementptr %array, %array* %30, i32 0, i32 2 %33 = bitcast i8* %31 to %dimension_descriptor* store %dimension_descriptor* %33, %dimension_descriptor** %32, align 8 %34 = getelementptr %array, %array* %30, i32 0, i32 4 store i32 3, i32* %34, align 4 store %array* %30, %array** %c, align 8 br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 %35 = load %array*, %array** %c, align 8 %36 = getelementptr %array, %array* %35, i32 0, i32 1 store i32 0, i32* %36, align 4 %37 = getelementptr %array, %array* %35, i32 0, i32 2 %38 = load %dimension_descriptor*, %dimension_descriptor** %37, align 8 %39 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %38, i32 0 %40 = getelementptr %dimension_descriptor, %dimension_descriptor* %39, i32 0, i32 0 %41 = getelementptr %dimension_descriptor, %dimension_descriptor* %39, i32 0, i32 1 %42 = getelementptr %dimension_descriptor, %dimension_descriptor* %39, i32 0, i32 2 store i32 1, i32* %40, align 4 store i32 1, i32* %41, align 4 store i32 3, i32* %42, align 4 %43 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %38, i32 1 %44 = getelementptr %dimension_descriptor, %dimension_descriptor* %43, i32 0, i32 0 %45 = getelementptr %dimension_descriptor, %dimension_descriptor* %43, i32 0, i32 1 %46 = getelementptr %dimension_descriptor, %dimension_descriptor* %43, i32 0, i32 2 store i32 3, i32* %44, align 4 store i32 1, i32* %45, align 4 store i32 3, i32* %46, align 4 %47 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %38, i32 2 %48 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 0 %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 1 %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 2 store i32 9, i32* %48, align 4 store i32 1, i32* %49, align 4 store i32 3, i32* %50, align 4 %51 = getelementptr %array, %array* %35, i32 0, i32 0 %52 = call i8* @_lfortran_malloc(i64 108) %53 = bitcast i8* %52 to i32* store i32* %53, i32** %51, align 8 %54 = load %array*, %array** %c, align 8 %55 = ptrtoint %array* %54 to i64 %56 = icmp eq i64 %55, 0 br i1 %56, label %merge_allocated16, label %check_data15 check_data15: ; preds = %ifcont14 %57 = getelementptr %array, %array* %54, i32 0, i32 0 %58 = load i32*, i32** %57, align 8 %59 = ptrtoint i32* %58 to i64 %60 = icmp ne i64 %59, 0 br label %merge_allocated16 merge_allocated16: ; preds = %check_data15, %ifcont14 %is_allocated17 = phi i1 [ false, %ifcont14 ], [ %60, %check_data15 ] %61 = xor i1 %is_allocated17, true br i1 %61, label %then18, label %ifcont19 then18: ; preds = %merge_allocated16 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont19: ; preds = %merge_allocated16 %62 = getelementptr %array, %array* %54, i32 0, i32 2 %63 = load %dimension_descriptor*, %dimension_descriptor** %62, align 8 %64 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %63, i32 0 %65 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 1 %66 = load i32, i32* %65, align 4 %67 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 2 %68 = load i32, i32* %67, align 4 %69 = sub i32 1, %66 %70 = add i32 %66, %68 %71 = sub i32 %70, 1 %72 = icmp slt i32 1, %66 %73 = icmp sgt i32 1, %71 %74 = or i1 %72, %73 br i1 %74, label %then20, label %ifcont21 then20: ; preds = %ifcont19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1, i32 1, i32 %66, i32 %71) call void @exit(i32 1) unreachable ifcont21: ; preds = %ifcont19 %75 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 0 %76 = load i32, i32* %75, align 4 %77 = mul i32 %76, %69 %78 = add i32 0, %77 %79 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %63, i32 1 %80 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 1 %81 = load i32, i32* %80, align 4 %82 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 2 %83 = load i32, i32* %82, align 4 %84 = sub i32 1, %81 %85 = add i32 %81, %83 %86 = sub i32 %85, 1 %87 = icmp slt i32 1, %81 %88 = icmp sgt i32 1, %86 %89 = or i1 %87, %88 br i1 %89, label %then22, label %ifcont23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1, i32 2, i32 %81, i32 %86) call void @exit(i32 1) unreachable ifcont23: ; preds = %ifcont21 %90 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 0 %91 = load i32, i32* %90, align 4 %92 = mul i32 %91, %84 %93 = add i32 %78, %92 %94 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %63, i32 2 %95 = getelementptr %dimension_descriptor, %dimension_descriptor* %94, i32 0, i32 1 %96 = load i32, i32* %95, align 4 %97 = getelementptr %dimension_descriptor, %dimension_descriptor* %94, i32 0, i32 2 %98 = load i32, i32* %97, align 4 %99 = sub i32 1, %96 %100 = add i32 %96, %98 %101 = sub i32 %100, 1 %102 = icmp slt i32 1, %96 %103 = icmp sgt i32 1, %101 %104 = or i1 %102, %103 br i1 %104, label %then24, label %ifcont25 then24: ; preds = %ifcont23 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1, i32 3, i32 %96, i32 %101) call void @exit(i32 1) unreachable ifcont25: ; preds = %ifcont23 %105 = getelementptr %dimension_descriptor, %dimension_descriptor* %94, i32 0, i32 0 %106 = load i32, i32* %105, align 4 %107 = mul i32 %106, %99 %108 = add i32 %93, %107 %109 = getelementptr %array, %array* %54, i32 0, i32 1 %110 = load i32, i32* %109, align 4 %111 = add i32 %108, %110 %112 = getelementptr %array, %array* %54, i32 0, i32 0 %113 = load i32*, i32** %112, align 8 %114 = getelementptr inbounds i32, i32* %113, i32 %111 store i32 99, i32* %114, align 4 br label %return return: ; preds = %ifcont25 br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define i32 @g(%array** %x) { .entry: %r = alloca i32, align 4 %0 = alloca i64, align 8 %1 = load %array*, %array** %x, align 8 %2 = ptrtoint %array* %1 to i64 %3 = icmp eq i64 %2, 0 br i1 %3, label %merge_allocated, label %check_data check_data: ; preds = %.entry %4 = getelementptr %array, %array* %1, i32 0, i32 0 %5 = load i32*, i32** %4, align 8 %6 = ptrtoint i32* %5 to i64 %7 = icmp ne i64 %6, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %7, %check_data ] %8 = xor i1 %is_allocated, true br i1 %8, label %then, label %ifcont then: ; preds = %merge_allocated call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @11, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %merge_allocated %9 = getelementptr %array, %array* %1, i32 0, i32 2 %10 = load %dimension_descriptor*, %dimension_descriptor** %9, align 8 %11 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %10, i32 0 %12 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 1 %13 = load i32, i32* %12, align 4 %14 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 2 %15 = load i32, i32* %14, align 4 %16 = sub i32 1, %13 %17 = add i32 %13, %15 %18 = sub i32 %17, 1 %19 = icmp slt i32 1, %13 %20 = icmp sgt i32 1, %18 %21 = or i1 %19, %20 br i1 %21, label %then1, label %ifcont2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @13, i32 0, i32 0), i32 1, i32 1, i32 %13, i32 %18) call void @exit(i32 1) unreachable ifcont2: ; preds = %ifcont %22 = getelementptr %dimension_descriptor, %dimension_descriptor* %11, i32 0, i32 0 %23 = load i32, i32* %22, align 4 %24 = mul i32 %23, %16 %25 = add i32 0, %24 %26 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %10, i32 1 %27 = getelementptr %dimension_descriptor, %dimension_descriptor* %26, i32 0, i32 1 %28 = load i32, i32* %27, align 4 %29 = getelementptr %dimension_descriptor, %dimension_descriptor* %26, i32 0, i32 2 %30 = load i32, i32* %29, align 4 %31 = sub i32 1, %28 %32 = add i32 %28, %30 %33 = sub i32 %32, 1 %34 = icmp slt i32 1, %28 %35 = icmp sgt i32 1, %33 %36 = or i1 %34, %35 br i1 %36, label %then3, label %ifcont4 then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @15, i32 0, i32 0), i32 1, i32 2, i32 %28, i32 %33) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %26, i32 0, i32 0 %38 = load i32, i32* %37, align 4 %39 = mul i32 %38, %31 %40 = add i32 %25, %39 %41 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %10, i32 2 %42 = getelementptr %dimension_descriptor, %dimension_descriptor* %41, i32 0, i32 1 %43 = load i32, i32* %42, align 4 %44 = getelementptr %dimension_descriptor, %dimension_descriptor* %41, i32 0, i32 2 %45 = load i32, i32* %44, align 4 %46 = sub i32 1, %43 %47 = add i32 %43, %45 %48 = sub i32 %47, 1 %49 = icmp slt i32 1, %43 %50 = icmp sgt i32 1, %48 %51 = or i1 %49, %50 br i1 %51, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @18, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @17, i32 0, i32 0), i32 1, i32 3, i32 %43, i32 %48) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %52 = getelementptr %dimension_descriptor, %dimension_descriptor* %41, i32 0, i32 0 %53 = load i32, i32* %52, align 4 %54 = mul i32 %53, %46 %55 = add i32 %40, %54 %56 = getelementptr %array, %array* %1, i32 0, i32 1 %57 = load i32, i32* %56, align 4 %58 = add i32 %55, %57 %59 = getelementptr %array, %array* %1, i32 0, i32 0 %60 = load i32*, i32** %59, align 8 %61 = getelementptr inbounds i32, i32* %60, i32 %58 %62 = load i32, i32* %61, align 4 %63 = alloca i32, align 4 store i32 %62, i32* %63, align 4 %64 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %63) %65 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %66 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %64, i8** %66, align 8 %67 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %65, i64* %67, align 4 %68 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %69 = load i8*, i8** %68, align 8 %70 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %71 = load i64, i64* %70, align 4 %72 = trunc i64 %71 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %69, i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %73 = icmp eq i8* %64, null br i1 %73, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free(i8* %64) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 %74 = load %array*, %array** %x, align 8 %75 = ptrtoint %array* %74 to i64 %76 = icmp eq i64 %75, 0 br i1 %76, label %merge_allocated8, label %check_data7 check_data7: ; preds = %free_done %77 = getelementptr %array, %array* %74, i32 0, i32 0 %78 = load i32*, i32** %77, align 8 %79 = ptrtoint i32* %78 to i64 %80 = icmp ne i64 %79, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %free_done %is_allocated9 = phi i1 [ false, %free_done ], [ %80, %check_data7 ] %81 = xor i1 %is_allocated9, true br i1 %81, label %then10, label %ifcont11 then10: ; preds = %merge_allocated8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont11: ; preds = %merge_allocated8 %82 = getelementptr %array, %array* %74, i32 0, i32 2 %83 = load %dimension_descriptor*, %dimension_descriptor** %82, align 8 %84 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %83, i32 0 %85 = getelementptr %dimension_descriptor, %dimension_descriptor* %84, i32 0, i32 1 %86 = load i32, i32* %85, align 4 %87 = getelementptr %dimension_descriptor, %dimension_descriptor* %84, i32 0, i32 2 %88 = load i32, i32* %87, align 4 %89 = sub i32 1, %86 %90 = add i32 %86, %88 %91 = sub i32 %90, 1 %92 = icmp slt i32 1, %86 %93 = icmp sgt i32 1, %91 %94 = or i1 %92, %93 br i1 %94, label %then12, label %ifcont13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1, i32 1, i32 %86, i32 %91) call void @exit(i32 1) unreachable ifcont13: ; preds = %ifcont11 %95 = getelementptr %dimension_descriptor, %dimension_descriptor* %84, i32 0, i32 0 %96 = load i32, i32* %95, align 4 %97 = mul i32 %96, %89 %98 = add i32 0, %97 %99 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %83, i32 1 %100 = getelementptr %dimension_descriptor, %dimension_descriptor* %99, i32 0, i32 1 %101 = load i32, i32* %100, align 4 %102 = getelementptr %dimension_descriptor, %dimension_descriptor* %99, i32 0, i32 2 %103 = load i32, i32* %102, align 4 %104 = sub i32 1, %101 %105 = add i32 %101, %103 %106 = sub i32 %105, 1 %107 = icmp slt i32 1, %101 %108 = icmp sgt i32 1, %106 %109 = or i1 %107, %108 br i1 %109, label %then14, label %ifcont15 then14: ; preds = %ifcont13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1, i32 2, i32 %101, i32 %106) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %110 = getelementptr %dimension_descriptor, %dimension_descriptor* %99, i32 0, i32 0 %111 = load i32, i32* %110, align 4 %112 = mul i32 %111, %104 %113 = add i32 %98, %112 %114 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %83, i32 2 %115 = getelementptr %dimension_descriptor, %dimension_descriptor* %114, i32 0, i32 1 %116 = load i32, i32* %115, align 4 %117 = getelementptr %dimension_descriptor, %dimension_descriptor* %114, i32 0, i32 2 %118 = load i32, i32* %117, align 4 %119 = sub i32 1, %116 %120 = add i32 %116, %118 %121 = sub i32 %120, 1 %122 = icmp slt i32 1, %116 %123 = icmp sgt i32 1, %121 %124 = or i1 %122, %123 br i1 %124, label %then16, label %ifcont17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1, i32 3, i32 %116, i32 %121) call void @exit(i32 1) unreachable ifcont17: ; preds = %ifcont15 %125 = getelementptr %dimension_descriptor, %dimension_descriptor* %114, i32 0, i32 0 %126 = load i32, i32* %125, align 4 %127 = mul i32 %126, %119 %128 = add i32 %113, %127 %129 = getelementptr %array, %array* %74, i32 0, i32 1 %130 = load i32, i32* %129, align 4 %131 = add i32 %128, %130 %132 = getelementptr %array, %array* %74, i32 0, i32 0 %133 = load i32*, i32** %132, align 8 %134 = getelementptr inbounds i32, i32* %133, i32 %131 %135 = load i32, i32* %134, align 4 %136 = icmp ne i32 %135, 8 br i1 %136, label %then18, label %else then18: ; preds = %ifcont17 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont19 else: ; preds = %ifcont17 br label %ifcont19 ifcont19: ; preds = %else, %then18 %137 = load %array*, %array** %x, align 8 %138 = ptrtoint %array* %137 to i64 %139 = icmp eq i64 %138, 0 br i1 %139, label %merge_allocated21, label %check_data20 check_data20: ; preds = %ifcont19 %140 = getelementptr %array, %array* %137, i32 0, i32 0 %141 = load i32*, i32** %140, align 8 %142 = ptrtoint i32* %141 to i64 %143 = icmp ne i64 %142, 0 br label %merge_allocated21 merge_allocated21: ; preds = %check_data20, %ifcont19 %is_allocated22 = phi i1 [ false, %ifcont19 ], [ %143, %check_data20 ] br i1 %is_allocated22, label %then23, label %else24 then23: ; preds = %merge_allocated21 %144 = getelementptr %array, %array* %137, i32 0, i32 0 %145 = load i32*, i32** %144, align 8 %146 = bitcast i32* %145 to i8* call void @_lfortran_free(i8* %146) %147 = getelementptr %array, %array* %137, i32 0, i32 0 store i32* null, i32** %147, align 8 br label %ifcont25 else24: ; preds = %merge_allocated21 br label %ifcont25 ifcont25: ; preds = %else24, %then23 call void @f(%array** %x) %148 = alloca i64, align 8 %149 = load %array*, %array** %x, align 8 %150 = ptrtoint %array* %149 to i64 %151 = icmp eq i64 %150, 0 br i1 %151, label %merge_allocated27, label %check_data26 check_data26: ; preds = %ifcont25 %152 = getelementptr %array, %array* %149, i32 0, i32 0 %153 = load i32*, i32** %152, align 8 %154 = ptrtoint i32* %153 to i64 %155 = icmp ne i64 %154, 0 br label %merge_allocated27 merge_allocated27: ; preds = %check_data26, %ifcont25 %is_allocated28 = phi i1 [ false, %ifcont25 ], [ %155, %check_data26 ] %156 = xor i1 %is_allocated28, true br i1 %156, label %then29, label %ifcont30 then29: ; preds = %merge_allocated27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @32, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @31, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont30: ; preds = %merge_allocated27 %157 = getelementptr %array, %array* %149, i32 0, i32 2 %158 = load %dimension_descriptor*, %dimension_descriptor** %157, align 8 %159 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %158, i32 0 %160 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 1 %161 = load i32, i32* %160, align 4 %162 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 2 %163 = load i32, i32* %162, align 4 %164 = sub i32 1, %161 %165 = add i32 %161, %163 %166 = sub i32 %165, 1 %167 = icmp slt i32 1, %161 %168 = icmp sgt i32 1, %166 %169 = or i1 %167, %168 br i1 %169, label %then31, label %ifcont32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @34, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @33, i32 0, i32 0), i32 1, i32 1, i32 %161, i32 %166) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %170 = getelementptr %dimension_descriptor, %dimension_descriptor* %159, i32 0, i32 0 %171 = load i32, i32* %170, align 4 %172 = mul i32 %171, %164 %173 = add i32 0, %172 %174 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %158, i32 1 %175 = getelementptr %dimension_descriptor, %dimension_descriptor* %174, i32 0, i32 1 %176 = load i32, i32* %175, align 4 %177 = getelementptr %dimension_descriptor, %dimension_descriptor* %174, i32 0, i32 2 %178 = load i32, i32* %177, align 4 %179 = sub i32 1, %176 %180 = add i32 %176, %178 %181 = sub i32 %180, 1 %182 = icmp slt i32 1, %176 %183 = icmp sgt i32 1, %181 %184 = or i1 %182, %183 br i1 %184, label %then33, label %ifcont34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @36, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @35, i32 0, i32 0), i32 1, i32 2, i32 %176, i32 %181) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %185 = getelementptr %dimension_descriptor, %dimension_descriptor* %174, i32 0, i32 0 %186 = load i32, i32* %185, align 4 %187 = mul i32 %186, %179 %188 = add i32 %173, %187 %189 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %158, i32 2 %190 = getelementptr %dimension_descriptor, %dimension_descriptor* %189, i32 0, i32 1 %191 = load i32, i32* %190, align 4 %192 = getelementptr %dimension_descriptor, %dimension_descriptor* %189, i32 0, i32 2 %193 = load i32, i32* %192, align 4 %194 = sub i32 1, %191 %195 = add i32 %191, %193 %196 = sub i32 %195, 1 %197 = icmp slt i32 1, %191 %198 = icmp sgt i32 1, %196 %199 = or i1 %197, %198 br i1 %199, label %then35, label %ifcont36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @38, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @37, i32 0, i32 0), i32 1, i32 3, i32 %191, i32 %196) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %200 = getelementptr %dimension_descriptor, %dimension_descriptor* %189, i32 0, i32 0 %201 = load i32, i32* %200, align 4 %202 = mul i32 %201, %194 %203 = add i32 %188, %202 %204 = getelementptr %array, %array* %149, i32 0, i32 1 %205 = load i32, i32* %204, align 4 %206 = add i32 %203, %205 %207 = getelementptr %array, %array* %149, i32 0, i32 0 %208 = load i32*, i32** %207, align 8 %209 = getelementptr inbounds i32, i32* %208, i32 %206 %210 = load i32, i32* %209, align 4 %211 = alloca i32, align 4 store i32 %210, i32* %211, align 4 %212 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %148, i32 0, i32 0, i32* %211) %213 = load i64, i64* %148, align 4 %stringFormat_desc37 = alloca %string_descriptor, align 8 %214 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 store i8* %212, i8** %214, align 8 %215 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 store i64 %213, i64* %215, align 4 %216 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 0 %217 = load i8*, i8** %216, align 8 %218 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc37, i32 0, i32 1 %219 = load i64, i64* %218, align 4 %220 = trunc i64 %219 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %217, i32 %220, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) %221 = icmp eq i8* %212, null br i1 %221, label %free_done39, label %free_nonnull38 free_nonnull38: ; preds = %ifcont36 call void @_lfortran_free(i8* %212) br label %free_done39 free_done39: ; preds = %free_nonnull38, %ifcont36 %222 = load %array*, %array** %x, align 8 %223 = ptrtoint %array* %222 to i64 %224 = icmp eq i64 %223, 0 br i1 %224, label %merge_allocated41, label %check_data40 check_data40: ; preds = %free_done39 %225 = getelementptr %array, %array* %222, i32 0, i32 0 %226 = load i32*, i32** %225, align 8 %227 = ptrtoint i32* %226 to i64 %228 = icmp ne i64 %227, 0 br label %merge_allocated41 merge_allocated41: ; preds = %check_data40, %free_done39 %is_allocated42 = phi i1 [ false, %free_done39 ], [ %228, %check_data40 ] %229 = xor i1 %is_allocated42, true br i1 %229, label %then43, label %ifcont44 then43: ; preds = %merge_allocated41 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont44: ; preds = %merge_allocated41 %230 = getelementptr %array, %array* %222, i32 0, i32 2 %231 = load %dimension_descriptor*, %dimension_descriptor** %230, align 8 %232 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %231, i32 0 %233 = getelementptr %dimension_descriptor, %dimension_descriptor* %232, i32 0, i32 1 %234 = load i32, i32* %233, align 4 %235 = getelementptr %dimension_descriptor, %dimension_descriptor* %232, i32 0, i32 2 %236 = load i32, i32* %235, align 4 %237 = sub i32 1, %234 %238 = add i32 %234, %236 %239 = sub i32 %238, 1 %240 = icmp slt i32 1, %234 %241 = icmp sgt i32 1, %239 %242 = or i1 %240, %241 br i1 %242, label %then45, label %ifcont46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1, i32 1, i32 %234, i32 %239) call void @exit(i32 1) unreachable ifcont46: ; preds = %ifcont44 %243 = getelementptr %dimension_descriptor, %dimension_descriptor* %232, i32 0, i32 0 %244 = load i32, i32* %243, align 4 %245 = mul i32 %244, %237 %246 = add i32 0, %245 %247 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %231, i32 1 %248 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 1 %249 = load i32, i32* %248, align 4 %250 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 2 %251 = load i32, i32* %250, align 4 %252 = sub i32 1, %249 %253 = add i32 %249, %251 %254 = sub i32 %253, 1 %255 = icmp slt i32 1, %249 %256 = icmp sgt i32 1, %254 %257 = or i1 %255, %256 br i1 %257, label %then47, label %ifcont48 then47: ; preds = %ifcont46 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1, i32 2, i32 %249, i32 %254) call void @exit(i32 1) unreachable ifcont48: ; preds = %ifcont46 %258 = getelementptr %dimension_descriptor, %dimension_descriptor* %247, i32 0, i32 0 %259 = load i32, i32* %258, align 4 %260 = mul i32 %259, %252 %261 = add i32 %246, %260 %262 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %231, i32 2 %263 = getelementptr %dimension_descriptor, %dimension_descriptor* %262, i32 0, i32 1 %264 = load i32, i32* %263, align 4 %265 = getelementptr %dimension_descriptor, %dimension_descriptor* %262, i32 0, i32 2 %266 = load i32, i32* %265, align 4 %267 = sub i32 1, %264 %268 = add i32 %264, %266 %269 = sub i32 %268, 1 %270 = icmp slt i32 1, %264 %271 = icmp sgt i32 1, %269 %272 = or i1 %270, %271 br i1 %272, label %then49, label %ifcont50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0), i32 1, i32 3, i32 %264, i32 %269) call void @exit(i32 1) unreachable ifcont50: ; preds = %ifcont48 %273 = getelementptr %dimension_descriptor, %dimension_descriptor* %262, i32 0, i32 0 %274 = load i32, i32* %273, align 4 %275 = mul i32 %274, %267 %276 = add i32 %261, %275 %277 = getelementptr %array, %array* %222, i32 0, i32 1 %278 = load i32, i32* %277, align 4 %279 = add i32 %276, %278 %280 = getelementptr %array, %array* %222, i32 0, i32 0 %281 = load i32*, i32** %280, align 8 %282 = getelementptr inbounds i32, i32* %281, i32 %279 %283 = load i32, i32* %282, align 4 %284 = icmp ne i32 %283, 99 br i1 %284, label %then51, label %else52 then51: ; preds = %ifcont50 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont53 else52: ; preds = %ifcont50 br label %ifcont53 ifcont53: ; preds = %else52, %then51 %285 = load %array*, %array** %x, align 8 %286 = ptrtoint %array* %285 to i64 %287 = icmp eq i64 %286, 0 br i1 %287, label %merge_allocated55, label %check_data54 check_data54: ; preds = %ifcont53 %288 = getelementptr %array, %array* %285, i32 0, i32 0 %289 = load i32*, i32** %288, align 8 %290 = ptrtoint i32* %289 to i64 %291 = icmp ne i64 %290, 0 br label %merge_allocated55 merge_allocated55: ; preds = %check_data54, %ifcont53 %is_allocated56 = phi i1 [ false, %ifcont53 ], [ %291, %check_data54 ] %292 = xor i1 %is_allocated56, true br i1 %292, label %then57, label %ifcont58 then57: ; preds = %merge_allocated55 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont58: ; preds = %merge_allocated55 %293 = getelementptr %array, %array* %285, i32 0, i32 2 %294 = load %dimension_descriptor*, %dimension_descriptor** %293, align 8 %295 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %294, i32 0 %296 = getelementptr %dimension_descriptor, %dimension_descriptor* %295, i32 0, i32 1 %297 = load i32, i32* %296, align 4 %298 = getelementptr %dimension_descriptor, %dimension_descriptor* %295, i32 0, i32 2 %299 = load i32, i32* %298, align 4 %300 = sub i32 1, %297 %301 = add i32 %297, %299 %302 = sub i32 %301, 1 %303 = icmp slt i32 1, %297 %304 = icmp sgt i32 1, %302 %305 = or i1 %303, %304 br i1 %305, label %then59, label %ifcont60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 1, i32 1, i32 %297, i32 %302) call void @exit(i32 1) unreachable ifcont60: ; preds = %ifcont58 %306 = getelementptr %dimension_descriptor, %dimension_descriptor* %295, i32 0, i32 0 %307 = load i32, i32* %306, align 4 %308 = mul i32 %307, %300 %309 = add i32 0, %308 %310 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %294, i32 1 %311 = getelementptr %dimension_descriptor, %dimension_descriptor* %310, i32 0, i32 1 %312 = load i32, i32* %311, align 4 %313 = getelementptr %dimension_descriptor, %dimension_descriptor* %310, i32 0, i32 2 %314 = load i32, i32* %313, align 4 %315 = sub i32 1, %312 %316 = add i32 %312, %314 %317 = sub i32 %316, 1 %318 = icmp slt i32 1, %312 %319 = icmp sgt i32 1, %317 %320 = or i1 %318, %319 br i1 %320, label %then61, label %ifcont62 then61: ; preds = %ifcont60 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i32 1, i32 2, i32 %312, i32 %317) call void @exit(i32 1) unreachable ifcont62: ; preds = %ifcont60 %321 = getelementptr %dimension_descriptor, %dimension_descriptor* %310, i32 0, i32 0 %322 = load i32, i32* %321, align 4 %323 = mul i32 %322, %315 %324 = add i32 %309, %323 %325 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %294, i32 2 %326 = getelementptr %dimension_descriptor, %dimension_descriptor* %325, i32 0, i32 1 %327 = load i32, i32* %326, align 4 %328 = getelementptr %dimension_descriptor, %dimension_descriptor* %325, i32 0, i32 2 %329 = load i32, i32* %328, align 4 %330 = sub i32 1, %327 %331 = add i32 %327, %329 %332 = sub i32 %331, 1 %333 = icmp slt i32 1, %327 %334 = icmp sgt i32 1, %332 %335 = or i1 %333, %334 br i1 %335, label %then63, label %ifcont64 then63: ; preds = %ifcont62 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1, i32 3, i32 %327, i32 %332) call void @exit(i32 1) unreachable ifcont64: ; preds = %ifcont62 %336 = getelementptr %dimension_descriptor, %dimension_descriptor* %325, i32 0, i32 0 %337 = load i32, i32* %336, align 4 %338 = mul i32 %337, %330 %339 = add i32 %324, %338 %340 = getelementptr %array, %array* %285, i32 0, i32 1 %341 = load i32, i32* %340, align 4 %342 = add i32 %339, %341 %343 = getelementptr %array, %array* %285, i32 0, i32 0 %344 = load i32*, i32** %343, align 8 %345 = getelementptr inbounds i32, i32* %344, i32 %342 store i32 8, i32* %345, align 4 store i32 0, i32* %r, align 4 br label %return return: ; preds = %ifcont64 br label %FINALIZE_SYMTABLE_g FINALIZE_SYMTABLE_g: ; preds = %return %346 = load i32, i32* %r, align 4 ret i32 %346 } define void @h(%array** %c) { .entry: %0 = load %array*, %array** %c, align 8 %1 = load %array*, %array** %c, align 8 %2 = ptrtoint %array* %1 to i64 %3 = icmp eq i64 %2, 0 br i1 %3, label %merge_allocated, label %check_data check_data: ; preds = %.entry %4 = getelementptr %array, %array* %1, i32 0, i32 0 %5 = load i32*, i32** %4, align 8 %6 = ptrtoint i32* %5 to i64 %7 = icmp ne i64 %6, 0 br label %merge_allocated merge_allocated: ; preds = %check_data, %.entry %is_allocated = phi i1 [ false, %.entry ], [ %7, %check_data ] br i1 %is_allocated, label %then, label %else5 then: ; preds = %merge_allocated %8 = load %array*, %array** %c, align 8 %9 = ptrtoint %array* %8 to i64 %10 = icmp eq i64 %9, 0 br i1 %10, label %merge_allocated2, label %check_data1 check_data1: ; preds = %then %11 = getelementptr %array, %array* %8, i32 0, i32 0 %12 = load i32*, i32** %11, align 8 %13 = ptrtoint i32* %12 to i64 %14 = icmp ne i64 %13, 0 br label %merge_allocated2 merge_allocated2: ; preds = %check_data1, %then %is_allocated3 = phi i1 [ false, %then ], [ %14, %check_data1 ] br i1 %is_allocated3, label %then4, label %else then4: ; preds = %merge_allocated2 %15 = getelementptr %array, %array* %8, i32 0, i32 0 %16 = load i32*, i32** %15, align 8 %17 = bitcast i32* %16 to i8* call void @_lfortran_free(i8* %17) %18 = getelementptr %array, %array* %8, i32 0, i32 0 store i32* null, i32** %18, align 8 br label %ifcont else: ; preds = %merge_allocated2 br label %ifcont ifcont: ; preds = %else, %then4 br label %ifcont6 else5: ; preds = %merge_allocated br label %ifcont6 ifcont6: ; preds = %else5, %ifcont %19 = load %array*, %array** %c, align 8 %20 = load %array*, %array** %c, align 8 %21 = ptrtoint %array* %20 to i64 %22 = icmp eq i64 %21, 0 br i1 %22, label %merge_allocated8, label %check_data7 check_data7: ; preds = %ifcont6 %23 = getelementptr %array, %array* %20, i32 0, i32 0 %24 = load i32*, i32** %23, align 8 %25 = ptrtoint i32* %24 to i64 %26 = icmp ne i64 %25, 0 br label %merge_allocated8 merge_allocated8: ; preds = %check_data7, %ifcont6 %is_allocated9 = phi i1 [ false, %ifcont6 ], [ %26, %check_data7 ] br i1 %is_allocated9, label %then10, label %else11 then10: ; preds = %merge_allocated8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %merge_allocated8 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %27 = load %array*, %array** %c, align 8 %28 = ptrtoint %array* %27 to i64 %29 = icmp eq i64 %28, 0 br i1 %29, label %merge_allocated14, label %check_data13 check_data13: ; preds = %ifcont12 %30 = getelementptr %array, %array* %27, i32 0, i32 0 %31 = load i32*, i32** %30, align 8 %32 = ptrtoint i32* %31 to i64 %33 = icmp ne i64 %32, 0 br label %merge_allocated14 merge_allocated14: ; preds = %check_data13, %ifcont12 %is_allocated15 = phi i1 [ false, %ifcont12 ], [ %33, %check_data13 ] br i1 %is_allocated15, label %then16, label %else17 then16: ; preds = %merge_allocated14 %34 = getelementptr %array, %array* %27, i32 0, i32 0 %35 = load i32*, i32** %34, align 8 %36 = bitcast i32* %35 to i8* call void @_lfortran_free(i8* %36) %37 = getelementptr %array, %array* %27, i32 0, i32 0 store i32* null, i32** %37, align 8 br label %ifcont18 else17: ; preds = %merge_allocated14 br label %ifcont18 ifcont18: ; preds = %else17, %then16 call void @f(%array** %c) %38 = alloca i64, align 8 %39 = load %array*, %array** %c, align 8 %40 = ptrtoint %array* %39 to i64 %41 = icmp eq i64 %40, 0 br i1 %41, label %merge_allocated20, label %check_data19 check_data19: ; preds = %ifcont18 %42 = getelementptr %array, %array* %39, i32 0, i32 0 %43 = load i32*, i32** %42, align 8 %44 = ptrtoint i32* %43 to i64 %45 = icmp ne i64 %44, 0 br label %merge_allocated20 merge_allocated20: ; preds = %check_data19, %ifcont18 %is_allocated21 = phi i1 [ false, %ifcont18 ], [ %45, %check_data19 ] %46 = xor i1 %is_allocated21, true br i1 %46, label %then22, label %ifcont23 then22: ; preds = %merge_allocated20 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @62, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @61, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont23: ; preds = %merge_allocated20 %47 = getelementptr %array, %array* %39, i32 0, i32 2 %48 = load %dimension_descriptor*, %dimension_descriptor** %47, align 8 %49 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %48, i32 0 %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %49, i32 0, i32 1 %51 = load i32, i32* %50, align 4 %52 = getelementptr %dimension_descriptor, %dimension_descriptor* %49, i32 0, i32 2 %53 = load i32, i32* %52, align 4 %54 = sub i32 1, %51 %55 = add i32 %51, %53 %56 = sub i32 %55, 1 %57 = icmp slt i32 1, %51 %58 = icmp sgt i32 1, %56 %59 = or i1 %57, %58 br i1 %59, label %then24, label %ifcont25 then24: ; preds = %ifcont23 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @64, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @63, i32 0, i32 0), i32 1, i32 1, i32 %51, i32 %56) call void @exit(i32 1) unreachable ifcont25: ; preds = %ifcont23 %60 = getelementptr %dimension_descriptor, %dimension_descriptor* %49, i32 0, i32 0 %61 = load i32, i32* %60, align 4 %62 = mul i32 %61, %54 %63 = add i32 0, %62 %64 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %48, i32 1 %65 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 1 %66 = load i32, i32* %65, align 4 %67 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 2 %68 = load i32, i32* %67, align 4 %69 = sub i32 1, %66 %70 = add i32 %66, %68 %71 = sub i32 %70, 1 %72 = icmp slt i32 1, %66 %73 = icmp sgt i32 1, %71 %74 = or i1 %72, %73 br i1 %74, label %then26, label %ifcont27 then26: ; preds = %ifcont25 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @66, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @65, i32 0, i32 0), i32 1, i32 2, i32 %66, i32 %71) call void @exit(i32 1) unreachable ifcont27: ; preds = %ifcont25 %75 = getelementptr %dimension_descriptor, %dimension_descriptor* %64, i32 0, i32 0 %76 = load i32, i32* %75, align 4 %77 = mul i32 %76, %69 %78 = add i32 %63, %77 %79 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %48, i32 2 %80 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 1 %81 = load i32, i32* %80, align 4 %82 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 2 %83 = load i32, i32* %82, align 4 %84 = sub i32 1, %81 %85 = add i32 %81, %83 %86 = sub i32 %85, 1 %87 = icmp slt i32 1, %81 %88 = icmp sgt i32 1, %86 %89 = or i1 %87, %88 br i1 %89, label %then28, label %ifcont29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @68, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @67, i32 0, i32 0), i32 1, i32 3, i32 %81, i32 %86) call void @exit(i32 1) unreachable ifcont29: ; preds = %ifcont27 %90 = getelementptr %dimension_descriptor, %dimension_descriptor* %79, i32 0, i32 0 %91 = load i32, i32* %90, align 4 %92 = mul i32 %91, %84 %93 = add i32 %78, %92 %94 = getelementptr %array, %array* %39, i32 0, i32 1 %95 = load i32, i32* %94, align 4 %96 = add i32 %93, %95 %97 = getelementptr %array, %array* %39, i32 0, i32 0 %98 = load i32*, i32** %97, align 8 %99 = getelementptr inbounds i32, i32* %98, i32 %96 %100 = load i32, i32* %99, align 4 %101 = alloca i32, align 4 store i32 %100, i32* %101, align 4 %102 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %38, i32 0, i32 0, i32* %101) %103 = load i64, i64* %38, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %104 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %102, i8** %104, align 8 %105 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %103, i64* %105, align 4 %106 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %107 = load i8*, i8** %106, align 8 %108 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %109 = load i64, i64* %108, align 4 %110 = trunc i64 %109 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* %107, i32 %110, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0), i32 1) %111 = icmp eq i8* %102, null br i1 %111, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont29 call void @_lfortran_free(i8* %102) br label %free_done free_done: ; preds = %free_nonnull, %ifcont29 %112 = load %array*, %array** %c, align 8 %113 = ptrtoint %array* %112 to i64 %114 = icmp eq i64 %113, 0 br i1 %114, label %merge_allocated31, label %check_data30 check_data30: ; preds = %free_done %115 = getelementptr %array, %array* %112, i32 0, i32 0 %116 = load i32*, i32** %115, align 8 %117 = ptrtoint i32* %116 to i64 %118 = icmp ne i64 %117, 0 br label %merge_allocated31 merge_allocated31: ; preds = %check_data30, %free_done %is_allocated32 = phi i1 [ false, %free_done ], [ %118, %check_data30 ] %119 = xor i1 %is_allocated32, true br i1 %119, label %then33, label %ifcont34 then33: ; preds = %merge_allocated31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont34: ; preds = %merge_allocated31 %120 = getelementptr %array, %array* %112, i32 0, i32 2 %121 = load %dimension_descriptor*, %dimension_descriptor** %120, align 8 %122 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %121, i32 0 %123 = getelementptr %dimension_descriptor, %dimension_descriptor* %122, i32 0, i32 1 %124 = load i32, i32* %123, align 4 %125 = getelementptr %dimension_descriptor, %dimension_descriptor* %122, i32 0, i32 2 %126 = load i32, i32* %125, align 4 %127 = sub i32 1, %124 %128 = add i32 %124, %126 %129 = sub i32 %128, 1 %130 = icmp slt i32 1, %124 %131 = icmp sgt i32 1, %129 %132 = or i1 %130, %131 br i1 %132, label %then35, label %ifcont36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0), i32 1, i32 1, i32 %124, i32 %129) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %133 = getelementptr %dimension_descriptor, %dimension_descriptor* %122, i32 0, i32 0 %134 = load i32, i32* %133, align 4 %135 = mul i32 %134, %127 %136 = add i32 0, %135 %137 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %121, i32 1 %138 = getelementptr %dimension_descriptor, %dimension_descriptor* %137, i32 0, i32 1 %139 = load i32, i32* %138, align 4 %140 = getelementptr %dimension_descriptor, %dimension_descriptor* %137, i32 0, i32 2 %141 = load i32, i32* %140, align 4 %142 = sub i32 1, %139 %143 = add i32 %139, %141 %144 = sub i32 %143, 1 %145 = icmp slt i32 1, %139 %146 = icmp sgt i32 1, %144 %147 = or i1 %145, %146 br i1 %147, label %then37, label %ifcont38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i32 1, i32 2, i32 %139, i32 %144) call void @exit(i32 1) unreachable ifcont38: ; preds = %ifcont36 %148 = getelementptr %dimension_descriptor, %dimension_descriptor* %137, i32 0, i32 0 %149 = load i32, i32* %148, align 4 %150 = mul i32 %149, %142 %151 = add i32 %136, %150 %152 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %121, i32 2 %153 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 1 %154 = load i32, i32* %153, align 4 %155 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 2 %156 = load i32, i32* %155, align 4 %157 = sub i32 1, %154 %158 = add i32 %154, %156 %159 = sub i32 %158, 1 %160 = icmp slt i32 1, %154 %161 = icmp sgt i32 1, %159 %162 = or i1 %160, %161 br i1 %162, label %then39, label %ifcont40 then39: ; preds = %ifcont38 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i32 1, i32 3, i32 %154, i32 %159) call void @exit(i32 1) unreachable ifcont40: ; preds = %ifcont38 %163 = getelementptr %dimension_descriptor, %dimension_descriptor* %152, i32 0, i32 0 %164 = load i32, i32* %163, align 4 %165 = mul i32 %164, %157 %166 = add i32 %151, %165 %167 = getelementptr %array, %array* %112, i32 0, i32 1 %168 = load i32, i32* %167, align 4 %169 = add i32 %166, %168 %170 = getelementptr %array, %array* %112, i32 0, i32 0 %171 = load i32*, i32** %170, align 8 %172 = getelementptr inbounds i32, i32* %171, i32 %169 %173 = load i32, i32* %172, align 4 %174 = icmp ne i32 %173, 99 br i1 %174, label %then41, label %else42 then41: ; preds = %ifcont40 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont43 else42: ; preds = %ifcont40 br label %ifcont43 ifcont43: ; preds = %else42, %then41 %175 = load %array*, %array** %c, align 8 %176 = ptrtoint %array* %175 to i64 %177 = icmp eq i64 %176, 0 br i1 %177, label %merge_allocated45, label %check_data44 check_data44: ; preds = %ifcont43 %178 = getelementptr %array, %array* %175, i32 0, i32 0 %179 = load i32*, i32** %178, align 8 %180 = ptrtoint i32* %179 to i64 %181 = icmp ne i64 %180, 0 br label %merge_allocated45 merge_allocated45: ; preds = %check_data44, %ifcont43 %is_allocated46 = phi i1 [ false, %ifcont43 ], [ %181, %check_data44 ] %182 = xor i1 %is_allocated46, true br i1 %182, label %then47, label %ifcont48 then47: ; preds = %merge_allocated45 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @81, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont48: ; preds = %merge_allocated45 %183 = getelementptr %array, %array* %175, i32 0, i32 2 %184 = load %dimension_descriptor*, %dimension_descriptor** %183, align 8 %185 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 0 %186 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 1 %187 = load i32, i32* %186, align 4 %188 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 2 %189 = load i32, i32* %188, align 4 %190 = sub i32 1, %187 %191 = add i32 %187, %189 %192 = sub i32 %191, 1 %193 = icmp slt i32 1, %187 %194 = icmp sgt i32 1, %192 %195 = or i1 %193, %194 br i1 %195, label %then49, label %ifcont50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @82, i32 0, i32 0), i32 1, i32 1, i32 %187, i32 %192) call void @exit(i32 1) unreachable ifcont50: ; preds = %ifcont48 %196 = getelementptr %dimension_descriptor, %dimension_descriptor* %185, i32 0, i32 0 %197 = load i32, i32* %196, align 4 %198 = mul i32 %197, %190 %199 = add i32 0, %198 %200 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 1 %201 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 1 %202 = load i32, i32* %201, align 4 %203 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 2 %204 = load i32, i32* %203, align 4 %205 = sub i32 1, %202 %206 = add i32 %202, %204 %207 = sub i32 %206, 1 %208 = icmp slt i32 1, %202 %209 = icmp sgt i32 1, %207 %210 = or i1 %208, %209 br i1 %210, label %then51, label %ifcont52 then51: ; preds = %ifcont50 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0), i32 1, i32 2, i32 %202, i32 %207) call void @exit(i32 1) unreachable ifcont52: ; preds = %ifcont50 %211 = getelementptr %dimension_descriptor, %dimension_descriptor* %200, i32 0, i32 0 %212 = load i32, i32* %211, align 4 %213 = mul i32 %212, %205 %214 = add i32 %199, %213 %215 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %184, i32 2 %216 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 1 %217 = load i32, i32* %216, align 4 %218 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 2 %219 = load i32, i32* %218, align 4 %220 = sub i32 1, %217 %221 = add i32 %217, %219 %222 = sub i32 %221, 1 %223 = icmp slt i32 1, %217 %224 = icmp sgt i32 1, %222 %225 = or i1 %223, %224 br i1 %225, label %then53, label %ifcont54 then53: ; preds = %ifcont52 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i32 1, i32 3, i32 %217, i32 %222) call void @exit(i32 1) unreachable ifcont54: ; preds = %ifcont52 %226 = getelementptr %dimension_descriptor, %dimension_descriptor* %215, i32 0, i32 0 %227 = load i32, i32* %226, align 4 %228 = mul i32 %227, %220 %229 = add i32 %214, %228 %230 = getelementptr %array, %array* %175, i32 0, i32 1 %231 = load i32, i32* %230, align 4 %232 = add i32 %229, %231 %233 = getelementptr %array, %array* %175, i32 0, i32 0 %234 = load i32*, i32** %233, align 8 %235 = getelementptr inbounds i32, i32* %234, i32 %232 store i32 8, i32* %235, align 4 br label %return return: ; preds = %ifcont54 br label %FINALIZE_SYMTABLE_h FINALIZE_SYMTABLE_h: ; preds = %return ret void } declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-int_01-72c2ff1.stdout0000664000175000017500000000650515141516316025132 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_01: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (RealConstant 3.300000 (Real 4) ) (RealConstant 3.300000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_01 [] [(Print (StringFormat () [(IntrinsicElementalFunction Int [(Var 2 x)] 0 (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntrinsicElementalFunction Int [(Var 2 y)] 0 (Integer 4) (IntegerConstant 7 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-rewind_invalid_kwarg1-54e2b4f.json0000664000175000017500000000077315141516316027743 0ustar alastairalastair{ "basename": "asr-rewind_invalid_kwarg1-54e2b4f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/rewind_invalid_kwarg1.f90", "infile_hash": "1a5966a45bdcff87457415865fdeba35d60b85be63db448a4c1203c9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-rewind_invalid_kwarg1-54e2b4f.stderr", "stderr_hash": "e0c4f2ddc1407c75eeb039d0ad31c950720cdc8effb8614a4fe7ce51", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-optional_01-56b1b65.json0000664000175000017500000000072615141516316025533 0ustar alastairalastair{ "basename": "asr-optional_01-56b1b65", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_01.f90", "infile_hash": "b703b762ac35be7e690936d507787f8757837c9b46e25ddaeb99640b", "outfile": null, "outfile_hash": null, "stdout": "asr-optional_01-56b1b65.stdout", "stdout_hash": "5af267436258c82b32006a89035ee486259d0e044fb81ecfb9c6ba19", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_20-771801a.json0000664000175000017500000000076115141516316026011 0ustar alastairalastair{ "basename": "asr-intrinsics_20-771801a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_20.f90", "infile_hash": "3ea299463f57ee7d2281d80a1fd624c38fd727a70415dda79ee12d6b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_20-771801a.stdout", "stdout_hash": "69eccc41fcc2596baa7c67a8b96917a3e864b35d88cd094ca690bdac", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-7a0ea7d.stderr0000664000175000017500000000016715141516316027362 0ustar alastairalastairsemantic error: Variable 'l' is not declared --> tests/implicit_typing1.f90:2:1 | 2 | L = 3 | ^ 'l' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-external_03-fe60427.json0000664000175000017500000000077515141516316025541 0ustar alastairalastair{ "basename": "asr-external_03-fe60427", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_03.f90", "infile_hash": "82ee198be6d031398277671c0c2f48a832124a1458e94c3317d080ba", "outfile": null, "outfile_hash": null, "stdout": "asr-external_03-fe60427.stdout", "stdout_hash": "77516545eae07d8cf95f10b9240a819031ad9bb8f042d8e57a5c036d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-print3-b6beca0.stdout0000664000175000017500000000004215141516316025414 0ustar alastairalastair x is 24 x is 24 ok ok lfortran-lfortran-2f73434/tests/reference/asr-intrinsics7-d1c02a1.json0000664000175000017500000000073515141516316025723 0ustar alastairalastair{ "basename": "asr-intrinsics7-d1c02a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics7.f90", "infile_hash": "3f4b8cbb7596de01d44dd95ec9e60be72c020b5be99fd530216fa5ce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics7-d1c02a1.stderr", "stderr_hash": "ac7860439cf8bdc12a0648003dd2a87a48b560534a0b08d1db7e0663", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine7-e0b863b.stdout0000664000175000017500000000014615141516316026637 0ustar alastairalastairfunction f(a::Base.RefValue{Int32}, b::Base.RefValue{Int32}) a[] = b[] + 1 b[] = a[] + 1 end lfortran-lfortran-2f73434/tests/reference/asr-nested_namelist_01-7fc4952.json0000664000175000017500000000100015141516316027057 0ustar alastairalastair{ "basename": "asr-nested_namelist_01-7fc4952", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_namelist_01.f90", "infile_hash": "3ae593ad78ac4bbac6d58d1dd1f8ee532e6cf64aef681fa7f311c7e2", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_namelist_01-7fc4952.stdout", "stdout_hash": "e362887b99c6cf5bed3e09cb248b19a4ccde96228f5813b0d53b4dba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_02-404e16e.stdout0000664000175000017500000002124415141516316026626 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @intrinsics_02.x = internal global float 0x3FEFEB7AA0000000 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_sin_f32(float* %x) { .entry: %_lcompilers_sin_f32 = alloca float, align 4 %0 = load float, float* %x, align 4 %1 = call float @_lfortran_ssin(float %0) store float %1, float* %_lcompilers_sin_f32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_sin_f32 FINALIZE_SYMTABLE__lcompilers_sin_f32: ; preds = %return %2 = load float, float* %_lcompilers_sin_f32, align 4 ret float %2 } declare float @_lfortran_ssin(float) define double @_lcompilers_sin_f64(double* %x) { .entry: %_lcompilers_sin_f64 = alloca double, align 8 %0 = load double, double* %x, align 8 %1 = call double @_lfortran_dsin(double %0) store double %1, double* %_lcompilers_sin_f64, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_sin_f64 FINALIZE_SYMTABLE__lcompilers_sin_f64: ; preds = %return %2 = load double, double* %_lcompilers_sin_f64, align 8 ret double %2 } declare double @_lfortran_dsin(double) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value10 = alloca double, align 8 %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %y = alloca double, align 8 store double 0x3FEFEB7A9B2C6D8B, double* %y, align 8 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* @intrinsics_02.x, double* %y) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = load float, float* @intrinsics_02.x, align 4 %14 = fsub float %13, 0x3FEFEB7AA0000000 %15 = call float @llvm.fabs.f32(float %14) %16 = fcmp ogt float %15, 0x3EB0C6F7A0000000 br i1 %16, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then %17 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x) %18 = fsub float %17, 0x3FEAE238A0000000 %19 = call float @llvm.fabs.f32(float %18) %20 = fcmp ogt float %19, 0x3EB0C6F7A0000000 br i1 %20, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %21 = load double, double* %y, align 8 %22 = fsub double %21, 0x3FEFEB7AA0000000 %23 = call double @llvm.fabs.f64(double %22) %24 = fcmp ogt double %23, 0x3E7AD7F2A0000000 br i1 %24, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 br i1 false, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %25 = call double @_lcompilers_sin_f64(double* %y) %26 = load float, float* @intrinsics_02.x, align 4 %27 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x) %28 = fadd float %26, %27 store float %28, float* %call_arg_value, align 4 %29 = call float @_lcompilers_sin_f32(float* %call_arg_value) %30 = fpext float %29 to double %31 = fadd double %25, %30 store double %31, double* %call_arg_value10, align 8 %32 = call double @_lcompilers_sin_f64(double* %call_arg_value10) %33 = fsub double %32, 0x3FEF20DD80000000 %34 = call double @llvm.fabs.f64(double %33) %35 = fcmp ogt double %34, 0x3E7AD7F2A0000000 br i1 %35, label %then11, label %else12 then11: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont9 br label %ifcont13 ifcont13: ; preds = %else12, %then11 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont13 br label %FINALIZE_SYMTABLE_intrinsics_02 FINALIZE_SYMTABLE_intrinsics_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_02-1746f84.stderr0000664000175000017500000000023215141516316030405 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_02.f90:5:10 | 5 | where(1) b = 12121 | ^ lfortran-lfortran-2f73434/tests/reference/asr-template_error_04-16c03e5.stderr0000664000175000017500000000124715141516316027262 0ustar alastairalastairsemantic error: Restriction type mismatch with provided function argument --> tests/errors/template_error_04.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ Restriction's parameter x of type real | 28 | real function func_arg_real(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ Function's parameter x of type integer lfortran-lfortran-2f73434/tests/reference/asr-program_variable-066cc64.json0000664000175000017500000000075415141516316026724 0ustar alastairalastair{ "basename": "asr-program_variable-066cc64", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/program_variable.f90", "infile_hash": "705c0c3c0189cc5dffc2065ba2a142997de885b15b886bb127ec0180", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-program_variable-066cc64.stderr", "stderr_hash": "0e44a8a9d9774693baa8d86077a5a2cabd62602a6931a100bcb3cd43", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-stop_03-897cacd.json0000664000175000017500000000070715141516316025063 0ustar alastairalastair{ "basename": "run-stop_03-897cacd", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/stop_03.f90", "infile_hash": "87d669b34b513b6802c7b254562f8ea915c2a166d298150441398562", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-stop_03-897cacd.stderr", "stderr_hash": "3e23cf1cb50e4b97d71757a6cc871271723a4247df92d3c07b24a0b0", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-select_type1-767380c.json0000664000175000017500000000074415141516316026416 0ustar alastairalastair{ "basename": "ast_f90-select_type1-767380c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/select_type1.f90", "infile_hash": "0484f169388676238c1bdf4ae9e9041b66ca05da7dc95a32c57a6003", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-select_type1-767380c.stdout", "stdout_hash": "7a06481b29b61eb38f12a018d320bf35f47ff7cf3624a9b23b1f2bdf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine9-8ecec78.json0000664000175000017500000000072615141516316026054 0ustar alastairalastair{ "basename": "ast-subroutine9-8ecec78", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine9.f90", "infile_hash": "7936a6a897f4c893828bca05987a6c387bcda279b2ac5f20199ffda3", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine9-8ecec78.stdout", "stdout_hash": "70ff4b1f1c748ff344c2f1067fb05b367850b7d510b15cec05c6a4c5", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.stderrlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_char_lengths-5ba8b29.0000664000175000017500000000034715141516316034162 0ustar alastairalastairsemantic error: Different `character` lengths 1 and 4 in array constructor --> tests/errors/array_constructor_with_different_char_lengths.f90:2:25 | 2 | print *, ["a", "b", "ball", "cat"] | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-fixedform_subroutine2-805f758.stdout0000664000175000017500000000314715141516316030241 0ustar alastairalastair(TranslationUnit [(Program subr2 () [] [] [] [(SubroutineCall 0 my_subr [] [] [] [] () )] [] ) (Subroutine my_subr [] [] () () [] [] [] [] [(Print 0 () [(FuncCallOrArray sxvals [] [] [] [] [] )] () ) (If 0 () (/= (FuncCallOrArray sxvals [] [] [] [] [] ) 4) [(ErrorStop 0 () () () )] [] () () () ) (Return 0 () () )] [(Function sxvals [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 sxvals 4 () ) (Return 0 () () )] [] [] )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_clojure-subroutine1-be16026.json0000664000175000017500000000077415141516316027407 0ustar alastairalastair{ "basename": "asr_clojure-subroutine1-be16026", "cmd": "lfortran --show-asr --no-color --no-indent --clojure {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "asr_clojure-subroutine1-be16026.stdout", "stdout_hash": "13fa0660f16523f661fee5f28b63f7e7178f85ae860253efe77f93b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-complex_01-f07fa9a.stdout0000664000175000017500000000554215141516316026074 0ustar alastairalastair(TranslationUnit [(Program complex_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () (Complex (Real "1.0") (u- (Real "3.0"))) Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrParameter )] [(a [] [] () (Real "3.0") Equal ()) (b [] [] () (Real "4.0") Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(y [] [] () (Complex a b) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeComplex [] () () None ) [(SimpleAttribute AttrParameter )] [(i_ [] [] () (Complex 0 1) Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(z [] [] () (+ a (* i_ b)) Equal ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(w [] [] () (+ (+ a b) (* i_ (- a b))) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Print 0 () [x y z w] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array12-cb81afc.stdout0000664000175000017500000004426315141516316025461 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array12: (Module (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), get_current_directory: (Function (SymbolTable 12 { buffersize: (Variable 12 buffersize [] Local (IntegerConstant 1000 (Integer 4) Decimal) (IntegerConstant 1000 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), cpath: (Variable 12 cpath [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 12 path [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 12 tmp [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_current_directory (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [getcwd] [(Var 12 path)] [(Allocate [((Var 12 cpath) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1000 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 12 tmp) (FunctionCall 2 getcwd () [((ArrayPhysicalCast (Var 12 cpath) DescriptorArray StringArraySinglePointer (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] StringArraySinglePointer ) () )) ((Var 12 buffersize))] (CPtr) () () ) () .false. .false. ) (If () (PointerAssociated (Var 12 tmp) () (Logical 4) () ) [(Print (StringFormat () [(StringConstant "PWD: " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 12 tmp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] () Public .false. .false. () ), getcwd: (Function (SymbolTable 11 { buf: (Variable 11 buf [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) [(() ())] StringArraySinglePointer ) () BindC Public Required .false. .false. .false. () .false. .false. ), bufsize: (Variable 11 bufsize [] In () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), path: (Variable 11 path [] ReturnVar () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ) }) getcwd (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength CChar) [(() ())] StringArraySinglePointer ) (Integer 4)] (CPtr) BindC Interface "getcwd" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 buf) (Var 11 bufsize)] [] (Var 11 path) Public .false. .false. () ) }) array12 () [iso_c_binding array12] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-interface2-98c9adf.stdout0000664000175000017500000000552115141516316026156 0ustar alastairalastair(TranslationUnit [(Module interface2 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (AbstractInterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine read_params [(this) (params)] [] () () [] [(Import [] ImportDefault () )] [] [(Declaration (AttrType TypeClass [] () porous_drag_model None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () parameter_list None ) [(SimpleAttribute AttrPointer ) (AttrIntent In )] [(params [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeaderAssignment) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [SomeProc] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [SomeProc2] [] () ) (InterfaceModuleProcedure [SomeProc3] [] () )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-volatile_02-2beae13.json0000664000175000017500000000075615141516316026046 0ustar alastairalastair{ "basename": "llvm-volatile_02-2beae13", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/volatile_02.f90", "infile_hash": "8e1e2efa590937906428b5c80f2025a351c33f23a5a821a26341ba02", "outfile": null, "outfile_hash": null, "stdout": "llvm-volatile_02-2beae13.stdout", "stdout_hash": "a0887b897cb738eaf462b6c61c1bd0d194de8ab7a5f69f746c4c3830", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-array3-a2f045b.stdout0000664000175000017500000000225715141516316025227 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_3_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 3); f32_3_1 a_value(&a_data); f32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; Kokkos::View b_data("b_data", 3); f32_3_1 b_value(&b_data); f32_3_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 3; a->data = &r; b->data = &r; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/ast-nested_02-68e8526.json0000664000175000017500000000074515141516316025131 0ustar alastairalastair{ "basename": "ast-nested_02-68e8526", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "ast-nested_02-68e8526.stdout", "stdout_hash": "d5993dd76c2694fb55579b390622320488c7a9f0ca5b6389020ee0b3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_54-2dbd7b1.stdout0000664000175000017500000003313715141516316025732 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_54: (Program (SymbolTable 5 { char: (Variable 5 char [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), double: (ExternalSymbol 5 double 2 double string_54_mod [] double Public ), double_: (ExternalSymbol 5 double_ 2 double_ string_54_mod [] double_ Public ), foo_sub: (ExternalSymbol 5 foo_sub 2 foo_sub string_54_mod [] foo_sub Public ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_54 [string_54_mod] [(Assignment (Var 5 x) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 foo_sub () [((Var 5 x)) ((Var 5 char))] () .false. )] ), string_54_mod: (Module (SymbolTable 2 { double: (GenericProcedure 2 double [2 double_] Public ), double_: (Function (SymbolTable 3 { ret: (Variable 3 ret [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) double_ (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 ret) (IntegerBinOp (Var 3 x) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] (Var 3 ret) Public .false. .false. () ), foo_sub: (Function (SymbolTable 4 { char: (Variable 4 char [double_ x] Unspecified () () Default (String 1 (FunctionCall 2 double_ 2 double [((Var 4 x))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) foo_sub (FunctionType [(Integer 4) (String 1 (FunctionCall 2 double_ 2 double [((FunctionParam 0 (Integer 4) () ))] (Integer 4) () () ) ExpressionLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [double_] [(Var 4 x) (Var 4 char)] [] () Public .false. .false. () ) }) string_54_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-Subroutine_Call1-8e53e13.json0000664000175000017500000000074515141516316026567 0ustar alastairalastair{ "basename": "ast-Subroutine_Call1-8e53e13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/Subroutine_Call1.f90", "infile_hash": "bf7f51f810752b3f8e9381f1e100d0c9b3495c2f87cd120a6ee74148", "outfile": null, "outfile_hash": null, "stdout": "ast-Subroutine_Call1-8e53e13.stdout", "stdout_hash": "2bdfc49abf507d5731369b0cc527c5dfe2695c9b2a50c839368ffc4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutines_10-779ade9.json0000664000175000017500000000077715141516316027055 0ustar alastairalastair{ "basename": "ast_f90-subroutines_10-779ade9", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/subroutines_10.f90", "infile_hash": "97868109f521b42642b328d8b79be02e7668b5819dc820880ec85da0", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-subroutines_10-779ade9.stdout", "stdout_hash": "77cac845f90c95ab93e41002c00fcc1be757d153ea2941c75c6690ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_array_04b-94baaad.json0000664000175000017500000000100015141516316027261 0ustar alastairalastair{ "basename": "asr-template_array_04b-94baaad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_04b.f90", "infile_hash": "9a6f4f46fcdcc358803d1376ed48985a450b5c724178f467db07ca61", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_04b-94baaad.stdout", "stdout_hash": "1701af82119eeece621e64df52c1fc5ba013d74b42a58e4c70710ddb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-goto_03-75b98c5.json0000664000175000017500000000073715141516316024700 0ustar alastairalastair{ "basename": "ast-goto_03-75b98c5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_03.f90", "infile_hash": "2a8829b6e334f6c1619d1d9c772f871874336138a9aa68816641754c", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_03-75b98c5.stdout", "stdout_hash": "043b1d9edace238ac68f4735fded4d14956a8653ab79077ac8d1030e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop3-d579f3c.stdout0000664000175000017500000001175515141516316027501 0ustar alastairalastair(TranslationUnit [(Subroutine start1 [(n) (f) (l) (lout)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(f [(1 l DimensionExpr)] [] () () None ()) (one [] [] () () None ()) (two [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [one two] [(Real "1.0") (Real "2.0")] )] () ) (Assignment 0 lout (+ 1 (/ n 2)) () ) (DoLoop 0 () 1 i 1 lout () [(Assignment 1 (FuncCallOrArray f [] [(() i () 0)] [] [] [] ) two () )] () () ) (If 0 () (== (FuncCallOrArray mod [] [(() n () 0) (() 2 () 0)] [] [] [] ) 0) [(Assignment 0 (FuncCallOrArray f [] [(() lout () 0)] [] [] [] ) one () )] [] () () () ) (Return 0 () () )] [] [] ) (Subroutine f [(n)] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 lout () [(Assignment 0 a 1 () ) (DoLoop 0 () 0 j 3 n () [(Assignment 0 b 2 () ) (DoLoop 0 () 4 k 3 n () [(Assignment 0 c 3 () ) (DoLoop 0 () 5 l 3 n () [(Assignment 0 d 4 () ) (Assignment 5 xx 5 () )] () () ) (Assignment 0 e 5 () )] () () ) (Assignment 0 kmn 6 () )] () () ) (Assignment 0 g 8 () ) (Assignment 1 (FuncCallOrArray kmn [] [(() i () 0)] [] [] [] ) two () )] () () ) (Assignment 0 h 9 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutine3-9c6f5d1.stderr0000664000175000017500000000022115141516316026277 0ustar alastairalastairsemantic error: Argument of 'size' must be an array --> tests/errors/subroutine3.f90:5:19 | 5 | print *, size(f) | ^ lfortran-lfortran-2f73434/tests/reference/ast-interface_01-587eedf.stdout0000664000175000017500000001271415141516316026376 0ustar alastairalastair(TranslationUnit [(Module interface_01_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeaderName a ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [a1] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [a2] [(SimpleAttribute AttrModule )] () )] )] [] [(Subroutine a1 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [(Assignment 0 a (+ a 1) () )] [] [] ) (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [(Assignment 0 a (+ a 1) () )] [] [] )] ) (Program interface_01 () [(Use [] interface_01_mod [(UseSymbol a () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(r [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i 5 () ) (SubroutineCall 0 a [] [(() i () 0)] [] [] () ) (If 0 () (/= i 6) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 r 6 () ) (SubroutineCall 0 a [] [(() r () 0)] [] [] () ) (If 0 () (/= r 7) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 i 7 () ) (SubroutineCall 0 a [] [(() i () 0)] [] [] () ) (If 0 () (/= i 8) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-modules_04-a8954ed.stdout0000664000175000017500000000570115141516316026023 0ustar alastairalastair(TranslationUnit [(Module modules_04_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Program modules_04 () [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 f [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] modules_04_a [(UseSymbol b () )] .true. () )] [] [] [] [(SubroutineCall 0 b [] [] [] [] () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] modules_04_a [(UseSymbol b () )] .true. () )] [] [] [] [(SubroutineCall 0 b [] [] [] [] () ) (Assignment 0 g 5 () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutine5-24e8434.json0000664000175000017500000000073515141516316025615 0ustar alastairalastair{ "basename": "asr-subroutine5-24e8434", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine5.f90", "infile_hash": "fb11d5f686b160d1abe5da165bfaa8b25ab42a2b8ebcfc282cb853a7", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine5-24e8434.stderr", "stderr_hash": "1a120ec47f476cea57b29e6a3f33d71b0c6a74582de508b2480e98fb", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_27-11ba39d.json0000664000175000017500000000076115141516316026154 0ustar alastairalastair{ "basename": "asr-intrinsics_27-11ba39d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_27.f90", "infile_hash": "eaa3c2bf4b96b7439c749f9241c0cd49e7c97bc0007423db62d81449", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_27-11ba39d.stdout", "stdout_hash": "055c683a98fe3602dd3baffc45baafcd1d3f28ad277312cf9f9229d9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_binop-415f1fa.json0000664000175000017500000000074015141516316026154 0ustar alastairalastair{ "basename": "asr-string_binop-415f1fa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_binop.f90", "infile_hash": "4e6301859ddd78b04a2a25c7024ec1a91d427fe1e12477c3d337dc6f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_binop-415f1fa.stderr", "stderr_hash": "b5d483b65a65764781e8af477c3eecc912b46d8ad9eb26cdb8d29319", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-do5-4355d03.json0000664000175000017500000000067615141516316024020 0ustar alastairalastair{ "basename": "ast-do5-4355d03", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do5.f90", "infile_hash": "40afe61b24ba33f887c21814d38e1b5657ee19b58338522032a6b678", "outfile": null, "outfile_hash": null, "stdout": "ast-do5-4355d03.stdout", "stdout_hash": "f97e9376b8c615b0d020dabd59ec1cf6b0dfd57186c80e9f3fa2cba7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-max_02-646ff6d.stdout0000664000175000017500000000556515141516316025146 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { max_02: (Program (SymbolTable 2 { y: (Variable 2 y [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) max_02 [] [(Print (StringFormat () [(IntrinsicElementalFunction Max [(Var 2 y) (Cast (Var 2 z) IntegerToInteger (Integer 8) () )] 0 (Integer 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-block_data1-f3dfb1f.stdout0000664000175000017500000000054715141516316027025 0ustar alastairalastairblock data init implicit integer (a-z) common /range/ x0, x1 data x0, x1/1, 10/ end block data init program block_data1 implicit integer (a-z) common /range/ x0, x1 print *, "Printing Even number in the Range: ", x0, " to ", x1 do i = x0, x1 if (mod(i, 2) /= 0) then cycle end if write(*, *) i end do end program block_data1 lfortran-lfortran-2f73434/tests/reference/run-exit2-f1f3b2c.stderr0000664000175000017500000000044015141516316025137 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/exit2.f90:6:12 | 6 | if ( i .eq. 5 ) then | ^^^^ help: write this as '==' warning: Routine `exit` is a non-standard function --> tests/exit2.f90:7:9 | 7 | call exit(2) | ^^^^^^^^^^^^ STOP 2 lfortran-lfortran-2f73434/tests/reference/asr-external_01-6754623.json0000664000175000017500000000077515141516316025402 0ustar alastairalastair{ "basename": "asr-external_01-6754623", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_01.f90", "infile_hash": "7beda56b1f983d450c845bf105e7b376c256981eea408894943b944d", "outfile": null, "outfile_hash": null, "stdout": "asr-external_01-6754623.stdout", "stdout_hash": "71650d19787cb40193fdb26beeec43e408f6b300a8b47f9fab9f0729", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_nested_vars-nested_call_filter_01-5a87413.json0000664000175000017500000000106615141516316032226 0ustar alastairalastair{ "basename": "pass_nested_vars-nested_call_filter_01-5a87413", "cmd": "lfortran --pass=nested_vars --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_call_filter_01.f90", "infile_hash": "8cec6df4b177816ae0e3fe2e6e58db32e27ffa4afb6640cbeabd017e", "outfile": null, "outfile_hash": null, "stdout": "pass_nested_vars-nested_call_filter_01-5a87413.stdout", "stdout_hash": "b908a2ecaec640ee37b440da054b3781305f06c0a44c87eb2ebe4280", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_external_dedup_01-90fba38.stdout0000664000175000017500000002215215141516316030703 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_external_dedup_01: (Program (SymbolTable 2 { outer: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), inner1: (Function (SymbolTable 4 { }) inner1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), inner2: (Function (SymbolTable 5 { }) inner2 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 3 inner1 () [] () .false. ) (SubroutineCall 3 inner2 () [] () .false. )] () Public .false. .false. () ) }) nested_external_dedup_01 [] [(SubroutineCall 2 outer () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_01-e2ed4a5.stdout0000664000175000017500000003565215141516316027173 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 1, i32* %j, align 4 %2 = load i32, i32* %j, align 4 %3 = icmp ne i32 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then call void @f(i32* %i, i32* %j) %4 = alloca i64, align 8 %5 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32* %i, i32* %j) %6 = load i64, i64* %4, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 4 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont call void @_lfortran_free(i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %ifcont %15 = load i32, i32* %i, align 4 %16 = icmp ne i32 %15, 1 br i1 %16, label %then1, label %else2 then1: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %free_done br label %ifcont3 ifcont3: ; preds = %else2, %then1 %17 = load i32, i32* %j, align 4 %18 = icmp ne i32 %17, 2 br i1 %18, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 store i32 1, i32* %j, align 4 %19 = load i32, i32* %j, align 4 %20 = icmp ne i32 %19, 1 br i1 %20, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 store i32 3, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %21 = alloca i64, align 8 %22 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %21, i32 0, i32 0, i32* %j) %23 = load i64, i64* %21, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %22, i8** %24, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %23, i64* %25, align 4 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %27 = load i8*, i8** %26, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %29 = load i64, i64* %28, align 4 %30 = trunc i64 %29 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %27, i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %31 = icmp eq i8* %22, null br i1 %31, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %ifcont9 call void @_lfortran_free(i8* %22) br label %free_done12 free_done12: ; preds = %free_nonnull11, %ifcont9 %32 = load i32, i32* %j, align 4 %33 = icmp ne i32 %32, 4 br i1 %33, label %then13, label %else14 then13: ; preds = %free_done12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %free_done12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i32 1, i32* %j, align 4 %34 = load i32, i32* %j, align 4 %35 = icmp ne i32 %34, 1 br i1 %35, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 store i32 3, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %36 = alloca i64, align 8 %37 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %36, i32 0, i32 0, i32* %j) %38 = load i64, i64* %36, align 4 %stringFormat_desc19 = alloca %string_descriptor, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %37, i8** %39, align 8 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %38, i64* %40, align 4 %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %42 = load i8*, i8** %41, align 8 %43 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %44 = load i64, i64* %43, align 4 %45 = trunc i64 %44 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* %42, i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1) %46 = icmp eq i8* %37, null br i1 %46, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %ifcont18 call void @_lfortran_free(i8* %37) br label %free_done21 free_done21: ; preds = %free_nonnull20, %ifcont18 %47 = load i32, i32* %j, align 4 %48 = icmp ne i32 %47, 4 br i1 %48, label %then22, label %else23 then22: ; preds = %free_done21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %free_done21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 store i32 1, i32* %j, align 4 %49 = load i32, i32* %j, align 4 %50 = icmp ne i32 %49, 1 br i1 %50, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %51 = load i32, i32* %i, align 4 %52 = add i32 %51, 2 store i32 %52, i32* %call_arg_value, align 4 call void @f(i32* %call_arg_value, i32* %j) %53 = alloca i64, align 8 %54 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %53, i32 0, i32 0, i32* %j) %55 = load i64, i64* %53, align 4 %stringFormat_desc28 = alloca %string_descriptor, align 8 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0 store i8* %54, i8** %56, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1 store i64 %55, i64* %57, align 4 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0 %59 = load i8*, i8** %58, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1 %61 = load i64, i64* %60, align 4 %62 = trunc i64 %61 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %59, i32 %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1) %63 = icmp eq i8* %54, null br i1 %63, label %free_done30, label %free_nonnull29 free_nonnull29: ; preds = %ifcont27 call void @_lfortran_free(i8* %54) br label %free_done30 free_done30: ; preds = %free_nonnull29, %ifcont27 %64 = load i32, i32* %j, align 4 %65 = icmp ne i32 %64, 4 br i1 %65, label %then31, label %else32 then31: ; preds = %free_done30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont33 else32: ; preds = %free_done30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont33 br label %FINALIZE_SYMTABLE_subroutines_01 FINALIZE_SYMTABLE_subroutines_01: ; preds = %return ret i32 0 } define void @f(i32* %a, i32* %b) { .entry: %0 = load i32, i32* %a, align 4 %1 = add i32 %0, 1 store i32 %1, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-fn5-3d75eb7.json0000664000175000017500000000067615141516316024170 0ustar alastairalastair{ "basename": "asr-fn5-3d75eb7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn5.f90", "infile_hash": "0f5a55688443ee8c8f4f70a1f78d616d25b3c2647bed1fd7ba267f51", "outfile": null, "outfile_hash": null, "stdout": "asr-fn5-3d75eb7.stdout", "stdout_hash": "7474938d7724b3d73f750673d0a02c774704856a3ea51f2b3bdcb87b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_13-e4a94c8.json0000664000175000017500000000074315141516316027643 0ustar alastairalastair{ "basename": "run-array_bounds_check_13-e4a94c8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_13.f90", "infile_hash": "23ed573cd7e5506c5ef4cb8c5ae9b56bb5d63342912e2ced76bb3674", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_13-e4a94c8.stderr", "stderr_hash": "de3f4c719301af35fbb51b89c907ead1023414fa0235335fbde13016", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-dim_assgn_test-2643606.stdout0000664000175000017500000000566715141516316026633 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dim_assgn_test: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) dim_assgn_test [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_02-48f3a02.json0000664000175000017500000000107415141516316025331 0ustar alastairalastair{ "basename": "ast_f90-goto_02-48f3a02", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/goto_02.f90", "infile_hash": "2bd2e5ad2c2506c3da506b82aa7d12c7877206410c2d7637f556d10b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-goto_02-48f3a02.stdout", "stdout_hash": "8fb675472ef67d02eecf5f4995edbecbfcd987589eef60972fa4cc78", "stderr": "ast_f90-goto_02-48f3a02.stderr", "stderr_hash": "317795e3eb8121d18463c9531b060be0c248a0b34d70a2961d6d2047", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_shape_05-429216b.json0000664000175000017500000000071615141516316026145 0ustar alastairalastair{ "basename": "run-array_shape_05-429216b", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_shape_05.f90", "infile_hash": "275313a71e6777c0d439f8f5c29d24c89ad089be510848d42db10643", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_shape_05-429216b.stderr", "stderr_hash": "7099b86368d5ae07feaaeee5788ca9ca6c60a5a160c80aaffa0b6ef6", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-entry1-3075e81.stdout0000664000175000017500000002710215141516316025120 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { entry1: (Program (SymbolTable 2 { dummy: (Variable 2 dummy [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) entry1 [] [(Assignment (Var 2 dummy) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 10.000000 (Real 4) ) ) () .false. .false. ) (SubroutineCall 1 x () [((Var 2 dummy))] () .false. ) (SubroutineCall 1 y () [((Var 2 dummy))] () .false. )] ), x: (Function (SymbolTable 3 { dummy: (Variable 3 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 3 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 3 dummy))] () .false. )] () Public .false. .false. () ), x_main__lcompilers: (Function (SymbolTable 5 { dummy: (Variable 5 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), entry__lcompilers: (Variable 5 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) x_main__lcompilers (FunctionType [(Integer 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 entry__lcompilers) (Var 5 dummy)] [(If () (IntegerCompare (Var 5 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 5 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Print (StringFormat () [(StringConstant "Printed using subroutine call: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 dummy) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Return) (GoToTarget 2 2 ) (Print (StringFormat () [(StringConstant "Printed using entry statement: " (String 1 (IntegerConstant 31 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 dummy)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Return)] () Public .false. .false. () ), y: (Function (SymbolTable 4 { dummy: (Variable 4 dummy [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) y (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [x_main__lcompilers] [(Var 4 dummy)] [(SubroutineCall 1 x_main__lcompilers 1 x_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((Var 4 dummy))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-functions_41-1e43fd0.json0000664000175000017500000000075615141516316026003 0ustar alastairalastair{ "basename": "ast-functions_41-1e43fd0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_41.f90", "infile_hash": "85251751a2389037443a86b523b90e5db508759f889cdf5413aab330", "outfile": null, "outfile_hash": null, "stdout": "ast-functions_41-1e43fd0.stdout", "stdout_hash": "f35d6094905818061debe81c3afcc9d2fe65e2c68b6e559c180c31ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_24-996af24.json0000664000175000017500000000075015141516316025372 0ustar alastairalastair{ "basename": "asr-modules_24-996af24", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_24.f90", "infile_hash": "cc2ada95991347eeecc7b723bd8553ddb59fa5da19b420154a4d66bc", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_24-996af24.stdout", "stdout_hash": "4465ef7f0d81f8820756591faf3bd4f6451fe5475fd64d3417f110ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-integer_overflow-3cf26f8.stdout0000664000175000017500000000002615141516316027436 0ustar alastairalastairRead integer: 2719 lfortran-lfortran-2f73434/tests/reference/ast-defop1-f87dd80.json0000664000175000017500000000070715141516316024657 0ustar alastairalastair{ "basename": "ast-defop1-f87dd80", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/defop1.f90", "infile_hash": "78b29077fdb7303bc8002ba7f16a36ffa13a981527f87df53bf268e3", "outfile": null, "outfile_hash": null, "stdout": "ast-defop1-f87dd80.stdout", "stdout_hash": "a407b773da29a71a0f9991ffecdf946ecee8d8126b3a17d7407ea861", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07-e57f5fc.json0000664000175000017500000000075715141516316027116 0ustar alastairalastair{ "basename": "asr-template_error_07-e57f5fc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07.f90", "infile_hash": "457f8cc7d8a3e6c63b446a8f446e911d4c57b89692e0abe4448ed31b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07-e57f5fc.stderr", "stderr_hash": "a6a43a0c3ac0c2f0d3917a73e56c56fbf38551314cdda44397599cb0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-coarrays_01-9ca4565.json0000664000175000017500000000074115141516316026214 0ustar alastairalastair{ "basename": "ast_f90-coarrays_01-9ca4565", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/coarrays_01.f90", "infile_hash": "933ef6b85aed33b834bb7b03ae1f635e2b6e4fd18eb8ec999593251f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-coarrays_01-9ca4565.stdout", "stdout_hash": "0265ac1072c55f5283c9fe82bac7a361de3c6e094dd3dbd9490d75d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_01-713dbcf.stderr0000664000175000017500000000044215141516316030236 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'x'. Tried to match size 10 of dimension 1 of LHS with size 3 of dimension 1 of RHS. Use '--realloc-lhs-arrays' option to reallocate LHS automatically. --> tests/errors/array_bounds_check_01.f90:5:5 | 5 | x = [1, 2, 3] | ^ lfortran-lfortran-2f73434/tests/reference/ast-modules_03-6fa1dfa.json0000664000175000017500000000075015141516316025575 0ustar alastairalastair{ "basename": "ast-modules_03-6fa1dfa", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_03.f90", "infile_hash": "0c943eab704cb3c04401d75522945962b53fc359340751a6477fc221", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_03-6fa1dfa.stdout", "stdout_hash": "30688651441a6be083e89efd79d54fa6d18d6783741e71df039676d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-derived_type_06-2623a81.stderr0000664000175000017500000000027615141516316026663 0ustar alastairalastairsemantic error: The expression with derived types contains two or more arrays. --> tests/errors/derived_type_06.f90:14:5 | 14 | main_arr%arr_2%num = 22 | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-fixedform_nestedloop_implicit-7cd720b.json0000664000175000017500000000102715141516316031572 0ustar alastairalastair{ "basename": "ast-fixedform_nestedloop_implicit-7cd720b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_nestedloop_implicit.f", "infile_hash": "5d7a5783286aa1c1fea858b0adca8da970b6e65cbb756e056792ca02", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_nestedloop_implicit-7cd720b.stdout", "stdout_hash": "8cde7a95e3239322c22dbcb3ff489e30a0369aa3e91dfeaa9f162898", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-logical4-b4e6b33.json0000664000175000017500000000074515141516316025350 0ustar alastairalastair{ "basename": "llvm-logical4-b4e6b33", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical4-b4e6b33.stdout", "stdout_hash": "c156c8c5d50b0a4ea1f6b46e7b91129b6dca8f1e08ac32fc9e2e5ca5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dint_args-0823aa1.json0000664000175000017500000000072715141516316025346 0ustar alastairalastair{ "basename": "asr-dint_args-0823aa1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dint_args.f90", "infile_hash": "2070168962f7bf0a98cb987d443506650737beb6909ff2319b0ab779", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dint_args-0823aa1.stderr", "stderr_hash": "2ef1e87d1dd172a51e033ddada381c518c2e6f939ed7e3222a24225b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-where_02-95cf592.stdout0000664000175000017500000002564115141516316025411 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (Where (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-expr4-2704d50.stdout0000664000175000017500000000034615141516316024734 0ustar alastairalastair(TranslationUnit [(Real "5.") (+ (Real "5.") (Real "3.")) (* (+ (Real "5.") (Real "3.")) (Real "2.")) (+ (Real "5.") (* (Real "3.") (Real "2."))) (- (Real "5.") (Real "3.")) (** (Real "4.") (Real "3."))] ) lfortran-lfortran-2f73434/tests/reference/asr-conv_complex2real-0c17eca.stdout0000664000175000017500000001076315141516316027534 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { conv_complex2real: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) conv_complex2real [] [(Assignment (Var 2 z) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (Cast (Cast (Var 2 z) ComplexToReal (Real 8) () ) RealToReal (Real 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing4-df7d614.json0000664000175000017500000000077615141516316026770 0ustar alastairalastair{ "basename": "asr-implicit_typing4-df7d614", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_typing4.f90", "infile_hash": "21dfe09305df396a4254e7b1f818acbac4b158b5731a58805794efda", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing4-df7d614.stderr", "stderr_hash": "0e5bf83cfac5959bd16ca0216ed0f276a9f0a153dbe877e08c0a04c9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-implicit_interface_04-9b6786e.stdout0000664000175000017500000003571615141516316030330 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [4 x i8] c"arr\00", align 1 @3 = private unnamed_addr constant [190 x i8] c"At 13:18 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @9 = private unnamed_addr constant [189 x i8] c"At 20:5 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @13 = private unnamed_addr constant [189 x i8] c"At 21:5 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [5 x i8] c"arr1\00", align 1 @17 = private unnamed_addr constant [189 x i8] c"At 22:5 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.b = internal global [3 x i32] zeroinitializer @main.n = internal global i32 3 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [189 x i8] c"At 3:12 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @23 = private unnamed_addr constant [189 x i8] c"At 3:12 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [189 x i8] c"At 3:12 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [7 x i8] c"driver\00", align 1 @27 = private unnamed_addr constant [212 x i8] c"At 6:39 of file tests/../integration_tests/implicit_interface_04.f90\0ARuntime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__1_k = alloca i32, align 4 store i32 1, i32* %__1_k, align 4 %2 = load i32, i32* %__1_k, align 4 %3 = sub i32 %2, 1 %4 = mul i32 1, %3 %5 = add i32 0, %4 %6 = icmp slt i32 %2, 1 %7 = icmp sgt i32 %2, 3 %8 = or i1 %6, %7 br i1 %8, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 %2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %9 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i32 %5 store i32 10, i32* %9, align 4 store i32 2, i32* %__1_k, align 4 %10 = load i32, i32* %__1_k, align 4 %11 = sub i32 %10, 1 %12 = mul i32 1, %11 %13 = add i32 0, %12 %14 = icmp slt i32 %10, 1 %15 = icmp sgt i32 %10, 3 %16 = or i1 %14, %15 br i1 %16, label %then1, label %ifcont2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 %10, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %ifcont %17 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i32 %13 store i32 20, i32* %17, align 4 store i32 3, i32* %__1_k, align 4 %18 = load i32, i32* %__1_k, align 4 %19 = sub i32 %18, 1 %20 = mul i32 1, %19 %21 = add i32 0, %20 %22 = icmp slt i32 %18, 1 %23 = icmp sgt i32 %18, 3 %24 = or i1 %22, %23 br i1 %24, label %then3, label %ifcont4 then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 %18, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont4: ; preds = %ifcont2 %25 = getelementptr [3 x i32], [3 x i32]* @main.b, i32 0, i32 %21 store i32 30, i32* %25, align 4 %26 = load i32, i32* @main.n, align 4 %27 = icmp slt i32 3, %26 br i1 %27, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([212 x i8], [212 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @26, i32 0, i32 0), i32 3, i32 1, i32 2, i32 %26) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 call void @driver(void (i32*, i32*, i32*)* @implicit_interface_check, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @main.b, i32 0, i32 0), i32* @main.n) call void @_lpython_free_argv() br label %return return: ; preds = %ifcont6 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } define void @driver(void (i32*, i32*, i32*)* %fnc, i32* %arr, i32* %m) { .entry: %0 = alloca i64, align 8 %1 = alloca float, align 4 store float 1.000000e+00, float* %1, align 4 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, float* %1) %3 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = load i32, i32* %m, align 4 %13 = add i32 1, %12 %14 = sub i32 %13, 1 %15 = icmp sgt i32 3, %14 %16 = or i1 false, %15 br i1 %16, label %then, label %ifcont then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @2, i32 0, i32 0), i32 3, i32 1, i32 1, i32 %14) call void @exit(i32 1) unreachable ifcont: ; preds = %free_done %17 = mul i32 1, %12 %18 = getelementptr inbounds i32, i32* %arr, i32 2 call void %fnc(i32* %arr, i32* %m, i32* %18) br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_driver FINALIZE_SYMTABLE_driver: ; preds = %return ret void } declare void @fnc(i32*, i32*, i32*) define void @implicit_interface_check(i32* %arr1, i32* %m, i32* %c) { .entry: %0 = load i32, i32* %m, align 4 %1 = icmp ne i32 %0, 3 br i1 %1, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %2 = load i32, i32* %c, align 4 %3 = icmp ne i32 %2, 30 br i1 %3, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %4 = load i32, i32* %m, align 4 %5 = add i32 1, %4 %6 = sub i32 %5, 1 %7 = icmp sgt i32 1, %6 %8 = or i1 false, %7 br i1 %8, label %then4, label %ifcont5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @8, i32 0, i32 0), i32 1, i32 1, i32 1, i32 %6) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 %9 = mul i32 1, %4 %10 = getelementptr inbounds i32, i32* %arr1, i32 0 %11 = load i32, i32* %10, align 4 %12 = icmp ne i32 %11, 10 br i1 %12, label %then6, label %else7 then6: ; preds = %ifcont5 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont8 else7: ; preds = %ifcont5 br label %ifcont8 ifcont8: ; preds = %else7, %then6 %13 = load i32, i32* %m, align 4 %14 = add i32 1, %13 %15 = sub i32 %14, 1 %16 = icmp sgt i32 2, %15 %17 = or i1 false, %16 br i1 %17, label %then9, label %ifcont10 then9: ; preds = %ifcont8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @12, i32 0, i32 0), i32 2, i32 1, i32 1, i32 %15) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %18 = mul i32 1, %13 %19 = getelementptr inbounds i32, i32* %arr1, i32 1 %20 = load i32, i32* %19, align 4 %21 = icmp ne i32 %20, 20 br i1 %21, label %then11, label %else12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont13 else12: ; preds = %ifcont10 br label %ifcont13 ifcont13: ; preds = %else12, %then11 %22 = load i32, i32* %m, align 4 %23 = add i32 1, %22 %24 = sub i32 %23, 1 %25 = icmp sgt i32 3, %24 %26 = or i1 false, %25 br i1 %26, label %then14, label %ifcont15 then14: ; preds = %ifcont13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([189 x i8], [189 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @16, i32 0, i32 0), i32 3, i32 1, i32 1, i32 %24) call void @exit(i32 1) unreachable ifcont15: ; preds = %ifcont13 %27 = mul i32 1, %22 %28 = getelementptr inbounds i32, i32* %arr1, i32 2 %29 = load i32, i32* %28, align 4 %30 = icmp ne i32 %29, 30 br i1 %30, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 br label %return return: ; preds = %ifcont18 br label %FINALIZE_SYMTABLE_implicit_interface_check FINALIZE_SYMTABLE_implicit_interface_check: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_logical-f19a63d.json0000664000175000017500000000100015141516316027133 0ustar alastairalastair{ "basename": "llvm-arrays_01_logical-f19a63d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_logical.f90", "infile_hash": "494cd2aba8ceee4c9a0bddba4b51d7a4b0b3f817d92e8c0894e4b08b", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_logical-f19a63d.stdout", "stdout_hash": "c3d13e474bcbcb72e9c216759b51b520988991a26d225fa2e8f6e241", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_struct_01-c320d7d.stdout0000664000175000017500000023312015141516316027546 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_struct_01: (Program (SymbolTable 15 { r: (ExternalSymbol 15 r 2 r template_struct_01_m [] r Public ), struct_t: (ExternalSymbol 15 struct_t 2 struct_t template_struct_01_m [] struct_t Public ), test_template: (ExternalSymbol 15 test_template 2 test_template template_struct_01_m [] test_template Public ) }) template_struct_01 [template_struct_01_m] [(SubroutineCall 15 test_template () [] () .false. )] ), template_struct_01_m: (Module (SymbolTable 2 { r: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t] [] ), struct_t: (Template (SymbolTable 4 { get_fst: (Function (SymbolTable 6 { 1_tuple_fst: (ExternalSymbol 6 1_tuple_fst 5 fst tuple [] fst Public ), p: (Variable 6 p [] In () () Default (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) 4 tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_fst (FunctionType [(StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 p)] [(Assignment (Var 6 r) (StructInstanceMember (Var 6 p) 6 1_tuple_fst (TypeParameter t ) () ) () .false. .false. )] (Var 6 r) Private .false. .false. () ), get_snd: (Function (SymbolTable 7 { 1_tuple_snd: (ExternalSymbol 7 1_tuple_snd 5 snd tuple [] snd Public ), p: (Variable 7 p [] In () () Default (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) 4 tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 7 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_snd (FunctionType [(StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 p)] [(Assignment (Var 7 r) (StructInstanceMember (Var 7 p) 7 1_tuple_snd (TypeParameter t ) () ) () .false. .false. )] (Var 7 r) Private .false. .false. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), tuple: (Struct (SymbolTable 5 { fst: (Variable 5 fst [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), snd: (Variable 5 snd [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) tuple (StructType [(TypeParameter t ) (TypeParameter t )] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () ) }) struct_t [t] [(Require r [t] )] ), test_template: (Function (SymbolTable 8 { 1_int_tuple_fst: (ExternalSymbol 8 1_int_tuple_fst 9 fst int_tuple [] fst Public ), 1_int_tuple_snd: (ExternalSymbol 8 1_int_tuple_snd 9 snd int_tuple [] snd Public ), 1_real_tuple_fst: (ExternalSymbol 8 1_real_tuple_fst 12 fst real_tuple [] fst Public ), 1_real_tuple_snd: (ExternalSymbol 8 1_real_tuple_snd 12 snd real_tuple [] snd Public ), get_int_fst: (Function (SymbolTable 10 { 1_int_tuple_fst: (ExternalSymbol 10 1_int_tuple_fst 9 fst int_tuple [] fst Public ), p: (Variable 10 p [] In () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 10 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_int_fst (FunctionType [(StructType [] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 p)] [(Assignment (Var 10 r) (StructInstanceMember (Var 10 p) 10 1_int_tuple_fst (Integer 4) () ) () .false. .false. )] (Var 10 r) Private .false. .false. () ), get_int_snd: (Function (SymbolTable 11 { 1_int_tuple_snd: (ExternalSymbol 11 1_int_tuple_snd 9 snd int_tuple [] snd Public ), p: (Variable 11 p [] In () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 11 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_int_snd (FunctionType [(StructType [] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 p)] [(Assignment (Var 11 r) (StructInstanceMember (Var 11 p) 11 1_int_tuple_snd (Integer 4) () ) () .false. .false. )] (Var 11 r) Private .false. .false. () ), get_real_fst: (Function (SymbolTable 13 { 1_real_tuple_fst: (ExternalSymbol 13 1_real_tuple_fst 12 fst real_tuple [] fst Public ), p: (Variable 13 p [] In () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 13 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_real_fst (FunctionType [(StructType [] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 p)] [(Assignment (Var 13 r) (StructInstanceMember (Var 13 p) 13 1_real_tuple_fst (Real 4) () ) () .false. .false. )] (Var 13 r) Private .false. .false. () ), get_real_snd: (Function (SymbolTable 14 { 1_real_tuple_snd: (ExternalSymbol 14 1_real_tuple_snd 12 snd real_tuple [] snd Public ), p: (Variable 14 p [] In () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 14 r [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) get_real_snd (FunctionType [(StructType [] [] .true. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 p)] [(Assignment (Var 14 r) (StructInstanceMember (Var 14 p) 14 1_real_tuple_snd (Real 4) () ) () .false. .false. )] (Var 14 r) Private .false. .false. () ), int_tuple: (Struct (SymbolTable 9 { fst: (Variable 9 fst [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), snd: (Variable 9 snd [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) int_tuple (StructType [] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () ), real_tuple: (Struct (SymbolTable 12 { fst: (Variable 12 fst [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), snd: (Variable 12 snd [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) real_tuple (StructType [] [] .true. .false. ) [] [fst snd] [] Source Private .false. .false. [] () () ), ti: (Variable 8 ti [] Local () () Default (StructType [] [] .true. .false. ) 8 int_tuple Source Private Required .false. .false. .false. () .false. .false. ), tr: (Variable 8 tr [] Local () () Default (StructType [] [] .true. .false. ) 8 real_tuple Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (StructInstanceMember (Var 8 ti) 8 1_int_tuple_fst (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "First element: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_int_fst () [((Var 8 ti))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 ti) 8 1_int_tuple_snd (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "Second element: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_int_snd () [((Var 8 ti))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 tr) 8 1_real_tuple_fst (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "First element: " (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_real_fst () [((Var 8 tr))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 8 tr) 8 1_real_tuple_snd (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Second element: " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 get_real_snd () [((Var 8 tr))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_struct_01_m () [template_struct_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-types_05-884adc8.json0000664000175000017500000000072515141516316025154 0ustar alastairalastair{ "basename": "wat-types_05-884adc8", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "wat-types_05-884adc8.stdout", "stdout_hash": "d71de8325c328b52541209526dc333fa1b2ac78d7ba72fe38166c57a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-ifix_01-ed76fb2.json0000664000175000017500000000072115141516316025005 0ustar alastairalastair{ "basename": "asr-ifix_01-ed76fb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/ifix_01.f90", "infile_hash": "071fd2fff88805039bb2f2d28c599704b137261b241efff1c3b430c4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-ifix_01-ed76fb2.stderr", "stderr_hash": "e6d710cdb171f37dab07ebfa92cdf7645d94c0964a4d338d63d7f75f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_disable_warnings-save4-99c3220.stdout0000664000175000017500000001236615141516316030320 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save4: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { x: (Variable 3 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (IntegerCompare (Var 3 x) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "x is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] () Public .false. .false. () ), y: (Variable 2 y [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save4 [] [(If () (IntegerCompare (Var 2 y) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "y is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-min_01-aa661b0.stdout0000664000175000017500000011542115141516316025107 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { min_min: (Program (SymbolTable 2 { int_inp1: (Variable 2 int_inp1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), int_inp2: (Variable 2 int_inp2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), output_amin0: (Variable 2 output_amin0 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), output_amin1: (Variable 2 output_amin1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), output_dmin1: (Variable 2 output_dmin1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), output_min: (Variable 2 output_min [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), output_min0: (Variable 2 output_min0 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), output_min1: (Variable 2 output_min1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), output_min_different_kinds: (Variable 2 output_min_different_kinds [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp1: (Variable 2 real_inp1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp2: (Variable 2 real_inp2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp3: (Variable 2 real_inp3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp4: (Variable 2 real_inp4 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp5: (Variable 2 real_inp5 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), real_inp6: (Variable 2 real_inp6 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) min_min [] [(Assignment (Var 2 real_inp1) (RealConstant 5.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp2) (RealConstant 10.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp3) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 real_inp4) (RealConstant 10.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 int_inp1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 int_inp2) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 real_inp5) (RealConstant 5.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 real_inp6) (RealConstant 9.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 output_min) (IntrinsicElementalFunction Min [(Var 2 real_inp1) (Var 2 real_inp2)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_min) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) GtE (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_min) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min0) (IntrinsicElementalFunction Min [(Var 2 int_inp1) (Var 2 int_inp2)] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min0)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 output_min0) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Integer 4) (Var 2 output_min0) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_amin0) (Cast (IntrinsicElementalFunction Min [(Var 2 int_inp1) (Var 2 int_inp2)] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_amin0)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_amin0) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 4) (Var 2 output_amin0) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min1) (Cast (IntrinsicElementalFunction Min [(Var 2 real_inp3) (Var 2 real_inp4)] 0 (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 output_min1) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Integer 4) (Var 2 output_min1) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_amin1) (IntrinsicElementalFunction Min [(Var 2 real_inp3) (Var 2 real_inp4)] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_amin1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_amin1) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 4) (Var 2 output_amin1) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_dmin1) (IntrinsicElementalFunction Min [(Var 2 real_inp1) (Var 2 real_inp1)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_dmin1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_dmin1) Sub (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) GtE (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_dmin1) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] ) (Assignment (Var 2 output_min_different_kinds) (IntrinsicElementalFunction Min [(Var 2 real_inp5) (Cast (Var 2 real_inp6) RealToReal (Real 8) () )] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 output_min_different_kinds)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 output_min_different_kinds) Sub (RealConstant 5.200000 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (TypeInquiry Kind (Real 8) (Var 2 output_min_different_kinds) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop (StringConstant "Incorrect kind for min" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-int_dp-41a64fa.stdout0000664000175000017500000000556415141516316025315 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { int_dp: (Program (SymbolTable 2 { u: (Variable 2 u [] Local (IntegerConstant 2147483647 (Integer 4) Decimal) (IntegerConstant 2147483647 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local (Cast (IntegerConstant 2147483647 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2147483647 (Integer 8) Decimal) ) (IntegerConstant 2147483647 (Integer 8) Decimal) Save (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_dp [] [(Print (StringFormat () [(Var 2 u) (Var 2 v)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_goto_select-a0c3483.json0000664000175000017500000000100215141516316030076 0ustar alastairalastair{ "basename": "asr-fixed_form_goto_select-a0c3483", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_goto_select.f", "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_goto_select-a0c3483.stdout", "stdout_hash": "185f33bbf6cd69c85dae746373d3cf5ac08c7fd15bc3152265fa043d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-substring_endidx-0f7e2c9.stderr0000664000175000017500000000024115141516316027370 0ustar alastairalastairsemantic error: Substring end index at must be of type integer --> tests/errors/substring_endidx.f90:4:17 | 4 | print*, s(1:5.2) | ^^^ lfortran-lfortran-2f73434/tests/reference/ast-auxiliary_IO_1-36af6ad.json0000664000175000017500000000076515141516316026371 0ustar alastairalastair{ "basename": "ast-auxiliary_IO_1-36af6ad", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/auxiliary_IO_1.f", "infile_hash": "6be10531c17bcd0a753784768cbd756393fcb08d05bae273201dbe30", "outfile": null, "outfile_hash": null, "stdout": "ast-auxiliary_IO_1-36af6ad.stdout", "stdout_hash": "11976ffa040614bba3d9fa046092e4b2a24f52a71271a9ae54b7f03d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-expr2-6f9abe8.stdout0000664000175000017500000000074015141516316025352 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 8, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %0 } lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err1-3303e2d.stderr0000664000175000017500000000025715141516316027710 0ustar alastairalastairC preprocessor error: factor(): The expression is not complete, expecting integer, name, +, - or ( --> tests/errors/cpp_err1.f90:4:13 | 4 | #if 2 < 1+2+ | ^ lfortran-lfortran-2f73434/tests/reference/asr-kwargs_02-1588831.stdout0000664000175000017500000004125315141516316025425 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kwargs_02: (Program (SymbolTable 6 { }) kwargs_02 [] [] ), kwargs_02_stdlib_logger: (Module (SymbolTable 2 { add_log_file: (Function (SymbolTable 4 { 1_logger_type_log_io_error: (ExternalSymbol 4 1_logger_type_log_io_error 3 log_io_error logger_type [] log_io_error Public ), filename: (Variable 4 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] InOut () () Default (StructType [] [] .false. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 4 unit [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) add_log_file (FunctionType [(StructType [] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 filename) (Var 4 unit)] [(SubroutineCall 4 1_logger_type_log_io_error () [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self) .false. )] () Public .false. .false. () ), log_io_error: (Function (SymbolTable 5 { code: (Variable 5 code [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), filename: (Variable 5 filename [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), self: (Variable 5 self [] InOut () () Default (StructType [] [] .false. .false. ) 2 logger_type Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 5 unit [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) log_io_error (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] () Public .false. .false. () ), logger_type: (Struct (SymbolTable 3 { add_log_file: (StructMethodDeclaration 3 add_log_file self add_log_file 2 add_log_file Source .false. .false. ), log_io_error: (StructMethodDeclaration 3 log_io_error self log_io_error 2 log_io_error Source .false. .false. ) }) logger_type (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ) }) kwargs_02_stdlib_logger () [kwargs_02_stdlib_logger] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dimension_attr-1c00ad6.json0000664000175000017500000000075215141516316026470 0ustar alastairalastair{ "basename": "asr-dimension_attr-1c00ad6", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr.f", "infile_hash": "94df0a120cc268f419253b89bd601cc62c0c40b1ff86e8eb05849b4b", "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr-1c00ad6.stdout", "stdout_hash": "da84a573e06413cc799632718080a01bc45408f6377f4f51fabed2f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-allocated_05-d9e0943.json0000664000175000017500000000071015141516316025661 0ustar alastairalastair{ "basename": "run-allocated_05-d9e0943", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocated_05.f90", "infile_hash": "06e26c9602e3608378d62fe2e84bb74ddd344d2d5c988fe08778dbce", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocated_05-d9e0943.stderr", "stderr_hash": "8a80dbd437cbd75ad29730d8845d3bcaef6715569481205a56be5276", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_14-302666f.stdout0000664000175000017500000007564715141516316026410 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_14: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k1: (Variable 2 k1 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k10: (Variable 2 k10 [] Local (IntrinsicElementalFunction SelectedCharKind [(StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k11: (Variable 2 k11 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k12: (Variable 2 k12 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k2: (Variable 2 k2 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k3: (Variable 2 k3 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 8) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k4: (Variable 2 k4 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k5: (Variable 2 k5 [] Local (IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 10 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k6: (Variable 2 k6 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k7: (Variable 2 k7 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k8: (Variable 2 k8 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 8) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k9: (Variable 2 k9 [] Local (IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 2 s1 [] Local () () Default (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_14 [] [(Assignment (Var 2 s1) (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 i1) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 5 (Integer 8) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(IntegerConstant 10 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k5)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k6)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k7)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 8) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k9)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedCharKind [(StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (Var 2 k10)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedIntKind [(Var 2 i1)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(Var 2 i1) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedCharKind [(Var 2 s1)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (Var 2 k11)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntrinsicElementalFunction SelectedRealKind [(IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (Var 2 k12)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-block1-ff0f95d.stdout0000664000175000017500000000464715141516316025313 0ustar alastairalastair(TranslationUnit [(Program block1 (TriviaNode [] [(EndOfLine) (Comment "! The variable B is implicitly declared in the scoping unit of the main program." ) (Comment "! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct." ) (Comment "! If the IMPORT, NONE statement is replaced with the IMPORT statement in the" ) (Comment "! comment, the program is conformant." )] ) [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ())] (TriviaNode [] [(EndOfLine) (Comment "! TODO: Fix this test case" )] ) )] [(Block 0 () [] [] [] [(Assignment 0 B 10 () ) (Print 0 () [B] () ) (If 0 () (== B 10) [(Print 0 () [(String "pass" ())] () )] [] () () () )] (TriviaNode [] [(EndOfLine) (Comment "! use mod, only: example" ) (Comment "! import, none" ) (Comment "! !import, only: B" )] ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope8-95c3673.json0000664000175000017500000000101415141516316031002 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope8-95c3673", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope8-95c3673.stdout", "stdout_hash": "681a07a559d57d70af5f38c33bb790512df5391f5713bd2fd2e92b3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-reserved_01-566a18c.json0000664000175000017500000000076615141516316026214 0ustar alastairalastair{ "basename": "ast_f90-reserved_01-566a18c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/reserved_01.f90", "infile_hash": "8f2d369e0f1a924d90eacfcc549441b5c9e0b56d89b4fda9164c8a84", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-reserved_01-566a18c.stdout", "stdout_hash": "1c7b4aef3fe18355b47331689f63c8c3a466a0d1d3fc8473bc6d4cba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_08-52825a6.json0000664000175000017500000000101715141516316030055 0ustar alastairalastair{ "basename": "asr-operator_overloading_08-52825a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_08.f90", "infile_hash": "5acb071582afc132942154d54a27349e2c92072962ccc8e3699a6187", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_08-52825a6.stdout", "stdout_hash": "c8f35366d2b4bfa6f3f73ab9eb34113a43654a94cd30966c61771f05", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-real_dp_01-e53c6fb.json0000664000175000017500000000075315141516316025644 0ustar alastairalastair{ "basename": "llvm-real_dp_01-e53c6fb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_01.f90", "infile_hash": "96dcdc6844b049f189b110b997c4e4f840afa6ff1cd1da7e03f80d79", "outfile": null, "outfile_hash": null, "stdout": "llvm-real_dp_01-e53c6fb.stdout", "stdout_hash": "13e8195535217d3908839aef55d041ce58cc5d945bd0e2c84e0368e7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cmd_01-e172099.stdout0000664000175000017500000001204315141516316024743 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_get_command_argument: (Program (SymbolTable 2 { arg: (Variable 2 arg [] Local () () Default (String 1 (IntegerConstant 32 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), count: (Variable 2 count [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_get_command_argument [] [(Assignment (Var 2 count) (IntrinsicElementalFunction CommandArgumentCount [] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "count: " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 count)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (IntrinsicImpureSubroutine GetCommandArgument [(Var 2 i) (Var 2 arg)] 1 ) (Print (StringFormat () [(IntrinsicElementalFunction StringTrim [(Var 2 arg)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-max_02-646ff6d.json0000664000175000017500000000105115141516316024557 0ustar alastairalastair{ "basename": "asr-max_02-646ff6d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/max_02.f90", "infile_hash": "bd78accf5e71c42d049416709f9c7e4f8e68f8f78e66bb1a5a47834a", "outfile": null, "outfile_hash": null, "stdout": "asr-max_02-646ff6d.stdout", "stdout_hash": "75833c9f67e77921339081fca93ce0f41d345174e74969a1decf8f75", "stderr": "asr-max_02-646ff6d.stderr", "stderr_hash": "64e91c42f66a3935616bfc089e1051357881a0b8abc49c7a30b8f46b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp1-515bcd9.json0000664000175000017500000000074415141516316026600 0ustar alastairalastair{ "basename": "asr_preprocess-cpp1-515bcd9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp1.f90", "infile_hash": "ac5c43ef61efaf9750763941c8ee309b88d00bdfc414901bcd6d4fbe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp1-515bcd9.stderr", "stderr_hash": "4ad2be665b1c2eb37d4740ec8df289a5635a32c470fa121e66ab853d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_01-964c12e.stdout0000664000175000017500000035067115141516316027455 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_simple_01: (Program (SymbolTable 18 { cast_r: (ExternalSymbol 18 cast_r 2 cast_r template_simple_01_m [] cast_r Public ), generic_sum: (ExternalSymbol 18 generic_sum 2 generic_sum template_simple_01_m [] generic_sum Public ), operator_r: (ExternalSymbol 18 operator_r 2 operator_r template_simple_01_m [] operator_r Public ), test_template: (ExternalSymbol 18 test_template 2 test_template template_simple_01_m [] test_template Public ) }) template_simple_01 [template_simple_01_m] [(SubroutineCall 18 test_template () [] () .false. )] ), template_simple_01_m: (Module (SymbolTable 2 { cast_integer: (Function (SymbolTable 7 { arg: (Variable 7 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_integer (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 7 arg)] [(Assignment (Var 7 res) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 res) Private .false. .false. () ), cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_r [t cast] [] ), cast_real: (Function (SymbolTable 8 { arg: (Variable 8 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 8 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_real (FunctionType [(Integer 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 8 arg)] [(Assignment (Var 8 res) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 8 res) Private .false. .false. () ), generic_sum: (Template (SymbolTable 9 { add: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 10 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 10 lhs) (Var 10 rhs)] [] (Var 10 res) Private .false. .false. () ), cast: (Function (SymbolTable 11 { arg: (Variable 11 arg [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 11 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(Integer 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 arg)] [] (Var 11 res) Private .false. .false. () ), generic_sum: (Function (SymbolTable 12 { arr: (Variable 12 arr [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast add] [(Var 12 arr)] [(Assignment (Var 12 n) (ArraySize (Var 12 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 12 res) (FunctionCall 9 cast () [((IntegerConstant 0 (Integer 4) Decimal))] (TypeParameter t ) () () ) () .false. .false. ) (If () (IntegerCompare (Var 12 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 12 res) (ArrayItem (Var 12 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(Assignment (Var 12 res) (FunctionCall 9 add () [((Var 12 res)) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] (TypeParameter t ) () () ) () .false. .false. )] [] )] [] )] (Var 12 res) Public .false. .false. () ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum [t add cast] [(Require operator_r [t add] ) (Require cast_r [t cast] )] ), operator_r: (Requirement (SymbolTable 3 { binary_func: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ) }) binary_func (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 res) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ) }) operator_r [t u v binary_func] [] ), test_template: (Function (SymbolTable 13 { a_i: (Variable 13 a_i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), a_r: (Variable 13 a_r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), generic_sum_integer: (Function (SymbolTable 15 { arr: (Variable 15 arr [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 15 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 15 res [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_integer ~add_intrinsic] [(Var 15 arr)] [(Assignment (Var 15 n) (ArraySize (Var 15 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 res) (FunctionCall 2 cast_integer () [((IntegerConstant 0 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 15 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 15 res) (ArrayItem (Var 15 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 15 n) ()) [(Assignment (Var 15 res) (FunctionCall 13 ~add_intrinsic () [((Var 15 res)) ((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () ))] (Integer 4) () () ) () .false. .false. )] [] )] [] )] (Var 15 res) Public .false. .false. () ), generic_sum_real: (Function (SymbolTable 17 { arr: (Variable 17 arr [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 17 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 17 res [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) generic_sum_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [cast_real ~add_intrinsic1] [(Var 17 arr)] [(Assignment (Var 17 n) (ArraySize (Var 17 arr) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 17 res) (FunctionCall 2 cast_real () [((IntegerConstant 0 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (IntegerCompare (Var 17 n) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 17 res) (ArrayItem (Var 17 arr) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) () .false. .false. ) (DoLoop () ((Var 17 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 17 n) ()) [(Assignment (Var 17 res) (FunctionCall 13 ~add_intrinsic1 () [((Var 17 res)) ((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (Real 4) ColMajor () ))] (Real 4) () () ) () .false. .false. )] [] )] [] )] (Var 17 res) Public .false. .false. () ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_i: (Variable 13 s_i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), s_r: (Variable 13 s_r [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 13 ~add [13 ~add_intrinsic 13 ~add_intrinsic1] Public ), ~add_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 14 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 14 ret [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (IntegerBinOp (Var 14 arg0) Add (Var 14 arg1) (Integer 4) () ) () .false. .false. )] (Var 14 ret) Public .false. .true. () ), ~add_intrinsic1: (Function (SymbolTable 16 { arg0: (Variable 16 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 16 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 16 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 16 arg0) (Var 16 arg1)] [(Assignment (Var 16 ret) (RealBinOp (Var 16 arg0) Add (Var 16 arg1) (Real 4) () ) () .false. .false. )] (Var 16 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 a_i) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 13 a_i) [(() (Var 13 i) ())] (Integer 4) ColMajor () ) (Var 13 i) () .false. .false. ) (Assignment (ArrayItem (Var 13 a_r) [(() (Var 13 i) ())] (Real 4) ColMajor () ) (Cast (Var 13 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 13 s_i) (FunctionCall 13 generic_sum_integer () [((ArrayPhysicalCast (Var 13 a_i) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 13 s_r) (FunctionCall 13 generic_sum_real () [((ArrayPhysicalCast (Var 13 a_r) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 13 s_i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 13 s_r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_simple_01_m () [template_simple_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-sync1-9624944.stdout0000664000175000017500000000635015141516316024670 0ustar alastairalastair(TranslationUnit [(Program sync1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(iam [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [(() () CodimensionStar)] () () None ())] () )] [(Assignment 0 iam (FuncCallOrArray this_image [] [] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== iam 1) [(Assignment 0 x (Real "1.0") () )] [] () () () ) (SyncMemory 0 [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 external_sync [] [] [] [] () ) (SyncMemory 0 [(AttrStat status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== iam 2) [(Write 0 [(()) (())] [] [(CoarrayRef x [] [] [] [(() 1 () CodimensionExpr)] [] )] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(SyncImages 0 () Asterisk [] () )] [(SyncImages 0 1 None [(AttrStat status )] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array_size_02-94fb4d3.stderr0000664000175000017500000000031415141516316026467 0ustar alastairalastairsemantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/array_size_02.f90:5:14 | 5 | size_a = size(a, 1, dim=1) | ^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/julia-case_02-e255e0e.stdout0000664000175000017500000000316015141516316025565 0ustar alastairalastairfunction main() local marks::Int32 local out::Int32 marks = 81 if 91 ≤ marks ≤ 100 out = 0 println("Excellent!") elseif 81 ≤ marks ≤ 90 out = 1 println("Very good!") elseif 71 ≤ marks ≤ 80 out = 2 println("Well done!") elseif 61 ≤ marks ≤ 70 out = 3 println("Not bad!") elseif 41 ≤ marks ≤ 60 out = 4 println("You passed!") elseif marks ≤ 40 out = 5 println("Better try again!") else out = 6 println("Invalid marks") end println("Your marks are ", " ", marks) if out ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if 91 ≤ marks ≤ 100 println("Excellent!") elseif 81 ≤ marks ≤ 90 println("Very good!") elseif 71 ≤ marks ≤ 80 println("Well done!") elseif 61 ≤ marks ≤ 70 println("Not bad!") elseif 41 ≤ marks ≤ 60 println("You passed!") elseif marks ≤ 40 println("Better try again!") else println("Invalid marks") end println("Your marks are ", " ", marks) if 91 ≤ marks ≤ 100 println("Excellent!") elseif 81 ≤ marks ≤ 90 println("Very good!") elseif 71 ≤ marks ≤ 80 println("Well done!") elseif 61 ≤ marks ≤ 70 println("Not bad!") elseif 41 ≤ marks ≤ 60 println("You passed!") elseif marks ≤ 40 println("Better try again!") else println("Invalid marks") end println("Your marks are ", " ", marks) end main() lfortran-lfortran-2f73434/tests/reference/asr-max_01-415ceb0.stderr0000664000175000017500000000036115141516316025071 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/max_01.f90:6:14 | 6 | print *, max(y, z) | ^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-lfortran-2f73434/tests/reference/llvm-global_scope6-3cbd5d2.json0000664000175000017500000000073715141516316026450 0ustar alastairalastair{ "basename": "llvm-global_scope6-3cbd5d2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope6.f90", "infile_hash": "3f2dfa122b78175565b7baa8f4d0417cfb0ed5bbe26bbb5f0f1f6f2e", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope6-3cbd5d2.stdout", "stdout_hash": "5b1acf6c71f8c095d87823c4373c6caaa74a7619002b6e1c959345c0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_call1-ad7fd7d.stdout0000664000175000017500000003174215141516316027405 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_frm: (Function (SymbolTable 2 { lw: (Variable 2 lw [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), prinf: (Function (SymbolTable 3 { prinf_arg_0: (Variable 3 prinf_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. ), prinf_arg_1: (Variable 3 prinf_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), prinf_arg_2: (Variable 3 prinf_arg_2 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) prinf (FunctionType [(String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1) (Var 3 prinf_arg_2)] [] () Public .false. .false. () ), w: (Variable 2 w [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) idd_frm (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m) (Var 2 n) (Var 2 w) (Var 2 x) (Var 2 y)] [(SubroutineCall 2 prinf () [((StringConstant "lw = *" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 2 lw)) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerBinOp (IntegerBinOp (IntegerConstant 16 (Integer 4) Decimal) Mul (Var 2 m) (Integer 4) () ) Add (IntegerConstant 70 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_02-87b589b.json0000664000175000017500000000100115141516316030153 0ustar alastairalastair{ "basename": "ast-program_without_line_02-87b589b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_02.f90", "infile_hash": "6d670e40b054653f92f57d8ae62f7499e30ae097dcea518f9d72a683", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_02-87b589b.stderr", "stderr_hash": "62705339ec315e9b82440933301be77473f956cdcf9d4b9623d0b69c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-cast_node_m_value-8b7098f.stdout0000664000175000017500000010145315141516316027442 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cast_node_m_value: (Program (SymbolTable 2 { c4_to_c8: (Variable 2 c4_to_c8 [] Local (Cast (ArrayConstructor [(ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) ) (ComplexConstructor (RealConstant 2.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 0.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) ComplexToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i4_to_c4: (Variable 2 i4_to_c4 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToComplex (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i4_to_c8: (Variable 2 i4_to_c8 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i4_to_i1: (Variable 2 i4_to_i1 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToInteger (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 3 [1, 2, 3] (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 3 [1, 2, 3] (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Integer 1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i4_to_r4: (Variable 2 i4_to_r4 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i4_to_r8: (Variable 2 i4_to_r8 [] Local (Cast (ArrayConstant 12 [1, 2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) IntegerToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1.0000000000000000e+00, 2.0000000000000000e+00, 3.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [1.0000000000000000e+00, 2.0000000000000000e+00, 3.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), r4_to_c4: (Variable 2 r4_to_c4 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToComplex (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 12 [(1.00000000e+00, 0.00000000e+00), (2.00000000e+00, 0.00000000e+00), (3.00000000e+00, 0.00000000e+00)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), r4_to_c8: (Variable 2 r4_to_c8 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToComplex (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [(1.0000000000000000e+00, 0.0000000000000000e+00), (2.0000000000000000e+00, 0.0000000000000000e+00), (3.0000000000000000e+00, 0.0000000000000000e+00)] (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Parameter (Array (Complex 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) cast_node_m_value [] [] ) }) [] ) ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_class_constructor-multiple_objects_args-2d1007e.stdoutlfortran-lfortran-2f73434/tests/reference/pass_class_constructor-multiple_objects_args-2d1007e.stdou0000664000175000017500000003653015141516316034160 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { 1_circle_radius: (ExternalSymbol 2 1_circle_radius 3 radius circle [] radius Public ), circle: (Struct (SymbolTable 3 { radius: (Variable 3 radius [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Public .false. .false. [] () () ), print_radius: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), m: (Variable 4 m [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 4 n [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. ) }) print_radius (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 m) (Var 4 n)] [(Print (StringFormat () [(StructInstanceMember (Var 4 m) 4 1_circle_radius (Real 4) () ) (StructInstanceMember (Var 4 n) 4 1_circle_radius (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 was_called) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] () Public .false. .false. () ), temp_struct_var__: (Variable 2 temp_struct_var__ [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. ), temp_struct_var__1: (Variable 2 temp_struct_var__1 [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Public Required .false. .false. .false. () .false. .false. ), was_called: (Variable 2 was_called [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (StructInstanceMember (Var 2 temp_struct_var__) 2 1_circle_radius (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 temp_struct_var__1) 2 1_circle_radius (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 2 print_radius () [((Var 2 temp_struct_var__)) ((Var 2 temp_struct_var__1))] () .false. ) (If () (LogicalNot (Var 2 was_called) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modulo_01-b82bee9.json0000664000175000017500000000072715141516316025354 0ustar alastairalastair{ "basename": "asr-modulo_01-b82bee9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/modulo_01.f90", "infile_hash": "a1faad9d12741b5d627f1c52ac348e99c9c7e07b44044a862435d250", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-modulo_01-b82bee9.stderr", "stderr_hash": "d79db9803291413c96b2e47dc8d958920ab27228255cde76f417294d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_2-9ba55e7.json0000664000175000017500000000121115141516316030601 0ustar alastairalastair{ "basename": "asr-continue_compilation_ff_2-9ba55e7", "cmd": "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/continue_compilation_ff_2.f", "infile_hash": "885df7aadcb0e8e8478ccad6225f17e5c3cf699a04ad8372958afeab", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_compilation_ff_2-9ba55e7.stdout", "stdout_hash": "6b7a042fa48758883b644f18a35cafed9cdb47c21b5c3eb050c1d23a", "stderr": "asr-continue_compilation_ff_2-9ba55e7.stderr", "stderr_hash": "a325f18d048882d5c223d38beb948cb8c3f3e78347f0e46c3ef5f6d1", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-logical2-94a2259.stdout0000664000175000017500000000464315141516316025567 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [26 x i8] c"Line 1 - Condition is true" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data, i32 0, i32 0), i64 26 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [27 x i8] c"Line 1 - Condition is false" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.1, i32 0, i32 0), i64 27 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i1, align 1 %b = alloca i1, align 1 store i1 true, i1* %a, align 1 store i1 false, i1* %b, align 1 %2 = load i1, i1* %a, align 1 %3 = load i1, i1* %b, align 1 %4 = icmp eq i1 %2, false %5 = select i1 %4, i1 %2, i1 %3 br i1 %5, label %then, label %else then: ; preds = %.entry %6 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont else: ; preds = %.entry %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_logical2 FINALIZE_SYMTABLE_logical2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-global_scope5-688b5a0.json0000664000175000017500000000073715141516316026316 0ustar alastairalastair{ "basename": "llvm-global_scope5-688b5a0", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope5.f90", "infile_hash": "63e512d3fe5d83aa6195002b9c31ddc77e1a93ac37df38989f782ed7", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope5-688b5a0.stdout", "stdout_hash": "cc4cca06eb67aa3f227fbdc6f64e7112fcc634b4bbfc26c4b4db14dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr8-cb13ef4.json0000664000175000017500000000070415141516316024607 0ustar alastairalastair{ "basename": "ast-expr8-cb13ef4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "ast-expr8-cb13ef4.stdout", "stdout_hash": "a5bded52998d57e79faf66d869a9d90b00601c965ba1347a25764d38", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_line_limit-0a3f0f0.stdout0000664000175000017500000000217315141516316030353 0ustar alastairalastair(TranslationUnit [(Program test () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [(String "this is a test to see if the fixed form parser properly ignores text past column 72" ())] () ) (Print 0 () [(String "test that we can still see the quote in the last column" ())] () ) (Print 0 () [(String "test that we avoid double \" lookahead in col 73 " ())] () ) (Print 0 () [(String " end-of-line double \"" ())] () ) (Assignment 0 a (+ 5 3) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-doloop_05-9e48e13.json0000664000175000017500000000073615141516316025536 0ustar alastairalastair{ "basename": "julia-doloop_05-9e48e13", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/doloop_05.f90", "infile_hash": "d6c2b01c1169dbde9ecbd05ebec2c3267e3d77d027cff03dc7361d78", "outfile": null, "outfile_hash": null, "stdout": "julia-doloop_05-9e48e13.stdout", "stdout_hash": "58f0432f021762b21c03b887da30de908897a0723ddb09945dd508f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-namelist_02-5bdbd75.json0000664000175000017500000000075315141516316025665 0ustar alastairalastair{ "basename": "asr-namelist_02-5bdbd75", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/namelist_02.f90", "infile_hash": "676c2a3a920ec86c6b8bc131b75e1c30f569d36d9777674a7e196b62", "outfile": null, "outfile_hash": null, "stdout": "asr-namelist_02-5bdbd75.stdout", "stdout_hash": "18f5ae368406fb1b64a0ff931cfd9af0b140c04c92949fbad133924a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-crlf1-374a66c.json0000664000175000017500000000073215141516316024417 0ustar alastairalastair{ "basename": "ast-crlf1-374a66c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/crlf1.f", "infile_hash": "137ef00eb5d20b96070b7a3753e6f4e2967db640fd0fad4f8f1aeeae", "outfile": null, "outfile_hash": null, "stdout": "ast-crlf1-374a66c.stdout", "stdout_hash": "5c431e42c94dd4a2ace2993d025345a9569d13b65c84ff8613a54206", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nullify_01-810c9d3.stdout0000664000175000017500000000156115141516316026125 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %p2 = alloca i32*, align 8 store i32* null, i32** %p2, align 8 %t1 = alloca i32, align 4 store i32* %t1, i32** %p1, align 8 store i32* %t1, i32** %p2, align 8 %2 = load i32*, i32** %p1, align 8 store i32 1, i32* %2, align 4 store i32* null, i32** %p1, align 8 store i32* null, i32** %p2, align 8 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nullify_01 FINALIZE_SYMTABLE_nullify_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-array_02-f2b519f.json0000664000175000017500000000072415141516316025107 0ustar alastairalastair{ "basename": "asr-array_02-f2b519f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_02.f90", "infile_hash": "8a51160d53f16bf9016e09ee1d74a1b589515e57b37d097c26e52b1a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_02-f2b519f.stderr", "stderr_hash": "5b69fda59876bd0f57004f8ef6e27919bcdc33b5f3ca35c01fdad382", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-print_intrinsics-8e5d219.stdout0000664000175000017500000001455615141516316027375 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_intrinsics: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 2 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_intrinsics [] [(Print (StringFormat () [(StringConstant "pi=acos(-1.0_sp) =\"" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 3.141593 (Real 4) ) ) (StringConstant "\"" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "pi=acos(-1.0_dp) =\"" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction Acos [(RealUnaryMinus (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant -1.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.141593 (Real 8) ) ) (StringConstant "\"" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-loop_test1-7800c18.json0000664000175000017500000000073615141516316025422 0ustar alastairalastair{ "basename": "ast-loop_test1-7800c18", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", "infile_hash": "149b2f607c4d8b4b89d207ac9353585e75ab55fd9c2520f7da02ffee", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test1-7800c18.stdout", "stdout_hash": "2b26fb6b8a3fa12cfbd7c121e39f95b2e5e2bd11c7d8320cdd64927f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form1-7fa677f.stdout0000664000175000017500000012343415141516316026263 0ustar alastairalastair(TranslationUnit [(Subroutine dqawse [(f) (a) (b) (alfa) (beta) (integr) (epsabs) (epsrel) (limit) (result) (abserr) (neval) (ier) (alist) (blist) (rlist) (elist) (iord) (last)] [] () () [] [] [] [(Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(a [] [] () () None ()) (abserr [] [] () () None ()) (alfa [] [] () () None ()) (alist [] [] () () None ()) (area [] [] () () None ()) (area1 [] [] () () None ()) (area12 [] [] () () None ()) (area2 [] [] () () None ()) (a1 [] [] () () None ()) (a2 [] [] () () None ()) (b [] [] () () None ()) (beta [] [] () () None ()) (blist [] [] () () None ()) (b1 [] [] () () None ()) (b2 [] [] () () None ()) (centre [] [] () () None ()) (dabs [] [] () () None ()) (dmax1 [] [] () () None ()) (d1mach [] [] () () None ()) (elist [] [] () () None ()) (epmach [] [] () () None ()) (epsabs [] [] () () None ()) (epsrel [] [] () () None ()) (errbnd [] [] () () None ()) (errmax [] [] () () None ()) (error1 [] [] () () None ()) (erro12 [] [] () () None ()) (error2 [] [] () () None ()) (errsum [] [] () () None ()) (f [] [] () () None ()) (resas1 [] [] () () None ()) (resas2 [] [] () () None ()) (result [] [] () () None ()) (rg [] [] () () None ()) (rh [] [] () () None ()) (ri [] [] () () None ()) (rj [] [] () () None ()) (rlist [] [] () () None ()) (uflow [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(ier [] [] () () None ()) (integr [] [] () () None ()) (iord [] [] () () None ()) (iroff1 [] [] () () None ()) (iroff2 [] [] () () None ()) (k [] [] () () None ()) (last [] [] () () None ()) (limit [] [] () () None ()) (maxerr [] [] () () None ()) (nev [] [] () () None ()) (neval [] [] () () None ()) (nrmax [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrExternal )] [(f [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(alist [(1 limit DimensionExpr)] [] () () None ()) (blist [(1 limit DimensionExpr)] [] () () None ()) (rlist [(1 limit DimensionExpr)] [] () () None ()) (elist [(1 limit DimensionExpr)] [] () () None ()) (iord [(1 limit DimensionExpr)] [] () () None ()) (ri [(1 25 DimensionExpr)] [] () () None ()) (rj [(1 25 DimensionExpr)] [] () () None ()) (rh [(1 25 DimensionExpr)] [] () () None ()) (rg [(1 25 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 epmach (FuncCallOrArray d1mach [] [(() 4 () 0)] [] [] [] ) () ) (Assignment 0 uflow (FuncCallOrArray d1mach [] [(() 1 () 0)] [] [] [] ) () ) (Assignment 0 ier 6 () ) (Assignment 0 neval 0 () ) (Assignment 0 last 0 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) (Real "0.0d+00") () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) (Real "0.0d+00") () ) (Assignment 0 (FuncCallOrArray iord [] [(() 1 () 0)] [] [] [] ) 0 () ) (Assignment 0 result (Real "0.0d+00") () ) (Assignment 0 abserr (Real "0.0d+00") () ) (If 0 () (BoolOp (BoolOp (BoolOp (BoolOp (BoolOp (BoolOp (<= b a) Or (BoolOp (== epsabs (Real "0.0d+00")) And (< epsrel (FuncCallOrArray dmax1 [] [(() (* (Real "0.5d+02") epmach) () 0) (() (Real "0.5d-28") () 0)] [] [] [] )) ) ) Or (<= alfa (u- (Real "0.1d+01"))) ) Or (<= beta (u- (Real "0.1d+01"))) ) Or (< integr 1) ) Or (> integr 4) ) Or (< limit 2) ) [(GoTo 0 () 999 [] () )] [] () () () ) (Assignment 0 ier 0 () ) (SubroutineCall 0 dqmomo [] [(() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() integr () 0)] [] [] () ) (Assignment 0 centre (* (Real "0.5d+00") (+ b a)) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a () 0) (() centre () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area1 () 0) (() error1 () 0) (() resas1 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval nev () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() centre () 0) (() b () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area2 () 0) (() error2 () 0) (() resas2 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 last 2 () ) (Assignment 0 neval (+ neval nev) () ) (Assignment 0 result (+ area1 area2) () ) (Assignment 0 abserr (+ error1 error2) () ) (Assignment 0 errbnd (FuncCallOrArray dmax1 [] [(() epsabs () 0) (() (* epsrel (FuncCallOrArray dabs [] [(() result () 0)] [] [] [] )) () 0)] [] [] [] ) () ) (If 0 () (> error2 error1) [(GoTo 0 () 10 [] () )] [] () () () ) (Assignment 0 (FuncCallOrArray alist [] [(() 1 () 0)] [] [] [] ) a () ) (Assignment 0 (FuncCallOrArray alist [] [(() 2 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray blist [] [(() 1 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray blist [] [(() 2 () 0)] [] [] [] ) b () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 2 () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) error1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 2 () 0)] [] [] [] ) error2 () ) (GoTo 0 () 20 [] () ) (Assignment 10 (FuncCallOrArray alist [] [(() 1 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray alist [] [(() 2 () 0)] [] [] [] ) a () ) (Assignment 0 (FuncCallOrArray blist [] [(() 1 () 0)] [] [] [] ) b () ) (Assignment 0 (FuncCallOrArray blist [] [(() 2 () 0)] [] [] [] ) centre () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 1 () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() 2 () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) error2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() 2 () 0)] [] [] [] ) error1 () ) (Assignment 20 (FuncCallOrArray iord [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 (FuncCallOrArray iord [] [(() 2 () 0)] [] [] [] ) 2 () ) (If 0 () (== limit 2) [(Assignment 0 ier 1 () )] [] () () () ) (If 0 () (BoolOp (<= abserr errbnd) Or (== ier 1) ) [(GoTo 0 () 999 [] () )] [] () () () ) (Assignment 0 errmax (FuncCallOrArray elist [] [(() 1 () 0)] [] [] [] ) () ) (Assignment 0 maxerr 1 () ) (Assignment 0 nrmax 1 () ) (Assignment 0 area result () ) (Assignment 0 errsum abserr () ) (Assignment 0 iroff1 0 () ) (Assignment 0 iroff2 0 () ) (DoLoop 0 () 60 last 3 limit () [(Assignment 0 a1 (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) () ) (Assignment 0 b1 (* (Real "0.5d+00") (+ (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ))) () ) (Assignment 0 a2 b1 () ) (Assignment 0 b2 (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a1 () 0) (() b1 () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area1 () 0) (() error1 () 0) (() resas1 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval (+ neval nev) () ) (SubroutineCall 0 dqc25s [] [(() f () 0) (() a () 0) (() b () 0) (() a2 () 0) (() b2 () 0) (() alfa () 0) (() beta () 0) (() ri () 0) (() rj () 0) (() rg () 0) (() rh () 0) (() area2 () 0) (() error2 () 0) (() resas2 () 0) (() integr () 0) (() nev () 0)] [] [] () ) (Assignment 0 neval (+ neval nev) () ) (Assignment 0 area12 (+ area1 area2) () ) (Assignment 0 erro12 (+ error1 error2) () ) (Assignment 0 errsum (- (+ errsum erro12) errmax) () ) (Assignment 0 area (- (+ area area12) (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] )) () ) (If 0 () (BoolOp (== a a1) Or (== b b2) ) [(GoTo 0 () 30 [] () )] [] () () () ) (If 0 () (BoolOp (== resas1 error1) Or (== resas2 error2) ) [(GoTo 0 () 30 [] () )] [] () () () ) (If 0 () (BoolOp (< (FuncCallOrArray dabs [] [(() (- (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area12) () 0)] [] [] [] ) (* (Real "0.1d-04") (FuncCallOrArray dabs [] [(() area12 () 0)] [] [] [] ))) And (>= erro12 (* (Real "0.99d+00") errmax)) ) [(Assignment 0 iroff1 (+ iroff1 1) () )] [] () () () ) (If 0 () (BoolOp (> last 10) And (> erro12 errmax) ) [(Assignment 0 iroff2 (+ iroff2 1) () )] [] () () () ) (Assignment 30 (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() last () 0)] [] [] [] ) area2 () ) (Assignment 0 errbnd (FuncCallOrArray dmax1 [] [(() epsabs () 0) (() (* epsrel (FuncCallOrArray dabs [] [(() area () 0)] [] [] [] )) () 0)] [] [] [] ) () ) (If 0 () (<= errsum errbnd) [(GoTo 0 () 35 [] () )] [] () () () ) (If 0 () (== last limit) [(Assignment 0 ier 1 () )] [] () () () ) (If 0 () (BoolOp (>= iroff1 6) Or (>= iroff2 20) ) [(Assignment 0 ier 2 () )] [] () () () ) (If 0 () (<= (FuncCallOrArray dmax1 [] [(() (FuncCallOrArray dabs [] [(() a1 () 0)] [] [] [] ) () 0) (() (FuncCallOrArray dabs [] [(() b2 () 0)] [] [] [] ) () 0)] [] [] [] ) (* (+ (Real "0.1d+01") (* (Real "0.1d+03") epmach)) (+ (FuncCallOrArray dabs [] [(() a2 () 0)] [] [] [] ) (* (Real "0.1d+04") uflow)))) [(Assignment 0 ier 3 () )] [] () () () ) (If 35 () (> error2 error1) [(GoTo 0 () 40 [] () )] [] () () () ) (Assignment 0 (FuncCallOrArray alist [] [(() last () 0)] [] [] [] ) a2 () ) (Assignment 0 (FuncCallOrArray blist [] [(() maxerr () 0)] [] [] [] ) b1 () ) (Assignment 0 (FuncCallOrArray blist [] [(() last () 0)] [] [] [] ) b2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() maxerr () 0)] [] [] [] ) error1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() last () 0)] [] [] [] ) error2 () ) (GoTo 0 () 50 [] () ) (Assignment 40 (FuncCallOrArray alist [] [(() maxerr () 0)] [] [] [] ) a2 () ) (Assignment 0 (FuncCallOrArray alist [] [(() last () 0)] [] [] [] ) a1 () ) (Assignment 0 (FuncCallOrArray blist [] [(() last () 0)] [] [] [] ) b1 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() maxerr () 0)] [] [] [] ) area2 () ) (Assignment 0 (FuncCallOrArray rlist [] [(() last () 0)] [] [] [] ) area1 () ) (Assignment 0 (FuncCallOrArray elist [] [(() maxerr () 0)] [] [] [] ) error2 () ) (Assignment 0 (FuncCallOrArray elist [] [(() last () 0)] [] [] [] ) error1 () ) (SubroutineCall 50 dqpsrt [] [(() limit () 0) (() last () 0) (() maxerr () 0) (() errmax () 0) (() elist () 0) (() iord () 0) (() nrmax () 0)] [] [] () ) (If 0 () (BoolOp (/= ier 0) Or (<= errsum errbnd) ) [(GoTo 0 () 70 [] () )] [] () () () ) (Continue 60 () )] () () ) (Assignment 70 result (Real "0.0d+00") () ) (DoLoop 0 () 80 k 1 last () [(Assignment 0 result (+ result (FuncCallOrArray rlist [] [(() k () 0)] [] [] [] )) () ) (Continue 80 () )] () () ) (Assignment 0 abserr errsum () ) (Return 999 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/tokens-expr7-bf90751.json0000664000175000017500000000071515141516316025172 0ustar alastairalastair{ "basename": "tokens-expr7-bf90751", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "tokens-expr7-bf90751.stdout", "stdout_hash": "5e07b110d4feed247c9fb163c38f17f1ed469bcc3eb61a8302ac4826", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_44-ec0baa3.json0000664000175000017500000000075015141516316025566 0ustar alastairalastair{ "basename": "asr-modules_44-ec0baa3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_44.f90", "infile_hash": "64a0fe18f63bcdea0da398339103b09acfb84dd85285ec15239ea14e", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_44-ec0baa3.stdout", "stdout_hash": "e163e527ccfe00a31e5891cdc872c2df134ee3d084c6ffc08fad30fb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-defop1-f87dd80.stdout0000664000175000017500000000337315141516316025232 0ustar alastairalastair(TranslationUnit [(Program defop1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Assignment 0 e (DefBinOp a "in" b ) () ) (Assignment 0 E (DefBinOp A "IN" B ) () ) (Assignment 0 e (DefBinOp s [(b [])] "op" (** 3 4) ) () ) (Assignment 0 E (DefBinOp S [(B [])] "OP" (** 3 4) ) () ) (Assignment 0 e (DefBinOp (+ a b) "x" (** y x) ) () ) (Assignment 0 e (DefBinOp (** x x) "x" (** x x) ) () ) (Assignment 0 E (DefBinOp (** X X) "X" (** X X) ) () ) (Assignment 0 e (** (DefBinOp (DefBinOp x "x" x ) "in" 3 ) 4) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-print3-5f4fc26.json0000664000175000017500000000070715141516316024711 0ustar alastairalastair{ "basename": "asr-print3-5f4fc26", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/print3.f90", "infile_hash": "891fa35fc5d09524ef73c8c3b92bcd5a4bede01e35fdf0f116df99b2", "outfile": null, "outfile_hash": null, "stdout": "asr-print3-5f4fc26.stdout", "stdout_hash": "2fbf0250cc4082d49c542abb419f2ac23ab81b774f070dd9421094da", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine3-952da2b.stdout0000664000175000017500000000010415141516316026624 0ustar alastairalastairfunction f()::Int32 local f::Int32 f = 42 return f end lfortran-lfortran-2f73434/tests/reference/asr-string_03-7320626.stdout0000664000175000017500000002604515141516316025430 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_03: (Program (SymbolTable 3 { combined: (Variable 3 combined [] Local () () Default (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), intro: (ExternalSymbol 3 intro 2 intro string_03_mod [] intro Public ), last_name: (Variable 3 last_name [] Local () () Default (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), posit: (Variable 3 posit [] Local () () Default (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), title: (Variable 3 title [] Local () () Default (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), verb: (Variable 3 verb [] Local () () Default (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_03 [string_03_mod] [(Assignment (Var 3 verb) (StringConstant "learned " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 posit) (StringConstant "from " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 title) (StringConstant "the " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 last_name) (StringConstant "best" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 3 combined) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 3 intro) (Var 3 verb)] 0 (String 1 (IntegerConstant 13 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 posit)] 0 (String 1 (IntegerConstant 18 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 title)] 0 (String 1 (IntegerConstant 22 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (Var 3 last_name)] 0 (String 1 (IntegerConstant 29 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) (StringConstant "." (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 30 (Integer 8) Decimal) ExpressionLength DescriptorString) () ) () .false. .false. ) (Print (Var 3 combined) )] ), string_03_mod: (Module (SymbolTable 2 { intro: (Variable 2 intro [] Local (StringConstant "I've " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "I've " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_03_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-fn4-83c4d1a.stdout0000664000175000017500000000125515141516316025201 0ustar alastairalastairfunction conform(mold, val, dim) type(*), intent(in) :: mold(..) type(*), intent(in), optional :: val(..) integer, intent(in), optional :: dim logical :: conform if (present(val)) then if (present(dim)) then if (dim > 0 .and. dim <= rank(mold) .and. dim <= rank(val)) then conform = size(mold, dim=dim) == size(val, dim=dim) else error stop "Runtime error: Illegal dim argument provided in conform" end if else if (rank(val) == rank(mold)) then conform = all(shape(mold) == shape(val)) else conform = .false. end if end if else conform = .true. end if end function conform lfortran-lfortran-2f73434/tests/reference/asr-template_03-6afb845.json0000664000175000017500000000075315141516316025610 0ustar alastairalastair{ "basename": "asr-template_03-6afb845", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03.f90", "infile_hash": "58b6ec4d6cf448b1aabceb4447e834d0d2e8f5a98058e37b48e86976", "outfile": null, "outfile_hash": null, "stdout": "asr-template_03-6afb845.stdout", "stdout_hash": "4fd5418a55a83f4f69efccdc3cddfa187987d7943f5cb9a333b9911f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_3-53e9045.stderr0000664000175000017500000000020715141516316026224 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/errors/fixed_form_3.f:4:21 | 4 | 500 print *, sin(y | ^ lfortran-lfortran-2f73434/tests/reference/asr-multi_error1-ed395f9.json0000664000175000017500000000075115141516316026126 0ustar alastairalastair{ "basename": "asr-multi_error1-ed395f9", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/multi_error1.f90", "infile_hash": "aae363b17603b231b2a906564a03365ce9a53952c754ea31187f352c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-multi_error1-ed395f9.stderr", "stderr_hash": "8e354c62a28f565b652876a84c5e566842065a5429ce01c56fea19e1", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast_f90-open1-9127585.json0000664000175000017500000000071715141516316024762 0ustar alastairalastair{ "basename": "ast_f90-open1-9127585", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/open1.f90", "infile_hash": "932467cb6b7bcbf97a0b9a7c90ea1ca8074bde26145accfc0bb252c2", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-open1-9127585.stdout", "stdout_hash": "6d193dc22ef86174299ec315108e34a1ae76e1b5ddcf0f3dbeef4567", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-builtin1-1b5ca89.json0000664000175000017500000000071515141516316025217 0ustar alastairalastair{ "basename": "ast-builtin1-1b5ca89", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/builtin1.f90", "infile_hash": "8c200e5b6fa38354dabbf5be7d12f548fa4e99f58ac9225f50a77c8c", "outfile": null, "outfile_hash": null, "stdout": "ast-builtin1-1b5ca89.stdout", "stdout_hash": "69ba0334bff0c89334b301f51dabd047f3bcd3269c7b395add55f37c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intent1-4e0feb8.stderr0000664000175000017500000000017615141516316025464 0ustar alastairalastairsemantic error: Cannot assign to an intent(in) variable `y` --> tests/errors/intent1.f90:9:5 | 9 | y = 99 | ^ lfortran-lfortran-2f73434/tests/reference/ast-expr7-68a8628.json0000664000175000017500000000070415141516316024405 0ustar alastairalastair{ "basename": "ast-expr7-68a8628", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "ast-expr7-68a8628.stdout", "stdout_hash": "081b61f601296b450572df4283c1f362c9ad2f18905737400d3b2d71", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cmplx_01-89b858d.json0000664000175000017500000000072415141516316025050 0ustar alastairalastair{ "basename": "asr-cmplx_01-89b858d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cmplx_01.f90", "infile_hash": "f317ca48704ee5d5a4888bed66f7268399aa3e448e1b69ad2c3414d6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-cmplx_01-89b858d.stderr", "stderr_hash": "c4130f91af513f593d149e9b8a56275d8ce38679baa257374b5bcb36", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-common3-fab0cfa.stdout0000664000175000017500000000042515141516316026276 0ustar alastairalastairsubroutine test() implicit none real :: a, b, c, d common a, b common a, b common a, b common a, /b1/ c, d, // b common a, /b1/ c, d, // b common b(2:4) common b(:4) common b(4) common /b1/ c, d, // a, b common /b1/ c, d, // a, b common /b1/ c, d, // a, b end subroutine test lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err5-38d12de.json0000664000175000017500000000076015141516316027450 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err5-38d12de", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err5.f90", "infile_hash": "01035d3623d53c8ebd4bc5480285bb86e44a0f1e138bea7619972dd4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err5-38d12de.stderr", "stderr_hash": "3966919982985df5bd5b492228a58d90a23ef0333b6d22b176851c3a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-modules_44-ec0baa3.stdout0000664000175000017500000005327415141516316026150 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_44: (Program (SymbolTable 9 { cmd_new: (ExternalSymbol 9 cmd_new 2 cmd_new modules_44_fpm_cmd_new [] cmd_new Public ), fpm_cmd_settings: (ExternalSymbol 9 fpm_cmd_settings 2 fpm_cmd_settings modules_44_fpm_cmd_new [] fpm_cmd_settings Public ), fpm_new_settings: (ExternalSymbol 9 fpm_new_settings 2 fpm_new_settings modules_44_fpm_cmd_new [] fpm_new_settings Public ), settings: (Variable 9 settings [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 9 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. ), warnwrite: (ExternalSymbol 9 warnwrite 4 warnwrite modules_44_module_fpm_filesystem [] warnwrite Public ) }) modules_44 [modules_44_fpm_cmd_new] [(SubroutineCall 9 cmd_new () [((Var 9 settings))] () .false. )] ), modules_44_fpm_cmd_new: (Module (SymbolTable 2 { cmd_new: (Function (SymbolTable 8 { 1_fpm_new_settings_name: (ExternalSymbol 8 1_fpm_new_settings_name 7 name fpm_new_settings [] name Public ), littlefile: (Variable 8 littlefile [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), settings: (Variable 8 settings [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. ) }) cmd_new (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 settings)] [(Assignment (Var 8 littlefile) (ArrayConstant 160 ["# ", "My cool new project! "] (Array (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (SubroutineCall 2 warnwrite () [((StructInstanceMember (Var 8 settings) 8 1_fpm_new_settings_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 8 littlefile))] () .false. )] () Public .false. .false. () ), fpm_cmd_settings: (Struct (SymbolTable 6 { working_dir: (Variable 6 working_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_cmd_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [working_dir] [] Source Public .false. .true. [] () () ), fpm_new_settings: (Struct (SymbolTable 7 { name: (Variable 7 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_new_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () 2 fpm_cmd_settings ), warnwrite: (ExternalSymbol 2 warnwrite 4 warnwrite modules_44_module_fpm_filesystem [] warnwrite Public ) }) modules_44_fpm_cmd_new () [modules_44_module_fpm_filesystem] .false. .false. .false. ), modules_44_module_fpm_filesystem: (Module (SymbolTable 4 { warnwrite: (Function (SymbolTable 5 { data: (Variable 5 data [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), fname: (Variable 5 fname [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) warnwrite (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 fname) (Var 5 data)] [] () Public .false. .false. () ) }) modules_44_module_fpm_filesystem () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-case_02-9e53b61.stdout0000664000175000017500000000504415141516316025172 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t marks; int32_t out; marks = 81; if (91 <= marks <= 100) { out = 0; std::cout<< "Excellent!"< tests/errors/dlgama_arg.f90:2:14 | 2 | print *, dlgama(2.7) | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-template_error_09-8d590f9.json0000664000175000017500000000075715141516316026764 0ustar alastairalastair{ "basename": "asr-template_error_09-8d590f9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_09.f90", "infile_hash": "773f4dded8e565f02f43e0b053439728820619a5f8d225f2badc429e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_09-8d590f9.stderr", "stderr_hash": "126101c2d657ed18e2d1e2362f8fec3a618565917fa77fd78e5c61d5", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_2-a6145a1.json0000664000175000017500000000101615141516316030032 0ustar alastairalastair{ "basename": "asr-continue_compilation_2-a6145a1", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_2.f90", "infile_hash": "fac238b80964cb94e477f4c75f6f269473d216fef9369c1c3d9b988d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_2-a6145a1.stderr", "stderr_hash": "970adef61d8d6e8651291b70d71e2ceefa9875b543c414b0c5b0e5f8", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-logical4-72c2657.stdout0000664000175000017500000001134115141516316025375 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical4: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) logical4 [] [(Assignment (Var 2 a) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToLogical (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) IntegerToLogical (Logical 4) () ) () .false. .false. ) (Assignment (Var 2 c) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToLogical (Logical 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 a) (Var 2 b) (Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-if_05-2102585.stdout0000664000175000017500000000162115141516316025027 0ustar alastairalastairfunction main() local x::Bool local y::Bool x = true y = false if x println("x: Single Line If") end if y println("y: Single Line If") end if x println("x: Multi Line If-Else: x is True") else println("x: Multi Line If-Else: x is False") end if y println("y: Multi Line If-Else: y is True") else println("y: Multi Line If-Else: y is False") end if x println("x: If part") else if x println("x: Else-If part") end end if y println("y: If part") else if x println("x: Else-If part") else println("Else part") end end if y println("y: If part") else if y println("y: Else-If part") else println("Else part") end end end main() lfortran-lfortran-2f73434/tests/reference/ast-fixedform_assign_minimal-c4142fa.json0000664000175000017500000000101015141516316030502 0ustar alastairalastair{ "basename": "ast-fixedform_assign_minimal-c4142fa", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_assign_minimal.f", "infile_hash": "c859f6358c9852842503fc3e803177fd6c3f47e9c7cf4037bdf71919", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_assign_minimal-c4142fa.stdout", "stdout_hash": "d31667a5b1ec2ba542cc957c3644f3879fc650daf8ec7167cf6457e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07c-901677a.stderr0000664000175000017500000000031215141516316027350 0ustar alastairalastairsemantic error: Parameter 'scombine' was not declared --> tests/errors/template_error_07c.f90:15:20 | 15 | require :: semigroup(t, scombine) | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-type_mismatch2-79a25db.json0000664000175000017500000000074615141516316026423 0ustar alastairalastair{ "basename": "asr-type_mismatch2-79a25db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_mismatch2.f90", "infile_hash": "6a0df64a4e21aca5923478788fd0b478a851e53939d6742cf2c96476", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_mismatch2-79a25db.stderr", "stderr_hash": "5d0d17d02357b96f4843fa53d93fa104ab9bcbeb55b06e8b29403085", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-nullify_02-1f0bd3a.json0000664000175000017500000000075015141516316025514 0ustar alastairalastair{ "basename": "asr-nullify_02-1f0bd3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_02-1f0bd3a.stdout", "stdout_hash": "ea292ab68375d0fb529bf6aa6d8d9e33615f312260b0529c68ac5e18", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm_i64-3afdb24.stdout0000664000175000017500000001465215141516316025554 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i64) (result i64))) (type (;3;) (func (param i64 i64) (result i64))) (type (;4;) (func (param) (result i64))) (type (;5;) (func (param) (result))) (type (;6;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i64) (result i64) (local i64) local.get 0 local.get 0 i64.mul local.set 1 local.get 1 return ) (func $3 (type 3) (param i64 i64) (result i64) (local i64) local.get 0 local.get 1 i64.add local.set 2 local.get 2 return ) (func $4 (type 4) (param) (result i64) (local i64 i64 i64) i64.const 1000000000000 local.set 1 i64.const 2000000000000 local.set 2 local.get 1 local.get 2 call 3 local.set 0 local.get 0 return ) (func $5 (type 5) (param) (result) (local) i64.const 1000000 call 2 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i64.const 1000000000000 i64.const 1000000000000 call 3 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop call 4 call 6 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $6 (type 6) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "a_sqr_i64" (func 2)) (export "add_i64" (func 3)) (export "test_i64" (func 4)) (export "_start" (func 5)) (export "print_i64" (func 6)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-data2-10e42d7.stdout0000664000175000017500000001651515141516316024751 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 3 { factor: (Variable 3 factor [] Local (RealConstant 100.000000 (Real 8) ) (RealConstant 100.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 3 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [b] [] [(Assignment (Var 3 factor) (RealConstant 100.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 3 zero) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "factor in a:" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 factor)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 1 b () [((Var 3 factor))] () .false. )] () Public .false. .false. () ), b: (Function (SymbolTable 4 { factor: (Variable 4 factor [] Unspecified () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [(Real 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 factor)] [(Print (StringFormat () [(StringConstant "factor: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 factor)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 2 { }) main [] [(SubroutineCall 1 a () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-data_14-f20fec7.stdout0000664000175000017500000000345315141516316025340 0ustar alastairalastair(TranslationUnit [(Program data_14 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 n DimensionExpr)] )] [(arr [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray arr [] [(() i () 0)] [] [] [] )] (AttrType TypeInteger [] () () None ) i 1 n () )] [(Real "0.0") (Real "0.0") (Real "0.0") (Real "0.0")] )] () ) (Print 0 () [arr] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_complex-445a788.stderr0000664000175000017500000000023015141516316030051 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_complex.f90:3:13 | 3 | complex(*) a | ^ lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce-58dd849.json0000664000175000017500000000076115141516316027621 0ustar alastairalastair{ "basename": "ast-do_concurrent_reduce-58dd849", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent_reduce.f90", "infile_hash": "44ebdebb05b853f4680c203c3b2b0e98e9285d1f3923ecbc255bc105", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent_reduce-58dd849.stdout", "stdout_hash": "7ed479c552c0ce3f4d28a00e6a9e87dfc161d764bef40fb9cfca3ee5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_11-1131557.stdout0000664000175000017500000000402515141516316025562 0ustar alastairalastair(TranslationUnit [(Module modules_11_module11 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () 1 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () 2 Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine access_internally [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "i = " ()) i] () )] [] [] )] ) (Program access_externally () [(Use [] modules_11_module11 [] .false. () )] [(ImplicitNone [] () )] [] [(Print 0 () [(String "j = " ()) j] () ) (SubroutineCall 0 access_internally [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-expr3-99b2959.stdout0000664000175000017500000000354115141516316024760 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 5 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Sub (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) )] ) lfortran-lfortran-2f73434/tests/reference/asr-atomic_01-1c877f0.json0000664000175000017500000000072715141516316025170 0ustar alastairalastair{ "basename": "asr-atomic_01-1c877f0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/atomic_01.f90", "infile_hash": "e5001ac4b903b55446e4522c9f89e7d9b9553efe2a29fbcbf5e28ec4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-atomic_01-1c877f0.stderr", "stderr_hash": "b5425aecd23bfaf3bcfc835e65dcb28e6209073ae0db8de396bc47dd", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-case_06-f84222d.json0000664000175000017500000000073715141516316024631 0ustar alastairalastair{ "basename": "asr-case_06-f84222d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "asr-case_06-f84222d.stdout", "stdout_hash": "6a4f4b87f1026517ea8f81baf7faf6210087416d288c01e14d91e297", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_assignment_arr2-3867783.stderr0000664000175000017500000000026415141516316033505 0ustar alastairalastairsemantic error: Different shape for array assignment on dimension 3(1 and 2) --> tests/errors/incompatible_dimension_assignment_arr2.f90:10:5 | 10 | y = x | ^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-common_linkage_separate_compilation_01-4003f83.json0000664000175000017500000000105215141516316033245 0ustar alastairalastair{ "basename": "llvm-common_linkage_separate_compilation_01-4003f83", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/common_linkage_separate_compilation_01.f90", "infile_hash": "81ac5886133bfb559572f95eadef2507efdf8b0ef2dd367d72256990", "outfile": null, "outfile_hash": null, "stdout": "llvm-common_linkage_separate_compilation_01-4003f83.stdout", "stdout_hash": "cc17b8f2bd27a4bce7558d914b3e8ea1281e83f7299604162ee25545", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr_05-c1f66bd.stdout0000664000175000017500000002572715141516316025414 0ustar alastairalastair(TranslationUnit [(Program expr_05 (TriviaNode [(EndOfLine) (Comment "! Test parantheses in expressions" )] [] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(l [] [] () () None ())] () )] [(Assignment 0 a 3 () ) (Assignment 0 b 4 () ) (Assignment 0 c 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 3) () ) (Assignment 0 x (* (u- 2) 3) () ) (Assignment 0 x (* 2 (u- 3)) () ) (Assignment 0 x (* (u- 2) (u- 3)) () ) (Assignment 0 x (* (u- 2) (u- 3)) () ) (Assignment 0 x (u- (** 2 3)) () ) (Assignment 0 x (u- (** 2 3)) () ) (Assignment 0 x (u- (* 2 3)) () ) (Assignment 0 x (** 2 (u- 3)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x a () ) (Assignment 0 x (Parenthesis a ) () ) (Assignment 0 x (* a b) () ) (Assignment 0 x (* (u- a) b) () ) (Assignment 0 x (u- (* a b)) () ) (Assignment 0 x (* a (u- b)) () ) (Assignment 0 x (* (u- a) (u- b)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* (* a b) c) () ) (Assignment 0 x (* (* (u- a) b) c) () ) (Assignment 0 x (* (* a (u- b)) c) () ) (Assignment 0 x (* (* a b) (u- c)) () ) (Assignment 0 x (* (* (u- a) (u- b)) (u- c)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (+ 3 (* 4 5)) () ) (Assignment 0 x (* (+ 3 4) 5) () ) (Assignment 0 x (* a (+ b (* 5 (- c b)))) () ) (Assignment 0 x (* (- 3 (* (* 2 a) b)) 5) () ) (Assignment 0 x (* (+ (* (* (u- 2) a) b) 3) 5) () ) (Assignment 0 x (* (+ (* (* (u- 2) a) b) (* (* 3 b) a)) 5) () ) (Assignment 0 x (* (+ (* (u- 2) (/ a b)) (** (+ a (u- b)) 2)) 5) () ) (Assignment 0 x (* (+ (* (* (u+ 2) a) b) 3) 5) () ) (Assignment 0 x (+ (+ (** a 2) (* (* 2 a) b)) (** b 2)) () ) (Assignment 0 x (* (+ a b) (- a b)) () ) (Assignment 0 x (** (+ a b) 2) () ) (Assignment 0 x (* (+ a b) (+ (- (** a 2) (* a b)) (** b 2))) () ) (Assignment 0 x (* (* (- a b) (+ a b)) (+ (** a 2) (** b 2))) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (/ 1 (* a b)) () ) (Assignment 0 x (* (/ 1 a) b) () ) (Assignment 0 x (* (/ 1 a) b) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (/ 1 (+ (* a b) 1)) () ) (Assignment 0 x (+ (* (/ 1 a) b) 1) () ) (Assignment 0 x (+ (* (/ 1 a) b) 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (- 2 (u- 2)) () ) (Assignment 0 x (- a (- (u- b) c)) () ) (Assignment 0 x (- a (* (u- 2) b)) () ) (Assignment 0 x (- c (/ (u- 2) b)) () ) (Assignment 0 x (- a (+ (+ 2 3) 4)) () ) (Assignment 0 x (+ a (+ (+ 2 3) 4)) () ) (Assignment 0 x (- (+ (* 2 a) (* a b)) (+ (* a b) (* 2 a))) () ) (Assignment 0 x (- (+ (* 2 a) (* a b)) (- (* a b) (* 2 a))) () ) (Assignment 0 x (- a (- b (- c 1))) () ) (Assignment 0 x (- a b) () ) (Assignment 0 x (- a (- b c)) () ) (Assignment 0 x (- (- a b) c) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (u- (- a (+ (u- b) (- (u- b) (* (u- b) b))))) () ) (Assignment 0 x (u- (+ 3 5)) () ) (Assignment 0 x (u- (+ a 5)) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 l (BoolOp (BoolOp (<= (+ (* (** x 3) 4) a) 4) Or (BoolOp (< x 5) And (< x 6) ) ) Eqv (BoolOp (Logical .true.) Or (BoolOp (not (Logical .false.)) And (Logical .true.) ) ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp l And l ) ) () ) (Assignment 0 l (BoolOp (BoolOp l Or l ) And l ) () ) (Assignment 0 l (BoolOp (BoolOp l And l ) Or l ) () ) (Assignment 0 l (BoolOp l And (BoolOp l Or l ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp (not l) And l ) ) () ) (Assignment 0 l (BoolOp l Or (BoolOp l And (not l) ) ) () ) (Assignment 0 l (BoolOp (BoolOp l And l ) Or (not l) ) () ) (Assignment 0 l (BoolOp (BoolOp l And (not l) ) Or l ) () ) (Assignment 0 l (BoolOp l And (not (BoolOp l Or l )) ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-array2-456cd99.json0000664000175000017500000000070015141516316025132 0ustar alastairalastair{ "basename": "julia-array2-456cd99", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "julia-array2-456cd99.stdout", "stdout_hash": "6626798dc1eb32ee609e58817932e55510893cdb5750ea30de9b8c7d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array1-cceb5f3.stdout0000664000175000017500000000563215141516316025401 0ustar alastairalastair(TranslationUnit [(Program array1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ()) (e [(1 5 DimensionExpr)] [] () () None ()) (e2 [(1 2 DimensionExpr) (1 3 DimensionExpr)] [] () () None ()) (e3 [(1 1 DimensionExpr) (1 2 DimensionExpr) (1 3 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(f [] [] () () None ()) (g [(1 3 DimensionExpr)] [] () () None ()) (g2 [(1 6 DimensionExpr) (1 3 DimensionExpr)] [] () () None ()) (g3 [(1 4 DimensionExpr) (1 3 DimensionExpr) (1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(a [] [] () () None ()) (b [(1 2 DimensionExpr)] [] () () None ()) (b2 [(1 3 DimensionExpr) (1 2 DimensionExpr)] [] () () None ()) (b3 [(1 2 DimensionExpr) (1 1 DimensionExpr) (1 2 DimensionExpr)] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name4-76fda17.json0000664000175000017500000000075415141516316027615 0ustar alastairalastair{ "basename": "lookup_name-lookup_name4-76fda17", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name4.f90", "infile_hash": "4f94dd895f74a3603c2465f84044dc46c3156dbabcb01fbe69722e60", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name4-76fda17.stdout", "stdout_hash": "547f4cdcb68dbf0b977390e3ca98e359fb12dd3e018ddc10ef90db14", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-dimension_attr-12e0f2a.stdout0000664000175000017500000000526515141516316027051 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [a] () )] [] [] ) (Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 3 DimensionExpr)] )] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration () [(AttrDimension [] )] [(a [(1 2 DimensionExpr) (1 2 DimensionExpr)] [] () () None ()) (b [(1 10 DimensionExpr) (1 10 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 2 DimensionExpr)] )] [(d [] [] () () None ())] () )] [(SubroutineCall 0 f [] [(() 1 () 0)] [] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name1-9a3abcc.json0000664000175000017500000000075415141516316027740 0ustar alastairalastair{ "basename": "lookup_name-lookup_name1-9a3abcc", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name1.f90", "infile_hash": "6040a3665d4455ccb812ccc763c7d458221ef5b0eb639ed341de0618", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name1-9a3abcc.stdout", "stdout_hash": "8df160638b3c83441d1ecd0dd1fdff905f4f006d492e805dc0041307", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_03-b1d32aa.json0000664000175000017500000000077215141516316026702 0ustar alastairalastair{ "basename": "asr-derived_types_03-b1d32aa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_03-b1d32aa.stdout", "stdout_hash": "644b7830111da5cece5f314a49ab174511d4c8e88d49cf1f8a3c8cbd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_01-964c12e.json0000664000175000017500000000100015141516316027057 0ustar alastairalastair{ "basename": "asr-template_simple_01-964c12e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_01.f90", "infile_hash": "52481db9c7b9e39192c8e234b6229517bfb5fb1ddc464a8bb4868784", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_01-964c12e.stdout", "stdout_hash": "79d783068ef101d85b2d255f13d1c941d77330b671fac6b7614c0d55", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kokkos_program2-8391215.stdout0000664000175000017500000006164015141516316026735 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kokkos_program2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nsize: (Variable 2 nsize [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), scalar: (Variable 2 scalar [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), triad: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Out () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), scalar: (Variable 3 scalar [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) triad (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Real 4) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) () (Integer 4) () ) () .false. .false. ) (DoConcurrentLoop [((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ())] [] [] [] [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4) ColMajor () ) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] )] () Public .false. .false. () ) }) kokkos_program2 [] [(Assignment (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 10.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 10000 (Integer 4) Decimal) ) () .false. .false. ) (DoConcurrentLoop [((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nsize) ())] [] [] [] [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. )] ) (SubroutineCall 2 triad () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () )) ((Var 2 scalar)) ((ArrayPhysicalCast (Var 2 c) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10000 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringConstant "End Stream Triad" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array_size_04-dcfa313.stderr0000664000175000017500000000032015141516316026533 0ustar alastairalastairsemantic error: Unrecognized keyword argument kind1 passed to size intrinsic. --> tests/errors/array_size_04.f90:5:14 | 5 | size_a = size(a, kind1=4, dim1=1) | ^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-atomic_01-1c877f0.stderr0000664000175000017500000000030115141516316025506 0ustar alastairalastairsemantic error: Atomic operations are not supported yet --> tests/errors/atomic_01.f90:4:5 | 4 | call atomic_add (atom[1], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-do1-0a89222.json0000664000175000017500000000101015141516316023773 0ustar alastairalastair{ "basename": "ast-do1-0a89222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do1.f90", "infile_hash": "d9f8fb8e2d3070078083b102420c5c27b9506873e1619343c90b8203", "outfile": null, "outfile_hash": null, "stdout": "ast-do1-0a89222.stdout", "stdout_hash": "9a6853d51ccec7ce1da61514e34be31c0e8fc545a1e106e4ec8883e5", "stderr": "ast-do1-0a89222.stderr", "stderr_hash": "821ed2d044760c06f9001637b4d80b3e0e930dccb08480b8b3f588b5", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-expr7-b630493.stdout0000664000175000017500000000004215141516316025413 0ustar alastairalastair5_int32 5_int64 5_l 5__l_3 5__l_3_lfortran-lfortran-2f73434/tests/reference/pass_loop_unroll-loop_unroll_large-8723774.json0000664000175000017500000000105215141516316031575 0ustar alastairalastair{ "basename": "pass_loop_unroll-loop_unroll_large-8723774", "cmd": "lfortran --pass=loop_unroll --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_large.f90", "infile_hash": "6dea35d299ef0d2baadd87d2ed6132d3e57e15e85a4bef2d609d1d22", "outfile": null, "outfile_hash": null, "stdout": "pass_loop_unroll-loop_unroll_large-8723774.stdout", "stdout_hash": "2d6317320abc094db2c4f16353ec591fe3a5536a411330005ffd5d9d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr1-e0e6d6b.json0000664000175000017500000000070415141516316024602 0ustar alastairalastair{ "basename": "asr-expr1-e0e6d6b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "asr-expr1-e0e6d6b.stdout", "stdout_hash": "87e8c124dc6636b5850e9cb14d78e25a20a1837c2afe9f39fbce1a50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics14-5a6d04e.stderr0000664000175000017500000000027715141516316026351 0ustar alastairalastairsemantic error: Unexpected args, Scale expects (real, int) as arguments --> tests/errors/intrinsics14.f90:2:14 | 2 | print *, scale([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-format_26-f627ed6.stdout0000664000175000017500000000002015141516316025651 0ustar alastairalastair 42 666 42 666 lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_05-d584fab.json0000664000175000017500000000074315141516316027720 0ustar alastairalastair{ "basename": "run-array_bounds_check_05-d584fab", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_05.f90", "infile_hash": "9ef4f46c35739ba9241c8707b603e057f3ec10d97212ae6dd2ec1796", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_05-d584fab.stderr", "stderr_hash": "fe29fd29e38fb094f329c6d6a9c0f87e94a6ea38a8a56e2a15384352", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-class_02-82c2f9c.json0000664000175000017500000000074515141516316025270 0ustar alastairalastair{ "basename": "llvm-class_02-82c2f9c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_02.f90", "infile_hash": "d9600a16766ae051943b344e946afd7523b8f9d66250d6cd908135cc", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_02-82c2f9c.stdout", "stdout_hash": "1fc108a7db692cb960ed3db482a7e394d40a073082c786694d758746", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-sync1-5d8b786.json0000664000175000017500000000071715141516316025140 0ustar alastairalastair{ "basename": "ast_f90-sync1-5d8b786", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/sync1.f90", "infile_hash": "363462c860cc54ea57727a4d2ee43782f907dd682bcafcb8fa2017cb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-sync1-5d8b786.stdout", "stdout_hash": "6a7ee91dfaa1f073b34287cf672a38961de6950f061a815621778d54", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-real_dp_01-b41f13e.stdout0000664000175000017500000001103615141516316025734 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { real_dp_01: (Program (SymbolTable 2 { v: (Variable 2 v [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) real_dp_01 [] [(Assignment (Var 2 zero) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 v) (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 1.050000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-program_03-374e848.json0000664000175000017500000000075315141516316025500 0ustar alastairalastair{ "basename": "llvm-program_03-374e848", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/program_03.f90", "infile_hash": "66e74edaf380b88bc4d65b0f35934f6857a8e67080628b16bd0e935a", "outfile": null, "outfile_hash": null, "stdout": "llvm-program_03-374e848.stdout", "stdout_hash": "5560475e6c9d14282bc9d5be1fcc964b58811ec8306ff4638831ad51", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_02-6d588ae.json0000664000175000017500000000075315141516316027156 0ustar alastairalastair{ "basename": "asr-dependency_test_02-6d588ae", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_02.f90", "infile_hash": "90fabf0105e9eee8d7001500b590bff2970e15d4abc43074d77349f1", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_02-6d588ae.stdout", "stdout_hash": "e14f093f68c501d006a5d0ff79db4d1d2f629affc8b9df9b1c97a52f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_float_of_int-4b9cf53.json0000664000175000017500000000075715141516316027147 0ustar alastairalastair{ "basename": "asr-kind_float_of_int-4b9cf53", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_float_of_int.f90", "infile_hash": "1162ce1a917f4ce2b50df7b8f496c081a1570e76122108e2108dc009", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_float_of_int-4b9cf53.stderr", "stderr_hash": "cdacf7eb32e15977e7cac4f156b8c8608b50b11cc5506f0f564fd170", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-array3-a030743.stdout0000664000175000017500000000256215141516316025071 0ustar alastairalastair(TranslationUnit [(Program array3 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () () [1 2 3] ) () ) (Assignment 0 b (ArrayInitializer () () [1 2 3] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-doconcurrentloop_02-2418c04.json0000664000175000017500000000101615141516316027672 0ustar alastairalastair{ "basename": "ast_f90-doconcurrentloop_02-2418c04", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doconcurrentloop_02.f90", "infile_hash": "972a21c452523a0a3060e6b1a0c75e868f5dd660ea5763358ccade86", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doconcurrentloop_02-2418c04.stdout", "stdout_hash": "1dac082ef96d3cdf03e2bdc4cce01528ddbcedb71c26845c26ac8bc7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_28-d8cdd42.stdout0000664000175000017500000000065415141516316025741 0ustar alastairalastair 0.100E+00 0.200E+00 0.300E+00 0.400E+00 (A,ES6.2E1) ****** (A,ES7.2E1) ******* (A,ES8.2E1) ******** (A,ES9.2E1) ********* ****** ******* 3.00E+20 ********* ********** *********** 0.E+0 1.E+1 3.E+0 3.E+5 1.E+10 -1.E+10 ******* ******* 1.230E-40 -1.230E-40 1.23E+2 1.23E+02 1.23E+002 1.00E+02 1.00E+00 9.99E+00 +1.23E+2 1.23E+2 **** ***** 0.0E+0 0.E+0 .29E+03 .29E+03 0.29E+03 .29E+00 0.12E+13 ******* lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_06-58bbdbc.stdout0000664000175000017500000000030615141516316030740 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Stop 0 () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-complex_pow_test-c556b63.json0000664000175000017500000000077215141516316027005 0ustar alastairalastair{ "basename": "asr-complex_pow_test-c556b63", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_pow_test.f90", "infile_hash": "cc3e566ed81771c2b1c24916ac5bcd29fde8fef80826cc84d56d72fa", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_pow_test-c556b63.stdout", "stdout_hash": "364697d7e6ad54b46f840360641542e0029aeaeeb5f96b1a3115d163", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_50-7def206.stdout0000664000175000017500000000020715141516316025647 0ustar alastairalastairtiny = 2.225E-308 huge = 1.798E+308 test = 1.235E+010 test =12.346E+009 test = 0.123E+011 tiny = 2.225E-0308 test = 1.235E+0010 PASSED lfortran-lfortran-2f73434/tests/reference/ast_f90-string_03-bda189f.json0000664000175000017500000000076015141516316026040 0ustar alastairalastair{ "basename": "ast_f90-string_03-bda189f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-string_03-bda189f.stdout", "stdout_hash": "ac059e0d3e3e31416bd5100be58a185940adf3491bf7f86809967147", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-implicit1-418fb10.stdout0000664000175000017500000000247515141516316026330 0ustar alastairalastairprogram implicit1 ! AST only implicit none implicit none implicit none implicit none (external) implicit none (type) implicit none (external, type) implicit none (type, external) implicit real (a-h,o-z) implicit real(dp) (a-h,o-z) implicit real(8) (a-h,o-z) implicit real(8) (a-h,o-z) implicit double precision (a-h,o-z) implicit character (c,o-z) implicit character(len=id) (a-z) implicit integer (i-n) implicit integer (i,j,k,l,m,n) implicit integer (i,j-l,m,n) implicit integer(dp) (a-h,o-z) implicit integer(8) (i,j-l,m,n) implicit integer (A,C) implicit integer(4) (C,D-x) implicit integer(4) (C,D-x) implicit logical (l,u-z) implicit logical(dp) (a-h,o-z) implicit logical(4) (l,u-z) implicit logical(4) (l,u-z) implicit complex (z) implicit complex(dp) (a-h,o-z) implicit complex (C) implicit complex(4) (z) implicit complex(4) (z) implicit type(BLOB) (A) implicit class(X) (A-b) implicit real(4) (a),real(4 + 4) (b),real(d) (d),real(d(2)) (a-z) implicit integer(4) (a),integer(4 + 4) (b),integer(d) (d),integer(d(2)) (a-z) implicit logical(4) (a),logical(4 + 4) (b),logical(d) (d),logical(d(2)) (a-z) implicit complex(4) (a),complex(4 + 4) (b),complex(d) (d),complex(d(2)) (a-z) implicit character(len=4, kind=c_char) (a) implicit character(len=4, kind=c_char) (a) implicit character(kind=c_char) (a) end program implicit1 lfortran-lfortran-2f73434/tests/reference/wat-logical3-ce72150.json0000664000175000017500000000104415141516316025077 0ustar alastairalastair{ "basename": "wat-logical3-ce72150", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "wat-logical3-ce72150.stdout", "stdout_hash": "0df3e13f4cffdb0b2d0fb9e7b841d761ccca090c557b1399e6307440", "stderr": "wat-logical3-ce72150.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-class_procedure_extra_args-543ebdc.json0000664000175000017500000000101215141516316031126 0ustar alastairalastair{ "basename": "asr-class_procedure_extra_args-543ebdc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/class_procedure_extra_args.f90", "infile_hash": "f53275da38d64c0a3c278bed536e3423f2ac0b91546f2c30ddf9570e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-class_procedure_extra_args-543ebdc.stderr", "stderr_hash": "f5a22cd690dbe013e7c1d0bc4205e17be3cd338286c55f69a5116c04", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-character_02-56bfff3.json0000664000175000017500000000106515141516316026007 0ustar alastairalastair{ "basename": "asr-character_02-56bfff3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_02.f90", "infile_hash": "8b839a8298fb3bcdf423c536b31f178985f93f1b62740bd3bb83aa8a", "outfile": null, "outfile_hash": null, "stdout": "asr-character_02-56bfff3.stdout", "stdout_hash": "ca1e83ad17e8d01db4f4bbfd32d2a5b5c6ed6f2d562d73c5ce0e74bb", "stderr": "asr-character_02-56bfff3.stderr", "stderr_hash": "b0d10fe88df62b1beb62226a5ac184ff6ef81b681425a016d9ee014f", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-rewind_inquire_flush-72b7f97.json0000664000175000017500000000100615141516316027640 0ustar alastairalastair{ "basename": "asr-rewind_inquire_flush-72b7f97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/rewind_inquire_flush.f90", "infile_hash": "8a55dc820362b5ab028d6f06d1edc7476b8b0f03a76e7d87655825ad", "outfile": null, "outfile_hash": null, "stdout": "asr-rewind_inquire_flush-72b7f97.stdout", "stdout_hash": "4af166ee6ba5519011f13d597ea0a948c62d86e59419991ce056e62d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-print_09-8516006.stdout0000664000175000017500000000040615141516316025274 0ustar alastairalastair0.140000001 123.456001 1.00000005E-03 1.49999996E-05 0.14000000000000001 456.78899999999999 1.0000000000000000E-004 0.140000001 123.456001 1.00000005E-03 1.49999996E-05 0.14000000000000001 456.78899999999999 1.0000000000000000E-004 lfortran-lfortran-2f73434/tests/reference/ast_f90-fn_call1-fcd6b9c.json0000664000175000017500000000073015141516316025766 0ustar alastairalastair{ "basename": "ast_f90-fn_call1-fcd6b9c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fn_call1.f90", "infile_hash": "fd319232dcd65e8f2c7722a5f8da034557658cb0a081224347fd1de6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fn_call1-fcd6b9c.stdout", "stdout_hash": "5f339fc44ee209b660588ca293bd90211b6797a86f69eada7ae5ef71", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-string_13-8952a13.json0000664000175000017500000000075015141516316025323 0ustar alastairalastair{ "basename": "llvm-string_13-8952a13", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_13.f90", "infile_hash": "25354bac77715f94447d94e23c5c51c4ece9145b600155f8a5cb4c9f", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_13-8952a13.stdout", "stdout_hash": "8f68f39ce484339bdc0e5ab52ca53d113d3d49f43c80ff3307a8fed3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_08-b380a57.stderr0000664000175000017500000000027215141516316027266 0ustar alastairalastairsemantic error: Operator `+` undefined for the types in the expression `t + t` --> tests/errors/template_error_08.f90:22:17 | 22 | z = x + y | ^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-substring-59dd84f.json0000664000175000017500000000072015141516316025517 0ustar alastairalastair{ "basename": "ast-substring-59dd84f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/substring.f90", "infile_hash": "c8a378c73c450c69e6694f02f51b2e1706ee25ae2e9645c28fd98788", "outfile": null, "outfile_hash": null, "stdout": "ast-substring-59dd84f.stdout", "stdout_hash": "5ce0edb1c1102420bfc100af59a72b8b5505be81563698c68d39067c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics8-6c1e53e.json0000664000175000017500000000073515141516316025744 0ustar alastairalastair{ "basename": "asr-intrinsics8-6c1e53e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics8.f90", "infile_hash": "9b631de39a99a46aa17f154cad0d2ee561c62e453115eb29cafebefe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics8-6c1e53e.stderr", "stderr_hash": "44334de20cf2be954d250d152cf7c59ecf37feb09dbd68167e510713", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-sin_03-14abee4.stdout0000664000175000017500000000450315141516316025367 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca double, align 8 store double 0x3FEFEB7A9B2C6D8B, double* %x, align 8 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, double* %x) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_sin_03 FINALIZE_SYMTABLE_sin_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_04-f7dffdb.stderr0000664000175000017500000000023715141516316030773 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_04.f90:11:10 | 11 | where(c) b = 12121 | ^ lfortran-lfortran-2f73434/tests/reference/ast-array4-3d07222.stdout0000664000175000017500000000164515141516316025075 0ustar alastairalastair(TranslationUnit [(Program array4 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 i a [(some_array [(() 5 () 0)])] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops2-98464d0.stdout0000664000175000017500000001626415141516316027316 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop2: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) implied_do_loop2 [] [(Assignment (Var 2 array) (ArrayReshape (ArrayConstructor [(ImpliedDoLoop [(Var 2 i) (ImpliedDoLoop [(IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) () (Integer 4) () )] (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) (ArrayPhysicalCast (ArrayConstant 8 [3, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 array)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_travel_02-4448a71.json0000664000175000017500000000100015141516316027003 0ustar alastairalastair{ "basename": "asr-template_travel_02-4448a71", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_02.f90", "infile_hash": "045f7caf874cd599c9a9fb7115ab3b9d0341395565a1387bdfdaf16b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_02-4448a71.stdout", "stdout_hash": "25cc789cc0e1f3ac053ddfa17ab051252872cc44dc7913e184115659", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-return1-517cbf1.json0000664000175000017500000000103015141516316025053 0ustar alastairalastair{ "basename": "ast-return1-517cbf1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/return1.f90", "infile_hash": "f77416f3b212e5cf5dddc4d2dee526355570f140dfa2dbc033bc84e7", "outfile": null, "outfile_hash": null, "stdout": "ast-return1-517cbf1.stdout", "stdout_hash": "d9595f897e3a19952b001c974bd21259e0872fd0ecaaebcdf29d91c6", "stderr": "ast-return1-517cbf1.stderr", "stderr_hash": "97e4ee7f017f858be24662871fe3e1ab033a7cd4bae84c20209d0502", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr3-1bb382e.stdout0000664000175000017500000000017415141516316025073 0ustar alastairalastair(TranslationUnit [5 (+ 5 3) (* (+ 5 3) 2) (+ 5 (* 3 2)) (- 5 3) (** 4 3) (+ 5 3) (+ 5 3)] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_logical-8df9344.json0000664000175000017500000000077015141516316027554 0ustar alastairalastair{ "basename": "asr-kind_star_of_logical-8df9344", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_star_of_logical.f90", "infile_hash": "846e56ce5f99321a473bb4424f13b70823958a7ddfca4c59c0e8b621", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_star_of_logical-8df9344.stderr", "stderr_hash": "c1ab6c3a4e54b2e0ea74d0814ff410713ab98d3e41ebdfd4af89ce34", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-return_01-495409d.stderr0000664000175000017500000000026115141516316025666 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/return_01.f90:9:15 | 9 | if (i .GT. 5) then | ^^^^ help: write this as '>' lfortran-lfortran-2f73434/tests/reference/asr-modules_12-744ab27.json0000664000175000017500000000075015141516316025355 0ustar alastairalastair{ "basename": "asr-modules_12-744ab27", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_12.f90", "infile_hash": "aba2ca12e578c5e6c071c1baf18c66272a5c54a88a9c73d8f05e6196", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_12-744ab27.stdout", "stdout_hash": "e3cd46c81f3ebbd83caed5b5145deef73797593c7c3c2defae820698", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_52-5261d38.stdout0000664000175000017500000010646415141516316025665 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_52_fpm_cmd_new: (Module (SymbolTable 2 { validate_toml_data: (Function (SymbolTable 3 { input: (Variable 3 input [] In () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), table: (Variable 3 table [] Local () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 3 toml_table Source Public Required .false. .false. .false. () .false. .false. ), toml_parse: (ExternalSymbol 3 toml_parse 5 toml_parse module_52_tomlf_de [] toml_parse Public ), toml_parse@toml_parse_string: (ExternalSymbol 3 toml_parse@toml_parse_string 5 toml_parse_string module_52_tomlf_de [] toml_parse_string Private ), toml_parse_string@toml_parse: (ExternalSymbol 3 toml_parse_string@toml_parse 5 toml_parse_string module_52_tomlf_de [] toml_parse_string Public ), toml_parse_unit@toml_parse: (ExternalSymbol 3 toml_parse_unit@toml_parse 5 toml_parse_unit module_52_tomlf_de [] toml_parse_unit Public ), toml_table: (ExternalSymbol 3 toml_table 12 toml_table module_52_tomlf_type [] toml_table Public ) }) validate_toml_data (FunctionType [(Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 input)] [(If () (IntrinsicImpureFunction Allocated [(Var 3 table)] 0 (Logical 4) () ) [(ExplicitDeallocate [(Var 3 table)] )] [] ) (ImplicitDeallocate [(Var 3 table)] ) (SubroutineCall 3 toml_parse@toml_parse_string 3 toml_parse [((Var 3 table)) ((Var 3 input)) (())] () .false. )] () Public .false. .false. () ) }) module_52_fpm_cmd_new () [module_52_tomlf_de module_52_tomlf_type] .false. .false. .false. ), module_52_tomlf_de: (Module (SymbolTable 5 { toml_error: (ExternalSymbol 5 toml_error 9 toml_error module_52_tomlf_error [] toml_error Public ), toml_parse: (GenericProcedure 5 toml_parse [5 toml_parse_unit 5 toml_parse_string] Public ), toml_parse_string: (Function (SymbolTable 6 { conf: (Variable 6 conf [] In () () Default (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .true. .false. () .false. .false. ), error: (Variable 6 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4)] [] .true. .false. ) ) 5 toml_error Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 6 table [] Out () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 5 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) toml_parse_string (FunctionType [(Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4)] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 table) (Var 6 conf) (Var 6 error)] [] () Public .false. .false. () ), toml_parse_unit: (Function (SymbolTable 7 { error: (Variable 7 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4)] [] .true. .false. ) ) 5 toml_error Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 7 table [] Out () () Default (Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 5 toml_table Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 7 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_parse_unit (FunctionType [(Allocatable (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4)] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 table) (Var 7 unit) (Var 7 error)] [] () Public .false. .false. () ), toml_table: (ExternalSymbol 5 toml_table 12 toml_table module_52_tomlf_type [] toml_table Public ) }) module_52_tomlf_de () [module_52_tomlf_error module_52_tomlf_type] .true. .false. .false. ), module_52_tomlf_error: (Module (SymbolTable 9 { toml_error: (Struct (SymbolTable 10 { message: (Variable 10 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 10 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_error (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4)] [] .true. .false. ) [] [stat message] [] Source Public .false. .false. [] () () ) }) module_52_tomlf_error () [] .true. .false. .false. ), module_52_tomlf_type: (Module (SymbolTable 12 { toml_table: (Struct (SymbolTable 13 { implicit: (Variable 13 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), inline: (Variable 13 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () () ) }) module_52_tomlf_type () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_4-656a640.stderr0000664000175000017500000000021115141516316026215 0ustar alastairalastairsyntax error: Token ')' is unexpected here --> tests/errors/fixed_form_4.f:4:19 | 4 | 500 print *, sin), y | ^ lfortran-lfortran-2f73434/tests/reference/ast-array2-7b9505c.stdout0000664000175000017500000001155715141516316025171 0ustar alastairalastair(TranslationUnit [(Program array2 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 5 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr)] )] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 2 DimensionExpr)] )] [(d [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 3 DimensionExpr)] )] [(e [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 4 DimensionExpr)] )] [(f [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 5 DimensionExpr) (1 2 DimensionExpr)] )] [(g [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 2 DimensionExpr) (1 3 DimensionExpr) (1 4 DimensionExpr)] )] [(h [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrDimension [(1 3 DimensionExpr) (1 4 DimensionExpr) (1 3 DimensionExpr)] )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrDimension [(1 5 DimensionExpr) (1 2 DimensionExpr) (1 2 DimensionExpr)] )] [(j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-doloop_04-e25bf76.json0000664000175000017500000000075015141516316025455 0ustar alastairalastair{ "basename": "llvm-doloop_04-e25bf76", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_04-e25bf76.stdout", "stdout_hash": "5e5baf1d0a606f74493997c21341161742e8dd99844ac4ebbc195fd4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_29-dc71c55.stdout0000664000175000017500000026036715141516316026033 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_git1: (Module (SymbolTable 15 { git_target_branch: (Function (SymbolTable 17 { 1_git_target_t_object: (ExternalSymbol 17 1_git_target_t_object 16 object git_target_t [] object Public ), 1_git_target_t_url: (ExternalSymbol 17 1_git_target_t_url 16 url git_target_t [] url Public ), branch: (Variable 17 branch [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 17 self [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 15 git_target_t Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 17 url [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) git_target_branch (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 url) (Var 17 branch)] [(Assignment (StructInstanceMember (Var 17 self) 17 1_git_target_t_url (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 17 url) () .false. .false. ) (Assignment (StructInstanceMember (Var 17 self) 17 1_git_target_t_object (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 17 branch) () .false. .false. )] (Var 17 self) Public .false. .false. () ), git_target_t: (Struct (SymbolTable 16 { object: (Variable 16 object [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 16 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) git_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [url object] [] Source Public .false. .false. [] () () ) }) fpm_git1 () [] .true. .false. .false. ), fpm_manifest_dependency1: (Module (SymbolTable 8 { dependency_config_t: (Struct (SymbolTable 9 { git: (Variable 9 git [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 8 git_target_t Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 9 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 9 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_config_t (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path git] [] Source Public .false. .false. [] () () ), error_t: (Struct (SymbolTable 10 { message: (Variable 10 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () ), git_target_branch: (ExternalSymbol 8 git_target_branch 15 git_target_branch fpm_git1 [] git_target_branch Public ), git_target_t: (ExternalSymbol 8 git_target_t 15 git_target_t fpm_git1 [] git_target_t Public ), new_dependencies: (Function (SymbolTable 12 { deps: (Variable 12 deps [] Out () () Default (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 8 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. ), error: (Variable 12 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 8 error_t Source Public Required .false. .false. .false. () .false. .false. ), root: (Variable 12 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 12 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 8 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) new_dependencies (FunctionType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (StructType [(Logical 4)] [] .true. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 deps) (Var 12 table) (Var 12 root) (Var 12 error)] [] () Public .false. .false. () ), new_dependency: (Function (SymbolTable 13 { 1_dependency_config_t_git: (ExternalSymbol 13 1_dependency_config_t_git 9 git dependency_config_t [] git Public ), obj: (Variable 13 obj [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 13 self [] Out () () Default (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. ), url: (Variable 13 url [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_dependency (FunctionType [(StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) [] () () ())] () () () )] [] ) (Assignment (StructInstanceMember (Var 13 self) 13 1_dependency_config_t_git (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (FunctionCall 8 git_target_branch () [((Var 13 url)) ((Var 13 obj))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. )] () Public .false. .false. () ), toml_table: (Struct (SymbolTable 11 { inline: (Variable 11 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () ) }) fpm_manifest_dependency1 () [fpm_git1] .true. .false. .false. ), fpm_manifest_executable: (Module (SymbolTable 4 { dependency_config_t: (ExternalSymbol 4 dependency_config_t 8 dependency_config_t fpm_manifest_dependency1 [] dependency_config_t Public ), error_t: (ExternalSymbol 4 error_t 8 error_t fpm_manifest_dependency1 [] error_t Public ), executable_config_t: (Struct (SymbolTable 5 { dependency: (Variable 5 dependency [] Local () () Default (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 dependency_config_t Source Public Required .false. .false. .false. () .false. .false. ), main: (Variable 5 main [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), source_dir: (Variable 5 source_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) executable_config_t (StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name source_dir main dependency] [] Source Public .false. .false. [] () () ), new_dependencies: (ExternalSymbol 4 new_dependencies 8 new_dependencies fpm_manifest_dependency1 [] new_dependencies Public ), new_executable: (Function (SymbolTable 6 { 1_executable_config_t_dependency: (ExternalSymbol 6 1_executable_config_t_dependency 5 dependency executable_config_t [] dependency Public ), child: (Variable 6 child [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ), error: (Variable 6 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 6 self [] Out () () Default (StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 4 executable_config_t Source Public Required .false. .false. .false. () .false. .false. ), table: (Variable 6 table [] InOut () () Default (StructType [(Logical 4)] [] .true. .false. ) 4 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) new_executable (FunctionType [(StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Logical 4)] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 table) (Var 6 error)] [(ImplicitDeallocate [(Var 6 error)] ) (SubroutineCall 4 new_dependencies () [((StructInstanceMember (Var 6 self) 6 1_executable_config_t_dependency (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () )) ((Var 6 child)) (()) ((Var 6 error))] () .false. )] () Public .false. .false. () ), toml_table: (ExternalSymbol 4 toml_table 8 toml_table fpm_manifest_dependency1 [] toml_table Public ) }) fpm_manifest_executable () [fpm_manifest_dependency1] .true. .false. .false. ), modules_29: (Program (SymbolTable 2 { dependency_config_t: (ExternalSymbol 2 dependency_config_t 8 dependency_config_t fpm_manifest_dependency1 [] dependency_config_t Public ), error_t: (ExternalSymbol 2 error_t 8 error_t fpm_manifest_dependency1 [] error_t Public ), executable_config_t: (ExternalSymbol 2 executable_config_t 4 executable_config_t fpm_manifest_executable [] executable_config_t Public ), new_dependencies: (ExternalSymbol 2 new_dependencies 8 new_dependencies fpm_manifest_dependency1 [] new_dependencies Public ), new_executable: (ExternalSymbol 2 new_executable 4 new_executable fpm_manifest_executable [] new_executable Public ), toml_table: (ExternalSymbol 2 toml_table 8 toml_table fpm_manifest_dependency1 [] toml_table Public ) }) modules_29 [fpm_manifest_executable] [(Print (StringConstant "running modules_29 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_41-d6b8ce9.stdout0000664000175000017500000005321115141516316027300 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_41: (Program (SymbolTable 4 { 1_mytype_a: (ExternalSymbol 4 1_mytype_a 3 a mytype [] a Public ), 1_mytype_b: (ExternalSymbol 4 1_mytype_b 3 b mytype [] b Public ), 1_mytype_c: (ExternalSymbol 4 1_mytype_c 3 c mytype [] c Public ), mytype: (ExternalSymbol 4 mytype 2 mytype derived_types_41_mod [] mytype Public ), mytype_instance: (ExternalSymbol 4 mytype_instance 2 mytype_instance derived_types_41_mod [] mytype_instance Public ) }) derived_types_41 [derived_types_41_mod] [(If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_a (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_b (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 4 mytype_instance) 4 1_mytype_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ), derived_types_41_mod: (Module (SymbolTable 2 { mytype: (Struct (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) mytype (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () ), mytype_instance: (Variable 2 mytype_instance [] Local (StructConstant 2 mytype [((ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor )) ((IntegerConstant 3 (Integer 4) Decimal)) ((ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) ) (StructConstant 2 mytype [((ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor )) ((IntegerConstant 3 (Integer 4) Decimal)) ((ArrayConstant 8 [4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) ) Default (StructType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) 2 mytype Source Public Required .false. .false. .false. () .false. .false. ) }) derived_types_41_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-print5-c57814b.stdout0000664000175000017500000000001015141516316025204 0ustar alastairalastairABCXYZ lfortran-lfortran-2f73434/tests/reference/asr-template_error_02-a3d3b4c.stderr0000664000175000017500000000136215141516316027413 0ustar alastairalastairsemantic error: Number of arguments mismatch, restriction expects a function with 2 parameters, but a function with 3 parameters is provided --> tests/errors/template_error_02.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ func_arg_real has 3 parameters | 28 | real function func_arg_real(x, y, a) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ func_arg_real has 3 parameters | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ f has 2 parameters lfortran-lfortran-2f73434/tests/reference/asr-string_02-bc2a3b9.json0000664000175000017500000000074515141516316025351 0ustar alastairalastair{ "basename": "asr-string_02-bc2a3b9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_02.f90", "infile_hash": "249fc849c605e3aad0bd2c8a33e00523fdc2270b95caa69737801caa", "outfile": null, "outfile_hash": null, "stdout": "asr-string_02-bc2a3b9.stdout", "stdout_hash": "1ebb335c3bcabd73a68d72cd68968e82d8f624d48491b87dc74d1fe0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/tokens-expr8-00c1054.stdout0000664000175000017500000000120115141516316025432 0ustar alastairalastair(TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 123) (NEWLINE) (TOKEN "identifier" j) (TOKEN "=") (TOKEN "integer" 123456789824390874092509458720948720947502984752098457242092870987) (NEWLINE) (TOKEN "identifier" k) (TOKEN "=") (TOKEN "integer" 2) (TOKEN "*") (TOKEN "integer" 18446744073709551616) (NEWLINE) (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 123_i8) (NEWLINE) (TOKEN "identifier" j) (TOKEN "=") (TOKEN "integer" 123456789824390874092509458720948720947502984752098457242092870987_i8) (NEWLINE) (TOKEN "identifier" k) (TOKEN "=") (TOKEN "integer" 2) (TOKEN "*") (TOKEN "integer" 18446744073709551616_i8) (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/asr-sign_from_value-b974070.json0000664000175000017500000000076715141516316026514 0ustar alastairalastair{ "basename": "asr-sign_from_value-b974070", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sign_from_value.f90", "infile_hash": "8dbaf3021ce3488c9846d4b6f9ffca21e9d2a2e6f4dfaa10cf7a844c", "outfile": null, "outfile_hash": null, "stdout": "asr-sign_from_value-b974070.stdout", "stdout_hash": "87ec0ab0c65b6c6af4b2115bc8c6cc33066ee6e23b043d6af604bed4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-format_03-c54e532.json0000664000175000017500000000076015141516316025200 0ustar alastairalastair{ "basename": "ast-format_03-c54e532", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_03.f", "infile_hash": "107455615125bad6c1e6c16c87933b0eb35e24f89ade881088aa8acc", "outfile": null, "outfile_hash": null, "stdout": "ast-format_03-c54e532.stdout", "stdout_hash": "f6730381d2371bd1c655a9d3a7d35b47f4d6a952b429b6169f56fb37", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_real-6cb0873.stdout0000664000175000017500000010333015141516316026560 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_real: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01_real [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 8) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 8) ColMajor () ) (Cast (Var 2 i) IntegerToReal (Real 8) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 14.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 8) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) ) (Real 8) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 1.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 2.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 3.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (Real 8) () ) () .false. .false. ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 17 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 17.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) () .false. .false. ) (If () (RealCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 8) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) () .false. .false. )] [] )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 13.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 14.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-class_01-82031c0.json0000664000175000017500000000074515141516316025107 0ustar alastairalastair{ "basename": "llvm-class_01-82031c0", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/class_01.f90", "infile_hash": "d56b80167c24a798a3f70abbc77b31570b560e826ce6b96ab9476bab", "outfile": null, "outfile_hash": null, "stdout": "llvm-class_01-82031c0.stdout", "stdout_hash": "bfcbaec26eb0e70d98af8579f7d95d1d7363e4a97f43ffc0ea65252c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-select_type_02-6e04a0b.stdout0000664000175000017500000007421715141516316026655 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type_collection: (Module (SymbolTable 2 { point: (Struct (SymbolTable 3 { x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point (StructType [(Real 4) (Real 4)] [] .true. .false. ) [] [x y] [] Source Public .false. .false. [] () () ) }) derived_type_collection () [] .false. .false. .false. ), select_type_02: (Program (SymbolTable 4 { 1_color_point_color: (ExternalSymbol 4 1_color_point_color 6 color color_point [] color Public ), 1_point_3d_z: (ExternalSymbol 4 1_point_3d_z 5 z point_3d [] z Public ), 1_point_x: (ExternalSymbol 4 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 4 1_point_y 3 y point [] y Public ), color_point: (Struct (SymbolTable 6 { color: (Variable 6 color [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) color_point (StructType [(Integer 4)] [] .true. .false. ) [] [color] [] Source Public .false. .false. [] () 4 point ), cp: (Variable 4 cp [] Local () () Default (StructType [(Integer 4)] [] .true. .false. ) 4 color_point Source Public Required .false. .true. .false. () .false. .false. ), p: (Variable 4 p [] Local () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 4 point Source Public Required .false. .true. .false. () .false. .false. ), p3d: (Variable 4 p3d [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 4 point_3d Source Public Required .false. .true. .false. () .false. .false. ), p_or_cp: (Variable 4 p_or_cp [] Local () () Default (Pointer (StructType [(Real 4) (Real 4)] [] .false. .false. ) ) 4 point Source Public Required .false. .false. .false. () .false. .false. ), point: (ExternalSymbol 4 point 2 point derived_type_collection [] point Public ), point_3d: (Struct (SymbolTable 5 { z: (Variable 5 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) point_3d (StructType [(Real 4)] [] .true. .false. ) [] [z] [] Source Public .false. .false. [] () 4 point ), ~select_type_block_: (Block (SymbolTable 7 { 1_point_x: (ExternalSymbol 7 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 7 1_point_y 3 y point [] y Public ), an: (Variable 7 an [] Local () () Default (Pointer (StructType [(Real 4) (Real 4)] [] .false. .false. ) ) 4 point Source Public Required .false. .false. .false. () .false. .false. ) }) ~select_type_block_ [(Associate (Var 7 an) (Var 4 p_or_cp) ) (Print (StringFormat () [(StringConstant "point: " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 7 an) 7 1_point_x (Real 4) () ) (StructInstanceMember (Var 7 an) 7 1_point_y (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), ~select_type_block_1: (Block (SymbolTable 8 { 1_color_point_color: (ExternalSymbol 8 1_color_point_color 6 color color_point [] color Public ), 1_point_x: (ExternalSymbol 8 1_point_x 3 x point [] x Public ), 1_point_y: (ExternalSymbol 8 1_point_y 3 y point [] y Public ), an: (Variable 8 an [] Local () () Default (Pointer (StructType [(Integer 4)] [] .true. .false. ) ) 4 color_point Source Public Required .false. .false. .false. () .false. .false. ) }) ~select_type_block_1 [(Associate (Var 8 an) (Var 4 p_or_cp) ) (Print (StringFormat () [(StringConstant "color_point: " (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 8 an) 8 1_point_x (Real 4) () ) (StructInstanceMember (Var 8 an) 8 1_point_y (Real 4) () ) (StructInstanceMember (Var 8 an) 8 1_color_point_color (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) select_type_02 [derived_type_collection] [(Assignment (StructInstanceMember (Var 4 p) 4 1_point_x (Real 4) () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p) 4 1_point_y (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_x (Real 4) () ) (RealConstant 3.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_y (Real 4) () ) (RealConstant 4.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 p3d) 4 1_point_3d_z (Real 4) () ) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_point_x (Real 4) () ) (RealConstant 6.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_point_y (Real 4) () ) (RealConstant 7.000000 (Real 4) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 cp) 4 1_color_point_color (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 4 p_or_cp) (Var 4 cp) ) (SelectType (Var 4 p_or_cp) an [(ClassStmt 4 point [(BlockCall -1 4 ~select_type_block_ )] ) (TypeStmtName 4 color_point [(BlockCall -1 4 ~select_type_block_1 )] )] [] )] ) }) [] ) ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/obj-valid_array_assignment_same_length_different_start-9ec7ffc.jsonlfortran-lfortran-2f73434/tests/reference/obj-valid_array_assignment_same_length_different_start-9ec0000664000175000017500000000073615141516316034450 0ustar alastairalastair{ "basename": "obj-valid_array_assignment_same_length_different_start-9ec7ffc", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/../integration_tests/valid_array_assignment_same_length_different_start.f90", "infile_hash": "21b0a7101b9336ee2eded7884da2046247ffa00ddacad8003ce71fef", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine4-a425266.json0000664000175000017500000000072615141516316025610 0ustar alastairalastair{ "basename": "asr-subroutine4-a425266", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine4-a425266.stdout", "stdout_hash": "c6559922851898ca672daa81c4a6fedabca849caffc1d7714f784e79", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-array1-d75d040.stdout0000664000175000017500000000630415141516316025146 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_5_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_5_1(Kokkos::View* data_): data{data_} {}; }; struct f32_2_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; f32_2_3_2(Kokkos::View* data_): data{data_} {}; }; struct f32_1_2_3_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; f32_1_2_3_3(Kokkos::View* data_): data{data_} {}; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct i32_6_3_2 { Kokkos::View* data; dimension_descriptor dims[2]; bool is_allocated; i32_6_3_2(Kokkos::View* data_): data{data_} {}; }; struct i32_4_3_2_3 { Kokkos::View* data; dimension_descriptor dims[3]; bool is_allocated; i32_4_3_2_3(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { bool a; Kokkos::View& b; Kokkos::View& b2; Kokkos::View& b3; float d; Kokkos::View e_data("e_data", 5); f32_5_1 e_value(&e_data); f32_5_1* e = &e_value; e->dims[0].lower_bound = 1; e->dims[0].length = 5; Kokkos::View e2_data("e2_data", 6); f32_2_3_2 e2_value(&e2_data); f32_2_3_2* e2 = &e2_value; e2->dims[0].lower_bound = 1; e2->dims[0].length = 2; e2->dims[1].lower_bound = 1; e2->dims[1].length = 3; Kokkos::View e3_data("e3_data", 6); f32_1_2_3_3 e3_value(&e3_data); f32_1_2_3_3* e3 = &e3_value; e3->dims[0].lower_bound = 1; e3->dims[0].length = 1; e3->dims[1].lower_bound = 1; e3->dims[1].length = 2; e3->dims[2].lower_bound = 1; e3->dims[2].length = 3; int32_t f; Kokkos::View g_data("g_data", 3); i32_3_1 g_value(&g_data); i32_3_1* g = &g_value; g->dims[0].lower_bound = 1; g->dims[0].length = 3; Kokkos::View g2_data("g2_data", 18); i32_6_3_2 g2_value(&g2_data); i32_6_3_2* g2 = &g2_value; g2->dims[0].lower_bound = 1; g2->dims[0].length = 6; g2->dims[1].lower_bound = 1; g2->dims[1].length = 3; Kokkos::View g3_data("g3_data", 24); i32_4_3_2_3 g3_value(&g3_data); i32_4_3_2_3* g3 = &g3_value; g3->dims[0].lower_bound = 1; g3->dims[0].length = 4; g3->dims[1].lower_bound = 1; g3->dims[1].length = 3; g3->dims[2].lower_bound = 1; g3->dims[2].length = 2; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/julia-arrays_05-f639a33.stdout0000664000175000017500000000053515141516316026105 0ustar alastairalastairfunction main() local i::Int32 local numbers::Array{Float32, 1} = [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] for i ∈ 1:5 numbers[i] = Float32(i) * 2.00000000000000000e+00 end numbers .= [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] end main() lfortran-lfortran-2f73434/tests/reference/asr-flush2-9767ece.stdout0000664000175000017500000000400115141516316025247 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flush2: (Program (SymbolTable 2 { }) flush2 [] [(Flush 0 (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () () () ) (FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () () () () () () () ) (Flush 0 (IntegerConstant 10 (Integer 4) Decimal) () () () ) (Flush 0 (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () () () )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-array2-4254183.json0000664000175000017500000000071215141516316024626 0ustar alastairalastair{ "basename": "llvm-array2-4254183", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "llvm-array2-4254183.stdout", "stdout_hash": "612e492ee35276493db1a63afe58c7779b7562cd13f144802e5ad2e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-where_04-a7fce45.json0000664000175000017500000000074215141516316025165 0ustar alastairalastair{ "basename": "asr-where_04-a7fce45", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_04.f90", "infile_hash": "48449a9af8d215a5a118d0776d25e23b7b310df89b1775164ddfde5e", "outfile": null, "outfile_hash": null, "stdout": "asr-where_04-a7fce45.stdout", "stdout_hash": "4017e45f367755cd3d8b4dbf5bb7a3ccd479e70d1ba2312d9407b57b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fn2-b585098.json0000664000175000017500000000067615141516316024031 0ustar alastairalastair{ "basename": "asr-fn2-b585098", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn2.f90", "infile_hash": "9f61561c47397aa03014fe07094ac838ada4865e513025e384edae00", "outfile": null, "outfile_hash": null, "stdout": "asr-fn2-b585098.stdout", "stdout_hash": "5351ec2cce111361eef4069528e1c452c45611b343b90a3aac6e2ffb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit1-7817d96.stdout0000664000175000017500000000402015141516316030002 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 a) LtE (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "h" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_01-a91206c.json0000664000175000017500000000074215141516316025043 0ustar alastairalastair{ "basename": "asr-types_01-a91206c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "asr-types_01-a91206c.stdout", "stdout_hash": "65b50c3857198c60241c3e4f4b96de0696c2110e3fc9df6cf01133a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence1-98d138a.stdout0000664000175000017500000000175215141516316031571 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":9},"end":{"character":20,"line":9}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":1,"line":10},"end":{"character":4,"line":10}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":7,"line":10},"end":{"character":10,"line":10}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":11},"end":{"character":13,"line":11}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":12,"line":2},"end":{"character":15,"line":2}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":3},"end":{"character":13,"line":3}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":1,"line":4},"end":{"character":4,"line":4}},"uri":"uri"},"name":"abc"},{"kind":9,"location":{"range":{"start":{"character":10,"line":5},"end":{"character":13,"line":5}},"uri":"uri"},"name":"abc"}]lfortran-lfortran-2f73434/tests/reference/asr-bindc_06-1fdaca6.json0000664000175000017500000000074215141516316025203 0ustar alastairalastair{ "basename": "asr-bindc_06-1fdaca6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc_06.f90", "infile_hash": "440638103af48bc45af28612b54a8986473962b10a857a1054bf9450", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc_06-1fdaca6.stdout", "stdout_hash": "5236760b26d24a895e36e888a227228791e77ab2b40aaadf695d2b76", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_05-5a73322.json0000664000175000017500000000076415141516316026202 0ustar alastairalastair{ "basename": "llvm-intrinsics_05-5a73322", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_05.f90", "infile_hash": "735edff1f9942ce107c1b84f9ddcf00e648e553327f54dacf7b8238c", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_05-5a73322.stdout", "stdout_hash": "e23d4ab3636ed25f486d8919b314f73808c632a7f8cde0a15e62efc9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-init1-a99a704.json0000664000175000017500000000071315141516316024434 0ustar alastairalastair{ "basename": "ast-init1-a99a704", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/init1.f90", "infile_hash": "9ec670cb5b8c7f2baae3997ae0911acdd19199100666c44da310ff4f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-init1-a99a704.stderr", "stderr_hash": "201d19c7bf14660170792288e575568c171f968dfe1987869b73324b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-real_dp_param-3adbc5b.stdout0000664000175000017500000001545115141516316026757 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { real_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local (Cast (RealConstant 1.050000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.050000 (Real 8) ) ) (RealConstant 1.050000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (RealConstant 0.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) real_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err2-aa1ccd3.json0000664000175000017500000000076015141516316027572 0ustar alastairalastair{ "basename": "asr_preprocess-cpp_err2-aa1ccd3", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp_err2.f90", "infile_hash": "008e95f545b9763c8060a2b4a9866ced9e1ebba05b0520dabee43dbb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp_err2-aa1ccd3.stderr", "stderr_hash": "bd0c715e440fc2ec42c75a09729a7fafb8c0a561845212a55fdb113f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit1-7817d96.json0000664000175000017500000000077415141516316027445 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit1-7817d96", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit1.f", "infile_hash": "23368f2fe6f6771c71559e99af7296e68d793e5df5a6a69aa6c39f62", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit1-7817d96.stdout", "stdout_hash": "71a1167e587cb447e61920f374910a202e8dfb21c9f8ebae515039f1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-implicit_argument_casting_01-0d962d9.json0000664000175000017500000000110615141516316031151 0ustar alastairalastair{ "basename": "run-implicit_argument_casting_01-0d962d9", "cmd": "lfortran --implicit-argument-casting --disable-implicit-argument-casting --no-color {infile}", "infile": "tests/../integration_tests/implicit_argument_casting_01.f90", "infile_hash": "3ed389916666e17233ec1aa288c9e7cfee00c97aacc83db1aeec5c7b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-implicit_argument_casting_01-0d962d9.stderr", "stderr_hash": "79cbdb3deeefc4c8dea93fb4b13541c2b274bce36ad244f5530895b1", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-dnint_args-3d72f4b.stderr0000664000175000017500000000023615141516316026145 0ustar alastairalastairsemantic error: Too many arguments to call `dnint` --> tests/errors/dnint_args.f90:2:13 | 2 | print*, dnint(1.0_8, 8) | ^^^^^^^^^^^^^^^ ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.stdoutlfortran-lfortran-2f73434/tests/reference/fortran-complex_to_complex_cast_fortran_codegen-d2ad266.st0000664000175000017500000000060515141516316034154 0ustar alastairalastairprogram implicitcomplextocomplexdifferentkindexample implicit none complex(4) :: complexvalue1 complex(8) :: complexvalue2 complexvalue1 = cmplx(1.00000000e+00, 2.00000000e+00) complexvalue2 = cmplx(complexvalue1, kind=8) print *, "Complex Value 1 (Default Kind):", complexvalue1 print *, "Complex Value 2 (Kind=8):", complexvalue2 end program implicitcomplextocomplexdifferentkindexample lfortran-lfortran-2f73434/tests/reference/ast-program1-caa9665.stdout0000664000175000017500000000133615141516316025573 0ustar alastairalastair(TranslationUnit [(Program program1 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (Print 0 () [i] () ) (Print 0 () [(+ i 1)] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/c-expr_11-8e5ae80.stdout0000664000175000017500000000050615141516316024754 0ustar alastairalastair #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); double x; x = ( 2.00000000000000000e+00*x + 1.00000000000000000e+00)/(x*(x + (double)(1))); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-global_scope4-1af6ab9.stdout0000664000175000017500000000212015141516316026621 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () )] ) lfortran-lfortran-2f73434/tests/reference/asr-doloop_01-bb1c596.stdout0000664000175000017500000000543415141516316025635 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_01 [] [(DoLoop () ((Var 2 i) (Cast (RealConstant 1.500000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (Cast (RealConstant 10.500000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) (Cast (RealConstant 2.400000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) )) [(Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_03-86dce2a.stdout0000664000175000017500000001462715141516316027605 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2: (Module (SymbolTable 4 { check_commandline: (Function (SymbolTable 5 { default_help: (Function (SymbolTable 6 { ilength: (Variable 6 ilength [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) default_help (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(IntrinsicImpureSubroutine GetCommandArgument [(IntegerConstant 0 (Integer 4) Decimal) (Var 6 ilength)] 2 )] () Public .false. .false. () ) }) check_commandline (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 5 default_help () [] () .false. )] () Public .false. .false. () ) }) m_cli2 () [] .true. .false. .false. ), m_cli2_user: (Module (SymbolTable 2 { check_commandline: (ExternalSymbol 2 check_commandline 4 check_commandline m_cli2 [] check_commandline Public ) }) m_cli2_user () [m_cli2] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-types_03-f0b782e.stdout0000664000175000017500000000673015141516316025511 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_03 [] [(Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (Cast (Var 2 r) RealToInteger (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor8-b01de63.json0000664000175000017500000000077015141516316030542 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor8-b01de63", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor8.f90", "infile_hash": "cd1d06b72c00ca0a67e83e5e20cfae7cbea5e5cf00ae46f81604d3b3", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor8-b01de63.stdout", "stdout_hash": "ad8945752c3e0b938f835b24a8dad599a1497216003cc543e5bc6c86", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-duplicate_module_procedures-3eaed23.stderr0000664000175000017500000000035415141516316031643 0ustar alastairalastairsemantic error: Entity test_01 is already present in the interface --> tests/errors/duplicate_module_procedures.f90:4:8 | 4 | module procedure test_01, test_01, test_01 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-case_01-b59db9c.stdout0000664000175000017500000002452615141516316025345 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), out: (Variable 2 out [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) case_01 [] [(Assignment (Var 2 i) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (Select () (Var 2 i) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "1" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 20 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 20 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "2" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 30 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 30 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "3" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 4 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 40 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 40 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [] .false. ) (If () (IntegerCompare (Var 2 out) NotEq (Cast (IntegerConstant 40 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 40 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (Var 2 i) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 11 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "1" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)] [(Assignment (Var 2 out) (Cast (IntegerConstant 22 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 22 (Integer 8) Decimal) ) () .false. .false. ) (Print (StringConstant "2,3,4" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] .false. )] [] .false. ) (If () (IntegerCompare (Var 2 out) NotEq (Cast (IntegerConstant 22 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 22 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_without_newline-d50219b.stdout0000664000175000017500000000121315141516316031373 0ustar alastairalastair(TranslationUnit [(Program example () [] [] [(Declaration (AttrType TypeCharacter [(len 2 Value)] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (String "Hi" ()) () ) (Print 0 () [x] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.stderr0000664000175000017500000000106015141516316032300 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:4:11 | 4 | if (y .eq. 1) then | ^^^^ help: write this as '==' style suggestion: Use '==' instead of '.eq.' --> tests/style1.f90:10:15 | 10 | if (x .eq. 1) then | ^^^^ help: write this as '==' warning: Assuming implicit save attribute for variable declaration --> tests/style1.f90:9:20 | 9 | integer :: x = 5 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data-modules_44-cd82150.stdout0000664000175000017500000006001115141516316032013 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_44: (Program (SymbolTable 9 { cmd_new: (ExternalSymbol 9 cmd_new 2 cmd_new modules_44_fpm_cmd_new [] cmd_new Public ), fpm_cmd_settings: (ExternalSymbol 9 fpm_cmd_settings 2 fpm_cmd_settings modules_44_fpm_cmd_new [] fpm_cmd_settings Public ), fpm_new_settings: (ExternalSymbol 9 fpm_new_settings 2 fpm_new_settings modules_44_fpm_cmd_new [] fpm_new_settings Public ), settings: (Variable 9 settings [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 9 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. ) }) modules_44 [modules_44_fpm_cmd_new] [(SubroutineCall 9 cmd_new () [((Var 9 settings))] () .false. )] ), modules_44_fpm_cmd_new: (Module (SymbolTable 2 { cmd_new: (Function (SymbolTable 8 { 1_fpm_new_settings_name: (ExternalSymbol 8 1_fpm_new_settings_name 7 name fpm_new_settings [] name Public ), littlefile: (Variable 8 littlefile [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), settings: (Variable 8 settings [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 fpm_new_settings Source Public Required .false. .false. .false. () .false. .false. ) }) cmd_new (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 settings)] [(Assignment (Var 8 littlefile) (ArrayConstant 160 ["# ", "My cool new project! "] (Array (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (SubroutineCall 2 warnwrite_string____1 2 warnwrite_string____1 [((StructInstanceMember (Var 8 settings) 8 1_fpm_new_settings_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((ArrayPhysicalCast (Var 8 littlefile) DescriptorArray PointerArray (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] PointerArray ) ) () )) ((ArraySize (Var 8 littlefile) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () .false. )] () Public .false. .false. () ), fpm_cmd_settings: (Struct (SymbolTable 6 { working_dir: (Variable 6 working_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_cmd_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [working_dir] [] Source Public .false. .true. [] () () ), fpm_new_settings: (Struct (SymbolTable 7 { name: (Variable 7 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_new_settings (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () 2 fpm_cmd_settings ), warnwrite_string____1: (ExternalSymbol 2 warnwrite_string____1 4 warnwrite_string____1 modules_44_module_fpm_filesystem [] warnwrite_string____1 Public ) }) modules_44_fpm_cmd_new () [modules_44_module_fpm_filesystem] .false. .false. .false. ), modules_44_module_fpm_filesystem: (Module (SymbolTable 4 { warnwrite_string____1: (Function (SymbolTable 10 { __1data: (Variable 10 __1data [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), data: (Variable 10 data [__1data] In () () Default (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 __1data))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), fname: (Variable 10 fname [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) warnwrite_string____1 (FunctionType [(String 1 () AssumedLength DescriptorString) (Array (String 1 () AssumedLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 fname) (Var 10 data) (Var 10 __1data)] [] () Public .false. .false. () ) }) modules_44_module_fpm_filesystem () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-global_scope2-181c327.json0000664000175000017500000000073415141516316026040 0ustar alastairalastair{ "basename": "ast-global_scope2-181c327", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "ast-global_scope2-181c327.stdout", "stdout_hash": "325fc3cf71aa455627445d19cd3444cf82fb01c030dda2c15eaa02cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-allocated_04-b4ea2f8.json0000664000175000017500000000071015141516316026012 0ustar alastairalastair{ "basename": "run-allocated_04-b4ea2f8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/allocated_04.f90", "infile_hash": "1611173eff922a3cb929ef1ac27648e7c337cfad4860f90e35f9ee9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-allocated_04-b4ea2f8.stderr", "stderr_hash": "fb3918b676fb40ed2976f1e91f710874a66ea11a974e210f59465b6a", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/mod_to_asr-mod1-14-bb0bd17.json0000664000175000017500000000074515141516316026161 0ustar alastairalastair{ "basename": "mod_to_asr-mod1-14-bb0bd17", "cmd": "lfortran mod --show-asr --no-indent --no-color {infile}", "infile": "tests/interop/mod1-14.mod", "infile_hash": "00dfd17351427824dd19adcb6958a8bbbd932547448a184c8ad952bc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "mod_to_asr-mod1-14-bb0bd17.stderr", "stderr_hash": "55ed9d251dff9521e02e51d9efa988c5e5b5748a24baa78b387de7f6", "returncode": 109 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp6-556419a.stderr0000664000175000017500000000022215141516316026770 0ustar alastairalastairsemantic error: Variable 'z12' is not declared --> tests/errors/cpp6.f90:3:1 | 3 | #include "cpp6.h" | ^^^^^^^^^^^^^^^^^ 'z12' is undeclared lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp8-edc2b52.json0000664000175000017500000000074415141516316026661 0ustar alastairalastair{ "basename": "asr_preprocess-cpp8-edc2b52", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp8.f90", "infile_hash": "32cafa9cd5fee5b62915c116621f50932e4919a8929d18bf2d3c2913", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp8-edc2b52.stderr", "stderr_hash": "875cf3a037baf0520e8c8717c94b01e43f292a714725f9e4d09ff361", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/tokens-subroutine1-c249ad5.json0000664000175000017500000000073715141516316026467 0ustar alastairalastair{ "basename": "tokens-subroutine1-c249ad5", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "tokens-subroutine1-c249ad5.stdout", "stdout_hash": "e48e3d92e7b293dcc3b2c28a10054c5191a8c2bda04d3a63a8c1b50e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_04-a8954ed.json0000664000175000017500000000075015141516316025451 0ustar alastairalastair{ "basename": "ast-modules_04-a8954ed", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_04.f90", "infile_hash": "b04f80d4de5baea50808e962f08564088751c24a464b3d1d7c0c316f", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_04-a8954ed.stdout", "stdout_hash": "2a048504489acee359b2e0fa29789c76861df057ef9d081a8374ac6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-goto_04-2487215.json0000664000175000017500000000073715141516316024525 0ustar alastairalastair{ "basename": "asr-goto_04-2487215", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_04.f90", "infile_hash": "302db59379e85ba1677034f61bec227f237c56085cea27ad7a1554b5", "outfile": null, "outfile_hash": null, "stdout": "asr-goto_04-2487215.stdout", "stdout_hash": "94695adc70bee9e50620349d8f6ddf8c5d602c2637862f7eb3a1c0f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_02-35d66e0.stdout0000664000175000017500000002410215141516316027124 0ustar alastairalastair(TranslationUnit [(Module a () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(r8 [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType B [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType C [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] ) (DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(AttrExtends B ) (SimpleAttribute AttrPublic )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [] [(r1 [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeType [] () C None ) [(SimpleAttribute AttrPointer )] [(cc [] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () ) (Declaration (AttrType TypeReal [(() r8 Value)] () () None ) [(SimpleAttribute AttrPointer )] [(r2 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ()) (r3 [(() () DimensionExpr)] [] () (FuncCallOrArray null [] [] [] [] [] ) Arrow ())] () )] [(Private () ) (DerivedTypeProc () [(SimpleAttribute AttrPrivate )] [(UseSymbol p1 () )] () ) (DerivedTypeProc something [(SimpleAttribute AttrPrivate )] [(UseSymbol p1b () )] () ) (DerivedTypeProc () [(AttrPass self )] [(UseSymbol p2 () )] () ) (DerivedTypeProc () [] [(UseSymbol proc_1 () ) (UseSymbol proc_2 () )] () ) (GenericOperator [] NOTEQ [p5 p6] () ) (GenericOperator [] PLUS [p8] () ) (GenericDefinedOperator [] "in" [p7] () ) (GenericDefinedOperator [] "dot" [p10] () ) (GenericOperator [] DIV [p11] () ) (GenericAssignment [] [p9] () ) (GenericName [(SimpleAttribute AttrPublic )] calcCoeffs [calcCoeffsReal calcCoeffsKPoint] () ) (GenericName [(SimpleAttribute AttrPrivate )] name [sample] () ) (GenericName [] p1 [p2] (TriviaNode [] [(Semicolon) (EndOfLine)] ) ) (GenericWrite [(SimpleAttribute AttrPublic )] formatted [t_write] () ) (GenericRead [] unformatted [t_read] () ) (FinalName y () )] ) (DerivedType matrix [k b] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrKind )] [(k [] [] () 4 Equal ())] () ) (Declaration (AttrType TypeInteger [(() 8 Value)] () () None ) [(SimpleAttribute AttrLen )] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() k Value)] () () None ) [] [(element [(1 b DimensionExpr) (1 b DimensionExpr)] [] () () None ())] () )] [] )] [] [(Subroutine p1 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent Out )] [(this [] [] () () None ())] () )] [] [] [] ) (Subroutine p2 [(this)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeClass [] () X None ) [(AttrIntent InOut )] [(this [] [] () () None ())] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast-arrays_02-bc13aa6.stdout0000664000175000017500000000556315141516316025715 0ustar alastairalastair(TranslationUnit [(Program arrays_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(a [(1 3 DimensionExpr)] [] () () None ()) (b [] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) (Real "3._dp") () ) (Assignment 0 (FuncCallOrArray a [] [(() 2 () 0)] [] [] [] ) (Real "2._dp") () ) (Assignment 0 (FuncCallOrArray a [] [(() 3 () 0)] [] [] [] ) (Real "1._dp") () ) (Assignment 0 b (FuncCallOrArray sum [] [(() a () 0)] [] [] [] ) () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- b (Real "6._dp")) () 0)] [] [] [] ) (Real "1e-12_dp")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-real_dp_param-bac42bc.stdout0000664000175000017500000000517015141516316027136 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @real_dp_param.u = internal global float 0x3FF0CCCCC0000000 @real_dp_param.v = internal global double 0x3FF0CCCCC0000000 @real_dp_param.zero = internal global double 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R8,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* @real_dp_param.u, double* @real_dp_param.v, double* @real_dp_param.zero) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_real_dp_param FINALIZE_SYMTABLE_real_dp_param: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-statement_01-00eefc8.stdout0000664000175000017500000001627615141516316026432 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { alnorm: (Function (SymbolTable 2 { alnorm: (Variable 2 alnorm [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zexp: (Function (SymbolTable 4 { z: (Variable 4 z [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zexp_return_var_name: (Variable 4 zexp_return_var_name [] ReturnVar () () Default (Real 8) 2 zexp Source Public Required .false. .false. .false. () .false. .false. ) }) zexp (FunctionType [(Real 8)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 z)] [(Assignment (Var 4 zexp_return_var_name) (IntrinsicElementalFunction Exp [(Var 4 z)] 0 (Real 8) () ) () .false. .false. )] (Var 4 zexp_return_var_name) Public .false. .false. () ) }) alnorm (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Return)] (Var 2 alnorm) Public .false. .false. () ), statement_01: (Program (SymbolTable 3 { }) statement_01 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-matmul_unallocated_01-39026d3.stderr0000664000175000017500000000023515141516316030044 0ustar alastairalastairruntime error: Array 'result' is indexed but not allocated. --> tests/errors/matmul_unallocated_01.f90:10:5 | 10 | C = matmul(A, B) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-bin_op_complex_dp-8ead434.json0000664000175000017500000000100015141516316027317 0ustar alastairalastair{ "basename": "llvm-bin_op_complex_dp-8ead434", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_complex_dp.f90", "infile_hash": "9be1b396941b73e1466a46963ee3ade085440ce077b444ce7e2f6baf", "outfile": null, "outfile_hash": null, "stdout": "llvm-bin_op_complex_dp-8ead434.stdout", "stdout_hash": "550dde71a92ade615245bff27ed47a97ad64e9c4b6c434150f20328c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-associate_01-4a4ac5c.stdout0000664000175000017500000002146515141516316026371 0ustar alastairalastair(TranslationUnit [(Program associate_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ()) (c [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrPointer )] [(x [(() () DimensionExpr)] [] () () None ()) (y [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(a_1 [] [] () () None ()) (c_234 [] [] () () None ()) (c_121 [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () )] [(Assignment 0 a_1 0 () ) (Assignment 0 n 10 () ) (Allocate 0 [(() (FuncCallOrArray a [] [(() 5 () 0)] [] [] [] ) () 0)] [] () ) (Allocate 0 [(() (FuncCallOrArray b [] [(() n () 0) (() n () 0)] [] [] [] ) () 0) (() (FuncCallOrArray c [] [(() n () 0) (() 5 () 0) (() n () 0)] [] [] [] ) () 0)] [] () ) (AssociateBlock 1 loop [(x [] [] () a Arrow ()) (y [] [] () c Arrow ()) (z [] [] () (FuncCallOrArray c [] [(() () 1 0) (() 2 () 0) (() () 1 0)] [] [] [] ) Arrow ())] [(Assignment 0 (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) (+ a_1 5) () ) (Assignment 0 (FuncCallOrArray y [] [(() 2 () 0) (() 3 () 0) (() 4 () 0)] [] [] [] ) 3 () ) (Assignment 0 (FuncCallOrArray z [] [(() 1 () 0) (() 1 () 0)] [] [] [] ) 17 () ) (If 0 () (/= (FuncCallOrArray size [] [(() z () 0)] [] [] [] ) 100) [(ErrorStop 0 () () () )] [] () () () )] () () ) (Assignment 0 a_1 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) () ) (If 0 () (== (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) 5) [(GoTo 0 () 1 [] () )] [] () () () ) (Assignment 0 c_234 (FuncCallOrArray c [] [(() 2 () 0) (() 3 () 0) (() 4 () 0)] [] [] [] ) () ) (Assignment 0 c_121 (FuncCallOrArray c [] [(() 1 () 0) (() 2 () 0) (() 1 () 0)] [] [] [] ) () ) (If 0 () (/= a_1 (Real "10.")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= c_234 (Real "3.")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= c_121 (Real "17.")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-allocated_04-b4ea2f8.stderr0000664000175000017500000000027715141516316026354 0ustar alastairalastairruntime error: Attempting to allocate already allocated variable 'x' --> tests/errors/allocated_04.f90:6:5 | 6 | allocate(x) ! Error: double allocation of scalar | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-iostat_constant_integer-4f6f5d4.stderr0000664000175000017500000000026415141516316030756 0ustar alastairalastairsemantic error: Non-variable expression for `iostat` --> tests/errors/iostat_constant_integer.f90:7:5 | 7 | read(buffer, *, iostat=ios) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/julia-subroutine3b-7e4c8ab.stdout0000664000175000017500000000031415141516316027056 0ustar alastairalastairfunction f()::Int32 local f::Int32 f = 42 return f end function g()::Int32 local g::Int32 g = 42 return g end function h()::Int32 local h::Int32 h = 42 return h end lfortran-lfortran-2f73434/tests/reference/asr-modules_24-996af24.stdout0000664000175000017500000005106515141516316025750 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_24: (Program (SymbolTable 7 { parse_select: (ExternalSymbol 7 parse_select 2 parse_select tomlf_de_tokenizer_24 [] parse_select Public ), tokenizer: (Variable 7 tokenizer [] Local () () Default (StructType [] [] .true. .false. ) 7 toml_tokenizer_ Source Public Required .false. .true. .false. () .false. .false. ), tokenizer_ptr: (Variable 7 tokenizer_ptr [] Local () () Default (Pointer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) ) 7 toml_tokenizer Source Public Required .false. .false. .false. () .false. .false. ), toml_table: (ExternalSymbol 7 toml_table 2 toml_table tomlf_de_tokenizer_24 [] toml_table Public ), toml_tokenizer: (ExternalSymbol 7 toml_tokenizer 2 toml_tokenizer tomlf_de_tokenizer_24 [] toml_tokenizer Public ), toml_tokenizer_: (ExternalSymbol 7 toml_tokenizer_ 2 toml_tokenizer_ tomlf_de_tokenizer_24 [] toml_tokenizer_ Public ) }) modules_24 [tomlf_de_tokenizer_24] [(Associate (Var 7 tokenizer_ptr) (Var 7 tokenizer) ) (SubroutineCall 7 parse_select () [((Var 7 tokenizer))] () .false. )] ), tomlf_de_tokenizer_24: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 6 { 1_toml_tokenizer_current: (ExternalSymbol 6 1_toml_tokenizer_current 4 current toml_tokenizer [] current Public ), de: (Variable 6 de [] InOut () () Default (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. ), table: (Variable 6 table [] Local () () Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) parse_select (FunctionType [(StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 de)] [(Nullify [(Var 6 table)] ) (Associate (StructInstanceMember (Var 6 de) 6 1_toml_tokenizer_current (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) () ) (Var 6 table) )] () Public .false. .false. () ), toml_table: (Struct (SymbolTable 3 { inline: (Variable 3 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4)] [] .true. .false. ) [] [inline] [] Source Public .false. .false. [] () () ), toml_tokenizer: (Struct (SymbolTable 4 { current: (Variable 4 current [] Local (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 4 current) ) (PointerNullConstant (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) (Var 4 current) ) Default (Pointer (StructType [(Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) toml_tokenizer (StructType [(Pointer (StructType [(Logical 4)] [] .true. .false. ) )] [] .true. .false. ) [toml_table] [current] [] Source Public .false. .true. [] () () ), toml_tokenizer_: (Struct (SymbolTable 5 { }) toml_tokenizer_ (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 toml_tokenizer ) }) tomlf_de_tokenizer_24 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-types_01-642cab3.json0000664000175000017500000000074515141516316025312 0ustar alastairalastair{ "basename": "llvm-types_01-642cab3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_01-642cab3.stdout", "stdout_hash": "f0354a012dc9419cec1a3f3c8f6b7e4400baaa93ac81580d585c224f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-finalize_01-5496007.json0000664000175000017500000000073115141516316025534 0ustar alastairalastair{ "basename": "llvm-finalize_01-5496007", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/finalize_01.f90", "infile_hash": "81b1d43091ce29fff8f14e778b9a33030de61262f7c499b22c152b7e", "outfile": null, "outfile_hash": null, "stdout": "llvm-finalize_01-5496007.stdout", "stdout_hash": "2cee62978661df1422699b5afc9153c59547639f02f98c704e476030", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_03-0771f1b.json0000664000175000017500000000076415141516316026261 0ustar alastairalastair{ "basename": "llvm-intrinsics_03-0771f1b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", "infile_hash": "e7fb61db3237594018e226a4236884f778bd41ae0848c5667da97462", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_03-0771f1b.stdout", "stdout_hash": "fde11e1dddb7a9465a7590b35d3743c12776beb17d7265727efb2eae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-floatStringInput-95c963d.stderr0000664000175000017500000000004015141516316027274 0ustar alastairalastairError: Invalid input from file. lfortran-lfortran-2f73434/tests/reference/llvm-global_scope7-69a167f.stdout0000664000175000017500000000111315141516316026664 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 6 define void @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 %0 = load i32, i32* @x, align 4 %1 = mul i32 2, %0 store i32 %1, i32* %__lfortran_evaluate_11, align 4 %2 = load i32, i32* @x, align 4 %3 = add i32 %2, 1 store i32 %3, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_14-8de1244.stderr0000664000175000017500000000024615141516316030106 0ustar alastairalastairruntime error: Argument 1 of subroutine f_integer____0 is unallocated. --> tests/errors/array_bounds_check_14.f90:16:12 | 16 | call f(x) | ^^ lfortran-lfortran-2f73434/tests/reference/asr-arrays_08_func-2759ced.json0000664000175000017500000000111115141516316026306 0ustar alastairalastair{ "basename": "asr-arrays_08_func-2759ced", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_08_func.f90", "infile_hash": "31dc0eac87716ea184d20ac42f94636f0a25c0ee00022272c2b1327d", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_08_func-2759ced.stdout", "stdout_hash": "be890988ee36578db62760c8e15871c73f5ca92cb3a48796d6d8cda2", "stderr": "asr-arrays_08_func-2759ced.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-kokkos_program2-43a2cc6.stdout0000664000175000017500000000450415141516316027137 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct f32_10000_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; f32_10000_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { template void triad(T0* a, T1* b, float scalar, T2* c); } // Implementations namespace { template void triad(T0* a, T1* b, float scalar, T2* c) { int32_t i; int32_t n; n = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); }); } void main2() { Kokkos::View a_data("a_data", 10000); f32_10000_1 a_value(&a_data); f32_10000_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 10000; Kokkos::View b_data("b_data", 10000); f32_10000_1 b_value(&b_data); f32_10000_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 10000; Kokkos::View c_data("c_data", 10000); f32_10000_1 c_value(&c_data); f32_10000_1* c = &c_value; c->dims[0].lower_bound = 1; c->dims[0].length = 10000; int32_t i; int32_t nsize; float scalar; scalar = (float)(10); nsize = a->data->extent(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, nsize+1), KOKKOS_LAMBDA(const long i) { a->data->operator[](i - a->dims[0].lower_bound) = (float)(5); b->data->operator[](i - b->dims[0].lower_bound) = (float)(5); }); triad(a, b, scalar, c); std::cout<< "End Stream Triad"< tests/errors/derived_type_01.f90:7:39 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-template_array_03-b7f9799.stderr0000664000175000017500000000167115141516316027301 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:24 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:31 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/../integration_tests/template_array_03.f90:87:38 | 87 | integer :: x = 1, y = 1, z = 1 | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_03-86dce2a.json0000664000175000017500000000075315141516316027227 0ustar alastairalastair{ "basename": "asr-dependency_test_03-86dce2a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/dependency_test_03.f90", "infile_hash": "390ea7aa4152460550f66c9d9bab3621da4cb1b7c17e27f7efa9f0df", "outfile": null, "outfile_hash": null, "stdout": "asr-dependency_test_03-86dce2a.stdout", "stdout_hash": "17edcc7992e963d4363112d95cb8c3c25ffd203258e5ee64919960f5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-case_05-f054494.json0000664000175000017500000000073015141516316025064 0ustar alastairalastair{ "basename": "julia-case_05-f054494", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "julia-case_05-f054494.stdout", "stdout_hash": "885953a54b03404cb78a017f766d921f69f9ec2c3d80c6be1b2b9953", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-binop_03-d0adef1.stdout0000664000175000017500000001427415141516316025772 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R8\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca i64, align 8 %y = alloca double, align 8 store i64 665663010, i64* %x, align 4 %2 = load i64, i64* %x, align 4 %simplified_pow_operation = mul i64 %2, %2 store i64 %simplified_pow_operation, i64* %x, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i64* %x) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = load i64, i64* %x, align 4 %15 = icmp ne i64 %14, 443107242882260100 br i1 %15, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then store double 0x41C3D69B11000000, double* %y, align 8 %16 = load double, double* %y, align 8 %simplified_pow_operation1 = fmul double %16, %16 store double %simplified_pow_operation1, double* %y, align 8 %17 = alloca i64, align 8 %18 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %17, i32 0, i32 0, double* %y) %19 = load i64, i64* %17, align 4 %stringFormat_desc2 = alloca %string_descriptor, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %19, i64* %21, align 4 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %25 = load i64, i64* %24, align 4 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %ifcont call void @_lfortran_free(i8* %18) br label %free_done4 free_done4: ; preds = %free_nonnull3, %ifcont %28 = load double, double* %y, align 8 %29 = fsub double %28, 0x439898EEC2459972 %30 = call double @llvm.fabs.f64(double %29) %31 = fcmp ogt double %30, 0x3BFD83C940000000 br i1 %31, label %then5, label %else6 then5: ; preds = %free_done4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont7 else6: ; preds = %free_done4 br label %ifcont7 ifcont7: ; preds = %else6, %then5 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont7 br label %FINALIZE_SYMTABLE_binop_03 FINALIZE_SYMTABLE_binop_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/asr-dim_float_03-ba04334.stderr0000664000175000017500000000031515141516316026160 0ustar alastairalastairsemantic error: `dim` argument to `Sum` must be a scalar and of integer type --> tests/errors/dim_float_03.f90:2:34 | 2 | print *, sum([1, 2, 3], .true., 1.1) | ^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-print2-785df93.stdout0000664000175000017500000000011715141516316025666 0ustar alastairalastairprogram print2 print "(es11.5,3x " // "es11.5)", 1.d0, 2.d0 end program print2 lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_06-58bbdbc.json0000664000175000017500000000100115141516316030360 0ustar alastairalastair{ "basename": "ast-program_without_line_06-58bbdbc", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_06.f90", "infile_hash": "20fbd1c400593343e3e6af74e9efb41a4d86f95050261626266a26ac", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_06-58bbdbc.stdout", "stdout_hash": "2c96f51cbf4cd83b0f3aa8877487ee2934df2ac013a5e41697b9abaa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_04-2ebc0e6.json0000664000175000017500000000074515141516316025354 0ustar alastairalastair{ "basename": "asr-string_04-2ebc0e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_04.f90", "infile_hash": "5dec930fb518a93b9004858a969c334193bb0a84dcadc023b57d5c10", "outfile": null, "outfile_hash": null, "stdout": "asr-string_04-2ebc0e6.stdout", "stdout_hash": "ea66a7a9fceeeeb1eb5c83b7b1b0a09dc79980736f1510b91910e0b0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-boz_01-def9db5.json0000664000175000017500000000105515141516316025111 0ustar alastairalastair{ "basename": "llvm-boz_01-def9db5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/boz_01.f90", "infile_hash": "58477e3f0fbdc7b41b5892cc6f876abfc5b434abe4884789d60b2d68", "outfile": null, "outfile_hash": null, "stdout": "llvm-boz_01-def9db5.stdout", "stdout_hash": "5dbead19c1bddb0b733081ee0242f87fd1bc39bbc289dd780ea33471", "stderr": "llvm-boz_01-def9db5.stderr", "stderr_hash": "2c1014e4f04672dfbcc83dde266587a98d7dc9651f6401dcaab51839", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-func_parameter_type_02-cef1ab3.stdout0000664000175000017500000004127615141516316030533 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 5 { f: (Variable 5 f [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 f) (Var 5 x) () .false. .false. )] (Var 5 f) Public .false. .false. () ), hinit853: (Function (SymbolTable 4 { f: (Function (SymbolTable 8 { f_arg_0: (Variable 8 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 8 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 f_arg_0)] [] (Var 8 f_return_var_name) Public .false. .false. () ), hinit853: (Variable 4 hinit853 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) hinit853 (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 f)] [(Assignment (Var 4 hinit853) (FunctionCall 4 f () [((RealConstant 3.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. )] (Var 4 hinit853) Public .false. .false. () ), main: (Program (SymbolTable 6 { f: (Function (SymbolTable 7 { f_return_var_name: (Variable 7 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 f_return_var_name) Public .false. .false. () ) }) main [] [(SubroutineCall 1 sub () [((Var 6 f))] () .false. )] ), sub: (Function (SymbolTable 2 { f: (Function (SymbolTable 3 { f_return_var_name: (Variable 3 f_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 f_return_var_name) Public .false. .false. () ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [hinit853] [(Var 2 f)] [(Assignment (Var 2 h) (FunctionCall 1 hinit853 () [((Var 2 f))] (Real 4) () () ) () .false. .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-nullify1-aaf5456.stdout0000664000175000017500000000073215141516316025602 0ustar alastairalastair(TranslationUnit [(Program nullify1 (TriviaNode [(EndOfLine) (Comment "! Tests for syntax (AST) only:" )] [] ) [] [] [] [(Nullify 0 [a] [] () ) (Nullify 0 [a b c d] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-error_stop2-7d55ddf.json0000664000175000017500000000075415141516316026041 0ustar alastairalastair{ "basename": "ast-error_stop2-7d55ddf", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/error_stop2.f", "infile_hash": "303b7586e16288aa99ec433c82ec87d416ceb9a14ddaf588ad3255ce", "outfile": null, "outfile_hash": null, "stdout": "ast-error_stop2-7d55ddf.stdout", "stdout_hash": "55b8a82284c303b17580f7b1a8d14526bbf46b6fc22b3993bcc97f4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intent_01-c1f267a.json0000664000175000017500000000074515141516316025267 0ustar alastairalastair{ "basename": "asr-intent_01-c1f267a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "asr-intent_01-c1f267a.stdout", "stdout_hash": "d35497494f3099098864c619b238f20e2f8beb7bd355ed4c31ae7607", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics13-349f6ac.json0000664000175000017500000000074015141516316026020 0ustar alastairalastair{ "basename": "asr-intrinsics13-349f6ac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics13.f90", "infile_hash": "d8cd233c3150d185f9e9e6c6f89d70471bb5b362d82cf142a51d0b82", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics13-349f6ac.stderr", "stderr_hash": "a5688f270ca65cae87f17411d2cbda408ffc88927b5f76033ad4b0ff", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_03-15fcd63.stderr0000664000175000017500000000030315141516316030156 0ustar alastairalastairruntime error: Array 'x' is not allocated. Use '--realloc-lhs-arrays' option to reallocate LHS automatically. --> tests/errors/array_bounds_check_03.f90:4:5 | 4 | x = [1, 2, 3] | ^ lfortran-lfortran-2f73434/tests/reference/cpp-program4-1796cb6.stderr0000664000175000017500000000040215141516316025466 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/ast-do5-4355d03.stdout0000664000175000017500000000605215141516316024363 0ustar alastairalastair(TranslationUnit [(Program do5 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ()) (enddo [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 15 j (+ j i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 16 i 1 5 () [(Assignment 16 enddo 5 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 20 j (+ j i) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Continue 31 () ) (Assignment 35 k (+ k 1) () )] () () ) (Continue 33 () ) (Assignment 30 k (+ k 1) () )] () () ) (Continue 40 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_add_01-56d8eff.json0000664000175000017500000000076715141516316026513 0ustar alastairalastair{ "basename": "asr-template_add_01-56d8eff", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01.f90", "infile_hash": "08b6efae516775086e118196aec862b1023aa56c02e207faa377f1a0", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01-56d8eff.stdout", "stdout_hash": "a220d75c4ea3653d907603607b213044e45af8ebd968404d55254844", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dimension_01-2172e76.json0000664000175000017500000000074015141516316025612 0ustar alastairalastair{ "basename": "asr-dimension_01-2172e76", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dimension_01.f90", "infile_hash": "0a6954d8790d6aca192ed8950554bda2671bec782ab05c87c7a74912", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dimension_01-2172e76.stderr", "stderr_hash": "9b74d99f78462b1b6e613732abfbf556364eb63270d82813b234b3d5", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/cpp-array2-9a93c4d.json0000664000175000017500000000067215141516316024671 0ustar alastairalastair{ "basename": "cpp-array2-9a93c4d", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/array2.f90", "infile_hash": "ec67f153c5f506f6a12ef94b06d43c7e9e86b9fc33c9c196029183f0", "outfile": null, "outfile_hash": null, "stdout": "cpp-array2-9a93c4d.stdout", "stdout_hash": "7a8f06efc0b71df9d23c13d24415b8e1dcf6e05ab3e6ffd3d2e4606b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-fmt1-c767956.json0000664000175000017500000000071415141516316024672 0ustar alastairalastair{ "basename": "ast_f90-fmt1-c767956", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/fmt1.f90", "infile_hash": "cc416a9bdea43f7844e35c44673a53dda17f3037acfc76ddef6f7c48", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-fmt1-c767956.stdout", "stdout_hash": "52971e2bba50a527abcf333d6f8b150a629a39dfac69b36c72587774", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope3-57006df.stdout0000664000175000017500000000171315141516316026471 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-lfortran-2f73434/tests/reference/ast-parameter_02-9547a35.stdout0000664000175000017500000000434715141516316026174 0ustar alastairalastair(TranslationUnit [(Subroutine a_proc [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 1 Equal ())] () )] [(Print 0 () [i] () )] [] [] ) (Module parameter_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 2 Equal ())] () )] [] [] ) (Program parameter_02 () [(Use [] parameter_02_a [(UseSymbol i () )] .true. () )] [(ImplicitNone [] () )] [] [(SubroutineCall 0 a_proc [] [] [] [] () ) (Print 0 () [i] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-allocate_02-4f6b634.json0000664000175000017500000000073115141516316025660 0ustar alastairalastair{ "basename": "llvm-allocate_02-4f6b634", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/allocate_02.f90", "infile_hash": "ad03592673976aa7fa7af3ba41187e932e00cba7473a89be8b00403d", "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_02-4f6b634.stdout", "stdout_hash": "cab4d1a96d01dd94e4fd81468b7c6d8be961fea51423c2444335e0e1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common_05-f767179.stdout0000664000175000017500000010455615141516316025521 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { file_common_block_block_1: (Module (SymbolTable 3 { block_1: (Struct (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) block_1 (StructType [] [] .true. .false. ) [] [a b c] [] Source Public .false. .false. [] () () ), struct_instance_block_1: (Variable 3 struct_instance_block_1 [] Local () () Default (StructType [] [] .true. .false. ) 3 block_1 Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_block_1 () [] .false. .false. .false. ), main: (Program (SymbolTable 2 { 1_block_1_a: (ExternalSymbol 2 1_block_1_a 4 a block_1 [] a Public ), 1_block_1_b: (ExternalSymbol 2 1_block_1_b 4 b block_1 [] b Public ), 1_block_1_c: (ExternalSymbol 2 1_block_1_c 4 c block_1 [] c Public ), block_1: (ExternalSymbol 2 block_1 3 block_1 file_common_block_block_1 [] block_1 Public ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), struct_instance_block_1: (ExternalSymbol 2 struct_instance_block_1 3 struct_instance_block_1 file_common_block_block_1 [] struct_instance_block_1 Public ) }) main [] [(Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (ArrayBroadcast (IntegerConstant 3 (Integer 4) Decimal) (ArrayConstant 4 [5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 20 [3, 3, 3, 3, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Mul (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Gt (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) Div (Var 2 d) (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [(If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Gt (Var 2 d) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [] )] ) (Select () (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. )] [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Mul (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] .false. ) (WhileLoop () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Gt (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal)) [(Assignment (Var 2 d) (IntegerBinOp (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) Add (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (Integer 4) () ) () .false. .false. )] [] ) (Print (StringFormat () [(StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) (Var 2 d)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_b (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) [(If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_c (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (StructInstanceMember (Var 2 struct_instance_block_1) 2 1_block_1_a (Integer 4) () ) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (If () (IntegerCompare (Var 2 d) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-forall1-88e2780.json0000664000175000017500000000104715141516316025356 0ustar alastairalastair{ "basename": "ast_f90-forall1-88e2780", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/forall1.f90", "infile_hash": "c0bc2a81b478acca60180152012de1e4011f235afde816cb91804fb9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-forall1-88e2780.stdout", "stdout_hash": "ccf3473772b8382892f8cf67b7b955e79e4d3a1b4cd10ce34730b582", "stderr": "ast_f90-forall1-88e2780.stderr", "stderr_hash": "4d905b6e8f90b9042def4e125077632dced461f1a0aeea1763458479", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope1-f174531.stdout0000664000175000017500000000113115141516316031333 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_08_func-ec93f58.stdout0000664000175000017500000000124015141516316027205 0ustar alastairalastairfunction copy_from_to(a::Array{Int32, 1}, b::Array{Int32, 1}) local i::Int32 for i ∈ 1:length(a) b[i] = a[i] end end function verify(a::Array{Int32, 1}, b::Array{Int32, 1})::Bool local i::Int32 local r::Bool r = true for i ∈ 1:length(a) r = r && a[i] == b[i] end return r end function main() local i::Int32 local r::Bool local x::Array{Int32, 1} local y::Array{Int32, 1} for i ∈ 1:length(x) x[i] = i end copy_from_to(Int32(x), Int32(y)) r = verify(Int32(x), Int32(y)) println(r) if !r println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-template_error_05-85bce3c.stderr0000664000175000017500000000123515141516316027426 0ustar alastairalastairsemantic error: Restriction type mismatch with provided function argument --> tests/errors/template_error_05.f90:34:33 | 34 | instantiate add_t(real, func_arg_real), only: add_real => add_generic | ^^^^^^^^^^^^^ | 8 | function F(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 11 | end function | ...^^^^^^^^^^^^^^^^^^^^ Requirement's return type real | 28 | integer function func_arg_real(x, y) result(z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 31 | end function | ...^^^^^^^^^^^^^^^^ Function's return type integer lfortran-lfortran-2f73434/tests/reference/llvm-finalize_02-cfb24d5.stdout0000664000175000017500000004315615141516316026411 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %array = type { %tt*, i32, %dimension_descriptor*, i1, i32 } %tt = type { float, %t } %t = type { i32 } %dimension_descriptor = type { i32, i32, i32 } %array.0 = type { i32*, i32, %dimension_descriptor*, i1, i32 } %array.1 = type { %string_descriptor*, i32, %dimension_descriptor*, i1, i32 } %string_descriptor = type <{ i8*, i64 }> @deep_0 = internal global i32 0 define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store i32 200, i32* %call_arg_value, align 4 call void @ss(i32* %call_arg_value) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_finalize_02 FINALIZE_SYMTABLE_finalize_02: ; preds = %return ret i32 0 } define void @ss(i32* %nang) { .entry: %0 = alloca i32, align 4 %1 = alloca i64, align 8 %arr_01 = alloca %array*, align 8 store %array* null, %array** %arr_01, align 8 %arr_desc = alloca %array, align 8 %2 = getelementptr %array, %array* %arr_desc, i32 0, i32 2 %3 = alloca i32, align 4 store i32 1, i32* %3, align 4 %4 = load i32, i32* %3, align 4 %5 = alloca %dimension_descriptor, i32 %4, align 8 %6 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 1 store i32 1, i32* %6, align 4 %7 = getelementptr %dimension_descriptor, %dimension_descriptor* %5, i32 0, i32 2 store i32 1, i32* %7, align 4 store %dimension_descriptor* %5, %dimension_descriptor** %2, align 8 %8 = getelementptr %array, %array* %arr_desc, i32 0, i32 4 store i32 1, i32* %8, align 4 %9 = getelementptr %array, %array* %arr_desc, i32 0, i32 0 store %tt* null, %tt** %9, align 8 store %array* %arr_desc, %array** %arr_01, align 8 %arr_02 = alloca %array.0*, align 8 store %array.0* null, %array.0** %arr_02, align 8 %arr_desc1 = alloca %array.0, align 8 %10 = getelementptr %array.0, %array.0* %arr_desc1, i32 0, i32 2 %11 = alloca i32, align 4 store i32 1, i32* %11, align 4 %12 = load i32, i32* %11, align 4 %13 = alloca %dimension_descriptor, i32 %12, align 8 %14 = getelementptr %dimension_descriptor, %dimension_descriptor* %13, i32 0, i32 1 store i32 1, i32* %14, align 4 %15 = getelementptr %dimension_descriptor, %dimension_descriptor* %13, i32 0, i32 2 store i32 1, i32* %15, align 4 store %dimension_descriptor* %13, %dimension_descriptor** %10, align 8 %16 = getelementptr %array.0, %array.0* %arr_desc1, i32 0, i32 4 store i32 1, i32* %16, align 4 %17 = getelementptr %array.0, %array.0* %arr_desc1, i32 0, i32 0 store i32* null, i32** %17, align 8 store %array.0* %arr_desc1, %array.0** %arr_02, align 8 %arr_03 = alloca i32*, align 8 store i32* null, i32** %arr_03, align 8 %arr_04 = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr_04, align 8 %arr_desc2 = alloca %array.1, align 8 %arr_desc_str_desc = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc, i32 0, i32 0 store i8* null, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc, i32 0, i32 1 store i64 0, i64* %19, align 4 %20 = getelementptr %array.1, %array.1* %arr_desc2, i32 0, i32 0 store %string_descriptor* %arr_desc_str_desc, %string_descriptor** %20, align 8 %21 = getelementptr %array.1, %array.1* %arr_desc2, i32 0, i32 2 %22 = alloca i32, align 4 store i32 1, i32* %22, align 4 %23 = load i32, i32* %22, align 4 %24 = alloca %dimension_descriptor, i32 %23, align 8 %25 = getelementptr %dimension_descriptor, %dimension_descriptor* %24, i32 0, i32 1 store i32 1, i32* %25, align 4 %26 = getelementptr %dimension_descriptor, %dimension_descriptor* %24, i32 0, i32 2 store i32 1, i32* %26, align 4 store %dimension_descriptor* %24, %dimension_descriptor** %21, align 8 %27 = getelementptr %array.1, %array.1* %arr_desc2, i32 0, i32 4 store i32 1, i32* %27, align 4 store %array.1* %arr_desc2, %array.1** %arr_04, align 8 %arr_05 = alloca %string_descriptor, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 store i8* null, i8** %28, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 1 store i64 0, i64* %29, align 4 %30 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 1 store i64 20, i64* %30, align 4 %31 = call i8* @_lfortran_malloc(i64 100) %32 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 store i8* %31, i8** %32, align 8 %arr_06 = alloca %array.0*, align 8 store %array.0* null, %array.0** %arr_06, align 8 %arr_desc3 = alloca %array.0, align 8 %33 = getelementptr %array.0, %array.0* %arr_desc3, i32 0, i32 2 %34 = alloca i32, align 4 store i32 1, i32* %34, align 4 %35 = load i32, i32* %34, align 4 %36 = alloca %dimension_descriptor, i32 %35, align 8 %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 1 store i32 1, i32* %37, align 4 %38 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 2 store i32 1, i32* %38, align 4 store %dimension_descriptor* %36, %dimension_descriptor** %33, align 8 %39 = getelementptr %array.0, %array.0* %arr_desc3, i32 0, i32 4 store i32 1, i32* %39, align 4 %40 = getelementptr %array.0, %array.0* %arr_desc3, i32 0, i32 0 store i32* null, i32** %40, align 8 store %array.0* %arr_desc3, %array.0** %arr_06, align 8 %arr_07 = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %arr_07, align 1 %arr_08 = alloca %array.1*, align 8 store %array.1* null, %array.1** %arr_08, align 8 %arr_desc4 = alloca %array.1, align 8 %arr_desc_str_desc5 = alloca %string_descriptor, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc5, i32 0, i32 0 store i8* null, i8** %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %arr_desc_str_desc5, i32 0, i32 1 store i64 0, i64* %42, align 4 %43 = getelementptr %array.1, %array.1* %arr_desc4, i32 0, i32 0 store %string_descriptor* %arr_desc_str_desc5, %string_descriptor** %43, align 8 %44 = getelementptr %array.1, %array.1* %arr_desc4, i32 0, i32 2 %45 = alloca i32, align 4 store i32 1, i32* %45, align 4 %46 = load i32, i32* %45, align 4 %47 = alloca %dimension_descriptor, i32 %46, align 8 %48 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 1 store i32 1, i32* %48, align 4 %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 2 store i32 1, i32* %49, align 4 store %dimension_descriptor* %47, %dimension_descriptor** %44, align 8 %50 = getelementptr %array.1, %array.1* %arr_desc4, i32 0, i32 4 store i32 1, i32* %50, align 4 store %array.1* %arr_desc4, %array.1** %arr_08, align 8 %51 = load i32, i32* %nang, align 4 store i32 %51, i32* @deep_0, align 4 %52 = load i32, i32* @deep_0, align 4 %53 = mul i32 1, %52 %54 = mul i32 %53, 4 %55 = sext i32 %54 to i64 %56 = call i8* @_lfortran_malloc(i64 %55) %57 = bitcast i8* %56 to i32* br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_ss FINALIZE_SYMTABLE_ss: ; preds = %return br label %Finalize_Variable_arr_01 Finalize_Variable_arr_01: ; preds = %FINALIZE_SYMTABLE_ss %58 = load %array*, %array** %arr_01, align 8 %59 = icmp ne %array* %58, null br i1 %59, label %is_allocated.then, label %is_allocated.else7 is_allocated.then: ; preds = %Finalize_Variable_arr_01 %60 = getelementptr %array, %array* %58, i32 0, i32 0 %61 = load %tt*, %tt** %60, align 8 %62 = icmp ne %tt* %61, null br i1 %62, label %is_allocated.then6, label %is_allocated.else is_allocated.then6: ; preds = %is_allocated.then br label %Calculate_arraySize Calculate_arraySize: ; preds = %is_allocated.then6 %63 = getelementptr %array, %array* %58, i32 0, i32 2 %64 = load %dimension_descriptor*, %dimension_descriptor** %63, align 8 %65 = getelementptr %array, %array* %58, i32 0, i32 4 %66 = load i32, i32* %65, align 4 store i64 1, i64* %1, align 4 store i32 0, i32* %0, align 4 br label %loop.head loop.head: ; preds = %loop.body, %Calculate_arraySize %67 = load i32, i32* %0, align 4 %68 = icmp slt i32 %67, %66 br i1 %68, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %69 = load i32, i32* %0, align 4 %70 = load i64, i64* %1, align 4 %71 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %64, i32 %69 %72 = getelementptr %dimension_descriptor, %dimension_descriptor* %71, i32 0, i32 2 %73 = load i32, i32* %72, align 4 %74 = sext i32 %73 to i64 %75 = mul i64 %70, %74 store i64 %75, i64* %1, align 4 %76 = add i32 %69, 1 store i32 %76, i32* %0, align 4 br label %loop.head loop.end: ; preds = %loop.head %77 = load i64, i64* %1, align 4 %arrSize_iter = alloca i64, align 8 store i64 -1, i64* %arrSize_iter, align 4 br label %Finalize_array_of_structs.head Finalize_array_of_structs.head: ; preds = %Finalize_array_of_structs.body, %loop.end %78 = load i64, i64* %arrSize_iter, align 4 %79 = add i64 %78, 1 store i64 %79, i64* %arrSize_iter, align 4 %80 = icmp slt i64 %79, %77 br i1 %80, label %Finalize_array_of_structs.body, label %Finalize_array_of_structs.end Finalize_array_of_structs.body: ; preds = %Finalize_array_of_structs.head %81 = load i64, i64* %arrSize_iter, align 4 %82 = getelementptr inbounds %tt, %tt* %61, i64 %81 %83 = getelementptr %tt, %tt* %82, i32 0, i32 0 %84 = getelementptr %tt, %tt* %82, i32 0, i32 1 br label %Finalize_array_of_structs.head Finalize_array_of_structs.end: ; preds = %Finalize_array_of_structs.head br label %is_allocated.ifcont is_allocated.else: ; preds = %is_allocated.then br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %Finalize_array_of_structs.end %85 = icmp eq %tt* %61, null br i1 %85, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.ifcont %86 = bitcast %tt* %61 to i8* call void @_lfortran_free(i8* %86) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.ifcont br label %is_allocated.ifcont8 is_allocated.else7: ; preds = %Finalize_Variable_arr_01 br label %is_allocated.ifcont8 is_allocated.ifcont8: ; preds = %is_allocated.else7, %free_done br label %Finalize_Variable_arr_02 Finalize_Variable_arr_02: ; preds = %is_allocated.ifcont8 %87 = load %array.0*, %array.0** %arr_02, align 8 %88 = icmp ne %array.0* %87, null br i1 %88, label %is_allocated.then9, label %is_allocated.else12 is_allocated.then9: ; preds = %Finalize_Variable_arr_02 %89 = getelementptr %array.0, %array.0* %87, i32 0, i32 0 %90 = load i32*, i32** %89, align 8 %91 = icmp eq i32* %90, null br i1 %91, label %free_done11, label %free_nonnull10 free_nonnull10: ; preds = %is_allocated.then9 %92 = bitcast i32* %90 to i8* call void @_lfortran_free(i8* %92) br label %free_done11 free_done11: ; preds = %free_nonnull10, %is_allocated.then9 br label %is_allocated.ifcont13 is_allocated.else12: ; preds = %Finalize_Variable_arr_02 br label %is_allocated.ifcont13 is_allocated.ifcont13: ; preds = %is_allocated.else12, %free_done11 br label %Finalize_Variable_arr_03 Finalize_Variable_arr_03: ; preds = %is_allocated.ifcont13 %93 = load i32*, i32** %arr_03, align 8 %94 = icmp eq i32* %93, null br i1 %94, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %Finalize_Variable_arr_03 %95 = bitcast i32* %93 to i8* call void @_lfortran_free(i8* %95) br label %free_done15 free_done15: ; preds = %free_nonnull14, %Finalize_Variable_arr_03 br label %Finalize_Variable_arr_04 Finalize_Variable_arr_04: ; preds = %free_done15 %96 = load %array.1*, %array.1** %arr_04, align 8 %97 = icmp ne %array.1* %96, null br i1 %97, label %is_allocated.then16, label %is_allocated.else19 is_allocated.then16: ; preds = %Finalize_Variable_arr_04 %98 = getelementptr %array.1, %array.1* %96, i32 0, i32 0 %99 = load %string_descriptor*, %string_descriptor** %98, align 8 %100 = getelementptr %string_descriptor, %string_descriptor* %99, i32 0, i32 0 %101 = load i8*, i8** %100, align 8 %102 = icmp eq i8* %101, null br i1 %102, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %is_allocated.then16 call void @_lfortran_free(i8* %101) br label %free_done18 free_done18: ; preds = %free_nonnull17, %is_allocated.then16 br label %is_allocated.ifcont20 is_allocated.else19: ; preds = %Finalize_Variable_arr_04 br label %is_allocated.ifcont20 is_allocated.ifcont20: ; preds = %is_allocated.else19, %free_done18 br label %Finalize_Variable_arr_05 Finalize_Variable_arr_05: ; preds = %is_allocated.ifcont20 %103 = getelementptr %string_descriptor, %string_descriptor* %arr_05, i32 0, i32 0 %104 = load i8*, i8** %103, align 8 %105 = icmp eq i8* %104, null br i1 %105, label %free_done22, label %free_nonnull21 free_nonnull21: ; preds = %Finalize_Variable_arr_05 call void @_lfortran_free(i8* %104) br label %free_done22 free_done22: ; preds = %free_nonnull21, %Finalize_Variable_arr_05 br label %Finalize_Variable_arr_06 Finalize_Variable_arr_06: ; preds = %free_done22 %106 = load %array.0*, %array.0** %arr_06, align 8 %107 = icmp ne %array.0* %106, null br i1 %107, label %is_allocated.then23, label %is_allocated.else26 is_allocated.then23: ; preds = %Finalize_Variable_arr_06 %108 = getelementptr %array.0, %array.0* %106, i32 0, i32 0 %109 = load i32*, i32** %108, align 8 %110 = icmp eq i32* %109, null br i1 %110, label %free_done25, label %free_nonnull24 free_nonnull24: ; preds = %is_allocated.then23 %111 = bitcast i32* %109 to i8* call void @_lfortran_free(i8* %111) br label %free_done25 free_done25: ; preds = %free_nonnull24, %is_allocated.then23 br label %is_allocated.ifcont27 is_allocated.else26: ; preds = %Finalize_Variable_arr_06 br label %is_allocated.ifcont27 is_allocated.ifcont27: ; preds = %is_allocated.else26, %free_done25 br label %Finalize_Variable_arr_07 Finalize_Variable_arr_07: ; preds = %is_allocated.ifcont27 %112 = getelementptr %string_descriptor, %string_descriptor* %arr_07, i32 0, i32 0 %113 = load i8*, i8** %112, align 8 %114 = icmp eq i8* %113, null br i1 %114, label %free_done29, label %free_nonnull28 free_nonnull28: ; preds = %Finalize_Variable_arr_07 call void @_lfortran_free(i8* %113) br label %free_done29 free_done29: ; preds = %free_nonnull28, %Finalize_Variable_arr_07 br label %Finalize_Variable_arr_08 Finalize_Variable_arr_08: ; preds = %free_done29 %115 = load %array.1*, %array.1** %arr_08, align 8 %116 = icmp ne %array.1* %115, null br i1 %116, label %is_allocated.then30, label %is_allocated.else33 is_allocated.then30: ; preds = %Finalize_Variable_arr_08 %117 = getelementptr %array.1, %array.1* %115, i32 0, i32 0 %118 = load %string_descriptor*, %string_descriptor** %117, align 8 %119 = getelementptr %string_descriptor, %string_descriptor* %118, i32 0, i32 0 %120 = load i8*, i8** %119, align 8 %121 = icmp eq i8* %120, null br i1 %121, label %free_done32, label %free_nonnull31 free_nonnull31: ; preds = %is_allocated.then30 call void @_lfortran_free(i8* %120) br label %free_done32 free_done32: ; preds = %free_nonnull31, %is_allocated.then30 br label %is_allocated.ifcont34 is_allocated.else33: ; preds = %Finalize_Variable_arr_08 br label %is_allocated.ifcont34 is_allocated.ifcont34: ; preds = %is_allocated.else33, %free_done32 br label %Finalize_Variable_arr_09 Finalize_Variable_arr_09: ; preds = %is_allocated.ifcont34 %122 = icmp eq i32* %57, null br i1 %122, label %free_done36, label %free_nonnull35 free_nonnull35: ; preds = %Finalize_Variable_arr_09 %123 = bitcast i32* %57 to i8* call void @_lfortran_free(i8* %123) br label %free_done36 free_done36: ; preds = %free_nonnull35, %Finalize_Variable_arr_09 ret void } declare i8* @_lfortran_malloc(i64) declare void @_lfortran_free(i8*) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-c_f_pointer_02-97865d6.json0000664000175000017500000000074615141516316026142 0ustar alastairalastair{ "basename": "asr-c_f_pointer_02-97865d6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/c_f_pointer_02.f90", "infile_hash": "e81284155f615b9e421316b6029ccdf0b4bbf68ee90104436dc21a6e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-c_f_pointer_02-97865d6.stderr", "stderr_hash": "155088ac0dd5a5402199d587d783c49abffe01f6e5d5e848ca068d02", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-doloop_02-cc78975.stdout0000664000175000017500000002766315141516316025604 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_02: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_02 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 a) (Var 2 b) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 a) (IntegerBinOp (IntegerBinOp (Var 2 a) Add (IntegerBinOp (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Add (Var 2 j) (Integer 4) () ) () .false. .false. )] [] )] [] ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerBinOp (IntegerBinOp (IntegerConstant 100 (Integer 4) Decimal) Mul (IntegerConstant 101 (Integer 4) Decimal) (Integer 4) (IntegerConstant 10100 (Integer 4) Decimal) ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5050 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 i) ()) [(Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (Var 2 j) (Integer 4) () ) () .false. .false. )] [] )] [] ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 220 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-block_02-bdd6766.stderr0000664000175000017500000000026315141516316026077 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/block_02.f90:7:14 | 7 | IF (A.EQ.15) GO TO 1 | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/ast-parameter_without_start_program-a99ac57.stdout0000664000175000017500000000055215141516316032555 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Declaration () [(SimpleAttribute AttrParameter )] [(x [] [] () 10 Equal ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_10-cfca9b9.stdout0000664000175000017500000000376215141516316026675 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_10: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_10 [] [(Print (StringFormat () [(IntrinsicElementalFunction Real [(Var 2 x)] 0 (Real 4) (RealConstant 3.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine3-d7c057c.json0000664000175000017500000000072615141516316025754 0ustar alastairalastair{ "basename": "ast-subroutine3-d7c057c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine3-d7c057c.stdout", "stdout_hash": "e10b35153f788c6b07c98ddad95846e8698fe1545e286262d93ae39a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nullify_01-09aa501.json0000664000175000017500000000075015141516316025353 0ustar alastairalastair{ "basename": "asr-nullify_01-09aa501", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_01.f90", "infile_hash": "5869e698f080612903a66a6001fa03b7b3390371a5a9eef3ca48a545", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_01-09aa501.stdout", "stdout_hash": "34769783007ce0fdeeaf0dc4274f1b2d32f30829513ae818ddc04344", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-class_01-704dee8.stdout0000664000175000017500000005620015141516316025450 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { circle_test: (Program (SymbolTable 6 { 1_circle_circle_print: (ExternalSymbol 6 1_circle_circle_print 3 print circle [] print Public ), 1_circle_radius: (ExternalSymbol 6 1_circle_radius 3 radius circle [] radius Public ), c: (Variable 6 c [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 6 circle Source Public Required .false. .false. .false. () .false. .false. ), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Public ) }) circle_test [class_circle1] [(Assignment (Var 6 c) (StructConstructor 6 circle [((RealConstant 1.500000 (Real 4) ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [] (Var 6 c) .false. ) (Assignment (StructInstanceMember (Var 6 c) 6 1_circle_radius (Real 4) () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [] (Var 6 c) .false. )] ), class_circle1: (Module (SymbolTable 2 { circle: (Struct (SymbolTable 3 { area: (StructMethodDeclaration 3 area () circle_area 2 circle_area Source .false. .false. ), print: (StructMethodDeclaration 3 print () circle_print 2 circle_print Source .false. .false. ), radius: (Variable 3 radius [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Private .false. .false. [] () () ), circle_area: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 4 area [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 4 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. ) }) circle_area (FunctionType [(StructType [(Real 4)] [] .false. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 this)] [(Assignment (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (StructInstanceMember (Var 4 this) 4 1_circle_radius (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 area) Private .false. .false. () ), circle_print: (Function (SymbolTable 5 { 1_circle_circle_area: (ExternalSymbol 5 1_circle_circle_area 3 area circle [] area Public ), 1_circle_radius: (ExternalSymbol 5 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 5 area [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 5 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. ) }) circle_print (FunctionType [(StructType [(Real 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this)] [(Assignment (Var 5 area) (FunctionCall 5 1_circle_circle_area () [] (Real 4) () (Var 5 this) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Circle: r = " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 this) 5 1_circle_radius (Real 4) () ) (StringConstant " area = " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 area)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Private .false. .false. () ), pi: (Variable 2 pi [] Local (Cast (RealConstant 3.141593 (Real 8) ) RealToReal (Real 4) (RealConstant 3.141593 (Real 4) ) ) (RealConstant 3.141593 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) class_circle1 () [class_circle1] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-types_02-48df0cb.stdout0000664000175000017500000000531115141516316025565 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) i32.const 1 local.set 0 f32.const 1.000000 local.set 1 local.get 0 f32.convert_i32_s local.set 1 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/llvm-return_05-b1ab26b.json0000664000175000017500000000075015141516316025540 0ustar alastairalastair{ "basename": "llvm-return_05-b1ab26b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_05.f90", "infile_hash": "d9114cec325b855f8ac7853b0cb0e9438d43c6ae5e3d6872a59aa6b6", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_05-b1ab26b.stdout", "stdout_hash": "87f4fbb8df771817656bf82caec04a3126db7b804fff1322e12f0a6e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array8-7572270.stdout0000664000175000017500000000210015141516316025016 0ustar alastairalastair(TranslationUnit [(Program array8 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 255 Value)] () () None ) [] [(a [(1 4 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(b [(1 4 DimensionExpr)] [] 255 () Asterisk ()) (c [(1 4 DimensionExpr)] [] 255 () Asterisk ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-real_dp_param-3adbc5b.json0000664000175000017500000000076115141516316026404 0ustar alastairalastair{ "basename": "asr-real_dp_param-3adbc5b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_param.f90", "infile_hash": "c3f349aae44d8efd8afc0b6bd017d9fdc88a0e652d6f7b3c35622828", "outfile": null, "outfile_hash": null, "stdout": "asr-real_dp_param-3adbc5b.stdout", "stdout_hash": "7cf5948e5e106d54101afde1d4d30c954c9ea7ef0cd6391b538dbe59", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics6-1d3a4b4.stderr0000664000175000017500000000025315141516316026256 0ustar alastairalastairsemantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/intrinsics6.f90:2:14 | 2 | print *, ieor(1, 1_8) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-program_cmake_02-d8d8f4d.stderr0000664000175000017500000000040315141516316027215 0ustar alastairalastairstyle suggestion: Use '==' instead of '.eq.' --> tests/../integration_tests/program_cmake_02.f90:4:49 | 4 | integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do | ^^^^ help: write this as '==' lfortran-lfortran-2f73434/tests/reference/asr-min_02-21863aa.json0000664000175000017500000000105115141516316024455 0ustar alastairalastair{ "basename": "asr-min_02-21863aa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/min_02.f90", "infile_hash": "395cfc5a8d60d306a6e51a8c1619bb4e36adede48c2fc96880e6c260", "outfile": null, "outfile_hash": null, "stdout": "asr-min_02-21863aa.stdout", "stdout_hash": "720e45449b4487e43b4e076ef12aad7651e10d9453694cea6edc1bfa", "stderr": "asr-min_02-21863aa.stderr", "stderr_hash": "725c31c866b6247c13d41d88baca52f0557baea049805e460d55fa23", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_clojure-functions_10-476558d.stdout0000664000175000017500000002147015141516316027745 0ustar alastairalastair(TranslationUnit (SymbolTable 1 {:kwarg_gp (Module (SymbolTable 2 {:mergegp (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public), :mergei32 (Function (SymbolTable 3 {:a (Variable 3 a [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :b (Variable 3 b [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :m (Variable 3 m [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false.), :r (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false.)}) mergei32 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray) (Array (Integer 4) [(() ())] DescriptorArray) (Array (Integer 4) [(() ())] DescriptorArray)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 3 a) (Var 3 b) (Var 3 m)] [] (Var 3 r) Public .false. .false. ()), :merger32 (Function (SymbolTable 4 {:a (Variable 4 a [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :b (Variable 4 b [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :m (Variable 4 m [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false.), :r (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false.)}) merger32 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray) (Array (Real 4) [(() ())] DescriptorArray) (Array (Real 4) [(() ())] DescriptorArray)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 4 a) (Var 4 b) (Var 4 m)] [] (Var 4 r) Public .false. .false. ()), :merger64 (Function (SymbolTable 5 {:a (Variable 5 a [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :b (Variable 5 b [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Required .false. .false. .false. () .false. .false.), :m (Variable 5 m [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray) () Source Public Optional .false. .false. .false. () .false. .false.), :r (Variable 5 r [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false.)}) merger64 (FunctionType [(Array (Real 8) [(() ())] DescriptorArray) (Array (Real 8) [(() ())] DescriptorArray) (Array (Real 8) [(() ())] DescriptorArray)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [(Var 5 a) (Var 5 b) (Var 5 m)] [] (Var 5 r) Public .false. .false. ())}) kwarg_gp () [] .false. .false. .false.), :kwarg_use (Program (SymbolTable 6 {:a1 (Variable 6 a1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :a2 (Variable 6 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :b1 (Variable 6 b1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :b2 (Variable 6 b2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :m1 (Variable 6 m1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :m2 (Variable 6 m2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray) () Source Public Required .false. .false. .false. () .false. .false.), :mergegp (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public), :mergegp/mergei32 (ExternalSymbol 6 mergegp/mergei32 2 mergei32 kwarg_gp [] mergei32 Private), :mergegp/merger32 (ExternalSymbol 6 mergegp/merger32 2 merger32 kwarg_gp [] merger32 Private), :mergei32 (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public), :merger32 (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public), :merger64 (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public)}) kwarg_use [kwarg_gp] [(Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) (())] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ()))] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray) ()))] (Integer 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) (())] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ()))] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ())) (Print (StringFormat () [(FunctionCall 6 mergegp/merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ())) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray) ()))] (Real 4) () ())] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString)) ()))])}) []) lfortran-lfortran-2f73434/tests/reference/llvm-automatic_allocation_02-2a7afc4.stdout0000664000175000017500000004231215141516316030772 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"i\00", align 1 @1 = private unnamed_addr constant [125 x i8] c"At 9:5 of file tests/../integration_tests/automatic_allocation_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"r\00", align 1 @3 = private unnamed_addr constant [126 x i8] c"At 10:5 of file tests/../integration_tests/automatic_allocation_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @5 = private unnamed_addr constant [126 x i8] c"At 11:5 of file tests/../integration_tests/automatic_allocation_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"l\00", align 1 @7 = private unnamed_addr constant [126 x i8] c"At 12:5 of file tests/../integration_tests/automatic_allocation_02.f90\0AAttempting to allocate already allocated variable '%s'\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"i\00", align 1 @9 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"r\00", align 1 @13 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @17 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"l\00", align 1 @21 = private unnamed_addr constant [32 x i8] c"Variable '%s' is not allocated.\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %complex_4*, align 8 store %complex_4* null, %complex_4** %c, align 8 %i = alloca i32*, align 8 store i32* null, i32** %i, align 8 %l = alloca i1*, align 8 store i1* null, i1** %l, align 8 %r = alloca float*, align 8 store float* null, float** %r, align 8 %2 = load i32*, i32** %i, align 8 %3 = icmp eq i32* %2, null br i1 %3, label %then, label %else then: ; preds = %.entry %4 = load i32*, i32** %i, align 8 %5 = ptrtoint i32* %4 to i64 %6 = icmp ne i64 %5, 0 br i1 %6, label %then1, label %ifcont then1: ; preds = %then call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %then %7 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %7, i8 0, i32 4, i1 false) %8 = bitcast i8* %7 to i32* store i32* %8, i32** %i, align 8 br label %ifcont2 else: ; preds = %.entry br label %ifcont2 ifcont2: ; preds = %else, %ifcont %9 = load i32*, i32** %i, align 8 store i32 10, i32* %9, align 4 %10 = load float*, float** %r, align 8 %11 = icmp eq float* %10, null br i1 %11, label %then3, label %else6 then3: ; preds = %ifcont2 %12 = load float*, float** %r, align 8 %13 = ptrtoint float* %12 to i64 %14 = icmp ne i64 %13, 0 br i1 %14, label %then4, label %ifcont5 then4: ; preds = %then3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %then3 %15 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %15, i8 0, i32 4, i1 false) %16 = bitcast i8* %15 to float* store float* %16, float** %r, align 8 br label %ifcont7 else6: ; preds = %ifcont2 br label %ifcont7 ifcont7: ; preds = %else6, %ifcont5 %17 = load float*, float** %r, align 8 store float 0x40119999A0000000, float* %17, align 4 %18 = load %complex_4*, %complex_4** %c, align 8 %19 = icmp eq %complex_4* %18, null br i1 %19, label %then8, label %else11 then8: ; preds = %ifcont7 %20 = load %complex_4*, %complex_4** %c, align 8 %21 = ptrtoint %complex_4* %20 to i64 %22 = icmp ne i64 %21, 0 br i1 %22, label %then9, label %ifcont10 then9: ; preds = %then8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %then8 %23 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %23, i8 0, i32 8, i1 false) %24 = bitcast i8* %23 to %complex_4* store %complex_4* %24, %complex_4** %c, align 8 br label %ifcont12 else11: ; preds = %ifcont7 br label %ifcont12 ifcont12: ; preds = %else11, %ifcont10 %25 = load %complex_4*, %complex_4** %c, align 8 store %complex_4 <{ float 1.000000e+00, float 2.000000e+00 }>, %complex_4* %25, align 1 %26 = load i1*, i1** %l, align 8 %27 = icmp eq i1* %26, null br i1 %27, label %then13, label %else16 then13: ; preds = %ifcont12 %28 = load i1*, i1** %l, align 8 %29 = ptrtoint i1* %28 to i64 %30 = icmp ne i64 %29, 0 br i1 %30, label %then14, label %ifcont15 then14: ; preds = %then13 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont15: ; preds = %then13 %31 = call i8* @_lfortran_malloc(i64 1) call void @llvm.memset.p0i8.i32(i8* %31, i8 0, i32 1, i1 false) %32 = bitcast i8* %31 to i1* store i1* %32, i1** %l, align 8 br label %ifcont17 else16: ; preds = %ifcont12 br label %ifcont17 ifcont17: ; preds = %else16, %ifcont15 %33 = load i1*, i1** %l, align 8 store i1 true, i1* %33, align 1 %34 = load i32*, i32** %i, align 8 %35 = ptrtoint i32* %34 to i64 %36 = icmp eq i64 %35, 0 br i1 %36, label %then18, label %ifcont19 then18: ; preds = %ifcont17 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont19: ; preds = %ifcont17 %37 = load i32*, i32** %i, align 8 %38 = load i32, i32* %37, align 4 %39 = icmp ne i32 %38, 10 br i1 %39, label %then20, label %else21 then20: ; preds = %ifcont19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont22 else21: ; preds = %ifcont19 br label %ifcont22 ifcont22: ; preds = %else21, %then20 %40 = load float*, float** %r, align 8 %41 = ptrtoint float* %40 to i64 %42 = icmp eq i64 %41, 0 br i1 %42, label %then23, label %ifcont24 then23: ; preds = %ifcont22 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont24: ; preds = %ifcont22 %43 = load float*, float** %r, align 8 %44 = load float, float* %43, align 4 %45 = fcmp une float %44, 0x40119999A0000000 br i1 %45, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %46 = load %complex_4*, %complex_4** %c, align 8 %47 = ptrtoint %complex_4* %46 to i64 %48 = icmp eq i64 %47, 0 br i1 %48, label %then28, label %ifcont29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont29: ; preds = %ifcont27 %49 = load %complex_4*, %complex_4** %c, align 8 %50 = load %complex_4, %complex_4* %49, align 1 %51 = extractvalue %complex_4 %50, 0 %52 = extractvalue %complex_4 %50, 1 %53 = fcmp one float %51, 1.000000e+00 %54 = fcmp one float %52, 2.000000e+00 %55 = or i1 %53, %54 br i1 %55, label %then30, label %else31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont32 else31: ; preds = %ifcont29 br label %ifcont32 ifcont32: ; preds = %else31, %then30 %56 = load i1*, i1** %l, align 8 %57 = ptrtoint i1* %56 to i64 %58 = icmp eq i64 %57, 0 br i1 %58, label %then33, label %ifcont34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %59 = load i1*, i1** %l, align 8 %60 = load i1, i1* %59, align 1 %61 = icmp eq i1 %60, false %62 = xor i1 %60, true br i1 %62, label %then35, label %else36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont37 else36: ; preds = %ifcont34 br label %ifcont37 ifcont37: ; preds = %else36, %then35 %63 = load i32*, i32** %i, align 8 %64 = ptrtoint i32* %63 to i64 %65 = icmp ne i64 %64, 0 br i1 %65, label %then38, label %else39 then38: ; preds = %ifcont37 %66 = alloca i8*, align 8 %67 = bitcast i32* %63 to i8* store i8* %67, i8** %66, align 8 %68 = load i8*, i8** %66, align 8 call void @_lfortran_free(i8* %68) store i32* null, i32** %i, align 8 br label %ifcont40 else39: ; preds = %ifcont37 br label %ifcont40 ifcont40: ; preds = %else39, %then38 %69 = load float*, float** %r, align 8 %70 = ptrtoint float* %69 to i64 %71 = icmp ne i64 %70, 0 br i1 %71, label %then41, label %else42 then41: ; preds = %ifcont40 %72 = alloca i8*, align 8 %73 = bitcast float* %69 to i8* store i8* %73, i8** %72, align 8 %74 = load i8*, i8** %72, align 8 call void @_lfortran_free(i8* %74) store float* null, float** %r, align 8 br label %ifcont43 else42: ; preds = %ifcont40 br label %ifcont43 ifcont43: ; preds = %else42, %then41 %75 = load %complex_4*, %complex_4** %c, align 8 %76 = ptrtoint %complex_4* %75 to i64 %77 = icmp ne i64 %76, 0 br i1 %77, label %then44, label %else45 then44: ; preds = %ifcont43 %78 = alloca i8*, align 8 %79 = bitcast %complex_4* %75 to i8* store i8* %79, i8** %78, align 8 %80 = load i8*, i8** %78, align 8 call void @_lfortran_free(i8* %80) store %complex_4* null, %complex_4** %c, align 8 br label %ifcont46 else45: ; preds = %ifcont43 br label %ifcont46 ifcont46: ; preds = %else45, %then44 %81 = load i1*, i1** %l, align 8 %82 = ptrtoint i1* %81 to i64 %83 = icmp ne i64 %82, 0 br i1 %83, label %then47, label %else48 then47: ; preds = %ifcont46 %84 = alloca i8*, align 8 %85 = bitcast i1* %81 to i8* store i8* %85, i8** %84, align 8 %86 = load i8*, i8** %84, align 8 call void @_lfortran_free(i8* %86) store i1* null, i1** %l, align 8 br label %ifcont49 else48: ; preds = %ifcont46 br label %ifcont49 ifcont49: ; preds = %else48, %then47 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont49 br label %FINALIZE_SYMTABLE_automatic_allocation_02 FINALIZE_SYMTABLE_automatic_allocation_02: ; preds = %return br label %Finalize_Variable_c Finalize_Variable_c: ; preds = %FINALIZE_SYMTABLE_automatic_allocation_02 %87 = load %complex_4*, %complex_4** %c, align 8 %88 = icmp eq %complex_4* %87, null br i1 %88, label %free_done, label %free_nonnull free_nonnull: ; preds = %Finalize_Variable_c %89 = bitcast %complex_4* %87 to i8* call void @_lfortran_free(i8* %89) br label %free_done free_done: ; preds = %free_nonnull, %Finalize_Variable_c br label %Finalize_Variable_i Finalize_Variable_i: ; preds = %free_done %90 = load i32*, i32** %i, align 8 %91 = icmp eq i32* %90, null br i1 %91, label %free_done51, label %free_nonnull50 free_nonnull50: ; preds = %Finalize_Variable_i %92 = bitcast i32* %90 to i8* call void @_lfortran_free(i8* %92) br label %free_done51 free_done51: ; preds = %free_nonnull50, %Finalize_Variable_i br label %Finalize_Variable_l Finalize_Variable_l: ; preds = %free_done51 %93 = load i1*, i1** %l, align 8 %94 = icmp eq i1* %93, null br i1 %94, label %free_done53, label %free_nonnull52 free_nonnull52: ; preds = %Finalize_Variable_l %95 = bitcast i1* %93 to i8* call void @_lfortran_free(i8* %95) br label %free_done53 free_done53: ; preds = %free_nonnull52, %Finalize_Variable_l br label %Finalize_Variable_r Finalize_Variable_r: ; preds = %free_done53 %96 = load float*, float** %r, align 8 %97 = icmp eq float* %96, null br i1 %97, label %free_done55, label %free_nonnull54 free_nonnull54: ; preds = %Finalize_Variable_r %98 = bitcast float* %96 to i8* call void @_lfortran_free(i8* %98) br label %free_done55 free_done55: ; preds = %free_nonnull54, %Finalize_Variable_r ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-struct_allocate-606e066.stdout0000664000175000017500000004442515141516316027075 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { mod_struct_allocate: (Module (SymbolTable 2 { mxdim: (Variable 2 mxdim [] Local (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), rp1d: (Struct (SymbolTable 3 { f: (Variable 3 f [] Local () () Default (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) rp1d (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [f] [] Source Public .false. .false. [] () () ), sds: (Struct (SymbolTable 4 { scales: (Variable 4 scales [] Local () () Default (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) 2 rp1d Source Public Required .false. .false. .false. () .false. .false. ) }) sds (StructType [(Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) [] [scales] [] Source Public .false. .false. [] () () ) }) mod_struct_allocate () [] .false. .false. .false. ), struct_allocate: (Program (SymbolTable 5 { 1_rp1d_f: (ExternalSymbol 5 1_rp1d_f 3 f rp1d [] f Public ), 1_sds_scales: (ExternalSymbol 5 1_sds_scales 4 scales sds [] scales Public ), rp1d: (ExternalSymbol 5 rp1d 2 rp1d mod_struct_allocate [] rp1d Public ), s: (Variable 5 s [] Local () () Default (StructType [(Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray )] [] .true. .false. ) 5 sds Source Public Required .false. .false. .false. () .false. .false. ), sds: (ExternalSymbol 5 sds 2 sds mod_struct_allocate [] sds Public ) }) struct_allocate [mod_struct_allocate] [(Allocate [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 5 s) 5 1_sds_scales (Array (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (StructType [(Pointer (Array (Real 8) [(() ())] DescriptorArray ) )] [] .true. .false. ) ColMajor () ) 5 1_rp1d_f (Pointer (Array (Real 8) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_10-2bab681.json0000664000175000017500000000074515141516316025263 0ustar alastairalastair{ "basename": "asr-arrays_10-2bab681", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_10.f90", "infile_hash": "0146a08c678315b48d4c8b7e901495a28efc46a8c25989fd6ebb887f", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_10-2bab681.stdout", "stdout_hash": "2578923fe0be21f9681e3b67bac33c0b5a860227bf1e258c710930f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json0000664000175000017500000000105215141516316031666 0ustar alastairalastair{ "basename": "pass_loop_unroll-loop_unroll_small-462d647", "cmd": "lfortran --pass=loop_unroll --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_small.f90", "infile_hash": "5a308fd86dceda8d2b6a3c4fcb2412bf4d1b3f043105d06956960db8", "outfile": null, "outfile_hash": null, "stdout": "pass_loop_unroll-loop_unroll_small-462d647.stdout", "stdout_hash": "d67a891fa608153843dbfade49d3add59fde99bf083c15137c968491", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_10-b69c804.stderr0000664000175000017500000000036715141516316030112 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands 'a' and 'b'. Tried to match size 2 of dimension 2 of 'a' with size 3 of dimension 2 of 'b'. --> tests/errors/array_bounds_check_10.f90:9:9 | 9 | e = a + b | ^ lfortran-lfortran-2f73434/tests/reference/asr-parameter1-1a7ed3b.stdout0000664000175000017500000001771715141516316026164 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dcstep: (Function (SymbolTable 2 { p66: (Variable 2 p66 [] Local (RealConstant 0.660000 (Real 8) ) (RealConstant 0.660000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 2 s [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), three: (Variable 2 three [] Local (RealConstant 3.000000 (Real 8) ) (RealConstant 3.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), two: (Variable 2 two [] Local (RealConstant 2.000000 (Real 8) ) (RealConstant 2.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local (RealConstant 0.000000 (Real 8) ) (RealConstant 0.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) dcstep (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 s) (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Abs [(Var 2 three)] 0 (Real 8) (RealConstant 3.000000 (Real 8) ) ) (IntrinsicElementalFunction Abs [(Var 2 two)] 0 (Real 8) (RealConstant 2.000000 (Real 8) ) ) (IntrinsicElementalFunction Abs [(Var 2 p66)] 0 (Real 8) (RealConstant 0.660000 (Real 8) ) )] 0 (Real 8) (RealConstant 3.000000 (Real 8) ) ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit_check-62ffca3.stdout0000664000175000017500000000105315141516316031264 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec a h ) (LetterSpec o z )] )] () )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_logical-13e0bd7.json0000664000175000017500000000077515141516316026760 0ustar alastairalastair{ "basename": "asr-arrays_01_logical-13e0bd7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_logical.f90", "infile_hash": "494cd2aba8ceee4c9a0bddba4b51d7a4b0b3f817d92e8c0894e4b08b", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_logical-13e0bd7.stdout", "stdout_hash": "aab443c9498cf21d6641b663677f48e53156206facc8c5607a5b9821", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_array_type_where_02-b821d8c.json0000664000175000017500000000102315141516316031400 0ustar alastairalastair{ "basename": "asr-incorrect_array_type_where_02-b821d8c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_array_type_where_02.f90", "infile_hash": "5668cc071e9f55f2ce6475dee614a22d075cea9d84e433197a7f0ac5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_array_type_where_02-b821d8c.stderr", "stderr_hash": "283fe1c585d134850afe27d9f5cdaa5c07ffcfe890b4bb815dfdbf78", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_where-where_04-2ee4397.stdout0000664000175000017500000005444715141516316026770 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { absdiff: (Variable 3 absdiff [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), reldiff: (Variable 3 reldiff [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Assignment (Var 3 reldiff) (ArrayConstant 8 [0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 3 absdiff) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (If () (RealCompare (FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () ) NotEq (RealConstant 0.000000 (Real 4) ) (Array (Logical 4) [(() ())] DescriptorArray ) () ) [(Assignment (Var 3 reldiff) (RealBinOp (ArrayBroadcast (Var 3 absdiff) (IntrinsicArrayFunction Shape [(IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) Div (IntrinsicElementalFunction Abs [(FunctionCall 2 solution () [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () () )] 0 (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 reldiff) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 reldiff)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) solution (FunctionType [] (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000001e-01, 1.00000001e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .false. .false. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-block_02-bdd6766.json0000664000175000017500000000110015141516316025534 0ustar alastairalastair{ "basename": "ast_f90-block_02-bdd6766", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block_02-bdd6766.stdout", "stdout_hash": "a32e429d8baa7f7afbb9aa01eb34fe290749104aaadd2e42f87d20d8", "stderr": "ast_f90-block_02-bdd6766.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-read1-a5fe5d5.json0000664000175000017500000000071715141516316025226 0ustar alastairalastair{ "basename": "ast_f90-read1-a5fe5d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/read1.f90", "infile_hash": "a8601ffbfb4ea0a84892d205a776a40b585951d3e69794b2b29d399a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-read1-a5fe5d5.stdout", "stdout_hash": "d21ac25095b1858a691f3256d5fe45e74fb0d90dec0a928044d0d1dd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-builtin1-1b5ca89.stdout0000664000175000017500000000664415141516316025577 0ustar alastairalastair(TranslationUnit [(Program builtin_01 (TriviaNode [(EndOfLine) (Comment "! AST only tests" )] [] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Inquire 0 [] [(unit n) (opened inuse)] [] () ) (Inquire 0 [] [(UNIT JOAN) (OPENED LOG_01) (NAMED LOG_02) (FORM CHAR_VAR) (IOSTAT IOS)] [] () ) (Inquire 0 [] [(IOLENGTH IOL)] [(FuncCallOrArray A [] [(1 N 1 0)] [] [] [] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Rewind 0 [s] [] () ) (Rewind 0 [s] [] () ) (Rewind 0 [10] [] () ) (Rewind 0 [] [(err label) (unit s)] () ) (Rewind 0 [(FuncCallOrArray iunit [] [(() 13 () 0)] [] [] [] )] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Backspace 0 [u] [] () ) (Backspace 0 [io_unit] [] () ) (Backspace 0 [10] [] () ) (Backspace 0 [10] [(IOSTAT N)] () ) (Backspace 0 [(FuncCallOrArray iunit [] [(() 13 () 0)] [] [] [] )] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Endfile 0 [K] [] () ) (Endfile 0 [5] [] () ) (Endfile 0 [k] [] () ) (Endfile 0 [10] [(iostat n)] () ) (Endfile 0 [] [(unit iout) (iostat ios) (iomsg msg)] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/wat-types_15-abe4006.stdout0000664000175000017500000002611515141516316025505 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i64 i64 i32 i32 f64 f64 f32 f32) i32.const 8 local.set 0 i32.const 2 local.set 4 i64.const 2 local.set 2 f32.const 3.140000 local.set 8 f64.const 3.140000 local.set 6 local.get 4 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 8 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 6 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 4 local.set 3 local.get 2 local.set 1 local.get 8 local.set 7 local.get 6 local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 2 i32.wrap_i64 local.set 3 local.get 8 i64.trunc_f32_s local.set 1 local.get 6 f32.demote_f64 local.set 7 local.get 4 f64.convert_i32_s local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 8 i32.trunc_f32_s local.set 3 local.get 6 i64.trunc_f64_s local.set 1 local.get 4 f32.convert_i32_s local.set 7 local.get 2 f64.convert_i64_s local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 6 i32.trunc_f64_s local.set 3 local.get 4 i64.extend_i32_s local.set 1 local.get 2 f32.convert_i64_s local.set 7 local.get 8 f64.promote_f32 local.set 5 local.get 3 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 7 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine6-a3aec97.json0000664000175000017500000000072615141516316026037 0ustar alastairalastair{ "basename": "ast-subroutine6-a3aec97", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine6-a3aec97.stdout", "stdout_hash": "4bece425307001572b06c85fe216838cc52f068a64ee07628af1c68c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_01-3535389.stdout0000664000175000017500000000555515141516316025605 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_01: (Program (SymbolTable 4 { b: (ExternalSymbol 4 b 2 b modules_01_a [] b Public ) }) modules_01 [modules_01_a] [(SubroutineCall 4 b () [] () .false. )] ), modules_01_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_01_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-return_03-3f7087d.stderr0000664000175000017500000000026615141516316025755 0ustar alastairalastairstyle suggestion: Use '>' instead of '.gt.' --> tests/../integration_tests/return_03.f90:10:15 | 10 | if (i .GT. 5) then | ^^^^ help: write this as '>' lfortran-lfortran-2f73434/tests/reference/asr-issue532-4bdd3b3.stdout0000664000175000017500000002615215141516316025475 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { issue532: (Program (SymbolTable 5 { }) issue532 [] [] ), issue532_mod: (Module (SymbolTable 2 { imodulo: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) imodulo (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sfloor] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((IntrinsicElementalFunction Real [(Var 4 x)] 0 (Real 4) () ))] (Integer 4) () () ) Mul (Var 4 y) (Integer 4) () ) () .false. .false. )] (Var 4 r) Public .false. .false. () ), sfloor: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sfloor (FunctionType [(Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4) () ) () .false. .false. )] (Var 3 r) Public .false. .false. () ) }) issue532_mod () [issue532_mod] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_05-1440b57.json0000664000175000017500000000100115141516316030054 0ustar alastairalastair{ "basename": "ast-program_without_line_05-1440b57", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_05.f90", "infile_hash": "808db970dd0ce4b65d56b9efbf2954ddc7f7a1c09417a583b2fce88a", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_05-1440b57.stdout", "stdout_hash": "6ee9a73b40d16d6c1602f39dd4d1d697cb02c3cd8afa0b4285f7824f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string2-3425046.stdout0000664000175000017500000012636415141516316025213 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_filesystem: (Module (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 11 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_ptr: (ExternalSymbol 2 c_ptr 11 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_string: (ExternalSymbol 2 f_string 4 f_string fpm_strings [] f_string Public ), f_string_cptr@f_string: (ExternalSymbol 2 f_string_cptr@f_string 4 f_string_cptr fpm_strings [] f_string_cptr Public ), f_string_cptr_n@f_string: (ExternalSymbol 2 f_string_cptr_n@f_string 4 f_string_cptr_n fpm_strings [] f_string_cptr_n Public ), f_string~genericprocedure@f_string: (ExternalSymbol 2 f_string~genericprocedure@f_string 4 f_string~genericprocedure fpm_strings [] f_string~genericprocedure Public ), get_temp_filename: (Function (SymbolTable 19 { c_tempfile: (Variable 19 c_tempfile [] Local () () Default (Pointer (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), f_string@f_string~genericprocedure: (ExternalSymbol 19 f_string@f_string~genericprocedure 4 f_string~genericprocedure fpm_strings [] f_string~genericprocedure Private ), tempfile: (Variable 19 tempfile [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_temp_filename (FunctionType [] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 19 tempfile) (FunctionCall 19 f_string@f_string~genericprocedure 2 f_string [((Var 19 c_tempfile))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. )] (Var 19 tempfile) Public .false. .false. () ), list_files: (Function (SymbolTable 18 { dir_entry_c: (Variable 18 dir_entry_c [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), dir_handle: (Variable 18 dir_handle [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), f_string@f_string_cptr: (ExternalSymbol 18 f_string@f_string_cptr 4 f_string_cptr fpm_strings [] f_string_cptr Private ), string_fortran: (Variable 18 string_fortran [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) list_files (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (LogicalNot (PointerAssociated (Var 18 dir_entry_c) () (Logical 4) () ) (Logical 4) () ) [(Exit () )] [(Assignment (Var 18 string_fortran) (FunctionCall 18 f_string@f_string_cptr 2 f_string [((Var 18 dir_entry_c))] (Allocatable (String 1 () DeferredLength DescriptorString) ) () () ) () .false. .false. )] )] [] )] () Public .false. .false. () ), string_t: (ExternalSymbol 2 string_t 4 string_t fpm_strings [] string_t Public ) }) fpm_filesystem () [fpm_strings iso_c_binding] .false. .false. .false. ), fpm_strings: (Module (SymbolTable 4 { c_char: (ExternalSymbol 4 c_char 11 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_ptr: (ExternalSymbol 4 c_ptr 11 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_size_t: (ExternalSymbol 4 c_size_t 11 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), f_string: (GenericProcedure 4 f_string [4 f_string~genericprocedure 4 f_string_cptr 4 f_string_cptr_n] Public ), f_string_cptr: (Function (SymbolTable 6 { c_strlen: (Function (SymbolTable 7 { r: (Variable 7 r [] ReturnVar () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 7 s [] In () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ) }) c_strlen (FunctionType [(CPtr)] (Integer 8) BindC Interface "strlen" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 s)] [] (Var 7 r) Public .false. .false. () ), cptr: (Variable 6 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 6 lfortran_tmp [] Local () () Default (Integer 8) () Source Private Required .false. .false. .false. () .false. .false. ), s: (Variable 6 s [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string_cptr (FunctionType [(CPtr)] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_string_cptr_n] [(Var 6 cptr)] [(Assignment (Var 6 lfortran_tmp) (FunctionCall 6 c_strlen () [((Var 6 cptr))] (Integer 8) () () ) () .false. .false. ) (Assignment (Var 6 s) (FunctionCall 4 f_string_cptr_n () [((Var 6 cptr)) ((Var 6 lfortran_tmp))] (String 1 (Var 6 lfortran_tmp) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 6 s) Public .false. .false. () ), f_string_cptr_n: (Function (SymbolTable 8 { cptr: (Variable 8 cptr [] In () () Default (CPtr) () Source Public Required .true. .false. .false. () .false. .false. ), n: (Variable 8 n [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 8 s [n] ReturnVar () () Default (String 1 (Var 8 n) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string_cptr_n (FunctionType [(CPtr) (Integer 8)] (String 1 (FunctionParam 1 (Integer 8) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 cptr) (Var 8 n)] [] (Var 8 s) Public .false. .false. () ), f_string~genericprocedure: (Function (SymbolTable 9 { c_string: (Variable 9 c_string [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f_string: (Variable 9 f_string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_string~genericprocedure (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 c_string)] [] (Var 9 f_string) Public .false. .false. () ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () ) }) fpm_strings () [iso_c_binding fpm_strings] .true. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_45-1c0e790.stdout0000664000175000017500000052250715141516316027147 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 8 { c_bool: (ExternalSymbol 8 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 8 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 8 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 8 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 8 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 9 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 10 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 11 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 12 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 13 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 14 { gomp_loop_auto_next: (Variable 14 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 14 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 14 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 istart) (Var 14 iend)] [] (Var 14 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 15 { end: (Variable 15 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 15 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 15 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 15 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 15 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 15 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 start) (Var 15 end) (Var 15 incr) (Var 15 istart) (Var 15 iend)] [] (Var 15 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 16 { gomp_loop_dynamic_next: (Variable 16 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 17 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 18 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 19 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 20 { gomp_loop_guided_next: (Variable 20 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 21 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 22 { gomp_loop_runtime_next: (Variable 22 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 22 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 22 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 istart) (Var 22 iend)] [] (Var 22 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 23 { end: (Variable 23 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 23 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 23 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 23 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 23 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 23 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 start) (Var 23 end) (Var 23 incr) (Var 23 istart) (Var 23 iend)] [] (Var 23 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 24 { gomp_loop_static_next: (Variable 24 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 24 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 24 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 istart) (Var 24 iend)] [] (Var 24 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 25 { chunk: (Variable 25 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 25 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 25 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 25 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 25 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 25 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 25 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 start) (Var 25 end) (Var 25 incr) (Var 25 chunk) (Var 25 istart) (Var 25 iend)] [] (Var 25 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 26 { data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 26 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 num_threads) (Var 26 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 27 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 28 { gomp_sections_next: (Variable 28 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 28 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 29 { count: (Variable 29 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 29 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 count)] [] (Var 29 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 30 { arg_align: (Variable 30 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 30 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 30 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 30 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 30 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 30 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 30 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 30 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 fn) (Var 30 data) (Var 30 cpyfn) (Var 30 arg_size) (Var 30 arg_align) (Var 30 if_clause) (Var 30 flags) (Var 30 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 31 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 32 { data: (Variable 32 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 32 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 32 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 32 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 fn) (Var 32 data) (Var 32 num_teams) (Var 32 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 33 { omp_get_max_threads: (Variable 33 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 34 { omp_get_num_procs: (Variable 34 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 34 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 35 { omp_get_num_teams: (Variable 35 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 36 { omp_get_num_threads: (Variable 36 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 37 { omp_get_team_num: (Variable 37 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 37 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 38 { level: (Variable 38 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 38 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 level)] [] (Var 38 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 39 { omp_get_thread_num: (Variable 39 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 39 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 40 { omp_get_wtime: (Variable 40 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 40 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 41 { n: (Variable 41 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_45: (Program (SymbolTable 6 { c_bool: (ExternalSymbol 6 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 6 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 6 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 6 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 6 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), compute_a: (ExternalSymbol 6 compute_a 2 compute_a openmp_45_parallel_sections [] compute_a Public ), compute_b: (ExternalSymbol 6 compute_b 2 compute_b openmp_45_parallel_sections [] compute_b Public ), compute_c: (ExternalSymbol 6 compute_c 2 compute_c openmp_45_parallel_sections [] compute_c Public ), gomp_atomic_end: (ExternalSymbol 6 gomp_atomic_end 8 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 6 gomp_atomic_start 8 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 6 gomp_barrier 8 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 6 gomp_critical_end 8 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 6 gomp_critical_start 8 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 6 gomp_loop_auto_next 8 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 6 gomp_loop_auto_start 8 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 6 gomp_loop_dynamic_next 8 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 6 gomp_loop_dynamic_start 8 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 6 gomp_loop_end 8 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 6 gomp_loop_end_nowait 8 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 6 gomp_loop_guided_next 8 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 6 gomp_loop_guided_start 8 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 6 gomp_loop_runtime_next 8 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 6 gomp_loop_runtime_start 8 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 6 gomp_loop_static_next 8 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 6 gomp_loop_static_start 8 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 6 gomp_parallel 8 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 6 gomp_sections_end 8 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 6 gomp_sections_next 8 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 6 gomp_sections_start 8 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 6 gomp_task 8 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 6 gomp_taskwait 8 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 6 gomp_teams 8 gomp_teams omp_lib [] gomp_teams Public ), omp_get_max_threads: (ExternalSymbol 6 omp_get_max_threads 8 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 6 omp_get_num_procs 8 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 6 omp_get_num_teams 8 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 6 omp_get_num_threads 8 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 6 omp_get_team_num 8 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 6 omp_get_team_size 8 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 6 omp_get_thread_num 8 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 6 omp_get_wtime 8 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 6 omp_set_num_threads 8 omp_set_num_threads omp_lib [] omp_set_num_threads Public ), tid: (Variable 6 tid [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) openmp_45 [omp_lib openmp_45_parallel_sections] [(OMPRegion ParallelSections [] [(OMPRegion Section [] [(SubroutineCall 6 compute_a () [] () .false. )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_b () [] () .false. )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_c () [] () .false. )] )] )] ), openmp_45_parallel_sections: (Module (SymbolTable 2 { compute_a: (Function (SymbolTable 3 { }) compute_a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing A" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_b: (Function (SymbolTable 4 { }) compute_b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing B" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_c: (Function (SymbolTable 5 { }) compute_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing C" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) openmp_45_parallel_sections () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutine5-0e48a69.stdout0000664000175000017500000000012515141516316026561 0ustar alastairalastairfunction add(a::Float32, b::Float32, c::Base.RefValue{Float32}) c[] = a + b end lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_04-e28fb55.stdout0000664000175000017500000006344115141516316030577 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_04_stdlib_string_type: (Module (SymbolTable 2 { assign_string_char: (Function (SymbolTable 4 { 1_string_type_raw: (ExternalSymbol 4 1_string_type_raw 3 raw string_type [] raw Public ), lhs: (Variable 4 lhs [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) assign_string_char (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (StructInstanceMember (Var 4 lhs) 4 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 4 rhs) () .false. .false. )] () Public .false. .false. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () ), trim_string: (Function (SymbolTable 5 { 1_string_type_raw: (ExternalSymbol 5 1_string_type_raw 3 raw string_type [] raw Public ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), trimmed_string: (Variable 5 trimmed_string [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) trim_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [assign_string_char] [(Var 5 string)] [(Assignment (Var 5 trimmed_string) (StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (SubroutineCall 2 assign_string_char 2 ~assign [((Var 5 trimmed_string)) ((StructInstanceMember (Var 5 string) 5 1_string_type_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () ))] () .false. ) .false. .false. )] (Var 5 trimmed_string) Public .false. .false. () ), ~assign: (CustomOperator 2 ~assign [2 assign_string_char] Public ) }) operator_overloading_04_stdlib_string_type () [] .false. .false. .false. ), operator_overloading_stdlib_string_use: (Module (SymbolTable 6 { chomp_string: (Function (SymbolTable 7 { assign_string_char@~assign: (ExternalSymbol 7 assign_string_char@~assign 2 assign_string_char operator_overloading_04_stdlib_string_type [] assign_string_char Public ), chomped_string: (Variable 7 chomped_string [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 7 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 7 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ), ~assign: (ExternalSymbol 7 ~assign 2 ~assign operator_overloading_04_stdlib_string_type [] ~assign Public ) }) chomp_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 string)] [] (Var 7 chomped_string) Public .false. .false. () ), string_type: (ExternalSymbol 6 string_type 2 string_type operator_overloading_04_stdlib_string_type [] string_type Public ) }) operator_overloading_stdlib_string_use () [operator_overloading_04_stdlib_string_type] .false. .false. .false. ), stdlib_string: (Program (SymbolTable 8 { }) stdlib_string [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-block2-b06d9e1.stdout0000664000175000017500000001415615141516316025215 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { hybrd: (Function (SymbolTable 2 { delta: (Variable 2 delta [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), fcn: (Function (SymbolTable 3 { n: (Variable 3 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fcn (FunctionType [(Integer 4)] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 n)] [] () Public .false. .false. () ), main: (Block (SymbolTable 4 { }) main [(Assignment (Var 2 delta) (IntrinsicElementalFunction Abs [(Var 2 ratio)] 0 (Real 4) () ) () .false. .false. )] ), ratio: (Variable 2 ratio [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) hybrd (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(BlockCall -1 2 main )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr2-6f9abe8.json0000664000175000017500000000070715141516316025004 0ustar alastairalastair{ "basename": "llvm-expr2-6f9abe8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr2-6f9abe8.stdout", "stdout_hash": "b7b6fd118a15ba00df9bceeaec7811941ce8ee4905f63f262748d77c", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.jsonlfortran-lfortran-2f73434/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_t0000664000175000017500000000114615141516316035006 0ustar alastairalastair{ "basename": "pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f", "cmd": "lfortran --pass=array_struct_temporary,array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/array_op_simplifier_test.f90", "infile_hash": "c0b02cecb6f724cd809c6ed591f08c805e9d87dc0635842a5eca99be", "outfile": null, "outfile_hash": null, "stdout": "pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.stdout", "stdout_hash": "42db1d6e6c94a8da3f987447c7305b993707fa569065894957658f0a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-while_02_fixed_form-524b922.stdout0000664000175000017500000001011515141516316027504 0ustar alastairalastair(TranslationUnit [(Program while_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 55) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 10) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (If 0 () (== i 2) [(Exit 0 () () )] [] () () () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 1) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 2) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 i 0 () ) (Assignment 0 j 0 () ) (WhileLoop 0 () (< i 10) [(Assignment 0 i (+ i 1) () ) (If 0 () (== i 2) [(Cycle 0 () () )] [] () () () ) (Assignment 0 j (+ j i) () )] () () ) (If 0 () (/= j 53) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (/= i 10) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_indent-subroutine1-fdc40b3.stdout0000664000175000017500000000362715141516316027740 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* x i) () )] () () )] [] [] ) (Subroutine h [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* i x) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_08-3680946.stdout0000664000175000017500000010760115141516316027005 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_08: (Program (SymbolTable 6 { 1_rectangle_length: (ExternalSymbol 6 1_rectangle_length 4 length rectangle [] length Public ), 1_rectangle_width: (ExternalSymbol 6 1_rectangle_width 4 width rectangle [] width Public ), 1_shape_color: (ExternalSymbol 6 1_shape_color 3 color shape [] color Public ), 1_shape_filled: (ExternalSymbol 6 1_shape_filled 3 filled shape [] filled Public ), 1_shape_initialize_subrout: (ExternalSymbol 6 1_shape_initialize_subrout 3 initialize shape [] initialize Public ), 1_shape_x: (ExternalSymbol 6 1_shape_x 3 x shape [] x Public ), 1_shape_y: (ExternalSymbol 6 1_shape_y 3 y shape [] y Public ), initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public ), rect: (Variable 6 rect [] Local () () Default (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 6 rectangle Source Public Required .false. .false. .false. () .false. .false. ), rectangle: (ExternalSymbol 6 rectangle 2 rectangle shape_mod [] rectangle Public ), shape: (ExternalSymbol 6 shape 2 shape shape_mod [] shape Public ), shp: (Variable 6 shp [] Local () () Default (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .true. .false. ) 6 shape Source Public Required .false. .false. .false. () .false. .false. ) }) derived_types_08 [shape_mod] [(SubroutineCall 6 1_shape_initialize_subrout () [((IntegerConstant 1 (Integer 4) Decimal)) ((LogicalConstant .true. (Logical 4) )) ((IntegerConstant 10 (Integer 4) Decimal)) ((IntegerConstant 20 (Integer 4) Decimal))] (Var 6 shp) .false. ) (SubroutineCall 6 1_shape_initialize_subrout () [((IntegerConstant 2 (Integer 4) Decimal)) ((LogicalConstant .false. (Logical 4) )) ((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 200 (Integer 4) Decimal))] (Var 6 rect) .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 shp) 6 1_shape_color (Integer 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_filled (Logical 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_x (Integer 4) () ) (StructInstanceMember (Var 6 shp) 6 1_shape_y (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StructInstanceMember (Var 6 rect) 6 1_shape_color (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_filled (Logical 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_x (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_shape_y (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (StructInstanceMember (Var 6 rect) 6 1_rectangle_length (Integer 4) () ) (IntegerConstant 100 (Integer 4) Decimal) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 rect) 6 1_rectangle_width (Integer 4) () ) (IntegerConstant 200 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 rect) 6 1_rectangle_length (Integer 4) () ) (StructInstanceMember (Var 6 rect) 6 1_rectangle_width (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), shape_mod: (Module (SymbolTable 2 { initialize_subrout: (Function (SymbolTable 5 { 1_shape_color: (ExternalSymbol 5 1_shape_color 3 color shape [] color Public ), 1_shape_filled: (ExternalSymbol 5 1_shape_filled 3 filled shape [] filled Public ), 1_shape_x: (ExternalSymbol 5 1_shape_x 3 x shape [] x Public ), 1_shape_y: (ExternalSymbol 5 1_shape_y 3 y shape [] y Public ), color: (Variable 5 color [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), filled: (Variable 5 filled [] Unspecified () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), sh: (Variable 5 sh [] Unspecified () () Default (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 shape Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) initialize_subrout (FunctionType [(StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .false. .false. ) (Integer 4) (Logical 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [(Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_color (Integer 4) () ) (Var 5 color) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_filled (Logical 4) () ) (Var 5 filled) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_x (Integer 4) () ) (Var 5 x) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sh) 5 1_shape_y (Integer 4) () ) (Var 5 y) () .false. .false. )] () Public .false. .false. () ), rectangle: (Struct (SymbolTable 4 { length: (Variable 4 length [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), width: (Variable 4 width [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) rectangle (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [length width] [] Source Public .false. .false. [] () 2 shape ), shape: (Struct (SymbolTable 3 { color: (Variable 3 color [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), filled: (Variable 3 filled [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), initialize: (StructMethodDeclaration 3 initialize () initialize_subrout 2 initialize_subrout Source .false. .false. ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) shape (StructType [(Integer 4) (Logical 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [color filled x y] [] Source Public .false. .false. [] () () ) }) shape_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_10-0449324.json0000664000175000017500000000075615141516316025560 0ustar alastairalastair{ "basename": "asr-functions_10-0449324", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_10.f90", "infile_hash": "fe4afd6d0a7065df5d59b482ad1bc0447df5303dc8246e85aa192fe0", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_10-0449324.stdout", "stdout_hash": "83db35b970619f804a3512fc996173e46df25d5d5afc98348d906bc8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_cc-78281a4.stderr0000664000175000017500000000026515141516316030572 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_cc.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-associate_07-a296ccb.stdout0000664000175000017500000003405315141516316026377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_07: (Program (SymbolTable 2 { p1: (Variable 2 p1 [] Local (PointerNullConstant (Pointer (Integer 4) ) () ) (PointerNullConstant (Pointer (Integer 4) ) () ) Save (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), p2: (Variable 2 p2 [] Local (PointerNullConstant (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () ) (PointerNullConstant (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () ) Save (Pointer (Array (Real 8) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), p3: (Variable 2 p3 [] Local (PointerNullConstant (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () ) (PointerNullConstant (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () ) Save (Pointer (Array (Complex 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), t1: (Variable 2 t1 [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .true. .false. () .false. .false. ), t2: (Variable 2 t2 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ), t3: (Variable 2 t3 [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ) }) associate_07 [] [(Associate (Var 2 p1) (Var 2 t1) ) (Associate (Var 2 p2) (ArrayPhysicalCast (Var 2 t2) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) ) (If () (LogicalNot (PointerAssociated (Var 2 p1) () (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p2) () (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p1) (Var 2 t1) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 p2) (Var 2 t2) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 p3) () (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 p3) (Var 2 t3) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-else1-9f4f4b8.json0000664000175000017500000000073215141516316024512 0ustar alastairalastair{ "basename": "ast-else1-9f4f4b8", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/else1.f", "infile_hash": "90793a3b11cf9eb1bd0bc949e1ed82c1559710f30707cc69106dfdcd", "outfile": null, "outfile_hash": null, "stdout": "ast-else1-9f4f4b8.stdout", "stdout_hash": "dcbdf701f7dc0b52cc343f15113d27aab9fc3de0ad7e1d5c5e6bcd6c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-global_scope4-10fa534.stdout0000664000175000017500000000124315141516316026645 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 %1 = add i32 %0, 1 store i32 %1, i32* @x, align 4 %2 = load i32, i32* @x, align 4 %3 = mul i32 3, %2 store i32 %3, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %4 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %4 } lfortran-lfortran-2f73434/tests/reference/ast-fixed_form3-1e78b3b.stdout0000664000175000017500000000747515141516316026257 0ustar alastairalastair(TranslationUnit [(Function functionf [(n)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(functionfunctionf [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(n [] [] () () None ())] () )] [] [] [] ) (Function f [(endfunctionf)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(endfunctionf [] [] () () None ())] () )] [(Assignment 0 endfunctionf 4 () )] [] [] ) (Function g [(integerx)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integerx [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 integerx 5 () ) (Assignment 0 x 5 () ) (Assignment 0 integerx 5 () )] [] [] ) (Function g2 [(integerx)] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integerx [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () 5 Equal ())] () )] [(Assignment 0 x 5 () ) (Assignment 0 integerx 5 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-modules_06-03c75b2.json0000664000175000017500000000075315141516316025543 0ustar alastairalastair{ "basename": "llvm-modules_06-03c75b2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_06.f90", "infile_hash": "ffed6acf9a41c361cf70e0d7be27fb220ad99d98ab607fce09d93992", "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_06-03c75b2.stdout", "stdout_hash": "592c097b2c9ec68d4e2d1a6d70fa8dcd5f93e5b4a6a68d14d92272df", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-if_04-1d3b97a.stderr0000664000175000017500000000023715141516316024724 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/if_04.f90:25:1 | 25 | endif name | ^^^^^ help: write this as 'end if' lfortran-lfortran-2f73434/tests/reference/ast-template_travel_01-7f304df.json0000664000175000017500000000100015141516316027145 0ustar alastairalastair{ "basename": "ast-template_travel_01-7f304df", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01.f90", "infile_hash": "49fd555855358466e9af6299db72ebf88c01a40bb93c00fefe71c2c7", "outfile": null, "outfile_hash": null, "stdout": "ast-template_travel_01-7f304df.stdout", "stdout_hash": "7d7e682e5bef7a75c7acc83ee370a9bb2b7a0469f070542d407b0973", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_04-39da8f9.stdout0000664000175000017500000001773215141516316026033 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__y = global i32 0 @__module___lcompilers_created__nested_context__b__yy = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_nested_04_a_b(i32* %x) { .entry: %call_arg_value = alloca i32, align 4 %b = alloca i32, align 4 %y = alloca i32, align 4 %yy = alloca float, align 4 store float 0x401A666660000000, float* %yy, align 4 %0 = load i32, i32* %x, align 4 store i32 %0, i32* %y, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %y, align 4 store i32 %2, i32* @__module___lcompilers_created__nested_context__b__y, align 4 %3 = load float, float* %yy, align 4 store float %3, float* @__module___lcompilers_created__nested_context__b__yy, align 4 store i32 6, i32* %call_arg_value, align 4 %4 = call i32 @b.__module_nested_04_a_c(i32* %call_arg_value) store i32 %4, i32* %b, align 4 %5 = load i32, i32* @__module___lcompilers_created__nested_context__b__y, align 4 store i32 %5, i32* %y, align 4 %6 = load float, float* @__module___lcompilers_created__nested_context__b__yy, align 4 store float %6, float* %yy, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %7 = load i32, i32* %b, align 4 ret i32 %7 } define i32 @b.__module_nested_04_a_c(i32* %z) { .entry: %c = alloca i32, align 4 %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %z) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry %11 = alloca i64, align 8 %12 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %11, i32 0, i32 0, i32* @__module___lcompilers_created__nested_context__b__y) %13 = load i64, i64* %11, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %12, i8** %14, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %13, i64* %15, align 4 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %17 = load i8*, i8** %16, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %19 = load i64, i64* %18, align 4 %20 = trunc i64 %19 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %21 = icmp eq i8* %12, null br i1 %21, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %12) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %22 = alloca i64, align 8 %23 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %22, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__yy) %24 = load i64, i64* %22, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %23, i8** %25, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %24, i64* %26, align 4 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %28 = load i8*, i8** %27, align 8 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %30 = load i64, i64* %29, align 4 %31 = trunc i64 %30 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %28, i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %32 = icmp eq i8* %23, null br i1 %32, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %23) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %33 = load i32, i32* %z, align 4 store i32 %33, i32* %c, align 4 br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return %34 = load i32, i32* %c, align 4 ret i32 %34 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %test = alloca i32, align 4 store i32 5, i32* %call_arg_value, align 4 %2 = call i32 @__module_nested_04_a_b(i32* %call_arg_value) store i32 %2, i32* %test, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_04 FINALIZE_SYMTABLE_nested_04: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-array14-c9f6829.json0000664000175000017500000000066215141516316024727 0ustar alastairalastair{ "basename": "run-array14-c9f6829", "cmd": "lfortran --no-color {infile}", "infile": "tests/array14.f90", "infile_hash": "c9c990e2fa0b1e76065f6886599c9d343b15ecf48d914ce3ade023ac", "outfile": null, "outfile_hash": null, "stdout": "run-array14-c9f6829.stdout", "stdout_hash": "74fc7283130ca59c5e68e5f6922184ad6c4ccd93f238ebfca1ea3632", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-entry_06-b57385d.json0000664000175000017500000000074215141516316025061 0ustar alastairalastair{ "basename": "asr-entry_06-b57385d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_06.f90", "infile_hash": "5135312696cc44e7912fe519e31778e0e4b2cb992cdd2c3c63bca0c9", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_06-b57385d.stdout", "stdout_hash": "9f564a4729f23eaabaac44967bcad828885b72e8755995d40bc24ebc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-cmd_02-ba58262.stdout0000664000175000017500000000556415141516316025027 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_exec: (Program (SymbolTable 2 { homedir: (Variable 2 homedir [] Local () () Default (String 1 (IntegerConstant 255 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_exec [] [(IntrinsicImpureSubroutine GetEnvironmentVariable [(StringConstant "HOME" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 homedir)] 1 ) (Print (StringFormat () [(IntrinsicElementalFunction StringTrim [(Var 2 homedir)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (IntrinsicImpureSubroutine ExecuteCommandLine [(StringConstant "printenv" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (LogicalConstant .true. (Logical 4) )] 0 )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_51-f69fffa.stdout0000664000175000017500000000022415141516316026021 0ustar alastairalastairbinary 2: 00000000000000000000000000000010 binary 255: 11111111 binary -1: **************** binary 42: 101010 binary 7: 111 01111 100 PASSED lfortran-lfortran-2f73434/tests/reference/ast_f90-format_02-3deee60.json0000664000175000017500000000076015141516316026016 0ustar alastairalastair{ "basename": "ast_f90-format_02-3deee60", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/format_02.f90", "infile_hash": "dcd9a1c68ffaff4df93d7299219c47741479f92da85570eb771f05b3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-format_02-3deee60.stdout", "stdout_hash": "2ac160dca83be0ef10e8016e9b55c05325da2d2065f62eeaf21d6059", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-program_01-4418962.stdout0000664000175000017500000000150515141516316026251 0ustar alastairalastairprogram program_01 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a integer :: i print *, "Normal random numbers:" do i = 1, 10 call rand(a) print *, a end do contains subroutine rand(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for ! Generating Normal Variables. SIAM Review, 6(3), 260–264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u - 1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) then exit end if end do u = u*sqrt((-2)*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine rand end program program_01 lfortran-lfortran-2f73434/tests/reference/llvm-sin_03-14abee4.json0000664000175000017500000000073715141516316025023 0ustar alastairalastair{ "basename": "llvm-sin_03-14abee4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/sin_03.f90", "infile_hash": "3c036b8aabdbfddc3c46fb69183c427f7991b105c361b785872acf59", "outfile": null, "outfile_hash": null, "stdout": "llvm-sin_03-14abee4.stdout", "stdout_hash": "4d6bde197c4b7d4f1d622f37ec039b03449edeb036f320bf79272e40", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_json-modules_10-93cd62d.stdout0000664000175000017500000006544215141516316027052 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "symtab": { "node": "SymbolTable1", "fields": { "modules_10": { "node": "Module", "fields": { "symtab": { "node": "SymbolTable4", "fields": { "my_global": { "node": "ExternalSymbol", "fields": { "parent_symtab": 4, "name": "my_global", "external": "my_global (SymbolTable2)", "module_name": "my_other_module", "scope_names": [], "original_name": "my_global", "access": "Public" }, "loc": { "first": 197, "last": 205, "first_filename": "tests/modules_10.f90", "first_line": 10, "first_column": 32, "last_filename": "tests/modules_10.f90", "last_line": 10, "last_column": 40 } }, "my_proc": { "node": "Function", "fields": { "symtab": { "node": "SymbolTable5", "fields": { "my_other_proc": { "node": "ExternalSymbol", "fields": { "parent_symtab": 5, "name": "my_other_proc", "external": "my_other_proc (SymbolTable2)", "module_name": "my_other_module", "scope_names": [], "original_name": "my_other_proc", "access": "Public" }, "loc": { "first": 274, "last": 286, "first_filename": "tests/modules_10.f90", "first_line": 13, "first_column": 36, "last_filename": "tests/modules_10.f90", "last_line": 13, "last_column": 48 } } } }, "name": "my_proc", "function_signature": { "node": "FunctionType", "fields": { "arg_types": [], "return_var_type": [], "abi": "Source", "deftype": "Implementation", "bindc_name": [], "elemental": false, "pure": false, "module": false, "inline": false, "static": false, "restrictions": [], "is_restriction": false }, "loc": { "first": 220, "last": 333, "first_filename": "tests/modules_10.f90", "first_line": 12, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 16, "last_column": 18 } }, "dependencies": [], "args": [], "body": [ { "node": "SubroutineCall", "fields": { "name": "my_other_proc (SymbolTable5)", "original_name": [], "args": [], "dt": [], "strict_bounds_checking": false }, "loc": { "first": 297, "last": 314, "first_filename": "tests/modules_10.f90", "first_line": 15, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 15, "last_column": 26 } } ], "return_var": [], "access": "Public", "deterministic": false, "side_effect_free": false, "module_file": [] }, "loc": { "first": 220, "last": 333, "first_filename": "tests/modules_10.f90", "first_line": 12, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 16, "last_column": 18 } } } }, "name": "modules_10", "parent_module": [], "dependencies": [ "my_other_module" ], "loaded_from_mod": false, "intrinsic": false, "has_submodules": false }, "loc": { "first": 148, "last": 344, "first_filename": "tests/modules_10.f90", "first_line": 9, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 17, "last_column": 10 } }, "my_other_module": { "node": "Module", "fields": { "symtab": { "node": "SymbolTable2", "fields": { "my_global": { "node": "Variable", "fields": { "parent_symtab": 2, "name": "my_global", "dependencies": [], "intent": "Local", "symbolic_value": { "node": "IntegerConstant", "fields": { "n": 0, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "value": { "node": "IntegerConstant", "fields": { "n": 0, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 50, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 28, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "storage": "Save", "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 27, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "type_declaration": [], "abi": "Source", "access": "Public", "presence": "Required", "value_attr": false, "target_attr": false, "contiguous_attr": false, "bindc_name": [], "is_volatile": false, "is_protected": false }, "loc": { "first": 38, "last": 50, "first_filename": "tests/modules_10.f90", "first_line": 2, "first_column": 16, "last_filename": "tests/modules_10.f90", "last_line": 2, "last_column": 28 } }, "my_other_proc": { "node": "Function", "fields": { "symtab": { "node": "SymbolTable3", "fields": {} }, "name": "my_other_proc", "function_signature": { "node": "FunctionType", "fields": { "arg_types": [], "return_var_type": [], "abi": "Source", "deftype": "Implementation", "bindc_name": [], "elemental": false, "pure": false, "module": false, "inline": false, "static": false, "restrictions": [], "is_restriction": false }, "loc": { "first": 65, "last": 134, "first_filename": "tests/modules_10.f90", "first_line": 4, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 6, "last_column": 18 } }, "dependencies": [], "args": [], "body": [ { "node": "Print", "fields": { "text": { "node": "StringFormat", "fields": { "fmt": [], "args": [ { "node": "Var", "fields": { "v": "my_global (SymbolTable2)" }, "loc": { "first": 107, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 18, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } ], "kind": "FormatFortran", "type": { "node": "Allocatable", "fields": { "type": { "node": "String", "fields": { "kind": 1, "len": [], "len_kind": "DeferredLength", "physical_type": "DescriptorString" }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } }, "value": [] }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } }, "loc": { "first": 98, "last": 115, "first_filename": "tests/modules_10.f90", "first_line": 5, "first_column": 9, "last_filename": "tests/modules_10.f90", "last_line": 5, "last_column": 26 } } ], "return_var": [], "access": "Public", "deterministic": false, "side_effect_free": false, "module_file": [] }, "loc": { "first": 65, "last": 134, "first_filename": "tests/modules_10.f90", "first_line": 4, "first_column": 5, "last_filename": "tests/modules_10.f90", "last_line": 6, "last_column": 18 } } } }, "name": "my_other_module", "parent_module": [], "dependencies": [], "loaded_from_mod": false, "intrinsic": false, "has_submodules": false }, "loc": { "first": 0, "last": 145, "first_filename": "tests/modules_10.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 7, "last_column": 10 } } } }, "items": [] }, "loc": { "first": 0, "last": 344, "first_filename": "tests/modules_10.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/modules_10.f90", "last_line": 17, "last_column": 10 } } lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface5-fbe2fe9.stdout0000664000175000017500000002366415141516316030134 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface5: (Function (SymbolTable 2 { a: (Variable 2 a [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), driver: (Function (SymbolTable 3 { driver_arg_0: (Variable 3 driver_arg_0 [] Unspecified () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), driver_arg_1: (Variable 3 driver_arg_1 [] Unspecified () () Default (Array (Integer 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ) }) driver (FunctionType [(Array (Integer 4) [(() ())] PointerArray ) (Array (Integer 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 driver_arg_0) (Var 3 driver_arg_1)] [] () Public .false. .false. () ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) implicit_interface5 (FunctionType [(Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a) (Var 2 b) (Var 2 n)] [(SubroutineCall 2 driver () [((Var 2 a)) ((Var 2 b))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_error_07b-d39ea05.stdout0000664000175000017500000001025115141516316027525 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_01: (Program (SymbolTable 5 { semigroup: (ExternalSymbol 5 semigroup 2 semigroup template_01_m [] semigroup Public ) }) template_01 [template_01_m] [] ), template_01_m: (Module (SymbolTable 2 { semigroup: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) semigroup [t combine] [] ), test_template: (Function (SymbolTable 4 { }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Private .false. .false. () ) }) template_01_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout0000664000175000017500000003230315141516316032242 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_small: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), print_subrout: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_subrout (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) loop_unroll_small [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 last) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (SubroutineCall 2 print_subrout () [((Var 2 x))] () .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 i) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-int_dp_param-19bf015.json0000664000175000017500000000075615141516316026043 0ustar alastairalastair{ "basename": "asr-int_dp_param-19bf015", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp_param.f90", "infile_hash": "bb7549fda78172a3f68b883fd1423773bf823a71a4dd2f89476886b5", "outfile": null, "outfile_hash": null, "stdout": "asr-int_dp_param-19bf015.stdout", "stdout_hash": "2c7c70958844786e31363324eb51d173a2bd75fa3df6e98e955793fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-associate_05-4641244.stdout0000664000175000017500000011617215141516316026077 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { associate_05: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), associate_block: (AssociateBlock (SymbolTable 3 { v: (Variable 3 v [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Assignment (Var 3 z) (RealBinOp (RealUnaryMinus (RealBinOp (RealBinOp (Var 2 x) Mul (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, ...., 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) Add (RealBinOp (Var 2 y) Mul (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, ...., 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (Var 2 theta) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Associate (Var 3 v) (Var 2 myreal) ) (Assignment (Var 3 v) (RealBinOp (Var 2 a) Add (Var 3 z) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 3 v) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 v) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Mul (RealConstant 4.600000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (RealBinOp (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) Mul (ArraySection (Var 3 v) [((IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (RealBinOp (ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) Mul (ArrayBroadcast (RealConstant 2.600000 (Real 4) ) (IntrinsicArrayFunction Shape [(ArraySection (Var 3 v) [((IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. )] ), myreal: (Variable 2 myreal [] Local () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), theta: (Variable 2 theta [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) associate_05 [] [(Allocate [((Var 2 myreal) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 x) (ArrayBroadcast (RealConstant 0.420000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [4.19999987e-01, 4.19999987e-01, 4.19999987e-01, ...., 4.19999987e-01, 4.19999987e-01, 4.19999987e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 y) (ArrayBroadcast (RealConstant 0.350000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [3.49999994e-01, 3.49999994e-01, 3.49999994e-01, ...., 3.49999994e-01, 3.49999994e-01, 3.49999994e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 myreal) (ArrayBroadcast (RealConstant 9.100000 (Real 4) ) (IntrinsicArrayFunction Shape [(Var 2 myreal)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 theta) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1.50000000e+00, 1.50000000e+00, 1.50000000e+00, ...., 1.50000000e+00, 1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 a) (ArrayBroadcast (RealConstant 0.400000 (Real 4) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [4.00000006e-01, 4.00000006e-01, 4.00000006e-01, ...., 4.00000006e-01, 4.00000006e-01, 4.00000006e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (AssociateBlockCall 2 associate_block ) (Print (StringFormat () [(Var 2 myreal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-modules_02-dc19c13.json0000664000175000017500000000072315141516316025433 0ustar alastairalastair{ "basename": "ast-modules_02-dc19c13", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/modules_02.f90", "infile_hash": "ca174c023f6a46f31eb8ac10ec968019baffb0a012c5211dc6e65ec4", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_02-dc19c13.stdout", "stdout_hash": "2163205bede5c96525db1cedc3528fc8c1904ff2aeaed222a347a117", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_07-bb03cfd.json0000664000175000017500000000110015141516316032722 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_07-bb03cfd", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_07.f90", "infile_hash": "4688c49c3c531f9e7dafd3b6a4ef2560b6e62ef554ea9df95ed61a8a", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_07-bb03cfd.stdout", "stdout_hash": "52252443d41bafce315aab110d7562afa052467415451240b68d2176", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-parameter_03-d4df941.stdout0000664000175000017500000000410415141516316026320 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { parameter_03: (Program (SymbolTable 2 { l_knd: (Variable 2 l_knd [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) parameter_03 [] [(Print (StringFormat () [(Var 2 l_knd)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dint_args-0823aa1.stderr0000664000175000017500000000023215141516316025667 0ustar alastairalastairsemantic error: Too many arguments to call `dint` --> tests/errors/dint_args.f90:2:13 | 2 | print*, dint(1.0_8, 8) | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-derived_type_04-0a4f388.json0000664000175000017500000000075115141516316026375 0ustar alastairalastair{ "basename": "asr-derived_type_04-0a4f388", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_04.f90", "infile_hash": "54474d4d6ab8c7341f0bb594bc870769d53b24e5791a5f3dd8c26b57", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_04-0a4f388.stderr", "stderr_hash": "89c06240e5acb5da3de35257174ab3f698788c40948fffdc135a39e0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-do_zero_increment-06c400d.stderr0000664000175000017500000000023615141516316027427 0ustar alastairalastairsemantic error: Step expression (Increment) in DO loop cannot be zero --> tests/errors/do_zero_increment.f90:4:14 | 4 | do i = 1, 5, 0 | ^ lfortran-lfortran-2f73434/tests/reference/ast-fixed_form4-a6a0e27.json0000664000175000017500000000074115141516316025666 0ustar alastairalastair{ "basename": "ast-fixed_form4-a6a0e27", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form4.f", "infile_hash": "4b4c0ab80a461abdbde1e862272b59c0a86b2fc7685d3b60379457f7", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form4-a6a0e27.stdout", "stdout_hash": "b71d4f8dfff81c774615aa2d502b4576e561b208b3d73998faa71da2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-real_dp_01-e53c6fb.stdout0000664000175000017500000000501215141516316026206 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"R4,R8,R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0.000000e+00, float* %zero, align 4 store double 0x3FF0CCCCC0000000, double* %v, align 8 store float 0x3FF0CCCCC0000000, float* %x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %x, double* %v, float* %zero) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_real_dp_01 FINALIZE_SYMTABLE_real_dp_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_different_types-bffc811.json0000664000175000017500000000105615141516316033633 0ustar alastairalastair{ "basename": "asr-array_constructor_with_different_types-bffc811", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_different_types.f90", "infile_hash": "0e407db91aa33a696329aa0e1867057fce840c163fe57885fd109654", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_different_types-bffc811.stderr", "stderr_hash": "483a4f9a004ffdba3852458d072b3f6ef0251b068762beeec58c2a34", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_01-6b086c6.stderr0000664000175000017500000000031715141516316027123 0ustar alastairalastairsemantic error: The argument `matrix_a` in `matmul` must be of type Integer, Real, Complex or Logical --> tests/errors/matrix_matmul_01.f90:5:21 | 5 | print *, matmul(a, b) | ^ lfortran-lfortran-2f73434/tests/reference/asr-global_scope8-67fff8d.stdout0000664000175000017500000000134515141516316026656 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Var 1 x)] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_02-2a5b79b.stdout0000664000175000017500000000212415141516316027661 0ustar alastairalastairmodule a implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type B type :: C end type C type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains private procedure, private :: p1 procedure(something), private :: p1b procedure, pass(self) :: p2 procedure :: proc_1, proc_2 generic :: operator(/=) => p5, p6 generic :: operator(+) => p8 generic :: operator(.in.) => p7 generic :: operator(.dot.) => p10 generic :: operator(/) => p11 generic :: assignment(=) => p9 generic, public :: calcCoeffs => calcCoeffsReal, calcCoeffsKPoint generic, private :: name => sample generic :: p1 => p2; generic, public :: write(formatted) => t_write generic :: read(unformatted) => t_read final :: y end type X type :: matrix(k, b) integer, kind :: k = 4 integer(8), len :: b real(k) :: element(b,b) end type matrix contains subroutine p1(this) class(X), intent(out) :: this end subroutine p1 subroutine p2(this) class(X), intent(inout) :: this end subroutine p2 end module a lfortran-lfortran-2f73434/tests/reference/asr-arrays_01-5f1c776.stdout0000664000175000017500000005002115141516316025561 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 17 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-Subroutine_Call1-5aa005c.json0000664000175000017500000000076015141516316027303 0ustar alastairalastair{ "basename": "ast_f90-Subroutine_Call1-5aa005c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/Subroutine_Call1.f90", "infile_hash": "bf7f51f810752b3f8e9381f1e100d0c9b3495c2f87cd120a6ee74148", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-Subroutine_Call1-5aa005c.stdout", "stdout_hash": "d7e18b9e02754303c8749a0cff1eeb8d6c0a9704c7e54509c003cec5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout0000664000175000017500000004510715141516316031255 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor12: (Program (SymbolTable 2 { f90_assert: (Function (SymbolTable 4 { file: (Variable 4 file [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), line: (Variable 4 line [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f90_assert (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 file) (Var 4 line)] [(Print (StringFormat () [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(StringConstant "Assertion failed at " (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 4 file)] 0 (String 1 () DeferredLength DescriptorString) () ) (StringConstant ":" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) (Var 4 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (ErrorStop () )] () Public .false. .false. () ), fn: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), fn: (Variable 3 fn [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fn (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 fn) (IntegerCompare (Var 3 a) Lt (Var 3 b) (Logical 4) () ) () .false. .false. )] (Var 3 fn) Public .false. .false. () ) }) preprocessor12 [] [(If () (LogicalNot (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 7 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4) Decimal) Gt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 8 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) (IntegerConstant 24 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 29 (Integer 4) Decimal) ) Gt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 9 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (FunctionCall 2 fn () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 5 (Integer 4) Decimal))] (Logical 4) () () ) (Logical 4) () ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 11 (Integer 4) Decimal))] () .false. )] [] ) (If () (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4) Decimal) Lt (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 13 (Integer 4) Decimal))] () .false. )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine7-27bdbfe.json0000664000175000017500000000072615141516316026117 0ustar alastairalastair{ "basename": "ast-subroutine7-27bdbfe", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine7.f90", "infile_hash": "3a15750c9d608f1988e0dd13f8d956be28a72297be5ef3137777cf2f", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine7-27bdbfe.stdout", "stdout_hash": "9d2a2173aee6b279a7a3b6a420347b530471957afeb7c66b70719f76", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_02-021cc51.stdout0000664000175000017500000032025115141516316026055 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_02: (Program (SymbolTable 8 { change_positions_chr: (Function (SymbolTable 12 { i: (Variable 12 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 12 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), mask: (Variable 12 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 12 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pos: (Variable 12 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), vec: (Variable 12 vec [] In () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) change_positions_chr (FunctionType [(Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~neq_intrinsic1] [(Var 12 vec)] [(Assignment (Var 12 n) (ArraySize (Var 12 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 12 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 n))] () () ())] () () () ) (If () (IntegerCompare (Var 12 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 12 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 12 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 12 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 12 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 12 n) ()) [(If () (FunctionCall 8 ~neq_intrinsic1 () [((ArrayItem (Var 12 vec) [(() (Var 12 i) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () )) ((ArrayItem (Var 12 vec) [(() (IntegerBinOp (Var 12 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 12 j) (IntegerBinOp (Var 12 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 pos) [(() (Var 12 j) ())] (Integer 4) ColMajor () ) (Var 12 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 12 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 j))] () () ())] () () () ) (DoLoop () ((Var 12 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 12 j) ()) [(Assignment (ArrayItem (Var 12 mask) [(() (Var 12 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 12 pos) [(() (Var 12 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 12 mask) Public .false. .false. () ), change_positions_int: (Function (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 10 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), mask: (Variable 10 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pos: (Variable 10 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), vec: (Variable 10 vec [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) change_positions_int (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~neq_intrinsic] [(Var 10 vec)] [(Assignment (Var 10 n) (ArraySize (Var 10 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 10 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (If () (IntegerCompare (Var 10 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 10 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 10 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 10 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 10 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 10 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 10 n) ()) [(If () (FunctionCall 8 ~neq_intrinsic () [((ArrayItem (Var 10 vec) [(() (Var 10 i) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 10 vec) [(() (IntegerBinOp (Var 10 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 10 j) (IntegerBinOp (Var 10 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 10 pos) [(() (Var 10 j) ())] (Integer 4) ColMajor () ) (Var 10 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 10 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 j))] () () ())] () () () ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 10 j) ()) [(Assignment (ArrayItem (Var 10 mask) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 10 pos) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 10 mask) Public .false. .false. () ), change_positions_tmpl: (ExternalSymbol 8 change_positions_tmpl 2 change_positions_tmpl template_02_m [] change_positions_tmpl Public ), eq: (ExternalSymbol 8 eq 2 eq template_02_m [] eq Public ), ~neq: (CustomOperator 8 ~neq [8 ~neq_intrinsic 8 ~neq_intrinsic1] Public ), ~neq_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 9 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 9 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~neq_intrinsic (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (IntegerCompare (Var 9 arg0) NotEq (Var 9 arg1) (Logical 4) () ) () .false. .false. )] (Var 9 ret) Public .false. .true. () ), ~neq_intrinsic1: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 11 arg1 [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 11 ret [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~neq_intrinsic1 (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (StringCompare (Var 11 arg0) NotEq (Var 11 arg1) (Logical 4) () ) () .false. .false. )] (Var 11 ret) Public .false. .true. () ) }) template_02 [template_02_m] [(Print (StringFormat () [(FunctionCall 8 change_positions_int () [((ArrayPhysicalCast (ArrayConstant 28 [3, 3, 6, ...., 2, 2, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] DescriptorArray ) () ))] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 8 change_positions_chr () [((ArrayPhysicalCast (ArrayConstant 7 ["a", "a", "b", ...., "p", "p", "o"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] PointerArray ) ColMajor ) PointerArray DescriptorArray (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] DescriptorArray ) () ))] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), template_02_m: (Module (SymbolTable 2 { change_positions_tmpl: (Template (SymbolTable 5 { change_positions_t: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), j: (Variable 7 j [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), mask: (Variable 7 mask [] ReturnVar () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 7 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pos: (Variable 7 pos [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), vec: (Variable 7 vec [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) change_positions_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray )] (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [ne] [(Var 7 vec)] [(Assignment (Var 7 n) (ArraySize (Var 7 vec) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 7 pos) [((IntegerConstant 1 (Integer 4) Decimal) (Var 7 n))] () () ())] () () () ) (If () (IntegerCompare (Var 7 n) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Return)] [] ) (Assignment (Var 7 pos) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 7 pos)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (ArrayItem (Var 7 pos) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 7 j) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 7 n) ()) [(If () (FunctionCall 5 ne () [((ArrayItem (Var 7 vec) [(() (Var 7 i) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 7 vec) [(() (IntegerBinOp (Var 7 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 7 j) (IntegerBinOp (Var 7 j) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 7 pos) [(() (Var 7 j) ())] (Integer 4) ColMajor () ) (Var 7 i) () .false. .false. )] [] )] [] ) (Allocate [((Var 7 mask) [((IntegerConstant 1 (Integer 4) Decimal) (Var 7 j))] () () ())] () () () ) (DoLoop () ((Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 7 j) ()) [(Assignment (ArrayItem (Var 7 mask) [(() (Var 7 i) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 7 pos) [(() (Var 7 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] )] (Var 7 mask) Public .false. .false. () ), ne: (Function (SymbolTable 6 { lhs: (Variable 6 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ne: (Variable 6 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 6 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) ne (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 lhs) (Var 6 rhs)] [] (Var 6 ne) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) change_positions_tmpl [t ne] [(Require eq [t ne] )] ), eq: (Requirement (SymbolTable 3 { ne: (Function (SymbolTable 4 { lhs: (Variable 4 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), ne: (Variable 4 ne [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) ne (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 ne) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) eq [t ne] [] ) }) template_02_m () [template_02_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-entry_05-f368f0e.stdout0000664000175000017500000010555415141516316025520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dstzr: (Function (SymbolTable 3 { abstol: (Variable 3 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), ftol: (Variable 3 ftol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), reltol: (Variable 3 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zx: (Variable 3 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) dstzr (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [dzror_main__lcompilers] [] [(SubroutineCall 1 dzror_main__lcompilers 1 dzror_main__lcompilers [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 0 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 3 r) DescriptorArray PointerArray (Pointer (Array (Real 4) [(() ())] PointerArray ) ) () ))] () .false. )] () Public .false. .false. () ), dzror: (Function (SymbolTable 2 { abstol: (Variable 2 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), ftol: (Variable 2 ftol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [n] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), reltol: (Variable 2 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zx: (Variable 2 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) dzror (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [dzror_main__lcompilers] [(Var 2 n) (Var 2 r)] [(SubroutineCall 1 dzror_main__lcompilers 1 dzror_main__lcompilers [((IntegerConstant 1 (Integer 4) Decimal)) ((Var 2 n)) ((Var 2 r))] () .false. )] () Public .false. .false. () ), dzror_main__lcompilers: (Function (SymbolTable 4 { abstol: (Variable 4 abstol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), entry__lcompilers: (Variable 4 entry__lcompilers [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ftol: (Function (SymbolTable 6 { ftol_return_var_name: (Variable 6 ftol_return_var_name [] ReturnVar () () Default (Real 8) 4 ftol Source Public Required .false. .false. .false. () .false. .false. ), zx: (Variable 6 zx [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) ftol (FunctionType [(Real 8)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 zx)] [(Assignment (Var 6 ftol_return_var_name) (RealBinOp (RealConstant 0.500000 (Real 8) ) Mul (IntrinsicElementalFunction Max [(Var 4 abstol) (RealBinOp (Var 4 reltol) Mul (IntrinsicElementalFunction Abs [(Var 6 zx)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 6 ftol_return_var_name) Public .false. .false. () ), n: (Variable 4 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [n] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), reltol: (Variable 4 reltol [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), zx: (Variable 4 zx [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) dzror_main__lcompilers (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 entry__lcompilers) (Var 4 n) (Var 4 r)] [(If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 1 1 )] [] ) (If () (IntegerCompare (Var 4 entry__lcompilers) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(GoTo 2 2 )] [] ) (GoToTarget 1 1 ) (Assignment (Var 4 r) (ArrayBroadcast (RealUnaryMinus (RealConstant 83.029999 (Real 4) ) (Real 4) (RealConstant -83.029999 (Real 4) ) ) (IntrinsicArrayFunction Shape [(Var 4 r)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 n))] PointerArray ) () ) () .false. .false. ) (Return) (GoToTarget 2 2 ) (Return)] () Public .false. .false. () ), entry_05: (Program (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) entry_05 [] [(SubroutineCall 1 dzror () [((IntegerConstant 10 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 5 r) FixedSizeArray PointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] PointerArray ) () ))] () .false. ) (DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 5 r) [(() (Var 5 i) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 83.029999 (Real 4) ) (Real 4) (RealConstant -83.029999 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 5 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-show_errors1-cc473c3.stdout0000664000175000017500000000123615141516316026470 0ustar alastairalastair{"uri":"file://tests/errors/show_errors1.f90","diagnostics":[{"source":"lpyth","range":{"start":{"line":9,"character":5},"end":{"line":9,"character":5}},"message":"Newline is unexpected here","severity":0},{"source":"lpyth","range":{"start":{"line":12,"character":10},"end":{"line":12,"character":11}},"message":"Variable 'xx' is not declared","severity":0},{"source":"lpyth","range":{"start":{"line":13,"character":10},"end":{"line":13,"character":11}},"message":"Variable 'xz' is not declared","severity":0},{"source":"lpyth","range":{"start":{"line":14,"character":10},"end":{"line":14,"character":18}},"message":"Variable 'fasldjkfh' is not declared","severity":0}]}lfortran-lfortran-2f73434/tests/reference/asr-func_parameter_type-a49e846.stderr0000664000175000017500000000027615141516316030006 0ustar alastairalastairsemantic error: Type mismatch in argument at argument (1); passed `real(4)` to `integer(4)`. --> tests/errors/func_parameter_type.f90:2:14 | 2 | print *, f(42.9) | ^^^^ lfortran-lfortran-2f73434/tests/reference/asr-write7-6ba53a1.stdout0000664000175000017500000005325015141516316025250 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { write7_mod: (Module (SymbolTable 2 { person: (Struct (SymbolTable 3 { pwf: (StructMethodDeclaration 3 pwf () pwf 2 pwf Source .false. .false. ), pwunf: (StructMethodDeclaration 3 pwunf () pwunf 2 pwunf Source .false. .false. ), ~write_formatted: (GenericProcedure 3 ~write_formatted [3 pwf] Public ), ~write_unformatted: (GenericProcedure 3 ~write_unformatted [3 pwunf] Public ) }) person (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), pwf: (Function (SymbolTable 4 { dtv: (Variable 4 dtv [] In () () Default (StructType [] [] .false. .false. ) 2 person Source Public Required .false. .false. .false. () .false. .false. ), iomsg: (Variable 4 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), iostat: (Variable 4 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iotype: (Variable 4 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), pfmt: (Variable 4 pfmt [] Local () () Default (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 4 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), vlist: (Variable 4 vlist [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) pwf (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 dtv) (Var 4 unit) (Var 4 iotype) (Var 4 vlist) (Var 4 iostat) (Var 4 iomsg)] [] () Public .false. .false. () ), pwunf: (Function (SymbolTable 5 { dtv: (Variable 5 dtv [] In () () Default (StructType [] [] .false. .false. ) 2 person Source Public Required .false. .false. .false. () .false. .false. ), iomsg: (Variable 5 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), iostat: (Variable 5 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 5 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) pwunf (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dtv) (Var 5 unit) (Var 5 iostat) (Var 5 iomsg)] [] () Public .false. .false. () ) }) write7_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-logical2-e35f19c.stdout0000664000175000017500000000704015141516316025534 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { logical2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) logical2 [] [(Assignment (Var 2 a) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (Assignment (Var 2 b) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (If () (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4) () ) [(Print (StringConstant "Line 1 - Condition is true" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "Line 1 - Condition is false" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-do_concurrent_reduce-373b02e.stdout0000664000175000017500000000145115141516316030136 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations template void sum_reduce(T0* a, float &s); // Implementations template void sum_reduce(T0* a, float &s) { int32_t i; int32_t n; n = a->data->extent(0); s = (float)(0); Kokkos::parallel_for(Kokkos::RangePolicy(1, n+1), KOKKOS_LAMBDA(const long i) { s = s + a->data->operator[](i - a->dims[0].lower_bound); }); } lfortran-lfortran-2f73434/tests/reference/ast-esub2-248f0df.stderr0000664000175000017500000000017315141516316025041 0ustar alastairalastairtokenizer error: Token '~' is not recognized --> tests/errors/esub2.f90:3:5 | 3 | x = ~1 | ^ token not recognized lfortran-lfortran-2f73434/tests/reference/enable_disable_style_suggestion-style1-55a065c.json0000664000175000017500000000102215141516316032426 0ustar alastairalastair{ "basename": "enable_disable_style_suggestion-style1-55a065c", "cmd": "lfortran --style-suggestions --no-style-suggestions --no-color {infile}", "infile": "tests/style1.f90", "infile_hash": "b37bbb3e24a2bceae58e25b574ccb9dea7fbe05441c08c9e4fa5add6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "enable_disable_style_suggestion-style1-55a065c.stderr", "stderr_hash": "ad63281caddb41bffefff059b6597e92190dd4b1ac34f473a6cbf269", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-codegen_function_polymorphic-834d4d1.stdout0000664000175000017500000000440015141516316032074 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %abstype_class = type <{ i32 (...)**, %abstype* }> %abstype = type {} define void @__module_codegen_function_polymorphic_my_func(%abstype_class** %obj) { .entry: %0 = load %abstype_class*, %abstype_class** %obj, align 8 %1 = ptrtoint %abstype_class* %0 to i64 %2 = icmp ne i64 %1, 0 br i1 %2, label %then, label %else5 then: ; preds = %.entry %3 = load %abstype_class*, %abstype_class** %obj, align 8 %4 = load %abstype_class*, %abstype_class** %obj, align 8 %5 = ptrtoint %abstype_class* %4 to i64 %6 = icmp ne i64 %5, 0 br i1 %6, label %then1, label %else3 then1: ; preds = %then %7 = getelementptr %abstype_class, %abstype_class* %4, i32 0, i32 1 %8 = load %abstype*, %abstype** %7, align 8 %9 = bitcast %abstype* %8 to i8* %10 = ptrtoint i8* %9 to i64 %11 = icmp ne i64 %10, 0 br i1 %11, label %then2, label %else then2: ; preds = %then1 %12 = alloca i8*, align 8 store i8* %9, i8** %12, align 8 %13 = load i8*, i8** %12, align 8 call void @_lfortran_free(i8* %13) %14 = bitcast %abstype** %7 to i8** store i8* null, i8** %14, align 8 br label %ifcont else: ; preds = %then1 br label %ifcont ifcont: ; preds = %else, %then2 %15 = alloca i8*, align 8 %16 = bitcast %abstype_class* %4 to i8* store i8* %16, i8** %15, align 8 %17 = load i8*, i8** %15, align 8 call void @_lfortran_free(i8* %17) store %abstype_class* null, %abstype_class** %obj, align 8 br label %ifcont4 else3: ; preds = %then br label %ifcont4 ifcont4: ; preds = %else3, %ifcont br label %ifcont6 else5: ; preds = %.entry br label %ifcont6 ifcont6: ; preds = %else5, %ifcont4 br label %return return: ; preds = %ifcont6 br label %FINALIZE_SYMTABLE_my_func FINALIZE_SYMTABLE_my_func: ; preds = %return ret void } declare void @_lfortran_free(i8*) lfortran-lfortran-2f73434/tests/reference/ast-contains1-58ed60a.json0000664000175000017500000000074615141516316025373 0ustar alastairalastair{ "basename": "ast-contains1-58ed60a", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/contains1.f", "infile_hash": "92f1f8d63ec16274e9b2680055f36a28bebc56ec8a04644d16c150ec", "outfile": null, "outfile_hash": null, "stdout": "ast-contains1-58ed60a.stdout", "stdout_hash": "021a035e85f816203564704e049a624ee2e494f3d750f54989570f07", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-flush_invalid_kwarg1-9fc0c7b.stderr0000664000175000017500000000025215141516316030200 0ustar alastairalastairsemantic error: Invalid argument `start` supplied --> tests/errors/flush_invalid_kwarg1.f90:3:5 | 3 | FLUSH(unit=10, start=100) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-array_shape_02-d196aa4.stderr0000664000175000017500000000034315141516316026611 0ustar alastairalastairsemantic error: Incompatible shape of array on assignment on dimension 0 (3 and 2) --> tests/errors/array_shape_02.f90:2:1 | 2 | integer :: x(3,2) = reshape([1,2,3,4],[2,2]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-subroutines_04-ba99aa1.json0000664000175000017500000000076715141516316026622 0ustar alastairalastair{ "basename": "llvm-subroutines_04-ba99aa1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutines_04-ba99aa1.stdout", "stdout_hash": "618118cc40d09741d85236f4b4dbf5d983ccf0d15fef5b82fbec8b25", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_02-ed49715.stdout0000664000175000017500000000612615141516316025742 0ustar alastairalastair(TranslationUnit [(Module modules_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Module modules_02_c (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine d [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "d()" ())] () )] [] [] ) (Subroutine e [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "e()" ())] () )] [] [] )] ) (Program modules_02 () [(Use [] modules_02_a [] .false. () ) (Use [] modules_02_c [(UseSymbol d x )] .true. () ) (Use [] modules_02_c [(UseSymbol e () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] () ) (SubroutineCall 0 x [] [] [] [] () ) (SubroutineCall 0 e [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-parameter_05-916c4d8.json0000664000175000017500000000075615141516316025705 0ustar alastairalastair{ "basename": "asr-parameter_05-916c4d8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_05.f90", "infile_hash": "050c43a9cdbd3f792c1b0b750daa46584ebee4ee16bebe0333f92e9b", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_05-916c4d8.stdout", "stdout_hash": "9be0bd121d402d4498aa9e3c7526ac0422bf2e3a2717e937363432ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_assgn_test-4df3c08.stderr0000664000175000017500000000055015141516316027017 0ustar alastairalastairwarning: Dimensions are specified twice --> tests/errors/dim_assgn_test.f90:3:19 | 3 | integer, private, dimension(2,2) :: a(2,3) | ^^^^^^^^^^^^^^ ^^^^^^ help: consider specifying it just one way or the other semantic error: Variable 'x' is not declared --> tests/errors/dim_assgn_test.f90:5:1 | 5 | x = 5 | ^ 'x' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-array_size_01-cdffaed.stderr0000664000175000017500000000037115141516316026766 0ustar alastairalastairsemantic error: Incorrect number of arguments passed to the 'size' intrinsic. It accepts at least 1 and at most 3 arguments. --> tests/errors/array_size_01.f90:5:14 | 5 | size_a = size(a, 1, 4, kind=4) | ^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-template_struct_01-f11e745.stdout0000664000175000017500000002605415141516316027504 0ustar alastairalastair(TranslationUnit [(Module template_struct_01_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(struct_t [] [] () () None ()) (test_template [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement r [t] [(DerivedType t [] () [(SimpleAttribute AttrDeferred )] [] [] )] [] ) (Template struct_t [t] [(Require [(UnitRequire r [(AttrNamelist t )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(tuple [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType tuple [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeType [] () t None ) [] [(fst [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(snd [] [] () () None ())] () )] [] )] [(Function get_fst [(p)] [] r () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () tuple None ) [(AttrIntent In )] [(p [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(r [] [] () () None ())] () )] [(Assignment 0 r fst [(p [])] () )] [] [] ) (Function get_snd [(p)] [] r () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () tuple None ) [(AttrIntent In )] [(p [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () t None ) [] [(r [] [] () () None ())] () )] [(Assignment 0 r snd [(p [])] () )] [] [] )] )] [] [(Subroutine test_template [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Instantiate struct_t [(AttrType TypeInteger [] () () None )] [(UseSymbol tuple int_tuple ) (UseSymbol get_fst get_int_fst ) (UseSymbol get_snd get_int_snd )] ) (Instantiate struct_t [(AttrType TypeReal [] () () None )] [(UseSymbol tuple real_tuple ) (UseSymbol get_fst get_real_fst ) (UseSymbol get_snd get_real_snd )] ) (Declaration (AttrType TypeType [] () int_tuple None ) [] [(ti [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () real_tuple None ) [] [(tr [] [] () () None ())] () )] [(Assignment 0 fst [(ti [])] 1 () ) (Print 0 () [(String "First element: " ()) (FuncCallOrArray get_int_fst [] [(() ti () 0)] [] [] [] )] () ) (Assignment 0 snd [(ti [])] 2 () ) (Print 0 () [(String "Second element: " ()) (FuncCallOrArray get_int_snd [] [(() ti () 0)] [] [] [] )] () ) (Assignment 0 fst [(tr [])] (Real "1.") () ) (Print 0 () [(String "First element: " ()) (FuncCallOrArray get_real_fst [] [(() tr () 0)] [] [] [] )] () ) (Assignment 0 snd [(tr [])] (Real "2.") () ) (Print 0 () [(String "Second element: " ()) (FuncCallOrArray get_real_snd [] [(() tr () 0)] [] [] [] )] () )] [] [] )] ) (Program template_struct_01 () [(Use [] template_struct_01_m [] .false. (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-types_11-696c3ee.json0000664000175000017500000000074215141516316025145 0ustar alastairalastair{ "basename": "ast-types_11-696c3ee", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_11.f90", "infile_hash": "ec77a687fe909a61a4d7e9edc0d249eb8fbcd372a60ff4c84d9d50ca", "outfile": null, "outfile_hash": null, "stdout": "ast-types_11-696c3ee.stdout", "stdout_hash": "133033e1bee41d47e922546395584ff57c6fe6b3408f737936d377bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-entry_02-b8ee2e2.json0000664000175000017500000000074215141516316025210 0ustar alastairalastair{ "basename": "asr-entry_02-b8ee2e2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_02.f90", "infile_hash": "b08199e4a4c1b3cec42730d5ef5520b9f0e1d547084894787c36d877", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_02-b8ee2e2.stdout", "stdout_hash": "8c1b719483ee56c87e881c387b6dbe2b8ed17724ba78ef657576df50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_06-2a9502c.stderr0000664000175000017500000000021315141516316031055 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/scalar_allocation_check_06.f90:6:14 | 6 | print *, x | ^ lfortran-lfortran-2f73434/tests/reference/ast-types_09-e7605c9.stdout0000664000175000017500000001230115141516316025435 0ustar alastairalastair(TranslationUnit [(Program types_09 () [(Use [] iso_c_binding [(UseSymbol c_char () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(ucs4 [] [] () (FuncCallOrArray selected_char_kind [] [(() (String "ISO_10646" ()) () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value) (() ucs4 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(nen [] [] () (FuncCallOrArray char [] [(() (FuncCallOrArray int [] [(() (BOZ "Z'5e74'" ) () 0)] [] [] [] ) () 0) (() ucs4 () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(s) (s2)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeCharacter [(kind c_char Value) (len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(len () Colon)] () () None ) [(SimpleAttribute AttrAllocatable ) (AttrIntent In )] [(s2 [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(kind 1 Value) (len () Star)] () () None ) [(SimpleAttribute AttrParameter )] [(lowercase [] [] () (String "abcdefghijklmnopqrstuvwxyz" ()) Equal ())] () )] [] [] [] ) (Subroutine s [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [(SimpleAttribute AttrIntrinsic )] iso_fortran_env [(UseSymbol int32 () )] .true. () )] [] [] [(Declaration (AttrType TypeInteger [(() int32 Value)] () () None ) [] [(x [] [] () 1 Equal ())] () )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_03-ef06d46.stdout0000664000175000017500000004313515141516316026533 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_03: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), i: (Variable 2 i [] Local (IntegerUnaryMinus (IntegerConstant 12 (Integer 4) Decimal) (Integer 4) (IntegerConstant -12 (Integer 4) Decimal) ) (IntegerConstant -12 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r1: (Variable 2 r1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_03 [iso_fortran_env] [(Assignment (Var 2 a) (RealConstant 4.200000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (IntrinsicElementalFunction Cos [(RealConstant 9.500000 (Real 4) )] 0 (Real 4) (RealConstant -0.997172 (Real 4) ) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Add (RealConstant 0.997172 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) Add (Cast (RealConstant 0.490261 (Real 4) ) RealToReal (Real 8) (RealConstant 0.490261 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Cos [(RealBinOp (Cast (IntrinsicElementalFunction Cos [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 0.070737 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.070737 (Real 8) ) ) Add (IntrinsicElementalFunction Cos [(RealBinOp (Var 2 a) Add (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 0.716404 (Real 4) ) RealToReal (Real 8) (RealConstant 0.716404 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 r1) (IntrinsicElementalFunction Cos [(Var 2 a)] 0 (Real 8) () ) () .false. .false. ) (Assignment (Var 2 r2) (RealUnaryMinus (RealConstant 0.490261 (Real 8) ) (Real 8) (RealConstant -0.490261 (Real 8) ) ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 r1) Sub (Var 2 r2) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicElementalFunction Abs [(Var 2 i)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (IntrinsicElementalFunction Abs [(Var 2 i)] 0 (Integer 4) () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-submodule_04-987b68b.json0000664000175000017500000000075615141516316025732 0ustar alastairalastair{ "basename": "asr-submodule_04-987b68b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/submodule_04.f90", "infile_hash": "642c924ba406c1301d4f17d3aa23330c0c88836827e2ccc9a223fe50", "outfile": null, "outfile_hash": null, "stdout": "asr-submodule_04-987b68b.stdout", "stdout_hash": "502f96e1d1ea86a45cfe6a2902a231c79adc58f8a99289f8f498fa6b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-maskl_negative-c92502f.json0000664000175000017500000000074615141516316026401 0ustar alastairalastair{ "basename": "asr-maskl_negative-c92502f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskl_negative.f90", "infile_hash": "144605a5591f224661ccc2e7d6305d6654847c20157594f344d3bd7c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskl_negative-c92502f.stderr", "stderr_hash": "9a2147feaabf5d9848200d0e5b64655c2d4629c9fd23a58730edc2b8", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface5-6590dfc.stdout0000664000175000017500000002430715141516316031163 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { klvnzo_: (Function (SymbolTable 2 { kd: (Variable 2 kd [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), klvna: (Function (SymbolTable 4 { klvna_arg_0: (Variable 4 klvna_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), rt: (Variable 4 rt [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) klvna (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 klvna_arg_0)] [] () Public .false. .false. () ), nt: (Variable 2 nt [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rt: (Variable 2 rt [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), rt0: (Variable 2 rt0 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), zo: (Variable 2 zo [nt] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 nt))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) klvnzo_ (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 nt) (Var 2 kd)] [(SubroutineCall 2 klvna () [((Var 2 rt))] () .false. ) (Return)] () Public .false. .false. () ), main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 klvnzo_ () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 8 (Integer 4) Decimal))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-call_subroutine_without_type_01-1c100d1.stdout0000664000175000017500000002560415141516316032443 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %mytype_class = type <{ i32 (...)**, %mytype* }> %mytype = type { float } %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__get_i__self = global %mytype_class* null @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-4,R4\00", align 1 @string_const_data = private constant [4 x i8] c"r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @_Name_mytype = private unnamed_addr constant [7 x i8] c"mytype\00", align 1 @_Type_Info_mytype = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_mytype, i32 0, i32 0) }, align 8 @_VTable_mytype = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_mytype to i8*), i8* bitcast (void (i8*, i8*)* @_copy_module_call_subroutine_without_type_01_mytype to i8*), i8* bitcast (void (i8**)* @_allocate_struct_module_call_subroutine_without_type_01_mytype to i8*), i8* bitcast (void (%mytype_class*)* @__module_module_call_subroutine_without_type_01_get_i to i8*)] }, align 8 @4 = private unnamed_addr constant [4 x i8] c"obj\00", align 1 @5 = private unnamed_addr constant [131 x i8] c"At 27:5 of file tests/../integration_tests/call_subroutine_without_type_01.f90\0ATried to access member of unallocated variable '%s'\00", align 1 define void @__module_module_call_subroutine_without_type_01_get_i(%mytype_class* %self) { .entry: store %mytype_class* %self, %mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 call void @get_i.__module_module_call_subroutine_without_type_01_get_r() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_get_i FINALIZE_SYMTABLE_get_i: ; preds = %return ret void } define void @get_i.__module_module_call_subroutine_without_type_01_get_r() { .entry: %0 = alloca i64, align 8 %1 = load %mytype_class*, %mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %2 = getelementptr %mytype_class, %mytype_class* %1, i32 0, i32 1 %3 = load %mytype*, %mytype** %2, align 8 %4 = getelementptr %mytype, %mytype* %3, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = alloca float, align 4 store float %5, float* %6, align 4 %7 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, %string_descriptor* @string_const, float* %6) %8 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %7, i8** %9, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %8, i64* %10, align 4 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %12 = load i8*, i8** %11, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %14 = load i64, i64* %13, align 4 %15 = trunc i64 %14 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %12, i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %16 = icmp eq i8* %7, null br i1 %16, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %7) br label %free_done free_done: ; preds = %free_nonnull, %.entry %17 = load %mytype_class*, %mytype_class** @__module___lcompilers_created__nested_context__get_i__self, align 8 %18 = getelementptr %mytype_class, %mytype_class* %17, i32 0, i32 1 %19 = load %mytype*, %mytype** %18, align 8 %20 = getelementptr %mytype, %mytype* %19, i32 0, i32 0 %21 = load float, float* %20, align 4 %22 = fcmp une float %21, 1.000000e+00 br i1 %22, label %then, label %else then: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %free_done br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_get_r FINALIZE_SYMTABLE_get_r: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %obj = alloca %mytype_class*, align 8 store %mytype_class* null, %mytype_class** %obj, align 8 %2 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 4, i1 false) %3 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 16, i1 false) %4 = bitcast i8* %3 to %mytype_class* store %mytype_class* %4, %mytype_class** %obj, align 8 %5 = load %mytype_class*, %mytype_class** %obj, align 8 %6 = getelementptr %mytype_class, %mytype_class* %5, i32 0, i32 1 %7 = bitcast i8* %2 to %mytype* store %mytype* %7, %mytype** %6, align 8 %8 = load %mytype*, %mytype** %6, align 8 %9 = bitcast %mytype_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_mytype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %9, align 8 %10 = getelementptr %mytype, %mytype* %8, i32 0, i32 0 %11 = load %mytype_class*, %mytype_class** %obj, align 8 %12 = ptrtoint %mytype_class* %11 to i64 %13 = icmp eq i64 %12, 0 br i1 %13, label %then, label %ifcont then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont: ; preds = %.entry %14 = getelementptr %mytype_class, %mytype_class* %11, i32 0, i32 1 %15 = load %mytype*, %mytype** %14, align 8 %16 = getelementptr %mytype, %mytype* %15, i32 0, i32 0 store float 1.000000e+00, float* %16, align 4 %17 = load %mytype_class*, %mytype_class** %obj, align 8 %18 = load %mytype_class*, %mytype_class** %obj, align 8 %19 = bitcast %mytype_class* %18 to void (%mytype_class*)*** %20 = load void (%mytype_class*)**, void (%mytype_class*)*** %19, align 8 %21 = getelementptr inbounds void (%mytype_class*)*, void (%mytype_class*)** %20, i32 2 %22 = load void (%mytype_class*)*, void (%mytype_class*)** %21, align 8 call void %22(%mytype_class* %18) call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_call_subroutine_without_type_01 FINALIZE_SYMTABLE_call_subroutine_without_type_01: ; preds = %return br label %Finalize_Variable_obj Finalize_Variable_obj: ; preds = %FINALIZE_SYMTABLE_call_subroutine_without_type_01 %23 = load %mytype_class*, %mytype_class** %obj, align 8 %24 = icmp ne %mytype_class* %23, null br i1 %24, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_obj %25 = getelementptr %mytype_class, %mytype_class* %23, i32 0, i32 1 %26 = load %mytype*, %mytype** %25, align 8 %27 = getelementptr %mytype, %mytype* %26, i32 0, i32 0 %28 = icmp eq %mytype_class* %23, null br i1 %28, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %29 = bitcast %mytype_class* %23 to i8* call void @_lfortran_free(i8* %29) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_obj br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_module_call_subroutine_without_type_01_mytype(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %mytype* %3 = bitcast i8* %1 to %mytype* %4 = getelementptr %mytype, %mytype* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %mytype, %mytype* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_module_call_subroutine_without_type_01_mytype(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %mytype_class* %4 = bitcast %mytype_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_mytype, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %mytype_class, %mytype_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %mytype* store %mytype* %7, %mytype** %5, align 8 %8 = getelementptr %mytype, %mytype* %7, i32 0, i32 0 ret void } declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/wat-logical3-ce72150.stderr0000664000175000017500000000047715141516316025442 0ustar alastairalastairwarning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-lfortran-2f73434/tests/reference/ast-enum_decl_without_start_program-9ae6425.stdout0000664000175000017500000000111515141516316032441 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Enum [(AttrBind (Bind [c] [] ) )] () [(Declaration () [(SimpleAttribute AttrEnumerator )] [(yellow [] [] () () None ())] () )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-data_stmt_with_implied_do_loop-476da0f.stdout0000664000175000017500000000475615141516316032302 0ustar alastairalastair(TranslationUnit [(Program data_stmt_with_implied_do_loop () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(p [(1 1 DimensionExpr)] [] () () None ()) (c [(1 1 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 1 Value)] () () None ) [] [(ch [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(FuncCallOrArray p [] [(() 1 () 0)] [] [] [] ) (DataImpliedDo [(FuncCallOrArray c [] [(() 1 () 0) (() i () 0)] [] [] [] )] () i 1 1 () )] [31 12] )] () ) (DataStmt 0 [(DataStmtSet [ch] [(String "=" ())] )] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-forall_01-11937e6.stdout0000664000175000017500000000674115141516316025466 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { forall_01: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ivec: (Variable 2 ivec [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) forall_01 [] [(ForAllSingle ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) (Assignment (ArrayItem (Var 2 ivec) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) ) (Print (StringFormat () [(Var 2 ivec)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_23-a731033.stdout0000664000175000017500000006343415141516316025500 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_23: (Module (SymbolTable 2 { add_context: (Function (SymbolTable 4 { 1_toml_context_num: (ExternalSymbol 4 1_toml_context_num 3 num toml_context [] num Public ), 1_toml_context_ptr: (ExternalSymbol 4 1_toml_context_ptr 3 ptr toml_context [] ptr Public ), context: (Variable 4 context [] In () () Default (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_context Source Public Required .false. .false. .false. () .false. .false. ), line_break: (Variable 4 line_break [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), message: (Variable 4 message [] InOut () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), num: (Variable 4 num [] Local () () Default (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) add_context (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 message) (Var 4 context)] [(If () (IntegerCompare (StructInstanceMember (Var 4 context) 4 1_toml_context_num (Integer 4) () ) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(FileWrite 0 (Var 4 num) () () () [(StringFormat (StringConstant "(\"line\",1x,i0,\":\")" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 4 context) 4 1_toml_context_num (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (Assignment (Var 4 message) (IntrinsicElementalFunction StringConcat [(StringSection (Var 4 num) (IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 4 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntrinsicElementalFunction StringLenTrim [(Var 4 num)] 0 (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Var 4 message)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] ) (Assignment (Var 4 message) (IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(IntrinsicElementalFunction StringConcat [(Var 4 message) (StringConstant " | " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) (StringSection (StructInstanceMember (Var 4 context) 4 1_toml_context_ptr (Pointer (String 1 () DeferredLength DescriptorString) ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Var 4 line_break) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (Var 4 line_break) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () )] 0 (String 1 () DeferredLength DescriptorString) () ) (StringConstant " |" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] () Public .false. .false. () ), toml_context: (Struct (SymbolTable 3 { num: (Variable 3 num [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pos: (Variable 3 pos [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 3 ptr [] Local () () Default (Pointer (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_context (StructType [(Integer 4) (Integer 4) (Pointer (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [pos num ptr] [] Source Public .false. .false. [] () () ) }) arrays_23 () [] .false. .false. .false. ), main: (Program (SymbolTable 5 { add_context: (ExternalSymbol 5 add_context 2 add_context arrays_23 [] add_context Public ), toml_context: (ExternalSymbol 5 toml_context 2 toml_context arrays_23 [] toml_context Public ) }) main [arrays_23] [(Print (StringConstant "working" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-volatile_03-914e4e5.stdout0000664000175000017500000000410315141516316026264 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @y_data = private global [1 x i8] c"2" @y = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @y_data, i32 0, i32 0), i64 1 }> define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %x, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 1 store i64 1, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 1) store i8* %4, i8** %3, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 call void @_lfortran_strcpy(i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 1), i8 0, i8 0, i8* %6, i64 1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_volatile_03 FINALIZE_SYMTABLE_volatile_03: ; preds = %return br label %Finalize_Variable_x Finalize_Variable_x: ; preds = %FINALIZE_SYMTABLE_volatile_03 %7 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = icmp eq i8* %8, null br i1 %9, label %free_done, label %free_nonnull free_nonnull: ; preds = %Finalize_Variable_x call void @_lfortran_free(i8* %8) br label %free_done free_done: ; preds = %free_nonnull, %Finalize_Variable_x ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) declare void @_lpython_free_argv() declare void @_lfortran_free(i8*) lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface4-4615450.stdout0000664000175000017500000007546115141516316030741 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { dqc25c: (Function (SymbolTable 2 { dqk15w: (Function (SymbolTable 5 { dqk15w_arg_0: (Variable 5 dqk15w_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) dqk15w (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 dqk15w_arg_0)] [] () Public .false. .false. () ), f: (Function (SymbolTable 6 { f_arg_0: (Variable 6 f_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f_return_var_name: (Variable 6 f_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), hlgth: (Variable 6 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 f_arg_0)] [] (Var 6 f_return_var_name) Public .false. .false. () ), hlgth: (Variable 2 hlgth [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dqc25c (FunctionType [(Real 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 f)] [(SubroutineCall 2 dqk15w () [((Var 2 f))] () .false. ) (Print (StringFormat () [(FunctionCall 2 f () [((Var 2 hlgth))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), func: (Function (SymbolTable 3 { c: (Function (SymbolTable 8 { c_arg_0: (Variable 8 c_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), c_return_var_name: (Variable 8 c_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), d: (Variable 8 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) c (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 c_arg_0)] [] (Var 8 c_return_var_name) Public .false. .false. () ), d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 3 f [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), func: (Variable 3 func [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sub2: (Function (SymbolTable 7 { sub2_arg_0: (Variable 7 sub2_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub2 (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 sub2_arg_0)] [] () Public .false. .false. () ) }) func (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 f)] [(SubroutineCall 3 sub2 () [((Var 3 c))] () .false. ) (Print (StringFormat () [(FunctionCall 3 c () [((Var 3 d))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 3 func) Public .false. .false. () ), main: (Program (SymbolTable 4 { a: (Function (SymbolTable 10 { a_arg_0: (Variable 10 a_arg_0 [] Unspecified () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), a_return_var_name: (Variable 10 a_return_var_name [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ), b: (Variable 10 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Real 4)] (Real 8) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 a_arg_0)] [] (Var 10 a_return_var_name) Public .false. .false. () ), b: (Variable 4 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sub: (Function (SymbolTable 9 { sub_arg_0: (Variable 9 sub_arg_0 [] Unspecified () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub (FunctionType [(Real 8)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 sub_arg_0)] [] () Public .false. .false. () ) }) main [] [(SubroutineCall 4 sub () [((Var 4 a))] () .false. ) (Print (StringFormat () [(FunctionCall 4 a () [((Var 4 b))] (Real 8) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-global_scope2-970a26a.json0000664000175000017500000000073415141516316026117 0ustar alastairalastair{ "basename": "asr-global_scope2-970a26a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope2-970a26a.stdout", "stdout_hash": "5a0496083015360023a6230997c1023ea34d73feff363d37a44b37b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_01-56d8eff.stdout0000664000175000017500000020675415141516316027070 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_01_m [] add_t Public ), r: (ExternalSymbol 13 r 2 r template_add_01_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_01_m [] test_template Public ) }) template_add_01 [template_add_01_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_01_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .false. .false. () ), func_arg_real: (Function (SymbolTable 8 { x: (Variable 8 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 z) (RealBinOp (Var 8 x) Add (Var 8 y) (Real 4) () ) () .false. .false. )] (Var 8 z) Private .false. .false. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { a: (Variable 10 a [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), add_integer: (Function (SymbolTable 12 { x: (Variable 12 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 12 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 z) (FunctionCall 2 func_arg_int () [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) () .false. .false. )] (Var 12 z) Public .false. .false. () ), add_real: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 11 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_real] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (FunctionCall 2 func_arg_real () [((Var 11 x)) ((Var 11 y))] (Real 4) () () ) () .false. .false. )] (Var 11 z) Public .false. .false. () ), b: (Variable 10 b [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 10 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 10 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 10 add_real () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 10 a) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 10 b) (IntegerConstant 9 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 10 add_integer () [((Var 10 a)) ((Var 10 b))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 10 add_integer () [((Var 10 a)) ((Var 10 b))] (Integer 4) () () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_add_01_m () [template_add_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-const_kind_01-90eb6ef.stdout0000664000175000017500000001534015141516316026556 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_kind_01: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r1: (Variable 2 r1 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r2: (Variable 2 r2 [] Local (RealConstant 1.000000 (Real 8) ) (RealConstant 1.000000 (Real 8) ) Parameter (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), r3: (Variable 2 r3 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 2 sp [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) const_kind_01 [] [(Assignment (Var 2 r3) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r3) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 sp) (Var 2 dp) (Var 2 r1) (Var 2 r2) (Var 2 r3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope9-bdf4288.json0000664000175000017500000000073715141516316026406 0ustar alastairalastair{ "basename": "llvm-global_scope9-bdf4288", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope9-bdf4288.stdout", "stdout_hash": "2cb1909892923c5a142d2fbe313927e6e62b9b7275adaaf94fa4cf64", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_22-e96df3d.stdout0000664000175000017500000000077115141516316025743 0ustar alastairalastairb format for integer(4) 10101 * ** *** **** 10101 10101 10101 10101 10101 10101 -1 in b32 format: "11111111111111111111111111111111" -1 in b0 format: "11111111111111111111111111111111" 10 in b32 format: " 1010" 11 in b0 format: "1011" 1100100 **** ***** 1100100 0 0 b format for integer(8) 11111 11111 1010 1010 0 0 b format for integer(1) 1011 1011 1010 1010 0 0 b format for integer(2) 1001 1001 **** ***** 0 0 lfortran-lfortran-2f73434/tests/reference/ast-substring-59dd84f.stdout0000664000175000017500000000365515141516316026102 0ustar alastairalastair(TranslationUnit [(Program substring () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [] [(str [] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [(() 5 Value)] () () None ) [(SimpleAttribute AttrParameter )] [(s [] [] () (Substring "Hello World" [(7 11 1 0)] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 str (Substring "12345" [(2 4 1 0)] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [str] () ) (Print 0 () [s] () ) (Print 0 () [(Substring "SubString" [(4 9 1 0)] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit9-b56b139.json0000664000175000017500000000106215141516316025304 0ustar alastairalastair{ "basename": "asr-implicit9-b56b139", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit9.f90", "infile_hash": "8821b0b62f5857553eb0efe35ab8190a8b1c4fe82e623f1dae4e81b3", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit9-b56b139.stdout", "stdout_hash": "638b9b5f788b1d1794061a63041405e7b63436b1c393fa46ed33c497", "stderr": "asr-implicit9-b56b139.stderr", "stderr_hash": "281a1f80ba2484620f2c440e2b98f3729b3fd0312b6c19ccab1a146d", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_implied_do_loops-modules_35-c089638.stdout0000664000175000017500000006533715141516316031463 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2_21: (Module (SymbolTable 2 { get_args_fixed_length_a_array: (Function (SymbolTable 3 { __1__libasr_index_: (Variable 3 __1__libasr_index_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __1__libasr_index_1: (Variable 3 __1__libasr_index_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr__created__var__0__array_constructor_: (Variable 3 __libasr__created__var__0__array_constructor_ [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr__created__var__1__array_constructor_: (Variable 3 __libasr__created__var__1__array_constructor_ [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), place: (Variable 3 place [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), strings: (Variable 3 strings [] Unspecified () () Default (Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), strings_a: (Variable 3 strings_a [] Local () () Default (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_args_fixed_length_a_array (FunctionType [(Allocatable (Array (String 1 () AssumedLength DescriptorString) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 strings)] [(Allocate [((Var 3 strings_a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] (IntegerConstant 5 (Integer 4) Decimal) () ())] () () () ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (StringLen (ArrayItem (Var 3 strings_a) [(() (ArrayBound (Var 3 strings_a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) LtE (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) (Logical 4) () ) [(Assignment (Var 3 strings) (Var 3 strings_a) () .false. .false. )] [(ExplicitDeallocate [(Var 3 __libasr__created__var__0__array_constructor_)] ) (Allocate [((Var 3 __libasr__created__var__0__array_constructor_) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) () ())] () () () ) (Assignment (Var 3 __1__libasr_index_) (ArrayBound (Var 3 __libasr__created__var__0__array_constructor_) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 3 strings) (Var 3 __libasr__created__var__0__array_constructor_) () .false. .false. )] )] [] ) (If () (IntegerCompare (Var 3 place) Gt (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ExplicitDeallocate [(Var 3 __libasr__created__var__1__array_constructor_)] ) (Allocate [((Var 3 __libasr__created__var__1__array_constructor_) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] (StringLen (ArrayItem (Var 3 strings) [(() (ArrayBound (Var 3 strings) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () AssumedLength DescriptorString) ColMajor () ) (Integer 4) () ) () ())] () () () ) (Assignment (Var 3 __1__libasr_index_1) (ArrayBound (Var 3 __libasr__created__var__1__array_constructor_) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 3 strings) (Var 3 __libasr__created__var__1__array_constructor_) () .false. .false. )] [] )] () Public .false. .false. () ) }) m_cli2_21 () [] .false. .false. .false. ), modules_35: (Program (SymbolTable 4 { get_args_fixed_length_a_array: (ExternalSymbol 4 get_args_fixed_length_a_array 2 get_args_fixed_length_a_array m_cli2_21 [] get_args_fixed_length_a_array Public ), string: (Variable 4 string [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_35 [m_cli2_21] [(Allocate [((Var 4 string) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] () () ())] () () () ) (Print (StringConstant "executing modules_35" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 4 get_args_fixed_length_a_array () [((Var 4 string))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_50-7def206.json0000664000175000017500000000071515141516316025302 0ustar alastairalastair{ "basename": "run-format_50-7def206", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_50.f90", "infile_hash": "ced3f301a712574d64ae033d0ff783b3f28e4ca070ed93d0ebf669ec", "outfile": null, "outfile_hash": null, "stdout": "run-format_50-7def206.stdout", "stdout_hash": "709e50b018137e30ecbf20beeeb4837a1e7405fea3dc60e7960561d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr6-7f62240.stdout0000664000175000017500000000052415141516316024737 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (RealConstant 5.300000 (Real 4) )] ) lfortran-lfortran-2f73434/tests/reference/x86-program_cmake_01-fc45ca9.json0000664000175000017500000000064315141516316026517 0ustar alastairalastair{ "basename": "x86-program_cmake_01-fc45ca9", "cmd": "lfortran --no-color --backend=x86 {infile} -o output", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics15-76ae493.stderr0000664000175000017500000000032315141516316026274 0ustar alastairalastairsemantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/intrinsics15.f90:2:14 | 2 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-string_11-e6c763f.json0000664000175000017500000000075015141516316025470 0ustar alastairalastair{ "basename": "llvm-string_11-e6c763f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_11.f90", "infile_hash": "eb36fd203a74190c7d98eeff5e136b53c72959fe49b4fed6558763d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_11-e6c763f.stdout", "stdout_hash": "544f2e9a99891641e7ba5b5f3b65b0552126805dd1880cf83e672e96", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_loop_unroll-loop_unroll_large-8723774.stdout0000664000175000017500000025476615141516316032174 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_large: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) loop_unroll_large [] [(Allocate [((Var 2 array) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 32 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 32 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-doloop_03-9c463c5.stdout0000664000175000017500000002276615141516316025573 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_03 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [] [] ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit () )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit () )] [] ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Cycle () )] [] ) (Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-int_dp_param-f284039.stdout0000664000175000017500000000477715141516316026540 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @int_dp_param.u = internal global i32 2147483647 @int_dp_param.v = internal global i64 2147483647 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [6 x i8] c"I4,I8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %prec1 = alloca i32, align 4 store i32 4, i32* %prec1, align 4 %prec2 = alloca i32, align 4 store i32 8, i32* %prec2, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* @int_dp_param.u, i64* @int_dp_param.v) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_int_dp_param FINALIZE_SYMTABLE_int_dp_param: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_01-8974c02.json0000664000175000017500000000100115141516316030042 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_01-8974c02", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_01.f90", "infile_hash": "b69410e8dc944d0748ba6ceb9a98bb46621c18dc322814e045286eeb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_01-8974c02.stderr", "stderr_hash": "695ca61a08fc7f97084ebac3997c3cf7dc2a84c2a0a786ccd345b928", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-program_04-4e711d5.stdout0000664000175000017500000000011515141516316026401 0ustar alastairalastairprogram __xx_main implicit none print *, "hello world" end program __xx_main lfortran-lfortran-2f73434/tests/reference/asr-derived_types_07-ccfd81f.json0000664000175000017500000000077215141516316027007 0ustar alastairalastair{ "basename": "asr-derived_types_07-ccfd81f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_07.f90", "infile_hash": "33107b2d28cc81b22f81d3874dcb73e2941e7687400413569dd293e2", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-ccfd81f.stdout", "stdout_hash": "0105d63d7ab55f30df2eecf129cfadee504ebca95781fc8803a56056", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-recursion_03-3285725.json0000664000175000017500000000076115141516316025752 0ustar alastairalastair{ "basename": "llvm-recursion_03-3285725", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_03.f90", "infile_hash": "ca5d64a5bc86665cf6168763480264f56ea25b3bfcc7217348fb14c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_03-3285725.stdout", "stdout_hash": "e8b5bf5efcecf3c1fde126fef0a8449c3f5eca8dfeeca5317b21f5d9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_39-aaf2ba8.stdout0000664000175000017500000053206615141516316027367 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_39: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ik: (Variable 2 ik [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iz: (Variable 2 iz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nk: (Variable 2 nk [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nz: (Variable 2 nz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_39 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nz) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nk) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 2 (Integer 4) Decimal) ) (OMPPrivate [(Var 2 iy) (Var 2 ix) (Var 2 iz)] )] [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 iz) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nz) ()) [(DoLoop () ((Var 2 ik) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nk) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix) (StringConstant "iz->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iz) (StringConstant "ik->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ik)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] [] )] [] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface_allocatable_array-38d4afe.stdout0000664000175000017500000003257015141516316033500 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_interface_allocatable_array: (Function (SymbolTable 2 { r_g: (Variable 2 r_g [] Local () () Default (Allocatable (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), r_t: (Variable 2 r_t [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), sub1: (Function (SymbolTable 3 { sub1_arg_0: (Variable 3 sub1_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), sub1_arg_1: (Variable 3 sub1_arg_1 [] Unspecified () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub1 (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 sub1_arg_0) (Var 3 sub1_arg_1)] [] () Public .false. .false. () ), sub2: (Function (SymbolTable 4 { sub2_arg_0: (Variable 4 sub2_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), sub2_arg_1: (Variable 4 sub2_arg_1 [] Unspecified () () Default (Array (Real 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ) }) sub2 (FunctionType [(Integer 4) (Array (Real 4) [(() ())] PointerArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 sub2_arg_0) (Var 4 sub2_arg_1)] [] () Public .false. .false. () ) }) implicit_interface_allocatable_array (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 2 sub1 () [((IntegerConstant 1 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 2 r_g) DescriptorArray PointerArray (Array (Real 4) [(() ())] PointerArray ) () ))] () .false. ) (SubroutineCall 2 sub2 () [((IntegerConstant 1 (Integer 4) Decimal)) ((ArrayPhysicalCast (Var 2 r_t) DescriptorArray PointerArray (Pointer (Array (Real 4) [(() ())] PointerArray ) ) () ))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-template_nested-35ad81a.stdout0000664000175000017500000003021315141516316027204 0ustar alastairalastair(TranslationUnit [(Module template_nested_m (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_t [] [] () () None ()) (test_template [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement R [T F] [(DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] )] [(Function F [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [] [] [] )] ) (Template add_t [T F] [(Require [(UnitRequire R [(AttrNamelist T ) (AttrNamelist F )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_generic [] [] () () None ())] () )] [(Function add_generic [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [(Assignment 0 z (FuncCallOrArray F [] [(() x () 0) (() y () 0)] [] [] [] ) () )] [] [] ) (Function call_add_generic [(x) (y)] [] z () () [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(z [] [] () () None ())] () )] [(Assignment 0 z (FuncCallOrArray add_generic [] [(() x () 0) (() y () 0)] [] [] [] ) () )] [] [] )] )] [] [(Function func_arg_real [(x) (y)] [(AttrType TypeReal [] () () None )] z () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () )] [(Assignment 0 z (+ x y) () )] [] [] ) (Subroutine test_template [] [] () () [] [] [] [(Instantiate add_t [(AttrType TypeReal [] () () None ) (AttrNamelist func_arg_real )] [(UseSymbol call_add_generic add_real )] ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ())] () )] [(Assignment 0 x (Real "5.1") () ) (Assignment 0 y (Real "7.2") () ) (Print 0 () [(String "The result is " ()) (FuncCallOrArray add_real [] [(() x () 0) (() y () 0)] [] [] [] )] () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray add_real [] [(() x () 0) (() y () 0)] [] [] [] ) (Real "12.3")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] [] )] ) (Program template_nested () [(Use [] template_nested_m [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-c_f_pointer_02-97865d6.stderr0000664000175000017500000000033615141516316026467 0ustar alastairalastairsemantic error: shape array passed to c_f_pointer must be of rank 1 but given rank is 2 --> tests/errors/c_f_pointer_02.f90:6:34 | 6 | call c_f_pointer(queries, x, shape) | ^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-dimension_attr2-8fda690.json0000664000175000017500000000076415141516316026600 0ustar alastairalastair{ "basename": "asr-dimension_attr2-8fda690", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr2.f90", "infile_hash": "568a05015d6d94c3e3a22921a99746f77bf708b4e1f67e7f5f30296d", "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr2-8fda690.stdout", "stdout_hash": "8551808b3dcd4ec197cea640b26ac82d37a12f702498c0028ed389e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_01-075c0b7.json0000664000175000017500000000073215141516316025347 0ustar alastairalastair{ "basename": "asr-complex_01-075c0b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/complex_01.f90", "infile_hash": "64e3a5939b32727865bb468781be815efa91bfd342a9340ce4514c0d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-complex_01-075c0b7.stderr", "stderr_hash": "fcbb361eb41ff9b3f71c50e7f9dc21e7dc4c7df3b6155e6fe470b54a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-recursion_03-8300fac.stdout0000664000175000017500000012042715141516316026345 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 9 { r: (Variable 9 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), solver: (ExternalSymbol 9 solver 2 solver recursion_03 [] solver Public ), solver_caller: (ExternalSymbol 9 solver_caller 2 solver_caller recursion_03 [] solver_caller Public ), sub1: (ExternalSymbol 9 sub1 2 sub1 recursion_03 [] sub1 Public ) }) main [recursion_03] [(Assignment (Var 9 r) (FunctionCall 9 sub1 () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "r =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 9 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), recursion_03: (Module (SymbolTable 2 { solver: (Function (SymbolTable 5 { f: (Function (SymbolTable 6 { f: (Variable 6 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 f) Public .false. .false. () ), f_val: (Variable 5 f_val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iter: (Variable 5 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), solver: (Variable 5 solver [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) solver (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sub1] [(Var 5 f) (Var 5 iter)] [(Assignment (Var 5 f_val) (FunctionCall 5 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "before:" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerBinOp (Var 5 iter) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 5 f_val) (FunctionCall 5 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "after:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 5 solver) Public .false. .false. () ), solver_caller: (Function (SymbolTable 3 { f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 f) Public .false. .false. () ), iter: (Variable 3 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), solver_caller: (Variable 3 solver_caller [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) solver_caller (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver] [(Var 3 f) (Var 3 iter)] [(Assignment (Var 3 solver_caller) (FunctionCall 2 solver () [((Var 3 f)) ((Var 3 iter))] (Integer 4) () () ) () .false. .false. )] (Var 3 solver_caller) Public .false. .false. () ), sub1: (Function (SymbolTable 7 { getx: (Function (SymbolTable 8 { getx: (Variable 8 getx [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) getx (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "x in getx" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 7 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 8 getx) (Var 7 x) () .false. .false. )] (Var 8 getx) Public .false. .false. () ), iter: (Variable 7 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sub1: (Variable 7 sub1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 7 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver_caller] [(Var 7 y) (Var 7 iter)] [(Assignment (Var 7 x) (Var 7 y) () .false. .false. ) (Print (StringConstant "in sub1" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 7 iter) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 7 sub1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] [] ) (Assignment (Var 7 tmp) (FunctionCall 7 getx () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 7 sub1) (FunctionCall 2 solver_caller () [((Var 7 getx)) ((Var 7 iter))] (Integer 4) () () ) () .false. .false. )] (Var 7 sub1) Public .false. .false. () ) }) recursion_03 () [recursion_03] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-write6-7442be9.json0000664000175000017500000000065715141516316024656 0ustar alastairalastair{ "basename": "run-write6-7442be9", "cmd": "lfortran --no-color {infile}", "infile": "tests/write6.f90", "infile_hash": "a4be2d1d5d03af3c83dd9f47c247c627e5f2f222cd527b3b0d781c14", "outfile": null, "outfile_hash": null, "stdout": "run-write6-7442be9.stdout", "stdout_hash": "59400cf5a52a85e7880d61e702843c2bba15a38ea7039cc42a52f7dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_02-35d66e0.json0000664000175000017500000000074515141516316026562 0ustar alastairalastair{ "basename": "ast-derived_types_02-35d66e0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_02.f90", "infile_hash": "97982d2ac648e6b5260dc06a91a3e121668752f5b642ff81d4efba5f", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_02-35d66e0.stdout", "stdout_hash": "20fd9b173cf3da467ad0ece417b92d024a9cb71adca5409494f60163", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-pragma1-25cfcb2.json0000664000175000017500000000074115141516316026445 0ustar alastairalastair{ "basename": "asr_openmp-pragma1-25cfcb2", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/pragma1.f90", "infile_hash": "0b9eea06186cb7eb1866b55256263d4e562835c40920f35b92ed18ee", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-pragma1-25cfcb2.stdout", "stdout_hash": "84651b07be9643cf439ce4fcc644d5341ca739402f439a433c4e37f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-defop1-57f175e.json0000664000175000017500000000072215141516316025251 0ustar alastairalastair{ "basename": "ast_f90-defop1-57f175e", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/defop1.f90", "infile_hash": "78b29077fdb7303bc8002ba7f16a36ffa13a981527f87df53bf268e3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-defop1-57f175e.stdout", "stdout_hash": "29fa60c533348137b692bebe3c5345e95ac566bb5372d55e8d5ac217", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_disable_style_suggestion-implicit10-c95f35e.stdout0000664000175000017500000001450415141516316033176 0ustar alastairalastair(TranslationUnit [(Function a [] [(AttrType TypeInteger [] () () None )] () () () [] [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ()) (e [] [] () () None ()) (f [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(d1 [] [] () () None ()) (e1 [] [] () () None ()) (f1 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(g [] [] () () None ()) (h [] [] () () None ()) (i [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(l [] [] () () None ()) (m [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeDoublePrecision [] () () None ) [] [(o [] [] () () None ()) (p [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(Y [(1 e1 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(X [(1 d1 DimensionExpr) (1 e1 DimensionExpr) (1 f1 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 (FuncCallOrArray Y [] [(() 1 () 0)] [] [] [] ) 3 () ) (Assignment 0 (FuncCallOrArray X [] [(() 1 () 0) (() 1 () 0) (() 1 () 0)] [] [] [] ) 3 () ) (Assignment 0 a 1 () ) (Assignment 0 b 2 () ) (Assignment 0 d 3 () ) (Assignment 0 f 4 () ) (Assignment 0 h 5 () ) (Assignment 0 i 6 () ) (Assignment 0 l 7 () ) (Assignment 0 m 8 () ) (Assignment 0 o 9 () ) (Assignment 0 p 10 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_size-aaed99f.stdout0000664000175000017500000010200215141516316027215 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @5 = private unnamed_addr constant [182 x i8] c"At 13:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @7 = private unnamed_addr constant [182 x i8] c"At 15:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [182 x i8] c"At 16:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @15 = private unnamed_addr constant [182 x i8] c"At 17:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @19 = private unnamed_addr constant [182 x i8] c"At 20:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [182 x i8] c"At 22:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [182 x i8] c"At 23:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [182 x i8] c"At 24:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [182 x i8] c"At 25:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [182 x i8] c"At 28:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @39 = private unnamed_addr constant [183 x i8] c"At 28:12 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @41 = private unnamed_addr constant [182 x i8] c"At 30:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [182 x i8] c"At 31:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [182 x i8] c"At 32:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @51 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @53 = private unnamed_addr constant [182 x i8] c"At 34:1 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [182 x i8] c"At 34:8 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @57 = private unnamed_addr constant [183 x i8] c"At 34:13 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [183 x i8] c"At 34:18 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @61 = private unnamed_addr constant [183 x i8] c"At 34:23 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [182 x i8] c"At 35:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @65 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [182 x i8] c"At 37:1 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @69 = private unnamed_addr constant [182 x i8] c"At 37:8 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @71 = private unnamed_addr constant [182 x i8] c"At 38:5 of file tests/../integration_tests/arrays_01_size.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @73 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x i32], align 4 %b = alloca [4 x i32], align 4 %i = alloca i32, align 4 %size_a = alloca i32, align 4 %size_b = alloca i32, align 4 store i32 3, i32* %size_a, align 4 store i32 4, i32* %size_b, align 4 %2 = load i32, i32* %size_a, align 4 %3 = icmp ne i32 %2, 3 br i1 %3, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %4 = load i32, i32* %size_b, align 4 %5 = icmp ne i32 %4, 4 br i1 %5, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont5, %ifcont3 %6 = load i32, i32* %i, align 4 %7 = add i32 %6, 1 %8 = load i32, i32* %size_a, align 4 %9 = icmp sle i32 %7, %8 br i1 %9, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %10 = load i32, i32* %i, align 4 %11 = add i32 %10, 1 store i32 %11, i32* %i, align 4 %12 = load i32, i32* %i, align 4 %13 = sub i32 %12, 1 %14 = mul i32 1, %13 %15 = add i32 0, %14 %16 = icmp slt i32 %12, 1 %17 = icmp sgt i32 %12, 3 %18 = or i1 %16, %17 br i1 %18, label %then4, label %ifcont5 then4: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 %12, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont5: ; preds = %loop.body %19 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 %15 %20 = load i32, i32* %i, align 4 %21 = add i32 %20, 10 store i32 %21, i32* %19, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then6, label %ifcont7 then6: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont7: ; preds = %loop.end %22 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %23 = load i32, i32* %22, align 4 %24 = icmp ne i32 %23, 11 br i1 %24, label %then8, label %else9 then8: ; preds = %ifcont7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont10 else9: ; preds = %ifcont7 br label %ifcont10 ifcont10: ; preds = %else9, %then8 br i1 false, label %then11, label %ifcont12 then11: ; preds = %ifcont10 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont12: ; preds = %ifcont10 %25 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 1 %26 = load i32, i32* %25, align 4 %27 = icmp ne i32 %26, 12 br i1 %27, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 br i1 false, label %then16, label %ifcont17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 3, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont17: ; preds = %ifcont15 %28 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 2 %29 = load i32, i32* %28, align 4 %30 = icmp ne i32 %29, 13 br i1 %30, label %then18, label %else19 then18: ; preds = %ifcont17 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont20 else19: ; preds = %ifcont17 br label %ifcont20 ifcont20: ; preds = %else19, %then18 store i32 10, i32* %i, align 4 br label %loop.head21 loop.head21: ; preds = %ifcont24, %ifcont20 %31 = load i32, i32* %i, align 4 %32 = add i32 %31, 1 %33 = load i32, i32* %size_b, align 4 %34 = add i32 10, %33 %35 = icmp sle i32 %32, %34 br i1 %35, label %loop.body22, label %loop.end25 loop.body22: ; preds = %loop.head21 %36 = load i32, i32* %i, align 4 %37 = add i32 %36, 1 store i32 %37, i32* %i, align 4 %38 = load i32, i32* %i, align 4 %39 = sub i32 %38, 10 %40 = sub i32 %39, 1 %41 = mul i32 1, %40 %42 = add i32 0, %41 %43 = icmp slt i32 %39, 1 %44 = icmp sgt i32 %39, 4 %45 = or i1 %43, %44 br i1 %45, label %then23, label %ifcont24 then23: ; preds = %loop.body22 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 %39, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont24: ; preds = %loop.body22 %46 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 %42 %47 = load i32, i32* %i, align 4 store i32 %47, i32* %46, align 4 br label %loop.head21 loop.end25: ; preds = %loop.head21 br i1 false, label %then26, label %ifcont27 then26: ; preds = %loop.end25 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont27: ; preds = %loop.end25 %48 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %49 = load i32, i32* %48, align 4 %50 = icmp ne i32 %49, 11 br i1 %50, label %then28, label %else29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont30 else29: ; preds = %ifcont27 br label %ifcont30 ifcont30: ; preds = %else29, %then28 br i1 false, label %then31, label %ifcont32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %51 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %52 = load i32, i32* %51, align 4 %53 = icmp ne i32 %52, 12 br i1 %53, label %then33, label %else34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont35 else34: ; preds = %ifcont32 br label %ifcont35 ifcont35: ; preds = %else34, %then33 br i1 false, label %then36, label %ifcont37 then36: ; preds = %ifcont35 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont37: ; preds = %ifcont35 %54 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %55 = load i32, i32* %54, align 4 %56 = icmp ne i32 %55, 13 br i1 %56, label %then38, label %else39 then38: ; preds = %ifcont37 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont40 else39: ; preds = %ifcont37 br label %ifcont40 ifcont40: ; preds = %else39, %then38 br i1 false, label %then41, label %ifcont42 then41: ; preds = %ifcont40 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont42: ; preds = %ifcont40 %57 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %58 = load i32, i32* %57, align 4 %59 = icmp ne i32 %58, 14 br i1 %59, label %then43, label %else44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont45 else44: ; preds = %ifcont42 br label %ifcont45 ifcont45: ; preds = %else44, %then43 store i32 0, i32* %i, align 4 br label %loop.head46 loop.head46: ; preds = %ifcont51, %ifcont45 %60 = load i32, i32* %i, align 4 %61 = add i32 %60, 1 %62 = load i32, i32* %size_a, align 4 %63 = icmp sle i32 %61, %62 br i1 %63, label %loop.body47, label %loop.end52 loop.body47: ; preds = %loop.head46 %64 = load i32, i32* %i, align 4 %65 = add i32 %64, 1 store i32 %65, i32* %i, align 4 %66 = load i32, i32* %i, align 4 %67 = sub i32 %66, 1 %68 = mul i32 1, %67 %69 = add i32 0, %68 %70 = icmp slt i32 %66, 1 %71 = icmp sgt i32 %66, 4 %72 = or i1 %70, %71 br i1 %72, label %then48, label %ifcont49 then48: ; preds = %loop.body47 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 %66, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont49: ; preds = %loop.body47 %73 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 %69 %74 = load i32, i32* %i, align 4 %75 = sub i32 %74, 1 %76 = mul i32 1, %75 %77 = add i32 0, %76 %78 = icmp slt i32 %74, 1 %79 = icmp sgt i32 %74, 3 %80 = or i1 %78, %79 br i1 %80, label %then50, label %ifcont51 then50: ; preds = %ifcont49 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 %74, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont51: ; preds = %ifcont49 %81 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 %77 %82 = load i32, i32* %81, align 4 %83 = sub i32 %82, 10 store i32 %83, i32* %73, align 4 br label %loop.head46 loop.end52: ; preds = %loop.head46 br i1 false, label %then53, label %ifcont54 then53: ; preds = %loop.end52 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont54: ; preds = %loop.end52 %84 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %85 = load i32, i32* %84, align 4 %86 = icmp ne i32 %85, 1 br i1 %86, label %then55, label %else56 then55: ; preds = %ifcont54 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont57 else56: ; preds = %ifcont54 br label %ifcont57 ifcont57: ; preds = %else56, %then55 br i1 false, label %then58, label %ifcont59 then58: ; preds = %ifcont57 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont59: ; preds = %ifcont57 %87 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %88 = load i32, i32* %87, align 4 %89 = icmp ne i32 %88, 2 br i1 %89, label %then60, label %else61 then60: ; preds = %ifcont59 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont62 else61: ; preds = %ifcont59 br label %ifcont62 ifcont62: ; preds = %else61, %then60 br i1 false, label %then63, label %ifcont64 then63: ; preds = %ifcont62 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont64: ; preds = %ifcont62 %90 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %91 = load i32, i32* %90, align 4 %92 = icmp ne i32 %91, 3 br i1 %92, label %then65, label %else66 then65: ; preds = %ifcont64 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont67 else66: ; preds = %ifcont64 br label %ifcont67 ifcont67: ; preds = %else66, %then65 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %93 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %94 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %95 = load i32, i32* %94, align 4 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %96 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %97 = load i32, i32* %96, align 4 %98 = add i32 %95, %97 br i1 false, label %then74, label %ifcont75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont75: ; preds = %ifcont73 %99 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %100 = load i32, i32* %99, align 4 %101 = add i32 %98, %100 br i1 false, label %then76, label %ifcont77 then76: ; preds = %ifcont75 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont77: ; preds = %ifcont75 %102 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %103 = load i32, i32* %102, align 4 %104 = add i32 %101, %103 store i32 %104, i32* %93, align 4 br i1 false, label %then78, label %ifcont79 then78: ; preds = %ifcont77 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont79: ; preds = %ifcont77 %105 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %106 = load i32, i32* %105, align 4 %107 = icmp ne i32 %106, 17 br i1 %107, label %then80, label %else81 then80: ; preds = %ifcont79 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont82 else81: ; preds = %ifcont79 br label %ifcont82 ifcont82: ; preds = %else81, %then80 br i1 false, label %then83, label %ifcont84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont84: ; preds = %ifcont82 %108 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 br i1 false, label %then85, label %ifcont86 then85: ; preds = %ifcont84 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont86: ; preds = %ifcont84 %109 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %110 = load i32, i32* %109, align 4 store i32 %110, i32* %108, align 4 br i1 false, label %then87, label %ifcont88 then87: ; preds = %ifcont86 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont88: ; preds = %ifcont86 %111 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %112 = load i32, i32* %111, align 4 %113 = icmp ne i32 %112, 11 br i1 %113, label %then89, label %else90 then89: ; preds = %ifcont88 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont91 else90: ; preds = %ifcont88 br label %ifcont91 ifcont91: ; preds = %else90, %then89 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont91 br label %FINALIZE_SYMTABLE_arrays_01 FINALIZE_SYMTABLE_arrays_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-sin_03-8490135.json0000664000175000017500000000073415141516316024343 0ustar alastairalastair{ "basename": "asr-sin_03-8490135", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/sin_03.f90", "infile_hash": "3c036b8aabdbfddc3c46fb69183c427f7991b105c361b785872acf59", "outfile": null, "outfile_hash": null, "stdout": "asr-sin_03-8490135.stdout", "stdout_hash": "d87e05d02548166cffe145fdbb970ab1efbbd2b6b1184d1dbb11886e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine3b-4883d18.stdout0000664000175000017500000001332515141516316026333 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 2 f) Public .false. .false. () ), g: (Function (SymbolTable 3 { g: (Variable 3 g [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 g) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 3 g) Public .false. .false. () ), h: (Function (SymbolTable 4 { h: (Variable 4 h [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) h (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 h) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. )] (Var 4 h) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-variable1-8ec1519.stdout0000664000175000017500000005016515141516316025634 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { variable01: (Function (SymbolTable 2 { m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), matveca: (Function (SymbolTable 3 { matveca_arg_0: (Variable 3 matveca_arg_0 [] Unspecified () () Default (Array (Complex 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_1: (Variable 3 matveca_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_2: (Variable 3 matveca_arg_2 [] Unspecified () () Default (Array (Complex 4) [(() ())] PointerArray ) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_3: (Variable 3 matveca_arg_3 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_4: (Variable 3 matveca_arg_4 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_5: (Variable 3 matveca_arg_5 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ), matveca_arg_6: (Variable 3 matveca_arg_6 [] Unspecified () () Default (Complex 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) matveca (FunctionType [(Array (Complex 4) [(() ())] PointerArray ) (Integer 4) (Array (Complex 4) [(() ())] PointerArray ) (Complex 4) (Complex 4) (Complex 4) (Complex 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 matveca_arg_0) (Var 3 matveca_arg_1) (Var 3 matveca_arg_2) (Var 3 matveca_arg_3) (Var 3 matveca_arg_4) (Var 3 matveca_arg_5) (Var 3 matveca_arg_6)] [] () Public .false. .false. () ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p1: (Variable 2 p1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p2: (Variable 2 p2 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p3: (Variable 2 p3 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p4: (Variable 2 p4 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [m] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 m))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [n] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) variable01 (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m) (Var 2 n)] [(SubroutineCall 2 matveca () [((Var 2 x)) ((Var 2 m)) ((Var 2 y)) ((Var 2 p1)) ((Var 2 p2)) ((Var 2 p3)) ((Var 2 p4))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-recursion_01-95eb32d.json0000664000175000017500000000076115141516316026166 0ustar alastairalastair{ "basename": "llvm-recursion_01-95eb32d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_01.f90", "infile_hash": "1e4b2d3443a20a91f047ee86808b6d104c0f8bb11e930886d11978b5", "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_01-95eb32d.stdout", "stdout_hash": "04cae25b03c2fc6a16161b00b4628fbc822a57ae069af6f30fdea32e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program_cmake_01-a9e6179.stdout0000664000175000017500000000113415141516316027073 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { testfortran: (Program (SymbolTable 2 { }) testfortran [] [(Print (StringConstant "Hello" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine2-c8b0b6f.stderr0000664000175000017500000000021315141516316026352 0ustar alastairalastairstyle suggestion: Use 'end do' instead of 'enddo' --> tests/subroutine2.f90:75:1 | 75 | enddo | ^^^^^ help: write this as 'end do' lfortran-lfortran-2f73434/tests/reference/asr-array_03-a79d86f.stderr0000664000175000017500000000025615141516316025454 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `a` has rank `1`, but is referenced as rank `2` --> tests/errors/array_03.f90:5:1 | 5 | a(:,:) = 1 | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-program3-e2fc2d1.stdout0000664000175000017500000001325515141516316025650 0ustar alastairalastair(TranslationUnit [(Program program3 () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 x (Real "5.0") () ) (Assignment 0 y (Real "2.0") () ) (Assignment 0 z (* x y) () ) (Print 0 () [(String "10.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "49.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "10.0 ==" ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function func1 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (+ a b) () ) (Assignment 0 c (FuncCallOrArray func2 [] [(() c () 0) (() c () 0)] [] [] [] ) () )] [] [] ) (Function func2 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (* a b) (TriviaNode [] [(EndOfLine) (Comment "! c = func1(c, c)" )] ) )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_13-07b50ad.stdout0000664000175000017500000004073215141516316026520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_13: (Program (SymbolTable 2 { p: (Variable 2 p [] Local (TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p1: (Variable 2 p1 [] Local (TypeInquiry Kind (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p2: (Variable 2 p2 [] Local (TypeInquiry Kind (Integer 8) (IntegerConstant 5 (Integer 8) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p3: (Variable 2 p3 [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p4: (Variable 2 p4 [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p5: (Variable 2 p5 [] Local (TypeInquiry Kind (Real 4) (RealConstant 5.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p6: (Variable 2 p6 [] Local (TypeInquiry Kind (Real 8) (RealConstant 5.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), p7: (Variable 2 p7 [] Local (TypeInquiry Kind (Logical 4) (LogicalConstant .true. (Logical 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_13 [] [(If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 p) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p1) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p2) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (Var 2 p3) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p5) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (Var 2 p6) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) And (IntegerCompare (Var 2 p7) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_call3-8c7b642.stderr0000664000175000017500000000026315141516316027141 0ustar alastairalastairsyntax error: Token ')' is unexpected here --> tests/fixed_form_call3.f:5:43 | 5 | call prinf('16m+70 = *',16*m+70,1)) | ^ lfortran-lfortran-2f73434/tests/reference/llvm-stop-866225f.json0000664000175000017500000000070415141516316024504 0ustar alastairalastair{ "basename": "llvm-stop-866225f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/stop.f90", "infile_hash": "4992b783d9f3aeee0fc682e7600ed3b3e57f5d9e8ea4ef63ab0bbb4d", "outfile": null, "outfile_hash": null, "stdout": "llvm-stop-866225f.stdout", "stdout_hash": "25664f5a74ead27cac1c65e20ee42d0ca11bd41a29e8e860f0ec60aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_module-3f800f0.json0000664000175000017500000000076015141516316026732 0ustar alastairalastair{ "basename": "ast-fixedform_module-3f800f0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_module.f", "infile_hash": "032fb00debb25bd84eafae8de804901f317da59470d4206d18b7fad0", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_module-3f800f0.stdout", "stdout_hash": "2dc542642992285eb91bbfb115fcac0fdfbced5aa5f5e9fda8f7de40", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_04_func-9f59ad6.json0000664000175000017500000000076415141516316026324 0ustar alastairalastair{ "basename": "asr-arrays_04_func-9f59ad6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_04_func-9f59ad6.stdout", "stdout_hash": "a346f7acfed727a44520ce313a07d4ff99937adc9151e9b1ef8d7f8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_11-1131557.json0000664000175000017500000000075015141516316025212 0ustar alastairalastair{ "basename": "ast-modules_11-1131557", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_11-1131557.stdout", "stdout_hash": "55df6502cfe05f7264ab8085c1865fa46d218804e1865d03caff299a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_20-4b5a0e4.stdout0000664000175000017500000001603715141516316025635 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_20: (Program (SymbolTable 2 { list_character: (Variable 2 list_character [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), list_integer: (Variable 2 list_integer [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), list_logical: (Variable 2 list_logical [] Local () () Default (Allocatable (Array (Logical 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_20 [] [(Assignment (Var 2 list_integer) (ArrayConstructor [] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) () .false. .false. ) (Assignment (Var 2 list_logical) (ArrayConstructor [] (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] FixedSizeArray ) () ColMajor () ) () .false. .false. ) (Assignment (Var 2 list_character) (ArrayConstructor [] (Array (String 1 (StringLen (ArrayItem (Var 2 list_character) [(() (ArrayBound (Var 2 list_character) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] PointerArray ) () ColMajor () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-modules_01-da63075.stdout0000664000175000017500000000262015141516316025723 0ustar alastairalastair(TranslationUnit [(Module modules_01_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () )] [] [] )] ) (Program modules_01 () [(Use [] modules_01_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-string_slice2-473fb60.stderr0000664000175000017500000000023215141516316026500 0ustar alastairalastairsemantic error: Substring end index exceeds the string length --> tests/errors/string_slice2.f90:6:12 | 6 | print*, s(1: 9) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/wat-doloop_02-1ee6409.json0000664000175000017500000000073015141516316025207 0ustar alastairalastair{ "basename": "wat-doloop_02-1ee6409", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_02-1ee6409.stdout", "stdout_hash": "c5abe75515114c8e79a1171cce08203579e2d2aaa33957730b5c41e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_json-modules_10-93cd62d.json0000664000175000017500000000074515141516316026474 0ustar alastairalastair{ "basename": "asr_json-modules_10-93cd62d", "cmd": "lfortran --show-asr --no-indent --json {infile} -o {outfile}", "infile": "tests/modules_10.f90", "infile_hash": "82a7ff17209a0f99dc417848d6e080a46a74724bfdb4d50f5146ad7c", "outfile": null, "outfile_hash": null, "stdout": "asr_json-modules_10-93cd62d.stdout", "stdout_hash": "6ba0d894fc527f3ef652b638dc1a6911afce7dea22593d7e9f4e548d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matmul_01-7b0b0c2.stdout0000664000175000017500000100235015141516316025617 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matmul_01: (Program (SymbolTable 6 { a: (Variable 6 a [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 6 b [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 6 c [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c2: (Variable 6 c2 [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 6 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), err: (Variable 6 err [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), fma_clock: (Variable 6 fma_clock [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), freq: (Variable 6 freq [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), ghz: (Variable 6 ghz [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iter: (Variable 6 iter [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), matmul1: (ExternalSymbol 6 matmul1 2 matmul1 matmul_01_cpu [] matmul1 Public ), matmul2: (ExternalSymbol 6 matmul2 2 matmul2 matmul_01_cpu [] matmul2 Public ), measured: (Variable 6 measured [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 6 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), percent_peak: (Variable 6 percent_peak [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 6 t [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), t1: (Variable 6 t1 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), t2: (Variable 6 t2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) matmul_01 [matmul_01_cpu] [(Assignment (Var 6 n) (IntegerConstant 96 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 6 iter) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(StringConstant "Size (n x n): n =" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 n)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Iter =" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 iter)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Size MB:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (RealBinOp (RealBinOp (RealBinOp (RealConstant 4.000000 (Real 8) ) Mul (Cast (Var 6 n) IntegerToReal (Real 8) () ) (Real 8) () ) Mul (Cast (Var 6 n) IntegerToReal (Real 8) () ) (Real 8) () ) Div (Cast (IntegerBinOp (IntegerConstant 1024 (Integer 4) Decimal) Pow (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 1048576 (Integer 4) Decimal) ) IntegerToReal (Real 8) (RealConstant 1048576.000000 (Real 8) ) ) (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Allocate [((Var 6 a) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 b) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 c) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ()) ((Var 6 c2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (IntrinsicImpureSubroutine RandomNumber [(Var 6 a)] 0 ) (IntrinsicImpureSubroutine RandomNumber [(Var 6 b)] 0 ) (Print (StringConstant "Fortran intrinsic matmul:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(Assignment (Var 6 c) (IntrinsicArrayFunction MatMul [(Var 6 a) (Var 6 b)] 3 (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () ) () .false. .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "matmul2:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(SubroutineCall 6 matmul2 () [((Var 6 a)) ((Var 6 b)) ((Var 6 c2))] () .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 err) (IntrinsicArrayFunction MaxVal [(IntrinsicElementalFunction Abs [(RealBinOp (Var 6 c) Sub (Var 6 c2) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Error:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 err)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 6 err) Gt (RealConstant 0.001000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "matmul1:" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t1)] 0 ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 6 iter) ()) [(SubroutineCall 6 matmul1 () [((Var 6 a)) ((Var 6 b)) ((Var 6 c2))] () .false. )] [] ) (IntrinsicImpureSubroutine CpuTime [(Var 6 t2)] 0 ) (Assignment (Var 6 err) (IntrinsicArrayFunction MaxVal [(IntrinsicElementalFunction Abs [(RealBinOp (Var 6 c) Sub (Var 6 c2) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )] 0 (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Error:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 err)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 t) (RealBinOp (RealBinOp (Var 6 t2) Sub (Var 6 t1) (Real 8) () ) Div (Cast (Var 6 iter) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 ghz) (RealConstant 1000000000.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 6 fma_clock) (RealConstant 0.062500 (Real 8) ) () .false. .false. ) (Assignment (Var 6 freq) (RealBinOp (RealConstant 3.200000 (Real 8) ) Mul (Var 6 ghz) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 measured) (RealBinOp (RealBinOp (Var 6 t) Mul (Var 6 freq) (Real 8) () ) Div (Cast (IntegerBinOp (Var 6 n) Pow (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) () .false. .false. ) (Assignment (Var 6 percent_peak) (RealBinOp (RealBinOp (Var 6 fma_clock) Div (Var 6 measured) (Real 8) () ) Mul (Cast (IntegerConstant 100 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 100.000000 (Real 8) ) ) (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Time: " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 t)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "Clock cycles per element:" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringFormat () [(StringConstant "Theoretical performance peak:" (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 fma_clock) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Measured: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 measured) (StringConstant "cycles" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Percent peak: " (String 1 (IntegerConstant 29 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 percent_peak) (StringConstant "%" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (Var 6 err) Gt (RealConstant 0.001000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), matmul_01_cpu: (Module (SymbolTable 2 { kernel2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a0: (Variable 4 a0 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (Variable 4 a1 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 4 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a3: (Variable 4 a3 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a4: (Variable 4 a4 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a5: (Variable 4 a5 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i1: (Variable 4 i1 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 4 s1 [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), u00: (Variable 4 u00 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u01: (Variable 4 u01 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u10: (Variable 4 u10 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u11: (Variable 4 u11 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u20: (Variable 4 u20 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u21: (Variable 4 u21 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u30: (Variable 4 u30 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u31: (Variable 4 u31 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u40: (Variable 4 u40 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u41: (Variable 4 u41 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u50: (Variable 4 u50 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), u51: (Variable 4 u51 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) kernel2 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 b) (Var 4 a) (Var 4 c) (Var 4 x) (Var 4 y) (Var 4 i1) (Var 4 s1)] [(Assignment (Var 4 u00) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u01) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u10) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u11) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u20) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u21) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u30) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u31) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u40) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u41) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u50) (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 4 u51) (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 k) (Var 4 i1) (IntegerBinOp (IntegerBinOp (Var 4 i1) Add (Var 4 s1) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(Assignment (Var 4 a0) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u00) (RealBinOp (Var 4 u00) Add (RealBinOp (Var 4 a0) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u01) (RealBinOp (Var 4 u01) Add (RealBinOp (Var 4 a0) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a1) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u10) (RealBinOp (Var 4 u10) Add (RealBinOp (Var 4 a1) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u11) (RealBinOp (Var 4 u11) Add (RealBinOp (Var 4 a1) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a2) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u20) (RealBinOp (Var 4 u20) Add (RealBinOp (Var 4 a2) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u21) (RealBinOp (Var 4 u21) Add (RealBinOp (Var 4 a2) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a3) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u30) (RealBinOp (Var 4 u30) Add (RealBinOp (Var 4 a3) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u31) (RealBinOp (Var 4 u31) Add (RealBinOp (Var 4 a3) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a4) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u40) (RealBinOp (Var 4 u40) Add (RealBinOp (Var 4 a4) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u41) (RealBinOp (Var 4 u41) Add (RealBinOp (Var 4 a4) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 a5) (ArrayPhysicalCast (ArrayBroadcast (ArrayItem (Var 4 a) [(() (Var 4 k) ()) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u50) (RealBinOp (Var 4 u50) Add (RealBinOp (Var 4 a5) Mul (ArraySection (Var 4 b) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. ) (Assignment (Var 4 u51) (RealBinOp (Var 4 u51) Add (RealBinOp (Var 4 a5) Mul (ArraySection (Var 4 b) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (Var 4 k) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. )] [] ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u00) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u01) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u10) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u11) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u20) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u21) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u30) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u31) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u40) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u41) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((Var 4 y) (IntegerBinOp (Var 4 y) Add (IntegerConstant 7 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u50) () .false. .false. ) (Assignment (ArraySection (Var 4 c) [((IntegerBinOp (Var 4 y) Add (IntegerConstant 8 (Integer 4) Decimal) (Integer 4) () ) (IntegerBinOp (Var 4 y) Add (IntegerConstant 15 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal)) (() (IntegerBinOp (Var 4 x) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) ())] (Array (Real 4) [(() ())] DescriptorArray ) () ) (Var 4 u51) () .false. .false. )] () Public .false. .false. () ), matmul1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) matmul1 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 c) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) (IntrinsicArrayFunction Shape [(Var 3 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) Add (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 3 b) [(() (Var 3 k) ()) (() (Var 3 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] )] [] )] [] )] () Public .false. .false. () ), matmul2: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 5 c [] Out () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i1: (Variable 5 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i2: (Variable 5 i2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i3: (Variable 5 i3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 5 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 5 s1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 5 s2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s3: (Variable 5 s3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) matmul2 (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [kernel2] [(Var 5 a) (Var 5 b) (Var 5 c)] [(Assignment (Var 5 n) (ArraySize (Var 5 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 s3) (IntegerConstant 48 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 s2) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 s1) (IntegerConstant 24 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 c) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) (IntrinsicArrayFunction Shape [(Var 5 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 5 i3) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s3)) [(DoLoop () ((Var 5 i2) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s2)) [(DoLoop () ((Var 5 i1) (IntegerConstant 1 (Integer 4) Decimal) (Var 5 n) (Var 5 s1)) [(DoLoop () ((Var 5 x) (Var 5 i2) (IntegerBinOp (IntegerBinOp (Var 5 i2) Add (Var 5 s2) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 6 (Integer 4) Decimal)) [(DoLoop () ((Var 5 y) (Var 5 i3) (IntegerBinOp (IntegerBinOp (Var 5 i3) Add (Var 5 s3) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (IntegerConstant 16 (Integer 4) Decimal)) [(SubroutineCall 2 kernel2 () [((ArrayPhysicalCast (Var 5 a) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 5 b) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 5 c) DescriptorArray DescriptorArray (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () )) ((Var 5 x)) ((Var 5 y)) ((Var 5 i1)) ((Var 5 s1))] () .false. )] [] )] [] )] [] )] [] )] [] )] () Public .false. .false. () ) }) matmul_01_cpu () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-block1-f4e17ad.json0000664000175000017500000000072215141516316025376 0ustar alastairalastair{ "basename": "ast_f90-block1-f4e17ad", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/block1.f90", "infile_hash": "195aaf0b0ae556975d0d7c84d1ff451d793614e176384294a288b08c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-block1-f4e17ad.stdout", "stdout_hash": "023d887b93d9b4e5408a600e5bc12cfd79b7d8d88960b4be25dc7a7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-kind_var_of_int-1199f59.json0000664000175000017500000000075115141516316026474 0ustar alastairalastair{ "basename": "asr-kind_var_of_int-1199f59", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/kind_var_of_int.f90", "infile_hash": "c331e081883c4bb4f2213b9796727af46dfc4feb20a04ab7b4a87881", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-kind_var_of_int-1199f59.stderr", "stderr_hash": "3f3a6b545dd15d259068cc59f9c6cd48f042c7a99cebbf83d6f74e15", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit3-7f279ac.json0000664000175000017500000000077415141516316027602 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit3-7f279ac", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit3.f", "infile_hash": "de7925b8e456615be2803bb7b49c366b8910e85dce4727bdbfcfe1b5", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit3-7f279ac.stdout", "stdout_hash": "bb3c3b53729836c8af738d245c1dd071d7e27292a1d04b1a14ad56cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/tokens-expr8-00c1054.json0000664000175000017500000000071515141516316025072 0ustar alastairalastair{ "basename": "tokens-expr8-00c1054", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/expr8.f90", "infile_hash": "b0f7cfaa460c9319f7cc7b0fa470fbbce940f7f4eef3156b55897b51", "outfile": null, "outfile_hash": null, "stdout": "tokens-expr8-00c1054.stdout", "stdout_hash": "f7ec05a11cafd75b4ddbbe0cbb606e0da8c6cec70baad1b3647519f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-init_values-19dfa76.stdout0000664000175000017500000004130115141516316026362 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { init_values: (Program (SymbolTable 2 { a: (Variable 2 a [i j] Local (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (IntegerConstant 3 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [l] Local (LogicalBinOp (Var 2 l) Or (LogicalConstant .true. (Logical 4) ) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) (ComplexConstant 3.000000 4.000000 (Complex 4) ) Parameter (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [a] Local (IntegerCompare (Var 2 a) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r_minus: (Variable 2 r_minus [r] Local (RealUnaryMinus (Var 2 r) (Real 4) (RealConstant -4.000000 (Real 4) ) ) (RealConstant -4.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 2 s [s1 s2] Local (IntrinsicElementalFunction StringConcat [(Var 2 s1) (Var 2 s2)] 0 (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) (StringConstant "left" (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "left" (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 2 s1 [] Local (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 2 s2 [] Local (StringConstant "eft" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "eft" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) init_values [] [(Print (StringFormat () [(Var 2 i) (Var 2 j) (Var 2 r) (Var 2 c) (Var 2 a) (Var 2 l) (Var 2 b) (Var 2 r_minus) (Var 2 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-do_loop_01-3b6a582.json0000664000175000017500000000073215141516316025336 0ustar alastairalastair{ "basename": "asr-do_loop_01-3b6a582", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/do_loop_01.f90", "infile_hash": "9ce950d001b6c5824cfa98548507a6e6740d66a95d14ec226ab6c15c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-do_loop_01-3b6a582.stderr", "stderr_hash": "8c3f16b3fc4fca0da547ba8723a5a8a6137c5b75d857f7d69aa0be1e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/tokens-esub2-4cb444d.json0000664000175000017500000000072415141516316025220 0ustar alastairalastair{ "basename": "tokens-esub2-4cb444d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/errors/esub2.f90", "infile_hash": "fb45951fe73ff1605633612371af0d19b7036b3aef93d6b084c33823", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "tokens-esub2-4cb444d.stderr", "stderr_hash": "f34c7ceeeaa22d1c9075e3ff71d51db6bdcd53ddb1f0b3c39e05fc33", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing2-1e706a4.stderr0000664000175000017500000000020615141516316027214 0ustar alastairalastairsemantic error: Variable 'x' is not declared --> tests/errors/implicit_typing2.f90:6:5 | 6 | x = 1 | ^ 'x' is undeclared lfortran-lfortran-2f73434/tests/reference/ast_f90-if2-0c3bb72.json0000664000175000017500000000071115141516316024610 0ustar alastairalastair{ "basename": "ast_f90-if2-0c3bb72", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/if2.f90", "infile_hash": "7e5997e7b3a28044e5c2899900ea795edfd628c1ed4530afdf1aea0d", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-if2-0c3bb72.stdout", "stdout_hash": "d505ab8f9410508730d2bcc0577d768fb7250379d8923bf3769b2cc6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_class_constructor-multiple_objects_args-2d1007e.json0000664000175000017500000000111015141516316033755 0ustar alastairalastair{ "basename": "pass_class_constructor-multiple_objects_args-2d1007e", "cmd": "lfortran --pass=class_constructor --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/multiple_objects_args.f90", "infile_hash": "08d1551d4b73ca92d0a09c318304281b80bb8e069e38b45ffc41f5b9", "outfile": null, "outfile_hash": null, "stdout": "pass_class_constructor-multiple_objects_args-2d1007e.stdout", "stdout_hash": "a04c5cb81ad038e4f00443ebb0dd86701a6192078c48aba79cff2572", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array9-fe1439d.json0000664000175000017500000000070715141516316024703 0ustar alastairalastair{ "basename": "ast-array9-fe1439d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array9.f90", "infile_hash": "7107510b84a7e22f82d8f1f61617c399bc53b8a0fb59a5453419889c", "outfile": null, "outfile_hash": null, "stdout": "ast-array9-fe1439d.stdout", "stdout_hash": "0713345f733a9e9bdd7064dcce8ae13e9748c685edbb5c44cd3deee5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-character_01-e8e453d.stdout0000664000175000017500000000330715141516316026300 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_01: (Program (SymbolTable 2 { c_null_char: (Variable 2 c_null_char [] Local (StringConstant "ball" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "b" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) character_01 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_type_05-3836aa5.stderr0000664000175000017500000000074415141516316026727 0ustar alastairalastairsemantic error: Pass and NoPass attributes cannot be provided together --> tests/errors/derived_type_05.f90:7:49 | 7 | procedure(testing_interface), deferred, pass(my_object), nopass :: testing | ^^^^^^^^^^^^^^^ pass specified here | 7 | procedure(testing_interface), deferred, pass(my_object), nopass :: testing | ^^^^^^ nopass specified here lfortran-lfortran-2f73434/tests/reference/ast-coarrays_02-ea9dc2c.json0000664000175000017500000000072615141516316025754 0ustar alastairalastair{ "basename": "ast-coarrays_02-ea9dc2c", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/coarrays_02.f90", "infile_hash": "b8a582ffc5b086c98bf8f601c32831d648b199fc53bb272628421da9", "outfile": null, "outfile_hash": null, "stdout": "ast-coarrays_02-ea9dc2c.stdout", "stdout_hash": "9379d9b17be1929c55ce40dc9fda706fcf87f3a926136690d45dda81", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_test-bb5013f.stdoutlfortran-lfortran-2f73434/tests/reference/pass_array_struct_temporary_array_op-array_op_simplifier_t0000664000175000017500000004600215141516316035006 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { __libasr_index_0_: (Variable 2 __libasr_index_0_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_index_0_1: (Variable 2 __libasr_index_0_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_index_0_2: (Variable 2 __libasr_index_0_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_index_1_: (Variable 2 __libasr_index_1_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_index_1_1: (Variable 2 __libasr_index_1_1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_index_1_2: (Variable 2 __libasr_index_1_2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Allocate [((Var 2 d) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (DebugCheckArrayBounds (Var 2 d) [(Var 2 a) (Var 2 b)] .false. ) (Assignment (Var 2 __libasr_index_1_1) (ArrayBound (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_1_2) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 2 __libasr_index_1_) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 d) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (Var 2 __libasr_index_0_1) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_2) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) () .false. .false. ) (DoLoop () ((Var 2 __libasr_index_0_) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 d) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 d) [(() (Var 2 __libasr_index_0_) ()) (() (Var 2 __libasr_index_1_) ())] (Real 4) ColMajor () ) (RealBinOp (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 __libasr_index_0_1) ()) (() (Var 2 __libasr_index_1_1) ())] (Real 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (Var 2 __libasr_index_0_2) ()) (() (Var 2 __libasr_index_1_2) ())] (Real 4) ColMajor () ) (Real 4) () ) Add (Var 2 c) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_1) (IntegerBinOp (Var 2 __libasr_index_0_1) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_0_2) (IntegerBinOp (Var 2 __libasr_index_0_2) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (Assignment (Var 2 __libasr_index_1_1) (IntegerBinOp (Var 2 __libasr_index_1_1) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 __libasr_index_1_2) (IntegerBinOp (Var 2 __libasr_index_1_2) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-procedure_with_type-4c8ea35.json0000664000175000017500000000076515141516316027561 0ustar alastairalastair{ "basename": "ast-procedure_with_type-4c8ea35", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/procedure_with_type.f90", "infile_hash": "a2cb3df55c455622783d0b209d9fd84633b8e67530cf4ca17030700e", "outfile": null, "outfile_hash": null, "stdout": "ast-procedure_with_type-4c8ea35.stdout", "stdout_hash": "49ddb23e13380a55dd5eea878d088309735ffe30d6a3cf012de19b4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allocate_01-f3446f6.json0000664000175000017500000000075315141516316025502 0ustar alastairalastair{ "basename": "asr-allocate_01-f3446f6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_01.f90", "infile_hash": "1132bfc098d2bca743472b75141d3c99f1a387436ca5098352f0c757", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_01-f3446f6.stdout", "stdout_hash": "abfe5864cbab3a66497591c56591026284ea393db6c4de098a4a5466", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-modules_11-a28ab77.stdout0000664000175000017500000001140515141516316026172 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module_modules_11_module11_i = global i32 1 @__module_modules_11_module11_j = global i32 2 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data = private constant [4 x i8] c"i = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.2 = private constant [4 x i8] c"j = " @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_modules_11_module11_access_internally() { .entry: %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, %string_descriptor* @string_const, i32* @__module_modules_11_module11_i) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_access_internally FINALIZE_SYMTABLE_access_internally: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %2, i32 0, i32 0, %string_descriptor* @string_const.3, i32* @__module_modules_11_module11_j) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @__module_modules_11_module11_access_internally() call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_access_externally FINALIZE_SYMTABLE_access_externally: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_03-15fcd63.json0000664000175000017500000000074315141516316027634 0ustar alastairalastair{ "basename": "run-array_bounds_check_03-15fcd63", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_03.f90", "infile_hash": "6799dc4bd57bea91b97537abefdd229857c3736e06be6a50c08655b5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_03-15fcd63.stderr", "stderr_hash": "acafb1b107fb254fa325e01e38b21139fcdc1bcec80df27288c4e5ce", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-doloop_01-5cd8bf1.json0000664000175000017500000000074515141516316025345 0ustar alastairalastair{ "basename": "asr-doloop_01-5cd8bf1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_01-5cd8bf1.stdout", "stdout_hash": "126a59cd13428c0861dfb1109f8e9ec3b8510ec7413208307aa5759e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-if_05-865c1b8.stdout0000664000175000017500000002062415141516316024674 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end local.get 1 if i32.const 1 i32.const 236 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end local.get 0 if i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 304 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 1 if i32.const 1 i32.const 348 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 388 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end local.get 0 if i32.const 1 i32.const 432 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 if i32.const 1 i32.const 452 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end end local.get 1 if i32.const 1 i32.const 476 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 if i32.const 1 i32.const 452 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 496 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end local.get 1 if i32.const 1 i32.const 476 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 1 if i32.const 1 i32.const 516 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 496 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\11\00\00\00") (data (;35;) (i32.const 216) "x: Single Line If ") (data (;36;) (i32.const 236) "\f4\00\00\00\11\00\00\00") (data (;37;) (i32.const 244) "y: Single Line If ") (data (;38;) (i32.const 264) "\10\01\00\00\20\00\00\00") (data (;39;) (i32.const 272) "x: Multi Line If-Else: x is True") (data (;40;) (i32.const 304) "\38\01\00\00\21\00\00\00") (data (;41;) (i32.const 312) "x: Multi Line If-Else: x is False ") (data (;42;) (i32.const 348) "\64\01\00\00\20\00\00\00") (data (;43;) (i32.const 356) "y: Multi Line If-Else: y is True") (data (;44;) (i32.const 388) "\8c\01\00\00\21\00\00\00") (data (;45;) (i32.const 396) "y: Multi Line If-Else: y is False ") (data (;46;) (i32.const 432) "\b8\01\00\00\0a\00\00\00") (data (;47;) (i32.const 440) "x: If part ") (data (;48;) (i32.const 452) "\cc\01\00\00\0f\00\00\00") (data (;49;) (i32.const 460) "x: Else-If part ") (data (;50;) (i32.const 476) "\e4\01\00\00\0a\00\00\00") (data (;51;) (i32.const 484) "y: If part ") (data (;52;) (i32.const 496) "\f8\01\00\00\09\00\00\00") (data (;53;) (i32.const 504) "Else part ") (data (;54;) (i32.const 516) "\0c\02\00\00\0f\00\00\00") (data (;55;) (i32.const 524) "y: Else-If part ") ) lfortran-lfortran-2f73434/tests/reference/asr-derived_type_02-3e6510f.stderr0000664000175000017500000000037415141516316026722 0ustar alastairalastairsemantic error: Passed object dummy argument does not match function argument --> tests/errors/derived_type_02.f90:7:9 | 7 | procedure(testing_interface), deferred :: testing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/pass_where-where_02-1839d96.json0000664000175000017500000000077515141516316026335 0ustar alastairalastair{ "basename": "pass_where-where_02-1839d96", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_02.f90", "infile_hash": "d77bcdf887423550fb6073875746e6b4af104d344e645f7f3753eb1d", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_02-1839d96.stdout", "stdout_hash": "5f1d9c1109aee5fe7e83f1e6fc960589f9f0347bf32b20b06213747b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-while_02-3db2b04.json0000664000175000017500000000074515141516316025253 0ustar alastairalastair{ "basename": "llvm-while_02-3db2b04", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/while_02.f90", "infile_hash": "a905fa7d48385e1df9ac039aabeadb0362aa1b11587096303c0839b2", "outfile": null, "outfile_hash": null, "stdout": "llvm-while_02-3db2b04.stdout", "stdout_hash": "fc7cdda19a4d6f778ecdf5287e42efebb9632b11898066abbc1fe3a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-close_invalid_kwarg1-b38b499.json0000664000175000017500000000077015141516316027506 0ustar alastairalastair{ "basename": "asr-close_invalid_kwarg1-b38b499", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/close_invalid_kwarg1.f90", "infile_hash": "296192ece06382b8ad7da3a6e8a9b36ec6a2d6b04dfd8d6a6e48fdf8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-close_invalid_kwarg1-b38b499.stderr", "stderr_hash": "c25da8e5009596338b320d2df46e459e72d9d78b60d4d488724c3953", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_array_01-691b151.json0000664000175000017500000000077515141516316026641 0ustar alastairalastair{ "basename": "asr-template_array_01-691b151", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_01.f90", "infile_hash": "6756a93056719ca3ede501254efbeec0d93fdeaf8378cddc308bb5b5", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_01-691b151.stdout", "stdout_hash": "b3a439de77006ec24f5791e0eaf26ea009c7a5613e362114e734db36", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program2-c0dd48f.json0000664000175000017500000000071515141516316025301 0ustar alastairalastair{ "basename": "ast-program2-c0dd48f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/program2.f90", "infile_hash": "24e43f660d753021af8fd33127b7d99fe70e9604cbfb321f65ab146a", "outfile": null, "outfile_hash": null, "stdout": "ast-program2-c0dd48f.stdout", "stdout_hash": "650f87e1542d614b21f87989da924ede9e7ce475c907055906decdb6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-loop_test-5d89970.json0000664000175000017500000000072715141516316025356 0ustar alastairalastair{ "basename": "asr-loop_test-5d89970", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/loop_test.f90", "infile_hash": "aed46db1607054f287d564d1050191e11ff8d7af86462aa07aeb685b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-loop_test-5d89970.stderr", "stderr_hash": "b7b3840a887c92453850d954f2bb22da6f6c1301b87b7681a2ded5e6", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-format_12-43152e4.json0000664000175000017500000000071515141516316025132 0ustar alastairalastair{ "basename": "run-format_12-43152e4", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_12.f90", "infile_hash": "c8b55fbf08e13910eba0e4a0676ce1ee33948fa588da1276816d610c", "outfile": null, "outfile_hash": null, "stdout": "run-format_12-43152e4.stdout", "stdout_hash": "8a11ee5189b3301b56878c592eba22999b95feb0926ef081c2e37cf8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp3-1719443.stderr0000664000175000017500000000021615141516316026706 0ustar alastairalastairsemantic error: Variable 'xx' is not declared --> tests/errors/cpp3.f90:7:10 | 7 | print *, xx, X123, y | ^^ 'xx' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-nested_call_filter_01-2b1295b.stdout0000664000175000017500000002460715141516316030101 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_call_filter_01: (Program (SymbolTable 4 { modproc: (ExternalSymbol 4 modproc 2 modproc nested_call_filter_mod [] modproc Public ), outer: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), inner: (Function (SymbolTable 6 { }) inner (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (Var 5 a) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) outer (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 5 inner () [] () .false. ) (SubroutineCall 4 modproc () [((Var 5 a))] () .false. )] () Public .false. .false. () ) }) nested_call_filter_01 [nested_call_filter_mod] [(SubroutineCall 4 outer () [] () .false. )] ), nested_call_filter_mod: (Module (SymbolTable 2 { modproc: (Function (SymbolTable 3 { y: (Variable 3 y [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modproc (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 y)] [(Assignment (Var 3 y) (IntegerBinOp (Var 3 y) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ) }) nested_call_filter_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-no_prescan_include2-121e523.stdout0000664000175000017500000000127615141516316027606 0ustar alastairalastair(TranslationUnit [(Program include2 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (* (+ 2 3) 5) () ) (Print 0 () [x] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-class_02-b56b852.stdout0000664000175000017500000006344615141516316025400 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { circle_test: (Program (SymbolTable 7 { main: (ExternalSymbol 7 main 2 main class_circle2 [] main Public ) }) circle_test [class_circle2] [(SubroutineCall 7 main () [] () .false. )] ), class_circle2: (Module (SymbolTable 2 { circle: (Struct (SymbolTable 3 { circle_area: (StructMethodDeclaration 3 circle_area () circle_area 2 circle_area Source .false. .false. ), circle_print: (StructMethodDeclaration 3 circle_print () circle_print 2 circle_print Source .false. .false. ), radius: (Variable 3 radius [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) circle (StructType [(Real 4)] [] .true. .false. ) [] [radius] [] Source Private .false. .false. [] () () ), circle_area: (Function (SymbolTable 4 { 1_circle_radius: (ExternalSymbol 4 1_circle_radius 3 radius circle [] radius Public ), circle_area: (Variable 4 circle_area [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), this: (Variable 4 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. ) }) circle_area (FunctionType [(StructType [(Real 4)] [] .false. .false. )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 this)] [(Assignment (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (StructInstanceMember (Var 4 this) 4 1_circle_radius (Real 4) () ) Pow (IntegerConstant 2 (Integer 4) Decimal) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 circle_area) Private .false. .false. () ), circle_print: (Function (SymbolTable 5 { 1_circle_circle_area: (ExternalSymbol 5 1_circle_circle_area 3 circle_area circle [] circle_area Public ), 1_circle_radius: (ExternalSymbol 5 1_circle_radius 3 radius circle [] radius Public ), area: (Variable 5 area [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 5 this [] In () () Default (StructType [(Real 4)] [] .false. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. ) }) circle_print (FunctionType [(StructType [(Real 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this)] [(Assignment (Var 5 area) (FunctionCall 5 1_circle_circle_area () [] (Real 4) () (Var 5 this) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Circle: r = " (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StructInstanceMember (Var 5 this) 5 1_circle_radius (Real 4) () ) (StringConstant " area = " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 area)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Private .false. .false. () ), main: (Function (SymbolTable 6 { 1_circle_circle_print: (ExternalSymbol 6 1_circle_circle_print 3 circle_print circle [] circle_print Public ), 1_circle_radius: (ExternalSymbol 6 1_circle_radius 3 radius circle [] radius Public ), c: (Variable 6 c [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 2 circle Source Private Required .false. .false. .false. () .false. .false. ) }) main (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 c) (StructConstructor 2 circle [((RealConstant 1.000000 (Real 4) ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 6 c) 6 1_circle_radius (Real 4) () ) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (SubroutineCall 6 1_circle_circle_print () [] (Var 6 c) .false. )] () Public .false. .false. () ), pi: (Variable 2 pi [] Local (Cast (RealConstant 3.141593 (Real 8) ) RealToReal (Real 4) (RealConstant 3.141593 (Real 4) ) ) (RealConstant 3.141593 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) class_circle2 () [class_circle2] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-logical4-64da104.stdout0000664000175000017500000001340015141516316025445 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32 i32) i32.const 2 i32.eqz i32.eqz local.set 0 i32.const -1 i32.eqz i32.eqz local.set 1 i32.const 0 i32.eqz i32.eqz local.set 2 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/cpp-expr_05-3b5ec63.json0000664000175000017500000000072215141516316024741 0ustar alastairalastair{ "basename": "cpp-expr_05-3b5ec63", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "cpp-expr_05-3b5ec63.stdout", "stdout_hash": "254da958ec0be8bf0705deaed51b55584a214ae34951339e2f090e85", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_06-2986f6e.json0000664000175000017500000000074315141516316027575 0ustar alastairalastair{ "basename": "run-array_bounds_check_06-2986f6e", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_06.f90", "infile_hash": "8d6d28fe1c81ff7cba66afc6e853bd26e5b8716b40fd41942df789a8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_06-2986f6e.stderr", "stderr_hash": "1606f51b6e85d0a750cba7425024a88508d41ce1ccac713926d32221", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/julia-case_01-cbdd0aa.stdout0000664000175000017500000000115015141516316025765 0ustar alastairalastairfunction main() local i::Int64 local out::Int64 i = 4 if i == 1 out = 10 println("1") elseif i == 2 out = 20 println("2") elseif i == 3 out = 30 println("3") elseif i == 4 out = 40 println("4") end if out ≠ 40 println(Base.stderr, "ERROR STOP") exit(1) end if i == 1 out = 11 println("1") elseif i == 2 || i == 3 || i == 4 out = 22 println("2,3,4") end if out ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-assign_to2-127a642.stdout0000664000175000017500000001730015141516316025737 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), next: (Variable 2 next [] Local () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), sum: (Variable 2 sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(GoToTarget 10 10 ) (Assignment (Var 2 next) (IntegerConstant 30 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 sum) (Var 2 zero) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 20 20 ) (Select () (Var 2 next) [(CaseStmt [(IntegerConstant 30 (Integer 4) Decimal)] [(GoTo 30 30 )] .false. ) (CaseStmt [(IntegerConstant 50 (Integer 4) Decimal)] [(GoTo 50 50 )] .false. ) (CaseStmt [(IntegerConstant 70 (Integer 4) Decimal)] [(GoTo 70 70 )] .false. )] [] .false. ) (GoToTarget 30 30 ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(GoTo 70 70 )] [] ) (GoToTarget 50 50 ) (Print (StringFormat () [(IntegerConstant 50 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 next) (IntegerConstant 50 (Integer 4) Decimal) () .false. .false. ) (GoToTarget 70 70 ) (Print (StringFormat () [(IntegerConstant 70 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-loop_unroll_small-13135c0.json0000664000175000017500000000077515141516316027053 0ustar alastairalastair{ "basename": "asr-loop_unroll_small-13135c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_unroll_small.f90", "infile_hash": "5a308fd86dceda8d2b6a3c4fcb2412bf4d1b3f043105d06956960db8", "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_small-13135c0.stdout", "stdout_hash": "d67a891fa608153843dbfade49d3add59fde99bf083c15137c968491", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing3-c82e537.stderr0000664000175000017500000000037215141516316027232 0ustar alastairalastairsemantic error: No implicit return type available for `fun` --> tests/errors/implicit_typing3.f90:4:9 - 5:24 | 4 | function fun() | ^^^^^^^^^^^^^^... ... | 5 | end function fun | ...^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-nullify_03-e2c1d62.json0000664000175000017500000000075015141516316025443 0ustar alastairalastair{ "basename": "asr-nullify_03-e2c1d62", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_03.f90", "infile_hash": "0208ba787353b8a7cb23824af4baf3aafbb3d05dcc246d54e91df0c9", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_03-e2c1d62.stdout", "stdout_hash": "a3344f85b64bedeed43abbe0511b96e6cfce0269b67ac4a15a656654", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_26-f10d0e6.json0000664000175000017500000000076115141516316026154 0ustar alastairalastair{ "basename": "asr-intrinsics_26-f10d0e6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_26.f90", "infile_hash": "6f188062412b32185ec5b7c5db08e46b54f4d9614541bc7e7c7ae271", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_26-f10d0e6.stdout", "stdout_hash": "eead0753acb58c997fc9bed567a3237d74aa2b3413d1b1985eb291b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_type_without_start_program-089810e.stdout0000664000175000017500000000114115141516316033107 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(DerivedType test_t [] () [] [(Declaration (AttrType TypeReal [] () () None ) [] [(a [] [] () () None ())] () )] [] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-func_parameter_type-a49e846.json0000664000175000017500000000076515141516316027457 0ustar alastairalastair{ "basename": "asr-func_parameter_type-a49e846", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/func_parameter_type.f90", "infile_hash": "34a08bb396e7c713157f35ee281ae8abc109b6b7378aa438f2aaef2c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-func_parameter_type-a49e846.stderr", "stderr_hash": "7c665d4a967ca63657ccba705071d2f7d35e9743d4a5f490e12623f4", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-complex2-5384cb2.json0000664000175000017500000000071515141516316025135 0ustar alastairalastair{ "basename": "asr-complex2-5384cb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/complex2.f90", "infile_hash": "420a31c745b1be940871a88d76cfdc7432de5cbf6fe9f2e8bc87bf39", "outfile": null, "outfile_hash": null, "stdout": "asr-complex2-5384cb2.stdout", "stdout_hash": "21ed739e95b2f92d56138f546a69d73ac2d165e6acd001718bb9a480", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-logical4-64da104.json0000664000175000017500000000072515141516316025102 0ustar alastairalastair{ "basename": "wat-logical4-64da104", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/logical4.f90", "infile_hash": "ea18762e8bbd163cb8b30960c719f953e2dfae041020c2f1066b3a35", "outfile": null, "outfile_hash": null, "stdout": "wat-logical4-64da104.stdout", "stdout_hash": "a35313a74d78b6aad86f524ddece4b224cb53af8c298cce7f3f07e96", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent2-9ec99ee.json0000664000175000017500000000075215141516316027175 0ustar alastairalastair{ "basename": "ast_f90-do_concurrent2-9ec99ee", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/do_concurrent2.f90", "infile_hash": "afe8788676d4b7be4b765236db5d9c60aa267325a08b714b35ba7eb6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-do_concurrent2-9ec99ee.stdout", "stdout_hash": "d18cfdaa93af3c0230f5f79dcf10d429f0f0b3ac12c1af98c050ff2f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fn_call1-7e6ba0b.json0000664000175000017500000000071515141516316025221 0ustar alastairalastair{ "basename": "ast-fn_call1-7e6ba0b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn_call1.f90", "infile_hash": "fd319232dcd65e8f2c7722a5f8da034557658cb0a081224347fd1de6", "outfile": null, "outfile_hash": null, "stdout": "ast-fn_call1-7e6ba0b.stdout", "stdout_hash": "2d97a6c127586c6ebbd91090700dbcbc9a8371fa558c763b88fa7c8d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-nested_01-a37fe7e.json0000664000175000017500000000074515141516316025342 0ustar alastairalastair{ "basename": "ast-nested_01-a37fe7e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "ast-nested_01-a37fe7e.stdout", "stdout_hash": "dbf361714b01b1a2e4ec4e771f157da77979767b5e74d03008b64994", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_rank_assign-a69f7b4.json0000664000175000017500000000100415141516316030511 0ustar alastairalastair{ "basename": "asr-incompatible_rank_assign-a69f7b4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_rank_assign.f90", "infile_hash": "0e650e977c4ce7ce00bc5318fc2f65dcd9689f91a8fdd7e5d8cb1007", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_rank_assign-a69f7b4.stderr", "stderr_hash": "9f94b6c9d177478d0f450c91caf1b034b7706eee4978a80630f36d7d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_real-6c5e850.stdout0000664000175000017500000013062215141516316026754 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [181 x i8] c"At 6:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @3 = private unnamed_addr constant [181 x i8] c"At 8:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @7 = private unnamed_addr constant [181 x i8] c"At 9:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [182 x i8] c"At 10:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @15 = private unnamed_addr constant [182 x i8] c"At 13:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @17 = private unnamed_addr constant [182 x i8] c"At 15:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [182 x i8] c"At 16:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [182 x i8] c"At 17:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [182 x i8] c"At 18:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [182 x i8] c"At 21:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @35 = private unnamed_addr constant [183 x i8] c"At 21:12 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [182 x i8] c"At 23:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @41 = private unnamed_addr constant [182 x i8] c"At 24:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [182 x i8] c"At 25:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [182 x i8] c"At 27:1 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [182 x i8] c"At 27:8 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @53 = private unnamed_addr constant [183 x i8] c"At 27:13 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [183 x i8] c"At 27:18 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @57 = private unnamed_addr constant [183 x i8] c"At 27:23 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [182 x i8] c"At 28:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @61 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [182 x i8] c"At 30:1 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @65 = private unnamed_addr constant [182 x i8] c"At 30:8 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [182 x i8] c"At 31:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @71 = private unnamed_addr constant [182 x i8] c"At 35:9 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @73 = private unnamed_addr constant [182 x i8] c"At 35:9 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @75 = private unnamed_addr constant [182 x i8] c"At 38:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @77 = private unnamed_addr constant [182 x i8] c"At 38:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @79 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @81 = private unnamed_addr constant [182 x i8] c"At 39:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @82 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @83 = private unnamed_addr constant [182 x i8] c"At 39:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @85 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @87 = private unnamed_addr constant [182 x i8] c"At 40:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @89 = private unnamed_addr constant [182 x i8] c"At 40:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @93 = private unnamed_addr constant [182 x i8] c"At 41:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @94 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @95 = private unnamed_addr constant [182 x i8] c"At 41:5 of file tests/../integration_tests/arrays_01_real.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @97 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x double], align 8 %b = alloca [4 x double], align 8 %c = alloca [4 x double], align 8 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 3 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 %7 = load i32, i32* %i, align 4 %8 = sub i32 %7, 1 %9 = mul i32 1, %8 %10 = add i32 0, %9 %11 = icmp slt i32 %7, 1 %12 = icmp sgt i32 %7, 3 %13 = or i1 %11, %12 br i1 %13, label %then, label %ifcont then: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 %7, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %14 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 %10 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 10 %17 = sitofp i32 %16 to double store double %17, double* %14, align 8 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %18 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 0 %19 = load double, double* %18, align 8 %20 = fcmp une double %19, 1.100000e+01 br i1 %20, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %21 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 1 %22 = load double, double* %21, align 8 %23 = fcmp une double %22, 1.200000e+01 br i1 %23, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 3, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %24 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 2 %25 = load double, double* %24, align 8 %26 = fcmp une double %25, 1.300000e+01 br i1 %26, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %27 = load i32, i32* %i, align 4 %28 = add i32 %27, 1 %29 = icmp sle i32 %28, 14 br i1 %29, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %30 = load i32, i32* %i, align 4 %31 = add i32 %30, 1 store i32 %31, i32* %i, align 4 %32 = load i32, i32* %i, align 4 %33 = sub i32 %32, 10 %34 = sub i32 %33, 1 %35 = mul i32 1, %34 %36 = add i32 0, %35 %37 = icmp slt i32 %33, 1 %38 = icmp sgt i32 %33, 4 %39 = or i1 %37, %38 br i1 %39, label %then17, label %ifcont18 then17: ; preds = %loop.body16 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 %33, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %40 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 %36 %41 = load i32, i32* %i, align 4 %42 = sitofp i32 %41 to double store double %42, double* %40, align 8 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %43 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 0 %44 = load double, double* %43, align 8 %45 = fcmp une double %44, 1.100000e+01 br i1 %45, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %46 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 1 %47 = load double, double* %46, align 8 %48 = fcmp une double %47, 1.200000e+01 br i1 %48, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %49 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 2 %50 = load double, double* %49, align 8 %51 = fcmp une double %50, 1.300000e+01 br i1 %51, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %52 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 3 %53 = load double, double* %52, align 8 %54 = fcmp une double %53, 1.400000e+01 br i1 %54, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %55 = load i32, i32* %i, align 4 %56 = add i32 %55, 1 %57 = icmp sle i32 %56, 3 br i1 %57, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %58 = load i32, i32* %i, align 4 %59 = add i32 %58, 1 store i32 %59, i32* %i, align 4 %60 = load i32, i32* %i, align 4 %61 = sub i32 %60, 1 %62 = mul i32 1, %61 %63 = add i32 0, %62 %64 = icmp slt i32 %60, 1 %65 = icmp sgt i32 %60, 4 %66 = or i1 %64, %65 br i1 %66, label %then42, label %ifcont43 then42: ; preds = %loop.body41 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 %60, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %67 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 %63 %68 = load i32, i32* %i, align 4 %69 = sub i32 %68, 1 %70 = mul i32 1, %69 %71 = add i32 0, %70 %72 = icmp slt i32 %68, 1 %73 = icmp sgt i32 %68, 3 %74 = or i1 %72, %73 br i1 %74, label %then44, label %ifcont45 then44: ; preds = %ifcont43 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 %68, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %75 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 %71 %76 = load double, double* %75, align 8 %77 = fsub double %76, 1.000000e+01 store double %77, double* %67, align 8 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %78 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 0 %79 = load double, double* %78, align 8 %80 = fcmp une double %79, 1.000000e+00 br i1 %80, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %81 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 1 %82 = load double, double* %81, align 8 %83 = fcmp une double %82, 2.000000e+00 br i1 %83, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %84 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 2 %85 = load double, double* %84, align 8 %86 = fcmp une double %85, 3.000000e+00 br i1 %86, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %87 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %88 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 0 %89 = load double, double* %88, align 8 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %90 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 1 %91 = load double, double* %90, align 8 %92 = fadd double %89, %91 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %93 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 2 %94 = load double, double* %93, align 8 %95 = fadd double %92, %94 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %96 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 0 %97 = load double, double* %96, align 8 %98 = fadd double %95, %97 store double %98, double* %87, align 8 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %99 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 3 %100 = load double, double* %99, align 8 %101 = fcmp une double %100, 1.700000e+01 br i1 %101, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %102 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %103 = getelementptr [3 x double], [3 x double]* %a, i32 0, i32 0 %104 = load double, double* %103, align 8 store double %104, double* %102, align 8 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %105 = getelementptr [4 x double], [4 x double]* %b, i32 0, i32 3 %106 = load double, double* %105, align 8 %107 = fcmp une double %106, 1.100000e+01 br i1 %107, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 store i32 0, i32* %i, align 4 br label %loop.head86 loop.head86: ; preds = %loop.end94, %ifcont85 %108 = load i32, i32* %i, align 4 %109 = add i32 %108, 1 %110 = icmp sle i32 %109, 2 br i1 %110, label %loop.body87, label %loop.end95 loop.body87: ; preds = %loop.head86 %111 = load i32, i32* %i, align 4 %112 = add i32 %111, 1 store i32 %112, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head88 loop.head88: ; preds = %ifcont93, %loop.body87 %113 = load i32, i32* %j, align 4 %114 = add i32 %113, 1 %115 = icmp sle i32 %114, 2 br i1 %115, label %loop.body89, label %loop.end94 loop.body89: ; preds = %loop.head88 %116 = load i32, i32* %j, align 4 %117 = add i32 %116, 1 store i32 %117, i32* %j, align 4 %118 = load i32, i32* %i, align 4 %119 = load i32, i32* %j, align 4 %120 = sub i32 %118, 1 %121 = mul i32 1, %120 %122 = add i32 0, %121 %123 = icmp slt i32 %118, 1 %124 = icmp sgt i32 %118, 2 %125 = or i1 %123, %124 br i1 %125, label %then90, label %ifcont91 then90: ; preds = %loop.body89 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i32 %118, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont91: ; preds = %loop.body89 %126 = sub i32 %119, 1 %127 = mul i32 2, %126 %128 = add i32 %122, %127 %129 = icmp slt i32 %119, 1 %130 = icmp sgt i32 %119, 2 %131 = or i1 %129, %130 br i1 %131, label %then92, label %ifcont93 then92: ; preds = %ifcont91 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0), i32 %119, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont93: ; preds = %ifcont91 %132 = getelementptr [4 x double], [4 x double]* %c, i32 0, i32 %128 %133 = load i32, i32* %i, align 4 %134 = load i32, i32* %j, align 4 %135 = add i32 %133, %134 %136 = add i32 %135, 10 %137 = sitofp i32 %136 to double store double %137, double* %132, align 8 br label %loop.head88 loop.end94: ; preds = %loop.head88 br label %loop.head86 loop.end95: ; preds = %loop.head86 br i1 false, label %then96, label %ifcont97 then96: ; preds = %loop.end95 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont97: ; preds = %loop.end95 br i1 false, label %then98, label %ifcont99 then98: ; preds = %ifcont97 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont99: ; preds = %ifcont97 %138 = getelementptr [4 x double], [4 x double]* %c, i32 0, i32 0 %139 = load double, double* %138, align 8 %140 = fcmp une double %139, 1.200000e+01 br i1 %140, label %then100, label %else101 then100: ; preds = %ifcont99 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont102 else101: ; preds = %ifcont99 br label %ifcont102 ifcont102: ; preds = %else101, %then100 br i1 false, label %then103, label %ifcont104 then103: ; preds = %ifcont102 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @81, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont104: ; preds = %ifcont102 br i1 false, label %then105, label %ifcont106 then105: ; preds = %ifcont104 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @82, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont106: ; preds = %ifcont104 %141 = getelementptr [4 x double], [4 x double]* %c, i32 0, i32 2 %142 = load double, double* %141, align 8 %143 = fcmp une double %142, 1.300000e+01 br i1 %143, label %then107, label %else108 then107: ; preds = %ifcont106 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont109 else108: ; preds = %ifcont106 br label %ifcont109 ifcont109: ; preds = %else108, %then107 br i1 false, label %then110, label %ifcont111 then110: ; preds = %ifcont109 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont111: ; preds = %ifcont109 br i1 false, label %then112, label %ifcont113 then112: ; preds = %ifcont111 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont113: ; preds = %ifcont111 %144 = getelementptr [4 x double], [4 x double]* %c, i32 0, i32 1 %145 = load double, double* %144, align 8 %146 = fcmp une double %145, 1.300000e+01 br i1 %146, label %then114, label %else115 then114: ; preds = %ifcont113 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont116 else115: ; preds = %ifcont113 br label %ifcont116 ifcont116: ; preds = %else115, %then114 br i1 false, label %then117, label %ifcont118 then117: ; preds = %ifcont116 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @93, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont118: ; preds = %ifcont116 br i1 false, label %then119, label %ifcont120 then119: ; preds = %ifcont118 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @94, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont120: ; preds = %ifcont118 %147 = getelementptr [4 x double], [4 x double]* %c, i32 0, i32 3 %148 = load double, double* %147, align 8 %149 = fcmp une double %148, 1.400000e+01 br i1 %149, label %then121, label %else122 then121: ; preds = %ifcont120 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @97, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont123 else122: ; preds = %ifcont120 br label %ifcont123 ifcont123: ; preds = %else122, %then121 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont123 br label %FINALIZE_SYMTABLE_arrays_01_real FINALIZE_SYMTABLE_arrays_01_real: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-matrix_02_matmul-d389302.stdout0000664000175000017500000005365715141516316027100 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { matrix_02_matmul: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), centry: (Variable 2 centry [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cmat: (Variable 2 cmat [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) matrix_02_matmul [] [(Assignment (Var 2 a) (ArrayReshape (ArrayConstant 48 [1, 2, 3, ...., 10, 11, 12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (IntrinsicArrayFunction Shape [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [(() ()) (() ())] FixedSizeArray ) () ) () .false. .false. ) (Assignment (Var 2 b) (ArrayReshape (ArrayConstant 48 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...., 1.00000000e+01, 1.10000000e+01, 1.20000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (IntrinsicArrayFunction Shape [(ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [4, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Real 4) [(() ()) (() ())] FixedSizeArray ) () ) () .false. .false. ) (Assignment (Var 2 cmat) (IntrinsicArrayFunction MatMul [(ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) (ArrayPhysicalCast (Var 2 b) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )] 3 (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (Var 2 centry) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (DoLoop () ((Var 2 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 centry) (RealBinOp (Var 2 centry) Add (RealBinOp (Cast (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 k) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () ) Mul (ArrayItem (Var 2 b) [(() (Var 2 k) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (ArrayItem (Var 2 cmat) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) NotEq (Var 2 centry) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-parse_without_program_line-0b3170b.json0000664000175000017500000000100315141516316031014 0ustar alastairalastair{ "basename": "ast-parse_without_program_line-0b3170b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parse_without_program_line.f90", "infile_hash": "c68088b59370c4f5a2dc3747e3ca0c7de19d0210a92e2043fb975b96", "outfile": null, "outfile_hash": null, "stdout": "ast-parse_without_program_line-0b3170b.stdout", "stdout_hash": "3b6396afa747e6c7fd70f4fcdd6cde6d058a00d2d9b63afad4c2e1c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_14-79df2e1.json0000664000175000017500000000074215141516316025143 0ustar alastairalastair{ "basename": "asr-types_14-79df2e1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_14.f90", "infile_hash": "604dcedee00d3b6bd830fb4ca72cbd189f2daab1b1f19dd82cf8ccc0", "outfile": null, "outfile_hash": null, "stdout": "asr-types_14-79df2e1.stdout", "stdout_hash": "0a0464a428d37ea3d1c89638e473e4708757f3c199556d355106ff53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-types_03-e07ce23.json0000664000175000017500000000072515141516316025137 0ustar alastairalastair{ "basename": "wat-types_03-e07ce23", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "wat-types_03-e07ce23.stdout", "stdout_hash": "b71ee4ae0bfeeacb0aa6a6c97ed4444e801a15fb3e1eb2f71f81514c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_04-da02dd9.json0000664000175000017500000000074515141516316026715 0ustar alastairalastair{ "basename": "asr-derived_types_04-da02dd9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_04.f90", "infile_hash": "860801f83352a02e1bdaf7e25275d6403c80f4311033af18f946969a", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-da02dd9.stdout", "stdout_hash": "6f87920c17691ffd7b5c888cbdc51232d1790c880c1a9883240ae49b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_25-0bdc4b7.stdout0000664000175000017500000000003015141516316025713 0ustar alastairalastair0.E+0 1.E+1 3.E+0 3.E+5 lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json0000664000175000017500000000101615141516316031056 0ustar alastairalastair{ "basename": "asr-fixed_form_simple_continue-1cd55c6", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_simple_continue.f", "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_simple_continue-1cd55c6.stdout", "stdout_hash": "e85c13ea23fe836b62dbb2a6c830735a74165d3cce70f650e7fd2b69", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-selectrank1-ee68c35.stdout0000664000175000017500000000114315141516316026735 0ustar alastairalastairsubroutine process(x) real :: x(..) select rank (x) rank (0) x = 0 rank (2) if (size(x, 2) >= 2) then x(:, 2) = 2 end if rank default print *, "i did not expect rank", rank(x), "shape", shape(x) error stop "process bad arg" end select return end subroutine process subroutine initialize(arg, size) real, contiguous :: arg(..) integer :: size, i select rank (arg) rank (0) ! special case the scalar case arg = 0.0 rank (*) do i = 1, size arg(i) = 0.0 end do end select return end subroutine initialize lfortran-lfortran-2f73434/tests/reference/asr-character_02-56bfff3.stdout0000664000175000017500000000632115141516316026360 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character_02: (Program (SymbolTable 2 { toml_base: (Variable 2 toml_base [] Local (ArrayConstant 4 ["1", "2", "3", "$"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) (ArrayConstant 4 ["1", "2", "3", "$"] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) Parameter (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) character_02 [] [(Print (StringFormat () [(Var 2 toml_base)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-data1-4f93542.stdout0000664000175000017500000000302115141516316024670 0ustar alastairalastair(TranslationUnit [(Program test_data () [] [] [(Declaration (AttrType TypeReal [(() 8 Value)] () () None ) [] [(coef [(1 10 DimensionExpr) (1 1 DimensionExpr)] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [(DataImpliedDo [(FuncCallOrArray coef [] [(() i () 0) (() 1 () 0)] [] [] [] )] () i 1 10 () )] [(Real "1.0d0") (Real "2.0d0") (Real "3.0d0") (Real "3.0d0") (Real "3.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0") (Real "4.0d0")] )] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-type_mismatch1-550e457.json0000664000175000017500000000074615141516316026263 0ustar alastairalastair{ "basename": "asr-type_mismatch1-550e457", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_mismatch1.f90", "infile_hash": "8c60e395b39fd2c67da15122466c307239673e117cef04270c66c152", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_mismatch1-550e457.stderr", "stderr_hash": "ba3a203c293f42c9e03b1f28230b6ce14cc3d351e71828676f57e8c2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-maskl_incorrect_bit_size-62a84b0.json0000664000175000017500000000100415141516316030437 0ustar alastairalastair{ "basename": "asr-maskl_incorrect_bit_size-62a84b0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskl_incorrect_bit_size.f90", "infile_hash": "22bc3f7e5c1f8e417a35a9b3c5e5cd5e77144132b3dce000e08f9541", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskl_incorrect_bit_size-62a84b0.stderr", "stderr_hash": "7d551a51912bdc498dfe973f7075b133094a1b35e8de2c37291c122e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-assign1-9565114.json0000664000175000017500000000074015141516316024615 0ustar alastairalastair{ "basename": "ast-assign1-9565114", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign1.f", "infile_hash": "fd0e9e89daf1180a598a34cec5b9ee4f3825428369188648ab3db4d1", "outfile": null, "outfile_hash": null, "stdout": "ast-assign1-9565114.stdout", "stdout_hash": "0c47ecfc2429b62c912fc9f1768ba159046eacbeb189e3b7ed51414b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_02-dc19c13.stdout0000664000175000017500000010152015141516316026001 0ustar alastairalastair(TranslationUnit [(Module random (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] types [(UseSymbol dp () )] .true. () ) (Use [] utils [(UseSymbol stop_error () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(randn [] [] () () None ()) (rand_gamma [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Interface (InterfaceHeaderName randn ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [randn_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [randn_vector_n] [(SimpleAttribute AttrModule )] () )] ) (Interface (InterfaceHeaderName rand_gamma ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceModuleProcedure [rand_gamma_scalar] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_vector] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_matrix] [(SimpleAttribute AttrModule )] () ) (InterfaceModuleProcedure [rand_gamma_vector_n] [(SimpleAttribute AttrModule )] () )] )] [] [(Subroutine randn_scalar [(x)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the standard normal distribution." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for Generating" ) (Comment "! Normal Variables. SIAM Review, 6(3), 260-264." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(SimpleAttribute AttrSave )] [(first [] [] () (Logical .true.) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(u [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(r2 [] [] () () None ())] () )] [(If 0 () first [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 random_number [] [(() u () 0)] [] [] () ) (Assignment 0 u (- (* 2 u) 1) () ) (Assignment 0 r2 (FuncCallOrArray sum [] [(() (** u 2) () 0)] [] [] [] ) () ) (If 0 () (BoolOp (< r2 1) And (> r2 0) ) [(Exit 0 () () )] [] () () () )] () () ) (Assignment 0 u (* u (FuncCallOrArray sqrt [] [(() (/ (* (u- 2) (FuncCallOrArray log [] [(() r2 () 0)] [] [] [] )) r2) () 0)] [] [] [] )) () ) (Assignment 0 x (FuncCallOrArray u [] [(() 1 () 0)] [] [] [] ) () )] [(Assignment 0 x (FuncCallOrArray u [] [(() 2 () 0)] [] [] [] ) () )] () () () ) (Assignment 0 first (not first) () )] [] [] ) (Subroutine randn_vector_n [(n) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () [(SubroutineCall 0 randn [] [(() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () )] () () )] [] [] ) (Subroutine randn_vector [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 randn_vector_n [] [(() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine randn_matrix [(x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 randn_vector_n [] [(() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma0 [(a) (first) (fn_val)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the gamma distribution." ) (Comment "!" ) (Comment "! The shape parameter a >= 1." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Tsang, W. W. (2000). A Simple Method for Generating" ) (Comment "! Gamma Variables. ACM Transactions on Mathematical Software (TOMS), 26(3)," ) (Comment "! 363-372." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(AttrIntent In )] [(first [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(fn_val [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(U [] [] () () None ()) (v [] [] () () None ()) (x [] [] () () None ())] () )] [(If 0 () (< a 1) [(SubroutineCall 0 stop_error [] [(() (String "Shape parameter must be >= 1" ()) () 0)] [] [] () )] [] () () () ) (If 0 () first [(Assignment 0 d (- a (/ (Real "1._dp") 3)) () ) (Assignment 0 c (/ 1 (FuncCallOrArray sqrt [] [(() (* 9 d) () 0)] [] [] [] )) () )] [] () () () ) (DoLoop 0 () 0 () () () () [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 randn [] [(() x () 0)] [] [] () ) (Assignment 0 v (** (+ 1 (* c x)) 3) () ) (If 0 () (> v 0) [(Exit 0 () () )] [] () () () )] () () ) (SubroutineCall 0 random_number [] [(() U () 0)] [] [] (TriviaNode [] [(EndOfLine) (Comment "! Note: the number 0.0331 below is exact, see [1]." )] ) ) (If 0 () (< U (- 1 (* (Real "0.0331_dp") (** x 4)))) [(Assignment 0 fn_val (* d v) () ) (Exit 0 () () )] [(If 0 () (< (FuncCallOrArray log [] [(() U () 0)] [] [] [] ) (+ (/ (** x 2) 2) (* d (+ (- 1 v) (FuncCallOrArray log [] [(() v () 0)] [] [] [] ))))) [(Assignment 0 fn_val (* d v) () ) (Exit 0 () () )] [] () () () )] () () () )] () () )] [] [] ) (Subroutine rand_gamma_scalar [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true.) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma_vector_n [(a) (n) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(1 n DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true.) () 0) (() (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) () 0)] [] [] () ) (DoLoop 0 () 0 i 2 (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () [(SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .false.) () 0) (() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () )] () () )] [] [] ) (Subroutine rand_gamma_vector [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] ) (Subroutine rand_gamma_matrix [(a) (x)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () )] [(SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_05-d584fab.stderr0000664000175000017500000000045515141516316030252 0ustar alastairalastairruntime error: Array shape mismatch in subroutine 'my'. Tried to match size 3 of dimension 1 of argument number 1, but expected size is 5 --> tests/errors/array_bounds_check_05.f90:7:13 | 7 | call my(x, 5) | ^ | 7 | call my(x, 5) | ~ Expected range 1:5, got 3 lfortran-lfortran-2f73434/tests/reference/cpp-arrays_01-4fac8c3.stdout0000664000175000017500000000715215141516316025716 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32_3_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_3_1(Kokkos::View* data_): data{data_} {}; }; struct i32_4_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_4_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { } // Implementations namespace { void main2() { Kokkos::View a_data("a_data", 3); i32_3_1 a_value(&a_data); i32_3_1* a = &a_value; a->dims[0].lower_bound = 1; a->dims[0].length = 3; Kokkos::View b_data("b_data", 4); i32_4_1 b_value(&b_data); i32_4_1* b = &b_value; b->dims[0].lower_bound = 1; b->dims[0].length = 4; int32_t i; for (i=1; i<=3; i++) { a->data->operator[](i - a->dims[0].lower_bound) = i + 10; } if (a->data->operator[](1 - a->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (a->data->operator[](2 - a->dims[0].lower_bound) != 12) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (a->data->operator[](3 - a->dims[0].lower_bound) != 13) { std::cerr << "ERROR STOP" << std::endl; exit(1); } for (i=11; i<=14; i++) { b->data->operator[](i - 10 - b->dims[0].lower_bound) = i; } if (b->data->operator[](1 - b->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](2 - b->dims[0].lower_bound) != 12) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](3 - b->dims[0].lower_bound) != 13) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](4 - b->dims[0].lower_bound) != 14) { std::cerr << "ERROR STOP" << std::endl; exit(1); } for (i=1; i<=3; i++) { b->data->operator[](i - b->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) - 10; } if (b->data->operator[](1 - b->dims[0].lower_bound) != 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](2 - b->dims[0].lower_bound) != 2) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (b->data->operator[](3 - b->dims[0].lower_bound) != 3) { std::cerr << "ERROR STOP" << std::endl; exit(1); } b->data->operator[](4 - b->dims[0].lower_bound) = b->data->operator[](1 - b->dims[0].lower_bound) + b->data->operator[](2 - b->dims[0].lower_bound) + b->data->operator[](3 - b->dims[0].lower_bound) + a->data->operator[](1 - a->dims[0].lower_bound); if (b->data->operator[](4 - b->dims[0].lower_bound) != 17) { std::cerr << "ERROR STOP" << std::endl; exit(1); } b->data->operator[](4 - b->dims[0].lower_bound) = a->data->operator[](1 - a->dims[0].lower_bound); if (b->data->operator[](4 - b->dims[0].lower_bound) != 11) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/ast_f90-namelist_01-a0d2302.json0000664000175000017500000000076615141516316026167 0ustar alastairalastair{ "basename": "ast_f90-namelist_01-a0d2302", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/namelist_01.f90", "infile_hash": "82b81ebf89597c4cee2bae25cbe602a58d7d628cf9dec14337630861", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-namelist_01-a0d2302.stdout", "stdout_hash": "8296480953775e34afb70a88ee0b8d0244707eba18ad4f86d1c4c1d6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-intent_01-fd00f62.stdout0000664000175000017500000000747515141516316025647 0ustar alastairalastair(TranslationUnit [(Module dflt_intent (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Subroutine foo [(c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ()) (d [] [] () () None ()) (e [] [] () () None ()) (g [] [] () () None ())] () )] [(Assignment 0 e (FuncCallOrArray f [] [(() c () 0)] [] [] [] ) () ) (Assignment 0 g (FuncCallOrArray f [] [(() d () 0)] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Function f [(x)] [(AttrType TypeReal [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ())] () )] [(Assignment 0 f (* 2 x) () ) (Print 0 () [f] () )] [] [] )] [] )] ) (Program main () [(Use [] dflt_intent [] .false. () )] [] [] [(SubroutineCall 0 foo [] [(() (Real "0.0") () 0) (() (Real "2.0") () 0)] [] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-bits_02-e48c6d3.stdout0000664000175000017500000001432415141516316025306 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_02: (Program (SymbolTable 2 { all_ones: (Variable 2 all_ones [all_zeros] Local (IntrinsicElementalFunction Not [(Var 2 all_zeros)] 0 (Integer 8) (IntegerConstant -1 (Integer 8) Decimal) ) (IntegerConstant -1 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), all_zeros: (Variable 2 all_zeros [] Local (IntegerConstant 0 (Integer 8) Decimal) (IntegerConstant 0 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), bits_kind: (ExternalSymbol 2 bits_kind 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), block_kind: (ExternalSymbol 2 block_kind 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ), block_size: (Variable 2 block_size [] Local (Cast (TypeInquiry BitSize (Integer 8) (IntegerConstant 0 (Integer 8) Decimal) (Integer 8) (IntegerConstant 64 (Integer 8) Decimal) ) IntegerToInteger (Integer 4) (IntegerConstant 64 (Integer 4) Decimal) ) (IntegerConstant 64 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bits_02 [iso_fortran_env] [(Print (StringFormat () [(Var 2 block_size)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 all_zeros)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 all_ones)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-array8-7572270.json0000664000175000017500000000070715141516316024460 0ustar alastairalastair{ "basename": "ast-array8-7572270", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array8.f90", "infile_hash": "fee5e1c1b4525cfa5f4eb3102cbdfdb2959403009df4a8920e8d1347", "outfile": null, "outfile_hash": null, "stdout": "ast-array8-7572270.stdout", "stdout_hash": "c194d2a98f4a161d6c2c20c83490fc8166bceccb5ab4f439fa5cdf8a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface_01-587eedf.json0000664000175000017500000000075615141516316026030 0ustar alastairalastair{ "basename": "ast-interface_01-587eedf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_01-587eedf.stdout", "stdout_hash": "2ffc8cf3e1c71c2bdd5857a3526d2e43d601c1633c0de8678ba7a5ed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine4-e2840c9.json0000664000175000017500000000071115141516316025664 0ustar alastairalastair{ "basename": "cpp-subroutine4-e2840c9", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine4-e2840c9.stdout", "stdout_hash": "6d5772b55884ee2a29331dc0be5f811a0a104070ba91471ca1670aa2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_05-00beea9.stdout0000664000175000017500000003076515141516316025706 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_05: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_05_a [] b Public ) }) nested_05 [nested_05_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_05_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 x) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 y) (RealConstant 3.500000 (Real 4) ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 y) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 3 c () [] () .false. ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) nested_05_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-file_open_06-cc72219.stdout0000664000175000017500000000001315141516316026230 0ustar alastairalastair +1.0 PASS lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_call2-28c0b82.stdout0000664000175000017500000001766015141516316027161 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_frm: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), prinf: (Function (SymbolTable 3 { prinf_arg_0: (Variable 3 prinf_arg_0 [] Unspecified () () Default (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) () BindC Public Required .false. .false. .false. () .false. .false. ), prinf_arg_1: (Variable 3 prinf_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) prinf (FunctionType [(String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1)] [] () Public .false. .false. () ) }) idd_frm (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 m)] [(Assignment (Var 2 a) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (SubroutineCall 2 prinf () [((StringConstant "lw = *" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (Assignment (Var 2 m) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_34-c5cfc20.stdout0000664000175000017500000003443515141516316026611 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_34: (Program (SymbolTable 2 { dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 3.143000 (Real 4) ) (RealConstant 3.143000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (Cast (RealConstant 2.330000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.330000 (Real 8) ) ) (RealConstant 2.330000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_34 [] [(Print (StringFormat () [(TypeInquiry Epsilon (Real 4) (Var 2 x) (Real 4) (RealConstant 0.000000 (Real 4) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(TypeInquiry Epsilon (Real 8) (Var 2 y) (Real 8) (RealConstant 0.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(RealBinOp (TypeInquiry Epsilon (Real 8) (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Pow (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (TypeInquiry Epsilon (Real 4) (Var 2 x) (Real 4) (RealConstant 0.000000 (Real 4) ) ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (TypeInquiry Epsilon (Real 8) (Var 2 y) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Sub (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 0.000000 (Real 8) ) ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (TypeInquiry Epsilon (Real 8) (RealConstant 1.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Pow (RealConstant 0.500000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) ) Sub (RealConstant 0.000000 (Real 8) ) (Real 8) (RealConstant 0.000000 (Real 8) ) )] 0 (Real 8) (RealConstant 0.000000 (Real 8) ) ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-case_06-3550f46.json0000664000175000017500000000073015141516316025062 0ustar alastairalastair{ "basename": "julia-case_06-3550f46", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "julia-case_06-3550f46.stdout", "stdout_hash": "9e8bf3e13ad760e57b03f3633c68d025586c89ee46283869c692b604", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-modules_04-e9ab16a.json0000664000175000017500000000076315141516316026200 0ustar alastairalastair{ "basename": "ast_f90-modules_04-e9ab16a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/modules_04.f90", "infile_hash": "b04f80d4de5baea50808e962f08564088751c24a464b3d1d7c0c316f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-modules_04-e9ab16a.stdout", "stdout_hash": "1b6c92c555140732bc7b56428c1086bb0205deed13c32d4f3c7faf80", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_31-cd9bfef.stdout0000664000175000017500000021315215141516316026241 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_cmd_update_modules_31: (Module (SymbolTable 4 { 1_dependency_config_t: (ExternalSymbol 4 1_dependency_config_t 9 dependency_config_t fpm_dependency_modules_31 [] dependency_config_t Public ), cmd_update: (Function (SymbolTable 7 { 1_dependency_config_t_name: (ExternalSymbol 7 1_dependency_config_t_name 10 name 1_dependency_config_t [] name Public ), 1_dependency_tree_t_dep: (ExternalSymbol 7 1_dependency_tree_t_dep 12 dep dependency_tree_t [] dep Public ), 1_dependency_tree_t_update_dependency: (ExternalSymbol 7 1_dependency_tree_t_update_dependency 12 update_dependency dependency_tree_t [] update_dependency Public ), 1_update: (ExternalSymbol 7 1_update 12 update dependency_tree_t [] update Private ), deps: (Variable 7 deps [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) 4 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ), error: (Variable 7 error [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. ), ii: (Variable 7 ii [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), settings: (Variable 7 settings [] In () () Default (StructType [(Logical 4) (Logical 4) (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) )] [] .true. .false. ) 4 fpm_update_settings Source Public Required .false. .false. .false. () .false. .false. ) }) cmd_update (FunctionType [(StructType [(Logical 4) (Logical 4) (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 settings)] [(SubroutineCall 7 1_dependency_tree_t_update_dependency 7 1_update [((StructInstanceMember (ArrayItem (StructInstanceMember (Var 7 deps) 7 1_dependency_tree_t_dep (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 7 ii) ())] (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) ColMajor () ) 7 1_dependency_config_t_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () )) ((Var 7 error))] (Var 7 deps) .false. )] () Public .false. .false. () ), dependency_tree_t: (ExternalSymbol 4 dependency_tree_t 9 dependency_tree_t fpm_dependency_modules_31 [] dependency_tree_t Public ), error_t: (ExternalSymbol 4 error_t 9 error_t fpm_dependency_modules_31 [] error_t Public ), fpm_cmd_settings: (Struct (SymbolTable 5 { verbose: (Variable 5 verbose [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), working_dir: (Variable 5 working_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_cmd_settings (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [working_dir verbose] [] Source Public .false. .true. [] () () ), fpm_update_settings: (Struct (SymbolTable 6 { clean: (Variable 6 clean [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), fetch_only: (Variable 6 fetch_only [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 6 name [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_update_settings (StructType [(Logical 4) (Logical 4) (Allocatable (Array (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [name fetch_only clean] [] Source Public .false. .false. [] () 4 fpm_cmd_settings ) }) fpm_cmd_update_modules_31 () [fpm_dependency_modules_31] .true. .false. .false. ), fpm_dependency_modules_31: (Module (SymbolTable 9 { dependency_config_t: (Struct (SymbolTable 10 { name: (Variable 10 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 10 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path] [] Source Public .false. .false. [] () () ), dependency_node_t: (Struct (SymbolTable 11 { done: (Variable 11 done [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), proj_dir: (Variable 11 proj_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), revision: (Variable 11 revision [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), update: (Variable 11 update [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_node_t (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [] [proj_dir revision done update] [] Source Public .false. .false. [] () 9 dependency_config_t ), dependency_tree_t: (Struct (SymbolTable 12 { cache: (Variable 12 cache [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), dep: (Variable 12 dep [] Local () () Default (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 9 dependency_node_t Source Public Required .false. .false. .false. () .false. .false. ), dep_dir: (Variable 12 dep_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), ndep: (Variable 12 ndep [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 12 unit [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), update: (GenericProcedure 12 update [12 update_dependency] Public ), update_dependency: (StructMethodDeclaration 12 update_dependency () update_dependency 9 update_dependency Source .false. .false. ), verbosity: (Variable 12 verbosity [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_tree_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [unit verbosity dep_dir ndep dep cache] [] Source Public .false. .false. [] () () ), error_t: (Struct (SymbolTable 13 { message: (Variable 13 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () ), update_dependency: (Function (SymbolTable 14 { error: (Variable 14 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 9 error_t Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 14 name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 14 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 9 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ) }) update_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 self) (Var 14 name) (Var 14 error)] [] () Public .false. .false. () ) }) fpm_dependency_modules_31 () [] .true. .false. .false. ), modules_31: (Program (SymbolTable 2 { 1_dependency_config_t: (ExternalSymbol 2 1_dependency_config_t 9 dependency_config_t fpm_dependency_modules_31 [] dependency_config_t Public ), cmd_update: (ExternalSymbol 2 cmd_update 4 cmd_update fpm_cmd_update_modules_31 [] cmd_update Public ), dependency_tree_t: (ExternalSymbol 2 dependency_tree_t 9 dependency_tree_t fpm_dependency_modules_31 [] dependency_tree_t Public ), error_t: (ExternalSymbol 2 error_t 9 error_t fpm_dependency_modules_31 [] error_t Public ), fpm_cmd_settings: (ExternalSymbol 2 fpm_cmd_settings 4 fpm_cmd_settings fpm_cmd_update_modules_31 [] fpm_cmd_settings Public ), fpm_update_settings: (ExternalSymbol 2 fpm_update_settings 4 fpm_update_settings fpm_cmd_update_modules_31 [] fpm_update_settings Public ) }) modules_31 [fpm_cmd_update_modules_31] [(Print (StringConstant "running modules_31 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-case_02-a38c2d8.json0000664000175000017500000000074215141516316025067 0ustar alastairalastair{ "basename": "llvm-case_02-a38c2d8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "llvm-case_02-a38c2d8.stdout", "stdout_hash": "5c2d625b697a6c95c237bb7e1ce15f0917bba1460db2f832e38967a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-block_data1-d563f39.stdout0000664000175000017500000000600115141516316026126 0ustar alastairalastair(TranslationUnit [(BlockData init (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration () [(AttrCommon [(range [(x0 [] [] () x0 None ()) (x1 [] [] () x1 None ())])] )] [] () )] [(DataStmt 0 [(DataStmtSet [x0 x1] [1 10] )] () )] ) (Program block_data1 () [] [(Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec a z )] )] () )] [(Declaration () [(AttrCommon [(range [(x0 [] [] () x0 None ()) (x1 [] [] () x1 None ())])] )] [] () )] [(Print 0 () [(String "Printing Even number in the Range: " ()) x0 (String " to " ()) x1] () ) (DoLoop 0 () 0 i x0 x1 () [(If 0 () (/= (FuncCallOrArray mod [] [(() i () 0) (() 2 () 0)] [] [] [] ) 0) [(Cycle 0 () () )] [] () () () ) (Write 0 [(()) (())] [] [i] () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_05-f939cc6.json0000664000175000017500000000072315141516316025453 0ustar alastairalastair{ "basename": "asr-modules_05-f939cc6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_05.f90", "infile_hash": "e9f1e3a9e80949247e90dc618aff63fe80d5cc91017f860a752efaff", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_05-f939cc6.stdout", "stdout_hash": "b3b557e60d5a592ba43570896ddb231f23bbb732f1e05650f7b04dee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_sort_02-0aa4518.stdout0000664000175000017500000101721015141516316027130 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_sort_02: (Program (SymbolTable 16 { lt_integer: (ExternalSymbol 16 lt_integer 5 lt_integer template_sort_02_m [] lt_integer Public ), lt_my_type: (ExternalSymbol 16 lt_my_type 2 lt_my_type template_sort_02_type [] lt_my_type Public ), lt_real: (ExternalSymbol 16 lt_real 5 lt_real template_sort_02_m [] lt_real Public ), my_type: (ExternalSymbol 16 my_type 2 my_type template_sort_02_type [] my_type Public ), op_r: (ExternalSymbol 16 op_r 5 op_r template_sort_02_m [] op_r Public ), quicksort: (ExternalSymbol 16 quicksort 5 quicksort template_sort_02_m [] quicksort Public ), swap: (ExternalSymbol 16 swap 5 swap template_sort_02_m [] swap Public ), test_template: (ExternalSymbol 16 test_template 5 test_template template_sort_02_m [] test_template Public ) }) template_sort_02 [template_sort_02_m] [(SubroutineCall 16 test_template () [] () .false. )] ), template_sort_02_m: (Module (SymbolTable 5 { lt_integer: (Function (SymbolTable 14 { lhs: (Variable 14 lhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 14 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 14 rhs [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) lt_integer (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 14 lhs) (Var 14 rhs)] [(Assignment (Var 14 res) (IntegerCompare (Var 14 lhs) Lt (Var 14 rhs) (Logical 4) () ) () .false. .false. )] (Var 14 res) Public .false. .false. () ), lt_my_type: (ExternalSymbol 5 lt_my_type 2 lt_my_type template_sort_02_type [] lt_my_type Public ), lt_real: (Function (SymbolTable 13 { lhs: (Variable 13 lhs [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 13 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 13 rhs [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) lt_real (FunctionType [(Real 4) (Real 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 lhs) (Var 13 rhs)] [(Assignment (Var 13 res) (RealCompare (Var 13 lhs) Lt (Var 13 rhs) (Logical 4) () ) () .false. .false. )] (Var 13 res) Public .false. .false. () ), my_type: (ExternalSymbol 5 my_type 2 my_type template_sort_02_type [] my_type Public ), op_r: (Requirement (SymbolTable 6 { op_func: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 7 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op_func (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 lhs) (Var 7 rhs)] [] (Var 7 res) Public .false. .false. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 6 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 6 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op_r [t u v op_func] [] ), quicksort: (Template (SymbolTable 10 { __instantiated_swap: (Function (SymbolTable 17 { lhs: (Variable 17 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 17 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 17 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 17 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 lhs) (Var 17 rhs)] [(Assignment (Var 17 tmp) (Var 17 lhs) () .false. .false. ) (Assignment (Var 17 lhs) (Var 17 rhs) () .false. .false. ) (Assignment (Var 17 rhs) (Var 17 tmp) () .false. .false. )] () Public .false. .false. () ), __instantiated_swap1: (Function (SymbolTable 18 { lhs: (Variable 18 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 18 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 18 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_swap1 (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 lhs) (Var 18 rhs)] [(Assignment (Var 18 tmp) (Var 18 lhs) () .false. .false. ) (Assignment (Var 18 lhs) (Var 18 rhs) () .false. .false. ) (Assignment (Var 18 rhs) (Var 18 tmp) () .false. .false. )] () Public .false. .false. () ), logical: (Variable 10 logical [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), lt: (Function (SymbolTable 11 { lhs: (Variable 11 lhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 11 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 11 rhs [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) lt (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 11 lhs) (Var 11 rhs)] [] (Var 11 res) Public .false. .false. () ), quicksort: (Function (SymbolTable 12 { arr: (Variable 12 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), high: (Variable 12 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 12 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 12 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pivot: (Variable 12 pivot [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) quicksort (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt __instantiated_swap __instantiated_swap1 quicksort] [(Var 12 arr) (Var 12 low) (Var 12 high)] [(If () (IntegerCompare (Var 12 low) Lt (Var 12 high) (Logical 4) () ) [(Assignment (Var 12 pivot) (ArrayItem (Var 12 arr) [(() (Var 12 high) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (Assignment (Var 12 last) (IntegerBinOp (Var 12 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 12 i) (Var 12 low) (IntegerBinOp (Var 12 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 10 lt () [((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () )) ((Var 12 pivot))] (Logical 4) () () ) [(Assignment (Var 12 last) (IntegerBinOp (Var 12 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 10 __instantiated_swap () [((ArrayItem (Var 12 arr) [(() (Var 12 last) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 12 arr) [(() (Var 12 i) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 10 __instantiated_swap1 () [((ArrayItem (Var 12 arr) [(() (IntegerBinOp (Var 12 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 12 arr) [(() (Var 12 high) ())] (TypeParameter t ) ColMajor () ))] () .false. ) (SubroutineCall 10 quicksort () [((ArrayPhysicalCast (Var 12 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((Var 12 low)) ((Var 12 last))] () .false. ) (SubroutineCall 10 quicksort () [((ArrayPhysicalCast (Var 12 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 12 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 12 high))] () .false. )] [] )] () Public .false. .false. () ), t: (Variable 10 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) quicksort [t lt] [(Require op_r [t logical lt] )] ), swap: (Template (SymbolTable 8 { swap: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 9 rhs [] InOut () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 9 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 9 tmp [] Local () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 lhs) (Var 9 rhs)] [(Assignment (Var 9 tmp) (Var 9 lhs) () .false. .false. ) (Assignment (Var 9 lhs) (Var 9 rhs) () .false. .false. ) (Assignment (Var 9 rhs) (Var 9 tmp) () .false. .false. )] () Public .false. .false. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ) }) swap [t] [] ), test_template: (Function (SymbolTable 15 { __asr___instantiated_swap: (Function (SymbolTable 20 { lhs: (Variable 20 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 20 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 20 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 20 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 lhs) (Var 20 rhs)] [(Assignment (Var 20 tmp) (Var 20 lhs) () .false. .false. ) (Assignment (Var 20 lhs) (Var 20 rhs) () .false. .false. ) (Assignment (Var 20 rhs) (Var 20 tmp) () .false. .false. )] () Public .false. .false. () ), __asr___instantiated_swap1: (Function (SymbolTable 21 { lhs: (Variable 21 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 21 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 21 t [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 21 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap1 (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 lhs) (Var 21 rhs)] [(Assignment (Var 21 tmp) (Var 21 lhs) () .false. .false. ) (Assignment (Var 21 lhs) (Var 21 rhs) () .false. .false. ) (Assignment (Var 21 rhs) (Var 21 tmp) () .false. .false. )] () Public .false. .false. () ), __asr___instantiated_swap11: (Function (SymbolTable 24 { lhs: (Variable 24 lhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 24 rhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 24 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 24 tmp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap11 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 lhs) (Var 24 rhs)] [(Assignment (Var 24 tmp) (Var 24 lhs) () .false. .false. ) (Assignment (Var 24 lhs) (Var 24 rhs) () .false. .false. ) (Assignment (Var 24 rhs) (Var 24 tmp) () .false. .false. )] () Public .false. .false. () ), __asr___instantiated_swap12: (Function (SymbolTable 27 { lhs: (Variable 27 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 27 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 27 t [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 27 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap12 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 27 lhs) (Var 27 rhs)] [(Assignment (Var 27 tmp) (Var 27 lhs) () .false. .false. ) (Assignment (Var 27 lhs) (Var 27 rhs) () .false. .false. ) (Assignment (Var 27 rhs) (Var 27 tmp) () .false. .false. )] () Public .false. .false. () ), __asr___instantiated_swap2: (Function (SymbolTable 23 { lhs: (Variable 23 lhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 23 rhs [] InOut () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 23 t [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 23 tmp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap2 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 lhs) (Var 23 rhs)] [(Assignment (Var 23 tmp) (Var 23 lhs) () .false. .false. ) (Assignment (Var 23 lhs) (Var 23 rhs) () .false. .false. ) (Assignment (Var 23 rhs) (Var 23 tmp) () .false. .false. )] () Public .false. .false. () ), __asr___instantiated_swap3: (Function (SymbolTable 26 { lhs: (Variable 26 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 26 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), t: (Variable 26 t [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 26 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) __asr___instantiated_swap3 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 lhs) (Var 26 rhs)] [(Assignment (Var 26 tmp) (Var 26 lhs) () .false. .false. ) (Assignment (Var 26 lhs) (Var 26 rhs) () .false. .false. ) (Assignment (Var 26 rhs) (Var 26 tmp) () .false. .false. )] () Public .false. .false. () ), __instantiated_quicksort: (Function (SymbolTable 19 { arr: (Variable 19 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), high: (Variable 19 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 19 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 19 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 19 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pivot: (Variable 19 pivot [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_quicksort (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_integer __asr___instantiated_swap __asr___instantiated_swap1 __instantiated_quicksort] [(Var 19 arr) (Var 19 low) (Var 19 high)] [(If () (IntegerCompare (Var 19 low) Lt (Var 19 high) (Logical 4) () ) [(Assignment (Var 19 pivot) (ArrayItem (Var 19 arr) [(() (Var 19 high) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 19 last) (IntegerBinOp (Var 19 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 19 i) (Var 19 low) (IntegerBinOp (Var 19 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_integer () [((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () )) ((Var 19 pivot))] (Logical 4) () () ) [(Assignment (Var 19 last) (IntegerBinOp (Var 19 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap () [((ArrayItem (Var 19 arr) [(() (Var 19 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 19 arr) [(() (Var 19 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap1 () [((ArrayItem (Var 19 arr) [(() (IntegerBinOp (Var 19 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 19 arr) [(() (Var 19 high) ())] (Integer 4) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 19 low)) ((Var 19 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 19 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 19 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 19 high))] () .false. )] [] )] () Public .false. .false. () ), __instantiated_quicksort1: (Function (SymbolTable 22 { arr: (Variable 22 arr [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), high: (Variable 22 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 22 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 22 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 22 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pivot: (Variable 22 pivot [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_quicksort1 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_real __asr___instantiated_swap2 __asr___instantiated_swap11 __instantiated_quicksort1] [(Var 22 arr) (Var 22 low) (Var 22 high)] [(If () (IntegerCompare (Var 22 low) Lt (Var 22 high) (Logical 4) () ) [(Assignment (Var 22 pivot) (ArrayItem (Var 22 arr) [(() (Var 22 high) ())] (Real 4) ColMajor () ) () .false. .false. ) (Assignment (Var 22 last) (IntegerBinOp (Var 22 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 22 i) (Var 22 low) (IntegerBinOp (Var 22 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_real () [((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (Real 4) ColMajor () )) ((Var 22 pivot))] (Logical 4) () () ) [(Assignment (Var 22 last) (IntegerBinOp (Var 22 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap2 () [((ArrayItem (Var 22 arr) [(() (Var 22 last) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 22 arr) [(() (Var 22 i) ())] (Real 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap11 () [((ArrayItem (Var 22 arr) [(() (IntegerBinOp (Var 22 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 22 arr) [(() (Var 22 high) ())] (Real 4) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 22 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((Var 22 low)) ((Var 22 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 22 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 22 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 22 high))] () .false. )] [] )] () Public .false. .false. () ), __instantiated_quicksort2: (Function (SymbolTable 25 { arr: (Variable 25 arr [] InOut () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), high: (Variable 25 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 25 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 25 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 25 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pivot: (Variable 25 pivot [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) __instantiated_quicksort2 (FunctionType [(Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr___instantiated_swap3 __asr___instantiated_swap12 __instantiated_quicksort2] [(Var 25 arr) (Var 25 low) (Var 25 high)] [(If () (IntegerCompare (Var 25 low) Lt (Var 25 high) (Logical 4) () ) [(Assignment (Var 25 pivot) (ArrayItem (Var 25 arr) [(() (Var 25 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) () .false. .false. ) (Assignment (Var 25 last) (IntegerBinOp (Var 25 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 25 i) (Var 25 low) (IntegerBinOp (Var 25 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_my_type () [((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((Var 25 pivot))] (Logical 4) () () ) [(Assignment (Var 25 last) (IntegerBinOp (Var 25 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 15 __asr___instantiated_swap3 () [((ArrayItem (Var 25 arr) [(() (Var 25 last) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 25 arr) [(() (Var 25 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 15 __asr___instantiated_swap12 () [((ArrayItem (Var 25 arr) [(() (IntegerBinOp (Var 25 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 25 arr) [(() (Var 25 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 25 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((Var 25 low)) ((Var 25 last))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 25 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 25 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 25 high))] () .false. )] [] )] () Public .false. .false. () ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), xi: (Variable 15 xi [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), xm: (Variable 15 xm [] Local () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) 5 my_type Source Public Required .false. .false. .false. () .false. .false. ), xr: (Variable 15 xr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 15 xi) (ArrayConstant 40 [2, 4, 1, ...., 3, 42, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 15 xr) (ArrayConstant 40 [2.00000000e+00, 4.00000000e+00, 1.00000000e+00, ...., 3.00000000e+00, 4.20000000e+01, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (DoLoop () ((Var 15 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 15 xm) [(() (Var 15 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) (StructConstructor 5 my_type [((ArrayItem (Var 15 xr) [(() (Var 15 i) ())] (Real 4) ColMajor () ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. )] [] ) (SubroutineCall 15 __instantiated_quicksort () [((ArrayPhysicalCast (Var 15 xi) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 15 __instantiated_quicksort1 () [((ArrayPhysicalCast (Var 15 xr) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 15 __instantiated_quicksort2 () [((ArrayPhysicalCast (Var 15 xm) FixedSizeArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (Print (StringFormat () [(Var 15 xi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 15 xr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 15 xm)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_sort_02_m () [template_sort_02_type template_sort_02_m] .false. .false. .false. ), template_sort_02_type: (Module (SymbolTable 2 { lt_my_type: (Function (SymbolTable 4 { 1_my_type_d: (ExternalSymbol 4 1_my_type_d 3 d my_type [] d Public ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) lt_my_type (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (Var 4 res) (RealCompare (StructInstanceMember (Var 4 lhs) 4 1_my_type_d (Real 4) () ) LtE (StructInstanceMember (Var 4 rhs) 4 1_my_type_d (Real 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 res) Public .false. .false. () ), my_type: (Struct (SymbolTable 3 { d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_type (StructType [(Real 4)] [] .true. .false. ) [] [d] [] Source Public .false. .false. [] () () ) }) template_sort_02_type () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-recursion_02-76da7b3.stdout0000664000175000017500000002761215141516316026544 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__sub1__x = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"S-DESC-7,I4\00", align 1 @string_const_data = private constant [7 x i8] c"before:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data, i32 0, i32 0), i64 7 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [12 x i8] c"S-DESC-6,I4\00", align 1 @string_const_data.2 = private constant [6 x i8] c"after:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.2, i32 0, i32 0), i64 6 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [12 x i8] c"S-DESC-9,I4\00", align 1 @string_const_data.5 = private constant [9 x i8] c"x in getx" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([9 x i8], [9 x i8]* @string_const_data.5, i32 0, i32 0), i64 9 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [7 x i8] c"in sub1" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.7, i32 0, i32 0), i64 7 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [12 x i8] c"S-DESC-3,I4\00", align 1 @string_const_data.10 = private constant [3 x i8] c"r =" @string_const.11 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.10, i32 0, i32 0), i64 3 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_recursion_02_solver(i32 ()* %f, i32* %iter) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %f_val = alloca i32, align 4 %solver = alloca i32, align 4 %0 = call i32 %f() store i32 %0, i32* %f_val, align 4 %1 = alloca i64, align 8 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %1, i32 0, i32 0, %string_descriptor* @string_const, i32* %f_val) %3 = load i64, i64* %1, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i32 2, i32* %call_arg_value, align 4 %12 = load i32, i32* %iter, align 4 %13 = sub i32 %12, 1 store i32 %13, i32* %call_arg_value1, align 4 %14 = call i32 @__module_recursion_02_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %14, i32* %solver, align 4 %15 = call i32 %f() store i32 %15, i32* %f_val, align 4 %16 = alloca i64, align 8 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %f_val) %18 = load i64, i64* %16, align 4 %stringFormat_desc2 = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %free_done call void @_lfortran_free(i8* %17) br label %free_done4 free_done4: ; preds = %free_nonnull3, %free_done br label %return return: ; preds = %free_done4 br label %FINALIZE_SYMTABLE_solver FINALIZE_SYMTABLE_solver: ; preds = %return %27 = load i32, i32* %solver, align 4 ret i32 %27 } declare i32 @f() define i32 @__module_recursion_02_sub1(i32* %y, i32* %iter) { .entry: %sub1 = alloca i32, align 4 %tmp = alloca i32, align 4 %x = alloca i32, align 4 %0 = load i32, i32* %y, align 4 store i32 %0, i32* %x, align 4 %1 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %1, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %2 = load i32, i32* %iter, align 4 %3 = icmp eq i32 %2, 1 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 1, i32* %sub1, align 4 br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i32, i32* %x, align 4 store i32 %4, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %5 = call i32 @sub1.__module_recursion_02_getx() store i32 %5, i32* %tmp, align 4 %6 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %6, i32* %x, align 4 %7 = load i32, i32* %x, align 4 store i32 %7, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 %8 = call i32 @__module_recursion_02_solver(i32 ()* @sub1.__module_recursion_02_getx, i32* %iter) store i32 %8, i32* %sub1, align 4 %9 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %9, i32* %x, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_sub1 FINALIZE_SYMTABLE_sub1: ; preds = %return %10 = load i32, i32* %sub1, align 4 ret i32 %10 } define i32 @sub1.__module_recursion_02_getx() { .entry: %getx = alloca i32, align 4 %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.4, i32 0, i32 0), i64* %0, i32 0, i32 0, %string_descriptor* @string_const.6, i32* @__module___lcompilers_created__nested_context__sub1__x) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry %11 = load i32, i32* @__module___lcompilers_created__nested_context__sub1__x, align 4 store i32 %11, i32* %getx, align 4 br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_getx FINALIZE_SYMTABLE_getx: ; preds = %return %12 = load i32, i32* %getx, align 4 ret i32 %12 } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca i32, align 4 store i32 3, i32* %call_arg_value, align 4 store i32 3, i32* %call_arg_value1, align 4 %2 = call i32 @__module_recursion_02_sub1(i32* %call_arg_value, i32* %call_arg_value1) store i32 %2, i32* %r, align 4 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.9, i32 0, i32 0), i64* %3, i32 0, i32 0, %string_descriptor* @string_const.11, i32* %r) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-where1-c237415.stdout0000664000175000017500000001264415141516316025074 0ustar alastairalastair(TranslationUnit [(Program test () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [(1 2 DimensionExpr) (1 2 DimensionExpr)] [] () (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [1 2 3 4] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] ) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Where 0 () (== x 1) [(Assignment 0 x 2 () )] [(Where 0 () (== x 2) [(Assignment 0 x 3 () )] [(Assignment 0 x (* x 2) () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (FuncCallOrArray all [] [(() (== x (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [2 3 6 8] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] )) () 0)] [] [] [] ) [(Print 0 () [(String "pass" ())] () )] [(Print 0 () [(String "fail" ())] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (== x 2) [(Assignment 0 x 3 () )] [(Where 0 () (== x 3) [(Assignment 0 x 4 () )] [(Where 0 () (== x 6) [(Assignment 0 x (* x 2) () )] [] () () )] () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (FuncCallOrArray all [] [(() (== x (FuncCallOrArray reshape [] [(() (ArrayInitializer () () [3 4 12 8] ) () 0) (() (ArrayInitializer () () [2 2] ) () 0)] [] [] [] )) () 0)] [] [] [] ) [(Print 0 () [(String "pass" ())] () )] [(Print 0 () [(String "fail" ())] () )] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules2-98d8120.stdout0000664000175000017500000010443115141516316025434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 8 { toml_ordered: (ExternalSymbol 8 toml_ordered 10 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 10 { destroy: (Function (SymbolTable 13 { self: (Variable 13 self [] InOut () () Default (StructType [] [] .false. .false. ) 10 toml_structure Source Public Required .false. .true. .false. () .false. .false. ), toml_value: (ExternalSymbol 13 toml_value 4 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 11 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 10 toml_structure ), toml_structure: (Struct (SymbolTable 12 { destroy: (StructMethodDeclaration 12 destroy () destroy 10 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type_array: (Module (SymbolTable 2 { destroy: (Function (SymbolTable 15 { 1_toml_array_list: (ExternalSymbol 15 1_toml_array_list 14 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 15 1_toml_structure 10 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 15 1_toml_structure_destroy 12 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 15 1_toml_value_key 5 key toml_value [] key Public ), self: (Variable 15 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 2 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 15 self) 15 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 15 self) 15 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 15 1_toml_structure_destroy () [] (StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 15 self) 15 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .false. .false. () ), new: (GenericProcedure 2 new [2 new_array] Public ), new_array: (Function (SymbolTable 16 { self: (Variable 16 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 2 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 self)] [] () Public .false. .false. () ), toml_array: (Struct (SymbolTable 14 { destroy: (StructMethodDeclaration 14 destroy () destroy 2 destroy Source .false. .false. ), list: (Variable 14 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 2 toml_ordered Source Public Required .false. .false. .false. () .false. .false. ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 2 toml_value ), toml_ordered: (ExternalSymbol 2 toml_ordered 10 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 2 toml_value 4 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .false. .false. .false. ), tomlf_type_value: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 4 toml_value Source Private Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .true. .false. ), key: (Variable 5 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine4-63e648f.stdout0000664000175000017500000000600715141516316026255 0ustar alastairalastair(TranslationUnit [(Subroutine triad [(a) (b) (scalar) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_34-f98f7e3.json0000664000175000017500000000075015141516316025462 0ustar alastairalastair{ "basename": "asr-modules_34-f98f7e3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_34.f90", "infile_hash": "345b669b534e06097d4a1202a471d3b9344402dc41e008388e6af962", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_34-f98f7e3.stdout", "stdout_hash": "d7ef06c934d5969e95dfbc8463056d92096e905773657db80432c3e8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-save_03-1103dd0.stdout0000664000175000017500000027654015141516316025212 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { save_03: (Program (SymbolTable 13 { i: (Variable 13 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 13 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 13 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 13 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 13 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 13 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 13 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_03 [] [] ), save_func: (Function (SymbolTable 6 { i: (Variable 6 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 6 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 6 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 6 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 6 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 6 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 6 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), save_func: (Variable 6 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 6 save_func) Public .false. .false. () ), save_module_03: (Module (SymbolTable 10 { i: (Variable 10 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 10 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 10 k [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 10 l [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), save_func_mod: (Function (SymbolTable 12 { i: (Variable 12 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 12 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 12 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 12 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 12 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 12 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 12 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), save_func_mod: (Variable 12 save_func_mod [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_func_mod (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 12 save_func_mod) Public .false. .false. () ), save_sub_mod: (Function (SymbolTable 11 { i: (Variable 11 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 11 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 11 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 11 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 11 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 11 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 11 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub_mod (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) save_module_03 () [] .false. .false. .false. ), save_nested_func: (Function (SymbolTable 7 { i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 7 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), save_func: (Function (SymbolTable 8 { k: (Variable 8 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 8 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 8 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 8 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 8 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), save_func: (Variable 8 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 8 save_func) Public .false. .false. () ), save_nested_func: (Variable 7 save_nested_func [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), save_sub: (Function (SymbolTable 9 { k: (Variable 9 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 9 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 9 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 9 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 9 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) save_nested_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 7 save_nested_func) Public .false. .false. () ), save_nested_sub: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), save_func: (Function (SymbolTable 5 { k: (Variable 5 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 5 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 5 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 5 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 5 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), save_func: (Variable 5 save_func [] ReturnVar () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_func (FunctionType [] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 5 save_func) Public .false. .false. () ), save_sub: (Function (SymbolTable 4 { k: (Variable 4 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 4 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 4 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 4 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 4 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) save_nested_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), save_sub: (Function (SymbolTable 2 { i: (Variable 2 i [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) save_sub (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_no_prescan-no_prescan_include1-40f0957.json0000664000175000017500000000102115141516316031443 0ustar alastairalastair{ "basename": "ast_no_prescan-no_prescan_include1-40f0957", "cmd": "lfortran --no-prescan --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include1.f90", "infile_hash": "075cc762767052e5ea227f825822032faad3fcaafa60bfbeb742a537", "outfile": null, "outfile_hash": null, "stdout": "ast_no_prescan-no_prescan_include1-40f0957.stdout", "stdout_hash": "b5fd0a7fe68ce6df58b2ab9113fa422959bdd40ae4b648b56a37a15c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-allocate_01-d7a2337.stderr0000664000175000017500000000010215141516316026027 0ustar alastairalastairruntime error: Attempting to allocate already allocated variable! lfortran-lfortran-2f73434/tests/reference/asr-modules_45-c69c75f.stdout0000664000175000017500000026230615141516316026037 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_45: (Program (SymbolTable 7 { compiler_name: (Variable 7 compiler_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flag: (ExternalSymbol 7 file_scope_flag 2 file_scope_flag modules_45_fpm_manifest_profile [] file_scope_flag Public ), get_flags: (ExternalSymbol 7 get_flags 2 get_flags modules_45_fpm_manifest_profile [] get_flags Public ), new_profile: (ExternalSymbol 7 new_profile 2 new_profile modules_45_fpm_manifest_profile [] new_profile Public ), os_type: (Variable 7 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), os_valid: (Variable 7 os_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_config_t: (ExternalSymbol 7 profile_config_t 2 profile_config_t modules_45_fpm_manifest_profile [] profile_config_t Public ), profile_name: (Variable 7 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), profiles: (Variable 7 profiles [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profindex: (Variable 7 profindex [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_45 [modules_45_fpm_manifest_profile] [(Allocate [((Var 7 profile_name) [] (IntegerConstant 40 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 7 compiler_name) [] (IntegerConstant 40 (Integer 4) Decimal) () ())] () () () ) (Allocate [((Var 7 profiles) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 7 get_flags () [((Var 7 profile_name)) ((Var 7 compiler_name)) ((Var 7 os_type)) ((Var 7 profiles)) ((Var 7 profindex)) ((Var 7 os_valid))] () .false. )] ), modules_45_fpm_manifest_profile: (Module (SymbolTable 2 { file_scope_flag: (Struct (SymbolTable 3 { }) file_scope_flag (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), get_flags: (Function (SymbolTable 6 { c_flags: (Variable 6 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), compiler_name: (Variable 6 compiler_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 6 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), err_message: (Variable 6 err_message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_flags: (Variable 6 file_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_name: (Variable 6 file_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 6 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), flags: (Variable 6 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), ifile: (Variable 6 ifile [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ikey: (Variable 6 ikey [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), is_valid: (Variable 6 is_valid [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), key_name: (Variable 6 key_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 6 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), os_type: (Variable 6 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), os_valid: (Variable 6 os_valid [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 6 profile_name [] In () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), profiles: (Variable 6 profiles [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profindex: (Variable 6 profindex [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 6 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_flags (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [new_profile] [(Var 6 profile_name) (Var 6 compiler_name) (Var 6 os_type) (Var 6 profiles) (Var 6 profindex) (Var 6 os_valid)] [(Assignment (ArrayItem (Var 6 profiles) [(() (Var 6 profindex) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) (FunctionCall 2 new_profile () [((Var 6 profile_name)) ((Var 6 compiler_name)) ((Var 6 os_type)) ((Var 6 flags)) ((Var 6 c_flags)) ((Var 6 cxx_flags)) ((Var 6 link_time_flags)) ((Var 6 file_scope_flags)) (())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () () ) () .false. .false. ) (Assignment (Var 6 profindex) (IntegerBinOp (Var 6 profindex) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), new_profile: (Function (SymbolTable 5 { c_flags: (Variable 5 c_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), compiler: (Variable 5 compiler [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 5 cxx_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 5 file_scope_flags [] In () () Default (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) 2 file_scope_flag Source Public Optional .false. .false. .false. () .false. .false. ), flags: (Variable 5 flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), is_built_in: (Variable 5 is_built_in [] In () () Default (Logical 4) () Source Public Optional .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 5 link_time_flags [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), os_type: (Variable 5 os_type [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile: (Variable 5 profile [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 profile_config_t Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 5 profile_name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_profile (FunctionType [(String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (String 1 () AssumedLength DescriptorString) (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) (Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 profile_name) (Var 5 compiler) (Var 5 os_type) (Var 5 flags) (Var 5 c_flags) (Var 5 cxx_flags) (Var 5 link_time_flags) (Var 5 file_scope_flags) (Var 5 is_built_in)] [] (Var 5 profile) Public .false. .false. () ), profile_config_t: (Struct (SymbolTable 4 { c_flags: (Variable 4 c_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), compiler: (Variable 4 compiler [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_flags: (Variable 4 cxx_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), file_scope_flags: (Variable 4 file_scope_flags [] Local () () Default (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 file_scope_flag Source Public Required .false. .false. .false. () .false. .false. ), flags: (Variable 4 flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), is_built_in: (Variable 4 is_built_in [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), link_time_flags: (Variable 4 link_time_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), os_type: (Variable 4 os_type [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), profile_name: (Variable 4 profile_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) profile_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [profile_name compiler os_type flags c_flags cxx_flags link_time_flags file_scope_flags is_built_in] [] Source Public .false. .false. [] () () ) }) modules_45_fpm_manifest_profile () [modules_45_fpm_manifest_profile] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-block_02-1362742.json0000664000175000017500000000105415141516316025151 0ustar alastairalastair{ "basename": "julia-block_02-1362742", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "julia-block_02-1362742.stdout", "stdout_hash": "59fcc1dd21572c0fc98eda4d9cded92ecfe679bd97aee86ad591cb61", "stderr": "julia-block_02-1362742.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout0000664000175000017500000001357215141516316031235 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 a)] [(Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), main: (Program (SymbolTable 3 { }) main [] [(If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "first branch" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (GoToTarget 10 10 )] [(Print (StringConstant "second branch" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (GoToTarget 50 50 ) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Return)] [] ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Gt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(GoTo 50 50 )] [] ) (If () (IntegerCompare (IntegerConstant 0 (Integer 4) Decimal) Lt (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4) Decimal))] () .false. )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_div_test-0a2468c.json0000664000175000017500000000077515141516316027144 0ustar alastairalastair{ "basename": "llvm-complex_div_test-0a2468c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_div_test.f90", "infile_hash": "0bbb7100f12786a5fc5022ab6cfd9f97cc6ede016ed0bdab03eda670", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_div_test-0a2468c.stdout", "stdout_hash": "6114c877ccc5931047fa9ed566ba07a759312d260427c3f848d5aa8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-assign_to3-fc49dae.stdout0000664000175000017500000000170215141516316026252 0ustar alastairalastair(TranslationUnit [(Program assign3 () [] [] [] [(Assign 10 30 next () ) (GoTo 20 next () [30 50 70 110] () ) (Assign 0 50 next () ) (Assign 0 70 next () ) (Assign 0 110 next () ) (Print 30 () [30] () ) (Print 50 () [50] () ) (Print 70 () [70] () ) (Print 110 () [110] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_01-9ec8e71.stdout0000664000175000017500000007063715141516316030606 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { operator_overloading_01: (Program (SymbolTable 5 { bin_add: (ExternalSymbol 5 bin_add 2 bin_add operator_overloading_01_overload_asterisk_m [] bin_add Public ), f: (Variable 5 f [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), logical_and: (ExternalSymbol 5 logical_and 2 logical_and operator_overloading_01_overload_asterisk_m [] logical_and Public ), t: (Variable 5 t [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Parameter (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (ExternalSymbol 5 ~add 2 ~add operator_overloading_01_overload_asterisk_m [] ~add Public ), ~mul: (ExternalSymbol 5 ~mul 2 ~mul operator_overloading_01_overload_asterisk_m [] ~mul Public ) }) operator_overloading_01 [operator_overloading_01_overload_asterisk_m] [(Print (StringFormat () [(StringConstant "T*T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T*F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F*T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F*F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T+T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "T+F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F+T:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "F+F:" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4) () () ) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), operator_overloading_01_overload_asterisk_m: (Module (SymbolTable 2 { bin_add: (Function (SymbolTable 4 { bin_add: (Variable 4 bin_add [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), log1: (Variable 4 log1 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), log2: (Variable 4 log2 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) bin_add (FunctionType [(Logical 4) (Logical 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 log1) (Var 4 log2)] [(If () (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4) () ) [(Assignment (Var 4 bin_add) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] [(If () (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4) () ) And (LogicalNot (Var 4 log2) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 bin_add) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] [(Assignment (Var 4 bin_add) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] )] )] (Var 4 bin_add) Public .false. .false. () ), logical_and: (Function (SymbolTable 3 { log1: (Variable 3 log1 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), log2: (Variable 3 log2 [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), logical_and: (Variable 3 logical_and [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) logical_and (FunctionType [(Logical 4) (Logical 4)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 log1) (Var 3 log2)] [(Assignment (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4) () ) () .false. .false. )] (Var 3 logical_and) Public .false. .false. () ), ~add: (CustomOperator 2 ~add [2 bin_add] Public ), ~mul: (CustomOperator 2 ~mul [2 logical_and] Public ) }) operator_overloading_01_overload_asterisk_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_38-2731560.stdout0000664000175000017500000052224215141516316027004 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 4 { c_bool: (ExternalSymbol 4 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 4 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 4 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 4 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 4 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 5 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 6 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 7 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 8 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 9 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 10 { gomp_loop_auto_next: (Variable 10 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 10 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 10 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 istart) (Var 10 iend)] [] (Var 10 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 11 { end: (Variable 11 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 11 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 11 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 11 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 11 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 11 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 start) (Var 11 end) (Var 11 incr) (Var 11 istart) (Var 11 iend)] [] (Var 11 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 12 { gomp_loop_dynamic_next: (Variable 12 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 12 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 12 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 istart) (Var 12 iend)] [] (Var 12 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 13 { chunk: (Variable 13 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 13 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 13 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 13 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 13 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 13 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 13 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 start) (Var 13 end) (Var 13 incr) (Var 13 chunk) (Var 13 istart) (Var 13 iend)] [] (Var 13 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 14 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 15 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 16 { gomp_loop_guided_next: (Variable 16 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 17 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 18 { gomp_loop_runtime_next: (Variable 18 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 18 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 18 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 istart) (Var 18 iend)] [] (Var 18 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 19 { end: (Variable 19 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 19 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 19 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 19 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 19 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 19 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 start) (Var 19 end) (Var 19 incr) (Var 19 istart) (Var 19 iend)] [] (Var 19 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 20 { gomp_loop_static_next: (Variable 20 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 21 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 22 { data: (Variable 22 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 22 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 22 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 22 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 fn) (Var 22 data) (Var 22 num_threads) (Var 22 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 23 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 24 { gomp_sections_next: (Variable 24 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 24 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 25 { count: (Variable 25 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 25 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 count)] [] (Var 25 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 26 { arg_align: (Variable 26 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 26 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 26 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 26 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 26 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 cpyfn) (Var 26 arg_size) (Var 26 arg_align) (Var 26 if_clause) (Var 26 flags) (Var 26 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 27 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 28 { data: (Variable 28 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 28 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 28 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 28 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 28 fn) (Var 28 data) (Var 28 num_teams) (Var 28 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 29 { omp_get_max_threads: (Variable 29 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 29 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 30 { omp_get_num_procs: (Variable 30 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 30 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 31 { omp_get_num_teams: (Variable 31 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 31 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 32 { omp_get_num_threads: (Variable 32 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 32 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 33 { omp_get_team_num: (Variable 33 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 34 { level: (Variable 34 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 34 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 34 level)] [] (Var 34 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 35 { omp_get_thread_num: (Variable 35 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 36 { omp_get_wtime: (Variable 36 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 37 { n: (Variable 37 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 37 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_38: (Program (SymbolTable 2 { c_bool: (ExternalSymbol 2 c_bool 39 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 2 c_funptr 39 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 39 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 2 c_long 39 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 2 c_ptr 39 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (ExternalSymbol 2 gomp_atomic_end 4 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 2 gomp_atomic_start 4 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 2 gomp_barrier 4 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 2 gomp_critical_end 4 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 2 gomp_critical_start 4 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 2 gomp_loop_auto_next 4 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 2 gomp_loop_auto_start 4 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 2 gomp_loop_dynamic_next 4 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 2 gomp_loop_dynamic_start 4 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 2 gomp_loop_end 4 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 2 gomp_loop_end_nowait 4 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 2 gomp_loop_guided_next 4 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 2 gomp_loop_guided_start 4 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 2 gomp_loop_runtime_next 4 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 2 gomp_loop_runtime_start 4 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 2 gomp_loop_static_next 4 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 2 gomp_loop_static_start 4 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 2 gomp_parallel 4 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 2 gomp_sections_end 4 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 2 gomp_sections_next 4 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 2 gomp_sections_start 4 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 2 gomp_task 4 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 2 gomp_taskwait 4 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 2 gomp_teams 4 gomp_teams omp_lib [] gomp_teams Public ), ix: (Variable 2 ix [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iy: (Variable 2 iy [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iz: (Variable 2 iz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nx: (Variable 2 nx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ny: (Variable 2 ny [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nz: (Variable 2 nz [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), omp_get_max_threads: (ExternalSymbol 2 omp_get_max_threads 4 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 2 omp_get_num_procs 4 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 2 omp_get_num_teams 4 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 2 omp_get_num_threads 4 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 2 omp_get_team_num 4 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 2 omp_get_team_size 4 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 2 omp_get_thread_num 4 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 2 omp_get_wtime 4 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 2 omp_set_num_threads 4 omp_set_num_threads omp_lib [] omp_set_num_threads Public ) }) openmp_38 [omp_lib] [(Assignment (Var 2 ny) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nx) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 nz) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (OMPRegion ParallelDo [(OMPCollapse (IntegerConstant 3 (Integer 4) Decimal) ) (OMPPrivate [(Var 2 iy) (Var 2 ix) (Var 2 iz)] )] [(DoLoop () ((Var 2 iy) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 ny) ()) [(DoLoop () ((Var 2 ix) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nx) ()) [(DoLoop () ((Var 2 iz) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nz) ()) [(Print (StringFormat () [(StringConstant "iy->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iy) (StringConstant "ix->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 ix) (StringConstant "iz->" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 iz)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] )] [] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-array2-456cd99.stdout0000664000175000017500000000050315141516316025504 0ustar alastairalastairfunction main() local a::Array{Float32, 1} local b::Array{Float32, 1} local c::Array{Int32, 1} local d::Array{Bool, 1} local e::Array{Float32, 2} local f::Array{Int32, 2} local g::Array{Bool, 2} local h::Array{Float32, 3} local i::Array{Int32, 3} local j::Array{Bool, 3} end main() lfortran-lfortran-2f73434/tests/reference/asr-const_kind_02-7c339b9.stdout0000664000175000017500000001412615141516316026423 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { const_kind_02: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i2: (Variable 2 i2 [] Local (IntegerConstant 1 (Integer 8) Decimal) (IntegerConstant 1 (Integer 8) Decimal) Parameter (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), i3: (Variable 2 i3 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), int32: (Variable 2 int32 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), int64: (Variable 2 int64 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) const_kind_02 [] [(Assignment (Var 2 i3) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i3) (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 int32) (Var 2 int64) (Var 2 i1) (Var 2 i2) (Var 2 i3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-arrayelements1-55b6bd6.stdout0000664000175000017500000000175215141516316027456 0ustar alastairalastairmodule my_subs implicit none interface my_sum module procedure sum_real, sum_int end interface my_sum contains subroutine sum_real(array, tot) real, dimension(:), intent(in) :: array real, intent(out) :: tot integer :: i tot = 1.0 do i = 1, size(array) tot = tot*array(i) end do end subroutine sum_real subroutine sum_int(array, tot) integer, dimension(:), intent(in) :: array integer, intent(out) :: tot integer :: i tot = 0 do i = 1, size(array) tot = tot + array(i) end do end subroutine sum_int end module my_subs program test_dt use my_subs implicit none type :: my_type integer :: weight real :: length end type my_type type(my_type), dimension(:), allocatable :: people type(my_type) :: answer allocate(people(2)) people(1)%weight = 1 people(1)%length = 1.0 people(2)%weight = 2 people(2)%length = 2.0 call my_sum(people(:)%weight, answer%weight) write(*, *) answer%weight call my_sum(people(:)%length, answer%length) write(*, *) answer%length end program test_dt lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01-91893af.stdout0000664000175000017500000007606315141516316025766 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [176 x i8] c"At 5:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @3 = private unnamed_addr constant [176 x i8] c"At 7:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @7 = private unnamed_addr constant [176 x i8] c"At 8:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [176 x i8] c"At 9:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @15 = private unnamed_addr constant [177 x i8] c"At 12:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @17 = private unnamed_addr constant [177 x i8] c"At 14:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [177 x i8] c"At 15:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [177 x i8] c"At 16:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [177 x i8] c"At 17:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [177 x i8] c"At 20:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @35 = private unnamed_addr constant [178 x i8] c"At 20:12 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [177 x i8] c"At 22:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @41 = private unnamed_addr constant [177 x i8] c"At 23:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [177 x i8] c"At 24:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [177 x i8] c"At 26:1 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [177 x i8] c"At 26:8 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @53 = private unnamed_addr constant [178 x i8] c"At 26:13 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [178 x i8] c"At 26:18 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @57 = private unnamed_addr constant [178 x i8] c"At 26:23 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [177 x i8] c"At 27:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @61 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [177 x i8] c"At 29:1 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @65 = private unnamed_addr constant [177 x i8] c"At 29:8 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [177 x i8] c"At 30:5 of file tests/../integration_tests/arrays_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x i32], align 4 %b = alloca [4 x i32], align 4 %i = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 3 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 %7 = load i32, i32* %i, align 4 %8 = sub i32 %7, 1 %9 = mul i32 1, %8 %10 = add i32 0, %9 %11 = icmp slt i32 %7, 1 %12 = icmp sgt i32 %7, 3 %13 = or i1 %11, %12 br i1 %13, label %then, label %ifcont then: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 %7, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %14 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 %10 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 10 store i32 %16, i32* %14, align 4 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %17 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %18 = load i32, i32* %17, align 4 %19 = icmp ne i32 %18, 11 br i1 %19, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %20 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 1 %21 = load i32, i32* %20, align 4 %22 = icmp ne i32 %21, 12 br i1 %22, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 3, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %23 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 2 %24 = load i32, i32* %23, align 4 %25 = icmp ne i32 %24, 13 br i1 %25, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %26 = load i32, i32* %i, align 4 %27 = add i32 %26, 1 %28 = icmp sle i32 %27, 14 br i1 %28, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %29 = load i32, i32* %i, align 4 %30 = add i32 %29, 1 store i32 %30, i32* %i, align 4 %31 = load i32, i32* %i, align 4 %32 = sub i32 %31, 10 %33 = sub i32 %32, 1 %34 = mul i32 1, %33 %35 = add i32 0, %34 %36 = icmp slt i32 %32, 1 %37 = icmp sgt i32 %32, 4 %38 = or i1 %36, %37 br i1 %38, label %then17, label %ifcont18 then17: ; preds = %loop.body16 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 %32, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %39 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 %35 %40 = load i32, i32* %i, align 4 store i32 %40, i32* %39, align 4 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %41 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %42 = load i32, i32* %41, align 4 %43 = icmp ne i32 %42, 11 br i1 %43, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %44 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %45 = load i32, i32* %44, align 4 %46 = icmp ne i32 %45, 12 br i1 %46, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %47 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %48 = load i32, i32* %47, align 4 %49 = icmp ne i32 %48, 13 br i1 %49, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %50 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %51 = load i32, i32* %50, align 4 %52 = icmp ne i32 %51, 14 br i1 %52, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %53 = load i32, i32* %i, align 4 %54 = add i32 %53, 1 %55 = icmp sle i32 %54, 3 br i1 %55, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %56 = load i32, i32* %i, align 4 %57 = add i32 %56, 1 store i32 %57, i32* %i, align 4 %58 = load i32, i32* %i, align 4 %59 = sub i32 %58, 1 %60 = mul i32 1, %59 %61 = add i32 0, %60 %62 = icmp slt i32 %58, 1 %63 = icmp sgt i32 %58, 4 %64 = or i1 %62, %63 br i1 %64, label %then42, label %ifcont43 then42: ; preds = %loop.body41 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 %58, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %65 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 %61 %66 = load i32, i32* %i, align 4 %67 = sub i32 %66, 1 %68 = mul i32 1, %67 %69 = add i32 0, %68 %70 = icmp slt i32 %66, 1 %71 = icmp sgt i32 %66, 3 %72 = or i1 %70, %71 br i1 %72, label %then44, label %ifcont45 then44: ; preds = %ifcont43 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 %66, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %73 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 %69 %74 = load i32, i32* %73, align 4 %75 = sub i32 %74, 10 store i32 %75, i32* %65, align 4 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %76 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %77 = load i32, i32* %76, align 4 %78 = icmp ne i32 %77, 1 br i1 %78, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %79 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %80 = load i32, i32* %79, align 4 %81 = icmp ne i32 %80, 2 br i1 %81, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %82 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %83 = load i32, i32* %82, align 4 %84 = icmp ne i32 %83, 3 br i1 %84, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %85 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %86 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 0 %87 = load i32, i32* %86, align 4 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %88 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 1 %89 = load i32, i32* %88, align 4 %90 = add i32 %87, %89 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %91 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 2 %92 = load i32, i32* %91, align 4 %93 = add i32 %90, %92 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %94 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %95 = load i32, i32* %94, align 4 %96 = add i32 %93, %95 store i32 %96, i32* %85, align 4 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %97 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %98 = load i32, i32* %97, align 4 %99 = icmp ne i32 %98, 17 br i1 %99, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %100 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %101 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 %102 = load i32, i32* %101, align 4 store i32 %102, i32* %100, align 4 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %103 = getelementptr [4 x i32], [4 x i32]* %b, i32 0, i32 3 %104 = load i32, i32* %103, align 4 %105 = icmp ne i32 %104, 11 br i1 %105, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont85 br label %FINALIZE_SYMTABLE_arrays_01 FINALIZE_SYMTABLE_arrays_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-attributes1-25126f0.json0000664000175000017500000000074115141516316026245 0ustar alastairalastair{ "basename": "ast_f90-attributes1-25126f0", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/attributes1.f90", "infile_hash": "895bd51041a1a5b92a95e7ae70f7475a5b305fdd6f8fcd525a30f46a", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-attributes1-25126f0.stdout", "stdout_hash": "b9e16c4afd812d7ebbce72a3da771f01cf60036efb15d7e5e73e9cea", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-open_notimplemented_kwarg1-24818cb.stdout0000664000175000017500000000263515141516316031302 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { open_notimplemented_kwargs: (Program (SymbolTable 2 { }) open_notimplemented_kwargs [] [(FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () (StringConstant "read" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-wasm1-8a138d6.stdout0000664000175000017500000001653415141516316025025 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32 i32) (result i32))) (type (;3;) (func (param i64 i64) (result i64))) (type (;4;) (func (param i32) (result i32))) (type (;5;) (func (param i32 i32) (result i32))) (type (;6;) (func (param i32) (result i32))) (type (;7;) (func (param) (result))) (type (;8;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32 i32) (result i32) (local i32) local.get 0 local.get 1 i32.add local.set 2 local.get 2 return ) (func $3 (type 3) (param i64 i64) (result i64) (local i64) local.get 0 local.get 1 i64.add local.set 2 local.get 2 return ) (func $4 (type 4) (param i32) (result i32) (local i32 i32) i32.const 3 local.set 2 local.get 2 local.get 0 call 6 i32.mul local.set 1 local.get 1 return ) (func $5 (type 5) (param i32 i32) (result i32) (local i32) local.get 0 local.get 1 i32.add local.set 2 local.get 2 return ) (func $6 (type 6) (param i32) (result i32) (local i32) local.get 0 local.get 0 i32.mul local.set 1 local.get 1 return ) (func $7 (type 7) (param) (result) (local) i32.const 5 call 6 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 i32.const 4 call 2 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i64.const 4 i64.const 5 call 3 call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 call 4 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 5 i32.const 4 call 5 i64.extend_i32_s call 8 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $8 (type 8) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "add" (func 2)) (export "add64" (func 3)) (export "computecirclearea" (func 4)) (export "my_add" (func 5)) (export "sqr" (func 6)) (export "_start" (func 7)) (export "print_i64" (func 8)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/julia-expr_09-838f740.stdout0000664000175000017500000000057415141516316025516 0ustar alastairalastairfunction main() local x4::Int32 local x8::Int64 local y4::Int32 local y8::Int64 y4 = 5 x4 = y4 ^ 2 println(y4, " ", x4) if x4 ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end y8 = 5 x8 = y8 ^ 2 println(y8, " ", x8) if x8 ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/ast-string_01-9625208.stdout0000664000175000017500000000171515141516316025433 0ustar alastairalastair(TranslationUnit [(Program print_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeCharacter [(len 7 Value)] () () None ) [] [(my_name [] [] () (String "Dominic" ()) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Print 0 () [(String "My name is " ()) my_name] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_error_07a-fa85c7e.json0000664000175000017500000000076215141516316027251 0ustar alastairalastair{ "basename": "asr-template_error_07a-fa85c7e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_07a.f90", "infile_hash": "2d93392c48b94ce432551da534053cf051a4d2ff3aa403b134d4a8e8", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_07a-fa85c7e.stderr", "stderr_hash": "11da2965b8a8b8ea46fe1e8545830084b13b39cd574fa274f7361414", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_1-c2d5950.stderr0000664000175000017500000000553015141516316031054 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:93:14 | 93 | I == 10 | ^ syntax error: Token '.5' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:94:14 | 94 | J = 20..5 | ^^ syntax error: Token 'i' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:95:32 | 95 | PRINT *, "Value of I is" I | ^ syntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/continue_compilation_ff_1.f:96:7 | 96 | CHARACTER*10 STR = 'Hello ' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: Token 'format' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:97:18 | 97 | WRITE(*,10 FORMAT(A)) | ^^^^^^ syntax error: Token '*' is unexpected here --> tests/errors/continue_compilation_ff_1.f:98:16 | 98 | A = B + * C | ^ syntax error: Token '.5' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:101:20 | 101 | REAL X Y Z 10.5 | ^^ syntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:102:27 | 102 | COMPLEX C = (1.0,2.0 | ^ syntax error: Token '=' is unexpected here --> tests/errors/continue_compilation_ff_1.f:103:11 | 103 | I === 10 | ^ syntax error: Token 'e' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:104:14 | 104 | J = .20E | ^ syntax error: Token '.45' (of type 'real') is unexpected here --> tests/errors/continue_compilation_ff_1.f:105:22 | 105 | REAL*8 A = 1.23.45 | ^^^ syntax error: Token 'thenprint' (of type 'identifier') is unexpected here --> tests/errors/continue_compilation_ff_1.f:118:20 | 118 | IF I .EQ. 10 THEN PRINT *, "Ten" | ^^^^^^^^^^ syntax error: Newline is unexpected here --> tests/errors/continue_compilation_ff_1.f:119:23 | 119 | CALL FUNC( 5, 6, | ^ warning: This equivalence statement is not implemented yet, for now we will ignore it --> tests/errors/continue_compilation_ff_1.f:108:7 | 108 | EQUIVALENCE (X Y) | ^^^^^^^^^^^^^^^^^ ignored for now semantic error: Variable 'integerklm' is not declared --> tests/errors/continue_compilation_ff_1.f:99:7 | 99 | INTEGER K L M = 5 | ^^^^^^^^^^^^^ 'integerklm' is undeclared semantic error: Variable 'n5' is not declared --> tests/errors/continue_compilation_ff_1.f:100:15 | 100 | READ *, N 5 | ^^^ 'n5' is undeclared lfortran-lfortran-2f73434/tests/reference/ast_f90-flush1-1eb6a16.json0000664000175000017500000000072215141516316025337 0ustar alastairalastair{ "basename": "ast_f90-flush1-1eb6a16", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/flush1.f90", "infile_hash": "d0c80e1628d5fabcef4bf73ec7d228e08c9d37462c1a3bd0f08481d8", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-flush1-1eb6a16.stdout", "stdout_hash": "a40a28bcf97c7b1f6b2fa764363a1ce06bdcccead4f89d7ecab10aaf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-program1-29eca93.stdout0000664000175000017500000000774615141516316025772 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 store i32 5, i32* %i, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %i) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = alloca i64, align 8 %14 = load i32, i32* %i, align 4 %15 = add i32 %14, 1 %16 = alloca i32, align 4 store i32 %15, i32* %16, align 4 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, i32* %16) %18 = load i64, i64* %13, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %17) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done call void @_lpython_free_argv() br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_program1 FINALIZE_SYMTABLE_program1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-derived_types_03-268a4a4.json0000664000175000017500000000077215141516316026560 0ustar alastairalastair{ "basename": "ast-derived_types_03-268a4a4", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_03-268a4a4.stdout", "stdout_hash": "64d6e9c4eec135cc474600cd8f3a44aab8c56cef25247a747a25f881", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-doloop_01-bb1c596.stderr0000664000175000017500000000072215141516316025611 0ustar alastairalastairwarning: Start expression in DO loop must be integer --> tests/warnings/doloop_01.f90:4:12 | 4 | do i = 1.5, 10.5, 2.4 | ^^^ warning: End expression in DO loop must be integer --> tests/warnings/doloop_01.f90:4:17 | 4 | do i = 1.5, 10.5, 2.4 | ^^^^ warning: Step expression (increment) in DO loop must be integer --> tests/warnings/doloop_01.f90:4:23 | 4 | do i = 1.5, 10.5, 2.4 | ^^^ lfortran-lfortran-2f73434/tests/reference/ast-program_02-2faf7cf.stdout0000664000175000017500000000271015141516316026150 0ustar alastairalastair(TranslationUnit [(Module program_02_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [] [] [] ) (Program program_02 () [(Use [] program_02_mod [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine f1 [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function f2 [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 f2 3 () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/tokens-array3-72b5447.stdout0000664000175000017500000000122315141516316025613 0ustar alastairalastair(KEYWORD "program") (TOKEN "identifier" array3) (NEWLINE) (KEYWORD "implicit") (KEYWORD "none") (NEWLINE) (NEWLINE) (KEYWORD "real") (TOKEN ",") (KEYWORD "dimension") (TOKEN "(") (TOKEN "integer" 3) (TOKEN ")") (TOKEN "::") (TOKEN "identifier" a) (TOKEN ",") (TOKEN "identifier" b) (NEWLINE) (NEWLINE) (TOKEN "identifier" a) (TOKEN "=") (TOKEN "[") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 2) (TOKEN ",") (TOKEN "integer" 3) (TOKEN "]") (NEWLINE) (TOKEN "identifier" b) (TOKEN "=") (TOKEN "[") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 2) (TOKEN ",") (TOKEN "integer" 3) (TOKEN "/)") (NEWLINE) (NEWLINE) (KEYWORD "end program") (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/llvm-bin_op_real_dp-224f1cf.json0000664000175000017500000000076715141516316026611 0ustar alastairalastair{ "basename": "llvm-bin_op_real_dp-224f1cf", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_real_dp.f90", "infile_hash": "051ba0744595dc6c3079fa4dd5b8cf1ee0504f434ee5dd8eb64ad7cc", "outfile": null, "outfile_hash": null, "stdout": "llvm-bin_op_real_dp-224f1cf.stdout", "stdout_hash": "f27a9efe18798e002dbf5bc95b5eb4a89f5e384df911279236705617", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-logical3-b6316c6.json0000664000175000017500000000106115141516316025074 0ustar alastairalastair{ "basename": "asr-logical3-b6316c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/logical3.f90", "infile_hash": "d7f7994a85ee59f1b3b80060886eeeb7390f9733461bd9349e4bb7c0", "outfile": null, "outfile_hash": null, "stdout": "asr-logical3-b6316c6.stdout", "stdout_hash": "e408350e0a6e6bbad37d0dffeef3fe7c766a4db4eb6fc198eee5f590", "stderr": "asr-logical3-b6316c6.stderr", "stderr_hash": "d7e28e54d198e14f86c18ab4c4ad128018b9bc6523fb945b05607a57", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dreal_arg_error-91381bb.stderr0000664000175000017500000000025415141516316027064 0ustar alastairalastairsemantic error: Unexpected args, Dreal expects (complex64) as arguments --> tests/errors/dreal_arg_error.f90:4:14 | 4 | print *, dreal(a) | ^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_01-6b086c6.json0000664000175000017500000000075415141516316026576 0ustar alastairalastair{ "basename": "asr-matrix_matmul_01-6b086c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_01.f90", "infile_hash": "38df7f8926269bd945a6ff81bfa92300eb2d9fab68d567e96304260a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_01-6b086c6.stderr", "stderr_hash": "500c0bf01ba18c5f424435852718361858f3948e5e187c1ac18556da", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-nested_03-57ffed2.json0000664000175000017500000000074515141516316025343 0ustar alastairalastair{ "basename": "asr-nested_03-57ffed2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_03.f90", "infile_hash": "690c7461fd0cb288a4f72f5fd09663a777ae1ba9f4a39dfdc5727c36", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_03-57ffed2.stdout", "stdout_hash": "28368b920ae5d1c7d792381004e7da9bedcd906917a9ff5ab5f958fb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-redeclaration1-b66ed3a.stderr0000664000175000017500000000034215141516316026767 0ustar alastairalastairsemantic error: Symbol is already declared in the same scope --> tests/errors/redeclaration1.f90:4:12 | 4 | real :: j, idx1 | ^^^^ redeclaration | 3 | integer :: idx1 | ~~~~ original declaration lfortran-lfortran-2f73434/tests/reference/asr-template_add_03-43a00f9.stdout0000664000175000017500000014637215141516316026710 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_03: (Program (SymbolTable 11 { add_t: (ExternalSymbol 11 add_t 2 add_t template_add_03_m [] add_t Public ), r: (ExternalSymbol 11 r 2 r template_add_03_m [] r Public ), test_template: (ExternalSymbol 11 test_template 2 test_template template_add_03_m [] test_template Public ) }) template_add_03 [template_add_03_m] [(SubroutineCall 11 test_template () [] () .false. )] ), template_add_03_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (FunctionCall 5 f () [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_t [t f] [(Require r [t f] )] ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t f] [] ), test_template: (Function (SymbolTable 8 { add_real: (Function (SymbolTable 10 { x: (Variable 10 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 10 z [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~add_intrinsic] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 z) (FunctionCall 8 ~add_intrinsic () [((Var 10 x)) ((Var 10 y))] (Real 4) () () ) () .false. .false. )] (Var 10 z) Public .false. .false. () ), x: (Variable 8 x [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 8 ~add [8 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 9 { arg0: (Variable 9 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 9 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 9 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 arg0) (Var 9 arg1)] [(Assignment (Var 9 ret) (RealBinOp (Var 9 arg0) Add (Var 9 arg1) (Real 4) () ) () .false. .false. )] (Var 9 ret) Public .false. .true. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 x) (RealConstant 5.100000 (Real 4) ) () .false. .false. ) (Assignment (Var 8 y) (RealConstant 7.200000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (FunctionCall 8 add_real () [((Var 8 x)) ((Var 8 y))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 8 add_real () [((Var 8 x)) ((Var 8 y))] (Real 4) () () ) Sub (RealConstant 12.300000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ) }) template_add_03_m () [template_add_03_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_06-15c0eef.stdout0000664000175000017500000003017215141516316026772 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %dp = alloca i32, align 4 store i32 8, i32* %dp, align 4 %x = alloca float, align 4 store float 0x3FEFFFFFE0000000, float* %x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %x) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry store float 0x3FEFFFFFE0000000, float* %x, align 4 %13 = alloca i64, align 8 %14 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %13, i32 0, i32 0, float* %x) %15 = load i64, i64* %13, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %15, i64* %17, align 4 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %21 = load i64, i64* %20, align 4 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %14) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done store float 1.000000e+00, float* %x, align 4 %24 = alloca i64, align 8 %25 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %24, i32 0, i32 0, float* %x) %26 = load i64, i64* %24, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %25, i8** %27, align 8 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %26, i64* %28, align 4 %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %30 = load i8*, i8** %29, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %32 = load i64, i64* %31, align 4 %33 = trunc i64 %32 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %30, i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %34 = icmp eq i8* %25, null br i1 %34, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %25) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 store float 1.000000e+00, float* %x, align 4 %35 = alloca i64, align 8 %36 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %35, i32 0, i32 0, float* %x) %37 = load i64, i64* %35, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %36, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %37, i64* %39, align 4 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %43 = load i64, i64* %42, align 4 %44 = trunc i64 %43 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %41, i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %45 = icmp eq i8* %36, null br i1 %45, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %36) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 store float 1.000000e+00, float* %x, align 4 %46 = alloca i64, align 8 %47 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %46, i32 0, i32 0, float* %x) %48 = load i64, i64* %46, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %47, i8** %49, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %48, i64* %50, align 4 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %52 = load i8*, i8** %51, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %54 = load i64, i64* %53, align 4 %55 = trunc i64 %54 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %52, i32 %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %56 = icmp eq i8* %47, null br i1 %56, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free(i8* %47) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 store float 0x3FEFFFFFE0000000, float* %x, align 4 %57 = alloca i64, align 8 %58 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %57, i32 0, i32 0, float* %x) %59 = load i64, i64* %57, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %58, i8** %60, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %59, i64* %61, align 4 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %63 = load i8*, i8** %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %65 = load i64, i64* %64, align 4 %66 = trunc i64 %65 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %63, i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %67 = icmp eq i8* %58, null br i1 %67, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free(i8* %58) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 store float 1.000000e+00, float* %x, align 4 %68 = alloca i64, align 8 %69 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.6, i32 0, i32 0), i64* %68, i32 0, i32 0, float* %x) %70 = load i64, i64* %68, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %71 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %69, i8** %71, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %70, i64* %72, align 4 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %74 = load i8*, i8** %73, align 8 %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %76 = load i64, i64* %75, align 4 %77 = trunc i64 %76 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %74, i32 %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %78 = icmp eq i8* %69, null br i1 %78, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free(i8* %69) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 call void @_lpython_free_argv() br label %return return: ; preds = %free_done18 br label %FINALIZE_SYMTABLE_intrinsics_06 FINALIZE_SYMTABLE_intrinsics_06: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-format2-ed47ddb.json0000664000175000017500000000071515141516316025366 0ustar alastairalastair{ "basename": "llvm-format2-ed47ddb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/format2.f90", "infile_hash": "24f2535488697afb5dd3d24d9f313087fe8386df6028895aea8bed12", "outfile": null, "outfile_hash": null, "stdout": "llvm-format2-ed47ddb.stdout", "stdout_hash": "67e59d971a52727c0ba2818127d87ab749d468081df2389afcd8d723", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_04-da02dd9.stdout0000664000175000017500000027505615141516316027277 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_datetime: (Module (SymbolTable 2 { date_to_string: (Function (SymbolTable 6 { 1_toml_date_day: (ExternalSymbol 6 1_toml_date_day 4 day toml_date [] day Public ), 1_toml_date_month: (ExternalSymbol 6 1_toml_date_month 4 month toml_date [] month Public ), 1_toml_date_year: (ExternalSymbol 6 1_toml_date_year 4 year toml_date [] year Public ), lhs: (Variable 6 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 6 rhs [] In () () Default (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 toml_date Source Private Required .false. .false. .false. () .false. .false. ) }) date_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 lhs) (Var 6 rhs)] [(Allocate [((Var 6 lhs) [] (IntegerConstant 10 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 6 lhs) () () () [(StringFormat (StringConstant "(i4.4,\"-\",i2.2,\"-\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 6 rhs) 6 1_toml_date_year (Integer 4) () ) (StructInstanceMember (Var 6 rhs) 6 1_toml_date_month (Integer 4) () ) (StructInstanceMember (Var 6 rhs) 6 1_toml_date_day (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] () Private .false. .false. () ), datetime_to_string: (Function (SymbolTable 8 { 1_toml_date_date_to_string: (ExternalSymbol 8 1_toml_date_date_to_string 4 to_string toml_date [] to_string Public ), 1_toml_datetime_date: (ExternalSymbol 8 1_toml_datetime_date 5 date toml_datetime [] date Public ), 1_toml_datetime_time: (ExternalSymbol 8 1_toml_datetime_time 5 time toml_datetime [] time Public ), 1_toml_time_time_to_string: (ExternalSymbol 8 1_toml_time_time_to_string 3 to_string toml_time [] to_string Public ), lhs: (Variable 8 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 8 rhs [] In () () Default (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. ) 2 toml_datetime Source Private Required .false. .false. .false. () .false. .false. ), temporary: (Variable 8 temporary [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) datetime_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [time_to_string] [(Var 8 lhs) (Var 8 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 8 1_toml_date_date_to_string () [((Var 8 lhs))] (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_date (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) () ) .false. ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 8 1_toml_time_time_to_string () [((Var 8 temporary))] (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) .false. ) (Assignment (Var 8 lhs) (IntrinsicElementalFunction StringConcat [(Var 8 lhs) (Var 8 temporary)] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () )] 0 (Logical 4) () ) [(Assignment (Var 8 lhs) (StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) (SubroutineCall 2 time_to_string 2 time_to_string [((Var 8 lhs)) ((StructInstanceMember (Var 8 rhs) 8 1_toml_datetime_time (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ))] () .false. ) .false. .false. )] [] )] )] () Private .false. .false. () ), new_toml_time: (Function (SymbolTable 9 { 1_toml_time_hour: (ExternalSymbol 9 1_toml_time_hour 3 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 9 1_toml_time_millisec 3 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 9 1_toml_time_minute 3 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 9 1_toml_time_second 3 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 9 1_toml_time_zone 3 zone toml_time [] zone Public ), hour: (Variable 9 hour [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), millisec: (Variable 9 millisec [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), minute: (Variable 9 minute [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), second: (Variable 9 second [] In () () Default (Integer 4) () Source Private Optional .false. .false. .false. () .false. .false. ), self: (Variable 9 self [] ReturnVar () () Default (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. ), zone: (Variable 9 zone [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Private Optional .false. .false. .false. () .false. .false. ) }) new_toml_time (FunctionType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (String 1 () AssumedLength DescriptorString)] (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 9 hour) (Var 9 minute) (Var 9 second) (Var 9 millisec) (Var 9 zone)] [(If () (IntrinsicElementalFunction Present [(Var 9 hour)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_hour (Integer 4) () ) (Var 9 hour) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 minute)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_minute (Integer 4) () ) (Var 9 minute) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 second)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_second (Integer 4) () ) (Var 9 second) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 millisec)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_millisec (Allocatable (Integer 4) ) () ) (Var 9 millisec) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 9 zone)] 0 (Logical 4) () ) [(Assignment (StructInstanceMember (Var 9 self) 9 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 9 zone) () .false. .false. )] [] )] (Var 9 self) Private .false. .false. () ), time_to_string: (Function (SymbolTable 7 { 1_toml_time_hour: (ExternalSymbol 7 1_toml_time_hour 3 hour toml_time [] hour Public ), 1_toml_time_millisec: (ExternalSymbol 7 1_toml_time_millisec 3 millisec toml_time [] millisec Public ), 1_toml_time_minute: (ExternalSymbol 7 1_toml_time_minute 3 minute toml_time [] minute Public ), 1_toml_time_second: (ExternalSymbol 7 1_toml_time_second 3 second toml_time [] second Public ), 1_toml_time_zone: (ExternalSymbol 7 1_toml_time_zone 3 zone toml_time [] zone Public ), lhs: (Variable 7 lhs [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 7 rhs [] In () () Default (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. ) }) time_to_string (FunctionType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 lhs) (Var 7 rhs)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_millisec (Allocatable (Integer 4) ) () )] 0 (Logical 4) () ) [(Allocate [((Var 7 lhs) [] (IntegerConstant 12 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 7 lhs) () () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2,\".\",i3.3)" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_second (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_millisec (Allocatable (Integer 4) ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] [(Allocate [((Var 7 lhs) [] (IntegerConstant 8 (Integer 4) Decimal) () ())] () () () ) (FileWrite 0 (Var 7 lhs) () () () [(StringFormat (StringConstant "(i2.2,\":\",i2.2,\":\",i2.2)" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_hour (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_minute (Integer 4) () ) (StructInstanceMember (Var 7 rhs) 7 1_toml_time_second (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 7 lhs) (IntrinsicElementalFunction StringConcat [(Var 7 lhs) (IntrinsicElementalFunction StringTrim [(StructInstanceMember (Var 7 rhs) 7 1_toml_time_zone (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [] )] () Private .false. .false. () ), toml_date: (Struct (SymbolTable 4 { day: (Variable 4 day [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), month: (Variable 4 month [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 4 to_string rhs date_to_string 2 date_to_string Source .false. .false. ), year: (Variable 4 year [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ~assign: (CustomOperator 4 ~assign [4 to_string] Public ) }) toml_date (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [year month day] [] Source Private .false. .false. [] () () ), toml_datetime: (Struct (SymbolTable 5 { date: (Variable 5 date [] Local () () Default (Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) 2 toml_date Source Private Required .false. .false. .false. () .false. .false. ), time: (Variable 5 time [] Local () () Default (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 toml_time Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 5 to_string rhs datetime_to_string 2 datetime_to_string Source .false. .false. ), ~assign: (CustomOperator 5 ~assign [5 to_string] Public ) }) toml_datetime (StructType [(Allocatable (StructType [(Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (Allocatable (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] [] .true. .false. ) [] [date time] [] Source Private .false. .false. [] () () ), toml_time: (Struct (SymbolTable 3 { hour: (Variable 3 hour [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), millisec: (Variable 3 millisec [] Local () () Default (Allocatable (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ), minute: (Variable 3 minute [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), second: (Variable 3 second [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 3 to_string rhs time_to_string 2 time_to_string Source .false. .false. ), zone: (Variable 3 zone [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), ~assign: (CustomOperator 3 ~assign [3 to_string] Public ) }) toml_time (StructType [(Integer 4) (Allocatable (Integer 4) ) (Integer 4) (Integer 4) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [hour minute second millisec zone] [] Source Private .false. .false. [] () () ), ~toml_time: (GenericProcedure 2 ~toml_time [2 new_toml_time] Public ) }) tomlf_datetime () [tomlf_datetime] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr6-914a051.json0000664000175000017500000000070715141516316024550 0ustar alastairalastair{ "basename": "llvm-expr6-914a051", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr6-914a051.stdout", "stdout_hash": "62fdea48371bdacc43164fd59d9933324986c2d2c00b4d7ef0a97ce4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-callback_01-facbb46.json0000664000175000017500000000075615141516316026047 0ustar alastairalastair{ "basename": "llvm-callback_01-facbb46", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_01.f90", "infile_hash": "d2c103564620acefc4245ff5eb5dfe84478276bead512800823259da", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_01-facbb46.stdout", "stdout_hash": "5f6f0541828cccb44a4909224a2121a690b7930595e6fdc14681e07a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json0000664000175000017500000000101015141516316030644 0ustar alastairalastair{ "basename": "asr-fixed_form_if_variations-b4dcd1e", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_if_variations.f", "infile_hash": "4a650d13a10da613323a06d614f3a9342a07afcae9d662a2584c8e52", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_if_variations-b4dcd1e.stdout", "stdout_hash": "5947eda5d0c2fe235404c3788347d419dd04d783b482c57d692a19c0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_03-2ad875a.json0000664000175000017500000000076015141516316027315 0ustar alastairalastair{ "basename": "ast_f90-derived_types_03-2ad875a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/derived_types_03.f90", "infile_hash": "0367caa646d88d9d311f2157b87aa8d37c7c09500fea94cc3adacbe3", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_03-2ad875a.stdout", "stdout_hash": "7a98583ef0e15fc8e8f7780421a2615536df4045cfb6b7850739787f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit10-f531a25.json0000664000175000017500000000106615141516316025353 0ustar alastairalastair{ "basename": "asr-implicit10-f531a25", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit10-f531a25.stdout", "stdout_hash": "c88b17187539dfda9b478bbb9291e6c549e3fd7226762037b09aa0a6", "stderr": "asr-implicit10-f531a25.stderr", "stderr_hash": "5e0f52ad16423091b73b5dc0c5de3f43847ef3bf23e99f74475d49f6", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_assignment-58b5a6f.json0000664000175000017500000000077415141516316027714 0ustar alastairalastair{ "basename": "ast-fixedform_assignment-58b5a6f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_assignment.f", "infile_hash": "a5ce54b54cc0b1865c8561b13812ea8490888bb2807c4a7bddd5ba39", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_assignment-58b5a6f.stdout", "stdout_hash": "ebcb76376b470c899d2a26a11e4e649e9a3b30343bcb3be43053fd9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit8-03c7a90.stderr0000664000175000017500000000033215141516316025627 0ustar alastairalastairsemantic error: m, n is/are used as dimensions but not declared --> tests/implicit8.f90:1:1 - 6:12 | 1 | integer function a(n,m) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 6 | end function | ...^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-template_error_06-1cbc8a9.stderr0000664000175000017500000000027115141516316027424 0ustar alastairalastairsemantic error: Type parameter 'g' is not specified in any requirements --> tests/errors/template_error_06.f90:16:11 | 16 | type(g) :: fst | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-struct_allocate-606e066.json0000664000175000017500000000076715141516316026525 0ustar alastairalastair{ "basename": "asr-struct_allocate-606e066", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/struct_allocate.f90", "infile_hash": "8f826ffcc557e1f998f9fb99e619bed6aa68bc3f5e45768ad8fa12a9", "outfile": null, "outfile_hash": null, "stdout": "asr-struct_allocate-606e066.stdout", "stdout_hash": "81ed148aa87bde3b5125950e28b23f062b732c6a453fc4483b98b819", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_if_01-6989548.stderr0000664000175000017500000000015115141516316031540 0ustar alastairalastairC preprocessor error: Unterminated #if --> tests/errors/unterminated_if_01.f90:1:1 | 1 | #if a | ^ lfortran-lfortran-2f73434/tests/reference/asr-modules_52-5261d38.json0000664000175000017500000000075015141516316025303 0ustar alastairalastair{ "basename": "asr-modules_52-5261d38", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_52.f90", "infile_hash": "640dd46fb2d4c29ca80decea7bf1e44a075d14193b200b95c56cee89", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_52-5261d38.stdout", "stdout_hash": "7e8975af469980db4d3bba626bc7747c2ad131a45406d3f05b7948b5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface_02-c56d91f.json0000664000175000017500000000075615141516316025743 0ustar alastairalastair{ "basename": "ast-interface_02-c56d91f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_02.f90", "infile_hash": "9a92d595f0a6e12d0a6033700f6b34403f12830b47fe3115eee2b5f1", "outfile": null, "outfile_hash": null, "stdout": "ast-interface_02-c56d91f.stdout", "stdout_hash": "2d3de6b70cc6299c5dff95b205590d76dbff0b3dba2d26b260b28e3c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-format_01-b8a6dbf.stdout0000664000175000017500000001521415141516316025771 0ustar alastairalastair(TranslationUnit [(Program format_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () )] [(Format 1 "/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 2 "/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 3 " /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5" () ) (Format 4 "2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5" () ) (Format 5 "/" () ) (Format 6 "/ " () ) (Format 7 " /" () ) (Format 8 "i6, /" () ) (Format 9 "i6,/" () ) (Format 10 "/ , /" () ) (Format 121 " /, 80A, / " () ) (Format 122 " /, 80A, /" () ) (Format 123 "/, 80A, /" () ) (Format 124 "/, 80A, / " () ) (Format 130 " 10X, 'keyword Input Echo - Values from input or default', / ,80A, / " () ) (Format 131 " 10X, 'keyword Input Echo - Values from input or default', / ,80A, /" () ) (Format 158 " 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, 4X, 'fixup = ', I1, / " () ) (Format 161 " 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',' Mats (fastest ), Moments, Groups, Groups (slowest)' " () ) (Format 162 " 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 " () ) (Format 221 " 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) " () ) (Format 306 " 2X, I4, 6(1X, ES11.4) " () ) (Format 324 " 4(2X, ES17.10) " () ) (Format 422 " /, 4X, 'Manufactured/Computed Solutions Max Diff=', ES13.6 " () ) (Format 500 " \"IARRAY =\", *( I0, :, \",\")" () ) (Format 501 "*( I0, :, \",\")" () ) (Format 510 "1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5" () ) (Format 511 "3/,I5" () ) (Format 512 "3/" () ) (Format 513 "1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7" () ) (Format 520 "1X, I1, 1X, 'ISN''T', 1X, I1" () ) (Format 530 "1PE12.4, I10" () ) (Format 540 "I12, /, ' Dates: ', 2 (2I3, I5)" () ) (Format 550 "ES12.3, ES12.3E3, G3.4, G3.4E100" () ) (Format 600 "//,63x,'Internal',/, 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, '(kg/m**3)',5x,'(J/kg)' " () ) (Format 610 "71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)" () ) (Format 620 "(1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))" () ) (Format 630 " //,' Format Number ',i4" () ) (Format 631 "//,' Format Number ',i4" () ) (Format 640 "\"Table form of A\"/(2F8.2)" () ) (Format 650 " 5X, 'ng= ', I4, / 5X, 'mat_opt= ', I2, / 5X, 'src_opt= ', I2, / 5X, 'scatp= ', I2 " () ) (Format 660 "' Format Number ',0PF17.8,' Ry' " () ) (Format 670 "/'xx'" () ) (Format 680 "/\"xx\"" () ) (Format 690 "/ \"xx\"" () ) (Format 700 "/ 'xx'" () ) (Format 710 "/ i5, 'x'" () ) (Format 720 "// i5, 'x'" () ) (Format 730 "//" () ) (Assignment 0 x 5 () ) (Format 740 "/1X'(',I2,')', X, A" () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-types_06-6f66d2c.stdout0000664000175000017500000005150215141516316025701 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 2.000000e+00, float* %r, align 4 store i32 2, i32* %i, align 4 %2 = load i32, i32* %i, align 4 %3 = load i32, i32* %i, align 4 %4 = icmp slt i32 %2, %3 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %5 = load float, float* %r, align 4 %6 = load float, float* %r, align 4 %7 = fcmp olt float %5, %6 br i1 %7, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %8 = load float, float* %r, align 4 %9 = load i32, i32* %i, align 4 %10 = sitofp i32 %9 to float %11 = fcmp olt float %8, %10 br i1 %11, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %12 = load i32, i32* %i, align 4 %13 = sitofp i32 %12 to float %14 = load float, float* %r, align 4 %15 = fcmp olt float %13, %14 br i1 %15, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %16 = load i32, i32* %i, align 4 %17 = load i32, i32* %i, align 4 %18 = icmp sgt i32 %16, %17 br i1 %18, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %19 = load float, float* %r, align 4 %20 = load float, float* %r, align 4 %21 = fcmp ogt float %19, %20 br i1 %21, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %22 = load float, float* %r, align 4 %23 = load i32, i32* %i, align 4 %24 = sitofp i32 %23 to float %25 = fcmp ogt float %22, %24 br i1 %25, label %then16, label %else17 then16: ; preds = %ifcont15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %ifcont15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %26 = load i32, i32* %i, align 4 %27 = sitofp i32 %26 to float %28 = load float, float* %r, align 4 %29 = fcmp ogt float %27, %28 br i1 %29, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %30 = load i32, i32* %i, align 4 %31 = load i32, i32* %i, align 4 %32 = icmp ne i32 %30, %31 br i1 %32, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 %33 = load float, float* %r, align 4 %34 = load float, float* %r, align 4 %35 = fcmp une float %33, %34 br i1 %35, label %then25, label %else26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont27 else26: ; preds = %ifcont24 br label %ifcont27 ifcont27: ; preds = %else26, %then25 %36 = load float, float* %r, align 4 %37 = load i32, i32* %i, align 4 %38 = sitofp i32 %37 to float %39 = fcmp une float %36, %38 br i1 %39, label %then28, label %else29 then28: ; preds = %ifcont27 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont30 else29: ; preds = %ifcont27 br label %ifcont30 ifcont30: ; preds = %else29, %then28 %40 = load i32, i32* %i, align 4 %41 = sitofp i32 %40 to float %42 = load float, float* %r, align 4 %43 = fcmp une float %41, %42 br i1 %43, label %then31, label %else32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont33 else32: ; preds = %ifcont30 br label %ifcont33 ifcont33: ; preds = %else32, %then31 %44 = load i32, i32* %i, align 4 %45 = add i32 %44, 1 %46 = load i32, i32* %i, align 4 %47 = icmp sle i32 %45, %46 br i1 %47, label %then34, label %else35 then34: ; preds = %ifcont33 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont36 else35: ; preds = %ifcont33 br label %ifcont36 ifcont36: ; preds = %else35, %then34 %48 = load float, float* %r, align 4 %49 = fadd float %48, 1.000000e+00 %50 = load float, float* %r, align 4 %51 = fcmp ole float %49, %50 br i1 %51, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 %52 = load float, float* %r, align 4 %53 = fadd float %52, 1.000000e+00 %54 = load i32, i32* %i, align 4 %55 = sitofp i32 %54 to float %56 = fcmp ole float %53, %55 br i1 %56, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %57 = load i32, i32* %i, align 4 %58 = add i32 %57, 1 %59 = sitofp i32 %58 to float %60 = load float, float* %r, align 4 %61 = fcmp ole float %59, %60 br i1 %61, label %then43, label %else44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont45 else44: ; preds = %ifcont42 br label %ifcont45 ifcont45: ; preds = %else44, %then43 %62 = load i32, i32* %i, align 4 %63 = load i32, i32* %i, align 4 %64 = add i32 %63, 1 %65 = icmp sge i32 %62, %64 br i1 %65, label %then46, label %else47 then46: ; preds = %ifcont45 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont48 else47: ; preds = %ifcont45 br label %ifcont48 ifcont48: ; preds = %else47, %then46 %66 = load float, float* %r, align 4 %67 = load float, float* %r, align 4 %68 = fadd float %67, 1.000000e+00 %69 = fcmp oge float %66, %68 br i1 %69, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 %70 = load float, float* %r, align 4 %71 = load i32, i32* %i, align 4 %72 = add i32 %71, 1 %73 = sitofp i32 %72 to float %74 = fcmp oge float %70, %73 br i1 %74, label %then52, label %else53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont54 else53: ; preds = %ifcont51 br label %ifcont54 ifcont54: ; preds = %else53, %then52 %75 = load i32, i32* %i, align 4 %76 = sitofp i32 %75 to float %77 = load float, float* %r, align 4 %78 = fadd float %77, 1.000000e+00 %79 = fcmp oge float %76, %78 br i1 %79, label %then55, label %else56 then55: ; preds = %ifcont54 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont57 else56: ; preds = %ifcont54 br label %ifcont57 ifcont57: ; preds = %else56, %then55 %80 = load i32, i32* %i, align 4 %81 = load i32, i32* %i, align 4 %82 = add i32 %81, 1 %83 = icmp eq i32 %80, %82 br i1 %83, label %then58, label %else59 then58: ; preds = %ifcont57 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont60 else59: ; preds = %ifcont57 br label %ifcont60 ifcont60: ; preds = %else59, %then58 %84 = load float, float* %r, align 4 %85 = load float, float* %r, align 4 %86 = fadd float %85, 1.000000e+00 %87 = fcmp oeq float %84, %86 br i1 %87, label %then61, label %else62 then61: ; preds = %ifcont60 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont63 else62: ; preds = %ifcont60 br label %ifcont63 ifcont63: ; preds = %else62, %then61 %88 = load float, float* %r, align 4 %89 = load i32, i32* %i, align 4 %90 = add i32 %89, 1 %91 = sitofp i32 %90 to float %92 = fcmp oeq float %88, %91 br i1 %92, label %then64, label %else65 then64: ; preds = %ifcont63 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont66 else65: ; preds = %ifcont63 br label %ifcont66 ifcont66: ; preds = %else65, %then64 %93 = load i32, i32* %i, align 4 %94 = sitofp i32 %93 to float %95 = load float, float* %r, align 4 %96 = fadd float %95, 1.000000e+00 %97 = fcmp oeq float %94, %96 br i1 %97, label %then67, label %else68 then67: ; preds = %ifcont66 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont69 else68: ; preds = %ifcont66 br label %ifcont69 ifcont69: ; preds = %else68, %then67 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont69 br label %FINALIZE_SYMTABLE_types_06 FINALIZE_SYMTABLE_types_06: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-external_02-ab2b90d.json0000664000175000017500000000077515141516316025666 0ustar alastairalastair{ "basename": "asr-external_02-ab2b90d", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external_02.f90", "infile_hash": "229cee9d64d77be22b3786ec7d91c285922a45bcd94b40f9d7e0d2b9", "outfile": null, "outfile_hash": null, "stdout": "asr-external_02-ab2b90d.stdout", "stdout_hash": "69634920298875a7ab32c3959d29a0007eb2004671c1ee1761355860", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_06-2a9502c.json0000664000175000017500000000076215141516316030534 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_06-2a9502c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_06.f90", "infile_hash": "23810657fc4e5777acd91a7cce76b5b3bb2e5e3ff87d25d44e4d80fa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_06-2a9502c.stderr", "stderr_hash": "a91863236c3aaa0176ad0ac95ab24bf4200ac11d83e06ff885282a52", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr_json-special_chars_json-70bba3a.json0000664000175000017500000000077515141516316030421 0ustar alastairalastair{ "basename": "asr_json-special_chars_json-70bba3a", "cmd": "lfortran --show-asr --no-indent --json {infile} -o {outfile}", "infile": "tests/special_chars_json.f90", "infile_hash": "f1aaa183ee7d224a4f0e158546c6f3077e139ee963f833a4c37394d5", "outfile": null, "outfile_hash": null, "stdout": "asr_json-special_chars_json-70bba3a.stdout", "stdout_hash": "1220d7a3aaa9c0feee952d20634489974241fed8588099d2eb109e43", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing2-d87e21a.stdout0000664000175000017500000003533715141516316027334 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { a: (Variable 2 a [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [n] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), ifault: (Variable 2 ifault [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4) (Real 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [(Assignment (Var 2 ifault) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. )] () Public .false. .false. () ), g: (Function (SymbolTable 3 { a: (Variable 3 a [n] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [n] Unspecified () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 3 g [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ifault: (Variable 3 ifault [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [(Integer 4) (Real 4) (Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 2 (Integer 4) () ))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [(Assignment (Var 3 ifault) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 r) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. )] (Var 3 g) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_array_01-691b151.stdout0000664000175000017500000017515515141516316027217 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_01: (Program (SymbolTable 10 { array_tmpl: (ExternalSymbol 10 array_tmpl 2 array_tmpl template_array_01_m [] array_tmpl Public ), r: (ExternalSymbol 10 r 2 r template_array_01_m [] r Public ), test_template: (ExternalSymbol 10 test_template 2 test_template template_array_01_m [] test_template Public ) }) template_array_01 [template_array_01_m] [(SubroutineCall 10 test_template () [] () .false. )] ), template_array_01_m: (Module (SymbolTable 2 { array_tmpl: (Template (SymbolTable 4 { insert_t: (Function (SymbolTable 5 { i: (Variable 5 i [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), lst: (Variable 5 lst [] In () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) insert_t (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 lst) (Var 5 i)] [(Assignment (ArrayItem (Var 5 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) (Var 5 i) () .false. .false. ) (Assignment (Var 5 r) (ArrayItem (Var 5 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] (Var 5 r) Public .false. .false. () ), insert_t_n: (Function (SymbolTable 6 { i: (Variable 6 i [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), lst: (Variable 6 lst [n] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 6 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 6 r [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) insert_t_n (FunctionType [(Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 n) (Var 6 lst) (Var 6 i)] [(Assignment (ArrayItem (Var 6 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) (Var 6 i) () .false. .false. ) (Assignment (Var 6 r) (ArrayItem (Var 6 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] (Var 6 r) Private .false. .false. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) array_tmpl [t] [(Require r [t] )] ), r: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) r [t] [] ), test_template: (Function (SymbolTable 7 { a: (Variable 7 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), insert_int: (Function (SymbolTable 8 { i: (Variable 8 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lst: (Variable 8 lst [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 8 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) insert_int (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 lst) (Var 8 i)] [(Assignment (ArrayItem (Var 8 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 8 i) () .false. .false. ) (Assignment (Var 8 r) (ArrayItem (Var 8 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. )] (Var 8 r) Public .false. .false. () ), insert_int_n: (Function (SymbolTable 9 { i: (Variable 9 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lst: (Variable 9 lst [n] In () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 9 n))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 9 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 9 r [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) insert_int_n (FunctionType [(Integer 4) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 n) (Var 9 lst) (Var 9 i)] [(Assignment (ArrayItem (Var 9 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 9 i) () .false. .false. ) (Assignment (Var 9 r) (ArrayItem (Var 9 lst) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. )] (Var 9 r) Private .false. .false. () ), r: (Variable 7 r [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 7 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 7 r) (FunctionCall 7 insert_int () [((ArrayPhysicalCast (Var 7 a) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () )) ((Var 7 i))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 7 r) (FunctionCall 7 insert_int_n () [((ArraySize (Var 7 a) () (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) )) ((ArrayPhysicalCast (Var 7 a) FixedSizeArray PointerArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Mul (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () )) ((Var 7 i))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 7 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_array_01_m () [template_array_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-doloop_01-d646475.stdout0000664000175000017500000000334015141516316026016 0ustar alastairalastairfunction main() local i::Int32 local j::Int32 j = 0 for i ∈ 1:10 j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 10:-1:1 j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:2:9 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 9:-2:1 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:2:10 j = j + i end if j ≠ 25 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:3:10 j = j + i end if j ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 10:-3:1 j = j + i end if j ≠ 22 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:1 j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:-1:1 j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:0 j = j + i end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 0:-1:1 j = j + i end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end println(j) end main() lfortran-lfortran-2f73434/tests/reference/tokens-esub1-3e8b16d.stdout0000664000175000017500000000042515141516316025572 0ustar alastairalastair(KEYWORD "subroutine") (TOKEN "identifier" g) (TOKEN "(") (TOKEN ")") (TOKEN "identifier" r) (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/llvm-string_01-deb8ed3.stdout0000664000175000017500000000556215141516316026201 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @my_name_data = private global [7 x i8] c"Dominic" @my_name = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @my_name_data, i32 0, i32 0), i64 7 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [19 x i8] c"S-DESC-11,S-DESC-7\00", align 1 @string_const_data = private constant [11 x i8] c"My name is " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %2 = alloca i64, align 8 %3 = load %string_descriptor, %string_descriptor* @my_name, align 1 %4 = alloca %string_descriptor, align 8 store %string_descriptor %3, %string_descriptor* %4, align 1 %5 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %string_descriptor* @string_const, %string_descriptor* %4) %6 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 4 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_print_01 FINALIZE_SYMTABLE_print_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-program_cmake_01-caf8f48.json0000664000175000017500000000077515141516316027057 0ustar alastairalastair{ "basename": "llvm-program_cmake_01-caf8f48", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "llvm-program_cmake_01-caf8f48.stdout", "stdout_hash": "284a0c8feb908444c048bb667989c6c3f580a7a907f1d3953cb06df0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-team1-f402eac.stdout0000664000175000017500000000075615141516316025603 0ustar alastairalastairprogram team1 implicit none ! Syntax check only(AST) integer, parameter :: n = 4 type(team_type) :: column, odd_even real, codimension[n,*] :: co_array integer, dimension(2) :: my_cosubscripts my_cosubscripts(:) = this_image(co_array) form team(my_cosubscripts(2), column, new_index = my_cosubscripts(1)) sync team(column) change team(column, ca[*] => co_array) ! segment 1 end team form team(2 - mod(this_image(), 2), odd_even) change team(odd_even) ! segment 2 end team end program team1 lfortran-lfortran-2f73434/tests/reference/asr-entry_05-f368f0e.json0000664000175000017500000000074215141516316025140 0ustar alastairalastair{ "basename": "asr-entry_05-f368f0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/entry_05.f90", "infile_hash": "6ba013faf5b219ebe9941b538cdb0e7566fcd7389ab49f3e09971eeb", "outfile": null, "outfile_hash": null, "stdout": "asr-entry_05-f368f0e.stdout", "stdout_hash": "ca12d6c435d1aab24bb46dfa3a7fa2c6ab67dcc86ae6745695ceb072", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_float_02-2681d16.json0000664000175000017500000000074015141516316025562 0ustar alastairalastair{ "basename": "asr-dim_float_02-2681d16", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dim_float_02.f90", "infile_hash": "b3cd2311350bf6e756c4dbf5aa99b24d1e2a004738acea5f0080194a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dim_float_02-2681d16.stderr", "stderr_hash": "35efe71f901511015f849241c9f551bf8c3f89337d62956c1606c855", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/cpp-types_05-06dea62.json0000664000175000017500000000072515141516316025127 0ustar alastairalastair{ "basename": "cpp-types_05-06dea62", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_05-06dea62.stdout", "stdout_hash": "a5794213f0c176d630f4d6bf958bdb932d7c8d293fa6eaddb5b62cfd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-assign_01-40d16c6.json0000664000175000017500000000072715141516316025170 0ustar alastairalastair{ "basename": "asr-assign_01-40d16c6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/assign_01.f90", "infile_hash": "b3907bfc11ab4a5400099590f3d20715a7fed312e26241facae934fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-assign_01-40d16c6.stderr", "stderr_hash": "22926a0ca854e3a26213cee88788e52c189e7e6d275089ff0cdc971c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-parameter_02-15e1701.stdout0000664000175000017500000000046215141516316026626 0ustar alastairalastairsubroutine a_proc() implicit none integer :: i parameter(i = 1) print *, i end subroutine a_proc module parameter_02_a implicit none integer :: i parameter(i = 2) end module parameter_02_a program parameter_02 use parameter_02_a, only: i implicit none call a_proc() print *, i end program parameter_02 lfortran-lfortran-2f73434/tests/reference/ast-do6-02ec641.stdout0000664000175000017500000002642015141516316024442 0ustar alastairalastair(TranslationUnit [(Program do6 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(correct [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 correct 0 () ) (Assignment 0 k 0 () ) (DoLoop 0 () 30 i 1 5 () [(DoLoop 0 () 30 j 1 5 () [(Assignment 30 k (+ k 1) () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 35 i 1 5 () [(DoLoop 0 () 35 j 1 5 () [(Assignment 0 k (+ k 1) () ) (Continue 35 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 40 i 1 25 () [(Assignment 0 k (+ k 1) () ) (Continue 40 () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 45 i 1 25 () [(Assignment 0 k (+ k 1) () ) (Continue 45 () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 50 i 1 5 () [(DoLoop 0 () 50 j 1 5 () [(Assignment 0 k (+ k 0) () ) (Assignment 50 k (+ k 1) () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k 0 () ) (DoLoop 0 () 60 i 1 25 () [(Assignment 0 k (+ k 0) () ) (Assignment 60 k (+ k 1) () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k (u- 30) () ) (DoLoop 0 () 65 i 1 5 () [(Assignment 0 k (+ k 1) () ) (DoLoop 0 () 65 j 1 5 () [(If 0 () (== k 25) [(GoTo 0 () 70 [] () )] [] () () () ) (Assignment 0 k (+ k 2) () ) (Continue 65 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== k 25) [(Assignment 0 j 0 () ) (GoTo 0 () 65 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 70 () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 k (u- 30) () ) (DoLoop 0 () 75 i 1 5 () [(Assignment 0 k (+ k 1) () ) (DoLoop 0 () 75 j 1 5 () [(If 0 () (== k 25) [(GoTo 0 () 80 [] () )] [] () () () ) (Assignment 0 k (+ k 2) () ) (Continue 75 () )] () () )] () () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (== k 25) [(Assignment 0 j 0 () ) (GoTo 0 () 75 [] () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Continue 80 () ) (Write 0 [(()) (())] [] [k] () ) (Assignment 0 correct (+ correct k) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Write 0 [(()) (())] [] [(/ (* 10 correct) 25) (String "% correct" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-assign-69436fa.json0000664000175000017500000000072215141516316025356 0ustar alastairalastair{ "basename": "ast_f90-assign-69436fa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/assign.f90", "infile_hash": "67fee149907196a73ab4db43412dfbf29304c02aa5f1ce2da476423e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-assign-69436fa.stdout", "stdout_hash": "2e0bd39311baa3a7f38105e69ba714fcc026427876ae89d84979f0b7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-specific_type_intrinsic-60c666c.stderr0000664000175000017500000000026115141516316030645 0ustar alastairalastairsemantic error: Argument 1 of dabs must be of double precision real type --> tests/errors/specific_type_intrinsic.f90:2:13 | 2 | print*, dabs(1) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_29-d4080f2.json0000664000175000017500000000076115141516316026101 0ustar alastairalastair{ "basename": "asr-intrinsics_29-d4080f2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_29.f90", "infile_hash": "16c52115980fa652cd9e0ade7a55786421b6801d678964a37095afbb", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_29-d4080f2.stdout", "stdout_hash": "51cb97406130aeed2967f3c3995abac5b7e237f135625daed1d445aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-div_to_mul-3aaf3c0.stdout0000664000175000017500000003162015141516316026243 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { div_to_mul: (Program (SymbolTable 2 { eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) div_to_mul [] [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (Var 2 pi) (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (RealConstant 2.000000 (Real 4) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Cast (Var 2 x) RealToReal (Real 8) () ) Div (RealConstant 2.000000 (Real 8) ) (Real 8) () ) Sub (Cast (RealConstant 1.570000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.570000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (Var 2 eps) RealToReal (Real 8) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (Var 2 x) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) () ) Sub (RealConstant 1.570000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (IntegerBinOp (Var 2 y) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-coarrays_02-6690b13.stdout0000664000175000017500000000204615141516316026500 0ustar alastairalastairprogram coarrays_02 ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541 use, intrinsic :: iso_fortran_env integer, allocatable :: node(:) ! tree nodes that this image handles. integer, allocatable :: nc(:) ! node(i) has nc(i) children. integer, allocatable :: parent(:), sub(:) ! the parent of node (i) is node (sub (i)) [parent (i)]. type(event_type), allocatable :: done(:)[:] integer :: i, j, status ! set up the tree, including allocation of all arrays. do i = 1, size(node) ! wait for children to complete if (nc(i) > 0) then event wait (done(i), until_count = nc(i), stat = status) if (status /= 0) then exit end if end if ! process node, using data from children. if (parent(i) > 0) then ! node is not the root. ! place result on image parent (i) for node node (sub) [parent (i)] ! tell parent (i) that this has been done. event post (done(sub(i))[parent(i)], stat = status) if (status /= 0) then exit end if end if end do end program coarrays_02 lfortran-lfortran-2f73434/tests/reference/ast-case_03-b14adab.stdout0000664000175000017500000001143715141516316025403 0ustar alastairalastair(TranslationUnit [(Program case03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(marks [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(a [] [] () 1 Equal ()) (b [] [] () 2 Equal ())] () )] [(Assignment 0 marks 94 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange (+ 40 b) () )] () [(Print 0 () [(String "Pass!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () (- 39 a) )] () [(Print 0 () [(String "Failed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 marks (u- 1) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange (+ 40 b) () )] () [(Print 0 () [(String "Pass!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 0 (- 39 a) )] () [(Print 0 () [(String "Failed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-modules_05-c35e0ac.json0000664000175000017500000000075015141516316025512 0ustar alastairalastair{ "basename": "ast-modules_05-c35e0ac", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_05.f90", "infile_hash": "eaea53640868ce2121656fd7b87e06fe464e05c8e9a0cf731a7a1dd9", "outfile": null, "outfile_hash": null, "stdout": "ast-modules_05-c35e0ac.stdout", "stdout_hash": "97a5d5fb477a65d5a96f3c9783f24c971e560937d0f6940b317646f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-substring_endidx-0f7e2c9.json0000664000175000017500000000075415141516316027047 0ustar alastairalastair{ "basename": "asr-substring_endidx-0f7e2c9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/substring_endidx.f90", "infile_hash": "822fddebe2c138bf6639648f87d91376999e080c3364c20e939b4b35", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-substring_endidx-0f7e2c9.stderr", "stderr_hash": "0364385c1f5a421621582c1588a156629243fa24183e1913f217c691", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr6-a926072.stdout0000664000175000017500000000657315141516316027704 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f2: (Variable 2 f2 [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 f2) (RealConstant 5.300000 (Real 4) ) () .false. .false. )] (Var 2 f2) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_simd-4dab78a.json0000664000175000017500000000102715141516316030777 0ustar alastairalastair{ "basename": "asr-continue_compilation_simd-4dab78a", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_simd.f90", "infile_hash": "bcbf2032f14e24bf22ad1f9c443f7511fbb94f8d8053425a5ac5512f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_simd-4dab78a.stderr", "stderr_hash": "7dbe5dce0f92a089dd83bcff73234bedef218e3d10328e83bf78c9cb", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/fortran-expr5-3a279bb.stdout0000664000175000017500000000017015141516316025760 0ustar alastairalastairprogram expr_05 implicit none integer(4) :: x x = (2 + 3)*5 if (x == 25) then error stop end if end program expr_05 lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_09-2af35ec.stdout0000664000175000017500000000527715141516316026620 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_09: (Program (SymbolTable 2 { z: (Variable 2 z [] Local (RealConstant 0.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_09 [] [(If () (RealCompare (Var 2 z) Lt (TypeInquiry Tiny (Real 4) (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) ) (Logical 4) () ) [(Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_array_03-b7f9799.json0000664000175000017500000000112515141516316026741 0ustar alastairalastair{ "basename": "asr-template_array_03-b7f9799", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_array_03.f90", "infile_hash": "0a5f1f988c49d757a19f81d842de7eea019605572d3da0afa04570aa", "outfile": null, "outfile_hash": null, "stdout": "asr-template_array_03-b7f9799.stdout", "stdout_hash": "8a8d5ef3ee1759290527ba224d11f5beae2644a6154376ef7b52bafd", "stderr": "asr-template_array_03-b7f9799.stderr", "stderr_hash": "8e5e5eb3564a9c02c74e592aa5fdd1ce96bc1b68565e23b2b4ad7e98", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-modules_06-7f94d73.stdout0000664000175000017500000000536715141516316025761 0ustar alastairalastair(TranslationUnit [(Module modules_06_b (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(b [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function b [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 b 5 () )] [] [] )] ) (Module modules_06_a () [(Use [] modules_06_b [(UseSymbol b () )] .true. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(a [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function a [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 a (+ 3 (FuncCallOrArray b [] [] [] [] [] )) () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutines_10-c3e0d28.json0000664000175000017500000000076415141516316026352 0ustar alastairalastair{ "basename": "ast-subroutines_10-c3e0d28", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_10.f90", "infile_hash": "97868109f521b42642b328d8b79be02e7668b5819dc820880ec85da0", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_10-c3e0d28.stdout", "stdout_hash": "c085bcf41cf64ac470b7cbdd70cf531c7eaf2e5e4858c4e4e339303a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit2-d78b357.json0000664000175000017500000000072015141516316025305 0ustar alastairalastair{ "basename": "asr-implicit2-d78b357", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit2.f90", "infile_hash": "a67613a87d4efd0aec316a23fdcc5490e286f34fc588479924d36fae", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit2-d78b357.stderr", "stderr_hash": "6a0c9f6fad4cbad2e56adede46f39283a8a953f87a2e9d5a3a74903b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-derived_type_03-a9e3c15.json0000664000175000017500000000075115141516316026451 0ustar alastairalastair{ "basename": "asr-derived_type_03-a9e3c15", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_03.f90", "infile_hash": "f6dd480af400f08cea170112f8ab92301acab80856807fb65b5cf387", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_03-a9e3c15.stderr", "stderr_hash": "909ba5fc73d1e33bd4e352e590aff0bb2c6fcc0deb2d33eff3fbe2f0", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-modules_36-53c9a79.stdout0000664000175000017500000006421515141516316026141 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %fpm_run_settings_class = type <{ i32 (...)**, %fpm_run_settings* }> %fpm_run_settings = type { %fpm_build_settings, %string_descriptor, %string_descriptor, %string_descriptor, i1 } %fpm_build_settings = type { i1 } %fpm_build_settings_class = type <{ i32 (...)**, %fpm_build_settings* }> @0 = private unnamed_addr constant [47 x i8] c"__libasr_created__intrinsic_array_function_Any\00", align 1 @1 = private unnamed_addr constant [186 x i8] c"At 24:14 of file tests/../integration_tests/modules_36.f90\0AArray shape mismatch in assignment to '%s'. Tried to match size %d of dimension %d of LHS with size %d of dimension %d of RHS.\00", align 1 @2 = private unnamed_addr constant [47 x i8] c"__libasr_created__intrinsic_array_function_Any\00", align 1 @3 = private unnamed_addr constant [179 x i8] c"At 24:14 of file tests/../integration_tests/modules_36.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @4 = private unnamed_addr constant [6 x i8] c"found\00", align 1 @5 = private unnamed_addr constant [179 x i8] c"At 24:19 of file tests/../integration_tests/modules_36.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @6 = private unnamed_addr constant [35 x i8] c"_lcompilers_Any_4_1_0_logical____0\00", align 1 @7 = private unnamed_addr constant [202 x i8] c"At 24:14 of file tests/../integration_tests/modules_36.f90\0ARuntime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1 @string_const_data = private constant [0 x i8] zeroinitializer @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([0 x i8], [0 x i8]* @string_const_data, i32 0, i32 0), i64 0 }> @8 = private unnamed_addr constant [5 x i8] c"mask\00", align 1 @9 = private unnamed_addr constant [179 x i8] c"At 24:10 of file tests/../integration_tests/modules_36.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @_Name_fpm_build_settings = private unnamed_addr constant [19 x i8] c"fpm_build_settings\00", align 1 @_Type_Info_fpm_build_settings = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([19 x i8], [19 x i8]* @_Name_fpm_build_settings, i32 0, i32 0) }, align 8 @_VTable_fpm_build_settings = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_fpm_build_settings to i8*), i8* bitcast (void (i8*, i8*)* @_copy_modules_36_fpm_main_01_fpm_build_settings to i8*), i8* bitcast (void (i8**)* @_allocate_struct_modules_36_fpm_main_01_fpm_build_settings to i8*)] }, align 8 @_Name_fpm_run_settings = private unnamed_addr constant [17 x i8] c"fpm_run_settings\00", align 1 @_Type_Info_fpm_run_settings = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @_Name_fpm_run_settings, i32 0, i32 0), i8* bitcast ({ i8* }* @_Type_Info_fpm_build_settings to i8*) }, align 8 @_VTable_fpm_run_settings = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_Type_Info_fpm_run_settings to i8*), i8* bitcast (void (i8*, i8*)* @_copy_modules_36_fpm_main_01_fpm_run_settings to i8*), i8* bitcast (void (i8**)* @_allocate_struct_modules_36_fpm_main_01_fpm_run_settings to i8*)] }, align 8 define i1 @_lcompilers_Any_4_1_0_logical____0(i8* %mask, i32* %__1mask) { .entry: %__1_i = alloca i32, align 4 %_lcompilers_Any_4_1_0 = alloca i1, align 1 store i1 false, i1* %_lcompilers_Any_4_1_0, align 1 store i32 0, i32* %__1_i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %0 = load i32, i32* %__1_i, align 4 %1 = add i32 %0, 1 %2 = load i32, i32* %__1mask, align 4 %3 = add i32 %2, 1 %4 = sub i32 %3, 1 %5 = icmp sle i32 %1, %4 br i1 %5, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %6 = load i32, i32* %__1_i, align 4 %7 = add i32 %6, 1 store i32 %7, i32* %__1_i, align 4 %8 = load i1, i1* %_lcompilers_Any_4_1_0, align 1 %9 = load i32, i32* %__1_i, align 4 %10 = load i32, i32* %__1mask, align 4 %11 = sub i32 %9, 1 %12 = mul i32 1, %11 %13 = add i32 0, %12 %14 = add i32 1, %10 %15 = sub i32 %14, 1 %16 = icmp slt i32 %9, 1 %17 = icmp sgt i32 %9, %15 %18 = or i1 %16, %17 br i1 %18, label %then, label %ifcont then: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @8, i32 0, i32 0), i32 %9, i32 1, i32 1, i32 %15) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %19 = mul i32 1, %10 %20 = getelementptr inbounds i8, i8* %mask, i32 %13 %21 = load i8, i8* %20, align 1 %22 = icmp ne i8 %21, 0 %23 = icmp eq i1 %8, false %24 = select i1 %23, i1 %22, i1 %8 store i1 %24, i1* %_lcompilers_Any_4_1_0, align 1 br label %loop.head loop.end: ; preds = %loop.head br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE__lcompilers_Any_4_1_0_logical____0 FINALIZE_SYMTABLE__lcompilers_Any_4_1_0_logical____0: ; preds = %return %25 = load i1, i1* %_lcompilers_Any_4_1_0, align 1 ret i1 %25 } define void @__module_modules_36_fpm_main_01_cmd_run(%fpm_run_settings_class* %settings, i1* %test) { .entry: %call_arg_value = alloca i32, align 4 %array_bound14 = alloca i32, align 4 %array_bound10 = alloca i32, align 4 %array_bound = alloca i32, align 4 %array_size1 = alloca i32, align 4 %array_size = alloca i32, align 4 %__libasr_created__intrinsic_array_function_Any = alloca [2 x i8], align 1 %__libasr_created__intrinsic_array_function_Any1 = alloca i1, align 1 %__libasr_index_0_ = alloca i32, align 4 %__libasr_index_0_1 = alloca i32, align 4 %found = alloca [2 x i8], align 1 %toomany = alloca i1, align 1 br i1 true, label %then, label %else then: ; preds = %.entry store i32 2, i32* %array_size, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %0 = load i32, i32* %array_size, align 4 br i1 true, label %then2, label %else3 then2: ; preds = %ifcont store i32 2, i32* %array_size1, align 4 br label %ifcont4 else3: ; preds = %ifcont br label %ifcont4 ifcont4: ; preds = %else3, %then2 %1 = load i32, i32* %array_size1, align 4 %2 = icmp ne i32 %1, %0 br i1 %2, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @0, i32 0, i32 0), i32 %0, i32 1, i32 %1, i32 1) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 br i1 true, label %then7, label %else8 then7: ; preds = %ifcont6 store i32 1, i32* %array_bound, align 4 br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %3 = load i32, i32* %array_bound, align 4 store i32 %3, i32* %__libasr_index_0_1, align 4 br i1 true, label %then11, label %else12 then11: ; preds = %ifcont9 store i32 1, i32* %array_bound10, align 4 br label %ifcont13 else12: ; preds = %ifcont9 br label %ifcont13 ifcont13: ; preds = %else12, %then11 %4 = load i32, i32* %array_bound10, align 4 %5 = sub i32 %4, 1 store i32 %5, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont21, %ifcont13 %6 = load i32, i32* %__libasr_index_0_, align 4 %7 = add i32 %6, 1 br i1 true, label %then15, label %else16 then15: ; preds = %loop.head store i32 2, i32* %array_bound14, align 4 br label %ifcont17 else16: ; preds = %loop.head br label %ifcont17 ifcont17: ; preds = %else16, %then15 %8 = load i32, i32* %array_bound14, align 4 %9 = icmp sle i32 %7, %8 br i1 %9, label %loop.body, label %loop.end loop.body: ; preds = %ifcont17 %10 = load i32, i32* %__libasr_index_0_, align 4 %11 = add i32 %10, 1 store i32 %11, i32* %__libasr_index_0_, align 4 %12 = load i32, i32* %__libasr_index_0_, align 4 %13 = sub i32 %12, 1 %14 = mul i32 1, %13 %15 = add i32 0, %14 %16 = icmp slt i32 %12, 1 %17 = icmp sgt i32 %12, 2 %18 = or i1 %16, %17 br i1 %18, label %then18, label %ifcont19 then18: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @2, i32 0, i32 0), i32 %12, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont19: ; preds = %loop.body %19 = getelementptr [2 x i8], [2 x i8]* %__libasr_created__intrinsic_array_function_Any, i32 0, i32 %15 %20 = load i32, i32* %__libasr_index_0_1, align 4 %21 = sub i32 %20, 1 %22 = mul i32 1, %21 %23 = add i32 0, %22 %24 = icmp slt i32 %20, 1 %25 = icmp sgt i32 %20, 2 %26 = or i1 %24, %25 br i1 %26, label %then20, label %ifcont21 then20: ; preds = %ifcont19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @4, i32 0, i32 0), i32 %20, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont21: ; preds = %ifcont19 %27 = getelementptr [2 x i8], [2 x i8]* %found, i32 0, i32 %23 %28 = load i8, i8* %27, align 1 %29 = icmp ne i8 %28, 0 %30 = xor i1 %29, true %31 = zext i1 %30 to i8 store i8 %31, i8* %19, align 1 %32 = load i32, i32* %__libasr_index_0_1, align 4 %33 = add i32 %32, 1 store i32 %33, i32* %__libasr_index_0_1, align 4 br label %loop.head loop.end: ; preds = %ifcont17 br i1 false, label %then22, label %ifcont23 then22: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @6, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont23: ; preds = %loop.end %34 = getelementptr [2 x i8], [2 x i8]* %__libasr_created__intrinsic_array_function_Any, i32 0, i32 0 store i32 2, i32* %call_arg_value, align 4 %35 = call i1 @_lcompilers_Any_4_1_0_logical____0(i8* %34, i32* %call_arg_value) store i1 %35, i1* %__libasr_created__intrinsic_array_function_Any1, align 1 %36 = load i1, i1* %__libasr_created__intrinsic_array_function_Any1, align 1 %37 = load i1, i1* %toomany, align 1 %38 = load i1, i1* %test, align 1 %39 = xor i1 %38, true %40 = icmp eq i1 %37, false %41 = select i1 %40, i1 %37, i1 %39 %42 = load i1, i1* %toomany, align 1 %43 = getelementptr %fpm_run_settings_class, %fpm_run_settings_class* %settings, i32 0, i32 1 %44 = load %fpm_run_settings*, %fpm_run_settings** %43, align 8 %45 = getelementptr %fpm_run_settings, %fpm_run_settings* %44, i32 0, i32 3 %46 = getelementptr %string_descriptor, %string_descriptor* %45, i32 0, i32 0 %47 = load i8*, i8** %46, align 8 %48 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %49 = call i32 @str_compare(i8* %47, i64 6, i8* %48, i64 0) %50 = icmp ne i32 %49, 0 %51 = icmp eq i1 %42, false %52 = select i1 %51, i1 %42, i1 %50 %53 = icmp eq i1 %41, false %54 = select i1 %53, i1 %52, i1 %41 %55 = getelementptr %fpm_run_settings_class, %fpm_run_settings_class* %settings, i32 0, i32 1 %56 = load %fpm_run_settings*, %fpm_run_settings** %55, align 8 %57 = getelementptr %fpm_run_settings, %fpm_run_settings* %56, i32 0, i32 0 %58 = getelementptr %fpm_build_settings, %fpm_build_settings* %57, i32 0, i32 0 %59 = load i1, i1* %58, align 1 %60 = xor i1 %59, true %61 = icmp eq i1 %54, false %62 = select i1 %61, i1 %54, i1 %60 %63 = icmp eq i1 %36, false %64 = select i1 %63, i1 %62, i1 %36 br i1 %64, label %then24, label %else25 then24: ; preds = %ifcont23 br label %ifcont26 else25: ; preds = %ifcont23 br label %ifcont26 ifcont26: ; preds = %else25, %then24 br label %return return: ; preds = %ifcont26 br label %FINALIZE_SYMTABLE_cmd_run FINALIZE_SYMTABLE_cmd_run: ; preds = %return ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i32 @str_compare(i8*, i64, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i1, align 1 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %settings = alloca %fpm_run_settings, align 8 %2 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 2 store %string_descriptor zeroinitializer, %string_descriptor* %2, align 1 %3 = getelementptr %string_descriptor, %string_descriptor* %2, i32 0, i32 1 store i64 4, i64* %3, align 4 %4 = getelementptr %string_descriptor, %string_descriptor* %2, i32 0, i32 0 %5 = call i8* @_lfortran_malloc(i64 4) store i8* %5, i8** %4, align 8 %6 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 4 %7 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 1 %8 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 3 store %string_descriptor zeroinitializer, %string_descriptor* %8, align 1 %9 = getelementptr %string_descriptor, %string_descriptor* %8, i32 0, i32 1 store i64 6, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %8, i32 0, i32 0 %11 = call i8* @_lfortran_malloc(i64 6) store i8* %11, i8** %10, align 8 %12 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 0 %13 = getelementptr %fpm_build_settings, %fpm_build_settings* %12, i32 0, i32 0 store i1 false, i1* %13, align 1 %14 = alloca %fpm_run_settings_class, align 8 %15 = getelementptr %fpm_run_settings_class, %fpm_run_settings_class* %14, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_VTable_fpm_run_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %15, align 8 %16 = getelementptr %fpm_run_settings_class, %fpm_run_settings_class* %14, i32 0, i32 1 store %fpm_run_settings* %settings, %fpm_run_settings** %16, align 8 store i1 true, i1* %call_arg_value, align 1 call void @__module_modules_36_fpm_main_01_cmd_run(%fpm_run_settings_class* %14, i1* %call_arg_value) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_modules_36 FINALIZE_SYMTABLE_modules_36: ; preds = %return br label %Finalize_Variable_settings Finalize_Variable_settings: ; preds = %FINALIZE_SYMTABLE_modules_36 br label %"Finalize_struct_fpm_run_settings's_name_member" "Finalize_struct_fpm_run_settings's_name_member": ; preds = %Finalize_Variable_settings %17 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 1 %18 = getelementptr %string_descriptor, %string_descriptor* %17, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = icmp eq i8* %19, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %"Finalize_struct_fpm_run_settings's_name_member" call void @_lfortran_free(i8* %19) br label %free_done free_done: ; preds = %free_nonnull, %"Finalize_struct_fpm_run_settings's_name_member" br label %"Finalize_struct_fpm_run_settings's_args_member" "Finalize_struct_fpm_run_settings's_args_member": ; preds = %free_done %21 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 2 %22 = getelementptr %string_descriptor, %string_descriptor* %21, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = icmp eq i8* %23, null br i1 %24, label %free_done2, label %free_nonnull1 free_nonnull1: ; preds = %"Finalize_struct_fpm_run_settings's_args_member" call void @_lfortran_free(i8* %23) br label %free_done2 free_done2: ; preds = %free_nonnull1, %"Finalize_struct_fpm_run_settings's_args_member" br label %"Finalize_struct_fpm_run_settings's_runner_member" "Finalize_struct_fpm_run_settings's_runner_member": ; preds = %free_done2 %25 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 3 %26 = getelementptr %string_descriptor, %string_descriptor* %25, i32 0, i32 0 %27 = load i8*, i8** %26, align 8 %28 = icmp eq i8* %27, null br i1 %28, label %free_done4, label %free_nonnull3 free_nonnull3: ; preds = %"Finalize_struct_fpm_run_settings's_runner_member" call void @_lfortran_free(i8* %27) br label %free_done4 free_done4: ; preds = %free_nonnull3, %"Finalize_struct_fpm_run_settings's_runner_member" %29 = getelementptr %fpm_run_settings, %fpm_run_settings* %settings, i32 0, i32 4 ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) define linkonce_odr void @_copy_modules_36_fpm_main_01_fpm_build_settings(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %fpm_build_settings* %3 = bitcast i8* %1 to %fpm_build_settings* %4 = getelementptr %fpm_build_settings, %fpm_build_settings* %2, i32 0, i32 0 %5 = load i1, i1* %4, align 1 %6 = getelementptr %fpm_build_settings, %fpm_build_settings* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store i1 %5, i1* %6, align 1 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_modules_36_fpm_main_01_fpm_build_settings(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %fpm_build_settings_class* %4 = bitcast %fpm_build_settings_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_VTable_fpm_build_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %fpm_build_settings_class, %fpm_build_settings_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 1) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 1, i1 false) %7 = bitcast i8* %6 to %fpm_build_settings* store %fpm_build_settings* %7, %fpm_build_settings** %5, align 8 %8 = getelementptr %fpm_build_settings, %fpm_build_settings* %7, i32 0, i32 0 store i1 false, i1* %8, align 1 ret void } ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_modules_36_fpm_main_01_fpm_run_settings(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %fpm_run_settings* %3 = bitcast i8* %1 to %fpm_run_settings* %4 = getelementptr %fpm_run_settings, %fpm_run_settings* %2, i32 0, i32 1 %5 = getelementptr %fpm_run_settings, %fpm_run_settings* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry %6 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 0 %7 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 1 %8 = getelementptr %string_descriptor, %string_descriptor* %4, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 call void @_lfortran_strcpy(i8** %6, i64* %7, i8 0, i8 0, i8* %9, i64 5) br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %10 = getelementptr %fpm_run_settings, %fpm_run_settings* %2, i32 0, i32 2 %11 = getelementptr %fpm_run_settings, %fpm_run_settings* %3, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont %12 = getelementptr %string_descriptor, %string_descriptor* %11, i32 0, i32 0 %13 = getelementptr %string_descriptor, %string_descriptor* %11, i32 0, i32 1 %14 = getelementptr %string_descriptor, %string_descriptor* %10, i32 0, i32 0 %15 = load i8*, i8** %14, align 8 call void @_lfortran_strcpy(i8** %12, i64* %13, i8 0, i8 0, i8* %15, i64 4) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %16 = getelementptr %fpm_run_settings, %fpm_run_settings* %2, i32 0, i32 3 %17 = getelementptr %fpm_run_settings, %fpm_run_settings* %3, i32 0, i32 3 br i1 true, label %then4, label %else5 then4: ; preds = %ifcont3 %18 = getelementptr %string_descriptor, %string_descriptor* %17, i32 0, i32 0 %19 = getelementptr %string_descriptor, %string_descriptor* %17, i32 0, i32 1 %20 = getelementptr %string_descriptor, %string_descriptor* %16, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 call void @_lfortran_strcpy(i8** %18, i64* %19, i8 0, i8 0, i8* %21, i64 6) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %22 = getelementptr %fpm_run_settings, %fpm_run_settings* %2, i32 0, i32 4 %23 = load i1, i1* %22, align 1 %24 = getelementptr %fpm_run_settings, %fpm_run_settings* %3, i32 0, i32 4 br i1 true, label %then7, label %else8 then7: ; preds = %ifcont6 store i1 %23, i1* %24, align 1 br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %25 = getelementptr %fpm_run_settings, %fpm_run_settings* %2, i32 0, i32 0 %26 = getelementptr %fpm_run_settings, %fpm_run_settings* %3, i32 0, i32 0 %27 = getelementptr %fpm_build_settings, %fpm_build_settings* %25, i32 0, i32 0 %28 = load i1, i1* %27, align 1 %29 = getelementptr %fpm_build_settings, %fpm_build_settings* %26, i32 0, i32 0 br i1 true, label %then10, label %else11 then10: ; preds = %ifcont9 store i1 %28, i1* %29, align 1 br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 ret void } define linkonce_odr void @_allocate_struct_modules_36_fpm_main_01_fpm_run_settings(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %fpm_run_settings_class* %4 = bitcast %fpm_run_settings_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_VTable_fpm_run_settings, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %fpm_run_settings_class, %fpm_run_settings_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 50) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 50, i1 false) %7 = bitcast i8* %6 to %fpm_run_settings* store %fpm_run_settings* %7, %fpm_run_settings** %5, align 8 %8 = getelementptr %fpm_run_settings, %fpm_run_settings* %7, i32 0, i32 2 store %string_descriptor zeroinitializer, %string_descriptor* %8, align 1 %9 = getelementptr %string_descriptor, %string_descriptor* %8, i32 0, i32 1 store i64 4, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %8, i32 0, i32 0 %11 = call i8* @_lfortran_malloc(i64 4) store i8* %11, i8** %10, align 8 %12 = getelementptr %fpm_run_settings, %fpm_run_settings* %7, i32 0, i32 4 %13 = getelementptr %fpm_run_settings, %fpm_run_settings* %7, i32 0, i32 1 %14 = getelementptr %fpm_run_settings, %fpm_run_settings* %7, i32 0, i32 3 store %string_descriptor zeroinitializer, %string_descriptor* %14, align 1 %15 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 1 store i64 6, i64* %15, align 4 %16 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 0 %17 = call i8* @_lfortran_malloc(i64 6) store i8* %17, i8** %16, align 8 %18 = getelementptr %fpm_run_settings, %fpm_run_settings* %7, i32 0, i32 0 %19 = getelementptr %fpm_build_settings, %fpm_build_settings* %18, i32 0, i32 0 store i1 false, i1* %19, align 1 ret void } declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) declare void @_lpython_free_argv() declare void @_lfortran_free(i8*) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-expr_13-57b03a6.json0000664000175000017500000000073715141516316024666 0ustar alastairalastair{ "basename": "asr-expr_13-57b03a6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_13.f90", "infile_hash": "2eaa9b9631c66ea28ea4dc4ede8f1a3717f4a929a68455837525f54f", "outfile": null, "outfile_hash": null, "stdout": "asr-expr_13-57b03a6.stdout", "stdout_hash": "6839eb57639d2c54366a95c7ed4ccf3290a6f15c029f38dab7dcff9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_transpose_01-f8038ce.json0000664000175000017500000000076515141516316027401 0ustar alastairalastair{ "basename": "asr-matrix_transpose_01-f8038ce", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_transpose_01.f90", "infile_hash": "0c478df59b5d52e60f6b4056b366a18dcb7652c887a2edb4745bcf9d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_transpose_01-f8038ce.stderr", "stderr_hash": "ee6e99f9b10deebcb64718039cba89686a12bc1bf0e1c39e58588ca9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-modules_60-baa1105.json0000664000175000017500000000075015141516316025420 0ustar alastairalastair{ "basename": "asr-modules_60-baa1105", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_60.f90", "infile_hash": "568155f82ef97833e2766041c53cec7324de6bf8d2c418af15782fa3", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_60-baa1105.stdout", "stdout_hash": "b863a653ebe6e35b20d096d0312537d9e993911295a5d4fc48a9d746", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-attributes1-9309f25.json0000664000175000017500000000072615141516316025606 0ustar alastairalastair{ "basename": "ast-attributes1-9309f25", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/attributes1.f90", "infile_hash": "895bd51041a1a5b92a95e7ae70f7475a5b305fdd6f8fcd525a30f46a", "outfile": null, "outfile_hash": null, "stdout": "ast-attributes1-9309f25.stdout", "stdout_hash": "6dd04b5bce018bd05d59df51935160092117d85e8a87217d79f1d467", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-string_01-9625208.json0000664000175000017500000000074515141516316025064 0ustar alastairalastair{ "basename": "ast-string_01-9625208", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "ast-string_01-9625208.stdout", "stdout_hash": "0653853f1250c414f1009951e98da3be4d35f7a22a47fe599dc34198", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-type_casting_01-4e8a892.stderr0000664000175000017500000000035415141516316026740 0ustar alastairalastairsemantic error: Type mismatch in array initialization. Enable logical casting by setting `--logical-casting = true` --> tests/errors/type_casting_01.f90:3:5 | 3 | logical :: x(3) = [1, 1, 0] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-save1-7ce7ccf.stderr0000664000175000017500000000173115141516316025203 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:2:13 | 2 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:8:13 | 8 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:20:17 | 20 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement warning: Assuming implicit save attribute for variable declaration --> tests/save1.f90:26:17 | 26 | real :: x = 5, z | ^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/asr-declaration1-880025a.json0000664000175000017500000000073115141516316025665 0ustar alastairalastair{ "basename": "asr-declaration1-880025a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/declaration1.f90", "infile_hash": "cd7f955f4afa5639a06727dad7fd12ea533d7de45b0159dc213a6490", "outfile": null, "outfile_hash": null, "stdout": "asr-declaration1-880025a.stdout", "stdout_hash": "bc22388c9975f3b8f0bae7eafbb8dee10933e06f48336bd383f58ef5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-volatile_03-914e4e5.json0000664000175000017500000000075615141516316025725 0ustar alastairalastair{ "basename": "llvm-volatile_03-914e4e5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/volatile_03.f90", "infile_hash": "3b3be17b65561543509ed16a60574cc3a3e7c9f0f574b21b8b02c026", "outfile": null, "outfile_hash": null, "stdout": "llvm-volatile_03-914e4e5.stdout", "stdout_hash": "e44cd9cd70b67cdff6b7df88d9ab29f2de33be2ad5605c83ccadbf2a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_size-aaed99f.json0000664000175000017500000000076715141516316026663 0ustar alastairalastair{ "basename": "llvm-arrays_01_size-aaed99f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01_size-aaed99f.stdout", "stdout_hash": "a6ef5c34ff7bf58132535e5fa8730abf0feae9153d0d433dad790f36", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-maskr_incorrect_bit_size-0d2cb26.json0000664000175000017500000000100415141516316030521 0ustar alastairalastair{ "basename": "asr-maskr_incorrect_bit_size-0d2cb26", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/maskr_incorrect_bit_size.f90", "infile_hash": "55ab6743eeb879b04470a9eafcb50e5fc4b79731f759b1bb0f41d6b2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-maskr_incorrect_bit_size-0d2cb26.stderr", "stderr_hash": "245a1c253a53c1c9b0e01daf29fa89c70f4bcea5c93cb74c0d1b0818", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout0000664000175000017500000000652215141516316031436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_where-where_02-1839d96.stdout0000664000175000017500000002567115141516316026710 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 3.500000 (Real 4) ) () .false. .false. ) (If () (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.500000 (Real 4) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 8 [1.50000000e+00, 1.50000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-bin_op_complex_dp-8ead434.stdout0000664000175000017500000000565215141516316027711 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_8 = type <{ double, double }> %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [32 x i8] c"{R4,R4},{R8,R8},{R4,R4},{R8,R8}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca %complex_8, align 8 %v = alloca %complex_8, align 8 %x = alloca %complex_4, align 8 %zero = alloca %complex_4, align 8 store %complex_4 <{ float 0x3FC24924A0000000, float 0.000000e+00 }>, %complex_4* %zero, align 1 store %complex_8 <{ double 0x3FC2492492492492, double 0.000000e+00 }>, %complex_8* %u, align 1 store %complex_8 <{ double 0x3FC2492492492492, double 0.000000e+00 }>, %complex_8* %v, align 1 store %complex_4 <{ float 0x3FC24924A0000000, float 0.000000e+00 }>, %complex_4* %x, align 1 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %complex_4* %zero, %complex_8* %v, %complex_4* %x, %complex_8* %u) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_bin_op_complex_dp FINALIZE_SYMTABLE_bin_op_complex_dp: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-subroutine1-fdc40b3.stdout0000664000175000017500000000362715141516316026377 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* x i) () )] () () )] [] [] ) (Subroutine h [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 x 1 () ) (DoLoop 0 () 0 i 1 10 () [(Assignment 0 x (* i x) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-expr_05-c1f66bd.json0000664000175000017500000000073715141516316025035 0ustar alastairalastair{ "basename": "ast-expr_05-c1f66bd", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_05.f90", "infile_hash": "ab6fcfdb7d7b127b347b822368c1a3d22c7241a82453de78dd535c05", "outfile": null, "outfile_hash": null, "stdout": "ast-expr_05-c1f66bd.stdout", "stdout_hash": "cd47854fd8f38c01cefa752ff4fbd4978cd2e378be04a364390a98f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-critical1-30285fa.stdout0000664000175000017500000000127715141516316026312 0ustar alastairalastairprogram critical1 implicit none integer :: joblist[*], job integer :: a, b integer :: IntegerSample character(len=50) :: Sample if (this_image() == 1) then read(*, *) joblist end if sync all do critical job = joblist[1] joblist[1] = job - 1 end critical ! >>>>>>>> Syntax check(AST) >>>>>>>> critical () IntegerSample = 0 end critical critical (stat = IntegerSample) Sample = "Error message" end critical critical (errmsg = Sample) Sample = "Error message" end critical ! <<<<<<<< Syntax check(AST) <<<<<<<< if (job > 0) then b = a**2 + b**2 else exit end if end do sync all end program critical1 lfortran-lfortran-2f73434/tests/reference/ast_f90-case_04-42ea8ac.stdout0000664000175000017500000000027715141516316026013 0ustar alastairalastairprogram case_04 implicit none integer :: i i = 4 select case (i) case (1) print *, "1" case (2, 3:5, 6, 8:10) print *, "2,3:5,6,8:10" end select end program case_04 lfortran-lfortran-2f73434/tests/reference/run-integerStringInput-16e7ff7.stderr0000664000175000017500000000005415141516316027710 0ustar alastairalastairError: Invalid input for int32_t from file. lfortran-lfortran-2f73434/tests/reference/asr-intrinsics10-ccd6322.stderr0000664000175000017500000000025015141516316026332 0ustar alastairalastairsemantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/intrinsics10.f90:4:14 | 4 | print *, ieor(x, y) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-expr_06-2de4136.stdout0000664000175000017500000000370715141516316025242 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { expr_06: (Program (SymbolTable 2 { x: (Variable 2 x [] Local (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) expr_06 [] [(Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_01-96f2648.stderr0000664000175000017500000000026515141516316030437 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_01.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-line_continuation_03-8570dc1.json0000664000175000017500000000100615141516316027424 0ustar alastairalastair{ "basename": "ast-line_continuation_03-8570dc1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/line_continuation_03.f90", "infile_hash": "e87783d3a61e68a07124b8821a85b1916933fb83e5fbc63d09e3f32d", "outfile": null, "outfile_hash": null, "stdout": "ast-line_continuation_03-8570dc1.stdout", "stdout_hash": "384a6183b9e02125b7c7be63aee3413ec4216c8b7a21a07132c2daa7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/tokens-boz1-719113d.stdout0000664000175000017500000000107415141516316025264 0ustar alastairalastair(TOKEN "BOZ constant" b'101') (NEWLINE) (TOKEN "BOZ constant" B'101') (NEWLINE) (TOKEN "BOZ constant" b"101") (NEWLINE) (TOKEN "BOZ constant" B"101") (NEWLINE) (TOKEN "BOZ constant" o'174') (NEWLINE) (TOKEN "BOZ constant" O'106') (NEWLINE) (TOKEN "BOZ constant" o"151") (NEWLINE) (TOKEN "BOZ constant" O"131") (NEWLINE) (TOKEN "BOZ constant" z'194a') (NEWLINE) (TOKEN "BOZ constant" Z'b108') (NEWLINE) (TOKEN "BOZ constant" z"f161") (NEWLINE) (TOKEN "BOZ constant" Z"1d31") (NEWLINE) (TOKEN "BOZ constant" z"C1B1") (NEWLINE) (TOKEN "BOZ constant" Z"1E3A") (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/cpp-types_06-a5c2d06.json0000664000175000017500000000072515141516316025125 0ustar alastairalastair{ "basename": "cpp-types_06-a5c2d06", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_06.f90", "infile_hash": "821a3f29390ed022c7e72bdf2e4f9bace059d335abe1d1b729ac6d22", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_06-a5c2d06.stdout", "stdout_hash": "df6601b7c7cd957da0568ab0bff6f60e37caec621cb495454b8cc71d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-goto_02-fc47ad0.json0000664000175000017500000000105515141516316025013 0ustar alastairalastair{ "basename": "ast-goto_02-fc47ad0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/goto_02.f90", "infile_hash": "2bd2e5ad2c2506c3da506b82aa7d12c7877206410c2d7637f556d10b", "outfile": null, "outfile_hash": null, "stdout": "ast-goto_02-fc47ad0.stdout", "stdout_hash": "0f83a7c1c8ae99021a94f1cfaaccde9a8bdf15ac5a5be3db3227342d", "stderr": "ast-goto_02-fc47ad0.stderr", "stderr_hash": "317795e3eb8121d18463c9531b060be0c248a0b34d70a2961d6d2047", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form3-1e78b3b.json0000664000175000017500000000074115141516316025673 0ustar alastairalastair{ "basename": "ast-fixed_form3-1e78b3b", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form3.f", "infile_hash": "fe46caff97c3a0f7399147dbe980a74d686d086dbc36b076f30d17df", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form3-1e78b3b.stdout", "stdout_hash": "65c3bbc021c20afde386d4f160263645f0c62e5476649fd2548cac44", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-selectrank1-ee68c35.json0000664000175000017500000000074115141516316026367 0ustar alastairalastair{ "basename": "ast_f90-selectrank1-ee68c35", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/selectrank1.f90", "infile_hash": "7bd5ab94da79a773b306a0b17ac6754bf7d5bb9dc2df46631d00593c", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-selectrank1-ee68c35.stdout", "stdout_hash": "b37b4872e11fd46535a1981e2881d9fb333e9bb5b5af51529b854fcf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_01b-bd911f4.stdout0000664000175000017500000022765715141516316027142 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_add_01b: (Program (SymbolTable 13 { add_t: (ExternalSymbol 13 add_t 2 add_t template_add_01b_m [] add_t Public ), r: (ExternalSymbol 13 r 2 r template_add_01b_m [] r Public ), test_template: (ExternalSymbol 13 test_template 2 test_template template_add_01b_m [] test_template Public ) }) template_add_01b [template_add_01b_m] [(SubroutineCall 13 test_template () [] () .false. )] ), template_add_01b_m: (Module (SymbolTable 2 { add_t: (Template (SymbolTable 5 { add_generic: (Function (SymbolTable 7 { x: (Variable 7 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 7 x) (Var 7 y)] [(Assignment (Var 7 z) (OverloadedBinOp (Var 7 x) Add (Var 7 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 7 x)) ((Var 7 y))] (TypeParameter t ) () () ) ) () .false. .false. )] (Var 7 z) Public .false. .false. () ), add_generic2: (Function (SymbolTable 8 { s: (Variable 8 s [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_generic2 (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 8 x) (Var 8 y) (Var 8 z)] [(Assignment (Var 8 s) (OverloadedBinOp (OverloadedBinOp (Var 8 x) Add (Var 8 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) ) Add (Var 8 z) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((OverloadedBinOp (Var 8 x) Add (Var 8 y) (TypeParameter t ) () (FunctionCall 5 f 5 ~add [((Var 8 x)) ((Var 8 y))] (TypeParameter t ) () () ) )) ((Var 8 z))] (TypeParameter t ) () () ) ) () .false. .false. )] (Var 8 s) Private .false. .false. () ), f: (Function (SymbolTable 6 { x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 6 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 z) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 5 ~add [5 f] Public ) }) add_t [t f] [(Require r [t f] )] ), func_arg_int: (Function (SymbolTable 9 { x: (Variable 9 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 9 z [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func_arg_int (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 x) (Var 9 y)] [(Assignment (Var 9 z) (IntegerBinOp (Var 9 x) Add (Var 9 y) (Integer 4) () ) () .false. .false. )] (Var 9 z) Private .false. .false. () ), r: (Requirement (SymbolTable 3 { f: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 3 ~add [3 f] Public ) }) r [t f] [] ), test_template: (Function (SymbolTable 10 { add_integer: (Function (SymbolTable 11 { x: (Variable 11 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 11 z [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 z) (OverloadedBinOp (Var 11 x) Add (Var 11 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 11 x)) ((Var 11 y))] (Integer 4) () () ) ) () .false. .false. )] (Var 11 z) Public .false. .false. () ), add_integer2: (Function (SymbolTable 12 { s: (Variable 12 s [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), z: (Variable 12 z [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_integer2 (FunctionType [(Integer 4) (Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func_arg_int] [(Var 12 x) (Var 12 y) (Var 12 z)] [(Assignment (Var 12 s) (OverloadedBinOp (OverloadedBinOp (Var 12 x) Add (Var 12 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) ) Add (Var 12 z) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((OverloadedBinOp (Var 12 x) Add (Var 12 y) (TypeParameter t ) () (FunctionCall 2 func_arg_int 5 ~add [((Var 12 x)) ((Var 12 y))] (Integer 4) () () ) )) ((Var 12 z))] (Integer 4) () () ) ) () .false. .false. )] (Var 12 s) Private .false. .false. () ), n1: (Variable 10 n1 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n2: (Variable 10 n2 [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 10 n1) (FunctionCall 10 add_integer () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 10 n2) (FunctionCall 10 add_integer2 () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 10 n1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "The result is" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 10 n2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_add_01b_m () [template_add_01b_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit5-8745632.json0000664000175000017500000000074215141516316025153 0ustar alastairalastair{ "basename": "asr-implicit5-8745632", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit5.f90", "infile_hash": "57638dfdf42ed194d8b670c35ec4e43e74c3a6cf3a32f2cb553f5927", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit5-8745632.stdout", "stdout_hash": "c786fcef743e8f6efe9c0b6dbfa5188f47f385da5bdf70f8f73196ad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program4-ba26fd1.json0000664000175000017500000000103415141516316025265 0ustar alastairalastair{ "basename": "asr-program4-ba26fd1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program4.f90", "infile_hash": "16adb5a498028ea668b9d513bb2ef0fa0b12e15bef4e2b5e30aa2740", "outfile": null, "outfile_hash": null, "stdout": "asr-program4-ba26fd1.stdout", "stdout_hash": "4dd41d9a639683750c87664e162b22483038ee86c2c5f9f3bab7f69e", "stderr": "asr-program4-ba26fd1.stderr", "stderr_hash": "3e15ec8a328c3f581817cf479d93e1f7166d89865efb6fb03f1909b8", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_06-5f5f77a.json0000664000175000017500000000072415141516316025121 0ustar alastairalastair{ "basename": "asr-array_06-5f5f77a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_06.f90", "infile_hash": "406fc70b089659c17d4efd5d20d1bbedbda96bf91883f69ca5841dc3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_06-5f5f77a.stderr", "stderr_hash": "ee4341dfe274063add7a3bac13df2f837d0fb1ad8212222e276b3dc2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-exit1-29ee7ce.json0000664000175000017500000000077015141516316024627 0ustar alastairalastair{ "basename": "run-exit1-29ee7ce", "cmd": "lfortran --no-color {infile}", "infile": "tests/exit1.f90", "infile_hash": "abc1b402ea4f1576938c8fde3e78af95360770c94eacad03f403f5d6", "outfile": null, "outfile_hash": null, "stdout": "run-exit1-29ee7ce.stdout", "stdout_hash": "61f0d87e355fe9206f69359bd0d77b9ac928ec3fdf45d6c625f90bce", "stderr": "run-exit1-29ee7ce.stderr", "stderr_hash": "95f484ba233b9e026fd67516cf7aa5435cfa13519766c6e935d45309", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-complex2-092502c.stdout0000664000175000017500000001551615141516316025612 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %2 = load %complex_4, %complex_4* %x, align 1 %3 = extractvalue %complex_4 %2, 0 %4 = extractvalue %complex_4 %2, 1 %5 = fadd float %3, 4.000000e+00 %6 = fadd float %4, 0.000000e+00 %7 = insertvalue %complex_4 undef, float %5, 0 %8 = insertvalue %complex_4 %7, float %6, 1 store %complex_4 %8, %complex_4* %x, align 1 %9 = alloca i64, align 8 %10 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %9, i32 0, i32 0, %complex_4* %x) %11 = load i64, i64* %9, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %10, i8** %12, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %11, i64* %13, align 4 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %15 = load i8*, i8** %14, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %17 = load i64, i64* %16, align 4 %18 = trunc i64 %17 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %15, i32 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %19 = icmp eq i8* %10, null br i1 %19, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %10) br label %free_done free_done: ; preds = %free_nonnull, %.entry %20 = load %complex_4, %complex_4* %x, align 1 %21 = extractvalue %complex_4 %20, 0 %22 = extractvalue %complex_4 %20, 1 %23 = fadd float 2.000000e+00, %21 %24 = fadd float 0.000000e+00, %22 %25 = insertvalue %complex_4 undef, float %23, 0 %26 = insertvalue %complex_4 %25, float %24, 1 store %complex_4 %26, %complex_4* %x, align 1 %27 = alloca i64, align 8 %28 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %27, i32 0, i32 0, %complex_4* %x) %29 = load i64, i64* %27, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %29, i64* %31, align 4 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %35 = load i64, i64* %34, align 4 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %28) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %38 = load %complex_4, %complex_4* %x, align 1 %39 = extractvalue %complex_4 %38, 0 %40 = extractvalue %complex_4 %38, 1 %41 = fadd float 2.000000e+00, %39 %42 = fadd float 0.000000e+00, %40 %43 = insertvalue %complex_4 undef, float %41, 0 %44 = insertvalue %complex_4 %43, float %42, 1 %45 = extractvalue %complex_4 %44, 0 %46 = extractvalue %complex_4 %44, 1 %47 = fadd float %45, 0.000000e+00 %48 = fadd float %46, 3.000000e+00 %49 = insertvalue %complex_4 undef, float %47, 0 %50 = insertvalue %complex_4 %49, float %48, 1 store %complex_4 %50, %complex_4* %x, align 1 %51 = alloca i64, align 8 %52 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %51, i32 0, i32 0, %complex_4* %x) %53 = load i64, i64* %51, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %54 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %52, i8** %54, align 8 %55 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %53, i64* %55, align 4 %56 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %57 = load i8*, i8** %56, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %59 = load i64, i64* %58, align 4 %60 = trunc i64 %59 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %57, i32 %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %61 = icmp eq i8* %52, null br i1 %61, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %52) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 call void @_lpython_free_argv() br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/wat-types_03-e07ce23.stdout0000664000175000017500000001652015141516316025510 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) f32.const 1.500000 local.set 1 local.get 1 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 i32.trunc_f32_s local.set 0 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine3b-98faad7.stdout0000664000175000017500000000231315141516316026550 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 f 42 () )] [] [] ) (Function g [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 g 42 () )] [] [] ) (Function h [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 h 42 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_02-404e16e.json0000664000175000017500000000076415141516316026261 0ustar alastairalastair{ "basename": "llvm-intrinsics_02-404e16e", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_02.f90", "infile_hash": "9042eb55a868aba778eaccfaba75217700b9f99f157df367ffc005fd", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_02-404e16e.stdout", "stdout_hash": "b2f68f4ce03883f3a8f0842fc04187c74fe273b6ffaf3b259c01c078", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_subroutine-2711676.json0000664000175000017500000000077415141516316027520 0ustar alastairalastair{ "basename": "ast-fixedform_subroutine-2711676", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_subroutine.f", "infile_hash": "5c2507d7f1f64444900c29417a17016db42b0546f696a6f523c53f0e", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_subroutine-2711676.stdout", "stdout_hash": "0182961eb112dbe5c268c36f4de0166f743db890cacf13ed192f7337", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-array6-d640983.stdout0000664000175000017500000000034315141516316025565 0ustar alastairalastairprogram array6 implicit none contains subroutine t(n, a, b, c, d, e) integer, intent(in) :: n real :: a(*), b(3:*) real, dimension(3,n,*) :: c real, dimension(3,n,4:*) :: d real :: e(n:*) end subroutine t end program array6 lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor6-c43df4d.stdout0000664000175000017500000001025115141516316031173 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor6: (Program (SymbolTable 2 { }) preprocessor6 [] [(Print (StringConstant "1a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2a" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "2b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1b" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "10" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1a0" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ab" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ac" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1c" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "10" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1a0" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1aa" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1ac" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "1c" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_25-b0e87c0.json0000664000175000017500000000075015141516316025437 0ustar alastairalastair{ "basename": "asr-modules_25-b0e87c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_25.f90", "infile_hash": "5354e419ff15c42c940ee6e22e7a2d6dd70b8aeba170fd2eb83da168", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_25-b0e87c0.stdout", "stdout_hash": "a193daba9aa2316969f80fa7aefba9ce7ecf33e544f30136241a4b98", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-conv_complex2real-0c17eca.json0000664000175000017500000000077515141516316027165 0ustar alastairalastair{ "basename": "asr-conv_complex2real-0c17eca", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/conv_complex2real.f90", "infile_hash": "45bd43af8695005b07db0e167445c8230cda8e3201e8ce644bf187d2", "outfile": null, "outfile_hash": null, "stdout": "asr-conv_complex2real-0c17eca.stdout", "stdout_hash": "086340a3e9dd331b746f725e9b0345d355476f9a99668abc0905b617", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-string_03-2cd8fec.json0000664000175000017500000000075015141516316025624 0ustar alastairalastair{ "basename": "llvm-string_03-2cd8fec", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_03.f90", "infile_hash": "7815b8703dfd3a1c61cab40604e20693508878e8a90e450834ce592b", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_03-2cd8fec.stdout", "stdout_hash": "d68d0ddb307fbda19866861e5f100e89902f134e4afe622d4ba9d511", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-doloop_01-4e94eaf.json0000664000175000017500000000073015141516316025352 0ustar alastairalastair{ "basename": "wat-doloop_01-4e94eaf", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "wat-doloop_01-4e94eaf.stdout", "stdout_hash": "185a1f350c3f225982b7770df44453159d54798ec1a262b383159c53", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/obj-expr2-6573591.json0000664000175000017500000000055715141516316024306 0ustar alastairalastair{ "basename": "obj-expr2-6573591", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common_13-fa7cbf0.json0000664000175000017500000000074515141516316025420 0ustar alastairalastair{ "basename": "asr-common_13-fa7cbf0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_13.f90", "infile_hash": "c06b84e80775a9b491a5bb86de409be83180247a70c7c75af9e92a4e", "outfile": null, "outfile_hash": null, "stdout": "asr-common_13-fa7cbf0.stdout", "stdout_hash": "f023079e18db70f9e19dd3664962ba6ac1d50c195dfb0559b6e3c863", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope1-786a363.json0000664000175000017500000000073415141516316026046 0ustar alastairalastair{ "basename": "asr-global_scope1-786a363", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope1-786a363.stdout", "stdout_hash": "1bf4258b7533326ad5f9bb94cb95af845ae56eb1355b13e3d2f563e0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-stop1-c0d0295.json0000664000175000017500000000071715141516316025130 0ustar alastairalastair{ "basename": "ast_f90-stop1-c0d0295", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/stop1.f90", "infile_hash": "356601f3f1d56abfa1b7d00130c2067cbf3d450b3c563a900ff9ccd5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-stop1-c0d0295.stdout", "stdout_hash": "f568222ca169cc7ad40eb4b3564c08a3d4ba845e0a5a141d4f0dcd3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-entry1-5b02d99.stdout0000664000175000017500000000404115141516316025201 0ustar alastairalastair(TranslationUnit [(Program entry1 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(dummy [] [] () () None ())] () )] [(Assignment 0 dummy 10 () ) (SubroutineCall 0 x [] [(() dummy () 0)] [] [] () ) (SubroutineCall 0 y [] [(() dummy () 0)] [] [] () )] [] ) (Subroutine x [(dummy)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(dummy [] [] () () None ())] () )] [(Print 0 () [(String "Printed using subroutine call: " ()) dummy] () ) (Assignment 0 dummy (Real "5.0") () ) (Return 0 () () ) (Entry 0 y [(dummy)] () () () ) (Print 0 () [(String "Printed using entry statement: " ()) dummy] () ) (Return 0 () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-optional_argument_subroutine_in_type-0d81d24.json0000664000175000017500000000104115141516316033126 0ustar alastairalastair{ "basename": "asr-optional_argument_subroutine_in_type-0d81d24", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_argument_subroutine_in_type.f90", "infile_hash": "95ac054a65cebfbc2df3708d0b697fb981e5a485008e8a79dc6ab79d", "outfile": null, "outfile_hash": null, "stdout": "asr-optional_argument_subroutine_in_type-0d81d24.stdout", "stdout_hash": "44358d6b5240f6477ea2b6e80ebc7ffc3a456798f4a8417caf44e79b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-associate_02-558b0e6.stdout0000664000175000017500000003645515141516316026434 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @associate_02.t1 = internal global i32 2 @associate_02.t2 = internal global double 2.000000e+00 @associate_02.t3 = internal global %complex_4 zeroinitializer @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.5 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.6 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p1 = alloca i32*, align 8 store i32* null, i32** %p1, align 8 %p2 = alloca double*, align 8 store double* null, double** %p2, align 8 %p3 = alloca %complex_4*, align 8 store %complex_4* null, %complex_4** %p3, align 8 store %complex_4 <{ float 2.000000e+00, float 3.000000e+00 }>, %complex_4* @associate_02.t3, align 1 store i32* @associate_02.t1, i32** %p1, align 8 store double* @associate_02.t2, double** %p2, align 8 store %complex_4* @associate_02.t3, %complex_4** %p3, align 8 %2 = load i32*, i32** %p1, align 8 store i32 1, i32* %2, align 4 %3 = load double*, double** %p2, align 8 store double 4.000000e+00, double* %3, align 8 %4 = alloca i64, align 8 %5 = load i32*, i32** %p1, align 8 %6 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, i32* %5) %7 = load i64, i64* %4, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 4 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %.entry %16 = alloca i64, align 8 %17 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %16, i32 0, i32 0, i32* @associate_02.t1) %18 = load i64, i64* %16, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %17, i8** %19, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %18, i64* %20, align 4 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %22 = load i8*, i8** %21, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %24 = load i64, i64* %23, align 4 %25 = trunc i64 %24 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %22, i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %26 = icmp eq i8* %17, null br i1 %26, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %17) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %27 = load double*, double** %p2, align 8 %28 = load double, double* %27, align 8 %29 = load i32*, i32** %p1, align 8 %30 = load i32, i32* %29, align 4 %31 = sitofp i32 %30 to double %32 = fadd double %28, %31 %33 = fptosi double %32 to i32 store i32 %33, i32* @associate_02.t1, align 4 %34 = alloca i64, align 8 %35 = load i32*, i32** %p1, align 8 %36 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %34, i32 0, i32 0, i32* %35) %37 = load i64, i64* %34, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %36, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %37, i64* %39, align 4 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %43 = load i64, i64* %42, align 4 %44 = trunc i64 %43 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %41, i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %45 = icmp eq i8* %36, null br i1 %45, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %36) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %46 = alloca i64, align 8 %47 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %46, i32 0, i32 0, i32* @associate_02.t1) %48 = load i64, i64* %46, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %49 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %47, i8** %49, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %48, i64* %50, align 4 %51 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %52 = load i8*, i8** %51, align 8 %53 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %54 = load i64, i64* %53, align 4 %55 = trunc i64 %54 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %52, i32 %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %56 = icmp eq i8* %47, null br i1 %56, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %47) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 store i32 8, i32* @associate_02.t1, align 4 %57 = alloca i64, align 8 %58 = load i32*, i32** %p1, align 8 %59 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.4, i32 0, i32 0), i64* %57, i32 0, i32 0, i32* %58) %60 = load i64, i64* %57, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %59, i8** %61, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %60, i64* %62, align 4 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %64 = load i8*, i8** %63, align 8 %65 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %66 = load i64, i64* %65, align 4 %67 = trunc i64 %66 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %64, i32 %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %68 = icmp eq i8* %59, null br i1 %68, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free(i8* %59) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %69 = alloca i64, align 8 %70 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.5, i32 0, i32 0), i64* %69, i32 0, i32 0, i32* @associate_02.t1) %71 = load i64, i64* %69, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %70, i8** %72, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %71, i64* %73, align 4 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %77 = load i64, i64* %76, align 4 %78 = trunc i64 %77 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %75, i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %79 = icmp eq i8* %70, null br i1 %79, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free(i8* %70) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %80 = load %complex_4*, %complex_4** %p3, align 8 %81 = load %complex_4*, %complex_4** %p3, align 8 %82 = load %complex_4, %complex_4* %81, align 1 %83 = extractvalue %complex_4 %82, 0 %84 = extractvalue %complex_4 %82, 1 %85 = fmul float 2.000000e+00, %83 %86 = fmul float 0.000000e+00, %84 %87 = fmul float 2.000000e+00, %84 %88 = fmul float 0.000000e+00, %83 %89 = fsub float %85, %86 %90 = fadd float %87, %88 %91 = insertvalue %complex_4 undef, float %89, 0 %92 = insertvalue %complex_4 %91, float %90, 1 store %complex_4 %92, %complex_4* %80, align 1 %93 = alloca i64, align 8 %94 = load %complex_4*, %complex_4** %p3, align 8 %95 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.6, i32 0, i32 0), i64* %93, i32 0, i32 0, %complex_4* %94) %96 = load i64, i64* %93, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %97 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %95, i8** %97, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %96, i64* %98, align 4 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %100 = load i8*, i8** %99, align 8 %101 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %102 = load i64, i64* %101, align 4 %103 = trunc i64 %102 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %100, i32 %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %104 = icmp eq i8* %95, null br i1 %104, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free(i8* %95) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %105 = alloca i64, align 8 %106 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.7, i32 0, i32 0), i64* %105, i32 0, i32 0, %complex_4* @associate_02.t3) %107 = load i64, i64* %105, align 4 %stringFormat_desc19 = alloca %string_descriptor, align 8 %108 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %106, i8** %108, align 8 %109 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %107, i64* %109, align 4 %110 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %111 = load i8*, i8** %110, align 8 %112 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %113 = load i64, i64* %112, align 4 %114 = trunc i64 %113 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %111, i32 %114, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %115 = icmp eq i8* %106, null br i1 %115, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free(i8* %106) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 call void @_lpython_free_argv() br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_associate_02 FINALIZE_SYMTABLE_associate_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/julia-doloop_03-6b5d1e0.stdout0000664000175000017500000000127415141516316026147 0ustar alastairalastairfunction main() local i::Int32 local j::Int32 j = 0 for i ∈ 1:10 j = j + i if i == 3 end if i == 2 break end end if j ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:10 if i == 2 break end j = j + i end if j ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end println(j) j = 0 for i ∈ 1:10 if i == 2 continue end j = j + i end if j ≠ 53 println(Base.stderr, "ERROR STOP") exit(1) end println(j) end main() lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_05-c57a23d.stderr0000664000175000017500000000031015141516316027172 0ustar alastairalastairsemantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 4 --> tests/errors/matrix_matmul_05.f90:5:24 | 5 | print *, matmul(a, b) | ^ lfortran-lfortran-2f73434/tests/reference/run-write6-7442be9.stdout0000664000175000017500000000003315141516316025213 0ustar alastairalastair12345 0002 -003 file04.txt lfortran-lfortran-2f73434/tests/reference/asr-complex_dp-ec165b1.json0000664000175000017500000000075015141516316025611 0ustar alastairalastair{ "basename": "asr-complex_dp-ec165b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp.f90", "infile_hash": "2ab8a19155ace703dc52c1f26d2ecea0db08a49637452b31871a40b2", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_dp-ec165b1.stdout", "stdout_hash": "8a830b6ec45d4fc87f6e8cd4f909ac6739d4cd2e41e1c8cd1d60537d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-doconcurrentloop_02-b8757f0.stdout0000664000175000017500000001217015141516316027665 0ustar alastairalastair(TranslationUnit [(Program doconcurrentloop_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 10 DimensionExpr)] )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(sum [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 sum 0 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() (- i 1) () 0)] [] [] [] ) 5) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 arraySum [] [(() a () 0) (() sum () 0)] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine arraySum [(a) (sum)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(sum [] [] () () None ())] () )] [(DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceAdd [s] )] [(Assignment 0 sum (+ sum (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_10-0449324.stdout0000664000175000017500000013712215141516316026127 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { kwarg_gp: (Module (SymbolTable 2 { mergegp: (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public ), mergei32: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 3 m [] Unspecified () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mergei32 (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 m)] [] (Var 3 r) Public .false. .false. () ), merger32: (Function (SymbolTable 4 { a: (Variable 4 a [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 4 m [] Unspecified () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) merger32 (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray )] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b) (Var 4 m)] [] (Var 4 r) Public .false. .false. () ), merger64: (Function (SymbolTable 5 { a: (Variable 5 a [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 5 m [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) merger64 (FunctionType [(Array (Real 8) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a) (Var 5 b) (Var 5 m)] [] (Var 5 r) Public .false. .false. () ) }) kwarg_gp () [] .false. .false. .false. ), kwarg_use: (Program (SymbolTable 6 { a1: (Variable 6 a1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 6 a2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b1: (Variable 6 b1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b2: (Variable 6 b2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m1: (Variable 6 m1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), m2: (Variable 6 m2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), mergegp: (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public ), mergegp@mergei32: (ExternalSymbol 6 mergegp@mergei32 2 mergei32 kwarg_gp [] mergei32 Private ), mergegp@merger32: (ExternalSymbol 6 mergegp@merger32 2 merger32 kwarg_gp [] merger32 Private ), mergei32: (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public ), merger32: (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public ), merger64: (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public ) }) kwarg_use [kwarg_gp] [(Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((ArrayPhysicalCast (Var 6 a1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) (())] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 mergegp@merger32 6 mergegp [((ArrayPhysicalCast (Var 6 a2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 b2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 m2) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] DescriptorArray ) () ))] (Real 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intent1-4e0feb8.json0000664000175000017500000000072115141516316025126 0ustar alastairalastair{ "basename": "asr-intent1-4e0feb8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intent1.f90", "infile_hash": "d12d1e1612c16f772abbbbdc87df9a7c395c4065223d4a66508ac667", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intent1-4e0feb8.stderr", "stderr_hash": "4350f78ca55c871c699300a9e29e5191b4b7f4e8f9c1015704c2d88d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do_01-737a2b1.stdout0000664000175000017500000003270415141516316027352 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { data_implied_do_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) data_implied_do_01 [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-expr8-cb13ef4.stdout0000664000175000017500000000112015141516316025151 0ustar alastairalastair(TranslationUnit [(Assignment 0 i 123 () ) (Assignment 0 j 123456789824390874092509458720948720947502984752098457242092870987 () ) (Assignment 0 k (* 2 18446744073709551616) () ) (Assignment 0 i 123_i8 () ) (Assignment 0 j 123456789824390874092509458720948720947502984752098457242092870987_i8 () ) (Assignment 0 k (* 2 18446744073709551616_i8) () )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_type_02-3e6510f.json0000664000175000017500000000075115141516316026367 0ustar alastairalastair{ "basename": "asr-derived_type_02-3e6510f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_02.f90", "infile_hash": "d6255b9c3de35703fc41705513045302de70c7d3d045bc8be96e2d27", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_02-3e6510f.stderr", "stderr_hash": "66c93e609d5f957dd07fca5bd4b6f6f6b8d91a29b82ccfa34910f42f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-return_06-ec98b0b.stdout0000664000175000017500000000114215141516316026123 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return unreachable_after_return: ; No predecessors! call void @_lpython_free_argv() br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/fortran-real_to_integer_cast_fortran_codegen-d0b1495.stdoutlfortran-lfortran-2f73434/tests/reference/fortran-real_to_integer_cast_fortran_codegen-d0b1495.stdou0000664000175000017500000000043415141516316034046 0ustar alastairalastairprogram implicitrealtointcastexample implicit none integer(4) :: integervalue real(4) :: realnumber realnumber = 3.14000010e+00 integervalue = int(realnumber, kind=4) print *, "Real Number:", realnumber print *, "Integer Value:", integervalue end program implicitrealtointcastexample lfortran-lfortran-2f73434/tests/reference/asr-character_parameter_padding_trimming-ea91653.json0000664000175000017500000000121415141516316032772 0ustar alastairalastair{ "basename": "asr-character_parameter_padding_trimming-ea91653", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/character_parameter_padding_trimming.f90", "infile_hash": "3ac17fa68feb60423eaa66ebbb88a3e18da1a72d0c7e8ed8ac8de022", "outfile": null, "outfile_hash": null, "stdout": "asr-character_parameter_padding_trimming-ea91653.stdout", "stdout_hash": "32d8eeaa4988dfaad3e9b3279f55732d7ed9b0b35da1ffa2ccca8adb", "stderr": "asr-character_parameter_padding_trimming-ea91653.stderr", "stderr_hash": "dd1d526423717b4be7522ae77a4f0054f4ceee382d37bbf977ca3d2b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit9-5318b32.stderr0000664000175000017500000000224415141516316025555 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit9.f90:3:17 | 3 | implicit integer*4 (d-e) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit9.f90:4:17 | 4 | implicit integer*8 (f-g) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit9.f90:6:14 | 6 | implicit real*4 (i-k) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit9.f90:7:14 | 7 | implicit real*8 (l) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit9.f90:9:17 | 9 | implicit complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit9.f90:10:17 | 10 | implicit complex*16 (p) | ^ help: write this as 'complex(8)' semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/implicit9.f90:2:1 | 2 | implicit integer (a,b-c) | ^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/c-doloop_08-2839ed5.json0000664000175000017500000000072215141516316024653 0ustar alastairalastair{ "basename": "c-doloop_08-2839ed5", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "c-doloop_08-2839ed5.stdout", "stdout_hash": "c41a66f6056c1229519d3bbf24fde5ffb0fca0f3c789d00b43e422f4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-loop_test5-d27e6d6.json0000664000175000017500000000073615141516316025575 0ustar alastairalastair{ "basename": "ast-loop_test5-d27e6d6", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test5.f", "infile_hash": "b0b55d75eb00726ea0683cc0829370dd7bb145ae4db703c5448b5e58", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test5-d27e6d6.stdout", "stdout_hash": "7afaa986dd75ab5b51ef4290815e8da71adfd6d305ece299f5b05863", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-int_01-9bf3eb9.json0000664000175000017500000000071615141516316024650 0ustar alastairalastair{ "basename": "asr-int_01-9bf3eb9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/int_01.f90", "infile_hash": "e2571a39476234ffe13799808dd85a6cdda52b13f89171e4fc4c868e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-int_01-9bf3eb9.stderr", "stderr_hash": "c9e39d59ade877d2ab7ac42be2b43f28bfecc44ab58b204ffd1ab5ab", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-implicit11-95f56fd.stdout0000664000175000017500000002016615141516316026031 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f1: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) f1 (FunctionType [(Complex 8) (Complex 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 z) (Var 2 i)] [(Assignment (Var 2 z) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 5.000000 0.000000 (Complex 8) ) ) () .false. .false. ) (Print (StringFormat () [(IntrinsicElementalFunction Aimag [(Var 2 z)] 0 (Real 8) () ) (IntrinsicElementalFunction Aimag [(Var 2 i)] 0 (Real 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 2 f1) Public .false. .false. () ), f2: (Function (SymbolTable 3 { i: (Variable 3 i [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Unspecified () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) f2 (FunctionType [(Complex 8) (Complex 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 z) (Var 3 i)] [(Assignment (Var 3 z) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 5.000000 0.000000 (Complex 8) ) ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-interface2-82ff094.json0000664000175000017500000000073615141516316026121 0ustar alastairalastair{ "basename": "ast_f90-interface2-82ff094", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/interface2.f90", "infile_hash": "708e539c3b559554e522379a3dd84fbbef89eb01ea66bf9ded4a5fcb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-interface2-82ff094.stdout", "stdout_hash": "7e23320a7fc6cd85194949f6a850d479e22a6cc211c4a87c9e81a031", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_ff_1-c2d5950.json0000664000175000017500000000121115141516316030512 0ustar alastairalastair{ "basename": "asr-continue_compilation_ff_1-c2d5950", "cmd": "lfortran --fixed-form --continue-compilation --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/continue_compilation_ff_1.f", "infile_hash": "46b7f1e9c2220cea2781fd285496d447b6e5c3b19a31fadcd1a3bdb4", "outfile": null, "outfile_hash": null, "stdout": "asr-continue_compilation_ff_1-c2d5950.stdout", "stdout_hash": "a788fe4f4c16e1b5dd0033d9b9ae9d548538e183cbe645517deb02c6", "stderr": "asr-continue_compilation_ff_1-c2d5950.stderr", "stderr_hash": "5058e79f75dbfe91f0ae19335276116f9240813af8445d32b0017abe", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast_f90-string_03-bda189f.stdout0000664000175000017500000000074515141516316026414 0ustar alastairalastairmodule string_03_mod implicit none character(len=5), parameter :: intro = "I've " end module string_03_mod program string_03 use string_03_mod, only: intro implicit none character(len=8) :: verb character(len=5) :: posit character(len=4) :: title character(len=7) :: last_name character(len=29) :: combined verb = "learned " posit = "from " title = "the " last_name = "best" combined = intro // verb // posit // title // last_name // "." print *, combined end program string_03 lfortran-lfortran-2f73434/tests/reference/llvm-string_13-8952a13.stdout0000664000175000017500000001155415141516316025700 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [9 x i8] c"I4,I4,I4\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %ia0 = alloca i32, align 4 store i32 48, i32* %ia0, align 4 %ia5 = alloca i32, align 4 store i32 53, i32* %ia5, align 4 %ia9 = alloca i32, align 4 store i32 57, i32* %ia9, align 4 br i1 false, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br i1 false, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 br i1 false, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %2 = alloca i64, align 8 %3 = alloca i32, align 4 store i32 48, i32* %3, align 4 %4 = alloca i32, align 4 store i32 53, i32* %4, align 4 %5 = alloca i32, align 4 store i32 57, i32* %5, align 4 %6 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %3, i32* %4, i32* %5) %7 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %6, i8** %8, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %7, i64* %9, align 4 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %11 = load i8*, i8** %10, align 8 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %13 = load i64, i64* %12, align 4 %14 = trunc i64 %13 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %15 = icmp eq i8* %6, null br i1 %15, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont6 call void @_lfortran_free(i8* %6) br label %free_done free_done: ; preds = %free_nonnull, %ifcont6 call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_string_13 FINALIZE_SYMTABLE_string_13: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_01-280d5b3.stdout0000664000175000017500000014064315141516316027434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_dependency: (Module (SymbolTable 2 { add_dependency: (Function (SymbolTable 6 { 1_dependency_tree_t_find_dependency: (ExternalSymbol 6 1_dependency_tree_t_find_dependency 5 find_dependency dependency_tree_t [] find_dependency Public ), dependency: (Variable 6 dependency [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 dependency_config_t Source Private Required .false. .false. .false. () .false. .false. ), id: (Variable 6 id [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 dependency_tree_t Source Private Required .false. .false. .false. () .false. .false. ) }) add_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 self) (Var 6 dependency)] [(Assignment (Var 6 id) (FunctionCall 6 1_dependency_tree_t_find_dependency () [((Var 6 dependency))] (Integer 4) () (Var 6 self) ) () .false. .false. )] () Private .false. .false. () ), dependency_config_t: (Struct (SymbolTable 3 { name: (Variable 3 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), path: (Variable 3 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path] [] Source Private .false. .false. [] () () ), dependency_node_t: (Struct (SymbolTable 4 { done: (Variable 4 done [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), proj_dir: (Variable 4 proj_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), revision: (Variable 4 revision [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), update: (Variable 4 update [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) dependency_node_t (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [] [proj_dir revision done update] [] Source Private .false. .false. [] () () ), dependency_tree_t: (Struct (SymbolTable 5 { add: (GenericProcedure 5 add [5 add_dependency] Public ), add_dependency: (StructMethodDeclaration 5 add_dependency () add_dependency 2 add_dependency Source .false. .false. ), cache: (Variable 5 cache [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), dep: (Variable 5 dep [] Local () () Default (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 dependency_node_t Source Private Required .false. .false. .false. () .false. .false. ), dep_dir: (Variable 5 dep_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ), find: (GenericProcedure 5 find [5 find_dependency] Public ), find_dependency: (StructMethodDeclaration 5 find_dependency () find_dependency 2 find_dependency Source .false. .false. ), ndep: (Variable 5 ndep [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), unit: (Variable 5 unit [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), verbosity: (Variable 5 verbosity [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) dependency_tree_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [unit verbosity dep_dir ndep dep cache] [] Source Private .false. .false. [] () () ), find_dependency: (Function (SymbolTable 7 { dependency: (Variable 7 dependency [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 dependency_config_t Source Private Required .false. .false. .false. () .false. .false. ), pos: (Variable 7 pos [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), self: (Variable 7 self [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 2 dependency_tree_t Source Private Required .false. .false. .false. () .false. .false. ) }) find_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 self) (Var 7 dependency)] [] (Var 7 pos) Private .false. .false. () ) }) fpm_dependency () [fpm_dependency] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-derived_types_02-f576514.json0000664000175000017500000000077215141516316026507 0ustar alastairalastair{ "basename": "ast-derived_types_02-f576514", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_02.f90", "infile_hash": "b1a54c8c7e9086351046470f0afa0c69c807f7816178672b004af9fe", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_02-f576514.stdout", "stdout_hash": "0a61a2e6d695eb12d0bc1b6bf58121d8afaf7a122248165fb446d864", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_cmake_01-4e6752a.json0000664000175000017500000000077215141516316026523 0ustar alastairalastair{ "basename": "ast-program_cmake_01-4e6752a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "ast-program_cmake_01-4e6752a.stdout", "stdout_hash": "8260abebd05f66a55fddeb2aad67140d716d0f191966276b4a29b4bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-derived_types_45-ae31b1c.stdout0000664000175000017500000001165715141516316027454 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %myint = type { i32 } @0 = private unnamed_addr constant [4 x i8] c"ins\00", align 1 @1 = private unnamed_addr constant [117 x i8] c"At 15:9 of file tests/../integration_tests/derived_types_45.f90\0ATried to access member of unallocated variable '%s'\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %ins = alloca %myint*, align 8 store %myint* null, %myint** %ins, align 8 %temp_struct_var__ = alloca %myint, align 8 %2 = getelementptr %myint, %myint* %temp_struct_var__, i32 0, i32 0 %3 = getelementptr %myint, %myint* %temp_struct_var__, i32 0, i32 0 store i32 44, i32* %3, align 4 %4 = load %myint*, %myint** %ins, align 8 %5 = icmp eq %myint* %4, null br i1 %5, label %then, label %else then: ; preds = %.entry %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %myint* store %myint* %7, %myint** %ins, align 8 %8 = load %myint*, %myint** %ins, align 8 %9 = getelementptr %myint, %myint* %8, i32 0, i32 0 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %10 = load %myint*, %myint** %ins, align 8 %11 = getelementptr %myint, %myint* %temp_struct_var__, i32 0, i32 0 %12 = load i32, i32* %11, align 4 %13 = getelementptr %myint, %myint* %10, i32 0, i32 0 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store i32 %12, i32* %13, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %14 = load %myint*, %myint** %ins, align 8 %15 = ptrtoint %myint* %14 to i64 %16 = icmp eq i64 %15, 0 br i1 %16, label %then4, label %ifcont5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont5: ; preds = %ifcont3 %17 = getelementptr %myint, %myint* %14, i32 0, i32 0 %18 = load i32, i32* %17, align 4 %19 = icmp ne i32 %18, 44 br i1 %19, label %then6, label %else7 then6: ; preds = %ifcont5 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont8 else7: ; preds = %ifcont5 br label %ifcont8 ifcont8: ; preds = %else7, %then6 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont8 br label %FINALIZE_SYMTABLE_derived_types_45 FINALIZE_SYMTABLE_derived_types_45: ; preds = %return br label %Finalize_Variable_ins Finalize_Variable_ins: ; preds = %FINALIZE_SYMTABLE_derived_types_45 %20 = load %myint*, %myint** %ins, align 8 %21 = icmp ne %myint* %20, null br i1 %21, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_ins %22 = getelementptr %myint, %myint* %20, i32 0, i32 0 %23 = icmp eq %myint* %20, null br i1 %23, label %free_done, label %free_nonnull free_nonnull: ; preds = %is_allocated.then %24 = bitcast %myint* %20 to i8* call void @_lfortran_free(i8* %24) br label %free_done free_done: ; preds = %free_nonnull, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_ins br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() declare void @_lfortran_free(i8*) attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/ast-subroutine5-d00e190.stdout0000664000175000017500000000210715141516316026230 0ustar alastairalastair(TranslationUnit [(Subroutine add [(a) (b) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [] [] () () None ())] () )] [(Assignment 0 c (+ a b) () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/c_target_cuda-openmp_72-c617edf.stdout0000664000175000017500000001451015141516316027725 0ustar alastairalastair#include #include #include #include #include #include #ifdef USE_GPU #include #else #include"cuda_cpu_runtime.h" #endif struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations #ifdef USE_GPU __global__ #endif void compute_kernel_0(struct r32 *a, struct r32 *b, int i_n) { int i = blockIdx.x * blockDim.x + threadIdx.x + 1; if (i <= i_n) { a->data[((0 + (a->dims[0].stride * (i - a->dims[0].lower_bound))) + a->offset)] = (float)(i) + b->data[((0 + (b->dims[0].stride * (i - b->dims[0].lower_bound))) + b->offset)]*(float)(340); } } #ifndef USE_GPU void compute_kernel_0_wrapper(void **args) { struct r32 *a = *(struct r32**)args[0]; struct r32 *b = *(struct r32**)args[1]; int i_n = *(int*)args[2]; compute_kernel_0(a, b, i_n); } #endif #ifndef USE_GPU void compute_kernel_wrapper(void **args, void *func) { if (func == (void*)compute_kernel_0) { compute_kernel_0_wrapper(args); return; } fprintf(stderr, "Unknown kernel function\n"); exit(1); } #endif int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t __libasr_index_0_; struct r32 a_value; struct r32* a = &a_value; float *a_data; a->data = a_data; a->n_dims = 1; a->offset = 0; a->dims[0].lower_bound = 1; a->dims[0].length = 0; a->dims[0].stride = 1; struct r32 b_value; struct r32* b = &b_value; float *b_data; b->data = b_data; b->n_dims = 1; b->offset = 0; b->dims[0].lower_bound = 1; b->dims[0].length = 0; b->dims[0].stride = 1; int32_t i; a->n_dims = 1; a->dims[0].lower_bound = 1; a->dims[0].length = 10000000; a->dims[0].stride = 1; a->data = (float*) _lfortran_malloc(1*a->dims[0].length*sizeof(float)); a->is_allocated = true; b->n_dims = 1; b->dims[0].lower_bound = 1; b->dims[0].length = 10000000; b->dims[0].stride = 1; b->data = (float*) _lfortran_malloc(1*b->dims[0].length*sizeof(float)); b->is_allocated = true; for (__libasr_index_0_=((int32_t)b->dims[1-1].lower_bound); __libasr_index_0_<=((int32_t) b->dims[1-1].length + b->dims[1-1].lower_bound - 1); __libasr_index_0_++) { b->data[((0 + (b->dims[0].stride * (__libasr_index_0_ - b->dims[0].lower_bound))) + b->offset)] = (float)(5); } float *d_a_data = NULL; float *d_b_data = NULL; cudaError_t err; size_t a_data_size = a->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_a_data, a_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } size_t b_data_size = b->dims[0].length * sizeof(float); err = cudaMalloc((void**)&d_b_data, b_data_size); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_data, a->data, a_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_data, b->data, b_data_size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 h_a_copy = *a; h_a_copy.data = d_a_data; struct r32 h_b_copy = *b; h_b_copy.data = d_b_data; struct r32 *d_a_struct = NULL; err = cudaMalloc((void**)&d_a_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } struct r32 *d_b_struct = NULL; err = cudaMalloc((void**)&d_b_struct, sizeof(struct r32)); if (err != cudaSuccess) { fprintf(stderr, "cudaMalloc failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_a_struct, &h_a_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_a_struct: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(d_b_struct, &h_b_copy, sizeof(struct r32), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy H2D failed for d_b_struct: %s\n", cudaGetErrorString(err)); exit(1); } int i_n = 10000000; int threads_per_block = 256; int blocks = (i_n + threads_per_block - 1) / threads_per_block; dim3 grid_dim = {blocks, 1, 1}; dim3 block_dim = {threads_per_block, 1, 1}; void *kernel_args[] = {&d_a_struct, &d_b_struct, &i_n}; err = cudaLaunchKernel((void*)compute_kernel_0, grid_dim, block_dim, kernel_args, 0, NULL); if (err != cudaSuccess) { fprintf(stderr, "cudaLaunchKernel failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaDeviceSynchronize(); if (err != cudaSuccess) { fprintf(stderr, "cudaDeviceSynchronize failed: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(a->data, d_a_data, a_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for a_data: %s\n", cudaGetErrorString(err)); exit(1); } err = cudaMemcpy(b->data, d_b_data, b_data_size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "cudaMemcpy D2H failed for b_data: %s\n", cudaGetErrorString(err)); exit(1); } cudaFree(d_a_data); cudaFree(d_a_struct); cudaFree(d_b_data); cudaFree(d_b_struct); printf("%f%s%f\n", a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)], " ", b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)]); if (a->data[((0 + (a->dims[0].stride * (5 - a->dims[0].lower_bound))) + a->offset)] != (float)(1705)) { fprintf(stderr, "ERROR STOP"); exit(1); } if (b->data[((0 + (b->dims[0].stride * (5 - b->dims[0].lower_bound))) + b->offset)] != (float)(5)) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-lfortran-2f73434/tests/reference/asr-array_shape_01-214f2d0.json0000664000175000017500000000074615141516316026176 0ustar alastairalastair{ "basename": "asr-array_shape_01-214f2d0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_shape_01.f90", "infile_hash": "68579b9a69c1f9b5af10e8204e34764a198346d7df567ee66be973e1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_shape_01-214f2d0.stderr", "stderr_hash": "e96c10b4c84a60814ab9c5119eff89419b8b8f950ee95c6054ddade5", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine2-2e9b84b.json0000664000175000017500000000073515141516316025754 0ustar alastairalastair{ "basename": "asr-subroutine2-2e9b84b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine2.f90", "infile_hash": "8d668071a906445fe0fbdca2d363b4a71347144c0a1c6c63893bd3b6", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine2-2e9b84b.stderr", "stderr_hash": "cdd6f5045d10d67292e10e561b3e3e368e46a987db60c98c39e16392", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-array_size_05-bc7d72f.json0000664000175000017500000000074315141516316026225 0ustar alastairalastair{ "basename": "asr-array_size_05-bc7d72f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_05.f90", "infile_hash": "2897aa70956cf4067dcd3a24263968a25d21ff6672ba6d3791805519", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_05-bc7d72f.stderr", "stderr_hash": "eedb29a2081bf075d9729fd746a5e4354f491336f7ce7c2322d59f8b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-do_concurrent1-74bde45.stderr0000664000175000017500000000032415141516316026743 0ustar alastairalastairsemantic error: Do concurrent loop variable `j` cannot be part of local expression --> tests/errors/do_concurrent1.f90:5:26 | 5 | do concurrent (j = 1:Ny) local(i, j) | ^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-bits_02-925bde2.stdout0000664000175000017500000001342315141516316025466 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [3 x i8] c"I8\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %all_ones = alloca i64, align 8 store i64 -1, i64* %all_ones, align 4 %all_zeros = alloca i64, align 8 store i64 0, i64* %all_zeros, align 4 %block_size = alloca i32, align 4 store i32 64, i32* %block_size, align 4 %2 = alloca i64, align 8 %3 = alloca i32, align 4 store i32 64, i32* %3, align 4 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i32* %3) %5 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry %14 = alloca i64, align 8 %15 = alloca i64, align 8 store i64 0, i64* %15, align 4 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i64* %15) %17 = load i64, i64* %14, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %23 = load i64, i64* %22, align 4 %24 = trunc i64 %23 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %21, i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %25 = icmp eq i8* %16, null br i1 %25, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %16) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %26 = alloca i64, align 8 %27 = alloca i64, align 8 store i64 -1, i64* %27, align 4 %28 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %26, i32 0, i32 0, i64* %27) %29 = load i64, i64* %26, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %28, i8** %30, align 8 %31 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %29, i64* %31, align 4 %32 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %33 = load i8*, i8** %32, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %35 = load i64, i64* %34, align 4 %36 = trunc i64 %35 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %33, i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %37 = icmp eq i8* %28, null br i1 %37, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %28) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 call void @_lpython_free_argv() br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_bits_02 FINALIZE_SYMTABLE_bits_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/tokens-array3-72b5447.json0000664000175000017500000000072015141516316025243 0ustar alastairalastair{ "basename": "tokens-array3-72b5447", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/array3.f90", "infile_hash": "047ac01d7e3df52429d6889258f37213048937dae8611af6cbd9ecae", "outfile": null, "outfile_hash": null, "stdout": "tokens-array3-72b5447.stdout", "stdout_hash": "850337689a6aff3dec0ad753b22b2ceb473efa75d4fee2587d579474", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-print2-785df93.json0000664000175000017500000000072215141516316025317 0ustar alastairalastair{ "basename": "ast_f90-print2-785df93", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/print2.f90", "infile_hash": "6adc0ae191ec271ea11820e431167bc842948bb91bf0b54fe86090f7", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-print2-785df93.stdout", "stdout_hash": "339b33d70462d35147ac0857de0da142cbd503ec76403f1a13ce8546", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common_13-fa7cbf0.stdout0000664000175000017500000005347315141516316025777 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { 1_arrblock_myarr: (ExternalSymbol 1 1_arrblock_myarr 3 myarr arrblock [] myarr Public ), 1_myblock_myint: (ExternalSymbol 1 1_myblock_myint 5 myint myblock [] myint Public ), arrblock: (ExternalSymbol 1 arrblock 2 arrblock file_common_block_arrblock [] arrblock Public ), common_13: (Program (SymbolTable 6 { 1_myblock_myzero: (ExternalSymbol 6 1_myblock_myzero 5 myzero myblock [] myzero Public ) }) common_13 [] [(If () (IntegerCompare (StructInstanceMember (Var 1 struct_instance_myblock) 1 1_myblock_myint (Integer 4) () ) NotEq (IntegerConstant 44 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (StructInstanceMember (Var 1 struct_instance_myblock) 6 1_myblock_myzero (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicArrayFunction Any [(ArrayPhysicalCast (IntegerCompare (StructInstanceMember (Var 1 struct_instance_arrblock) 1 1_arrblock_myarr (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) NotEq (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) FixedSizeArray DescriptorArray (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] )] ), file_common_block_arrblock: (Module (SymbolTable 2 { arrblock: (Struct (SymbolTable 3 { myarr: (Variable 3 myarr [] Local (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrblock (StructType [] [] .true. .false. ) [] [myarr] [] Source Public .false. .false. [] () () ), struct_instance_arrblock: (Variable 2 struct_instance_arrblock [] Local (StructConstant 2 arrblock [((ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [] [] .true. .false. ) ) (StructConstant 2 arrblock [((ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ))] (StructType [] [] .true. .false. ) ) Default (StructType [] [] .true. .false. ) 2 arrblock Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_arrblock () [] .false. .false. .false. ), file_common_block_myblock: (Module (SymbolTable 4 { myblock: (Struct (SymbolTable 5 { myint: (Variable 5 myint [] Local (IntegerConstant 44 (Integer 4) Decimal) (IntegerConstant 44 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), myzero: (Variable 5 myzero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) myblock (StructType [] [] .true. .false. ) [] [myint myzero] [] Source Public .false. .false. [] () () ), struct_instance_myblock: (Variable 4 struct_instance_myblock [] Local (StructConstant 4 myblock [((IntegerConstant 44 (Integer 4) Decimal)) (())] (StructType [] [] .true. .false. ) ) (StructConstant 4 myblock [((IntegerConstant 44 (Integer 4) Decimal)) (())] (StructType [] [] .true. .false. ) ) Default (StructType [] [] .true. .false. ) 4 myblock Source Public Required .false. .false. .false. () .false. .false. ) }) file_common_block_myblock () [] .false. .false. .false. ), myarr: (Variable 1 myarr [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), myblock: (ExternalSymbol 1 myblock 4 myblock file_common_block_myblock [] myblock Public ), myint: (Variable 1 myint [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), myzero: (Variable 1 myzero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), struct_instance_arrblock: (ExternalSymbol 1 struct_instance_arrblock 2 struct_instance_arrblock file_common_block_arrblock [] struct_instance_arrblock Public ), struct_instance_myblock: (ExternalSymbol 1 struct_instance_myblock 4 struct_instance_myblock file_common_block_myblock [] struct_instance_myblock Public ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_09-1e51ac7.stdout0000664000175000017500000003323515141516316026354 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stdlib_quadrature: (Program (SymbolTable 5 { simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public ), x1: (Variable 5 x1 [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) stdlib_quadrature [stdlib_quadrature_simps] [(Print (StringFormat () [(FunctionCall 5 simps38_weights_dp () [((ArrayPhysicalCast (Var 5 x1) FixedSizeArray PointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), stdlib_quadrature_simps: (Module (SymbolTable 2 { simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public ), simps38_weights_dp: (Function (SymbolTable 3 { w: (Variable 3 w [] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) simps38_weights_dp (FunctionType [(Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [] (Var 3 w) Public .false. .false. () ), simps38_weights_dp_use: (Function (SymbolTable 4 { x1: (Variable 4 x1 [] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) simps38_weights_dp_use (FunctionType [(Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [simps38_weights_dp] [(Var 4 x1)] [(Print (StringFormat () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) stdlib_quadrature_simps () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-intrinsics_03-0771f1b.stdout0000664000175000017500000002120215141516316026620 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @intrinsics_03.i = internal global i32 -12 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define double @_lcompilers_cos_f64(double* %x) { .entry: %_lcompilers_cos_f64 = alloca double, align 8 %0 = load double, double* %x, align 8 %1 = call double @_lfortran_dcos(double %0) store double %1, double* %_lcompilers_cos_f64, align 8 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_cos_f64 FINALIZE_SYMTABLE__lcompilers_cos_f64: ; preds = %return %2 = load double, double* %_lcompilers_cos_f64, align 8 ret double %2 } declare double @_lfortran_dcos(double) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value4 = alloca double, align 8 %call_arg_value = alloca double, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca double, align 8 %r1 = alloca double, align 8 %r2 = alloca double, align 8 %x = alloca float, align 4 store double 4.200000e+00, double* %a, align 8 store float 0xBFEFE8D5A0000000, float* %x, align 4 %2 = load float, float* %x, align 4 %3 = fadd float %2, 0x3FEFE8D5A0000000 %4 = call float @llvm.fabs.f32(float %3) %5 = fcmp ogt float %4, 0x3E7AD7F2A0000000 br i1 %5, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %6 = call double @_lcompilers_cos_f64(double* %a) %7 = fadd double %6, 0x3FDF606EE0000000 %8 = call double @llvm.fabs.f64(double %7) %9 = fcmp ogt double %8, 0x3E7AD7F2A0000000 br i1 %9, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %10 = load double, double* %a, align 8 %11 = call double @_lcompilers_cos_f64(double* %a) %12 = fadd double %10, %11 store double %12, double* %call_arg_value, align 8 %13 = call double @_lcompilers_cos_f64(double* %call_arg_value) %14 = fadd double 0x3FB21BD54FC5F9A7, %13 store double %14, double* %call_arg_value4, align 8 %15 = call double @_lcompilers_cos_f64(double* %call_arg_value4) %16 = fsub double %15, 0x3FE6ECC720000000 %17 = call double @llvm.fabs.f64(double %16) %18 = fcmp ogt double %17, 0x3E7AD7F2A0000000 br i1 %18, label %then5, label %else6 then5: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont7 else6: ; preds = %ifcont3 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %19 = call double @_lcompilers_cos_f64(double* %a) store double %19, double* %r1, align 8 store double 0xBFDF606EEC8AC71E, double* %r2, align 8 %20 = load double, double* %r1, align 8 %21 = load double, double* %r2, align 8 %22 = fsub double %20, %21 %23 = call double @llvm.fabs.f64(double %22) %24 = fcmp ogt double %23, 1.000000e-15 br i1 %24, label %then8, label %else9 then8: ; preds = %ifcont7 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont10 else9: ; preds = %ifcont7 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %25 = alloca i64, align 8 %26 = load i32, i32* @intrinsics_03.i, align 4 %27 = sub i32 0, %26 %28 = icmp sge i32 %26, 0 %29 = select i1 %28, i32 %26, i32 %27 %30 = alloca i32, align 4 store i32 %29, i32* %30, align 4 %31 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %25, i32 0, i32 0, i32* %30) %32 = load i64, i64* %25, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %31, i8** %33, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %32, i64* %34, align 4 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %38 = load i64, i64* %37, align 4 %39 = trunc i64 %38 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %40 = icmp eq i8* %31, null br i1 %40, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont10 call void @_lfortran_free(i8* %31) br label %free_done free_done: ; preds = %free_nonnull, %ifcont10 %41 = load i32, i32* @intrinsics_03.i, align 4 %42 = sub i32 0, %41 %43 = icmp sge i32 %41, 0 %44 = select i1 %43, i32 %41, i32 %42 %45 = icmp ne i32 %44, 12 br i1 %45, label %then11, label %else12 then11: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont13 else12: ; preds = %free_done br label %ifcont13 ifcont13: ; preds = %else12, %then11 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont13 br label %FINALIZE_SYMTABLE_intrinsics_03 FINALIZE_SYMTABLE_intrinsics_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) ; Function Attrs: nounwind readnone speculatable willreturn declare double @llvm.fabs.f64(double) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/ast-template_nested-35ad81a.json0000664000175000017500000000076715141516316026646 0ustar alastairalastair{ "basename": "ast-template_nested-35ad81a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_nested.f90", "infile_hash": "b575d8ddebeed199be34078f7dfa99b5995ec81d1e730014775e9f5c", "outfile": null, "outfile_hash": null, "stdout": "ast-template_nested-35ad81a.stdout", "stdout_hash": "6f2e3863407264e4e29a16b1b32598e806ccd0dac6b3389cb967876a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-common1-abbc59b.json0000664000175000017500000000071215141516316025171 0ustar alastairalastair{ "basename": "ast-common1-abbc59b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/common1.f90", "infile_hash": "d7a7a1f2f3dfe2e00668bce25dbd3dc8830df902ed2c7841ef1bc6e8", "outfile": null, "outfile_hash": null, "stdout": "ast-common1-abbc59b.stdout", "stdout_hash": "d3d7c74010f253585e6e6e08caef2d514f2df042adefcdfd197df655", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop3-d579f3c.json0000664000175000017500000000076315141516316027125 0ustar alastairalastair{ "basename": "ast-fixedform_doloop3-d579f3c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop3.f", "infile_hash": "ebd193385bf57e6d56e977b85546143c590e783d1f2b5bdea17ecdf9", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop3-d579f3c.stdout", "stdout_hash": "359c9d820d5c7a6f090fe92de1ebc651158e6974e0e50b191458b82c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_transfer_01-3dca715.json0000664000175000017500000000075715141516316027011 0ustar alastairalastair{ "basename": "asr-array_transfer_01-3dca715", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_transfer_01.f90", "infile_hash": "98bc1c8f86b6df52afdc9b504d783677d18ac3c8df19a7f37745108e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_transfer_01-3dca715.stderr", "stderr_hash": "c9c6004b1c3700fc8c09a34a02aa902bc57cd47fe9164257e54395db", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_assignment_arr1-28b49c0.json0000664000175000017500000000105615141516316033274 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_assignment_arr1-28b49c0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_assignment_arr1.f90", "infile_hash": "daa395a32105f0f71dbd4c9d998fc201815d8af3bfc7999db517fa80", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_assignment_arr1-28b49c0.stderr", "stderr_hash": "490c2fa77a6d816d9cd7d8956aa9dde9d389f043b860bb92ddffa64d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-bits_01-2906c1d.stdout0000664000175000017500000001601615141516316025215 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_01: (Program (SymbolTable 2 { int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public ), int64: (ExternalSymbol 2 int64 4 int64 lfortran_intrinsic_iso_fortran_env [] int64 Public ) }) bits_01 [iso_fortran_env] [(If () (IntegerCompare (IntrinsicElementalFunction Ibclr [(IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibclr [(IntegerConstant 4 (Integer 8) Decimal) (IntegerConstant 1 (Integer 4) Decimal)] 0 (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) NotEq (IntegerConstant 4 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibset [(IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ibset [(IntegerConstant 2 (Integer 8) Decimal) (IntegerConstant 3 (Integer 4) Decimal)] 0 (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) ) NotEq (IntegerConstant 10 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ieor [(IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) NotEq (IntegerConstant 18 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntrinsicElementalFunction Ieor [(IntegerConstant 31 (Integer 8) Decimal) (IntegerConstant 3 (Integer 8) Decimal)] 0 (Integer 8) (IntegerConstant 28 (Integer 8) Decimal) ) NotEq (IntegerConstant 28 (Integer 8) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.jsonlfortran-lfortran-2f73434/tests/reference/asr-incompatible_dimension_logical_arrays_logical_binop_020000664000175000017500000000113615141516316034412 0ustar alastairalastair{ "basename": "asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f90", "infile_hash": "c26b31652036dcebc000ad9bfe9d5aae3fac2441958efe2268f46d19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incompatible_dimension_logical_arrays_logical_binop_02-5be1708.stderr", "stderr_hash": "51654ae3483b5cb57d2295f9bf6b7501f2f1f8d1250b8a09f4c5e924", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutine2-2e9b84b.stderr0000664000175000017500000000020515141516316026276 0ustar alastairalastairsemantic error: Subroutine `bpe` called as a function --> tests/errors/subroutine2.f90:3:9 | 3 | i = bpe() | ^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-template_error_02-a3d3b4c.json0000664000175000017500000000075715141516316027070 0ustar alastairalastair{ "basename": "asr-template_error_02-a3d3b4c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_02.f90", "infile_hash": "336ede84eb90fd5b1a04f02a060fda99e866119e2ab06e47f6ed4ce1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_02-a3d3b4c.stderr", "stderr_hash": "e78b35ca24bdaf12ae1591f787465311852265876ed2389cdc1166df", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-parsing_02-740c1e5.json0000664000175000017500000000107115141516316025344 0ustar alastairalastair{ "basename": "ast-parsing_02-740c1e5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parsing_02.f90", "infile_hash": "f78db77720bb5392af4091a6679a066e81cb5afd18e4df47dd9e5898", "outfile": null, "outfile_hash": null, "stdout": "ast-parsing_02-740c1e5.stdout", "stdout_hash": "53101a270f3999896d6456bbcc27cc78916ac7d7a8080893dedff9cb", "stderr": "ast-parsing_02-740c1e5.stderr", "stderr_hash": "38c28e43e72288cf56f08313327a8162e55d4462005ccca3fd591670", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/tokens-subroutine1-c249ad5.stdout0000664000175000017500000000206015141516316027027 0ustar alastairalastair(KEYWORD "subroutine") (TOKEN "identifier" g) (TOKEN "(") (TOKEN ")") (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (TOKEN ",") (TOKEN "identifier" i) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "do") (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 10) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "identifier" x) (TOKEN "*") (TOKEN "identifier" i) (NEWLINE) (KEYWORD "end do") (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (NEWLINE) (KEYWORD "subroutine") (TOKEN "identifier" h) (TOKEN "(") (TOKEN ")") (NEWLINE) (KEYWORD "integer") (TOKEN "::") (TOKEN "identifier" x) (TOKEN ",") (TOKEN "identifier" i) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "integer" 1) (NEWLINE) (KEYWORD "do") (TOKEN "identifier" i) (TOKEN "=") (TOKEN "integer" 1) (TOKEN ",") (TOKEN "integer" 10) (NEWLINE) (TOKEN "identifier" x) (TOKEN "=") (TOKEN "identifier" i) (TOKEN "*") (TOKEN "identifier" x) (NEWLINE) (KEYWORD "end do") (NEWLINE) (KEYWORD "end subroutine") (NEWLINE) (EOF) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_01-713dbcf.json0000664000175000017500000000074315141516316027710 0ustar alastairalastair{ "basename": "run-array_bounds_check_01-713dbcf", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_01.f90", "infile_hash": "e8570ec720776191802ff5d4d5cd6944a6b2e8730e5bf1bd8458dd83", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_01-713dbcf.stderr", "stderr_hash": "500eb9df608df1c3e64d6caa392eea8ab5a9283eb4ef5895515ec024", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-program_03-fbe20e8.stdout0000664000175000017500000004050015141516316026063 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { closuretest: (Program (SymbolTable 2 { add_z: (Function (SymbolTable 5 { x: (Variable 5 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) add_z (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 y) (IntegerBinOp (Var 5 x) Add (Var 2 z) (Integer 4) () ) () .false. .false. )] (Var 5 y) Public .false. .false. () ), apply: (Function (SymbolTable 3 { fun: (Function (SymbolTable 4 { fun: (Variable 4 fun [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fun (FunctionType [(Integer 4)] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 x)] [] (Var 4 fun) Public .false. .false. () ), x: (Variable 3 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) apply (FunctionType [(FunctionType [(Integer 4)] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 fun) (Var 3 x)] [(Assignment (Var 3 y) (FunctionCall 3 fun () [((Var 3 x))] (Integer 4) () () ) () .false. .false. )] (Var 3 y) Public .false. .false. () ), z: (Variable 2 z [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) closuretest [] [(DoLoop () ((Var 2 z) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Print (StringFormat () [(FunctionCall 2 apply () [((Var 2 add_z)) ((IntegerConstant 1 (Integer 4) Decimal))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-interface4-ad40742.json0000664000175000017500000000072315141516316025424 0ustar alastairalastair{ "basename": "ast-interface4-ad40742", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface4.f90", "infile_hash": "8b4db4e1c65a085c13634bc5b46243c7f058ed4cb41ddd3d3e5a664d", "outfile": null, "outfile_hash": null, "stdout": "ast-interface4-ad40742.stdout", "stdout_hash": "fac611acfc12622ff256979439438ae668db9b7ce3005f7f8731e0f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_add_04-1710dbc.json0000664000175000017500000000076715141516316026410 0ustar alastairalastair{ "basename": "asr-template_add_04-1710dbc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_04.f90", "infile_hash": "3a87e933776c164b3f127859bb8ca5b6daabc9c6df7232173c427158", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_04-1710dbc.stdout", "stdout_hash": "b00d13478790b9585b68998ccc0180bc74feeadd5c9c9af62354c646", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-return_05-b1ab26b.stdout0000664000175000017500000000306515141516316026113 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [11 x i8] c"Hello world" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @f() { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_f FINALIZE_SYMTABLE_f: ; preds = %return ret void } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) br label %return unreachable_after_return: ; No predecessors! %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %2, i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_36-1cb3d03.stdout0000664000175000017500000004650115141516316026522 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_36: (Program (SymbolTable 2 { all_spaces: (Variable 2 all_spaces [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), empty: (Variable 2 empty [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), simple: (Variable 2 simple [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), space_at_end: (Variable 2 space_at_end [] Local (IntrinsicElementalFunction Adjustl [(StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), space_at_start: (Variable 2 space_at_start [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " gfortran" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), space_in_between: (Variable 2 space_in_between [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), spaces_with_symbols: (Variable 2 spaces_with_symbols [] Local (IntrinsicElementalFunction Adjustl [(StringConstant " # gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_36 [] [(Print (Var 2 empty) ) (If () (StringCompare (Var 2 empty) NotEq (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 all_spaces) ) (If () (StringCompare (Var 2 all_spaces) NotEq (StringConstant " " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 simple) ) (If () (StringCompare (Var 2 simple) NotEq (StringConstant "gfortran" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_at_start) ) (If () (StringCompare (Var 2 space_at_start) NotEq (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_at_end) ) (If () (StringCompare (Var 2 space_at_end) NotEq (StringConstant "gfortran " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 space_in_between) ) (If () (StringCompare (Var 2 space_in_between) NotEq (StringConstant "g for tran " (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (Var 2 spaces_with_symbols) ) (If () (StringCompare (Var 2 spaces_with_symbols) NotEq (StringConstant "# gfor* t $ ran & " (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor4-0e1d0e4.json0000664000175000017500000000077015141516316030534 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor4-0e1d0e4", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor4.f90", "infile_hash": "3cb054641f93241f08e6335f76da31e95f6046107067226629d80dc8", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor4-0e1d0e4.stdout", "stdout_hash": "1ff83624c8a869ab677c46c2951c7ebd27d2ba67f504679741610a93", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_52-f04ddb1.stdout0000664000175000017500000000001715141516316025717 0ustar alastairalastair1st2nd 1st 2nd lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr2-22f4149.json0000664000175000017500000000076415141516316027324 0ustar alastairalastair{ "basename": "pass_global_stmts-expr2-22f4149", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr2.f90", "infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr2-22f4149.stdout", "stdout_hash": "7cfdbc3531389ff83d078d76e6ef53d4f6fd0484989edba12f3f47b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_02-87b589b.stderr0000664000175000017500000000024615141516316030517 0ustar alastairalastairsyntax error: Expected function, subroutine, procedure in program contains --> tests/errors/program_without_line_02.f90:3:1 | 3 | print *, "OK" | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-write7-6ba53a1.json0000664000175000017500000000070715141516316024676 0ustar alastairalastair{ "basename": "asr-write7-6ba53a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/write7.f90", "infile_hash": "72e9fcaf8f4630dca63e67f6803d98543e8fdedc2ba0e20224168db8", "outfile": null, "outfile_hash": null, "stdout": "asr-write7-6ba53a1.stdout", "stdout_hash": "49debb2f215e7c133c8e14cf67efb6a810a604ee6811f2ff8d25b1bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_02_matmul-d389302.json0000664000175000017500000000077215141516316026515 0ustar alastairalastair{ "basename": "asr-matrix_02_matmul-d389302", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/matrix_02_matmul.f90", "infile_hash": "d02f8fde32ffc602a3915e12a9e9cd79453989c6edcbe310a8dd7d76", "outfile": null, "outfile_hash": null, "stdout": "asr-matrix_02_matmul-d389302.stdout", "stdout_hash": "698e56825db07ad34945a3f19a97e71be2c868d237f6e12833a9527b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-doloop_02-13efa8f.stdout0000664000175000017500000000126015141516316026230 0ustar alastairalastairfunction main() local a::Int32 local b::Int32 local i::Int32 local j::Int32 j = 0 a = 1 b = 10 for i ∈ a:b j = j + i end if j ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end println(j) a = 0 for i ∈ 1:10 for j ∈ 1:10 a = a + (i - 1) * 10 + j end end if a ≠ 100 * 101 ÷ 2 println(Base.stderr, "ERROR STOP") exit(1) end println(a) a = 0 for i ∈ 1:10 for j ∈ 1:i a = a + j end end if a ≠ 220 println(Base.stderr, "ERROR STOP") exit(1) end println(a) end main() lfortran-lfortran-2f73434/tests/reference/ast_f90-print1-a173a20.json0000664000175000017500000000072215141516316025263 0ustar alastairalastair{ "basename": "ast_f90-print1-a173a20", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/print1.f90", "infile_hash": "b39169477bbb20a9f0fc581832d539c45122fbc253e90314075c6581", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-print1-a173a20.stdout", "stdout_hash": "e1464ab402d54ce71669c3f81dfcff8642f127a654b17ec4596b93f3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope7-70d8b93.json0000664000175000017500000000073415141516316026133 0ustar alastairalastair{ "basename": "asr-global_scope7-70d8b93", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope7.f90", "infile_hash": "b3d005db52f7a57b335928fc6d884d6fdee0654c64fc98c2e797e242", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope7-70d8b93.stdout", "stdout_hash": "61189e1fd4120b0f37e881427a48a04d1e33c3c4490b585db34a90bc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-allocated_05-d9e0943.stderr0000664000175000017500000000031415141516316026213 0ustar alastairalastairruntime error: Attempting to allocate already allocated variable 'arr' --> tests/errors/allocated_05.f90:6:5 | 6 | allocate(arr(20)) ! Error: double allocation of array | ^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_01-2ba20d5.json0000664000175000017500000000100515141516316027270 0ustar alastairalastair{ "basename": "ast_f90-derived_types_01-2ba20d5", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_01-2ba20d5.stdout", "stdout_hash": "cdba8e3acfcc8bdc1a07b64f9bb6e8f938fc04d924b9b8f2f00d5dd7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_06-58f9b18.stdout0000664000175000017500000005064415141516316025450 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_06: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_06 [] [(Assignment (Var 2 r) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Lt (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Lt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Lt (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () ) Lt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) Gt (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Gt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Gt (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () ) Gt (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) NotEq (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) NotEq (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) NotEq (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () ) NotEq (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) LtE (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) LtE (Cast (Var 2 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () ) LtE (Var 2 r) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) GtE (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) GtE (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) GtE (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () ) GtE (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 i) Eq (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Eq (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Var 2 r) Eq (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (Var 2 i) IntegerToReal (Real 4) () ) Eq (RealBinOp (Var 2 r) Add (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics14-5a6d04e.json0000664000175000017500000000074015141516316026012 0ustar alastairalastair{ "basename": "asr-intrinsics14-5a6d04e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics14.f90", "infile_hash": "e5abcb6a33f84a36c3412054dd1092db703e97cebdb5e26d69b29702", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics14-5a6d04e.stderr", "stderr_hash": "249e6e7185993869a1a130554f0fcf10c43c67fef75ae76089e4717c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-function_call1-0b992da.stdout0000664000175000017500000004777115141516316026753 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { module_function_call1: (Module (SymbolTable 2 { eval_1d: (Function (SymbolTable 4 { res: (Variable 4 res [x] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 4 self [] In () () Default (StructType [] [] .false. .false. ) 2 softmax Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) eval_1d (FunctionType [(StructType [] [] .false. .false. ) (Array (Real 4) [(() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ())] DescriptorArray ) () ) () (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 self) (Var 4 x)] [] (Var 4 res) Public .false. .false. () ), eval_1d_prime: (Function (SymbolTable 5 { 1_softmax_eval_1d: (ExternalSymbol 5 1_softmax_eval_1d 3 eval_1d softmax [] eval_1d Public ), res: (Variable 5 res [x] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 5 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 5 self [] In () () Default (StructType [] [] .false. .false. ) 2 softmax Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) eval_1d_prime (FunctionType [(StructType [] [] .false. .false. ) (Array (Real 4) [(() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ())] DescriptorArray ) () ) () (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 x)] [(Assignment (Var 5 res) (FunctionCall 5 1_softmax_eval_1d () [((ArrayPhysicalCast (Var 5 x) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 5 x) () (Integer 4) () ))] PointerArray ) () (Var 5 self) ) () .false. .false. )] (Var 5 res) Public .false. .false. () ), softmax: (Struct (SymbolTable 3 { eval_1d: (StructMethodDeclaration 3 eval_1d () eval_1d 2 eval_1d Source .false. .false. ) }) softmax (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ) }) module_function_call1 () [module_function_call1] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit6-061f8e3.json0000664000175000017500000000106215141516316025302 0ustar alastairalastair{ "basename": "asr-implicit6-061f8e3", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit6.f90", "infile_hash": "ec52eac2f61928998941f6ef5395e23263fedec17cbec758e10e24ef", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit6-061f8e3.stdout", "stdout_hash": "861b9958301fafd6fb611071ece455ddfded54becda4daf5f3625beb", "stderr": "asr-implicit6-061f8e3.stderr", "stderr_hash": "3dae74d301e53effbbe322b0da76528b0a55ed4a7d3d784ca7da3e51", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_13-e4a94c8.stderr0000664000175000017500000000025515141516316030173 0ustar alastairalastairruntime error: Argument 1 of subroutine my is unallocated. --> tests/errors/array_bounds_check_13.f90:27:13 | 27 | call my(my_array, i) | ^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-string_slice-e254cc2.stderr0000664000175000017500000000022015141516316026467 0ustar alastairalastairsemantic error: Substring `start` is less than one --> tests/errors/string_slice.f90:4:13 | 4 | print*, s(-2:6) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01_complex-c90dbdd.stdout0000664000175000017500000014137015141516316027714 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> @0 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @1 = private unnamed_addr constant [184 x i8] c"At 6:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @3 = private unnamed_addr constant [184 x i8] c"At 8:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @7 = private unnamed_addr constant [184 x i8] c"At 9:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @11 = private unnamed_addr constant [185 x i8] c"At 10:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @15 = private unnamed_addr constant [185 x i8] c"At 13:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @17 = private unnamed_addr constant [185 x i8] c"At 15:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @21 = private unnamed_addr constant [185 x i8] c"At 16:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @25 = private unnamed_addr constant [185 x i8] c"At 17:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @29 = private unnamed_addr constant [185 x i8] c"At 18:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @33 = private unnamed_addr constant [185 x i8] c"At 21:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @35 = private unnamed_addr constant [186 x i8] c"At 21:12 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @37 = private unnamed_addr constant [185 x i8] c"At 23:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @41 = private unnamed_addr constant [185 x i8] c"At 24:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @45 = private unnamed_addr constant [185 x i8] c"At 25:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @49 = private unnamed_addr constant [185 x i8] c"At 27:1 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @51 = private unnamed_addr constant [185 x i8] c"At 27:8 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @53 = private unnamed_addr constant [186 x i8] c"At 27:13 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @54 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @55 = private unnamed_addr constant [186 x i8] c"At 27:18 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @56 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @57 = private unnamed_addr constant [186 x i8] c"At 27:23 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @58 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @59 = private unnamed_addr constant [185 x i8] c"At 28:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @60 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @61 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @62 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @63 = private unnamed_addr constant [185 x i8] c"At 30:1 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @64 = private unnamed_addr constant [2 x i8] c"a\00", align 1 @65 = private unnamed_addr constant [185 x i8] c"At 30:8 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @66 = private unnamed_addr constant [2 x i8] c"b\00", align 1 @67 = private unnamed_addr constant [185 x i8] c"At 31:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @68 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @69 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @70 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @71 = private unnamed_addr constant [185 x i8] c"At 35:9 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @72 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @73 = private unnamed_addr constant [185 x i8] c"At 35:9 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @74 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @75 = private unnamed_addr constant [185 x i8] c"At 38:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @76 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @77 = private unnamed_addr constant [185 x i8] c"At 38:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @78 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @79 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @80 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @81 = private unnamed_addr constant [185 x i8] c"At 39:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @82 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @83 = private unnamed_addr constant [185 x i8] c"At 39:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @84 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @85 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @86 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @87 = private unnamed_addr constant [185 x i8] c"At 40:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @88 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @89 = private unnamed_addr constant [185 x i8] c"At 40:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @90 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @91 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @92 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @93 = private unnamed_addr constant [185 x i8] c"At 41:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @94 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @95 = private unnamed_addr constant [185 x i8] c"At 41:5 of file tests/../integration_tests/arrays_01_complex.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @96 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @97 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca [3 x %complex_4], align 8 %b = alloca [4 x %complex_4], align 8 %c = alloca [4 x %complex_4], align 8 %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 0, i32* %i, align 4 br label %loop.head loop.head: ; preds = %ifcont, %.entry %2 = load i32, i32* %i, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 3 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %i, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %i, align 4 %7 = load i32, i32* %i, align 4 %8 = sub i32 %7, 1 %9 = mul i32 1, %8 %10 = add i32 0, %9 %11 = icmp slt i32 %7, 1 %12 = icmp sgt i32 %7, 3 %13 = or i1 %11, %12 br i1 %13, label %then, label %ifcont then: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 %7, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont: ; preds = %loop.body %14 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 %10 %15 = load i32, i32* %i, align 4 %16 = add i32 %15, 10 %17 = sitofp i32 %16 to float %18 = insertvalue %complex_4 undef, float %17, 0 %19 = insertvalue %complex_4 %18, float 0.000000e+00, 1 store %complex_4 %19, %complex_4* %14, align 1 br label %loop.head loop.end: ; preds = %loop.head br i1 false, label %then1, label %ifcont2 then1: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont2: ; preds = %loop.end %20 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 0 %21 = load %complex_4, %complex_4* %20, align 1 %22 = extractvalue %complex_4 %21, 0 %23 = extractvalue %complex_4 %21, 1 %24 = fcmp one float %22, 1.100000e+01 %25 = fcmp one float %23, 0.000000e+00 %26 = or i1 %24, %25 br i1 %26, label %then3, label %else then3: ; preds = %ifcont2 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont4 else: ; preds = %ifcont2 br label %ifcont4 ifcont4: ; preds = %else, %then3 br i1 false, label %then5, label %ifcont6 then5: ; preds = %ifcont4 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 2, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont6: ; preds = %ifcont4 %27 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 1 %28 = load %complex_4, %complex_4* %27, align 1 %29 = extractvalue %complex_4 %28, 0 %30 = extractvalue %complex_4 %28, 1 %31 = fcmp one float %29, 1.200000e+01 %32 = fcmp one float %30, 0.000000e+00 %33 = or i1 %31, %32 br i1 %33, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 br i1 false, label %then10, label %ifcont11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 3, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont11: ; preds = %ifcont9 %34 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 2 %35 = load %complex_4, %complex_4* %34, align 1 %36 = extractvalue %complex_4 %35, 0 %37 = extractvalue %complex_4 %35, 1 %38 = fcmp one float %36, 1.300000e+01 %39 = fcmp one float %37, 0.000000e+00 %40 = or i1 %38, %39 br i1 %40, label %then12, label %else13 then12: ; preds = %ifcont11 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont14 else13: ; preds = %ifcont11 br label %ifcont14 ifcont14: ; preds = %else13, %then12 store i32 10, i32* %i, align 4 br label %loop.head15 loop.head15: ; preds = %ifcont18, %ifcont14 %41 = load i32, i32* %i, align 4 %42 = add i32 %41, 1 %43 = icmp sle i32 %42, 14 br i1 %43, label %loop.body16, label %loop.end19 loop.body16: ; preds = %loop.head15 %44 = load i32, i32* %i, align 4 %45 = add i32 %44, 1 store i32 %45, i32* %i, align 4 %46 = load i32, i32* %i, align 4 %47 = sub i32 %46, 10 %48 = sub i32 %47, 1 %49 = mul i32 1, %48 %50 = add i32 0, %49 %51 = icmp slt i32 %47, 1 %52 = icmp sgt i32 %47, 4 %53 = or i1 %51, %52 br i1 %53, label %then17, label %ifcont18 then17: ; preds = %loop.body16 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 %47, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %54 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 %50 %55 = load i32, i32* %i, align 4 %56 = sitofp i32 %55 to float %57 = insertvalue %complex_4 undef, float %56, 0 %58 = insertvalue %complex_4 %57, float 0.000000e+00, 1 store %complex_4 %58, %complex_4* %54, align 1 br label %loop.head15 loop.end19: ; preds = %loop.head15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %59 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 0 %60 = load %complex_4, %complex_4* %59, align 1 %61 = extractvalue %complex_4 %60, 0 %62 = extractvalue %complex_4 %60, 1 %63 = fcmp one float %61, 1.100000e+01 %64 = fcmp one float %62, 0.000000e+00 %65 = or i1 %63, %64 br i1 %65, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %66 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 1 %67 = load %complex_4, %complex_4* %66, align 1 %68 = extractvalue %complex_4 %67, 0 %69 = extractvalue %complex_4 %67, 1 %70 = fcmp one float %68, 1.200000e+01 %71 = fcmp one float %69, 0.000000e+00 %72 = or i1 %70, %71 br i1 %72, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 br i1 false, label %then30, label %ifcont31 then30: ; preds = %ifcont29 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont31: ; preds = %ifcont29 %73 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 2 %74 = load %complex_4, %complex_4* %73, align 1 %75 = extractvalue %complex_4 %74, 0 %76 = extractvalue %complex_4 %74, 1 %77 = fcmp one float %75, 1.300000e+01 %78 = fcmp one float %76, 0.000000e+00 %79 = or i1 %77, %78 br i1 %79, label %then32, label %else33 then32: ; preds = %ifcont31 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont34 else33: ; preds = %ifcont31 br label %ifcont34 ifcont34: ; preds = %else33, %then32 br i1 false, label %then35, label %ifcont36 then35: ; preds = %ifcont34 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont36: ; preds = %ifcont34 %80 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 3 %81 = load %complex_4, %complex_4* %80, align 1 %82 = extractvalue %complex_4 %81, 0 %83 = extractvalue %complex_4 %81, 1 %84 = fcmp one float %82, 1.400000e+01 %85 = fcmp one float %83, 0.000000e+00 %86 = or i1 %84, %85 br i1 %86, label %then37, label %else38 then37: ; preds = %ifcont36 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont39 else38: ; preds = %ifcont36 br label %ifcont39 ifcont39: ; preds = %else38, %then37 store i32 0, i32* %i, align 4 br label %loop.head40 loop.head40: ; preds = %ifcont45, %ifcont39 %87 = load i32, i32* %i, align 4 %88 = add i32 %87, 1 %89 = icmp sle i32 %88, 3 br i1 %89, label %loop.body41, label %loop.end46 loop.body41: ; preds = %loop.head40 %90 = load i32, i32* %i, align 4 %91 = add i32 %90, 1 store i32 %91, i32* %i, align 4 %92 = load i32, i32* %i, align 4 %93 = sub i32 %92, 1 %94 = mul i32 1, %93 %95 = add i32 0, %94 %96 = icmp slt i32 %92, 1 %97 = icmp sgt i32 %92, 4 %98 = or i1 %96, %97 br i1 %98, label %then42, label %ifcont43 then42: ; preds = %loop.body41 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0), i32 %92, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont43: ; preds = %loop.body41 %99 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 %95 %100 = load i32, i32* %i, align 4 %101 = sub i32 %100, 1 %102 = mul i32 1, %101 %103 = add i32 0, %102 %104 = icmp slt i32 %100, 1 %105 = icmp sgt i32 %100, 3 %106 = or i1 %104, %105 br i1 %106, label %then44, label %ifcont45 then44: ; preds = %ifcont43 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 %100, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont45: ; preds = %ifcont43 %107 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 %103 %108 = load %complex_4, %complex_4* %107, align 1 %109 = extractvalue %complex_4 %108, 0 %110 = extractvalue %complex_4 %108, 1 %111 = fsub float %109, 1.000000e+01 %112 = fsub float %110, 0.000000e+00 %113 = insertvalue %complex_4 undef, float %111, 0 %114 = insertvalue %complex_4 %113, float %112, 1 store %complex_4 %114, %complex_4* %99, align 1 br label %loop.head40 loop.end46: ; preds = %loop.head40 br i1 false, label %then47, label %ifcont48 then47: ; preds = %loop.end46 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont48: ; preds = %loop.end46 %115 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 0 %116 = load %complex_4, %complex_4* %115, align 1 %117 = extractvalue %complex_4 %116, 0 %118 = extractvalue %complex_4 %116, 1 %119 = fcmp one float %117, 1.000000e+00 %120 = fcmp one float %118, 0.000000e+00 %121 = or i1 %119, %120 br i1 %121, label %then49, label %else50 then49: ; preds = %ifcont48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %ifcont48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 br i1 false, label %then52, label %ifcont53 then52: ; preds = %ifcont51 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont53: ; preds = %ifcont51 %122 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 1 %123 = load %complex_4, %complex_4* %122, align 1 %124 = extractvalue %complex_4 %123, 0 %125 = extractvalue %complex_4 %123, 1 %126 = fcmp one float %124, 2.000000e+00 %127 = fcmp one float %125, 0.000000e+00 %128 = or i1 %126, %127 br i1 %128, label %then54, label %else55 then54: ; preds = %ifcont53 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont56 else55: ; preds = %ifcont53 br label %ifcont56 ifcont56: ; preds = %else55, %then54 br i1 false, label %then57, label %ifcont58 then57: ; preds = %ifcont56 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @45, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont58: ; preds = %ifcont56 %129 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 2 %130 = load %complex_4, %complex_4* %129, align 1 %131 = extractvalue %complex_4 %130, 0 %132 = extractvalue %complex_4 %130, 1 %133 = fcmp one float %131, 3.000000e+00 %134 = fcmp one float %132, 0.000000e+00 %135 = or i1 %133, %134 br i1 %135, label %then59, label %else60 then59: ; preds = %ifcont58 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont61 else60: ; preds = %ifcont58 br label %ifcont61 ifcont61: ; preds = %else60, %then59 br i1 false, label %then62, label %ifcont63 then62: ; preds = %ifcont61 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @49, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont63: ; preds = %ifcont61 %136 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 3 br i1 false, label %then64, label %ifcont65 then64: ; preds = %ifcont63 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0), i32 1, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont65: ; preds = %ifcont63 %137 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 0 %138 = load %complex_4, %complex_4* %137, align 1 br i1 false, label %then66, label %ifcont67 then66: ; preds = %ifcont65 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @53, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 2, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont67: ; preds = %ifcont65 %139 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 1 %140 = load %complex_4, %complex_4* %139, align 1 %141 = extractvalue %complex_4 %138, 0 %142 = extractvalue %complex_4 %138, 1 %143 = extractvalue %complex_4 %140, 0 %144 = extractvalue %complex_4 %140, 1 %145 = fadd float %141, %143 %146 = fadd float %142, %144 %147 = insertvalue %complex_4 undef, float %145, 0 %148 = insertvalue %complex_4 %147, float %146, 1 br i1 false, label %then68, label %ifcont69 then68: ; preds = %ifcont67 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @55, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @54, i32 0, i32 0), i32 3, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont69: ; preds = %ifcont67 %149 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 2 %150 = load %complex_4, %complex_4* %149, align 1 %151 = extractvalue %complex_4 %148, 0 %152 = extractvalue %complex_4 %148, 1 %153 = extractvalue %complex_4 %150, 0 %154 = extractvalue %complex_4 %150, 1 %155 = fadd float %151, %153 %156 = fadd float %152, %154 %157 = insertvalue %complex_4 undef, float %155, 0 %158 = insertvalue %complex_4 %157, float %156, 1 br i1 false, label %then70, label %ifcont71 then70: ; preds = %ifcont69 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @57, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @56, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont71: ; preds = %ifcont69 %159 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 0 %160 = load %complex_4, %complex_4* %159, align 1 %161 = extractvalue %complex_4 %158, 0 %162 = extractvalue %complex_4 %158, 1 %163 = extractvalue %complex_4 %160, 0 %164 = extractvalue %complex_4 %160, 1 %165 = fadd float %161, %163 %166 = fadd float %162, %164 %167 = insertvalue %complex_4 undef, float %165, 0 %168 = insertvalue %complex_4 %167, float %166, 1 store %complex_4 %168, %complex_4* %136, align 1 br i1 false, label %then72, label %ifcont73 then72: ; preds = %ifcont71 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @59, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @58, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont73: ; preds = %ifcont71 %169 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 3 %170 = load %complex_4, %complex_4* %169, align 1 %171 = extractvalue %complex_4 %170, 0 %172 = extractvalue %complex_4 %170, 1 %173 = fcmp one float %171, 1.700000e+01 %174 = fcmp one float %172, 0.000000e+00 %175 = or i1 %173, %174 br i1 %175, label %then74, label %else75 then74: ; preds = %ifcont73 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @61, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @60, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont76 else75: ; preds = %ifcont73 br label %ifcont76 ifcont76: ; preds = %else75, %then74 br i1 false, label %then77, label %ifcont78 then77: ; preds = %ifcont76 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @63, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @62, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont78: ; preds = %ifcont76 %176 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 3 br i1 false, label %then79, label %ifcont80 then79: ; preds = %ifcont78 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @65, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @64, i32 0, i32 0), i32 1, i32 1, i32 1, i32 3) call void @exit(i32 1) unreachable ifcont80: ; preds = %ifcont78 %177 = getelementptr [3 x %complex_4], [3 x %complex_4]* %a, i32 0, i32 0 %178 = load %complex_4, %complex_4* %177, align 1 store %complex_4 %178, %complex_4* %176, align 1 br i1 false, label %then81, label %ifcont82 then81: ; preds = %ifcont80 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @67, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @66, i32 0, i32 0), i32 4, i32 1, i32 1, i32 4) call void @exit(i32 1) unreachable ifcont82: ; preds = %ifcont80 %179 = getelementptr [4 x %complex_4], [4 x %complex_4]* %b, i32 0, i32 3 %180 = load %complex_4, %complex_4* %179, align 1 %181 = extractvalue %complex_4 %180, 0 %182 = extractvalue %complex_4 %180, 1 %183 = fcmp one float %181, 1.100000e+01 %184 = fcmp one float %182, 0.000000e+00 %185 = or i1 %183, %184 br i1 %185, label %then83, label %else84 then83: ; preds = %ifcont82 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @69, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @68, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont85 else84: ; preds = %ifcont82 br label %ifcont85 ifcont85: ; preds = %else84, %then83 store i32 0, i32* %i, align 4 br label %loop.head86 loop.head86: ; preds = %loop.end94, %ifcont85 %186 = load i32, i32* %i, align 4 %187 = add i32 %186, 1 %188 = icmp sle i32 %187, 2 br i1 %188, label %loop.body87, label %loop.end95 loop.body87: ; preds = %loop.head86 %189 = load i32, i32* %i, align 4 %190 = add i32 %189, 1 store i32 %190, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head88 loop.head88: ; preds = %ifcont93, %loop.body87 %191 = load i32, i32* %j, align 4 %192 = add i32 %191, 1 %193 = icmp sle i32 %192, 2 br i1 %193, label %loop.body89, label %loop.end94 loop.body89: ; preds = %loop.head88 %194 = load i32, i32* %j, align 4 %195 = add i32 %194, 1 store i32 %195, i32* %j, align 4 %196 = load i32, i32* %i, align 4 %197 = load i32, i32* %j, align 4 %198 = sub i32 %196, 1 %199 = mul i32 1, %198 %200 = add i32 0, %199 %201 = icmp slt i32 %196, 1 %202 = icmp sgt i32 %196, 2 %203 = or i1 %201, %202 br i1 %203, label %then90, label %ifcont91 then90: ; preds = %loop.body89 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @71, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @70, i32 0, i32 0), i32 %196, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont91: ; preds = %loop.body89 %204 = sub i32 %197, 1 %205 = mul i32 2, %204 %206 = add i32 %200, %205 %207 = icmp slt i32 %197, 1 %208 = icmp sgt i32 %197, 2 %209 = or i1 %207, %208 br i1 %209, label %then92, label %ifcont93 then92: ; preds = %ifcont91 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @73, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @72, i32 0, i32 0), i32 %197, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont93: ; preds = %ifcont91 %210 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i32 %206 %211 = load i32, i32* %i, align 4 %212 = load i32, i32* %j, align 4 %213 = add i32 %211, %212 %214 = add i32 %213, 10 %215 = sitofp i32 %214 to float %216 = insertvalue %complex_4 undef, float %215, 0 %217 = insertvalue %complex_4 %216, float 0.000000e+00, 1 store %complex_4 %217, %complex_4* %210, align 1 br label %loop.head88 loop.end94: ; preds = %loop.head88 br label %loop.head86 loop.end95: ; preds = %loop.head86 br i1 false, label %then96, label %ifcont97 then96: ; preds = %loop.end95 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @75, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @74, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont97: ; preds = %loop.end95 br i1 false, label %then98, label %ifcont99 then98: ; preds = %ifcont97 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @77, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @76, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont99: ; preds = %ifcont97 %218 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i32 0 %219 = load %complex_4, %complex_4* %218, align 1 %220 = extractvalue %complex_4 %219, 0 %221 = extractvalue %complex_4 %219, 1 %222 = fcmp one float %220, 1.200000e+01 %223 = fcmp one float %221, 0.000000e+00 %224 = or i1 %222, %223 br i1 %224, label %then100, label %else101 then100: ; preds = %ifcont99 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @79, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @78, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont102 else101: ; preds = %ifcont99 br label %ifcont102 ifcont102: ; preds = %else101, %then100 br i1 false, label %then103, label %ifcont104 then103: ; preds = %ifcont102 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @81, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @80, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont104: ; preds = %ifcont102 br i1 false, label %then105, label %ifcont106 then105: ; preds = %ifcont104 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @83, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @82, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont106: ; preds = %ifcont104 %225 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i32 2 %226 = load %complex_4, %complex_4* %225, align 1 %227 = extractvalue %complex_4 %226, 0 %228 = extractvalue %complex_4 %226, 1 %229 = fcmp one float %227, 1.300000e+01 %230 = fcmp one float %228, 0.000000e+00 %231 = or i1 %229, %230 br i1 %231, label %then107, label %else108 then107: ; preds = %ifcont106 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @85, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @84, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont109 else108: ; preds = %ifcont106 br label %ifcont109 ifcont109: ; preds = %else108, %then107 br i1 false, label %then110, label %ifcont111 then110: ; preds = %ifcont109 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @87, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @86, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont111: ; preds = %ifcont109 br i1 false, label %then112, label %ifcont113 then112: ; preds = %ifcont111 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @89, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @88, i32 0, i32 0), i32 1, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont113: ; preds = %ifcont111 %232 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i32 1 %233 = load %complex_4, %complex_4* %232, align 1 %234 = extractvalue %complex_4 %233, 0 %235 = extractvalue %complex_4 %233, 1 %236 = fcmp one float %234, 1.300000e+01 %237 = fcmp one float %235, 0.000000e+00 %238 = or i1 %236, %237 br i1 %238, label %then114, label %else115 then114: ; preds = %ifcont113 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @90, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont116 else115: ; preds = %ifcont113 br label %ifcont116 ifcont116: ; preds = %else115, %then114 br i1 false, label %then117, label %ifcont118 then117: ; preds = %ifcont116 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @93, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @92, i32 0, i32 0), i32 2, i32 1, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont118: ; preds = %ifcont116 br i1 false, label %then119, label %ifcont120 then119: ; preds = %ifcont118 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @95, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @94, i32 0, i32 0), i32 2, i32 2, i32 1, i32 2) call void @exit(i32 1) unreachable ifcont120: ; preds = %ifcont118 %239 = getelementptr [4 x %complex_4], [4 x %complex_4]* %c, i32 0, i32 3 %240 = load %complex_4, %complex_4* %239, align 1 %241 = extractvalue %complex_4 %240, 0 %242 = extractvalue %complex_4 %240, 1 %243 = fcmp one float %241, 1.400000e+01 %244 = fcmp one float %242, 0.000000e+00 %245 = or i1 %243, %244 br i1 %245, label %then121, label %else122 then121: ; preds = %ifcont120 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @97, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @96, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont123 else122: ; preds = %ifcont120 br label %ifcont123 ifcont123: ; preds = %else122, %then121 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont123 br label %FINALIZE_SYMTABLE_arrays_01_complex FINALIZE_SYMTABLE_arrays_01_complex: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-types_04-92449d7.stdout0000664000175000017500000000627315141516316025552 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 %x = alloca float, align 4 store float 1.500000e+00, float* %r, align 4 store i32 2, i32* %i, align 4 %2 = load i32, i32* %i, align 4 %3 = load i32, i32* %i, align 4 %4 = mul i32 %2, %3 %5 = sitofp i32 %4 to float store float %5, float* %x, align 4 %6 = load float, float* %r, align 4 %7 = load float, float* %r, align 4 %8 = fmul float %6, %7 store float %8, float* %x, align 4 %9 = load i32, i32* %i, align 4 %10 = sitofp i32 %9 to float %11 = load float, float* %r, align 4 %12 = fmul float %10, %11 store float %12, float* %x, align 4 %13 = load float, float* %r, align 4 %14 = load i32, i32* %i, align 4 %15 = sitofp i32 %14 to float %16 = fmul float %13, %15 store float %16, float* %x, align 4 %17 = load i32, i32* %i, align 4 %18 = load i32, i32* %i, align 4 %19 = add i32 %17, %18 %20 = sitofp i32 %19 to float store float %20, float* %x, align 4 %21 = load float, float* %r, align 4 %22 = load float, float* %r, align 4 %23 = fadd float %21, %22 store float %23, float* %x, align 4 %24 = load float, float* %r, align 4 %25 = load i32, i32* %i, align 4 %26 = sitofp i32 %25 to float %27 = fadd float %24, %26 store float %27, float* %x, align 4 %28 = load i32, i32* %i, align 4 %29 = sitofp i32 %28 to float %30 = load float, float* %r, align 4 %31 = fadd float %29, %30 store float %31, float* %x, align 4 %32 = load i32, i32* %i, align 4 %33 = load i32, i32* %i, align 4 %34 = sub i32 %32, %33 %35 = sitofp i32 %34 to float store float %35, float* %x, align 4 %36 = load float, float* %r, align 4 %37 = load float, float* %r, align 4 %38 = fsub float %36, %37 store float %38, float* %x, align 4 %39 = load float, float* %r, align 4 %40 = load i32, i32* %i, align 4 %41 = sitofp i32 %40 to float %42 = fsub float %39, %41 store float %42, float* %x, align 4 %43 = load i32, i32* %i, align 4 %44 = sitofp i32 %43 to float %45 = load float, float* %r, align 4 %46 = fsub float %44, %45 store float %46, float* %x, align 4 %47 = load i32, i32* %i, align 4 %48 = load i32, i32* %i, align 4 %49 = sdiv i32 %47, %48 %50 = sitofp i32 %49 to float store float %50, float* %x, align 4 %51 = load float, float* %r, align 4 %52 = load float, float* %r, align 4 %53 = fdiv float %51, %52 store float %53, float* %x, align 4 %54 = load i32, i32* %i, align 4 %55 = sitofp i32 %54 to float %56 = load float, float* %r, align 4 %57 = fdiv float %55, %56 store float %57, float* %x, align 4 %58 = load float, float* %r, align 4 %59 = load i32, i32* %i, align 4 %60 = sitofp i32 %59 to float %61 = fdiv float %58, %60 store float %61, float* %x, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_04 FINALIZE_SYMTABLE_types_04: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_03-1824805.stdout0000664000175000017500000000047115141516316027445 0ustar alastairalastairprogram derived_types_03 implicit none type :: X integer :: i end type X type(X) :: b contains subroutine Y() type :: A integer :: i end type A type(A) :: b end subroutine Y integer function Z() type :: A integer :: i end type A type(A) :: b Z = 5 end function Z end program derived_types_03 lfortran-lfortran-2f73434/tests/reference/ast-derived_types_01-b50f880.stdout0000664000175000017500000001726215141516316027134 0ustar alastairalastair(TranslationUnit [(Module derived_types_01_m_01 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType X [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeReal [] () () None ) [] [(r [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] ) (DerivedType Y [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeComplex [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () X None ) [] [(d [] [] () () None ())] () )] [] )] [] [(Subroutine set [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () X None ) [(AttrIntent Out )] [(a [] [] () () None ())] () )] [(Assignment 0 i [(a [])] 1 () ) (Assignment 0 r [(a [])] (Real "1.5") () )] [] [] )] ) (Module derived_types_01_m_02 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(Use [] derived_types_01_m_01 [(UseSymbol Y () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DerivedType Z [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeComplex [] () () None ) [] [(k [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Y None ) [] [(l [] [] () () None ())] () )] [] )] [] [] ) (Program derived_types_01 () [(Use [] derived_types_01_m_02 [(UseSymbol Z () )] .true. () ) (Use [] derived_types_01_m_01 [(UseSymbol X () ) (UseSymbol set () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeType [] () X None ) [] [(b [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () Z None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 i [(b [])] 5 () ) (Assignment 0 r [(b [])] (Real "3.5") () ) (Print 0 () [i [(b [])] r [(b [])]] () ) (SubroutineCall 0 set [] [(() b () 0)] [] [] () ) (Print 0 () [i [(b [])] r [(b [])]] () ) (Assignment 0 r [(c []) (l []) (d [])] (Real "2.0") () ) (Assignment 0 i [(c []) (l []) (d [])] 2 () ) (Assignment 0 k [(c [])] (Complex (Real "2.0") (Real "2.0")) () ) (Print 0 () [r [(c []) (l []) (d [])] i [(c []) (l []) (d [])] k [(c [])]] () ) (SubroutineCall 0 set [] [(() d [(c []) (l [])] () 0)] [] [] () ) (Print 0 () [r [(c []) (l []) (d [])] i [(c []) (l []) (d [])] k [(c [])]] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent2-80c03e1.json0000664000175000017500000000073715141516316026331 0ustar alastairalastair{ "basename": "ast-do_concurrent2-80c03e1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent2.f90", "infile_hash": "afe8788676d4b7be4b765236db5d9c60aa267325a08b714b35ba7eb6", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent2-80c03e1.stdout", "stdout_hash": "a70df883fcc6b8c546e8c45b808a98df215aba0e1c3d13042d58b833", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_03-d9fd880.stdout0000664000175000017500000004540015141516316030764 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data = private constant [4 x i8] c"T>T:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.2 = private constant [4 x i8] c"T>F:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.5 = private constant [4 x i8] c"F>T:" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.8 = private constant [4 x i8] c"F>F:" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.8, i32 0, i32 0), i64 4 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.11 = private constant [4 x i8] c"T @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.14 = private constant [4 x i8] c"T @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.16 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.17 = private constant [4 x i8] c"F @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.19 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.20 = private constant [4 x i8] c"F @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i1 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i1* %log1, i1* %log2) { .entry: %greater_than_inverse = alloca i1, align 1 %0 = load i1, i1* %log1, align 1 %1 = load i1, i1* %log2, align 1 %2 = select i1 false, i1 true, i1 %1 %3 = icmp eq i1 %0, false %4 = xor i1 %0, %2 %5 = xor i1 %4, true %6 = icmp eq i1 %5, false %7 = xor i1 %5, false %8 = xor i1 %7, true br i1 %8, label %then, label %else then: ; preds = %.entry store i1 true, i1* %greater_than_inverse, align 1 br label %ifcont else: ; preds = %.entry store i1 false, i1* %greater_than_inverse, align 1 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_greater_than_inverse FINALIZE_SYMTABLE_greater_than_inverse: ; preds = %return %9 = load i1, i1* %greater_than_inverse, align 1 ret i1 %9 } define i1 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i1* %log1, i1* %log2) { .entry: %less_than_inverse = alloca i1, align 1 %0 = load i1, i1* %log1, align 1 %1 = load i1, i1* %log2, align 1 %2 = select i1 true, i1 false, i1 %1 %3 = icmp eq i1 %0, false %4 = xor i1 %0, %2 %5 = xor i1 %4, true %6 = icmp eq i1 %5, false %7 = xor i1 %5, true %8 = xor i1 %7, true br i1 %8, label %then, label %else then: ; preds = %.entry store i1 true, i1* %less_than_inverse, align 1 br label %ifcont else: ; preds = %.entry store i1 false, i1* %less_than_inverse, align 1 br label %ifcont ifcont: ; preds = %else, %then br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_less_than_inverse FINALIZE_SYMTABLE_less_than_inverse: ; preds = %return %9 = load i1, i1* %less_than_inverse, align 1 ret i1 %9 } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i1, align 1 store i1 false, i1* %f, align 1 %t = alloca i1, align 1 store i1 true, i1* %t, align 1 %2 = alloca i64, align 8 %3 = call i1 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i1* %t, i1* %t) %4 = alloca i1, align 1 store i1 %3, i1* %4, align 1 %5 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %string_descriptor* @string_const, i1* %4) %6 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 4 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry %15 = alloca i64, align 8 %16 = call i1 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i1* %t, i1* %f) %17 = alloca i1, align 1 store i1 %16, i1* %17, align 1 %18 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.1, i32 0, i32 0), i64* %15, i32 0, i32 0, %string_descriptor* @string_const.3, i1* %17) %19 = load i64, i64* %15, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %19, i64* %21, align 4 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %25 = load i64, i64* %24, align 4 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %18) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %28 = alloca i64, align 8 %29 = call i1 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i1* %f, i1* %t) %30 = alloca i1, align 1 store i1 %29, i1* %30, align 1 %31 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.4, i32 0, i32 0), i64* %28, i32 0, i32 0, %string_descriptor* @string_const.6, i1* %30) %32 = load i64, i64* %28, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %31, i8** %33, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %32, i64* %34, align 4 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %38 = load i64, i64* %37, align 4 %39 = trunc i64 %38 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %40 = icmp eq i8* %31, null br i1 %40, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %31) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %41 = alloca i64, align 8 %42 = call i1 @__module_operator_overloading_01_overload_comp_m_greater_than_inverse(i1* %f, i1* %f) %43 = alloca i1, align 1 store i1 %42, i1* %43, align 1 %44 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.7, i32 0, i32 0), i64* %41, i32 0, i32 0, %string_descriptor* @string_const.9, i1* %43) %45 = load i64, i64* %41, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %46 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %44, i8** %46, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %45, i64* %47, align 4 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %49 = load i8*, i8** %48, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %51 = load i64, i64* %50, align 4 %52 = trunc i64 %51 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %49, i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %53 = icmp eq i8* %44, null br i1 %53, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %44) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %54 = alloca i64, align 8 %55 = call i1 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i1* %t, i1* %t) %56 = alloca i1, align 1 store i1 %55, i1* %56, align 1 %57 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.10, i32 0, i32 0), i64* %54, i32 0, i32 0, %string_descriptor* @string_const.12, i1* %56) %58 = load i64, i64* %54, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %57, i8** %59, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %58, i64* %60, align 4 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %62 = load i8*, i8** %61, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %64 = load i64, i64* %63, align 4 %65 = trunc i64 %64 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %62, i32 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %66 = icmp eq i8* %57, null br i1 %66, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free(i8* %57) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %67 = alloca i64, align 8 %68 = call i1 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i1* %t, i1* %f) %69 = alloca i1, align 1 store i1 %68, i1* %69, align 1 %70 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.13, i32 0, i32 0), i64* %67, i32 0, i32 0, %string_descriptor* @string_const.15, i1* %69) %71 = load i64, i64* %67, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %70, i8** %72, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %71, i64* %73, align 4 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %77 = load i64, i64* %76, align 4 %78 = trunc i64 %77 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %75, i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %79 = icmp eq i8* %70, null br i1 %79, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free(i8* %70) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %80 = alloca i64, align 8 %81 = call i1 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i1* %f, i1* %t) %82 = alloca i1, align 1 store i1 %81, i1* %82, align 1 %83 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.16, i32 0, i32 0), i64* %80, i32 0, i32 0, %string_descriptor* @string_const.18, i1* %82) %84 = load i64, i64* %80, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %85 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %83, i8** %85, align 8 %86 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %84, i64* %86, align 4 %87 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %88 = load i8*, i8** %87, align 8 %89 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %90 = load i64, i64* %89, align 4 %91 = trunc i64 %90 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %88, i32 %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %92 = icmp eq i8* %83, null br i1 %92, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free(i8* %83) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %93 = alloca i64, align 8 %94 = call i1 @__module_operator_overloading_01_overload_comp_m_less_than_inverse(i1* %f, i1* %f) %95 = alloca i1, align 1 store i1 %94, i1* %95, align 1 %96 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.19, i32 0, i32 0), i64* %93, i32 0, i32 0, %string_descriptor* @string_const.21, i1* %95) %97 = load i64, i64* %93, align 4 %stringFormat_desc19 = alloca %string_descriptor, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %96, i8** %98, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %97, i64* %99, align 4 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %101 = load i8*, i8** %100, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %103 = load i64, i64* %102, align 4 %104 = trunc i64 %103 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %101, i32 %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %105 = icmp eq i8* %96, null br i1 %105, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free(i8* %96) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 call void @_lpython_free_argv() br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_operator_overloading_01 FINALIZE_SYMTABLE_operator_overloading_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f5f31.jsonlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f0000664000175000017500000000112115141516316034411 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-optional_02-e4f5f31", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/optional_02.f90", "infile_hash": "f70cf57f95d77734e476563b856205456df72bd576aaacc1ab8fa85a", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-optional_02-e4f5f31.stdout", "stdout_hash": "bb207b52b0c76ac0468da75d275288ed0d14fc33cd2179c6ef2bee5d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_mul_test-562260f.json0000664000175000017500000000077215141516316026712 0ustar alastairalastair{ "basename": "asr-complex_mul_test-562260f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_mul_test.f90", "infile_hash": "908ba75c567d6ff4ba0e42cba3e974999d00e5d24710f4649ac212d6", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_mul_test-562260f.stdout", "stdout_hash": "20970a6a065da347ed62deeed309a3bd023952bd0b3e1b817121f184", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_sort_01-b412f73.stdout0000664000175000017500000062721015141516316027142 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_sort_01: (Program (SymbolTable 18 { lt_my_type: (ExternalSymbol 18 lt_my_type 2 lt_my_type template_sort_01_type [] lt_my_type Public ), my_type: (ExternalSymbol 18 my_type 2 my_type template_sort_01_type [] my_type Public ), op_r: (ExternalSymbol 18 op_r 5 op_r template_sort_01_m [] op_r Public ), qsort_t: (ExternalSymbol 18 qsort_t 5 qsort_t template_sort_01_m [] qsort_t Public ), test_template: (ExternalSymbol 18 test_template 5 test_template template_sort_01_m [] test_template Public ) }) template_sort_01 [template_sort_01_m] [(SubroutineCall 18 test_template () [] () .false. )] ), template_sort_01_m: (Module (SymbolTable 5 { lt_integer: (Function (SymbolTable 13 { lhs: (Variable 13 lhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 13 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 13 rhs [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) lt_integer (FunctionType [(Integer 4) (Integer 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 lhs) (Var 13 rhs)] [(Assignment (Var 13 res) (IntegerCompare (Var 13 lhs) Lt (Var 13 rhs) (Logical 4) () ) () .false. .false. )] (Var 13 res) Private .false. .false. () ), lt_my_type: (ExternalSymbol 5 lt_my_type 2 lt_my_type template_sort_01_type [] lt_my_type Public ), lt_real: (Function (SymbolTable 12 { lhs: (Variable 12 lhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 12 rhs [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) lt_real (FunctionType [(Real 4) (Real 4)] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 12 lhs) (Var 12 rhs)] [(Assignment (Var 12 res) (RealCompare (Var 12 lhs) Lt (Var 12 rhs) (Logical 4) () ) () .false. .false. )] (Var 12 res) Private .false. .false. () ), my_type: (ExternalSymbol 5 my_type 2 my_type template_sort_01_type [] my_type Public ), op_r: (Requirement (SymbolTable 6 { op_func: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 7 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) op_func (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter v ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 7 lhs) (Var 7 rhs)] [] (Var 7 res) Private .false. .false. () ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), u: (Variable 6 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ), v: (Variable 6 v [] In () () Default (TypeParameter v ) () Source Private Required .false. .false. .false. () .false. .false. ) }) op_r [t u v op_func] [] ), qsort_t: (Template (SymbolTable 8 { logical: (Variable 8 logical [] In () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), lt: (Function (SymbolTable 9 { lhs: (Variable 9 lhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 9 rhs [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) lt (FunctionType [(TypeParameter t ) (TypeParameter t )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 lhs) (Var 9 rhs)] [] (Var 9 res) Private .false. .false. () ), qs: (Function (SymbolTable 11 { arr: (Variable 11 arr [] InOut () () Default (Array (TypeParameter t ) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), high: (Variable 11 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 11 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), last: (Variable 11 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), low: (Variable 11 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pivot: (Variable 11 pivot [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) qs (FunctionType [(Array (TypeParameter t ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt swp qs] [(Var 11 arr) (Var 11 low) (Var 11 high)] [(If () (IntegerCompare (Var 11 low) Lt (Var 11 high) (Logical 4) () ) [(Assignment (Var 11 pivot) (ArrayItem (Var 11 arr) [(() (Var 11 high) ())] (TypeParameter t ) ColMajor () ) () .false. .false. ) (Assignment (Var 11 last) (IntegerBinOp (Var 11 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 11 i) (Var 11 low) (IntegerBinOp (Var 11 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 8 lt () [((ArrayItem (Var 11 arr) [(() (Var 11 i) ())] (TypeParameter t ) ColMajor () )) ((Var 11 pivot))] (Logical 4) () () ) [(Assignment (Var 11 last) (IntegerBinOp (Var 11 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 8 swp () [((ArrayItem (Var 11 arr) [(() (Var 11 last) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 11 arr) [(() (Var 11 i) ())] (TypeParameter t ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 8 swp () [((ArrayItem (Var 11 arr) [(() (IntegerBinOp (Var 11 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (TypeParameter t ) ColMajor () )) ((ArrayItem (Var 11 arr) [(() (Var 11 high) ())] (TypeParameter t ) ColMajor () ))] () .false. ) (SubroutineCall 8 qs () [((ArrayPhysicalCast (Var 11 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((Var 11 low)) ((Var 11 last))] () .false. ) (SubroutineCall 8 qs () [((ArrayPhysicalCast (Var 11 arr) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 11 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 11 high))] () .false. )] [] )] () Private .false. .false. () ), swp: (Function (SymbolTable 10 { lhs: (Variable 10 lhs [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 10 rhs [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 10 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) swp (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 lhs) (Var 10 rhs)] [(Assignment (Var 10 tmp) (Var 10 lhs) () .false. .false. ) (Assignment (Var 10 lhs) (Var 10 rhs) () .false. .false. ) (Assignment (Var 10 rhs) (Var 10 tmp) () .false. .false. )] () Private .false. .false. () ), t: (Variable 8 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) qsort_t [t lt] [(Require op_r [t logical lt] )] ), test_template: (Function (SymbolTable 14 { __asr_swp: (Function (SymbolTable 19 { lhs: (Variable 19 lhs [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 19 rhs [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 19 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_swp (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 19 lhs) (Var 19 rhs)] [(Assignment (Var 19 tmp) (Var 19 lhs) () .false. .false. ) (Assignment (Var 19 lhs) (Var 19 rhs) () .false. .false. ) (Assignment (Var 19 rhs) (Var 19 tmp) () .false. .false. )] () Private .false. .false. () ), __asr_swp1: (Function (SymbolTable 20 { lhs: (Variable 20 lhs [] InOut () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 20 rhs [] InOut () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 20 tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_swp1 (FunctionType [(Real 4) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 lhs) (Var 20 rhs)] [(Assignment (Var 20 tmp) (Var 20 lhs) () .false. .false. ) (Assignment (Var 20 lhs) (Var 20 rhs) () .false. .false. ) (Assignment (Var 20 rhs) (Var 20 tmp) () .false. .false. )] () Private .false. .false. () ), __asr_swp2: (Function (SymbolTable 21 { lhs: (Variable 21 lhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ), rhs: (Variable 21 rhs [] InOut () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 21 tmp [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_swp2 (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 lhs) (Var 21 rhs)] [(Assignment (Var 21 tmp) (Var 21 lhs) () .false. .false. ) (Assignment (Var 21 lhs) (Var 21 rhs) () .false. .false. ) (Assignment (Var 21 rhs) (Var 21 tmp) () .false. .false. )] () Private .false. .false. () ), i: (Variable 14 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), qsort_integer: (Function (SymbolTable 15 { arr: (Variable 15 arr [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), high: (Variable 15 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 15 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), last: (Variable 15 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), low: (Variable 15 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pivot: (Variable 15 pivot [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) qsort_integer (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_integer __asr_swp qsort_integer] [(Var 15 arr) (Var 15 low) (Var 15 high)] [(If () (IntegerCompare (Var 15 low) Lt (Var 15 high) (Logical 4) () ) [(Assignment (Var 15 pivot) (ArrayItem (Var 15 arr) [(() (Var 15 high) ())] (Integer 4) ColMajor () ) () .false. .false. ) (Assignment (Var 15 last) (IntegerBinOp (Var 15 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 15 i) (Var 15 low) (IntegerBinOp (Var 15 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_integer () [((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () )) ((Var 15 pivot))] (Logical 4) () () ) [(Assignment (Var 15 last) (IntegerBinOp (Var 15 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp () [((ArrayItem (Var 15 arr) [(() (Var 15 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 15 arr) [(() (Var 15 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp () [((ArrayItem (Var 15 arr) [(() (IntegerBinOp (Var 15 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 15 arr) [(() (Var 15 high) ())] (Integer 4) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 15 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 15 low)) ((Var 15 last))] () .false. ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 15 arr) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 15 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 15 high))] () .false. )] [] )] () Private .false. .false. () ), qsort_my_type: (Function (SymbolTable 17 { arr: (Variable 17 arr [] InOut () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ), high: (Variable 17 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 17 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), last: (Variable 17 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), low: (Variable 17 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pivot: (Variable 17 pivot [] Local () () Default (StructType [(Real 4)] [] .true. .false. ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ) }) qsort_my_type (FunctionType [(Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [__asr_swp2 qsort_my_type] [(Var 17 arr) (Var 17 low) (Var 17 high)] [(If () (IntegerCompare (Var 17 low) Lt (Var 17 high) (Logical 4) () ) [(Assignment (Var 17 pivot) (ArrayItem (Var 17 arr) [(() (Var 17 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) () .false. .false. ) (Assignment (Var 17 last) (IntegerBinOp (Var 17 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 17 i) (Var 17 low) (IntegerBinOp (Var 17 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_my_type () [((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((Var 17 pivot))] (Logical 4) () () ) [(Assignment (Var 17 last) (IntegerBinOp (Var 17 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp2 () [((ArrayItem (Var 17 arr) [(() (Var 17 last) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 17 arr) [(() (Var 17 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp2 () [((ArrayItem (Var 17 arr) [(() (IntegerBinOp (Var 17 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 17 arr) [(() (Var 17 high) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 17 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((Var 17 low)) ((Var 17 last))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 17 arr) DescriptorArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 17 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 17 high))] () .false. )] [] )] () Private .false. .false. () ), qsort_real: (Function (SymbolTable 16 { arr: (Variable 16 arr [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), high: (Variable 16 high [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), i: (Variable 16 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), last: (Variable 16 last [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), low: (Variable 16 low [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), pivot: (Variable 16 pivot [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) qsort_real (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [lt_real __asr_swp1 qsort_real] [(Var 16 arr) (Var 16 low) (Var 16 high)] [(If () (IntegerCompare (Var 16 low) Lt (Var 16 high) (Logical 4) () ) [(Assignment (Var 16 pivot) (ArrayItem (Var 16 arr) [(() (Var 16 high) ())] (Real 4) ColMajor () ) () .false. .false. ) (Assignment (Var 16 last) (IntegerBinOp (Var 16 low) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (DoLoop () ((Var 16 i) (Var 16 low) (IntegerBinOp (Var 16 high) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ()) [(If () (FunctionCall 5 lt_real () [((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Real 4) ColMajor () )) ((Var 16 pivot))] (Logical 4) () () ) [(Assignment (Var 16 last) (IntegerBinOp (Var 16 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 14 __asr_swp1 () [((ArrayItem (Var 16 arr) [(() (Var 16 last) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 16 arr) [(() (Var 16 i) ())] (Real 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 14 __asr_swp1 () [((ArrayItem (Var 16 arr) [(() (IntegerBinOp (Var 16 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () )) ((ArrayItem (Var 16 arr) [(() (Var 16 high) ())] (Real 4) ColMajor () ))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 16 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((Var 16 low)) ((Var 16 last))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 16 arr) DescriptorArray DescriptorArray (Array (Real 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 16 last) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((Var 16 high))] () .false. )] [] )] () Private .false. .false. () ), xi: (Variable 14 xi [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), xm: (Variable 14 xm [] Local () () Default (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) 5 my_type Source Private Required .false. .false. .false. () .false. .false. ), xr: (Variable 14 xr [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 14 xi) (ArrayConstant 40 [2, 4, 1, ...., 3, 42, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 14 xr) (ArrayConstant 40 [2.00000000e+00, 4.00000000e+00, 1.00000000e+00, ...., 3.00000000e+00, 4.20000000e+01, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (DoLoop () ((Var 14 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 14 xm) [(() (Var 14 i) ())] (StructType [(Real 4)] [] .true. .false. ) ColMajor () ) (StructConstructor 5 my_type [((ArrayItem (Var 14 xr) [(() (Var 14 i) ())] (Real 4) ColMajor () ))] (StructType [(Real 4)] [] .true. .false. ) () ) () .false. .false. )] [] ) (SubroutineCall 14 qsort_integer () [((ArrayPhysicalCast (Var 14 xi) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 14 qsort_real () [((ArrayPhysicalCast (Var 14 xr) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (SubroutineCall 14 qsort_my_type () [((ArrayPhysicalCast (Var 14 xm) FixedSizeArray DescriptorArray (Array (StructType [(Real 4)] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () )) ((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 10 (Integer 4) Decimal))] () .false. ) (Print (StringFormat () [(Var 14 xi)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 14 xr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 14 xm)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_sort_01_m () [template_sort_01_type template_sort_01_m] .false. .false. .false. ), template_sort_01_type: (Module (SymbolTable 2 { lt_my_type: (Function (SymbolTable 4 { 1_my_type_d: (ExternalSymbol 4 1_my_type_d 3 d my_type [] d Public ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 4 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Real 4)] [] .true. .false. ) 2 my_type Source Public Required .false. .false. .false. () .false. .false. ) }) lt_my_type (FunctionType [(StructType [(Real 4)] [] .true. .false. ) (StructType [(Real 4)] [] .true. .false. )] (Logical 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [(Assignment (Var 4 res) (RealCompare (StructInstanceMember (Var 4 lhs) 4 1_my_type_d (Real 4) () ) Lt (StructInstanceMember (Var 4 rhs) 4 1_my_type_d (Real 4) () ) (Logical 4) () ) () .false. .false. )] (Var 4 res) Public .false. .false. () ), my_type: (Struct (SymbolTable 3 { d: (Variable 3 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_type (StructType [(Real 4)] [] .true. .false. ) [] [d] [] Source Public .false. .false. [] () () ) }) template_sort_01_type () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-expr_11-ab53b8f.stderr0000664000175000017500000000024215141516316025667 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/../integration_tests/expr_11.f90:3:5 | 3 | real*8 x | ^^^^^^ help: write this as 'real(8)' lfortran-lfortran-2f73434/tests/reference/run-format8-4e5a9c0.json0000664000175000017500000000066215141516316025064 0ustar alastairalastair{ "basename": "run-format8-4e5a9c0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format8.f90", "infile_hash": "30908958fbdff81f81f462b9361840b83c87df049d3b81311709b494", "outfile": null, "outfile_hash": null, "stdout": "run-format8-4e5a9c0.stdout", "stdout_hash": "fa723c58541506da3d4ef67cccca0883504118610c2a5a645389c13f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-sole_intrinsic-1ce1e44.json0000664000175000017500000000075215141516316026507 0ustar alastairalastair{ "basename": "ast-sole_intrinsic-1ce1e44", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/sole_intrinsic.f", "infile_hash": "eb8dafc3736c80b83b7cc0b62cbe2fce5882fac022c391b7514607ea", "outfile": null, "outfile_hash": null, "stdout": "ast-sole_intrinsic-1ce1e44.stdout", "stdout_hash": "1d82f87da296398b2778dd0a2947f9d7eb09c4b643dc4b443fa23df5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_03-436c4e5.stdout0000664000175000017500000000107715141516316025657 0ustar alastairalastairprogram case03 implicit none ! local variable declaration integer :: marks integer, parameter :: a = 1, b = 2 marks = 94 select case (marks) case (40 + b:) print *, "Pass!" case (:39 - a) print *, "Failed!" case default print *, "Invalid marks" end select print *, "Your marks are ", marks marks = -1 select case (marks) case (40 + b:) print *, "Pass!" case (0:39 - a) print *, "Failed!" case default print *, "Invalid marks" end select print *, "Your marks are ", marks end program case03 lfortran-lfortran-2f73434/tests/reference/asr-arrays_reshape_14-913f34e.stdout0000664000175000017500000036637615141516316027317 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_reshape_14: (Program (SymbolTable 2 { i23: (Variable 2 i23 [] Local (ArrayReshape (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayPhysicalCast (ArrayConstant 8 [2, 3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [-14, 3, 0, -2, 19, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), test_1d_to_nd: (Function (SymbolTable 4 { a: (Variable 4 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 4 d [] Unspecified () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), eps: (Variable 4 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 4 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), newshape: (Variable 4 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), newshape1: (Variable 4 newshape1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_1d_to_nd (FunctionType [(Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 d)] [(Assignment (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) () .false. .false. ) (DoLoop () ((Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal) ()) [(Assignment (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) IntegerToReal (Real 4) () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () ) () .false. .false. )] [] ) (Assignment (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 a) (ArrayReshape (Var 4 b) (ArrayPhysicalCast (Var 4 newshape) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Real 8) [(() ()) (() ())] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 4 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 16 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 c) (ArrayReshape (Var 4 d) (ArrayPhysicalCast (Var 4 newshape1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Real 8) [(() ()) (() ()) (() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 4 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8) ColMajor () ) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 4 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] )] () Public .false. .false. () ), test_nd_to_1d: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 3 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), eps: (Variable 3 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 3 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), newshape: (Variable 3 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), newshape1: (Variable 3 newshape1 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_nd_to_1d (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 256 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (ArrayReshape (Var 3 a) (ArrayPhysicalCast (Var 3 newshape) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Real 8) [(() ())] DescriptorArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 256 (Integer 4) Decimal) ()) [(Assignment (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8) ColMajor () ) Sub (Cast (Var 3 i) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (Var 3 j) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 3 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 3 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 3 k) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () ) () .false. .false. )] [] )] [] )] [] ) (Assignment (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 4096 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 d) (ArrayReshape (Var 3 c) (ArrayPhysicalCast (Var 3 newshape1) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] DescriptorArray ) () ) (Array (Real 8) [(() ())] FixedSizeArray ) () ) () .false. .false. ) (DoLoop () ((Var 3 l) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal) ()) [(Assignment (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8) ColMajor () ) Sub (Cast (Var 3 i) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (Var 3 j) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (Var 3 k) IntegerToReal (Real 8) () ) (Real 8) () ) Sub (Cast (RealConstant 0.500000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.500000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Var 3 eps) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .false. .false. () ), test_reshape_with_argument: (Function (SymbolTable 5 { a: (Variable 5 a [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 5 d [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 5 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 5 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 5 l [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_reshape_with_argument (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [test_nd_to_1d test_1d_to_nd] [] [(DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(DoLoop () ((Var 5 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) IntegerToReal (Real 4) () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () ) () .false. .false. )] [] )] [] ) (SubroutineCall 2 test_nd_to_1d () [((ArrayPhysicalCast (Var 5 a) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (DoLoop () ((Var 5 l) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal) ()) [(Assignment (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Div (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Div (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8) ColMajor () ) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4) () ) Add (Var 5 k) (Integer 4) () ) IntegerToReal (Real 4) () ) Add (RealConstant 0.500000 (Real 4) ) (Real 4) () ) RealToReal (Real 8) () ) () .false. .false. )] [] ) (SubroutineCall 2 test_1d_to_nd () [((ArrayPhysicalCast (Var 5 d) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4096 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .false. .false. () ) }) array_reshape_14 [] [(Print (StringFormat () [(Var 2 i23)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 2 test_reshape_with_argument () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr1-213371d.json0000664000175000017500000000076415141516316027314 0ustar alastairalastair{ "basename": "pass_global_stmts-expr1-213371d", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr1-213371d.stdout", "stdout_hash": "ba286566be6b4df3a4d93854510b00a5f1f0c9a7a6696616bab20bb7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-modules_01-1b129c3.stdout0000664000175000017500000000276715141516316026115 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_modules_01_a_b() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_modules_01_a_b() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_modules_01 FINALIZE_SYMTABLE_modules_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-save_03-1103dd0.json0000664000175000017500000000073715141516316024632 0ustar alastairalastair{ "basename": "asr-save_03-1103dd0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/save_03.f90", "infile_hash": "cf1d7642d08ac82732ef50230fcd5c6a2efe507a49d1bab6d5fc4d18", "outfile": null, "outfile_hash": null, "stdout": "asr-save_03-1103dd0.stdout", "stdout_hash": "0229589db9b304eaddc3d97b7b701e0f16cdce1dfe971e3aac25e24b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_number_of_args-051b0f1.json0000664000175000017500000000077015141516316027540 0ustar alastairalastair{ "basename": "asr-fixed_number_of_args-051b0f1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/fixed_number_of_args.f90", "infile_hash": "1b3aa87f3b596e48a59fbdde7a0d087382fe86f59b16d140a9080f67", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-fixed_number_of_args-051b0f1.stderr", "stderr_hash": "0b27b7f5c19c3839e3d0a9d6780e620fc12356cfaf3e1f64acd9b7ba", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast_f90-format_01-fa31fe9.json0000664000175000017500000000076015141516316026020 0ustar alastairalastair{ "basename": "ast_f90-format_01-fa31fe9", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/format_01.f90", "infile_hash": "4cc04453f51b9adcf8108f25d26d048109fd69c30496888f6f560433", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-format_01-fa31fe9.stdout", "stdout_hash": "1fb1912ba73b8d475f18a53cb6b3c88da84f8c2a44bea12ed347e9bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_32-b407b58.json0000664000175000017500000000071515141516316025220 0ustar alastairalastair{ "basename": "run-format_32-b407b58", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_32.f90", "infile_hash": "385d84e335ddd90480fc23634cd59d26ffab47077a530930c9b040c4", "outfile": null, "outfile_hash": null, "stdout": "run-format_32-b407b58.stdout", "stdout_hash": "cc677e65d96a9b300f723460d58d5958810ec354b9c40c4d015aab9a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-assign_to2-6015b09.stdout0000664000175000017500000000302415141516316025737 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (sum [] [] () () None ()) (ZERO [] [] () () None ())] () )] [(Assign 10 30 next () ) (Assignment 0 sum ZERO () ) (Assignment 0 i 1 () ) (GoTo 20 next () [30 50 70] () ) (If 30 () (< 0 1) [(GoTo 0 () 70 [] () )] [] () () () ) (Print 50 () [50] () ) (Assign 0 50 next () ) (Print 70 () [70] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-program_03-fbe20e8.json0000664000175000017500000000075015141516316025515 0ustar alastairalastair{ "basename": "asr-program_03-fbe20e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_03.f90", "infile_hash": "66e74edaf380b88bc4d65b0f35934f6857a8e67080628b16bd0e935a", "outfile": null, "outfile_hash": null, "stdout": "asr-program_03-fbe20e8.stdout", "stdout_hash": "42a60fca8a7b688d060a38b2b1e467cef52b7167e59f71ac7e83e7c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_02-00d0664.stderr0000664000175000017500000000030615141516316026751 0ustar alastairalastairsemantic error: Type mismatch in argument `x`: expected `integer(4)[:]` but got `integer(8)[:]` --> tests/errors/implicit_call_02.f90:9:19 | 9 | call test_sub(arr) | ^^^ lfortran-lfortran-2f73434/tests/reference/llvm-class_01-82031c0.stdout0000664000175000017500000002022515141516316025453 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %circle_class = type <{ i32 (...)**, %circle* }> %circle = type { float } @__module_class_circle1_pi = global float 0x400921FB60000000 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0) }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_class_circle1_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_class_circle1_circle to i8*), i8* bitcast (float (%circle_class*)* @__module_class_circle1_circle_area to i8*), i8* bitcast (void (%circle_class*)* @__module_class_circle1_circle_print to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [25 x i8] c"S-DESC-12,R4,S-DESC-8,R4\00", align 1 @string_const_data = private constant [12 x i8] c"Circle: r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @string_const_data.1 = private constant [8 x i8] c" area = " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.1, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_class_circle1_circle_area(%circle_class* %this) { .entry: %area = alloca float, align 4 %0 = load float, float* @__module_class_circle1_pi, align 4 %1 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %2 = load %circle*, %circle** %1, align 8 %3 = getelementptr %circle, %circle* %2, i32 0, i32 0 %4 = load float, float* %3, align 4 %simplified_pow_operation = fmul float %4, %4 %5 = fmul float %0, %simplified_pow_operation store float %5, float* %area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %6 = load float, float* %area, align 4 ret float %6 } define void @__module_class_circle1_circle_print(%circle_class* %this) { .entry: %area = alloca float, align 4 %0 = bitcast %circle_class* %this to float (%circle_class*)*** %1 = load float (%circle_class*)**, float (%circle_class*)*** %0, align 8 %2 = getelementptr inbounds float (%circle_class*)*, float (%circle_class*)** %1, i32 2 %3 = load float (%circle_class*)*, float (%circle_class*)** %2, align 8 %4 = call float %3(%circle_class* %this) store float %4, float* %area, align 4 %5 = alloca i64, align 8 %6 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %7 = load %circle*, %circle** %6, align 8 %8 = getelementptr %circle, %circle* %7, i32 0, i32 0 %9 = load float, float* %8, align 4 %10 = alloca float, align 4 store float %9, float* %10, align 4 %11 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, %string_descriptor* @string_const, float* %10, %string_descriptor* @string_const.2, float* %area) %12 = load i64, i64* %5, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 4 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_circle_print FINALIZE_SYMTABLE_circle_print: ; preds = %return ret void } define linkonce_odr void @_copy_class_circle1_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %circle* %3 = bitcast i8* %1 to %circle* %4 = getelementptr %circle, %circle* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %circle, %circle* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_class_circle1_circle(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %circle_class* %4 = bitcast %circle_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %circle_class, %circle_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %circle* store %circle* %7, %circle** %5, align 8 %8 = getelementptr %circle, %circle* %7, i32 0, i32 0 ret void } declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca %circle, align 8 %2 = getelementptr %circle, %circle* %c, i32 0, i32 0 %3 = getelementptr %circle, %circle* %c, i32 0, i32 0 store float 1.500000e+00, float* %3, align 4 %4 = alloca %circle_class, align 8 %5 = getelementptr %circle_class, %circle_class* %4, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8 %6 = getelementptr %circle_class, %circle_class* %4, i32 0, i32 1 store %circle* %c, %circle** %6, align 8 call void @__module_class_circle1_circle_print(%circle_class* %4) %7 = getelementptr %circle, %circle* %c, i32 0, i32 0 store float 2.000000e+00, float* %7, align 4 %8 = alloca %circle_class, align 8 %9 = getelementptr %circle_class, %circle_class* %8, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %9, align 8 %10 = getelementptr %circle_class, %circle_class* %8, i32 0, i32 1 store %circle* %c, %circle** %10, align 8 call void @__module_class_circle1_circle_print(%circle_class* %8) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_test FINALIZE_SYMTABLE_circle_test: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-fn6-a24010a.json0000664000175000017500000000067615141516316024061 0ustar alastairalastair{ "basename": "asr-fn6-a24010a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/fn6.f90", "infile_hash": "635454a138db38c61d94f257c35b7c909eb0b9603372d17c77f7e1fd", "outfile": null, "outfile_hash": null, "stdout": "asr-fn6-a24010a.stdout", "stdout_hash": "664052099c78bf886fd473a09a261db8d03b9b161f9627f50671569c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-external_04-30bc1c7.stdout0000664000175000017500000000062515141516316026337 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define void @a() { .entry: call void @b(float ()* @f, float ()* @g) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_a FINALIZE_SYMTABLE_a: ; preds = %return ret void } declare void @b(float ()*, float ()*) declare float @f() declare float @g() lfortran-lfortran-2f73434/tests/reference/asr-program_without_line_cc-b84ba02.stderr0000664000175000017500000000052315141516316030711 0ustar alastairalastairsyntax error: Expected program end --> tests/errors/program_without_line_cc.f90:1:1 - 2:8 | 1 | print *, "OK" | ^^^^^^^^^^^^^... ... | 2 | contains | ...^^^^^^^^ semantic error: Variable 'contains' is not declared --> tests/errors/program_without_line_cc.f90:2:1 | 2 | contains | ^^^^^^^^ 'contains' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-where_01-c45f2da.stdout0000664000175000017500000007200415141516316025525 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { where_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) where_01 [] [(Assignment (Var 2 a) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-2, -2, -2, ...., -2, -2, -2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant -3 (Integer 4) Decimal) ) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [-3, -3, -3, ...., -3, -3, -3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (Where (IntegerCompare (Var 2 a) GtE (IntegerConstant 0 (Integer 4) Decimal) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 0 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [0, 0, 0, ...., 0, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(IntegerBinOp (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 0 (Integer 4) Decimal) (Integer 4) () )] 0 (Integer 4) () ) IntegerToReal (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutines_06-1ab6665.json0000664000175000017500000000076415141516316026277 0ustar alastairalastair{ "basename": "asr-subroutines_06-1ab6665", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_06.f90", "infile_hash": "29e8f662721c0da49f12396843b768130d3ec0293c22c9b527c2c053", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_06-1ab6665.stdout", "stdout_hash": "8083196a6f7b29c99eb0a1c32099b1c452457019f2c8d3f8594733f8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_where-where_03-00685f9.stdout0000664000175000017500000010145615141516316026677 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 where_03 () [] () .false. )] ), where_03: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) where_03 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 16 [-1.00000000e+00, -2.00000000e+00, 5.00000000e+00, 7.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (If () (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (If () (RealCompare (Var 2 a) Eq (RealConstant 1.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(If () (RealCompare (Var 2 a) Eq (RealConstant 2.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 a) (RealBinOp (RealBinOp (RealBinOp (Var 2 b) Mul (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Div (Var 2 a) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] )] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant -2.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-coarray_02-793f8b3.json0000664000175000017500000000073215141516316025357 0ustar alastairalastair{ "basename": "asr-coarray_02-793f8b3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/coarray_02.f90", "infile_hash": "44aa57421c584c7303ac985d318b599190ab1a634795e72cc1b3488a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-coarray_02-793f8b3.stderr", "stderr_hash": "08647c98a57c1f78ead31e8f8989aee8b6e65c75d38debbdf4739b7e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-coarrays_01-2b1221b.stdout0000664000175000017500000005211115141516316026060 0ustar alastairalastair(TranslationUnit [(Program coarrays_01 (TriviaNode [(EndOfLine) (Comment "! This test should test most of coarray syntax:" ) (Comment "! * declarations" ) (Comment "! * allocations" ) (Comment "! * coarray operations" ) (Comment "!" ) (Comment "! You can test the syntax manually with GFortran by:" ) (Comment "! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o" ) (Comment "!" )] [] ) [(Use [] iso_fortran_env [(UseSymbol event_type () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Coarray Declarations" )] ) )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 100 DimensionExpr)] ) (AttrCodimension [(() () CodimensionStar)] )] [(A [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [(1 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(c [] [(() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(D [(1 100 DimensionExpr) (1 2 DimensionExpr)] [(1 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(E [(1 1 DimensionExpr) (1 2 DimensionExpr) (1 3 DimensionExpr)] [(1 1 CodimensionExpr) (1 2 CodimensionExpr) ((u- 1) 3 CodimensionExpr) (() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(F [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(g [(() () DimensionExpr) (() () DimensionExpr) (() () DimensionExpr)] [(() () CodimensionExpr) (() () CodimensionExpr) (() () CodimensionExpr)] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 20 DimensionExpr)] ) (AttrCodimension [(1 20 CodimensionExpr) (() () CodimensionStar)] )] [(h [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrCodimension [(() () CodimensionExpr)] ) (SimpleAttribute AttrAllocatable )] [(z [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeCharacter [] () () None ) [] [(r [(1 20 DimensionExpr)] [(1 20 CodimensionExpr) (0 () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeType [] () event_type None ) [] [(ok_to_overwrite [] [(() () CodimensionStar)] () () None ())] () ) (Declaration (AttrType TypeType [] () event_type None ) [(SimpleAttribute AttrAllocatable )] [(greeting_ready [(() () DimensionExpr)] [(() () CodimensionExpr)] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (n [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Allocation" )] ) )] [(Assignment 0 n 5 () ) (Allocate 0 [(() (CoarrayRef F [] [(() n () 0)] [] [(() () 1 CodimensionStar)] [] ) () 0)] [] () ) (Allocate 0 [(() (CoarrayRef greeting_ready [] [(() (FuncCallOrArray num_images [] [] [] [] [] ) () 0)] [] [(() () 1 CodimensionStar)] [] ) () 0)] [] () ) (Allocate 0 [(() (CoarrayRef g [] [(() 50 () 0) (() 50 () 0) (() 50 () 0)] [] [(1 2 1 CodimensionExpr) (1 2 1 CodimensionExpr) (() () 1 CodimensionStar)] [] ) () 0)] [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Array access, events, teams" )] ) ) (If 0 () (== (FuncCallOrArray this_image [] [] [] [] [] ) 1) [(DoLoop 0 () 0 i 2 (FuncCallOrArray num_images [] [] [] [] [] ) () [(Assignment 0 c (+ c (CoarrayRef c [] [] [] [(() i () CodimensionExpr)] [] )) () ) (EventPost 0 (CoarrayRef ok_to_overwrite [] [] [] [(() i () CodimensionExpr)] [] ) [] () )] () () )] [(EventWait 0 ok_to_overwrite [] () ) (EventPost 0 (CoarrayRef greeting_ready [] [(() (FuncCallOrArray this_image [] [] [] [] [] ) () 0)] [] [(() 1 () CodimensionExpr)] [] ) [] () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SyncAll 0 [] () ) (SyncAll 0 [] () ) (SyncAll 0 [(AttrStat status )] () ) (SyncAll 0 [(AttrErrmsg status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (EventWait 0 variable [(AttrEventWaitKwArg until_count status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg until_count status ) (AttrErrmsg status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg errmsg status )] () ) (EventWait 0 variable [(AttrEventWaitKwArg stat status )] () ) (EventPost 0 (CoarrayRef done [] [(() (FuncCallOrArray sub [] [(() i () 0)] [] [] [] ) () 0)] [] [(() (FuncCallOrArray parent [] [(() i () 0)] [] [] [] ) () CodimensionExpr)] [] ) [(AttrStat status )] () ) (EventPost 0 variable [(AttrStat status )] () ) (EventPost 0 variable [(AttrErrmsg status )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 (FuncCallOrArray a [(s [])] [(() 3 () 0)] [] [(() 4 () 0)] [] ) (String "S" ()) () ) (Assignment 0 (CoarrayRef b [(s [])] [] [] [(() 3 () CodimensionExpr)] [] ) (CoarrayRef c [] [] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef c [(s [])] [(() 3 () 0)] [] [(() 4 () CodimensionExpr)] [] ) (CoarrayRef f [] [(() 3 () 0)] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef c [] [] [] [(() 3 () CodimensionExpr)] [] ) (CoarrayRef c [] [] [] [(() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef B [] [] [] [(() 1 () CodimensionExpr) (() 2 () CodimensionExpr)] [] ) (CoarrayRef B [] [] [] [(() 3 () CodimensionExpr) (() 4 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef D [] [(() 99 () 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 4 () CodimensionExpr)] [] ) (CoarrayRef D [] [(() 1 () 0) (() 2 () 0)] [] [(() 1 () CodimensionExpr) (() 2 () CodimensionExpr)] [] ) () ) (Assignment 0 (CoarrayRef D [] [(() 99 () 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(team 3)] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(team 3) (stat i)] ) 5 () ) (Assignment 0 (CoarrayRef D [] [(() () 1 0) (() 1 () 0)] [] [(() 3 () CodimensionExpr) (() 3 () CodimensionExpr)] [(stat i)] ) 5 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-abort_01-7212a3d.json0000664000175000017500000000106515141516316025170 0ustar alastairalastair{ "basename": "llvm-abort_01-7212a3d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/abort_01.f90", "infile_hash": "9b8982942d302b8eddf9045a7946fa1e69ed2f05b494320cef4823c2", "outfile": null, "outfile_hash": null, "stdout": "llvm-abort_01-7212a3d.stdout", "stdout_hash": "2d788656766d53021efb97ff1d323f416f760182ebb8b6c6c325fe22", "stderr": "llvm-abort_01-7212a3d.stderr", "stderr_hash": "132e12d6d59905849ec72f4c5e5303920f043e68e199519ab136643f", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-complex3-001609d.stdout0000664000175000017500000000450515141516316025423 0ustar alastairalastair(TranslationUnit [(Program complex3 () [] [] [(Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 8 Value)] () () None ) [] [(y [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [(() 4 Value)] () () None ) [] [(w [] [] () () None ())] () )] [(Assignment 0 x (Complex (Real "3.0_8") (Real "4.0_8")) () ) (Print 0 () [x] () ) (Assignment 0 y (Complex (Real "3.0_8") (Real "4.0_8")) () ) (Print 0 () [y] () ) (Assignment 0 z (Complex (Real "3.0_4") (Real "4.0_4")) () ) (Print 0 () [z] () ) (Assignment 0 w (Complex (Real "3.0_4") (Real "4.0_4")) () ) (Print 0 () [w] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-integerStringInput_64-3a7e5be.stderr0000664000175000017500000000005415141516316030267 0ustar alastairalastairError: Invalid input for int64_t from file. lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit1-5bea864.json0000664000175000017500000000077415141516316027574 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit1-5bea864", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit1.f", "infile_hash": "23368f2fe6f6771c71559e99af7296e68d793e5df5a6a69aa6c39f62", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit1-5bea864.stdout", "stdout_hash": "9f2a92545fa9fef0e728a5105db787511732b5dfd0e291a9c7d1ec5e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit12-1826599.stdout0000664000175000017500000005121615141516316025611 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) () .false. .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_indent-subroutine1-41f648b.json0000664000175000017500000000074415141516316027233 0ustar alastairalastair{ "basename": "asr_indent-subroutine1-41f648b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine1.f90", "infile_hash": "e209c22328b423e75d6801f3c0ef19bc120936196435dff2cb19df31", "outfile": null, "outfile_hash": null, "stdout": "asr_indent-subroutine1-41f648b.stdout", "stdout_hash": "7dcfae335439415cf4ef7af7dff71c6f7b26a714b8bf963cedbe3217", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_34-81f4937.stdout0000664000175000017500000000005015141516316025515 0ustar alastairalastairmainline k = -1 2 3 internal k = -1 2 3 lfortran-lfortran-2f73434/tests/reference/asr-modules_02-74be421.stdout0000664000175000017500000001722115141516316025724 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_02: (Program (SymbolTable 7 { b: (ExternalSymbol 7 b 2 b modules_02_a [] b Public ), e: (ExternalSymbol 7 e 4 e modules_02_c [] e Public ), x: (ExternalSymbol 7 x 4 d modules_02_c [] d Public ) }) modules_02 [modules_02_a modules_02_c] [(SubroutineCall 7 b () [] () .false. ) (SubroutineCall 7 x () [] () .false. ) (SubroutineCall 7 e () [] () .false. )] ), modules_02_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_02_a () [] .false. .false. .false. ), modules_02_c: (Module (SymbolTable 4 { d: (Function (SymbolTable 5 { }) d (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "d()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), e: (Function (SymbolTable 6 { }) e (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "e()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) modules_02_c () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-substring_startidx-5fb6d57.json0000664000175000017500000000076215141516316027440 0ustar alastairalastair{ "basename": "asr-substring_startidx-5fb6d57", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/substring_startidx.f90", "infile_hash": "fcff3742bb69cbe950f45a39c1dca614325666b260ee503f8862cfdf", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-substring_startidx-5fb6d57.stderr", "stderr_hash": "564b4a23bb9dc1c50abb4282ce068b3666966efc9fd6fa9de268b987", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-bindc1-345b88c.json0000664000175000017500000000073715141516316024743 0ustar alastairalastair{ "basename": "llvm-bindc1-345b88c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc1.f90", "infile_hash": "b894bae3cff84c3540cc34d38c5e3e6c46197db6d93d5f0b48013a06", "outfile": null, "outfile_hash": null, "stdout": "llvm-bindc1-345b88c.stdout", "stdout_hash": "b00ababa0c9372b522bd727e57a6b0894c54dad91ed35053ca168ee6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-close_invalid_kwarg1-b38b499.stderr0000664000175000017500000000022215141516316030030 0ustar alastairalastairsemantic error: Invalid argument `end` supplied --> tests/errors/close_invalid_kwarg1.f90:4:5 | 4 | CLOSE(end=200) | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-write5-2f63ce9.stdout0000664000175000017500000000005315141516316025275 0ustar alastairalastairhibye first , last Hello world! lfortran-lfortran-2f73434/tests/reference/llvm-logical2-94a2259.json0000664000175000017500000000074515141516316025215 0ustar alastairalastair{ "basename": "llvm-logical2-94a2259", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical2.f90", "infile_hash": "5b01ca4533da32f0fa6292eeb511d007181a316ce112af8ff858c9c0", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical2-94a2259.stdout", "stdout_hash": "89b23e1cc35f41706138b1e99f07f2678a4e6416a13f04b0cff65cdd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_06-821cc56.stdout0000664000175000017500000001652715141516316025743 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_06_a: (Module (SymbolTable 4 { a: (Function (SymbolTable 5 { a: (Variable 5 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Add (FunctionCall 4 b () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. )] (Var 5 a) Public .false. .false. () ), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Public ) }) modules_06_a () [modules_06_b] .false. .false. .false. ), modules_06_b: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 b) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 3 b) Public .false. .false. () ) }) modules_06_b () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_error_04-16c03e5.json0000664000175000017500000000075715141516316026735 0ustar alastairalastair{ "basename": "asr-template_error_04-16c03e5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_04.f90", "infile_hash": "3d82e0ebf1e89bfdddfc6b3ae47095d92ae6e31d6ca62fdbcf40c593", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_04-16c03e5.stderr", "stderr_hash": "bb95e09903b028ee8a93c75a094907a6b565354afb8fc3a7a4e55a61", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-global_scope3-45d8bdc.stdout0000664000175000017500000000061215141516316026632 0ustar alastairalastair(TranslationUnit [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Assignment 0 x 6 () ) (Assignment 0 x (+ x 1) () )] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_04-1467181.stderr0000664000175000017500000000023415141516316030341 0ustar alastairalastairsyntax error: Statement or Declaration expected inside program, found Expression --> tests/errors/program_without_line_04.f90:2:1 | 2 | 2 + 2 | ^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-multi_error1-ed395f9.stderr0000664000175000017500000000075315141516316026462 0ustar alastairalastairsyntax error: Newline is unexpected here --> tests/multi_error1.f90:3:15 | 3 | integer :: x = | ^ syntax error: Newline is unexpected here --> tests/multi_error1.f90:5:15 | 5 | integer :: y = | ^ syntax error: Newline is unexpected here --> tests/multi_error1.f90:6:13 | 6 | print *, x + | ^ syntax error: Token 'y' (of type 'identifier') is unexpected here --> tests/multi_error1.f90:7:12 | 7 | print *, x y | ^ lfortran-lfortran-2f73434/tests/reference/ast-parameter_01-746df62.json0000664000175000017500000000075615141516316025703 0ustar alastairalastair{ "basename": "ast-parameter_01-746df62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_01.f90", "infile_hash": "3488de8c55d194f309a915223114321d8596fba6f63399b39ac1ad68", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_01-746df62.stdout", "stdout_hash": "0f45f37e0c2c7f94640f3f8b1c01280a5642f24835f7c70b24dc9830", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr4-6c75096.json0000664000175000017500000000070415141516316024375 0ustar alastairalastair{ "basename": "asr-expr4-6c75096", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "asr-expr4-6c75096.stdout", "stdout_hash": "165f0be894fdc0bd46d8f7239c2179d258224f3ff0efc5dda62a6775", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-uppercase1-b7c06b1.json0000664000175000017500000000072315141516316025525 0ustar alastairalastair{ "basename": "asr-uppercase1-b7c06b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/uppercase1.f90", "infile_hash": "5a65afa41100952259b9009c4fba9ad49c4090de264c0e38fcb37834", "outfile": null, "outfile_hash": null, "stdout": "asr-uppercase1-b7c06b1.stdout", "stdout_hash": "bed4387ba506826a78494642671db2ae955baed5092b35ad60b4b20d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-doloop_01-a6563cb.json0000664000175000017500000000075015141516316025443 0ustar alastairalastair{ "basename": "llvm-doloop_01-a6563cb", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_01.f90", "infile_hash": "14818f8f39c32bf890cf7906fe8a9692b270ad81a49bcdf0486f8e84", "outfile": null, "outfile_hash": null, "stdout": "llvm-doloop_01-a6563cb.stdout", "stdout_hash": "87118ca8bea5d05ddb350263fae058a09814e478137d31580b67d1a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_size_01-cdffaed.json0000664000175000017500000000074315141516316026437 0ustar alastairalastair{ "basename": "asr-array_size_01-cdffaed", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_01.f90", "infile_hash": "30589552e7b01a1e8ea7af0d40250a71b6da5ada13521c8a222d7e14", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_01-cdffaed.stderr", "stderr_hash": "87b541207ac6c6cd8813ae288cb7710355a4248161837047820cd9fd", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_flip_sign-expr_13-e24d940.json0000664000175000017500000000100615141516316027073 0ustar alastairalastair{ "basename": "pass_flip_sign-expr_13-e24d940", "cmd": "lfortran --pass=flip_sign --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/expr_13.f90", "infile_hash": "2eaa9b9631c66ea28ea4dc4ede8f1a3717f4a929a68455837525f54f", "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-expr_13-e24d940.stdout", "stdout_hash": "6839eb57639d2c54366a95c7ed4ccf3290a6f15c029f38dab7dcff9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_05-e6d3b50.json0000664000175000017500000000074515141516316025272 0ustar alastairalastair{ "basename": "asr-arrays_05-e6d3b50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_05.f90", "infile_hash": "09eac1191b2e8a76fafedf1307b2d1240ffbc5f632c08afa847df805", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_05-e6d3b50.stdout", "stdout_hash": "280ef306b1bbdb7dd80a42d1c512933b61f7eb1a6ce93f2c866aff4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-arrays_101-8ed52ae.stdout0000664000175000017500000004124215141516316026167 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [10 x i8] c"small_arr\00", align 1 @1 = private unnamed_addr constant [178 x i8] c"At 17:5 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @2 = private unnamed_addr constant [10 x i8] c"large_arr\00", align 1 @3 = private unnamed_addr constant [178 x i8] c"At 18:5 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @4 = private unnamed_addr constant [10 x i8] c"small_arr\00", align 1 @5 = private unnamed_addr constant [178 x i8] c"At 21:9 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [10 x i8] c"large_arr\00", align 1 @9 = private unnamed_addr constant [178 x i8] c"At 22:9 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [10 x i8] c"block_arr\00", align 1 @13 = private unnamed_addr constant [179 x i8] c"At 30:13 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @14 = private unnamed_addr constant [10 x i8] c"block_arr\00", align 1 @15 = private unnamed_addr constant [179 x i8] c"At 31:25 of file tests/../integration_tests/arrays_101.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [2 x i8] c"OK" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data, i32 0, i32 0), i64 2 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @_lcompilers_real_i32(i32* %x) { .entry: %_lcompilers_real_i32 = alloca float, align 4 %0 = load i32, i32* %x, align 4 %1 = sitofp i32 %0 to float store float %1, float* %_lcompilers_real_i32, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE__lcompilers_real_i32 FINALIZE_SYMTABLE__lcompilers_real_i32: ; preds = %return %2 = load float, float* %_lcompilers_real_i32, align 4 ret float %2 } define i32 @main(i32 %0, i8** %1) { .entry: %array_bound38 = alloca i32, align 4 %array_bound33 = alloca i32, align 4 %array_bound12 = alloca i32, align 4 %array_bound7 = alloca i32, align 4 %array_bound1 = alloca i32, align 4 %array_bound = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %__libasr_index_0_ = alloca i32, align 4 %__libasr_index_0_1 = alloca i32, align 4 %i = alloca i32, align 4 %2 = call i8* @_lfortran_malloc(i64 8000) %3 = bitcast i8* %2 to [2000 x float]* %small_arr = alloca [100 x float], align 4 %sum = alloca float, align 4 br i1 true, label %then, label %else then: ; preds = %.entry store i32 1, i32* %array_bound, align 4 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %4 = load i32, i32* %array_bound, align 4 %5 = sub i32 %4, 1 store i32 %5, i32* %__libasr_index_0_, align 4 br label %loop.head loop.head: ; preds = %ifcont6, %ifcont %6 = load i32, i32* %__libasr_index_0_, align 4 %7 = add i32 %6, 1 br i1 true, label %then2, label %else3 then2: ; preds = %loop.head store i32 100, i32* %array_bound1, align 4 br label %ifcont4 else3: ; preds = %loop.head br label %ifcont4 ifcont4: ; preds = %else3, %then2 %8 = load i32, i32* %array_bound1, align 4 %9 = icmp sle i32 %7, %8 br i1 %9, label %loop.body, label %loop.end loop.body: ; preds = %ifcont4 %10 = load i32, i32* %__libasr_index_0_, align 4 %11 = add i32 %10, 1 store i32 %11, i32* %__libasr_index_0_, align 4 %12 = load i32, i32* %__libasr_index_0_, align 4 %13 = sub i32 %12, 1 %14 = mul i32 1, %13 %15 = add i32 0, %14 %16 = icmp slt i32 %12, 1 %17 = icmp sgt i32 %12, 100 %18 = or i1 %16, %17 br i1 %18, label %then5, label %ifcont6 then5: ; preds = %loop.body call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @0, i32 0, i32 0), i32 %12, i32 1, i32 1, i32 100) call void @exit(i32 1) unreachable ifcont6: ; preds = %loop.body %19 = getelementptr [100 x float], [100 x float]* %small_arr, i32 0, i32 %15 store float 1.000000e+00, float* %19, align 4 br label %loop.head loop.end: ; preds = %ifcont4 br i1 true, label %then8, label %else9 then8: ; preds = %loop.end store i32 1, i32* %array_bound7, align 4 br label %ifcont10 else9: ; preds = %loop.end br label %ifcont10 ifcont10: ; preds = %else9, %then8 %20 = load i32, i32* %array_bound7, align 4 %21 = sub i32 %20, 1 store i32 %21, i32* %__libasr_index_0_1, align 4 br label %loop.head11 loop.head11: ; preds = %ifcont18, %ifcont10 %22 = load i32, i32* %__libasr_index_0_1, align 4 %23 = add i32 %22, 1 br i1 true, label %then13, label %else14 then13: ; preds = %loop.head11 store i32 2000, i32* %array_bound12, align 4 br label %ifcont15 else14: ; preds = %loop.head11 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %24 = load i32, i32* %array_bound12, align 4 %25 = icmp sle i32 %23, %24 br i1 %25, label %loop.body16, label %loop.end19 loop.body16: ; preds = %ifcont15 %26 = load i32, i32* %__libasr_index_0_1, align 4 %27 = add i32 %26, 1 store i32 %27, i32* %__libasr_index_0_1, align 4 %28 = load i32, i32* %__libasr_index_0_1, align 4 %29 = sub i32 %28, 1 %30 = mul i32 1, %29 %31 = add i32 0, %30 %32 = icmp slt i32 %28, 1 %33 = icmp sgt i32 %28, 2000 %34 = or i1 %32, %33 br i1 %34, label %then17, label %ifcont18 then17: ; preds = %loop.body16 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @2, i32 0, i32 0), i32 %28, i32 1, i32 1, i32 2000) call void @exit(i32 1) unreachable ifcont18: ; preds = %loop.body16 %35 = getelementptr [2000 x float], [2000 x float]* %3, i32 0, i32 %31 store float 2.000000e+00, float* %35, align 4 br label %loop.head11 loop.end19: ; preds = %ifcont15 br i1 false, label %then20, label %ifcont21 then20: ; preds = %loop.end19 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @4, i32 0, i32 0), i32 1, i32 1, i32 1, i32 100) call void @exit(i32 1) unreachable ifcont21: ; preds = %loop.end19 %36 = getelementptr [100 x float], [100 x float]* %small_arr, i32 0, i32 0 %37 = load float, float* %36, align 4 %38 = fcmp une float %37, 1.000000e+00 br i1 %38, label %then22, label %else23 then22: ; preds = %ifcont21 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 br i1 false, label %then25, label %ifcont26 then25: ; preds = %ifcont24 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @8, i32 0, i32 0), i32 1, i32 1, i32 1, i32 2000) call void @exit(i32 1) unreachable ifcont26: ; preds = %ifcont24 %39 = getelementptr [2000 x float], [2000 x float]* %3, i32 0, i32 0 %40 = load float, float* %39, align 4 %41 = fcmp une float %40, 2.000000e+00 br i1 %41, label %then27, label %else28 then27: ; preds = %ifcont26 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont29 else28: ; preds = %ifcont26 br label %ifcont29 ifcont29: ; preds = %else28, %then27 store float 0.000000e+00, float* %sum, align 4 store i32 0, i32* %i, align 4 br label %loop.head30 loop.head30: ; preds = %FINALIZE_SYMTABLE_block, %ifcont29 %42 = load i32, i32* %i, align 4 %43 = add i32 %42, 1 %44 = icmp sle i32 %43, 1000 br i1 %44, label %loop.body31, label %loop.end48 loop.body31: ; preds = %loop.head30 %45 = load i32, i32* %i, align 4 %46 = add i32 %45, 1 store i32 %46, i32* %i, align 4 br label %block.start block.start: ; preds = %loop.body31 %__libasr_index_0_32 = alloca i32, align 4 %47 = call i8* @_lfortran_malloc(i64 2000) %48 = bitcast i8* %47 to [500 x float]* br i1 true, label %then34, label %else35 then34: ; preds = %block.start store i32 1, i32* %array_bound33, align 4 br label %ifcont36 else35: ; preds = %block.start br label %ifcont36 ifcont36: ; preds = %else35, %then34 %49 = load i32, i32* %array_bound33, align 4 %50 = sub i32 %49, 1 store i32 %50, i32* %__libasr_index_0_32, align 4 br label %loop.head37 loop.head37: ; preds = %ifcont44, %ifcont36 %51 = load i32, i32* %__libasr_index_0_32, align 4 %52 = add i32 %51, 1 br i1 true, label %then39, label %else40 then39: ; preds = %loop.head37 store i32 500, i32* %array_bound38, align 4 br label %ifcont41 else40: ; preds = %loop.head37 br label %ifcont41 ifcont41: ; preds = %else40, %then39 %53 = load i32, i32* %array_bound38, align 4 %54 = icmp sle i32 %52, %53 br i1 %54, label %loop.body42, label %loop.end45 loop.body42: ; preds = %ifcont41 %55 = load i32, i32* %__libasr_index_0_32, align 4 %56 = add i32 %55, 1 store i32 %56, i32* %__libasr_index_0_32, align 4 %57 = load i32, i32* %__libasr_index_0_32, align 4 %58 = sub i32 %57, 1 %59 = mul i32 1, %58 %60 = add i32 0, %59 %61 = icmp slt i32 %57, 1 %62 = icmp sgt i32 %57, 500 %63 = or i1 %61, %62 br i1 %63, label %then43, label %ifcont44 then43: ; preds = %loop.body42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @12, i32 0, i32 0), i32 %57, i32 1, i32 1, i32 500) call void @exit(i32 1) unreachable ifcont44: ; preds = %loop.body42 %64 = getelementptr [500 x float], [500 x float]* %48, i32 0, i32 %60 %65 = call float @_lcompilers_real_i32(i32* %i) store float %65, float* %64, align 4 br label %loop.head37 loop.end45: ; preds = %ifcont41 %66 = load float, float* %sum, align 4 br i1 false, label %then46, label %ifcont47 then46: ; preds = %loop.end45 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @14, i32 0, i32 0), i32 1, i32 1, i32 1, i32 500) call void @exit(i32 1) unreachable ifcont47: ; preds = %loop.end45 %67 = getelementptr [500 x float], [500 x float]* %48, i32 0, i32 0 %68 = load float, float* %67, align 4 %69 = fadd float %66, %68 store float %69, float* %sum, align 4 %70 = icmp eq i8* %47, null br i1 %70, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont47 call void @_lfortran_free(i8* %47) br label %free_done free_done: ; preds = %free_nonnull, %ifcont47 br label %block.end block.end: ; preds = %free_done br label %FINALIZE_SYMTABLE_block FINALIZE_SYMTABLE_block: ; preds = %block.end br label %loop.head30 loop.end48: ; preds = %loop.head30 %71 = load float, float* %sum, align 4 %72 = fsub float %71, 5.005000e+05 %73 = call float @llvm.fabs.f32(float %72) %74 = fcmp ogt float %73, 0x3FB99999A0000000 br i1 %74, label %then49, label %else50 then49: ; preds = %loop.end48 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont51 else50: ; preds = %loop.end48 br label %ifcont51 ifcont51: ; preds = %else50, %then49 %75 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %75, i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %ifcont51 br label %FINALIZE_SYMTABLE_static_large_array FINALIZE_SYMTABLE_static_large_array: ; preds = %return %76 = icmp eq i8* %2, null br i1 %76, label %free_done53, label %free_nonnull52 free_nonnull52: ; preds = %FINALIZE_SYMTABLE_static_large_array call void @_lfortran_free(i8* %2) br label %free_done53 free_done53: ; preds = %free_nonnull52, %FINALIZE_SYMTABLE_static_large_array ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lfortran_free(i8*) ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.fabs.f32(float) #0 declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } lfortran-lfortran-2f73434/tests/reference/ast-program4-c375e95.stdout0000664000175000017500000001767015141516316025534 0ustar alastairalastair(TranslationUnit [(Program program4 () [] [] [(Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ()) (y [] [] () () None ()) (z [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (Assignment 0 y (Real "2.0") (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "6.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func1 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "7.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "6.0 == " ()) z] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 z (FuncCallOrArray func2 [] [(() x () 0) (() y () 0)] [] [] [] ) () ) (Print 0 () [(String "8.0 == " ()) z] () )] [(Function func1 [(a) (b)] [] c () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrSave )] [(saved [] [] () (Real "2.0") Equal ())] () )] [(Assignment 0 saved (+ saved (Real "1.0")) () ) (Assignment 0 c (+ (+ (+ c a) b) saved) () )] [] [] ) (Function func2 [(a) (b)] [] c () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(saved1 [] [] () (Real "2.0") Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrSave )] [(saved2 [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(d [] [] () () None ())] () )] [(Assignment 0 saved1 (+ saved1 (Real "1.0")) () ) (Assignment 0 c (+ (+ (+ (+ (+ d c) a) b) saved1) saved2) () ) (Assignment 0 saved2 (+ saved2 (Real "1.0")) () ) (Assignment 0 d (+ d (Real "3.0")) () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-loop_unroll_large-c6b628b.stdout0000664000175000017500000001451415141516316027557 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_large: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) loop_unroll_large [] [(Allocate [((Var 2 array) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 35 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-subroutine3-d7c057c.stdout0000664000175000017500000000055715141516316026327 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Assignment 0 f 42 () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_31-1180df5.stdout0000664000175000017500000000130615141516316025562 0ustar alastairalastair-------------------------------------------------------------------------------- value=4096, value(bits)=00000000000000000001000000000000 , trailz= 12 value= 1, value(bits)=00000000000000000000000000000001 , trailz= 0 00000000000000000001000000000000 0001000000000000 1000000000000 1000000000000 -------------------------------------------------------------------------------- value= 112, value(bits)=00000000000000000000000001110000 , trailz= 4 value= 7, value(bits)=00000000000000000000000000000111 , trailz= 0 00000000000000000001000000000000 0001000000000000 1000000000000 1000000000000 lfortran-lfortran-2f73434/tests/reference/llvm-types_01-642cab3.stdout0000664000175000017500000000137215141516316025660 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %r = alloca float, align 4 store float 1.000000e+00, float* %r, align 4 store float 1.500000e+00, float* %r, align 4 store float 1.000000e+00, float* %r, align 4 store float 2.000000e+00, float* %r, align 4 store float 3.000000e+00, float* %r, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_types_01 FINALIZE_SYMTABLE_types_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-common2-1811464.stdout0000664000175000017500000000615015141516316025166 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ()) (e [] [] () () None ()) (g [] [] () () None ()) (h [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration () [(AttrCommon [(block_1 [(a [] [] () a None ()) (b [] [] () b None ()) (h [] [] () h None ())]) (block_2 [(c [] [] () c None ()) (d [] [] () d None ())]) (block_3 [(e [] [] () e None ()) (g [] [] () g None ())])] )] [] () ) (Declaration () [(AttrCommon [(block_4 [(i [] [] () i None ())]) (block_5 [(j [] [] () j None ()) (k [] [] () k None ())])] )] [] () )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-init1-a99a704.stderr0000664000175000017500000000024615141516316024767 0ustar alastairalastairsyntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/init1.f90:2:1 | 2 | integer x = 1 | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-write_12-63d1bdf.stdout0000664000175000017500000000001415141516316025557 0ustar alastairalastairx = 42 PASS lfortran-lfortran-2f73434/tests/reference/llvm-automatic_allocation_02-2a7afc4.json0000664000175000017500000000102215141516316030412 0ustar alastairalastair{ "basename": "llvm-automatic_allocation_02-2a7afc4", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/automatic_allocation_02.f90", "infile_hash": "1646e150432feecdb083d01f8f11d5f17ae691764bb12ada80610c85", "outfile": null, "outfile_hash": null, "stdout": "llvm-automatic_allocation_02-2a7afc4.stdout", "stdout_hash": "83d2b2e16d575abef64d425f402defde82f3b4ce3159d79eb1bd73ac", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f5f31.stdoutlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-optional_02-e4f0000664000175000017500000002745015141516316034426 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { optional_02: (Program (SymbolTable 4 { __libasr_created_dummy_variable_: (Variable 4 __libasr_created_dummy_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), __libasr_created_variable_pointer_: (Variable 4 __libasr_created_variable_pointer_ [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), f1: (ExternalSymbol 4 f1 2 f1 optional_02_m [] f1 Public ), i: (Variable 4 i [] Local () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) optional_02 [optional_02_m] [(Assignment (Var 4 i) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicImpureFunction Allocated [(Var 4 i)] 0 (Logical 4) () ) [(Associate (Var 4 __libasr_created_variable_pointer_) (Var 4 i) )] [(Associate (Var 4 __libasr_created_variable_pointer_) (Var 4 __libasr_created_dummy_variable_) )] ) (Print (StringFormat () [(FunctionCall 4 f1 () [((Var 4 __libasr_created_variable_pointer_)) ((LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 4 i)] 0 (Logical 4) () ) And (LogicalConstant .true. (Logical 4) ) (Logical 4) () ))] (Allocatable (Integer 4) ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), optional_02_m: (Module (SymbolTable 2 { f1: (Function (SymbolTable 3 { __libasr_is_present_x: (Variable 3 __libasr_is_present_x [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] ReturnVar () () Default (Allocatable (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f1 (FunctionType [(Integer 4) (Logical 4)] (Allocatable (Integer 4) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 __libasr_is_present_x)] [(Assignment (Var 3 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 r) Public .false. .false. () ) }) optional_02_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_27-4f64cb2.json0000664000175000017500000000075015141516316025443 0ustar alastairalastair{ "basename": "asr-modules_27-4f64cb2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_27.f90", "infile_hash": "30331196ee4a840d6aaf78770ddd668bf8779203aee238721cc32795", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_27-4f64cb2.stdout", "stdout_hash": "19ad49b4bbfc5e2f60c8a3d13677d95cce6c4e68edfa1203d3ca5feb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-idint_real4-b5321a5.stderr0000664000175000017500000000025015141516316026116 0ustar alastairalastairsemantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/idint_real4.f90:2:14 | 2 | print *, idint(4.5) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json0000664000175000017500000000101415141516316031265 0ustar alastairalastair{ "basename": "pass_global_stmts-global_scope9-4cbbc3e", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope9.f90", "infile_hash": "29e87c62bbe7f9efedd2e3cf348e80153367ecc0369b16de6f4db296", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope9-4cbbc3e.stdout", "stdout_hash": "029dbb5d95b0e1d697351776e3f2887a9b90652713cd5a63d0bd4fd9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine4-22dcb28.json0000664000175000017500000000071715141516316026264 0ustar alastairalastair{ "basename": "julia-subroutine4-22dcb28", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine4.f90", "infile_hash": "06ca8a1c322b25fe9280c43f558f6fa92e1a4843b6f6b77e206fdf4e", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine4-22dcb28.stdout", "stdout_hash": "e7081ba2219e5435a01d4386a3e43a95255b2026714034c3e1ee31c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_class_in_derived_type-15eb7b6.stdout0000664000175000017500000001567615141516316033035 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fortuno_types: (Module (SymbolTable 2 { dict_item: (Struct (SymbolTable 3 { value: (Variable 3 value [] Local () () Default (Allocatable (StructType [] [] .false. .true. ) ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. ), value2: (Variable 3 value2 [] Local () () Default (Allocatable (StructType [] [] .false. .true. ) ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () ) }) dict_item (StructType [(Allocatable (StructType [] [] .false. .true. ) ) (Allocatable (StructType [] [] .false. .true. ) )] [] .true. .false. ) [] [value value2] [] Source Public .false. .false. [] () () ) }) fortuno_types () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-shiftl1-0ff5448.json0000664000175000017500000000071215141516316024761 0ustar alastairalastair{ "basename": "asr-shiftl1-0ff5448", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/shiftl1.f90", "infile_hash": "c0c9708eb1b78ae3123b7f35e798bdaf8cac8feb729db248ae3045cb", "outfile": null, "outfile_hash": null, "stdout": "asr-shiftl1-0ff5448.stdout", "stdout_hash": "9515486eb5f0977f1bc3e8e94e260e2d4fdb3fad54c6baf97dcb08ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_travel_01-cd2b445.json0000664000175000017500000000100015141516316027135 0ustar alastairalastair{ "basename": "asr-template_travel_01-cd2b445", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01.f90", "infile_hash": "49fd555855358466e9af6299db72ebf88c01a40bb93c00fefe71c2c7", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_01-cd2b445.stdout", "stdout_hash": "2e015f1e9871dfa941add950d4720633a2545e5b01ae0bf2ee3b06c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-data_01-dc2d917.stdout0000664000175000017500000001763115141516316025260 0ustar alastairalastair(TranslationUnit [(Program data_01 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ()) (td [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ()) (z [] [] () () None ()) (c1 [(1 4 DimensionExpr)] [] () () None ()) (bf1 [] [] () () None ()) (xx90 [] [] () () None ()) (xx95 [] [] () () None ()) (b [] [] () () None ()) (p [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x td b] [1 4 3] )] () ) (DataStmt 0 [(DataStmtSet [y z] [(Real "2.0") (Real "3.0")] )] () ) (DataStmt 0 [(DataStmtSet [c1] [(Real "0.0") (Real "0.22") (u- (Real "0.14")) (u- (Real "0.21"))] )] () ) (DataStmt 0 [(DataStmtSet [bf1] [(Real "0.8")] ) (DataStmtSet [xx90 xx95] [(Real "0.55") (Real "0.62")] )] () ) (Print 0 () [x y z] () ) (If 0 () (/= x 1) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- y (Real "2.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- z (Real "3.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 1 () 0)] [] [] [] ) (Real "0.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray c1 [] [(() 2 () 0)] [] [] [] ) (Real "0.22")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (+ (FuncCallOrArray c1 [] [(() 4 () 0)] [] [] [] ) (Real "0.21")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- bf1 (Real "0.8")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx90 (Real "0.55")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- xx95 (Real "0.62")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () ) (Assignment 0 p (** b (- td 1)) () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- p (Real "27.0")) () 0)] [] [] [] ) (Real "1e-5")) [(ErrorStop 0 () () () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-preprocessor17-f2d76bb.json0000664000175000017500000000073715141516316026450 0ustar alastairalastair{ "basename": "asr-preprocessor17-f2d76bb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor17.F90", "infile_hash": "a07132d08deb1a0de21dd365371df337fe07652c9d42aa4c0a7e19ab", "outfile": null, "outfile_hash": null, "stdout": "asr-preprocessor17-f2d76bb.stdout", "stdout_hash": "9f77a9fa93093c46ae5e913eb0c3835f60f700966b7dab0427d2af95", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_35-10733ec.json0000664000175000017500000000076115141516316026074 0ustar alastairalastair{ "basename": "asr-intrinsics_35-10733ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_35.f90", "infile_hash": "e79df62a924c1199bf5e17b5ca059ae5ee9598aa94091ab14f6c083b", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_35-10733ec.stdout", "stdout_hash": "1b176f4c36b08d02ab42c578f8909f4d8d94e721e06297d8b7468c3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-floor_02-5b70ee6.json0000664000175000017500000000074215141516316025111 0ustar alastairalastair{ "basename": "asr-floor_02-5b70ee6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/floor_02.f90", "infile_hash": "491234f50f51c45988216c1d0dc82e2493ae2de4b40cf8c85e31ed16", "outfile": null, "outfile_hash": null, "stdout": "asr-floor_02-5b70ee6.stdout", "stdout_hash": "81c0891814243b1eb33279cf595893abca197cef591cfcf5ec0e3bbc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_11-0e4b62c.json0000664000175000017500000000074515141516316025271 0ustar alastairalastair{ "basename": "asr-string_11-0e4b62c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_11.f90", "infile_hash": "eb36fd203a74190c7d98eeff5e136b53c72959fe49b4fed6558763d3", "outfile": null, "outfile_hash": null, "stdout": "asr-string_11-0e4b62c.stdout", "stdout_hash": "879afa55ac4dda5ae2b7d95504dca6855f9acaef45714cfd784bf693", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-real_to_real_cast_fortran_codegen-b969b0f.json0000664000175000017500000000104415141516316033236 0ustar alastairalastair{ "basename": "fortran-real_to_real_cast_fortran_codegen-b969b0f", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_real_cast_fortran_codegen.f90", "infile_hash": "101385afd4eb558d127d1dad0192c160bee2cfc84bb2413cf32f4196", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_real_cast_fortran_codegen-b969b0f.stdout", "stdout_hash": "2eaca20b156b3b2e94e081a2df0601da4e228ad42d663a51a40594ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_02-eff3752.json0000664000175000017500000000071415141516316024343 0ustar alastairalastair{ "basename": "c-case_02-eff3752", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_02.f90", "infile_hash": "76d3020fba89787d565870ed03c1b5e8914d12b062cb9ca7a8c37550", "outfile": null, "outfile_hash": null, "stdout": "c-case_02-eff3752.stdout", "stdout_hash": "0c399d74c1e9da4150b7897617885c26efa6f50b999355381b02d7a5", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.stdoutlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000007634515141516316035024 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_40: (Program (SymbolTable 8 { }) modules_40 [] [(Print (StringConstant "executing modules_40" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_40_tomlf_de_tokenizer: (Module (SymbolTable 2 { parse_select: (Function (SymbolTable 5 { de: (Variable 5 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. ), fill_stack: (Function (SymbolTable 6 { __libasr_created_variable_: (Variable 6 __libasr_created_variable_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), de: (Variable 6 de [] InOut () () Default (StructType [] [] .false. .false. ) 2 toml_tokenizer Source Public Required .false. .true. .false. () .false. .false. ), stack: (Variable 6 stack [] Out () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), top: (Variable 6 top [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fill_stack (FunctionType [(StructType [] [] .false. .false. ) (Integer 4) (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [resize] [(Var 6 de) (Var 6 top) (Var 6 stack)] [(WhileLoop () (LogicalConstant .true. (Logical 4) ) [(If () (IntegerCompare (Var 6 top) GtE (ArraySize (Var 6 stack) () (Integer 4) () ) (Logical 4) () ) [(SubroutineCall 5 resize () [((Var 6 stack)) ((Var 6 __libasr_created_variable_)) ((LogicalConstant .false. (Logical 4) ))] () .false. )] [] )] [] )] () Public .false. .false. () ), resize: (Function (SymbolTable 7 { __libasr_is_present_n: (Variable 7 __libasr_is_present_n [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), stack: (Variable 7 stack [] InOut () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ) }) resize (FunctionType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 stack) (Var 7 n) (Var 7 __libasr_is_present_n)] [] () Public .false. .false. () ) }) parse_select (FunctionType [(StructType [] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 de)] [] () Public .false. .false. () ), tfc: (Variable 2 tfc [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () ), toml_tokenizer: (Struct (SymbolTable 4 { parse_select: (StructMethodDeclaration 4 parse_select () parse_select 2 parse_select Source .false. .false. ) }) toml_tokenizer (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () ) }) modules_40_tomlf_de_tokenizer () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_data-650e309.stdout0000664000175000017500000000231515141516316026652 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(one [] [] () () None ()) (two [] [] () () None ())] () )] [(DataStmt 0 [(DataStmtSet [x] [1] )] () ) (DataStmt 0 [(DataStmtSet [one two] [(Real "1.0") (Real "2.0")] )] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-assign_to1-09e061a.stdout0000664000175000017500000000105315141516316026015 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [] [(If 1000 () (< 0 1) [(Assign 0 15 k () )] [] () () () ) (GoTo 100 k () [] () ) (Print 15 () [(String "run" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/wat-types_01-c4e1000.json0000664000175000017500000000072515141516316025041 0ustar alastairalastair{ "basename": "wat-types_01-c4e1000", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_01.f90", "infile_hash": "1987d8bcc6219e1bf0134a0123e23d9e02a0a8efb6989074d1537f46", "outfile": null, "outfile_hash": null, "stdout": "wat-types_01-c4e1000.stdout", "stdout_hash": "b1ae4419715b7eb8696eff165119c75c2d76d265d7d8bdf6fd9cd5ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-max_01-415ceb0.json0000664000175000017500000000105115141516316024534 0ustar alastairalastair{ "basename": "asr-max_01-415ceb0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/max_01.f90", "infile_hash": "96c2be2ccab6e4a1ed29b0d707ac35303f33d40c3f1fd2aace27dc62", "outfile": null, "outfile_hash": null, "stdout": "asr-max_01-415ceb0.stdout", "stdout_hash": "1a0a9f505c3336eff3ee1d45fe5326407acac8b906704d5f9f138979", "stderr": "asr-max_01-415ceb0.stderr", "stderr_hash": "1f989072f5c997289f323424f4c36e74085a65b04506fffae9cb88fa", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-parameter_01-c88a516.stdout0000664000175000017500000000021115141516316026711 0ustar alastairalastairprogram parameter_01 implicit none integer :: i, j, k parameter(i = 1) parameter(j = 2, k = 3) print *, i, j, k end program parameter_01 lfortran-lfortran-2f73434/tests/reference/llvm-complex_pow_test-2b160e8.stdout0000664000175000017500000000641015141516316027530 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %2 = alloca %complex_4, align 8 %3 = alloca %complex_4, align 8 %4 = alloca %complex_4, align 8 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 %y = alloca %complex_4, align 8 %z = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 store %complex_4 <{ float 3.000000e+00, float 2.000000e+00 }>, %complex_4* %y, align 1 %5 = load %complex_4, %complex_4* %x, align 1 %6 = load %complex_4, %complex_4* %y, align 1 %7 = extractvalue %complex_4 %5, 0 %8 = extractvalue %complex_4 %5, 1 %9 = extractvalue %complex_4 %6, 0 %10 = extractvalue %complex_4 %6, 1 store %complex_4 %5, %complex_4* %4, align 1 store %complex_4 %6, %complex_4* %3, align 1 call void @_lfortran_complex_pow_32(%complex_4* %4, %complex_4* %3, %complex_4* %2) %11 = load %complex_4, %complex_4* %2, align 1 store %complex_4 %11, %complex_4* %z, align 1 %12 = alloca i64, align 8 %13 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %12, i32 0, i32 0, %complex_4* %z) %14 = load i64, i64* %12, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %14, i64* %16, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %13) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_complex_pow_32(%complex_4*, %complex_4*, %complex_4*) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name3-a06a374.json0000664000175000017500000000075415141516316027522 0ustar alastairalastair{ "basename": "lookup_name-lookup_name3-a06a374", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name3.f90", "infile_hash": "7181224f94a1ed635176c4414c3a6f8a8b82712a2f3834d4f9fb74b3", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name3-a06a374.stdout", "stdout_hash": "5ec01df86d0ab3ac57f61290c0bdd5a71dbcbcd60b159b1d7e39664f", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_37-1456cdb.stdoutlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000015273715141516316035024 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_37: (Program (SymbolTable 11 { }) modules_37 [] [(Print (StringConstant "executing modules_37" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_37_fpm_backend: (Module (SymbolTable 2 { build_package_build_target_ptr____0: (Function (SymbolTable 13 { 1_build_target_ptr_ptr: (ExternalSymbol 13 1_build_target_ptr_ptr 6 ptr build_target_ptr [] ptr Public ), __1targets: (Variable 13 __1targets [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), associate_block: (AssociateBlock (SymbolTable 14 { 1_build_target_t_output_dir: (ExternalSymbol 14 1_build_target_t_output_dir 7 output_dir build_target_t [] output_dir Public ), 1_string_t_s: (ExternalSymbol 14 1_string_t_s 5 s string_t [] s Public ), target: (Variable 14 target [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 14 target) (StructInstanceMember (ArrayItem (Var 13 targets) [(() (Var 13 i) ())] (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) ColMajor () ) 9 1_build_target_ptr_ptr (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) ) (Assignment (StructInstanceMember (Var 13 temp) 12 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StructInstanceMember (Var 14 target) 12 1_build_target_t_output_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (Assignment (Var 13 build_dirs) (ArrayConstructor [(Var 13 build_dirs) (Var 13 temp)] (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) ) () ColMajor () ) () .false. .false. )] ), build_dirs: (Variable 13 build_dirs [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 13 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), model: (Variable 13 model [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. ), targets: (Variable 13 targets [__1targets] InOut () () Default (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 13 __1targets))] PointerArray ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. ), temp: (Variable 13 temp [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ), verbose: (Variable 13 verbose [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_package_build_target_ptr____0 (FunctionType [(Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 1 (Integer 4) () ))] PointerArray ) (Integer 4) (StructType [] [] .true. .false. ) (Logical 4)] () Source Implementation "" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 targets) (Var 13 __1targets) (Var 13 model) (Var 13 verbose)] [(Allocate [((Var 13 build_dirs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 13 targets) () (Integer 4) () ) ()) [(AssociateBlockCall 13 associate_block )] [] )] () Public .false. .false. () ), build_target_ptr: (Struct (SymbolTable 6 { ptr: (Variable 6 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () ), build_target_t: (Struct (SymbolTable 7 { output_dir: (Variable 7 output_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_dir] [] Source Public .false. .false. [] () () ), cmd_build: (Function (SymbolTable 10 { 1_fpm_cmd_settings_verbose: (ExternalSymbol 10 1_fpm_cmd_settings_verbose 3 verbose fpm_cmd_settings [] verbose Public ), model: (Variable 10 model [] Local () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. ), settings: (Variable 10 settings [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_build_settings Source Public Required .false. .false. .false. () .false. .false. ), targets: (Variable 10 targets [] Local () () Default (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. ) }) cmd_build (FunctionType [(StructType [] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [build_package_build_target_ptr____0] [(Var 10 settings)] [(SubroutineCall 2 build_package_build_target_ptr____0 2 build_package_build_target_ptr____0 [((ArrayPhysicalCast (Var 10 targets) DescriptorArray PointerArray (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] PointerArray ) ) () )) ((ArraySize (Var 10 targets) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 10 model)) ((StructInstanceMember (Var 10 settings) 10 1_fpm_cmd_settings_verbose (Logical 4) () ))] () .false. )] () Public .false. .false. () ), fpm_build_settings: (Struct (SymbolTable 4 { }) fpm_build_settings (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 fpm_cmd_settings ), fpm_cmd_settings: (Struct (SymbolTable 3 { verbose: (Variable 3 verbose [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_cmd_settings (StructType [(Logical 4)] [] .true. .false. ) [] [verbose] [] Source Public .false. .true. [] () () ), fpm_model_t: (Struct (SymbolTable 8 { }) fpm_model_t (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () ) }) modules_37_fpm_backend () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-format_21-af89e92.json0000664000175000017500000000071515141516316025312 0ustar alastairalastair{ "basename": "run-format_21-af89e92", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_21.f90", "infile_hash": "2904f4fcdadb6f1a06d09e4134a55f9af19894ead3ce04beadb21afb", "outfile": null, "outfile_hash": null, "stdout": "run-format_21-af89e92.stdout", "stdout_hash": "ad2e37f369ec7b73dfd1f6dde8e11a82488123cced26b1699815d60f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_01-3f7a7b3.stdout0000664000175000017500000002045215141516316026010 0ustar alastairalastair(TranslationUnit [(Program program_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(dp [] [] () (FuncCallOrArray kind [] [(() (Real "0.d0") () 0)] [] [] [] ) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Print 0 () [(String "Normal random numbers:" ())] () ) (DoLoop 0 () 0 i 1 10 () [(SubroutineCall 0 rand [] [(() a () 0)] [] [] () ) (Print 0 () [a] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine rand [(x)] [] () (TriviaNode [(EndOfLine) (Comment "! Returns a psuedorandom scalar drawn from the standard normal distribution." ) (Comment "!" ) (Comment "! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for" ) (Comment "! Generating Normal Variables. SIAM Review, 6(3), 260–264." )] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent Out )] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [(SimpleAttribute AttrSave )] [(first [] [] () (Logical .true.) Equal ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(SimpleAttribute AttrSave )] [(u [(1 2 DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [] [(r2 [] [] () () None ())] () )] [(If 0 () first [(DoLoop 0 () 0 () () () () [(SubroutineCall 0 random_number [] [(() u () 0)] [] [] () ) (Assignment 0 u (- (* 2 u) 1) () ) (Assignment 0 r2 (FuncCallOrArray sum [] [(() (** u 2) () 0)] [] [] [] ) () ) (If 0 () (BoolOp (< r2 1) And (> r2 0) ) [(Exit 0 () () )] [] () () () )] () () ) (Assignment 0 u (* u (FuncCallOrArray sqrt [] [(() (/ (* (u- 2) (FuncCallOrArray log [] [(() r2 () 0)] [] [] [] )) r2) () 0)] [] [] [] )) () ) (Assignment 0 x (FuncCallOrArray u [] [(() 1 () 0)] [] [] [] ) () )] [(Assignment 0 x (FuncCallOrArray u [] [(() 2 () 0)] [] [] [] ) () )] () () () ) (Assignment 0 first (not first) () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_37-20d0238.json0000664000175000017500000000071515141516316025134 0ustar alastairalastair{ "basename": "run-format_37-20d0238", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_37.f90", "infile_hash": "94b93a59d013f07a2eed519c774d916f389d9b7ab823c410a833ddbf", "outfile": null, "outfile_hash": null, "stdout": "run-format_37-20d0238.stdout", "stdout_hash": "ceb6a77e9bb873f743a8f47294998c0fdd8fbb2287e40ff66386f162", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_5-f25edd8.stderr0000664000175000017500000000024215141516316026450 0ustar alastairalastairsyntax error: Token 'abcdef' (of type 'identifier') is unexpected here --> tests/errors/fixed_form_5.f:3:12 | 3 | y = 5abcdef + 3 | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/tokens-boz1-719113d.json0000664000175000017500000000071215141516316024711 0ustar alastairalastair{ "basename": "tokens-boz1-719113d", "cmd": "lfortran --no-color --show-tokens {infile} -o {outfile}", "infile": "tests/boz1.f90", "infile_hash": "5bb9dc97e57fb92acadcdcfd70ffe99dfcfd6d1be490f4c6766a2543", "outfile": null, "outfile_hash": null, "stdout": "tokens-boz1-719113d.stdout", "stdout_hash": "963956fa5618ed087ff96ab6c55004d1eeba847628743783a5c8898b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-types_04-92449d7.json0000664000175000017500000000074515141516316025177 0ustar alastairalastair{ "basename": "llvm-types_04-92449d7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_04.f90", "infile_hash": "da21466af87608d5d323360a130e0a5542261d98fabaeebb5adc16d3", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_04-92449d7.stdout", "stdout_hash": "cf26fda90ffb2dd5aedf88cf74d289d9a97d66da369f0c7e480f6af9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_subroutine-2711676.stdout0000664000175000017500000000361315141516316030064 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a) (b) (c)] [] () () [] [] [] [] [(Print 0 () [4] () )] [] [] ) (Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ()) (l [] [] () () None ())] () )] [(Assignment 0 k 100 () ) (DoLoop 0 () 80 k 1 10 () [(Print 0 () [k] () ) (Continue 80 () )] () () ) (If 0 () (<= k 10000) [(Print 0 () [k] () )] [(Print 0 () [(+ k 1)] () ) (DoLoop 0 () 0 l 1 10 () [(Print 0 () [(String "do" ())] () )] () () )] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-types_13-76138b5.json0000664000175000017500000000106115141516316024775 0ustar alastairalastair{ "basename": "ast-types_13-76138b5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_13.f90", "infile_hash": "0386b3b949293ae071687d72cec51980cbdce80908080fa69e19a807", "outfile": null, "outfile_hash": null, "stdout": "ast-types_13-76138b5.stdout", "stdout_hash": "f39de7cbaea94bff362cd2cad976e8c04c930150c7a0b8049ca5fd87", "stderr": "ast-types_13-76138b5.stderr", "stderr_hash": "44623a78eb46ca78c3622e964b0d57198c877bd80dad64fca178c250", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-select_type_13-f465d8c.json0000664000175000017500000000076715141516316026514 0ustar alastairalastair{ "basename": "llvm-select_type_13-f465d8c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/select_type_13.f90", "infile_hash": "8413deaa6aa9c492fa66fded9921b523764270cbc670d08a3a3c6ab0", "outfile": null, "outfile_hash": null, "stdout": "llvm-select_type_13-f465d8c.stdout", "stdout_hash": "1fc5699883637d67c7cc493d103aecda0ab95486e3a6b4eada180cf8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-empty-681c1d1.json0000664000175000017500000000066715141516316024553 0ustar alastairalastair{ "basename": "wat-empty-681c1d1", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/empty.f90", "infile_hash": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", "outfile": null, "outfile_hash": null, "stdout": "wat-empty-681c1d1.stdout", "stdout_hash": "0ca4269517c69a129d718045702784b3fb3462d6f70b3e15e0a1ce75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-selectrank1-5d08637.json0000664000175000017500000000072615141516316025552 0ustar alastairalastair{ "basename": "ast-selectrank1-5d08637", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/selectrank1.f90", "infile_hash": "7bd5ab94da79a773b306a0b17ac6754bf7d5bb9dc2df46631d00593c", "outfile": null, "outfile_hash": null, "stdout": "ast-selectrank1-5d08637.stdout", "stdout_hash": "0f653c82bd65995c75cb2be0a4de50116b04e3e7666d21709e1816e1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_07-3e4ee40.json0000664000175000017500000000100115141516316030221 0ustar alastairalastair{ "basename": "ast-program_without_line_07-3e4ee40", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_07.f90", "infile_hash": "308bb5317a98bf3331bb13ff5e833a995f95bd6e2ebf622ee1406299", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_07-3e4ee40.stdout", "stdout_hash": "7618d8207246aa9ade0eb2f57f4763e1edc8f6c6534ec3fb149b963d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-double_complex1-2f3d83c.json0000664000175000017500000000077015141516316026553 0ustar alastairalastair{ "basename": "ast-double_complex1-2f3d83c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/double_complex1.f", "infile_hash": "67c79648ea8350e391b185e24698b65c09cdc201a298e72e7e59f992", "outfile": null, "outfile_hash": null, "stdout": "ast-double_complex1-2f3d83c.stdout", "stdout_hash": "7995ee30697dbb88bbc5b6b7f59a4a9c1606b126decbdcffe625af4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-print3-5f4fc26.stdout0000664000175000017500000001524015141516316025260 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_03: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_03 [] [(Assignment (Var 2 x) (IntegerConstant 24 (Integer 4) Decimal) () .false. .false. ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () ) (Print (StringFormat () [(StringConstant "x is " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () ) (FileWrite 0 () () () () [(StringFormat () [(StringConstant "x is " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () ) (Print (StringConstant "ok" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (FileWrite 0 () () () () [(StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () ) (FileWrite 0 () () () () [(StringConstant "ok" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) )] () () () .true. () () )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-ifix_01-ed76fb2.stderr0000664000175000017500000000024715141516316025342 0ustar alastairalastairsemantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/ifix_01.f90:2:14 | 2 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-nested_06-fa1a99f.json0000664000175000017500000000075015141516316025525 0ustar alastairalastair{ "basename": "llvm-nested_06-fa1a99f", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_06.f90", "infile_hash": "b94500b7f8becc154e61ec7d99e50e8c4cbbd4c0ca20bb262a670562", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_06-fa1a99f.stdout", "stdout_hash": "5e0c443c9d06ee6fc248f759cf5196ab1768a28100e764ef16061cc1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-test_backspace_01-cd469a1.stdout0000664000175000017500000002053015141516316027306 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_backspace_01: (Program (SymbolTable 2 { line: (Variable 2 line [] Local () () Default (String 1 (IntegerConstant 80 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_backspace_01 [] [(FileOpen 0 (IntegerConstant 10 (Integer 4) Decimal) (StringConstant "file_01_data.txt" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "old" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () (StringConstant "read" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () ) (FileRead 0 (Var 2 u) (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () [(Var 2 line)] () .true. () () ) (FileWrite 0 () () () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (FileBackspace 0 (Var 2 u) () () ) (FileRead 0 (Var 2 u) (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () () () () () () [(Var 2 line)] () .true. () () ) (FileWrite 0 () () () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StringConstant "Read and printed the same line again:" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (FileWrite 0 () () () () [(StringFormat (StringConstant "(A)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 line)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (If () (StringCompare (Var 2 line) NotEq (StringConstant "10130" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (FileClose 0 (Var 2 u) () () () () )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_08-9988b1f.json0000664000175000017500000000076115141516316026121 0ustar alastairalastair{ "basename": "asr-intrinsics_08-9988b1f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_08.f90", "infile_hash": "c9428b7dfa89eea7b77764819c3adcba62cbdf38d804597568fd0fad", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_08-9988b1f.stdout", "stdout_hash": "6537d129f4b8e8f2c32e6683dc039767672c5e69034cabdc01c401d0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-arrays_03_func-3a62608.stdout0000664000175000017500000000303115141516316026501 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32_10_1 { Kokkos::View* data; dimension_descriptor dims[1]; bool is_allocated; i32_10_1(Kokkos::View* data_): data{data_} {}; }; // Forward declarations namespace { template int32_t mysum(T0* a); } // Implementations namespace { template int32_t mysum(T0* a) { int32_t i; int32_t r; r = 0; for (i=1; i<=a->data->extent(0); i++) { r = r + a->data->operator[](i - a->dims[0].lower_bound); } return r; } void main2() { int32_t i; int32_t s; Kokkos::View x_data("x_data", 10); i32_10_1 x_value(&x_data); i32_10_1* x = &x_value; x->dims[0].lower_bound = 1; x->dims[0].length = 10; for (i=1; i<=x->data->extent(0); i++) { x->data->operator[](i - x->dims[0].lower_bound) = i; } s = mysum(x); std::cout << s << std::endl; if (s != 55) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-parameter_04-553ff5b.json0000664000175000017500000000075615141516316025761 0ustar alastairalastair{ "basename": "asr-parameter_04-553ff5b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/parameter_04.f90", "infile_hash": "f2aa1dc4b8d444f21facebf1ba278ce095935a979f72f56f29c08223", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter_04-553ff5b.stdout", "stdout_hash": "2c4c1519b6c8559f01bfd72555e50042aba75a3bbe14b4f7c7a68a3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-bits_02-925bde2.json0000664000175000017500000000074215141516316025115 0ustar alastairalastair{ "basename": "llvm-bits_02-925bde2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_02.f90", "infile_hash": "326043189040d63a64dac0f62cb9504336196a58ad139ffe70eeb884", "outfile": null, "outfile_hash": null, "stdout": "llvm-bits_02-925bde2.stdout", "stdout_hash": "ccfe828bc9c2df79e3981bcb27a3b9a41de171fd42710231fa6d1194", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_09-aca4085.stdout0000664000175000017500000001451215141516316026007 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_09: (Program (SymbolTable 2 { i: (Variable 2 i [] Local (IntegerConstant 42 (Integer 4) Decimal) (IntegerConstant 42 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z1: (Variable 2 z1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), z2: (Variable 2 z2 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex_09 [] [(Assignment (Var 2 z1) (IntrinsicElementalFunction Cmplx [(Var 2 i) (Var 2 x) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z1) (IntrinsicElementalFunction Cmplx [(Var 2 x) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z2) (Cast (IntrinsicElementalFunction Cmplx [(Var 2 z2) (RealConstant 0.000000 (Real 4) ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Complex 8) () ) ComplexToComplex (Complex 4) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-fma-8bc0756.stdout0000664000175000017500000005606315141516316024533 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fma: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 2 s1 [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 2 s2 [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.000000 (Real 8) ) ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) fma [] [(Assignment (Var 2 x) (RealBinOp (RealBinOp (RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) () ) Add (RealBinOp (RealConstant 0.500000 (Real 4) ) Mul (IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 x)] 0 (Real 4) () ) (Real 4) () ) (Real 4) () ) Sub (RealBinOp (Var 2 x) Mul (Var 2 pi) (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (Var 2 z) (RealBinOp (Var 2 s1) Add (RealBinOp (Var 2 z) Mul (Var 2 s2) (Real 8) () ) (Real 8) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.940000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 z) Sub (Cast (RealConstant 3.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 3.000000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntrinsicElementalFunction Nint [(IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (RealBinOp (Var 2 r) Add (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) (Real 4) () )] 0 (Real 4) () )] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Cast (RealBinOp (Var 2 r) Sub (RealBinOp (Var 2 r) Mul (Var 2 r) (Real 4) () ) (Real 4) () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-parameter_02-15e1701.json0000664000175000017500000000077115141516316026260 0ustar alastairalastair{ "basename": "ast_f90-parameter_02-15e1701", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/parameter_02.f90", "infile_hash": "09e4b92d73bf1ea50001dc2926c14f213a0c8eda2c2e399f78df895e", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-parameter_02-15e1701.stdout", "stdout_hash": "6bdc06efa3421a6ae06c297a90810eb3d2ad2a9a25ac05eec9bdd6a1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_13-ae4df53.json0000664000175000017500000000074515141516316025361 0ustar alastairalastair{ "basename": "asr-string_13-ae4df53", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/string_13.f90", "infile_hash": "25354bac77715f94447d94e23c5c51c4ece9145b600155f8a5cb4c9f", "outfile": null, "outfile_hash": null, "stdout": "asr-string_13-ae4df53.stdout", "stdout_hash": "8d34a1e0e667a753bc79a5af8dc4a4fab1f45209ab562c14b7fb74ba", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-real_to_complex_cast_in_comparison-655651c.json0000664000175000017500000000104715141516316033323 0ustar alastairalastair{ "basename": "fortran-real_to_complex_cast_in_comparison-655651c", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/real_to_complex_cast_in_comparison.f90", "infile_hash": "b24f703e12ad69de41d2e7963f95416d6e78e2a032b22b228316972c", "outfile": null, "outfile_hash": null, "stdout": "fortran-real_to_complex_cast_in_comparison-655651c.stdout", "stdout_hash": "95851562b3383350ea1f5434caa777076a734e6d5189e91589408588", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-global_scope1-b0a630a.json0000664000175000017500000000073715141516316026351 0ustar alastairalastair{ "basename": "llvm-global_scope1-b0a630a", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope1.f90", "infile_hash": "449b38487b6c79754deedb9991f1867bcf8c67d0d93019c2fe15854c", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope1-b0a630a.stdout", "stdout_hash": "008af44efaac8baa6178920ec2730470d4fc144e4364568bd9dd70c7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-callback_03-0f44942.json0000664000175000017500000000075615141516316025556 0ustar alastairalastair{ "basename": "llvm-callback_03-0f44942", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_03.f90", "infile_hash": "ed8de8dc63a13125cc459d17776eb179835cd6860aa332449493c9e8", "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_03-0f44942.stdout", "stdout_hash": "071f49784261151fdd37c0b0cecce90b6071d0adc44919c45870627b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_allocate_for_array-b52ea30.stderr0000664000175000017500000000041115141516316031676 0ustar alastairalastairsemantic error: Allocate for arrays should have dimensions specified, found only array variable with no dimensions --> tests/errors/incorrect_allocate_for_array.f90:3:14 | 3 | allocate(a) | ^ Array specification required in allocate statement lfortran-lfortran-2f73434/tests/reference/ast-use1-56851d0.json0000664000175000017500000000072715141516316024210 0ustar alastairalastair{ "basename": "ast-use1-56851d0", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/use1.f", "infile_hash": "52745ad3598973f5e65c2a8cb8829e843ff54d4b7d398bd6d4734367", "outfile": null, "outfile_hash": null, "stdout": "ast-use1-56851d0.stdout", "stdout_hash": "1667ab83da97e35ba5b86366b130421d81be2d719440f6057a4e159c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do2-1ec601e.json0000664000175000017500000000101015141516316024131 0ustar alastairalastair{ "basename": "ast-do2-1ec601e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do2.f90", "infile_hash": "7f47b6b127565d836c9d83019e001f2160489c3d1243f1de7e93af71", "outfile": null, "outfile_hash": null, "stdout": "ast-do2-1ec601e.stdout", "stdout_hash": "0ab41435499b9bf55305b0895a7d74b7c79771cd7279d2868fdef093", "stderr": "ast-do2-1ec601e.stderr", "stderr_hash": "058e62ed95ffbe797f06eaf8d52e4ae850f39e6e94112c2895a35bdf", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program4-ba26fd1.stderr0000664000175000017500000000040215141516316025615 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/wat-logical1-ef567ea.stdout0000664000175000017500000001271315141516316025627 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 1 local.set 0 i32.const 0 local.set 1 local.get 0 i64.extend_i32_s call 3 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/ast_f90-arrayelements1-55b6bd6.json0000664000175000017500000000075215141516316027104 0ustar alastairalastair{ "basename": "ast_f90-arrayelements1-55b6bd6", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/arrayelements1.f90", "infile_hash": "aee653e314f2bace5cb65c7ffd4c015a8ca517a00eeab179a2d74a15", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrayelements1-55b6bd6.stdout", "stdout_hash": "b11a0ebd3f59a28ec286b85430edf68c667644e9e5b9e04848d598c4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_1-04b6d40.stderr0000664000175000017500000013410115141516316030366 0ustar alastairalastairsemantic error: Derived type `another_undefined_type` is not defined --> tests/errors/continue_compilation_1.f90:50:9 | 50 | type(another_undefined_type) :: s3_in_subroutine | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type used here is not defined in any scope semantic error: c_char should have a length of 1 --> tests/errors/continue_compilation_1.f90:74:9 | 74 | character(len=2, kind=c_char), intent(in) :: c | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'c' not defined --> tests/errors/continue_compilation_1.f90:72:5 - 75:20 | 72 | subroutine s(c) bind(c) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 75 | end subroutine s | ...^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-size '*' is only permitted in the last dimension --> tests/errors/continue_compilation_1.f90:88:31 | 88 | real, intent(in) :: a(*, 10) | ^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_1.f90:87:5 - 89:18 | 87 | subroutine assumed_size_star_pos_1(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 89 | end subroutine | ...^^^^^^^^^^^^^^^^^^ semantic error: Assumed-size '*' is only permitted in the last dimension --> tests/errors/continue_compilation_1.f90:92:19 | 92 | real :: a(*, 10) | ^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_1.f90:91:5 - 93:18 | 91 | subroutine assumed_size_star_pos_2(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 93 | end subroutine | ...^^^^^^^^^^^^^^^^^^ semantic error: Defined assignment procedure must not return a value --> tests/errors/continue_compilation_1.f90:112:5 - 116:32 | 112 | integer function assign_func_bad(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 116 | end function assign_func_bad | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Defined assignment procedure must have exactly two arguments --> tests/errors/continue_compilation_1.f90:118:5 - 120:37 | 118 | subroutine assign_wrong_nargs(lhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 120 | end subroutine assign_wrong_nargs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: First argument of defined assignment must have INTENT(OUT) or INTENT(INOUT) --> tests/errors/continue_compilation_1.f90:122:5 - 125:33 | 122 | subroutine assign_bad_lhs(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 125 | end subroutine assign_bad_lhs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Second argument of defined assignment must have INTENT(IN) --> tests/errors/continue_compilation_1.f90:127:5 - 130:33 | 127 | subroutine assign_bad_rhs(lhs, rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 130 | end subroutine assign_bad_rhs | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Interface 'f_missing' is referenced but not defined --> tests/errors/continue_compilation_1.f90:22:9 | 22 | procedure(f_missing), pointer, nopass :: fn => null() | ^^^^^^^^^^^^^^^^^^^^ Referenced here semantic error: Interface 'missing_global_interface' is referenced but not defined --> tests/errors/continue_compilation_1.f90:25:5 | 25 | procedure(missing_global_interface), pointer :: p => null() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Referenced here semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/continue_compilation_1.f90:181:5 - 183:49 | 181 | implicit integer(a-f), real(e-z) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 183 | ! Put declarations below without empty lines | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `repeat` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:204:38 | 204 | character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot convert LOGICAL to REAL --> tests/errors/continue_compilation_1.f90:207:20 | 207 | real :: adwf = .true. | ^^^^^^ semantic error: Symbol is already declared in the same scope --> tests/errors/continue_compilation_1.f90:211:31 | 211 | integer , dimension(3) :: array | ^^^^^ redeclaration | 210 | double precision array | ~~~~~ original declaration semantic error: Array members must me of the same type as the struct --> tests/errors/continue_compilation_1.f90:215:53 | 215 | type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] | ^ semantic error: Initialization of `myclass_array2` must reduce to a compile time constant. --> tests/errors/continue_compilation_1.f90:216:66 | 216 | type(MyClass), parameter :: myclass_array2(2) = [MyClass(1), MyClass(q1)] | ^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: only 'len' and 'kind' are allowed as type parameters --> tests/errors/continue_compilation_1.f90:217:5 | 217 | character(width=10) :: str_c_1 | ^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: can't use a keyword argument more than once --> tests/errors/continue_compilation_1.f90:218:5 | 218 | character(len=10, len=20) :: str_c_2 | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: positional type parameters cannot follow a keyword argument --> tests/errors/continue_compilation_1.f90:219:5 | 219 | character(len=10, 1) :: str_c_3 | ^^^^^^^^^^^^^^^^^^^^ semantic error: Syntax error in CHARACTER declaration: using only 'len' keyword argument after a positional type is invalid --> tests/errors/continue_compilation_1.f90:220:5 | 220 | character(1, len=20) :: str_c_4 | ^^^^^^^^^^^^^^^^^^^^ semantic error: Allocatable array 'x' must have a deferred shape or assumed rank --> tests/errors/continue_compilation_1.f90:221:34 | 221 | character(:), allocatable :: x(2) | ^^^^ semantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/continue_compilation_1.f90:223:26 | 223 | logical :: mask_size(size(arr_size)) | ^^^^^^^^^^^^^^ semantic error: `protected` attribute is only allowed in specification part of a module --> tests/errors/continue_compilation_1.f90:224:5 | 224 | integer, protected :: protected_attr_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `protected` attribute is only allowed in specification part of a module --> tests/errors/continue_compilation_1.f90:225:5 | 225 | integer, parameter, protected :: protected_parameter_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable `n` cannot appear in the expression as it is not a constant --> tests/errors/continue_compilation_1.f90:230:27 | 230 | integer :: elements(n) | ^ semantic error: Derived type `bspline_3d` is not defined --> tests/errors/continue_compilation_1.f90:232:5 | 232 | type(bspline_3d) :: s3_in_program | ^^^^^^^^^^^^^^^^ Type used here is not defined in any scope semantic error: BOZ literal constant cannot be used in binary operations --> tests/errors/continue_compilation_1.f90:234:19 | 234 | integer::tt = b'01' * 3 | ^^^^^^^^^ semantic error: An 'allocatable' variable cannot have an initialization expression --> tests/errors/continue_compilation_1.f90:236:29 | 236 | integer, allocatable :: allocate_int = 1 | ^^^^^^^^^^^^^^^^ semantic error: An 'allocatable' variable cannot have an initialization expression --> tests/errors/continue_compilation_1.f90:237:34 | 237 | character(:), allocatable :: allocate_char = "H" | ^^^^^^^^^^^^^^^^^^^ semantic error: Transformational intrinsic is not permitted in an initialization expression --> tests/errors/continue_compilation_1.f90:241:42 | 241 | integer, parameter :: param_minloc = minloc(param_arr, 1, [.false., .false., .false.]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable `uninitialized_param_local` with parameter attribute is not initialised --> tests/errors/continue_compilation_1.f90:249:5 | 249 | type(MyClass), parameter :: uninitialized_param_local | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Symbol not found: `non_existent_symbol` --> tests/errors/continue_compilation_1.f90:250:5 | 250 | type(MyClass) :: err_obj1 = non_existent_symbol | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Named initialization not supported with: my_func --> tests/errors/continue_compilation_1.f90:251:5 | 251 | type(MyClass) :: err_obj2 = my_func | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Initialization with non-constant variable `non_parameter_var` is not allowed --> tests/errors/continue_compilation_1.f90:253:5 | 253 | type(MyClass) :: err_obj3 = non_parameter_var | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 252 | integer :: non_parameter_var = 5 | ~~~~~~~~~~~~~~~~~~~~~ declared here semantic error: Named initialization with array parameter `myclass_array` is not supported yet --> tests/errors/continue_compilation_1.f90:254:5 | 254 | type(MyClass) :: err_obj4 = myclass_array | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 215 | type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ array parameter declared here semantic error: Symbol not found: `uninitialized_param_local` --> tests/errors/continue_compilation_1.f90:255:5 | 255 | type(MyClass) :: err_obj5 = uninitialized_param_local | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_1.f90:565:14 | 565 | integer, intent(out) :: out_intent | ^^^^^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_1.f90:566:14 | 566 | integer, intent(in) :: in_intent | ^^^^^^^^^^ semantic error: The upper bound of an assumed-size array's last dimension is not defined --> tests/errors/continue_compilation_1.f90:82:18 | 82 | print *, ubound(a, 1) | ^^^^^^^^^^^^ semantic error: The DIM argument must be present when calling UBOUND on an assumed-size array --> tests/errors/continue_compilation_1.f90:83:18 | 83 | print *, ubound(b) | ^^^^^^^^^ semantic error: The upper bound of an assumed-size array's last dimension is not defined --> tests/errors/continue_compilation_1.f90:84:18 | 84 | print *, ubound(c, 2) | ^^^^^^^^^^^^ semantic error: Character intrinsic 'trim' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:106:18 | 106 | print *, trim(generic) | ^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'adjustl' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:107:18 | 107 | print *, adjustl(generic) | ^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'adjustr' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:108:18 | 108 | print *, adjustr(generic) | ^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Character intrinsic 'len_trim' with class(*) argument must be inside 'type is (character(len=*))' guard --> tests/errors/continue_compilation_1.f90:109:18 | 109 | print *, len_trim(generic) | ^^^^^^^^^^^^^^^^^ invalid use of character intrinsic with polymorphic argument semantic error: Intrinsic 'not_real' is not recognized --> tests/errors/continue_compilation_1.f90:239:14 | 239 | call sub(not_real) | ^^^^^^^^ 'not_real' is not a known intrinsic function semantic error: Array index 10 is out of bounds (1 to 3) in dimension 1 --> tests/errors/continue_compilation_1.f90:279:14 | 279 | print *, a(10) | ^^^^^ semantic error: Assignment to loop variable `i` is not allowed --> tests/errors/continue_compilation_1.f90:286:8 | 286 | i = i + 1 | ^ semantic error: first argument of `maskl` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/continue_compilation_1.f90:290:13 | 290 | print*, maskl(63) | ^^^^^^^^^ semantic error: first argument of `maskr` must be less than or equal to the BIT_SIZE of INTEGER(KIND=4) --> tests/errors/continue_compilation_1.f90:292:13 | 292 | print*, maskr(63) | ^^^^^^^^^ semantic error: first argument of `maskl` must be nonnegative --> tests/errors/continue_compilation_1.f90:294:13 | 294 | print*, maskl(-24) | ^^^^^^^^^^ semantic error: first argument of `maskr` must be nonnegative --> tests/errors/continue_compilation_1.f90:296:13 | 296 | print*, maskr(-24) | ^^^^^^^^^^ semantic error: The argument `matrix_a` in `matmul` must be of type Integer, Real, Complex or Logical --> tests/errors/continue_compilation_1.f90:298:21 | 298 | print *, matmul(a1, b1) | ^^ semantic error: The argument `matrix_b` in `matmul` must be of type Integer, Real or Complex if first matrix is of numeric type --> tests/errors/continue_compilation_1.f90:300:25 | 300 | print *, matmul(b1, a1) | ^^ semantic error: The `matmul` intrinsic doesn't handle logical type yet --> tests/errors/continue_compilation_1.f90:302:14 | 302 | print *, matmul(a2, b1) | ^^^^^^^^^^^^^^ semantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 3 --> tests/errors/continue_compilation_1.f90:304:21 | 304 | print *, matmul(a3, b1) | ^^ semantic error: `matmul` accepts arrays of rank 1 or 2 only, provided an array with rank, 4 --> tests/errors/continue_compilation_1.f90:306:25 | 306 | print *, matmul(b1, b4) | ^^ semantic error: The argument `matrix_b` in `matmul` must be of rank 2, provided an array with rank, 1 --> tests/errors/continue_compilation_1.f90:308:24 | 308 | print *, matmul(a, b) | ^ semantic error: `transpose` accepts arrays of rank 2 only, provided an array with rank, 1 --> tests/errors/continue_compilation_1.f90:310:24 | 310 | print *, transpose(a) | ^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_1.f90:312:14 | 312 | print *, merge_bits(8, 12_8, 2) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Mergebits must be the same --> tests/errors/continue_compilation_1.f90:314:14 | 314 | print *, merge_bits(a5, b5, c5) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Second argument of modulo cannot be 0 --> tests/errors/continue_compilation_1.f90:330:14 | 330 | print *, modulo(1, 0) | ^^^^^^^^^^^^ semantic error: Procedure 'my_func' accepts 2 arguments, but 3 were provided --> tests/errors/continue_compilation_1.f90:332:5 | 332 | call my_func(y=1, x=2, z=1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments to 'my_func' semantic error: Result of `nint` overflows its kind(4) --> tests/errors/continue_compilation_1.f90:335:13 | 335 | print*, nint(1e12_8) | ^^^^^^^^^^^^ semantic error: Result of `nint` overflows its kind(4) --> tests/errors/continue_compilation_1.f90:336:13 | 336 | print*, nint(1000000000000.0000000000000000d0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid argument `hello` supplied --> tests/errors/continue_compilation_1.f90:338:5 | 338 | OPEN(file="numbers", hello="world") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_1.f90:340:5 | 340 | i1 = 3 | ^^^^^^ assignment here | 190 | integer, parameter :: i1 = 2 | ~~~~~~ declared as constant semantic error: Expected 0 or 1 arguments, got 2 arguments instead. --> tests/errors/continue_compilation_1.f90:342:5 | 342 | call FLUSH(1, 2) | ^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `verify` intrinsic must be a scalar --> tests/errors/continue_compilation_1.f90:344:39 | 344 | print*, verify(string, set, kind= [4, 4] ) | ^^^^^^ semantic error: arguments of `and` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:345:14 | 345 | print *, and([1, 2, 3], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The shift argument of 'dshiftl' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:347:28 | 347 | print *, dshiftl(1, 2, 34) | ^^ semantic error: The shift argument of 'dshiftl' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:348:28 | 348 | print *, dshiftl(1, 2, -2) | ^^ semantic error: The shift argument of 'dshiftr' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:350:28 | 350 | print *, dshiftr(1, 2, 34) | ^^ semantic error: The shift argument of 'dshiftr' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:351:28 | 351 | print *, dshiftr(1, 2, -2) | ^^ semantic error: arguments of `selected_int_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:353:14 | 353 | print *, selected_int_kind([1,2,3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `selected_real_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:354:14 | 354 | print *, selected_real_kind([1,2,3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: arguments of `selected_char_kind` intrinsic must be scalar --> tests/errors/continue_compilation_1.f90:355:14 | 355 | print *, selected_char_kind(['c', 'a', 'b']) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:364:30 | 364 | print *, sum(arr1, dim = 2) | ^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:365:30 | 365 | print *, sum(arr1, dim = -1) | ^^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:366:44 | 366 | print *, sum(arr1, mask = mask1, dim = 2) | ^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Sum` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:367:44 | 367 | print *, sum(arr1, mask = mask1, dim = -1) | ^^ Must have 0 < dim <= 1 for array of rank 1 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:369:34 | 369 | print *, product(arr2, dim = 3) | ^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:370:34 | 370 | print *, product(arr2, dim = -1) | ^^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:371:48 | 371 | print *, product(arr2, mask = mask2, dim = 3) | ^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Product` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:372:48 | 372 | print *, product(arr2, mask = mask2, dim = -1) | ^^ Must have 0 < dim <= 2 for array of rank 2 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:374:34 | 374 | print *, iparity(arr3, dim = 4) | ^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:375:34 | 375 | print *, iparity(arr3, dim = -1) | ^^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:376:48 | 376 | print *, iparity(arr3, mask = mask3, dim = 4) | ^ Must have 0 < dim <= 3 for array of rank 3 semantic error: `dim` argument of the `Iparity` intrinsic is out of bounds --> tests/errors/continue_compilation_1.f90:377:48 | 377 | print *, iparity(arr3, mask = mask3, dim = -1) | ^^ Must have 0 < dim <= 3 for array of rank 3 semantic error: Expected logical expression in if statement, but recieved integer(4) instead --> tests/errors/continue_compilation_1.f90:379:9 | 379 | if (q1) q1 = 1 | ^^ integer(4) expression, expected logical semantic error: Expected logical expression in if statement, but recieved real(4) instead --> tests/errors/continue_compilation_1.f90:380:9 | 380 | if (r1) r1 = 1.0 | ^^ real(4) expression, expected logical semantic error: Expected logical expression in if statement, but recieved string instead --> tests/errors/continue_compilation_1.f90:381:9 | 381 | if (c1) c1 = 'a' | ^^ string expression, expected logical semantic error: The ranks of the `array` and `mask` arguments of the `Sum` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:386:18 | 386 | print *, sum(arr1, mask2) | ^^^^ ^^^^^ `array` is rank 1, but `mask` is rank 2 semantic error: The ranks of the `array` and `mask` arguments of the `Sum` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:387:18 | 387 | print *, sum(arr2, mask3, 2) | ^^^^ ^^^^^ `array` is rank 2, but `mask` is rank 3 semantic error: The shapes of the `array` and `mask` arguments of the `Iparity` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:388:22 | 388 | print *, iparity(arr2, mask4) | ^^^^ ^^^^^ `array` has shape [2,3], but `mask` has shape [3,2] semantic error: The shapes of the `array` and `mask` arguments of the `Iparity` intrinsic must be the same --> tests/errors/continue_compilation_1.f90:389:22 | 389 | print *, iparity(arr3, mask5, 3) | ^^^^ ^^^^^ `array` has shape [2,1,3], but `mask` has shape [2,3,1] semantic error: Argument to 'present' must be a variable, but got an expression --> tests/errors/continue_compilation_1.f90:392:22 | 392 | print *, present(a + 1) | ^^^^^ Expected a variable here semantic error: Argument to 'present' must be an optional dummy argument --> tests/errors/continue_compilation_1.f90:395:22 | 395 | print *, present(a) | ^ This variable is not 'optional' semantic error: Different shape for arguments `array` and `mask` for pack intrinsic (3 and 4) --> tests/errors/continue_compilation_1.f90:397:30 | 397 | print *, pack([1, 2, 3], [.true., .true., .true., .true.]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: reshape accepts arrays for `source` argument, found string instead. --> tests/errors/continue_compilation_1.f90:399:22 | 399 | print *, reshape("hello", [2, 3]) | ^^^^^^^ semantic error: reshape accepts arrays for `source` argument, found logical instead. --> tests/errors/continue_compilation_1.f90:400:22 | 400 | print *, reshape(.true., [2, 3]) | ^^^^^^ semantic error: reshape accepts arrays for `shape` argument, found string instead. --> tests/errors/continue_compilation_1.f90:401:36 | 401 | print *, reshape([1, 2, 3, 4], "hello") | ^^^^^^^ semantic error: reshape accepts arrays for `shape` argument, found logical instead. --> tests/errors/continue_compilation_1.f90:402:36 | 402 | print *, reshape([1, 2, 3, 4], .false.) | ^^^^^^^ semantic error: reshape accepts `source` array with size greater than or equal to size specified by `shape` array --> tests/errors/continue_compilation_1.f90:404:14 | 404 | print *, reshape([1, 2, 3, 4], [2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `shape` specifies size of 6 which exceeds the `source` array size of 4 semantic error: Division by zero --> tests/errors/continue_compilation_1.f90:407:14 | 407 | print *, 1/0 | ^^^ semantic error: Division by zero --> tests/errors/continue_compilation_1.f90:408:14 | 408 | print *, x/zero | ^^^^^^ semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_1.f90:409:14 | 409 | print *, v**str | ^ ^^^ type mismatch (real and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_1.f90:410:14 | 410 | print *, str**v | ^^^ ^ type mismatch (string and real) semantic error: The shift argument of 'shiftl' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:412:24 | 412 | print *, shiftl(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'shiftl' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:413:24 | 413 | print *, shiftl(2, -3) | ^^ semantic error: The shift argument of 'shiftr' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:414:24 | 414 | print *, shiftr(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'shiftr' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:415:24 | 415 | print *, shiftr(2, -3) | ^^ semantic error: The shift argument of 'rshift' intrinsic must be less than or equal to the bit size of the integer --> tests/errors/continue_compilation_1.f90:416:24 | 416 | print *, rshift(2, 34) | ^^ Shift value is 34, but bit size of integer is 32 semantic error: The shift argument of 'rshift' intrinsic must be non-negative integer --> tests/errors/continue_compilation_1.f90:417:24 | 417 | print *, rshift(2, -3) | ^^ semantic error: Input to `Sum` is expected to be numeric, but got string[:] --> tests/errors/continue_compilation_1.f90:419:18 | 419 | print *, sum([c1]) | ^^^^ must be integer, real or complex type semantic error: Input to `Product` is expected to be numeric, but got string[:] --> tests/errors/continue_compilation_1.f90:420:22 | 420 | print *, product([c1]) | ^^^^ must be integer, real or complex type semantic error: Input to `MinVal` is expected to be of integer, real or character type, but got complex[:] --> tests/errors/continue_compilation_1.f90:421:21 | 421 | print *, minval([c]) | ^^^ must be integer, real or character type semantic error: Input to `MaxVal` is expected to be of integer, real or character type, but got complex[:] --> tests/errors/continue_compilation_1.f90:422:21 | 422 | print *, maxval([c]) | ^^^ must be integer, real or character type semantic error: Argument to intrinsic `Sum` is expected to be an array, found: integer --> tests/errors/continue_compilation_1.f90:424:14 | 424 | print *, sum(q1) | ^^^^^^^ semantic error: Argument to intrinsic `Product` is expected to be an array, found: real --> tests/errors/continue_compilation_1.f90:425:14 | 425 | print *, product(r1) | ^^^^^^^^^^^ semantic error: Argument to intrinsic `MinVal` is expected to be an array, found: integer --> tests/errors/continue_compilation_1.f90:426:14 | 426 | print *, minval(q1) | ^^^^^^^^^^ semantic error: Argument to intrinsic `MaxVal` is expected to be an array, found: real --> tests/errors/continue_compilation_1.f90:427:14 | 427 | print *, maxval(r1) | ^^^^^^^^^^ semantic error: 'mask' argument of 'sum' intrinsic must be logical --> tests/errors/continue_compilation_1.f90:429:14 | 429 | print *, sum([1, 2, 3], mask = [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:430:5 | 430 | z1 = y | ^^ ^ type mismatch (real and logical) semantic error: reshape accepts arrays for `pad` argument, found integer instead. --> tests/errors/continue_compilation_1.f90:432:50 | 432 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], 0) | ^ semantic error: reshape accepts arrays for `order` argument, found integer instead. --> tests/errors/continue_compilation_1.f90:433:55 | 433 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0], 0) | ^ semantic error: `pad` argument of reshape intrinsic must have same type and kind as `source` argument, found pad type real[:] and kind 4 source type integer[:] and kind 4 instead. --> tests/errors/continue_compilation_1.f90:434:50 | 434 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [1.2]) | ^^^^^ semantic error: `pad` argument of reshape intrinsic must have same type and kind as `source` argument, found pad type integer[:] and kind 8 source type integer[:] and kind 4 instead. --> tests/errors/continue_compilation_1.f90:435:50 | 435 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0_8]) | ^^^^^ semantic error: reshape accepts `order` array with integer elements --> tests/errors/continue_compilation_1.f90:437:58 | 437 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [1.0, 2.0]) | ^^^^^^^^^^ semantic error: reshape accepts `order` array as a permutation of elements from 1 to 2 --> tests/errors/continue_compilation_1.f90:438:58 | 438 | print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 3]) | ^^^^^^ semantic error: `mask` argument to `count` intrinsic must be a logical array --> tests/errors/continue_compilation_1.f90:440:20 | 440 | print *, count(1) | ^ semantic error: `mask` argument to `count` intrinsic must be a logical array --> tests/errors/continue_compilation_1.f90:441:20 | 441 | print *, count([2]) | ^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:443:5 | 443 | a_real = [logical::] | ^^^^^^ ^^^^^^^^^^^ type mismatch (real[:] and logical[:]) semantic error: Input to `Iparity` is expected to be an integer, but got string[:] --> tests/errors/continue_compilation_1.f90:446:22 | 446 | print *, iparity(["a", "b"]) | ^^^^^^^^^^ must be of integer type semantic error: The `mask` argument to `parity` must be logical, but got string[:] --> tests/errors/continue_compilation_1.f90:447:21 | 447 | print *, parity(["a", "b"]) | ^^^^^^^^^^ must be logical type semantic error: `shape` array in reshape intrinsic should be of constant size --> tests/errors/continue_compilation_1.f90:450:30 | 450 | matrix = reshape(source, shape_, pad=[0]) | ^^^^^^ not a constant size array semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_1.f90:450:5 | 450 | matrix = reshape(source, shape_, pad=[0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Complex variable 'c' only has %re, %im, and %kind members, not 'mymember' --> tests/errors/continue_compilation_1.f90:455:14 | 455 | print *, c%mymember | ^^^^^^^^^^ semantic error: Character variable 'c1' only has %len and %kind members, not 'mymember' --> tests/errors/continue_compilation_1.f90:457:14 | 457 | print *, c1%mymember | ^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'present' intrinsic. It accepts exactly 1 arguments. --> tests/errors/continue_compilation_1.f90:459:14 | 459 | print *, present(x,x) | ^^^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'present' intrinsic. It accepts exactly 1 arguments. --> tests/errors/continue_compilation_1.f90:460:14 | 460 | print *, present() | ^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'ieor' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_1.f90:461:14 | 461 | print *, ieor(x) | ^^^^^^^ semantic error: Incorrect number of arguments passed to the 'ieor' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_1.f90:462:14 | 462 | print *, ieor() | ^^^^^^ semantic error: `exit` statements cannot be outside of loops or blocks --> tests/errors/continue_compilation_1.f90:464:5 | 464 | exit | ^^^^ semantic error: Required argument `y` at position 2 is missing in function call --> tests/errors/continue_compilation_1.f90:467:18 | 467 | call my_func(10) | ^^ semantic error: Required argument `x` is missing in function call --> tests/errors/continue_compilation_1.f90:468:5 | 468 | call my_func() | ^^^^^^^^^^^^^^ semantic error: Required argument `extra_arg` is missing in function call --> tests/errors/continue_compilation_1.f90:472:5 | 472 | call obj%display() | ^^^^^^^^^^^^^^^^^^ semantic error: Shape mismatch in `allocate` statement. --> tests/errors/continue_compilation_1.f90:474:14 | 474 | allocate(arr4(5), source=[1, 2, 3]) | ^^^^^^^ ^^^^^^^^^ shape mismatch in dimension 1 semantic error: Type mismatch: The `source` argument in `allocate` must have the same type as the allocated variable. Expected type: integer[:] allocatable, but got: real. --> tests/errors/continue_compilation_1.f90:475:14 | 475 | allocate(arr4(5), source=v) | ^^^^^^^ ^ incompatible types in `allocate` statement semantic error: Dimension mismatch in `allocate` statement. --> tests/errors/continue_compilation_1.f90:476:14 | 476 | allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mismatch in dimensions between allocated variable and `source` semantic error: Cannot allocate an array from a scalar source. --> tests/errors/continue_compilation_1.f90:477:14 | 477 | allocate(arr4, source=7) | ^^^^ allocated variable is an array, but `source` is a scalar semantic error: Argument was not specified --> tests/errors/continue_compilation_1.f90:479:5 | 479 | call logger % add_log_file(filename=filename) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-th argument not specified for add_log_file semantic error: Required argument `unit` is missing in function call --> tests/errors/continue_compilation_1.f90:480:5 | 480 | call logger % add_log_file() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `allocate` statement only accepts four keyword arguments: `stat`, `errmsg`, `source` and `mold` --> tests/errors/continue_compilation_1.f90:482:5 | 482 | allocate(arr5, status=q1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 2 and 3 in array constructor --> tests/errors/continue_compilation_1.f90:485:21 | 485 | print *, ["aa", "aaa"] | ^^^^^ semantic error: Different shape for array assignment on dimension 1(2 and 1) --> tests/errors/continue_compilation_1.f90:486:5 | 486 | cc_a3 = cc_temp3(cc_i0:cc_i0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The argument `mask` must be of rank 2, an array with rank 1 was provided. --> tests/errors/continue_compilation_1.f90:487:25 | 487 | print *, pack(arr2, mask1) | ^^^^^ semantic error: Variable protected_module_my_class_obj is PROTECTED and cannot appear in LHS of assignment --> tests/errors/continue_compilation_1.f90:490:5 | 490 | protected_module_my_class_obj%value = 42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(2 and 1) --> tests/errors/continue_compilation_1.f90:491:5 | 491 | cc_a4 = cc_temp4(cc_i1+1:cc_i1+1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid syntax of derived type for array constructor --> tests/errors/continue_compilation_1.f90:492:12 | 492 | arr = [type(MyClass) :: v1, v2, v3] | ^^^^^^^^^^^^^ help: use just the derived type name 'myclass', without the keyword 'type' semantic error: Class type `NonExistingType` is not defined --> tests/errors/continue_compilation_1.f90:494:11 | 494 | arr = [NonExistingType :: v1, v2, v3] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: DATA statement element count mismatch: 8 elements on left-hand side, 10 values on right-hand side --> tests/errors/continue_compilation_1.f90:497:5 | 497 | data j2, x2, (y2(i2), i2=1,3), k2 / 1,2,3,4,5,6,7,3*8 / | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: DO loop label 'q1' already defined --> tests/errors/continue_compilation_1.f90:499:9 - 501:10 | 499 | q1: do q1 = 1, 3 | ^^^^^^^^^^^^... ... | 501 | end do q1 | ...^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:506:5 | 506 | WRITE (6, fmt_i1) | ^^^^^^^^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:511:5 | 511 | print fmt_i2, "test" | ^^^^^^^^^^^^^^^^^^^^ semantic error: Assigned format (using integer variable as format specifier) is not supported. Use character variables instead. --> tests/errors/continue_compilation_1.f90:516:5 | 516 | read (5, fmt_i3) | ^^^^^^^^^^^^^^^^ semantic error: Type mismatch in argument `p`: expected a procedure but got `integer` --> tests/errors/continue_compilation_1.f90:519:21 | 519 | call proc_param(42) | ^^ semantic error: `end` must be a literal integer label --> tests/errors/continue_compilation_1.f90:522:18 | 522 | read (*, end=x) x | ^ semantic error: `end` must be a literal integer label --> tests/errors/continue_compilation_1.f90:523:18 | 523 | read (*, end=9011.0) x | ^^^^^^ semantic error: `err` must be a literal integer label --> tests/errors/continue_compilation_1.f90:525:18 | 525 | read (*, err=x) x | ^ semantic error: `err` must be a literal integer label --> tests/errors/continue_compilation_1.f90:526:18 | 526 | read (*, err=9013.0) x | ^^^^^^ semantic error: `end` is only supported for READ statements --> tests/errors/continue_compilation_1.f90:527:5 | 527 | write (*, end=9014) x | ^^^^^^^^^^^^^^^^^^^^^ semantic error: end= label 999 is not defined --> tests/errors/continue_compilation_1.f90:532:20 | 532 | read(*, *, end=999) x | ^^^ semantic error: err= label 500 is not defined --> tests/errors/continue_compilation_1.f90:533:20 | 533 | read(*, *, err=500) x | ^^^ semantic error: Duplicate value of `recl` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:535:5 | 535 | OPEN(unit=10, recl=10, recl=20) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `recl` must be of type, Integer --> tests/errors/continue_compilation_1.f90:536:5 | 536 | OPEN(unit=10, recl=10.5) | ^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Invalid substring syntax: use lower:upper instead of lower,upper --> tests/errors/continue_compilation_1.f90:539:14 | 539 | print *, string(i,i) | ^^^^^^^^^^^ semantic error: Allocate should only be called with Allocatable or Pointer type inputs, found str --> tests/errors/continue_compilation_1.f90:541:14 | 541 | allocate(strx) | ^^^^ 'strx' is not allocatable or pointer semantic error: Type mismatch: allocatable character dummy argument 's' has length 5 but actual argument has length 10. --> tests/errors/continue_compilation_1.f90:543:32 | 543 | call modify_and_deallocate(strx) | ^^^^ dummy argument 's' declared here semantic error: Intrinsic `allocated` can be called only on allocatable argument --> tests/errors/continue_compilation_1.f90:544:14 | 544 | print *, allocated(strx) | ^^^^^^^^^^^^^^^ semantic error: Duplicate value of `encoding` found --> tests/errors/continue_compilation_1.f90:548:5 | 548 | OPEN(unit=10, encoding="UTF-8", encoding="UTF-8") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `encoding` must be of type, String or StringPointer --> tests/errors/continue_compilation_1.f90:549:5 | 549 | OPEN(unit=10, encoding=10) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` specifier is not allowed for internal file I/O --> tests/errors/continue_compilation_1.f90:552:5 | 552 | read(str_var, rec=1) x | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` specifier is not allowed for internal file I/O --> tests/errors/continue_compilation_1.f90:553:5 | 553 | write(str_var, rec=1) x | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Duplicate value of `rec` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:554:5 | 554 | read(unit=10, rec=1, rec=2) y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Duplicate value of `rec` found, it has already been specified via arguments or keyword arguments --> tests/errors/continue_compilation_1.f90:555:5 | 555 | write(unit=10, rec=1, rec=2) y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `rec` must be of type, Integer --> tests/errors/continue_compilation_1.f90:556:5 | 556 | read(10, rec=1.5) y | ^^^^^^^^^^^^^^^^^^^ semantic error: `rec` must be of type, Integer --> tests/errors/continue_compilation_1.f90:557:5 | 557 | write(10, rec=2.5) y | ^^^^^^^^^^^^^^^^^^^^ semantic error: `bad` is not defined or imported --> tests/errors/continue_compilation_1.f90:560:13 | 560 | bad_x = .bad. 10 | ^^^^^^^^ semantic error: Operands of comparison operator '==' are not comparable: ieee_class_type == ieee_class_type --> tests/errors/continue_compilation_1.f90:563:10 | 563 | b = (ieee_cls == ieee_quiet_nan) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_1.f90:563:5 | 563 | b = (ieee_cls == ieee_quiet_nan) | ^ ^^^^^^^^^^^^^^ type mismatch (integer[:] and ieee_class_type) lfortran-lfortran-2f73434/tests/reference/asr-subroutine5-24e8434.stderr0000664000175000017500000000020515141516316026137 0ustar alastairalastairsemantic error: Variable 'd' is not declared --> tests/errors/subroutine5.f90:4:9 | 4 | c = a + d | ^ 'd' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-recursion_03-8300fac.json0000664000175000017500000000075615141516316025776 0ustar alastairalastair{ "basename": "asr-recursion_03-8300fac", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_03.f90", "infile_hash": "ca5d64a5bc86665cf6168763480264f56ea25b3bfcc7217348fb14c0", "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_03-8300fac.stdout", "stdout_hash": "9e49c4a53b0dc4c0d648911153064c7ab77e44d940bd0f8d1f084878", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/lookup_name-function_call1-c233951.json0000664000175000017500000000076215141516316027752 0ustar alastairalastair{ "basename": "lookup_name-function_call1-c233951", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/function_call1.f90", "infile_hash": "45acf463b1d977f1bdf3d9420205c7979fc03de58d60260cb37fd0bc", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-function_call1-c233951.stdout", "stdout_hash": "be13f54e037b9595915fd749f61a34c9b319d2e2a8cc223684168ef8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_07-d5a6b4c.json0000664000175000017500000000073015141516316025342 0ustar alastairalastair{ "basename": "julia-expr_07-d5a6b4c", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_07.f90", "infile_hash": "3104b4735ed58e4c3d370db99249102fa43c866834c04484ea2b7bae", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_07-d5a6b4c.stdout", "stdout_hash": "cf9271a274f8e200abd752d92c0c908cbb4982ca0c3f92352de65f84", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fn3-5eccc1b.json0000664000175000017500000000067615141516316024315 0ustar alastairalastair{ "basename": "ast-fn3-5eccc1b", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fn3.f90", "infile_hash": "9cb6b85c5c656d4fd5e9402dd69877be1fec7b37ce21b2ae59abc263", "outfile": null, "outfile_hash": null, "stdout": "ast-fn3-5eccc1b.stdout", "stdout_hash": "55534aa7232b364cec210b2e7385105d5124524c7d57abae3b855db6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-types_08-c70036f.json0000664000175000017500000000074215141516316025057 0ustar alastairalastair{ "basename": "ast-types_08-c70036f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_08.f90", "infile_hash": "022002fe0deb83e3961dc20b35dd2623d7f85f3a299f77323042cb29", "outfile": null, "outfile_hash": null, "stdout": "ast-types_08-c70036f.stdout", "stdout_hash": "5d4f7d4841a1ea61dee8586124196f13805169958f41449e3ecddf05", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-const_real_dp-e0fca56.json0000664000175000017500000000076415141516316026550 0ustar alastairalastair{ "basename": "llvm-const_real_dp-e0fca56", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/const_real_dp.f90", "infile_hash": "636cd3c6b6c703b943b251bba6439b2675cd69fb82cd65a43513e971", "outfile": null, "outfile_hash": null, "stdout": "llvm-const_real_dp-e0fca56.stdout", "stdout_hash": "079cf1090075269aedf99822cfe35b6c084262b638aefce43b5565d5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_02-eff3752.stdout0000664000175000017500000000424015141516316024712 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int32_t marks; int32_t out; marks = 81; if (91 <= marks <= 100) { out = 0; printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { out = 1; printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { out = 2; printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { out = 3; printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { out = 4; printf("%s\n","You passed!"); } else if (marks <= 40) { out = 5; printf("%s\n","Better try again!"); } else { out = 6; printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (out != 1) { fprintf(stderr, "ERROR STOP"); exit(1); } if (91 <= marks <= 100) { printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { printf("%s\n","You passed!"); } else if (marks <= 40) { printf("%s\n","Better try again!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); if (91 <= marks <= 100) { printf("%s\n","Excellent!"); } else if (81 <= marks <= 90) { printf("%s\n","Very good!"); } else if (71 <= marks <= 80) { printf("%s\n","Well done!"); } else if (61 <= marks <= 70) { printf("%s\n","Not bad!"); } else if (41 <= marks <= 60) { printf("%s\n","You passed!"); } else if (marks <= 40) { printf("%s\n","Better try again!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-lfortran-2f73434/tests/reference/wat-if_04-1d3b97a.stdout0000664000175000017500000001535115141516316024746 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32) i32.const 1 local.set 0 local.get 0 i32.const 1 i32.eq if i32.const 1 i32.const 100 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 2 i32.eq if i32.const 1 i32.const 112 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 3 i32.eq if i32.const 1 i32.const 124 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 4 i32.eq if i32.const 1 i32.const 136 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else end end end end local.get 0 i32.const 1 i32.eq if i32.const 1 i32.const 100 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 2 i32.eq if i32.const 1 i32.const 112 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 3 i32.eq if i32.const 1 i32.const 124 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else local.get 0 i32.const 4 i32.eq if i32.const 1 i32.const 136 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop else i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop end end end end i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\08\00\00\00") (data (;35;) (i32.const 216) "Invalid!") ) lfortran-lfortran-2f73434/tests/reference/asr-pragma2-604d549.json0000664000175000017500000000071215141516316024657 0ustar alastairalastair{ "basename": "asr-pragma2-604d549", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "asr-pragma2-604d549.stdout", "stdout_hash": "1eae7d1daa35fd054ab708746431737e658084993b0294c0a45f3e21", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-assign_01-2cf003f.json0000664000175000017500000000074715141516316025246 0ustar alastairalastair{ "basename": "asr-assign_01-2cf003f", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/assign_01.f90", "infile_hash": "b3907bfc11ab4a5400099590f3d20715a7fed312e26241facae934fb", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-assign_01-2cf003f.stderr", "stderr_hash": "22926a0ca854e3a26213cee88788e52c189e7e6d275089ff0cdc971c", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-finalize_02-cfb24d5.json0000664000175000017500000000073115141516316026030 0ustar alastairalastair{ "basename": "llvm-finalize_02-cfb24d5", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/finalize_02.f90", "infile_hash": "fcf0784c9f9bddbeb187dc2ba6d322c3b6549c31c52ec7d83adff23d", "outfile": null, "outfile_hash": null, "stdout": "llvm-finalize_02-cfb24d5.stdout", "stdout_hash": "cb5ce358ce9714b005549aa56269a3fa699c19ed2faf050b9cc1b42a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-intent_01-fd00f62.json0000664000175000017500000000074515141516316025267 0ustar alastairalastair{ "basename": "ast-intent_01-fd00f62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intent_01.f90", "infile_hash": "ecbce2d4b01a09bee24ec92ce8be335f75903e746d23a667806bf264", "outfile": null, "outfile_hash": null, "stdout": "ast-intent_01-fd00f62.stdout", "stdout_hash": "e05ed8c65f0aad32346e455f95ad971e8dd2bb2a4d84ef03fda672e9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_argument_casting_01-2274b4b.json0000664000175000017500000000107215141516316031121 0ustar alastairalastair{ "basename": "asr-implicit_argument_casting_01-2274b4b", "cmd": "lfortran --show-asr --implicit-argument-casting --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/implicit_argument_casting_01.f90", "infile_hash": "3ed389916666e17233ec1aa288c9e7cfee00c97aacc83db1aeec5c7b", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_argument_casting_01-2274b4b.stdout", "stdout_hash": "b8c34c6b14e05884b1474dbb03d9fc5ad4e822c11061d790531a21bb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_clojure-subroutine1-be16026.stdout0000664000175000017500000000265015141516316027753 0ustar alastairalastair(TranslationUnit (SymbolTable 1 {:g (Function (SymbolTable 2 {:i (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false.), :x (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false.)}) g (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [] [(Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false.) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (IntegerBinOp (Var 2 x) Mul (Var 2 i) (Integer 4) ()) () .false. .false.)] [])] () Public .false. .false. ()), :h (Function (SymbolTable 3 {:i (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false.), :x (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false.)}) h (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false.) [] [] [(Assignment (Var 3 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false.) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 3 x) (IntegerBinOp (Var 3 i) Mul (Var 3 x) (Integer 4) ()) () .false. .false.)] [])] () Public .false. .false. ())}) []) lfortran-lfortran-2f73434/tests/reference/llvm-mangle_underscore_external_01-c26c50a.stdout0000664000175000017500000000106115141516316032104 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @foo_() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_mangle_underscore_external_01 FINALIZE_SYMTABLE_mangle_underscore_external_01: ; preds = %return ret i32 0 } declare void @foo_() declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/llvm-int_dp_param-f284039.json0000664000175000017500000000076115141516316026154 0ustar alastairalastair{ "basename": "llvm-int_dp_param-f284039", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/int_dp_param.f90", "infile_hash": "bb7549fda78172a3f68b883fd1423773bf823a71a4dd2f89476886b5", "outfile": null, "outfile_hash": null, "stdout": "llvm-int_dp_param-f284039.stdout", "stdout_hash": "7b7c8cb0b3b16c319223db99f45dda496187f348484b0eb57b4266bd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_16-3e10090.json0000664000175000017500000000075615141516316025636 0ustar alastairalastair{ "basename": "asr-functions_16-3e10090", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_16.f90", "infile_hash": "f0bb1852c528b9e8f34b1e8b3c8f4aaac6f064bbe56c89cc8988f72c", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_16-3e10090.stdout", "stdout_hash": "6e15ca575a69227d90dfe09f13a53d9f7b76f929007df3ac33b0807f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_check-32a1dba.json0000664000175000017500000000100615141516316026470 0ustar alastairalastair{ "basename": "asr-implicit_check-32a1dba", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_check.f90", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_check-32a1dba.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-logical1-d46903b.json0000664000175000017500000000074515141516316025270 0ustar alastairalastair{ "basename": "llvm-logical1-d46903b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/logical1.f90", "infile_hash": "3768bda3700377afdf458a45ed70e2be9481e14ae76fda62adbe38e8", "outfile": null, "outfile_hash": null, "stdout": "llvm-logical1-d46903b.stdout", "stdout_hash": "40aeda8443f06ece45f88da4e74c9aca9ac65cfe19c4fed636de4d3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-coarrays_01-9ca4565.stdout0000664000175000017500000000331315141516316026563 0ustar alastairalastairprogram coarrays_01 ! This test should test most of coarray syntax: ! * declarations ! * allocations ! * coarray operations ! ! You can test the syntax manually with GFortran by: ! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o ! use iso_fortran_env, only: event_type implicit none ! Coarray Declarations real, dimension(100), codimension[*] :: A integer :: B[3,*] integer :: c[*] real :: D(100,2)[3,*] real :: E(1,2,3)[1,2,-1:3,*] real, allocatable :: F(:)[:] real, allocatable :: g(:,:,:)[:,:,:] real, dimension(20), codimension[20,*] :: h real, codimension[:], allocatable :: z(:,:) character :: r(20)[20,0:*] type(event_type) :: ok_to_overwrite[*] type(event_type), allocatable :: greeting_ready(:)[:] integer :: i, n ! Allocation n = 5 allocate(F(n)[*]) allocate(greeting_ready(num_images())[*]) allocate(g(50, 50, 50)[1:2, 1:2, *]) ! Array access, events, teams if (this_image() == 1) then do i = 2, num_images() c = c + c[i] event post (ok_to_overwrite[i]) end do else event wait (ok_to_overwrite) event post (greeting_ready(this_image())[1]) end if sync all sync all () sync all (stat = status) sync all (errmsg = status) event wait (variable, until_count = status) event wait (variable, until_count = status, errmsg = status) event wait (variable, errmsg = status) event wait (variable, stat = status) event post (done(sub(i))[parent(i)], stat = status) event post (variable, stat = status) event post (variable, errmsg = status) s%a(3)(4) = "S" s%b[3] = c[4] s%c(3)[4] = f(3)[4] c[3] = c[4] B[1, 2] = B[3, 4] D(99, 1)[3, 4] = D(1, 2)[1, 2] D(99, 1)[3, 3] = 5 D(:, 1)[3, 3] = 5 D(:, 1)[3, 3, team=3] = 5 D(:, 1)[3, 3, team=3, stat=i] = 5 D(:, 1)[3, 3, stat=i] = 5 end program coarrays_01 lfortran-lfortran-2f73434/tests/reference/llvm-global_scope8-240995c.stdout0000664000175000017500000000106615141516316026610 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 6, i32* @x, align 4 %0 = load i32, i32* @x, align 4 store i32 %0, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %1 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %1 } lfortran-lfortran-2f73434/tests/reference/asr-fn5-3d75eb7.stdout0000664000175000017500000014466615141516316024551 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fn5: (Module (SymbolTable 2 { atleast: (Function (SymbolTable 3 { length: (Variable 3 length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), line: (Variable 3 line [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), pattern: (Variable 3 pattern [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), strout: (Variable 3 strout [length line] ReturnVar () () Default (String 1 (IntrinsicElementalFunction Max [(Var 3 length) (StringLen (IntrinsicElementalFunction StringTrim [(Var 3 line)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) atleast (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 () AssumedLength DescriptorString)] (String 1 (IntrinsicElementalFunction Max [(FunctionParam 1 (Integer 4) () ) (StringLen (IntrinsicElementalFunction StringTrim [(FunctionParam 0 (String 1 () AssumedLength DescriptorString) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 line) (Var 3 length) (Var 3 pattern)] [(If () (IntrinsicElementalFunction Present [(Var 3 pattern)] 0 (Logical 4) () ) [(Assignment (Var 3 strout) (IntrinsicElementalFunction StringConcat [(Var 3 line) (IntrinsicElementalFunction Repeat [(Var 3 pattern) (IntegerBinOp (IntegerBinOp (StringLen (Var 3 strout) (Integer 4) () ) Div (StringLen (Var 3 pattern) (Integer 4) () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (String 1 () DeferredLength DescriptorString) () ) () .false. .false. )] [(Assignment (Var 3 strout) (Var 3 line) () .false. .false. )] )] (Var 3 strout) Public .false. .false. () ), print_dictionary: (Function (SymbolTable 4 { header: (Variable 4 header [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), keywords: (Variable 4 keywords [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), present_in: (Variable 4 present_in [] Local () () Save (Allocatable (Array (Logical 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), shorts: (Variable 4 shorts [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), stop: (Variable 4 stop [] In () () Default (Logical 4) () Source Public Optional .false. .false. .false. () .false. .false. ), values: (Variable 4 values [] Local () () Save (Allocatable (Array (String 1 () DeferredLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_dictionary (FunctionType [(String 1 () AssumedLength DescriptorString) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [atleast] [(Var 4 header) (Var 4 stop)] [(FileWrite 0 () () () () [(StringFormat (StringConstant "(a,1x,a,1x,a,1x,a)" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(FunctionCall 2 atleast () [((StringConstant "KEYWORD" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () )) (())] (String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (StringLen (IntrinsicElementalFunction StringTrim [(StringConstant "KEYWORD" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) (StringConstant "SHORT" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "PRESENT" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "VALUE" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () ) (FileWrite 0 () () () () [(StringFormat (StringConstant "(*(a,1x,a5,1x,l1,8x,\"[\",a,\"]\",/))" (String 1 (IntegerConstant 33 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(ImpliedDoLoop [(FunctionCall 2 atleast () [((ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )) ((IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () )) (())] (String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (StringLen (IntrinsicElementalFunction StringTrim [(ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) (ArrayItem (Var 4 shorts) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (ArrayItem (Var 4 present_in) [(() (Var 4 i) ())] (Logical 4) ColMajor () ) (StringSection (ArrayItem (Var 4 values) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 values) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 4 values) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () )] (Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 4 keywords) () (Integer 4) () ) () (Tuple [(String 1 (IntrinsicElementalFunction Max [(IntrinsicElementalFunction Max [(StringLen (ArrayItem (Var 4 keywords) [(() (ArrayBound (Var 4 keywords) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) ())] (String 1 () DeferredLength DescriptorString) ColMajor () ) (Integer 4) () ) (IntegerConstant 8 (Integer 4) Decimal)] 0 (Integer 4) () ) (StringLen (IntrinsicElementalFunction StringTrim [(ArrayItem (Var 4 keywords) [(() (Var 4 i) ())] (String 1 () DeferredLength DescriptorString) ColMajor () )] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) (String 1 () DeferredLength DescriptorString) (Logical 4) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 4 values) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString)] ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () () () .true. () () )] () Public .false. .false. () ) }) fn5 () [fn5] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-external1-93d8653.stdout0000664000175000017500000000757015141516316025621 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iddr_rsvd: (Function (SymbolTable 2 { matvect: (Function (SymbolTable 3 { matvect_return_var_name: (Variable 3 matvect_return_var_name [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) matvect (FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 3 matvect_return_var_name) Public .false. .false. () ) }) iddr_rsvd (FunctionType [(FunctionType [] (Real 4) BindC Interface () .false. .false. .false. .false. .false. [] .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 matvect)] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-block_data1-33d76d9.stdout0000664000175000017500000000016515141516316026133 0ustar alastairalastair(TranslationUnit [(BlockData block_data1 () [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-program_cmake_01-a9e6179.json0000664000175000017500000000077215141516316026531 0ustar alastairalastair{ "basename": "asr-program_cmake_01-a9e6179", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_01.f90", "infile_hash": "0e854d9b2ed613d6193d78290dc20a45ec66f60ab17e1c0229c3febe", "outfile": null, "outfile_hash": null, "stdout": "asr-program_cmake_01-a9e6179.stdout", "stdout_hash": "ab5531bd4c5cfcc429da69414d2ead8fc1faf72006823340a3cb23f6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-real_dp_01-b41f13e.json0000664000175000017500000000075015141516316025364 0ustar alastairalastair{ "basename": "asr-real_dp_01-b41f13e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_01.f90", "infile_hash": "96dcdc6844b049f189b110b997c4e4f840afa6ff1cd1da7e03f80d79", "outfile": null, "outfile_hash": null, "stdout": "asr-real_dp_01-b41f13e.stdout", "stdout_hash": "07b1303a99e36803d4f4aae92712985da9060eaa9d91f195be136334", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_04-2ebc0e6.stdout0000664000175000017500000003735615141516316025735 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_04: (Program (SymbolTable 2 { greetings: (Variable 2 greetings [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), str: (Variable 2 str [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), user_data: (Variable 2 user_data [] Local () () Default (Allocatable (Array (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_04 [] [(Allocate [((Var 2 user_data) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Mr. " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Rowan " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 user_data) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "Atkinson" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Allocate [((Var 2 greetings) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "h" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "e" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 greetings) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (StringConstant "o" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Here is " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () ) (ArrayItem (Var 2 user_data) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (String 1 (IntegerConstant 40 (Integer 4) Decimal) ExpressionLength DescriptorString) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 greetings)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Allocate [((Var 2 str) [] (IntegerConstant 8 (Integer 4) Decimal) () ())] () () () ) (Assignment (Var 2 str) (StringConstant "abcd" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (IntegerCompare (StringLen (StringSection (Var 2 str) (IntegerConstant 2 (Integer 4) Decimal) (StringLen (Var 2 str) (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerBinOp (IntegerBinOp (StringLen (Var 2 str) (Integer 4) () ) Sub (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ExpressionLength DescriptorString) () ) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_complex-2513a51.json0000664000175000017500000000077515141516316026651 0ustar alastairalastair{ "basename": "asr-arrays_01_complex-2513a51", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_complex.f90", "infile_hash": "2f81875039547fcf7eaa3375e4f99fbc8ef6d91ac2bb214c88cff999", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_complex-2513a51.stdout", "stdout_hash": "8084000c9217d4185c6eb9152e726424cfdecaac826f1d341091fa50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program2-c0dd48f.stdout0000664000175000017500000000166715141516316025661 0ustar alastairalastair(TranslationUnit [(Program program2 () [] [(ImplicitNone [] () )] [] [(SubroutineCall 0 b [] [] [] [] () ) (SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b" ())] () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast-include1-f5bbd80.stdout0000664000175000017500000000321315141516316025617 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 2 () [(DoLoop 0 () 2 j 1 3 () [(DoLoop 0 () 2 k 1 4 () [(Continue 2 () )] () () )] () () ) (Continue 1 () )] () () )] [] [] ) (Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 2 () [(GoTo 0 () 1 [] () ) (Continue 1 () )] () () )] [] [] ) (Program main () [] [] [] [(SubroutineCall 0 f [] [] [] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-assign_to2-6015b09.json0000664000175000017500000000075015141516316025371 0ustar alastairalastair{ "basename": "ast-assign_to2-6015b09", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/assign_to2.f90", "infile_hash": "a929e60f25d1d3c3b1ef485c7d9b5dca6f7bebcfffc66ed010f309d3", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to2-6015b09.stdout", "stdout_hash": "21c3cc594ba3e21409d2c1ec75ac79c2d3f35a6c37b3b0a8fb83979f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_07-240b0d5.stdout0000664000175000017500000001567115141516316026445 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_07: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 2 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp2: (Variable 2 sp2 [] Local (TypeInquiry Kind (Real 4) (RealConstant 0.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_07 [] [(Assignment (Var 2 a) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 b) (Cast (Var 2 a) RealToReal (Real 8) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-goto_03-38b11b3.stdout0000664000175000017500000000045115141516316025675 0ustar alastairalastairprogram goto_03 implicit none integer :: a, n n = 2 a = 10 go to (1, 2, 3), n 1 a = a + 10 2 a = a + 20 3 a = a + 30 if (a /= 60) then error stop end if assign 30 to n go to n, (10, 20, 30) 10 a = a*a 20 a = a + a 30 a = a - a if (a /= 0) then error stop end if end program goto_03 lfortran-lfortran-2f73434/tests/reference/pass_select_case-case_07-90772d0.stdout0000664000175000017500000005116015141516316027633 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { case_07: (Program (SymbolTable 2 { test_case: (Function (SymbolTable 3 { c: (Variable 3 c [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 3 res [] ReturnVar () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_case (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c)] [(If () (LogicalBinOp (StringCompare (StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) LtE (Var 3 c) (Logical 4) () ) And (StringCompare (Var 3 c) LtE (StringConstant "j" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of the first ten letters" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(If () (LogicalBinOp (StringCompare (StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) LtE (Var 3 c) (Logical 4) () ) And (StringCompare (Var 3 c) LtE (StringConstant "p" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of l, m, n, o, p" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(If () (StringCompare (Var 3 c) Eq (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(Assignment (Var 3 res) (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "one of z" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Assignment (Var 3 res) (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Print (StringConstant "other characters, which may not be letters" (String 1 (IntegerConstant 42 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] )] )] (Var 3 res) Public .false. .false. () ) }) case_07 [] [(If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "a" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "d" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "a:j" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "l" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "p" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "l:p" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "z" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "k" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (StringCompare (FunctionCall 2 test_case () [((StringConstant "r" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () () ) NotEq (StringConstant "not found" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_size-352da98.json0000664000175000017500000000076415141516316026250 0ustar alastairalastair{ "basename": "asr-arrays_01_size-352da98", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01_size.f90", "infile_hash": "cb58e1bbc81b8cb3e39e493299f8ce73339c3bfe6f97ec12ea102145", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_01_size-352da98.stdout", "stdout_hash": "2dfc31f0609baef4bbdaf0aade0e825f0ee08fa64c9c6078a48b0d48", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_03-6afb845.stdout0000664000175000017500000030472315141516316026165 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_03: (Program (SymbolTable 13 { f: (ExternalSymbol 13 f 2 f template_03_m [] f Public ) }) template_03 [template_03_m] [(SubroutineCall 13 f () [] () .false. )] ), template_03_m: (Module (SymbolTable 2 { axpy_tmpl: (Template (SymbolTable 5 { axpy: (Function (SymbolTable 8 { a: (Variable 8 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 8 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 8 lfortran_tmp [] Local () () Default (TypeParameter w ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (Array (TypeParameter u ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] InOut () () Default (Array (TypeParameter v ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy (FunctionType [(TypeParameter t ) (Array (TypeParameter u ) [(() ())] DescriptorArray ) (Array (TypeParameter v ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [times plus] [(Var 8 a) (Var 8 x) (Var 8 y)] [(DoLoop () ((Var 8 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 x) () (Integer 4) () ) ()) [(Assignment (Var 8 lfortran_tmp) (FunctionCall 5 times () [((Var 8 a)) ((ArrayItem (Var 8 x) [(() (Var 8 i) ())] (TypeParameter u ) ColMajor () ))] (TypeParameter w ) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 8 y) [(() (Var 8 i) ())] (TypeParameter v ) ColMajor () ) (FunctionCall 5 plus () [((ArrayItem (Var 8 y) [(() (Var 8 i) ())] (TypeParameter v ) ColMajor () )) ((Var 8 lfortran_tmp))] (TypeParameter v ) () () ) () .false. .false. )] [] )] () Public .false. .false. () ), plus: (Function (SymbolTable 6 { a: (Variable 6 a [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 6 b [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 6 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(TypeParameter v ) (TypeParameter w )] (TypeParameter v ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 a) (Var 6 b)] [] (Var 6 op) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), times: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 7 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 7 op [] ReturnVar () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ) }) times (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter w ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 7 a) (Var 7 b)] [] (Var 7 op) Public .false. .false. () ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 5 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 5 w [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy_tmpl [t u v w plus times] [(Require op [v w plus] ) (Require op [t u w times] )] ), f: (Function (SymbolTable 9 { a: (Variable 9 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), axpy: (Function (SymbolTable 12 { a: (Variable 12 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 12 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), lfortran_tmp: (Variable 12 lfortran_tmp [] Local () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] InOut () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~mul_intrinsic ~add_intrinsic] [(Var 12 a) (Var 12 x) (Var 12 y)] [(DoLoop () ((Var 12 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 12 x) () (Integer 4) () ) ()) [(Assignment (Var 12 lfortran_tmp) (FunctionCall 9 ~mul_intrinsic () [((Var 12 a)) ((ArrayItem (Var 12 x) [(() (Var 12 i) ())] (Integer 4) ColMajor () ))] (Real 4) () () ) () .false. .false. ) (Assignment (ArrayItem (Var 12 y) [(() (Var 12 i) ())] (Real 4) ColMajor () ) (FunctionCall 9 ~add_intrinsic () [((ArrayItem (Var 12 y) [(() (Var 12 i) ())] (Real 4) ColMajor () )) ((Var 12 lfortran_tmp))] (Real 4) () () ) () .false. .false. )] [] )] () Public .false. .false. () ), dp: (Variable 9 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 9 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 9 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 9 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 9 ~add [9 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 10 { arg0: (Variable 10 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 10 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 10 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 10 arg0) (Var 10 arg1)] [(Assignment (Var 10 ret) (RealBinOp (Var 10 arg0) Add (Var 10 arg1) (Real 4) () ) () .false. .false. )] (Var 10 ret) Public .false. .true. () ), ~mul: (CustomOperator 9 ~mul [9 ~mul_intrinsic] Public ), ~mul_intrinsic: (Function (SymbolTable 11 { arg0: (Variable 11 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 11 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 11 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~mul_intrinsic (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 11 arg0) (Var 11 arg1)] [(Assignment (Var 11 ret) (RealBinOp (Var 11 arg0) Mul (Cast (Var 11 arg1) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 11 ret) Public .false. .true. () ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 9 a) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 9 x) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 9 y) (ArrayBroadcast (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [0.00000000e+00, 0.00000000e+00, 0.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 9 axpy () [((Var 9 a)) ((ArrayPhysicalCast (Var 9 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 9 y) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. ) (Print (StringFormat () [(Var 9 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), op: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 4 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Interface () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 a) (Var 4 b)] [] (Var 4 op) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op [t u v op] [] ) }) template_03_m () [template_03_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-assign-69436fa.stdout0000664000175000017500000000030015141516316025717 0ustar alastairalastairprogram assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x assign 10 to x 30 assign 10 to y ! An integer variable is required in this context. end program assign lfortran-lfortran-2f73434/tests/reference/ast_f90-doloop_05-1dc897c.json0000664000175000017500000000076015141516316025754 0ustar alastairalastair{ "basename": "ast_f90-doloop_05-1dc897c", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doloop_05.f90", "infile_hash": "d6c2b01c1169dbde9ecbd05ebec2c3267e3d77d027cff03dc7361d78", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doloop_05-1dc897c.stdout", "stdout_hash": "c1d752f2d90e0bdbedd94a6eaacd00d9b71f03a56ea0cbe2650c7658", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_vector-140858c.stdout0000664000175000017500000031710415141516316027077 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_vector: (Program (SymbolTable 11 { main: (ExternalSymbol 11 main 2 main template_vector_m [] main Public ), vector_t: (ExternalSymbol 11 vector_t 2 vector_t template_vector_m [] vector_t Public ) }) template_vector [template_vector_m] [(SubroutineCall 11 main () [] () .false. )] ), template_vector_m: (Module (SymbolTable 2 { main: (Function (SymbolTable 7 { 1_intvector___asr_push_back: (ExternalSymbol 7 1_intvector___asr_push_back 8 push_back intvector [] push_back Public ), 1_intvector_elements: (ExternalSymbol 7 1_intvector_elements 8 elements intvector [] elements Public ), __asr_push_back: (Function (SymbolTable 9 { 1_intvector_elements: (ExternalSymbol 9 1_intvector_elements 8 elements intvector [] elements Public ), 1_intvector_resize: (ExternalSymbol 9 1_intvector_resize 8 resize intvector [] resize Public ), 1_intvector_sz: (ExternalSymbol 9 1_intvector_sz 8 sz intvector [] sz Public ), item: (Variable 9 item [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), new_size: (Variable 9 new_size [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 9 this [] In () () Default (StructType [] [] .false. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_push_back (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 this) (Var 9 item)] [(Assignment (Var 9 new_size) (IntegerBinOp (StructInstanceMember (Var 9 this) 9 1_intvector_sz (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 9 1_intvector_resize () [((Var 9 new_size))] (Var 9 this) .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 9 this) 9 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (Var 9 new_size) ())] (Integer 4) ColMajor () ) (Var 9 item) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 this) 9 1_intvector_sz (Integer 4) () ) (Var 9 new_size) () .false. .false. )] () Private .false. .false. () ), __asr_resize: (Function (SymbolTable 10 { 1_intvector_elements: (ExternalSymbol 10 1_intvector_elements 8 elements intvector [] elements Public ), 1_intvector_sz: (ExternalSymbol 10 1_intvector_sz 8 sz intvector [] sz Public ), i: (Variable 10 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 10 this [] InOut () () Default (StructType [] [] .false. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 10 tmp [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_resize (FunctionType [(StructType [] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 this) (Var 10 n)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (Return)] [] ) (If () (IntegerCompare (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) GtE (Var 10 n) (Logical 4) () ) [(Return)] [] ) (Allocate [((Var 10 tmp) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 10 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 10 tmp) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) (ArrayItem (StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (Var 10 i) ())] (Integer 4) ColMajor () ) () .false. .false. )] [] ) (Allocate [((StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 10 n))] () () ())] () () () ) (Assignment (ArraySection (StructInstanceMember (Var 10 this) 10 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 10 this) 10 1_intvector_sz (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Integer 4) [(() ())] DescriptorArray ) () ) (Var 10 tmp) () .false. .false. )] () Private .false. .false. () ), intvector: (Struct (SymbolTable 8 { elements: (Variable 8 elements [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), push_back: (StructMethodDeclaration 8 push_back () __asr_push_back 7 __asr_push_back Source .false. .false. ), resize: (StructMethodDeclaration 8 resize () __asr_resize 7 __asr_resize Source .false. .false. ), sz: (Variable 8 sz [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) intvector (StructType [] [] .true. .false. ) [] [elements sz] [] Source Private .false. .false. [] () () ), v: (Variable 7 v [] Local () () Default (StructType [] [] .true. .false. ) 7 intvector Source Private Required .false. .false. .false. () .false. .false. ) }) main (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(SubroutineCall 7 1_intvector___asr_push_back () [((IntegerConstant 10 (Integer 4) Decimal))] (Var 7 v) .false. ) (If () (IntegerCompare (ArrayItem (StructInstanceMember (Var 7 v) 7 1_intvector_elements (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] () Public .false. .false. () ), vector_t: (Template (SymbolTable 3 { push_back: (Function (SymbolTable 5 { 1_vector_elements: (ExternalSymbol 5 1_vector_elements 4 elements vector [] elements Public ), 1_vector_resize: (ExternalSymbol 5 1_vector_resize 4 resize vector [] resize Public ), 1_vector_sz: (ExternalSymbol 5 1_vector_sz 4 sz vector [] sz Public ), item: (Variable 5 item [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), new_size: (Variable 5 new_size [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 5 this [] In () () Default (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) 3 vector Source Private Required .false. .false. .false. () .false. .false. ) }) push_back (FunctionType [(StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this) (Var 5 item)] [(Assignment (Var 5 new_size) (IntegerBinOp (StructInstanceMember (Var 5 this) 5 1_vector_sz (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 5 1_vector_resize () [((Var 5 new_size))] (Var 5 this) .false. ) (Assignment (ArrayItem (StructInstanceMember (Var 5 this) 5 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [(() (Var 5 new_size) ())] (TypeParameter t ) ColMajor () ) (Var 5 item) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 this) 5 1_vector_sz (Integer 4) () ) (Var 5 new_size) () .false. .false. )] () Private .false. .false. () ), resize: (Function (SymbolTable 6 { 1_vector_elements: (ExternalSymbol 6 1_vector_elements 4 elements vector [] elements Public ), 1_vector_sz: (ExternalSymbol 6 1_vector_sz 4 sz vector [] sz Public ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 6 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), this: (Variable 6 this [] InOut () () Default (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) 3 vector Source Private Required .false. .false. .false. () .false. .false. ), tmp: (Variable 6 tmp [] Local () () Default (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) resize (FunctionType [(StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 this) (Var 6 n)] [(If () (LogicalNot (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () )] 0 (Logical 4) () ) (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (Return)] [] ) (If () (IntegerCompare (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) GtE (Var 6 n) (Logical 4) () ) [(Return)] [] ) (Allocate [((Var 6 tmp) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 6 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 6 tmp) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () ) (ArrayItem (StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [(() (Var 6 i) ())] (TypeParameter t ) ColMajor () ) () .false. .false. )] [] ) (Allocate [((StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 6 n))] () () ())] () () () ) (Assignment (ArraySection (StructInstanceMember (Var 6 this) 6 1_vector_elements (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 6 this) 6 1_vector_sz (Integer 4) () ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (TypeParameter t ) [(() ())] DescriptorArray ) () ) (Var 6 tmp) () .false. .false. )] () Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), vector: (Struct (SymbolTable 4 { elements: (Variable 4 elements [] Local () () Default (Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) () Source Private Required .false. .false. .false. () .false. .false. ), push_back: (StructMethodDeclaration 4 push_back () push_back 3 push_back Source .false. .false. ), resize: (StructMethodDeclaration 4 resize () resize 3 resize Source .false. .false. ), sz: (Variable 4 sz [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) vector (StructType [(Allocatable (Array (TypeParameter t ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) [] [elements sz] [] Source Private .false. .false. [] () () ) }) vector_t [t] [] ) }) template_vector_m () [template_vector_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-sole_intrinsic-1ce1e44.stdout0000664000175000017500000000463115141516316027060 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration () [(SimpleAttribute AttrIntrinsic )] [(aimag [] [] () () None ()) (cmplx [] [] () () None ()) (real [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(f [] [] () () None ())] () ) (Declaration (AttrType TypeComplex [] () () None ) [] [(x [] [] () (Complex (Real "1.0") (u- (Real "3.0"))) Equal ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrIntrinsic )] [(mod [] [] () () None ())] () )] [(Assignment 0 f (FuncCallOrArray cmplx [] [(() 3 () 0) (() 1 () 0)] [] [] [] ) () ) (Assignment 0 y (FuncCallOrArray aimag [] [(() x () 0)] [] [] [] ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-end_function_name_not_match-92ee1a1.stderr0000664000175000017500000000040615141516316031521 0ustar alastairalastairsyntax error: End function name does not match function name --> tests/errors/end_function_name_not_match.f90:1:1 - 6:23 | 1 | real function square(x) | ^^^^^^^^^^^^^^^^^^^^^^^... ... | 6 | end function square_int | ...^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-if1-6dc9fe3.stdout0000664000175000017500000000040415141516316025260 0ustar alastairalastairprogram if1 integer :: i i = 5 if (i == 5) then print *, "correct" end if if (i == 6) then print *, "incorrect" end if i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, "i < 0" go to 40 60 print *, "i == 0" go to 40 70 print *, "i > 0" end program if1 lfortran-lfortran-2f73434/tests/reference/asr-string_slice2-473fb60.json0000664000175000017500000000074315141516316026155 0ustar alastairalastair{ "basename": "asr-string_slice2-473fb60", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_slice2.f90", "infile_hash": "f3995fe57e4845b075c37fa64078352880de67388d65b1a68c666e31", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_slice2-473fb60.stderr", "stderr_hash": "c3a382633b8a93827775482c6d6739623eddd1e010dcf1598d8f8a5d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-kind_star_of_logical-8df9344.stderr0000664000175000017500000000023015141516316030075 0ustar alastairalastairsemantic error: Expected initialization expression for kind --> tests/errors/kind_star_of_logical.f90:3:13 | 3 | logical(*) a | ^ lfortran-lfortran-2f73434/tests/reference/ast-array7-b9de38f.stdout0000664000175000017500000000324215141516316025334 0ustar alastairalastair(TranslationUnit [(Program array7 () [] [(Implicit [(ImplicitSpec (AttrType TypeDoublePrecision [] () () None ) [(LetterSpec A H ) (LetterSpec O Z )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeInteger [] () () None ) [(LetterSpec I N )] )] () )] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrParameter )] [(n [] [] () 10 Equal ())] () ) (Declaration () [(AttrDimension [] )] [(SJ [(0 N DimensionExpr)] [] () () None ()) (DJ [(0 N DimensionExpr)] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-redeclaration1-9d7c988.json0000664000175000017500000000076115141516316026327 0ustar alastairalastair{ "basename": "asr-redeclaration1-9d7c988", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/redeclaration1.f90", "infile_hash": "ff81dd9b45f6ed6a45cc24ac800b39403510201002affa3577c4216a", "outfile": null, "outfile_hash": null, "stdout": "asr-redeclaration1-9d7c988.stdout", "stdout_hash": "0caba53c473e87815015b6426785a737f464b0d7f61c05ff23dd64d4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-preprocess_01-20f7efb.json0000664000175000017500000000107115141516316026226 0ustar alastairalastair{ "basename": "asr-preprocess_01-20f7efb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/preprocess_01.f90", "infile_hash": "8b0a43c23607be7c2557620c9ad10af23a6bcf0430bf1d5170b65303", "outfile": null, "outfile_hash": null, "stdout": "asr-preprocess_01-20f7efb.stdout", "stdout_hash": "4f1658e7cdeebd657ec68daf84c2925de4407c668b9ddb737d9cfb67", "stderr": "asr-preprocess_01-20f7efb.stderr", "stderr_hash": "add78f2a68b8c40d46c23122eeab18b258daae408143d3fb854b005d", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-class_02-82c2f9c.stdout0000664000175000017500000002010615141516316025632 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> %circle_class = type <{ i32 (...)**, %circle* }> %circle = type { float } @__module_class_circle2_pi = global float 0x400921FB60000000 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0) }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_class_circle2_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_class_circle2_circle to i8*), i8* bitcast (float (%circle_class*)* @__module_class_circle2_circle_area to i8*), i8* bitcast (void (%circle_class*)* @__module_class_circle2_circle_print to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [25 x i8] c"S-DESC-12,R4,S-DESC-8,R4\00", align 1 @string_const_data = private constant [12 x i8] c"Circle: r = " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @string_const_data.1 = private constant [8 x i8] c" area = " @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.1, i32 0, i32 0), i64 8 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_class_circle2_circle_area(%circle_class* %this) { .entry: %circle_area = alloca float, align 4 %0 = load float, float* @__module_class_circle2_pi, align 4 %1 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %2 = load %circle*, %circle** %1, align 8 %3 = getelementptr %circle, %circle* %2, i32 0, i32 0 %4 = load float, float* %3, align 4 %simplified_pow_operation = fmul float %4, %4 %5 = fmul float %0, %simplified_pow_operation store float %5, float* %circle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %6 = load float, float* %circle_area, align 4 ret float %6 } define void @__module_class_circle2_circle_print(%circle_class* %this) { .entry: %area = alloca float, align 4 %0 = bitcast %circle_class* %this to float (%circle_class*)*** %1 = load float (%circle_class*)**, float (%circle_class*)*** %0, align 8 %2 = getelementptr inbounds float (%circle_class*)*, float (%circle_class*)** %1, i32 2 %3 = load float (%circle_class*)*, float (%circle_class*)** %2, align 8 %4 = call float %3(%circle_class* %this) store float %4, float* %area, align 4 %5 = alloca i64, align 8 %6 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %7 = load %circle*, %circle** %6, align 8 %8 = getelementptr %circle, %circle* %7, i32 0, i32 0 %9 = load float, float* %8, align 4 %10 = alloca float, align 4 store float %9, float* %10, align 4 %11 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, %string_descriptor* @string_const, float* %10, %string_descriptor* @string_const.2, float* %area) %12 = load i64, i64* %5, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 4 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_circle_print FINALIZE_SYMTABLE_circle_print: ; preds = %return ret void } define void @__module_class_circle2__xx_lcompilers_changed_main_xx() { .entry: %c = alloca %circle, align 8 %0 = getelementptr %circle, %circle* %c, i32 0, i32 0 %1 = getelementptr %circle, %circle* %c, i32 0, i32 0 store float 1.000000e+00, float* %1, align 4 %2 = getelementptr %circle, %circle* %c, i32 0, i32 0 store float 1.500000e+00, float* %2, align 4 %3 = alloca %circle_class, align 8 %4 = getelementptr %circle_class, %circle_class* %3, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %circle_class, %circle_class* %3, i32 0, i32 1 store %circle* %c, %circle** %5, align 8 call void @__module_class_circle2_circle_print(%circle_class* %3) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret void } define linkonce_odr void @_copy_class_circle2_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %circle* %3 = bitcast i8* %1 to %circle* %4 = getelementptr %circle, %circle* %2, i32 0, i32 0 %5 = load float, float* %4, align 4 %6 = getelementptr %circle, %circle* %3, i32 0, i32 0 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then ret void } define linkonce_odr void @_allocate_struct_class_circle2_circle(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %circle_class* %4 = bitcast %circle_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %circle_class, %circle_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %circle* store %circle* %7, %circle** %5, align 8 %8 = getelementptr %circle, %circle* %7, i32 0, i32 0 ret void } declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_class_circle2__xx_lcompilers_changed_main_xx() call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_test FINALIZE_SYMTABLE_circle_test: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_01-8974c02.stderr0000664000175000017500000000024415141516316030404 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_01.f90:5:10 | 5 | where(.true.) b = 12121 | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-expr_05-a129dce.stdout0000664000175000017500000000246615141516316026062 0ustar alastairalastairprogram expr_05 ! Test parantheses in expressions implicit none integer :: x, a, b, c logical :: l a = 3 b = 4 c = 5 x = 2*3 x = (-2)*3 x = 2*(-3) x = (-2)*(-3) x = (-2)*(-3) x = -2**3 x = -2**3 x = -2*3 x = 2**(-3) x = a x = (a) x = a*b x = (-a)*b x = -a*b x = a*(-b) x = (-a)*(-b) x = a*b*c x = (-a)*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3 + 4*5 x = (3 + 4)*5 x = a*(b + 5*(c - b)) x = (3 - 2*a*b)*5 x = ((-2)*a*b + 3)*5 x = ((-2)*a*b + 3*b*a)*5 x = ((-2)*a/b + (a + (-b))**2)*5 x = (2*a*b + 3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = 1/a*b x = 1/(a*b + 1) x = 1/a*b + 1 x = 1/a*b + 1 x = 2 - (-2) x = a - ((-b) - c) x = a - (-2)*b x = c - (-2)/b x = a - (2 + 3 + 4) x = a + 2 + 3 + 4 x = 2*a + a*b - (a*b + 2*a) x = 2*a + a*b - (a*b - 2*a) x = a - (b - (c - 1)) x = a - b x = a - (b - c) x = a - b - c x = -(a - ((-b) + (-b) - (-b)*b)) x = -(3 + 5) x = -(a + 5) l = x**3*4 + a <= 4 .or. x < 5 .and. x < 6 .eqv. .true. .or. .not. .false. .and. .true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not.(l .or. l) end program expr_05 lfortran-lfortran-2f73434/tests/reference/llvm-boz_01-def9db5.stdout0000664000175000017500000001704315141516316025466 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [18 x i8] c"I4,I4,I4,I4,I4,R4\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %boz_1 = alloca i32, align 4 %boz_2 = alloca i32, align 4 %boz_3 = alloca i32, align 4 %boz_4 = alloca i32, align 4 %boz_5 = alloca i32, align 4 %boz_6 = alloca float, align 4 store i32 93, i32* %boz_1, align 4 store i32 1255, i32* %boz_2, align 4 store i32 2748, i32* %boz_3, align 4 store i32 180150001, i32* %boz_4, align 4 store i32 180150001, i32* %boz_5, align 4 store float 0x36DA000000000000, float* %boz_6, align 4 %2 = load i32, i32* %boz_4, align 4 %3 = load i32, i32* %boz_5, align 4 %4 = icmp ne i32 %2, %3 br i1 %4, label %then, label %else then: ; preds = %.entry call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %5 = load i32, i32* %boz_1, align 4 %6 = icmp ne i32 %5, 93 br i1 %6, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %7 = load i32, i32* %boz_2, align 4 %8 = icmp ne i32 %7, 1255 br i1 %8, label %then4, label %else5 then4: ; preds = %ifcont3 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 else5: ; preds = %ifcont3 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %9 = load i32, i32* %boz_3, align 4 %10 = icmp ne i32 %9, 2748 br i1 %10, label %then7, label %else8 then7: ; preds = %ifcont6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %ifcont6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %11 = load i32, i32* %boz_4, align 4 %12 = icmp ne i32 %11, 180150001 br i1 %12, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 %13 = load i32, i32* %boz_5, align 4 %14 = icmp ne i32 %13, 180150001 br i1 %14, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 %15 = alloca i64, align 8 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @serialization_info, i32 0, i32 0), i64* %15, i32 0, i32 0, i32* %boz_1, i32* %boz_2, i32* %boz_3, i32* %boz_4, i32* %boz_5, float* %boz_6) %17 = load i64, i64* %15, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %23 = load i64, i64* %22, align 4 %24 = trunc i64 %23 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %21, i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %25 = icmp eq i8* %16, null br i1 %25, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont15 call void @_lfortran_free(i8* %16) br label %free_done free_done: ; preds = %free_nonnull, %ifcont15 call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_boz_01 FINALIZE_SYMTABLE_boz_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_01-e42aa0d.stderr0000664000175000017500000000034015141516316027163 0ustar alastairalastairsemantic error: Cannot call 'xub' as a procedure; it is a variable. Use --implicit-interface to enable implicit procedure interfaces. --> tests/errors/implicit_call_01.f90:4:5 | 4 | call xub (i) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-character_parameter_padding_trimming-ea91653.stderr0000664000175000017500000000270415141516316033331 0ustar alastairalastairwarning: The LHS character len=2 and the RHS character len=5 are not equal. --> tests/character_parameter_padding_trimming.f90:16:5 | 16 | character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=3 and the RHS character len=4 are not equal. --> tests/character_parameter_padding_trimming.f90:17:5 | 17 | character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=5 and the RHS character len=7 are not equal. --> tests/character_parameter_padding_trimming.f90:18:5 | 18 | character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len warning: The LHS character len=1 and the RHS character len=2 are not equal. --> tests/character_parameter_padding_trimming.f90:19:5 | 19 | character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the RHS character len to match the LHS character len lfortran-lfortran-2f73434/tests/reference/asr-complex_sub_test-f54ef56.stdout0000664000175000017500000001543715141516316027435 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Sub (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) ) Sub (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Sub (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Sub (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics11-7200632.json0000664000175000017500000000074015141516316025562 0ustar alastairalastair{ "basename": "asr-intrinsics11-7200632", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics11.f90", "infile_hash": "a1421b32cc55564ceeab263ddf15d4e31e93c87c30ac8acc8e8948b0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics11-7200632.stderr", "stderr_hash": "31c7c19f850d3ab5ef6c98b67f6612aa86499f43eda5cc1949bd4beb", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-modules4-22712cd.stdout0000664000175000017500000015475415141516316025520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 13 { toml_ordered: (ExternalSymbol 13 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 15 { destroy: (Function (SymbolTable 18 { self: (Variable 18 self [] InOut () () Default (StructType [] [] .false. .false. ) 15 toml_structure Source Public Required .false. .true. .false. () .false. .false. ), toml_value: (ExternalSymbol 18 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 16 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 15 toml_structure ), toml_structure: (Struct (SymbolTable 17 { destroy: (StructMethodDeclaration 17 destroy () destroy 15 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type: (Module (SymbolTable 2 { new: (GenericProcedure 2 new [2 new_array 2 new_keyval 2 new_keyval] Public ), new_array: (ExternalSymbol 2 new_array 4 new_array tomlf_type_array [] new_array Public ), new_keyval: (ExternalSymbol 2 new_keyval 20 new_keyval tomlf_type_keyval [] new_keyval Public ), toml_array: (ExternalSymbol 2 toml_array 4 toml_array tomlf_type_array [] toml_array Public ), toml_keyval: (ExternalSymbol 2 toml_keyval 20 toml_keyval tomlf_type_keyval [] toml_keyval Public ) }) tomlf_type () [tomlf_type_array tomlf_type_keyval] .false. .false. .false. ), tomlf_type_array: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { 1_toml_array_list: (ExternalSymbol 6 1_toml_array_list 5 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 6 1_toml_structure 15 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 6 1_toml_structure_destroy 17 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 6 1_toml_value_key 10 key toml_value [] key Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 6 1_toml_structure_destroy () [] (StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .false. .false. () ), new: (GenericProcedure 4 new [4 new_array] Public ), new_array: (Function (SymbolTable 7 { self: (Variable 7 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self)] [] () Public .false. .false. () ), toml_array: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .false. .false. ), list: (Variable 5 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 toml_ordered Source Public Required .false. .false. .false. () .false. .false. ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 4 toml_value ), toml_ordered: (ExternalSymbol 4 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 4 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .true. .false. .false. ), tomlf_type_keyval: (Module (SymbolTable 20 { destroy: (Function (SymbolTable 23 { 1_toml_keyval_raw: (ExternalSymbol 23 1_toml_keyval_raw 21 raw toml_keyval [] raw Public ), 1_toml_value_key: (ExternalSymbol 23 1_toml_value_key 22 key toml_value [] key Public ), self: (Variable 23 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 20 toml_keyval Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 23 self) 23 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 23 self) 23 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 23 self) 23 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 23 self) 23 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] )] () Public .false. .false. () ), new: (GenericProcedure 20 new [20 new_keyval] Public ), new_keyval: (Function (SymbolTable 24 { self: (Variable 24 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 20 toml_keyval Source Public Required .false. .false. .false. () .false. .false. ) }) new_keyval (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 self)] [] () Public .false. .false. () ), toml_keyval: (Struct (SymbolTable 21 { destroy: (StructMethodDeclaration 21 destroy () destroy 20 destroy Source .false. .false. ), raw: (Variable 21 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_keyval (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () 20 toml_value ), toml_value: (Struct (SymbolTable 22 { destroy: (StructMethodDeclaration 22 destroy () destroy 20 destroy Source .true. .false. ), key: (Variable 22 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () ) }) tomlf_type_keyval () [] .true. .false. .false. ), tomlf_type_value: (Module (SymbolTable 9 { destroy: (Function (SymbolTable 11 { self: (Variable 11 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 9 toml_value Source Private Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 10 { destroy: (StructMethodDeclaration 10 destroy () destroy 9 destroy Source .true. .false. ), key: (Variable 10 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-esub1-15eb690.json0000664000175000017500000000071315141516316024424 0ustar alastairalastair{ "basename": "ast-esub1-15eb690", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/esub1.f90", "infile_hash": "93b7d715c14f2da952a8945b7ea7b16817b269880b156f00497dd7b1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-esub1-15eb690.stderr", "stderr_hash": "48b8d74bcdf39ea72135c4853146fdfde7142e5f9ce448b9553d2c1a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-mre_parameter-15f810f.stderr0000664000175000017500000000065415141516316026602 0ustar alastairalastairsemantic error: arguments of `repeat` intrinsic must be scalar --> tests/errors/mre_parameter.f90:3:38 | 3 | character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Variable 'ar1' is not declared --> tests/errors/mre_parameter.f90:4:14 | 4 | print *, ar1 | ^^^ 'ar1' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_05-c57a23d.json0000664000175000017500000000075415141516316026654 0ustar alastairalastair{ "basename": "asr-matrix_matmul_05-c57a23d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_05.f90", "infile_hash": "6c98c338c41f6fbbc80e3b357b0fa5b757ec6dfd02332a8e06839241", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_05-c57a23d.stderr", "stderr_hash": "171aa1673005266c1b63f76f0f5000745a88e7f2468ad3e1713e6e82", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_47-bdbe527.json0000664000175000017500000000076115141516316026244 0ustar alastairalastair{ "basename": "asr-intrinsics_47-bdbe527", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_47.f90", "infile_hash": "e72c8435df70e13e7d473f70c58ee55796a7f234125dd71264bf94cf", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_47-bdbe527.stdout", "stdout_hash": "73d111ab5e1a9791490a682e2d40280a37320e5cf69921c7b4ee8624", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-write_02-795afbb.json0000664000175000017500000000067415141516316025227 0ustar alastairalastair{ "basename": "run-write_02-795afbb", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/write_02.f90", "infile_hash": "7c59eecee1e7e7127571ea73b91b4e0e10077295f6dbb75f94aef687", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-write_02-795afbb.stderr", "stderr_hash": "b65bc0d80ed3f38265702bfd48f891f579ea1c8ec54cef7c4f9f59ed", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/run-read2-7b581ec.stdout0000664000175000017500000000042215141516316025050 0ustar alastairalastairphifile: '' F T lfortran-lfortran-2f73434/tests/reference/ast-block_data1-33d76d9.json0000664000175000017500000000075415141516316025566 0ustar alastairalastair{ "basename": "ast-block_data1-33d76d9", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/block_data1.f", "infile_hash": "75a23d4519eec459620a61996f68ddb43af0b44cb2fb1a34861528f0", "outfile": null, "outfile_hash": null, "stdout": "ast-block_data1-33d76d9.stdout", "stdout_hash": "fa6fc46628f6fbca3fed9e33648c5c116898e59d1be2698a8d5ab91f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format3-ee61b31.stdout0000664000175000017500000000014315141516316025416 0ustar alastairalastair 12.3457E+03 123.4568E-06 1.2346E+03 ********** ********** -1.2346E+03 -123.45679E-06 0.0000E+00 lfortran-lfortran-2f73434/tests/reference/ast_f90-array9-25daf13.stdout0000664000175000017500000000072015141516316025713 0ustar alastairalastairprogram array9 type :: varying_string character(len=1), allocatable :: characters(:) end type varying_string type(varying_string) :: x type(varying_string), allocatable :: a(:) real, allocatable :: b(:) integer, allocatable :: c(:) real(4), allocatable :: d(:) a = [varying_string :: ] b = [real :: ] b = [integer :: ] d = [real(4) :: ] a = [varying_string :: x, x] b = [real :: 1.0, 2.0] b = [integer :: 1, 2] d = [real(4) :: 1.0, 2.0] end program array9 lfortran-lfortran-2f73434/tests/reference/asr-nested_04-8423f42.json0000664000175000017500000000074515141516316025116 0ustar alastairalastair{ "basename": "asr-nested_04-8423f42", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_04.f90", "infile_hash": "e1cee5ef2176599a2dccac3f59fc86ddc957a5f559f5edb7ddd710ca", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_04-8423f42.stdout", "stdout_hash": "01639e3026f1d163553301e767e81cb33f2b214bc9c6464fa5b29f3f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_19-d880475.stdout0000664000175000017500000024627515141516316025542 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stdlib_strings_use: (Program (SymbolTable 14 { char: (ExternalSymbol 14 char 2 char string_19_stdlib_string_type [] char Public ), char_string: (ExternalSymbol 14 char_string 2 char_string string_19_stdlib_string_type [] char_string Public ), compute_lps: (ExternalSymbol 14 compute_lps 6 compute_lps string_19_stdlib_strings [] compute_lps Public ), compute_lps_use: (ExternalSymbol 14 compute_lps_use 6 compute_lps_use string_19_stdlib_strings [] compute_lps_use Public ), compute_lps_use1: (ExternalSymbol 14 compute_lps_use1 6 compute_lps_use1 string_19_stdlib_strings [] compute_lps_use1 Public ), len: (ExternalSymbol 14 len 2 len string_19_stdlib_string_type [] len Public ), len_string: (ExternalSymbol 14 len_string 2 len_string string_19_stdlib_string_type [] len_string Public ), padl: (ExternalSymbol 14 padl 6 padl string_19_stdlib_strings [] padl Public ), padl_char_default: (ExternalSymbol 14 padl_char_default 6 padl_char_default string_19_stdlib_strings [] padl_char_default Public ), padl_char_pad_with: (ExternalSymbol 14 padl_char_pad_with 6 padl_char_pad_with string_19_stdlib_strings [] padl_char_pad_with Public ), padl_string_default: (ExternalSymbol 14 padl_string_default 6 padl_string_default string_19_stdlib_strings [] padl_string_default Public ), padl_string_pad_with: (ExternalSymbol 14 padl_string_pad_with 6 padl_string_pad_with string_19_stdlib_strings [] padl_string_pad_with Public ), string_type: (ExternalSymbol 14 string_type 2 string_type string_19_stdlib_string_type [] string_type Public ) }) stdlib_strings_use [string_19_stdlib_strings] [] ), string_19_stdlib_string_type: (Module (SymbolTable 2 { char: (GenericProcedure 2 char [2 char_string] Public ), char_string: (Function (SymbolTable 5 { character_string: (Variable 5 character_string [len_string string] ReturnVar () () Default (String 1 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 5 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) char_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (String 1 (FunctionCall 2 len_string 2 len [((FunctionParam 0 (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ))] (Integer 4) () () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [len_string] [(Var 5 string)] [] (Var 5 character_string) Public .false. .false. () ), len: (GenericProcedure 2 len [2 len_string] Public ), len_string: (Function (SymbolTable 4 { length: (Variable 4 length [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) len_string (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string)] [] (Var 4 length) Public .false. .false. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () ) }) string_19_stdlib_string_type () [] .false. .false. .false. ), string_19_stdlib_strings: (Module (SymbolTable 6 { char: (ExternalSymbol 6 char 2 char string_19_stdlib_string_type [] char Public ), char_string: (ExternalSymbol 6 char_string 2 char_string string_19_stdlib_string_type [] char_string Public ), compute_lps: (Function (SymbolTable 7 { lps_array: (Variable 7 lps_array [string] ReturnVar () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 7 string) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 7 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) compute_lps (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 string)] [] (Var 7 lps_array) Public .false. .false. () ), compute_lps_use: (Function (SymbolTable 8 { l: (Variable 8 l [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 8 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) compute_lps_use (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [compute_lps] [(Var 8 string)] [(Print (StringFormat () [(FunctionCall 6 compute_lps () [((Var 8 string))] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 8 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 8 l) Public .false. .false. () ), compute_lps_use1: (Function (SymbolTable 9 { char@char_string: (ExternalSymbol 9 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), l: (Variable 9 l [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), len_string: (ExternalSymbol 9 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), string: (Variable 9 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) compute_lps_use1 (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 string)] [(Print (FunctionCall 9 char@char_string 6 char [((Var 9 string))] (String 1 (FunctionCall 9 len_string 6 len [((Var 9 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) )] (Var 9 l) Public .false. .false. () ), len: (ExternalSymbol 6 len 2 len string_19_stdlib_string_type [] len Public ), len_string: (ExternalSymbol 6 len_string 2 len_string string_19_stdlib_string_type [] len_string Public ), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public ), padl_char_default: (Function (SymbolTable 12 { output_length: (Variable 12 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 12 res [string] ReturnVar () () Default (String 1 (StringLen (Var 12 string) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 12 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) padl_char_default (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4)] (String 1 (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 12 string) (Var 12 output_length)] [(Assignment (Var 12 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 12 string)) ((Var 12 output_length)) ((StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntrinsicElementalFunction Max [(StringLen (Var 12 string) (Integer 4) () ) (Var 12 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ) () .false. .false. )] (Var 12 res) Public .false. .false. () ), padl_char_pad_with: (Function (SymbolTable 13 { output_length: (Variable 13 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pad_with: (Variable 13 pad_with [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 13 res [string output_length] ReturnVar () () Default (String 1 (IntrinsicElementalFunction Max [(StringLen (Var 13 string) (Integer 4) () ) (Var 13 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 13 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string_length: (Variable 13 string_length [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) padl_char_pad_with (FunctionType [(String 1 () AssumedLength DescriptorString) (Integer 4) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) (FunctionParam 1 (Integer 4) () )] 0 (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 13 string) (Var 13 output_length) (Var 13 pad_with)] [] (Var 13 res) Public .false. .false. () ), padl_string_default: (Function (SymbolTable 10 { char@char_string: (ExternalSymbol 10 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), len_string: (ExternalSymbol 10 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), output_length: (Variable 10 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 10 res [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 10 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) padl_string_default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 10 string) (Var 10 output_length)] [(Assignment (Var 10 res) (StructConstructor 6 string_type [((FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 10 char@char_string 6 char [((Var 10 string))] (String 1 (FunctionCall 10 len_string 6 len [((Var 10 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () )) ((Var 10 output_length)) ((StringConstant " " (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ))] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionCall 10 char@char_string 6 char [((Var 10 string))] (String 1 (FunctionCall 10 len_string 6 len [((Var 10 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) (Integer 4) () ) (Var 10 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ) () .false. .false. )] (Var 10 res) Public .false. .false. () ), padl_string_pad_with: (Function (SymbolTable 11 { char@char_string: (ExternalSymbol 11 char@char_string 2 char_string string_19_stdlib_string_type [] char_string Private ), len_string: (ExternalSymbol 11 len_string 2 len_string string_19_stdlib_string_type [] len_string Private ), output_length: (Variable 11 output_length [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pad_with: (Variable 11 pad_with [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 11 res [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 11 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 6 string_type Source Public Required .false. .false. .false. () .false. .false. ) }) padl_string_pad_with (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [padl_char_pad_with] [(Var 11 string) (Var 11 output_length) (Var 11 pad_with)] [(Assignment (Var 11 res) (StructConstructor 6 string_type [((FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 11 char@char_string 6 char [((Var 11 string))] (String 1 (FunctionCall 11 len_string 6 len [((Var 11 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () )) ((Var 11 output_length)) ((Var 11 pad_with))] (String 1 (IntrinsicElementalFunction Max [(StringLen (FunctionCall 11 char@char_string 6 char [((Var 11 string))] (String 1 (FunctionCall 11 len_string 6 len [((Var 11 string))] (Integer 4) () () ) ExpressionLength DescriptorString) () () ) (Integer 4) () ) (Var 11 output_length)] 0 (Integer 4) () ) ExpressionLength DescriptorString) () () ))] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) () ) () .false. .false. )] (Var 11 res) Public .false. .false. () ), string_type: (ExternalSymbol 6 string_type 2 string_type string_19_stdlib_string_type [] string_type Public ) }) string_19_stdlib_strings () [string_19_stdlib_string_type string_19_stdlib_strings] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_41-d6b8ce9.json0000664000175000017500000000077215141516316026733 0ustar alastairalastair{ "basename": "asr-derived_types_41-d6b8ce9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_41.f90", "infile_hash": "7159edfcbabeaa6b15ecf1918e77a04e8513664002ea1c2d083daf22", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_41-d6b8ce9.stdout", "stdout_hash": "8a81582f8756eda2b3c19e360ed66b14dd8ec2a076d51b302f93c27f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_11-0e4b62c.stdout0000664000175000017500000001266015141516316025641 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_11: (Program (SymbolTable 2 { mystring: (Variable 2 mystring [] Local () () Default (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), teststring: (Variable 2 teststring [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_11 [] [(Assignment (Var 2 mystring) (StringConstant "This is a test" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (Var 2 teststring) (StringConstant "test" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction SubstrIndex [(Var 2 mystring) (Var 2 teststring) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "test is not found" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringFormat () [(StringConstant "test is found at index: " (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicElementalFunction SubstrIndex [(Var 2 mystring) (Var 2 teststring) (LogicalConstant .false. (Logical 4) ) (IntegerConstant 4 (Integer 4) Decimal)] 0 (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_03-02055a5.json0000664000175000017500000000100115141516316030045 0ustar alastairalastair{ "basename": "ast-program_without_line_03-02055a5", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/program_without_line_03.f90", "infile_hash": "c13c381753891f9763d89fca907d09d8b91fbeb4a75cea48bb067bd2", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_03-02055a5.stdout", "stdout_hash": "07d77481a3e5fd16c38342d0b79d66659db3518386c72f91bfb82432", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_01-3aedbb0.json0000664000175000017500000000074015141516316026050 0ustar alastairalastair{ "basename": "asr-interface_01-3aedbb0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/interface_01.f90", "infile_hash": "b3cc26ccc2bc7a873737daead40905324f4677aa4bb62d5d61c3f1f7", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-interface_01-3aedbb0.stderr", "stderr_hash": "b82b55a33db6f80c8687298540f92911fb30386f8e21b81c75ae1a15", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp3-1719443.json0000664000175000017500000000074415141516316026362 0ustar alastairalastair{ "basename": "asr_preprocess-cpp3-1719443", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/cpp3.f90", "infile_hash": "8b42a312082ab5a08623b751910516f3fa8bcc464dce36d988e4bdfe", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-cpp3-1719443.stderr", "stderr_hash": "c0b7018b71bb4510119ff690e45d7a2c7eff32436b3d6b25ef7dc105", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-write2-3444284.json0000664000175000017500000000070715141516316024463 0ustar alastairalastair{ "basename": "asr-write2-3444284", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/write2.f90", "infile_hash": "e32f4a7448b2f59536da5f9579270c896bf9d80ebadd03daccc928a1", "outfile": null, "outfile_hash": null, "stdout": "asr-write2-3444284.stdout", "stdout_hash": "aef358e55a36bc0c367c1573687447bfa4a9729b26087f2febf17957", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dfloat1-6063adb.json0000664000175000017500000000072115141516316025006 0ustar alastairalastair{ "basename": "asr-dfloat1-6063adb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dfloat1.f90", "infile_hash": "b50b81a63b232ce8b4801c6c435c827b7df71baf4217dd90f15762e4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dfloat1-6063adb.stderr", "stderr_hash": "de5d5c88ec7bf943a3b4746575d13c97cc97b9cd9b8f4c9866791a8b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/cpp-program1-5e4637e.json0000664000175000017500000000070015141516316025133 0ustar alastairalastair{ "basename": "cpp-program1-5e4637e", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/program1.f90", "infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b", "outfile": null, "outfile_hash": null, "stdout": "cpp-program1-5e4637e.stdout", "stdout_hash": "073746662932e0ce2e600c25a715615fe4b74026be4ae139ed0708aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_14-302666f.json0000664000175000017500000000076115141516316026020 0ustar alastairalastair{ "basename": "asr-intrinsics_14-302666f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_14.f90", "infile_hash": "0017e2b1ddd0667501a325653a7ff399ca299155a4493562918f53e9", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_14-302666f.stdout", "stdout_hash": "de2a848d301868503b85f7c5d822ed46646322ce3ad699320c42fbcd", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do4-f8e2956.json0000664000175000017500000000067615141516316024120 0ustar alastairalastair{ "basename": "ast-do4-f8e2956", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do4.f90", "infile_hash": "34663c8b85b65aed5d3129e8a34a70dbf48fd845aab8935fe666b75e", "outfile": null, "outfile_hash": null, "stdout": "ast-do4-f8e2956.stdout", "stdout_hash": "cddb489a5d3ec9c8d0af2a34245100a3427d4ed315f8f5dc58db17dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bindc_06-1fdaca6.stdout0000664000175000017500000003305315141516316025555 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc_06: (Program (SymbolTable 11 { c_f_pointer: (ExternalSymbol 11 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_int: (ExternalSymbol 11 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_ptr: (ExternalSymbol 11 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_int4: (ExternalSymbol 11 f_int4 2 f_int4 bindc_06_mod [] f_int4 Public ), f_int8: (ExternalSymbol 11 f_int8 2 f_int8 bindc_06_mod [] f_int8 Public ), f_logical: (ExternalSymbol 11 f_logical 2 f_logical bindc_06_mod [] f_logical Public ), f_type_c_ptr: (ExternalSymbol 11 f_type_c_ptr 2 f_type_c_ptr bindc_06_mod [] f_type_c_ptr Public ), ptr_f_type_c_ptr: (Variable 11 ptr_f_type_c_ptr [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bindc_06 [bindc_06_mod iso_c_binding] [(Print (StringFormat () [(StringConstant "f_int4: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 11 f_int4)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 11 f_int4) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StringConstant "f_int8: " (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 11 f_int8)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 11 f_int8) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 2 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(StringConstant "f_logical: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 11 f_logical)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (Var 11 f_logical) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (CPtrToPointer (Var 11 f_type_c_ptr) (Var 11 ptr_f_type_c_ptr) () () ) (Print (StringFormat () [(StringConstant "ptr_f_type_c_ptr: " (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 11 ptr_f_type_c_ptr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 11 ptr_f_type_c_ptr) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), bindc_06_mod: (Module (SymbolTable 2 { c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), f_int4: (Variable 2 f_int4 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. "c_int4" .false. .false. ), f_int8: (Variable 2 f_int8 [] Local () () Default (Integer 8) () BindC Public Required .false. .false. .false. "c_int8" .false. .false. ), f_logical: (Variable 2 f_logical [] Local () () Default (Logical 4) () BindC Public Required .false. .false. .false. "c_logical" .false. .false. ), f_type_c_ptr: (Variable 2 f_type_c_ptr [] Local () () Default (CPtr) () BindC Public Required .false. .false. .false. "c_type_c_ptr" .false. .false. ) }) bindc_06_mod () [iso_c_binding] .false. .false. .false. ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_triple-54fa485.json0000664000175000017500000000076715141516316026613 0ustar alastairalastair{ "basename": "asr-template_triple-54fa485", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_triple.f90", "infile_hash": "5d7a3ab9825f5285b40ca4edf152dc13eda9163c4892dd5a690f645b", "outfile": null, "outfile_hash": null, "stdout": "asr-template_triple-54fa485.stdout", "stdout_hash": "7cb38db1ed4a6306cf5175d4c60e344208d5ab36b0b1a97a0b9b796d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit_check-94844d9.stdout0000664000175000017500000000053315141516316031063 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-cmd_01-e172099.json0000664000175000017500000000073415141516316024376 0ustar alastairalastair{ "basename": "asr-cmd_01-e172099", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/cmd_01.f90", "infile_hash": "11c7006f168f19f99bdf735051e716724b244773d6aff7c50eb77a7f", "outfile": null, "outfile_hash": null, "stdout": "asr-cmd_01-e172099.stdout", "stdout_hash": "056be960db0a92671537926eb589ca32a20d1b377253dba30bf4742d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_03-f7a6efe.json0000664000175000017500000000101715141516316030357 0ustar alastairalastair{ "basename": "asr-operator_overloading_03-f7a6efe", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_03.f90", "infile_hash": "3340e64f6a134b16739a00f54087bb1816f1e6876ec32e6170275e19", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_03-f7a6efe.stdout", "stdout_hash": "6441d1b73e68663bd0ba24cfbde30de348bbe411f511bf94ce5d39c2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_01-dcc012a.json0000664000175000017500000000075215141516316025423 0ustar alastairalastair{ "basename": "ast_f90-case_01-dcc012a", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-case_01-dcc012a.stdout", "stdout_hash": "5d1a88408262f9ce060b4a02827cd3b0ebdce3bb954de1839d2bce89", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-common1-ee77de6.stdout0000664000175000017500000000042515141516316026160 0ustar alastairalastairprogram common1 implicit real (a-z) real :: A, B common /sample/ A, B common /c/ c, /b/ d, e, f, /c/ g, h, i(5) common x, y, z(10) A = 10 B = 20 call pass() stop end program common1 subroutine pass() real :: A, B common /sample/ A, B print *, A, B return end subroutine pass lfortran-lfortran-2f73434/tests/reference/pass_openmp-do_concurrent_01-2a6df8c.stdout0000664000175000017500000005223015141516316031022 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { _lcompilers_mlir_gpu_offloading: (Module (SymbolTable 3 { _lcompilers_doconcurrent_replacer_func: (Function (SymbolTable 4 { i: (Variable 4 i [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 4 n [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] InOut () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) _lcompilers_doconcurrent_replacer_func (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray )] () BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 i) (Var 4 n) (Var 4 x)] [(DoConcurrentLoop [((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 4 n) ())] [] [] [] [(Print (StringFormat () [(ArrayItem (Var 4 x) [(() (Var 4 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 4 x) [(() (Var 4 i) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.490000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] )] () Public .false. .false. () ) }) _lcompilers_mlir_gpu_offloading () [] .false. .false. .false. ), do_concurrent_01: (Program (SymbolTable 2 { _lcompilers_doconcurrent_replacer_func: (Function (SymbolTable 5 { i: (Variable 5 i [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 5 n [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] InOut () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) _lcompilers_doconcurrent_replacer_func (FunctionType [(Integer 4) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray )] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 i) (Var 5 n) (Var 5 x)] [] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) do_concurrent_01 [] [(Assignment (Var 2 n) (IntegerConstant 12 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (ArrayBroadcast (RealConstant 0.490000 (Real 4) ) (ArrayConstant 4 [12] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 48 [4.90000010e-01, 4.90000010e-01, 4.90000010e-01, ...., 4.90000010e-01, 4.90000010e-01, 4.90000010e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 12 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 2 _lcompilers_doconcurrent_replacer_func 2 _lcompilers_doconcurrent_replacer_func [((Var 2 i)) ((Var 2 n)) ((Var 2 x))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_03b-0778e50.json0000664000175000017500000000075615141516316025615 0ustar alastairalastair{ "basename": "asr-template_03b-0778e50", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_03b.f90", "infile_hash": "4285fa6069fdc8872b08ca46688ab8168abfe0c468a57c65818deeb6", "outfile": null, "outfile_hash": null, "stdout": "asr-template_03b-0778e50.stdout", "stdout_hash": "6fd6e45be22cf41c582413f0bb052a6fb885d2efddc0a04472fbe9fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-program3-32749e4.stdout0000664000175000017500000000135715141516316025076 0ustar alastairalastair #include #include #include #include #include float func2(float a, float b); float func1(float a, float b); // Implementations float func2(float a, float b) { float c; c = a*b; return c; } float func1(float a, float b) { float c; c = a + b; c = func2(c, c); return c; } int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); float x; float y; float z; x = 5.00000000000000000e+00; y = 2.00000000000000000e+00; z = x*y; printf("%s%s%f\n", "10.0 ==", " ", z); z = func1(x, y); printf("%s%s%f\n", "49.0 ==", " ", z); z = func2(x, y); printf("%s%s%f\n", "10.0 ==", " ", z); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-dimension_attr2-8fda690.stdout0000664000175000017500000001041715141516316027145 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f: (Variable 2 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Unspecified () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] PointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 x)] [] (Var 2 f) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-nested_external_dedup_01-90fba38.json0000664000175000017500000000102215141516316030323 0ustar alastairalastair{ "basename": "asr-nested_external_dedup_01-90fba38", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_external_dedup_01.f90", "infile_hash": "2aab29c92da224e4546714887b85dfa6883b7ba509705159b438bf9a", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_external_dedup_01-90fba38.stdout", "stdout_hash": "764bd033db65d0a27f333bfdfe033ac9c30de956d19f4a05f55829ad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface2-f4d4abc.stdout0000664000175000017500000001722115141516316031304 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fdjac1: (Function (SymbolTable 2 { fcn: (Function (SymbolTable 3 { fcn_arg_0: (Variable 3 fcn_arg_0 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), fcn_arg_1: (Variable 3 fcn_arg_1 [] Unspecified () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) fcn (FunctionType [(Integer 4) (Integer 4)] () BindC Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 fcn_arg_0) (Var 3 fcn_arg_1)] [] () Public .false. .false. () ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fdjac1 (FunctionType [(Real 4) (Integer 4) (Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 fcn) (Var 2 n) (Var 2 x) (Var 2 y)] [(SubroutineCall 2 fcn () [((Var 2 x)) ((Var 2 y))] () .false. )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_json-special_chars_json-70bba3a.stdout0000664000175000017500000001533415141516316030767 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "symtab": { "node": "SymbolTable1", "fields": { "special_chars_json": { "node": "Program", "fields": { "symtab": { "node": "SymbolTable2", "fields": {} }, "name": "special_chars_json", "dependencies": [], "body": [ { "node": "Print", "fields": { "text": { "node": "StringConstant", "fields": { "s": "A \"string\".", "type": { "node": "String", "fields": { "kind": 1, "len": { "node": "IntegerConstant", "fields": { "n": 11, "type": { "node": "Integer", "fields": { "kind": 4 }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } }, "intboz_type": "Decimal" }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } }, "len_kind": "ExpressionLength", "physical_type": "DescriptorString" }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } }, "loc": { "first": 50, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } } }, "items": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } lfortran-lfortran-2f73434/tests/reference/asr-subroutine1-b6656b7.json0000664000175000017500000000073515141516316025675 0ustar alastairalastair{ "basename": "asr-subroutine1-b6656b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/subroutine1.f90", "infile_hash": "0c76f3b9c93978c48be3b338215eb0380706f094f8d28edce0da034e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-subroutine1-b6656b7.stderr", "stderr_hash": "6023ad3e9dde6734e3fcc03d3dc361690e636daec657440736485019", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-implicit10-23a5156.json0000664000175000017500000000104415141516316025267 0ustar alastairalastair{ "basename": "asr-implicit10-23a5156", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit10.f90", "infile_hash": "f0dec4633ec4724235e11ed6642f34f24f69c6f4dc41aab5ae903cfa", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit10-23a5156.stdout", "stdout_hash": "c88b17187539dfda9b478bbb9291e6c549e3fd7226762037b09aa0a6", "stderr": "asr-implicit10-23a5156.stderr", "stderr_hash": "5e0f52ad16423091b73b5dc0c5de3f43847ef3bf23e99f74475d49f6", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_29-d4080f2.stdout0000664000175000017500000000550015141516316026446 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_29: (Program (SymbolTable 2 { random_dp: (Variable 2 random_dp [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), random_sp: (Variable 2 random_sp [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_29 [] [(IntrinsicImpureSubroutine RandomNumber [(Var 2 random_sp)] 0 ) (IntrinsicImpureSubroutine RandomNumber [(Var 2 random_dp)] 0 ) (Print (StringFormat () [(Var 2 random_sp) (Var 2 random_dp)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-bindc3-d064ff7.json0000664000175000017500000000073715141516316025025 0ustar alastairalastair{ "basename": "llvm-bindc3-d064ff7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc3.f90", "infile_hash": "d2305932b687641416dda5e45cb66123d72a7d2ca5449952e2379d3b", "outfile": null, "outfile_hash": null, "stdout": "llvm-bindc3-d064ff7.stdout", "stdout_hash": "ee5b6635fe1154321948856ef813f50a15cbb16946d55ceb1799a47d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_array_type_where_01-b613ee3.json0000664000175000017500000000102315141516316031374 0ustar alastairalastair{ "basename": "asr-incorrect_array_type_where_01-b613ee3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_array_type_where_01.f90", "infile_hash": "7405582b48138f3053960b0c529eb8efd66eb1f0ba5b64831491897a", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_array_type_where_01-b613ee3.stderr", "stderr_hash": "394bb205e8a76416975321bc38ba522a27b12c5da6cfe2bca046baf9", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/wat-expr_09-fa1b124.json0000664000175000017500000000072215141516316024744 0ustar alastairalastair{ "basename": "wat-expr_09-fa1b124", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/expr_09.f90", "infile_hash": "3b99f849ef5412d7fbc16bc164307d14964150e05dd203596a3e6dd8", "outfile": null, "outfile_hash": null, "stdout": "wat-expr_09-fa1b124.stdout", "stdout_hash": "ab04339a5ed742704119e5c3c44a4b56c0d3e6c0dc991616b8fe90fe", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent2-80c03e1.stdout0000664000175000017500000001103715141516316026675 0ustar alastairalastair(TranslationUnit [(Subroutine do_concurrent2 [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_size-352da98.stdout0000664000175000017500000005726215141516316026626 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_a: (Variable 2 size_a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), size_b: (Variable 2 size_b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01 [] [(Assignment (Var 2 size_a) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 size_b) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 size_a) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 size_b) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 size_a) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerBinOp (IntegerConstant 10 (Integer 4) Decimal) Add (Var 2 size_b) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 13 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 14 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 size_a) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 17 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 11 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_04-1467181.json0000664000175000017500000000100115141516316030000 0ustar alastairalastair{ "basename": "ast-program_without_line_04-1467181", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_04.f90", "infile_hash": "5dd71811b458116465222710dc3764ee1b6409e2319dd89a99e0bb1d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_04-1467181.stderr", "stderr_hash": "22480cef181ec588afc64592b6fa0194336dc6923ce414c93fe29239", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_06-2986f6e.stderr0000664000175000017500000000033315141516316030122 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'x'. Tried to match size 3 of dimension 1 of LHS with size 4 of dimension 1 of RHS. --> tests/errors/array_bounds_check_06.f90:10:5 | 10 | x = y | ^ lfortran-lfortran-2f73434/tests/reference/asr-implicit3-ffc1655.stdout0000664000175000017500000002524615141516316025745 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Unspecified () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Unspecified () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Real 4) (Real 4) (Complex 4) (Real 8)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 m) (Var 2 z) (Var 2 k)] [(Assignment (Var 2 n) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 8.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 k) (Cast (RealConstant 9.230000 (Real 4) ) RealToReal (Real 8) (RealConstant 9.230000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 z) (ComplexConstructor (RealConstant 1.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-select_type1-36bfefb.stdout0000664000175000017500000000764715141516316026616 0ustar alastairalastair(TranslationUnit [(Program select_type1 () [] [(ImplicitNone [] () )] [] [(SelectType 0 () uptr (FuncCallOrArray value [(iter [])] [] [] [] [] ) [(TypeStmtType (AttrType TypeInteger [] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtType (AttrType TypeReal [] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtType (AttrType TypeCharacter [(() () Star)] () () None ) () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (TypeStmtName point () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (ClassStmt point2 () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] ) (ClassDefault () [(Print 0 () [(FuncCallOrArray key [(iter [])] [] [] [] [] ) (String " = " ()) uptr] () )] )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name2-458b8c9.stdout0000664000175000017500000000026315141516316030106 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":3},"end":{"character":12,"line":3}},"uri":"tests/lookup_name2.f90"},"name":"x","filename":"tests/lookup_name2.f90"}]lfortran-lfortran-2f73434/tests/reference/run-matmul_unallocated_01-39026d3.json0000664000175000017500000000074315141516316027516 0ustar alastairalastair{ "basename": "run-matmul_unallocated_01-39026d3", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/matmul_unallocated_01.f90", "infile_hash": "69fa6b271c924d4944c45f3f5d8f6a569ff838a441c57aa9cbb649e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-matmul_unallocated_01-39026d3.stderr", "stderr_hash": "27d4b4405677d150b5b6139ca6d0e9dbc69fc26895f705955bf98a9e", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-where_03-a34eed8.stdout0000664000175000017500000010134215141516316025532 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { }) main [] [(SubroutineCall 1 where_03 () [] () .false. )] ), where_03: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) where_03 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 a) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 16 [-1.00000000e+00, -2.00000000e+00, 5.00000000e+00, 7.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Where (RealCompare (Var 2 a) Gt (Var 2 b) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 1.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [] ) (Where (RealCompare (Var 2 a) Eq (RealConstant 1.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 a) (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Where (RealCompare (Var 2 a) Eq (RealConstant 2.000000 (Real 4) ) (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) [(Assignment (Var 2 b) (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] [(Assignment (Var 2 a) (RealBinOp (RealBinOp (RealBinOp (Var 2 b) Mul (ArrayBroadcast (RealConstant 2.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [2.00000000e+00, 2.00000000e+00, 2.00000000e+00, 2.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Div (Var 2 a) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) Mul (ArrayBroadcast (RealConstant 3.000000 (Real 4) ) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 16 [3.00000000e+00, 3.00000000e+00, 3.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. )] )] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 a) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 10.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealUnaryMinus (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant -2.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 5.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 7.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 b)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-incorrect_number_args_function-1f6f6fa.stderr0000664000175000017500000000031215141516316032355 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/incorrect_number_args_function.f90:3:25 | 3 | print *, helloWorld(5.1, 2) | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-external_04-30bc1c7.json0000664000175000017500000000076515141516316025773 0ustar alastairalastair{ "basename": "llvm-external_04-30bc1c7", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_04.f90", "infile_hash": "a5c33c0669ed285af4ed4856e01d35a773adcd4be529adc807f976c5", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_04-30bc1c7.stdout", "stdout_hash": "3f79032520165bd88ba323c3f60f35ece55d55456b461dd0e387ba1e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_15b-09f8335.json0000664000175000017500000000075315141516316025454 0ustar alastairalastair{ "basename": "asr-modules_15b-09f8335", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_15b.f90", "infile_hash": "fbbd085f2ba045d9c713c3e0edf41b67cc3f20b94a53364bf3b9f51c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_15b-09f8335.stdout", "stdout_hash": "783a9b65ade21c311bce3b3a1f2b768371c1a54a6fe24a33530c2658", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-expr9-c1303f2.json0000664000175000017500000000071715141516316025124 0ustar alastairalastair{ "basename": "ast_f90-expr9-c1303f2", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr9.f90", "infile_hash": "72b98645e78d4c2860107f173940315443535270bca4d18d631ea006", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr9-c1303f2.stdout", "stdout_hash": "d6888988904544626c2adaff83ce70adc5f226e814b3c3ab8430eca7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-formatTesting-889403a.json0000664000175000017500000000071315141516316026175 0ustar alastairalastair{ "basename": "run-formatTesting-889403a", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/formatTesting.f90", "infile_hash": "fcb5d75f1257b518b8fb71e979444738eba9931484ba15fd671cb0db", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-formatTesting-889403a.stderr", "stderr_hash": "24057424695e00241a9c4cf96807eb8691d7e2e221931b4a7fef4d52", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/run-integerStringInput-16e7ff7.json0000664000175000017500000000073215141516316027361 0ustar alastairalastair{ "basename": "run-integerStringInput-16e7ff7", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integerStringInput.f90", "infile_hash": "04a4574d2a233b18a7a450ff6c9e574741495c363d9f3f355e8fcb6c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-integerStringInput-16e7ff7.stderr", "stderr_hash": "93103ec86aa429ca52c869eca8168e2a245d3dec573aec6aaf204e65", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_ifndef_01-1761667.stderr0000664000175000017500000000016515141516316032363 0ustar alastairalastairC preprocessor error: Unterminated #ifndef --> tests/errors/unterminated_ifndef_01.f90:1:1 | 1 | #ifndef a | ^ lfortran-lfortran-2f73434/tests/reference/asr-type_conflict1-5097f3a.json0000664000175000017500000000074615141516316026337 0ustar alastairalastair{ "basename": "asr-type_conflict1-5097f3a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/type_conflict1.f90", "infile_hash": "86a1bbc02900a3c4090ab3cf9b25729e2571b2d48b4591cb834512e9", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-type_conflict1-5097f3a.stderr", "stderr_hash": "c759335f4cd52da75bca7415c1ebdad62815732ec829e4cd7ab6984a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-loop_test3-f4e458f.json0000664000175000017500000000073615141516316025577 0ustar alastairalastair{ "basename": "ast-loop_test3-f4e458f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test3.f", "infile_hash": "563e057e78a555b01f0ba784adcca08cd39669ac229fc2d62af5f13a", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test3-f4e458f.stdout", "stdout_hash": "c1ea5142131bb85d6cf2b1ae1d2c458f8b43166e8d2051b323404151", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_do_loops-loop_var_use_after_loop-e26183c.stdout0000664000175000017500000006627515141516316032761 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) main [] [(Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 1 i =" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 1 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 2 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) Lt (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Print (StringConstant "if (i < 2) then" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 2 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 3 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) LtE (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 3 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (WhileLoop () (IntegerCompare (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) LtE (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "In loop 4 i = " (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) LtE (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(If () (IntegerCompare (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Exit () )] [(Print (StringConstant "i - 1 /= 3" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [] )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "After loop 4 i = " (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 i) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-real8_1-0d3012c.stdout0000664000175000017500000000050115141516316025165 0ustar alastairalastair(TranslationUnit [(Function f [] [(AttrType TypeReal [(() 8 Value)] () () None )] () () () [] [] [] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-array_01_transfer-125156e.json0000664000175000017500000000077515141516316026652 0ustar alastairalastair{ "basename": "asr-array_01_transfer-125156e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/array_01_transfer.f90", "infile_hash": "920caa9e18706045e10e552111ebbdee612fb11bdc829a77fcfa71ca", "outfile": null, "outfile_hash": null, "stdout": "asr-array_01_transfer-125156e.stdout", "stdout_hash": "d81242faddd310d90efeaa3c292355f1355bdaf87d8b723bee05fd4a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array6-fe9aa62.json0000664000175000017500000000070715141516316024756 0ustar alastairalastair{ "basename": "ast-array6-fe9aa62", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array6.f90", "infile_hash": "bd74956aa588e4b340d6de16fc0b67a51fbf31518393a6cb4e7d2901", "outfile": null, "outfile_hash": null, "stdout": "ast-array6-fe9aa62.stdout", "stdout_hash": "daf1e34e185a4b9e4e5d6e2c747b92f7a3315250c853cd8f02ff356c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_error_07a-fa85c7e.stderr0000664000175000017500000000035515141516316027601 0ustar alastairalastairsemantic error: Symbol combine is not declared in semigroup's parameters --> tests/errors/template_error_07a.f90:6:5 - 13:1 | 6 | requirement semigroup(t) | ^^^^^^^^^^^^^^^^^^^^^^^^... ... | 13 | | ...^ lfortran-lfortran-2f73434/tests/reference/ast-parsing_02-740c1e5.stdout0000664000175000017500000002546115141516316025726 0ustar alastairalastair(TranslationUnit [(Module program_parsing_02_submodule (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(complex [] [] () 1 Equal ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(true [] [] () (Logical .true.) Equal ())] () ) (Declaration (AttrType TypeLogical [] () () None ) [] [(false [] [] () (Logical .false.) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DerivedType type [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeType [] () type None ) [(SimpleAttribute AttrAllocatable )] [(types [(() () DimensionExpr)] [] () () None ())] () )] [] ) (Interface (InterfaceHeader) () [(InterfaceProc (Subroutine function [(integer) (real)] [(SimpleAttribute AttrModule )] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(integer [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(real [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Submodule program_parsing_02_submodule () program_parsing_02_module (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Procedure function [] [(SimpleAttribute AttrModule )] () [] [] [] [] [(Assignment 0 real (* 2 integer) () )] [] )] ) (Program program_parsing_02 (TriviaNode [(EndOfLine) (EndOfLine)] [] ) [(Use [] program_parsing_02_submodule [(UseSymbol complex character ) (UseSymbol function subroutine ) (UseSymbol true then ) (UseSymbol false else ) (UseSymbol type () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(integer [] [] () () None ()) (real [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () type None ) [] [(types [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 integer character (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! Thanks to https://stackoverflow.com/a/57015100/1876449" )] ) ) (Assignment 0 types (FuncCallOrArray type [] [] [(types (ArrayInitializer () () [(FuncCallOrArray type [] [] [(types (ArrayInitializer () () [(FuncCallOrArray type [] [] [] [] [] ) (FuncCallOrArray type [] [] [] [] [] ) (FuncCallOrArray type [] [] [] [] [] )] ))] [] [] ) (FuncCallOrArray type [] [] [] [] [] )] ))] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Block 0 block [] [] [(Declaration (AttrType TypeLogical [] () () None ) [] [(if [] [] () () None ())] () )] [(If 0 endif then [(Assignment 0 if then () )] [(If 0 () else [(Assignment 0 if else () )] [(Assignment 0 if (BoolOp (not (Parenthesis else )) And (not (Parenthesis if )) ) () )] () () () )] () () () ) (Print 0 () [if] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (AssociateBlock 0 associate [(logical [] [] () character Arrow ()) (complex [] [] () real Arrow ())] [(SubroutineCall 0 subroutine [] [(() logical () 0) (() complex () 0)] [] [] () ) (Print 0 () [(Parenthesis complex )] () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-test_backspace_01-cd469a1.json0000664000175000017500000000077515141516316026746 0ustar alastairalastair{ "basename": "asr-test_backspace_01-cd469a1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/test_backspace_01.f90", "infile_hash": "951cbd3df9edfd9ca3e2005dc3cc09a6f6597e6e3ad00db4e2b1edb4", "outfile": null, "outfile_hash": null, "stdout": "asr-test_backspace_01-cd469a1.stdout", "stdout_hash": "280d7e9ecab03a883752b63220f0e2c77690592fe3d88651fda875a0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bits_03-c7d2024.json0000664000175000017500000000073715141516316024646 0ustar alastairalastair{ "basename": "asr-bits_03-c7d2024", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_03.f90", "infile_hash": "cc34aad3be3fdea9a5462e9abfa5bdcfb6450d87092552dd633e7d63", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_03-c7d2024.stdout", "stdout_hash": "7bc4c09cceab6e8e06eed905db83c4cf6240e24b50b6996ecf388682", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-abort_01-7212a3d.stderr0000664000175000017500000000027115141516316025520 0ustar alastairalastairwarning: `abort` is an LFortran extension --> tests/../integration_tests/abort_01.f90:3:16 | 3 | if (.false.) call abort() | ^^^^^^^^^^^^ Use `error stop` instead lfortran-lfortran-2f73434/tests/reference/run-print_intrinsics-9b076f7.json0000664000175000017500000000071515141516316027036 0ustar alastairalastair{ "basename": "run-print_intrinsics-9b076f7", "cmd": "lfortran --no-color {infile}", "infile": "tests/print_intrinsics.f90", "infile_hash": "a18c84b05282913a620d056c8183e7e7ee364fcb4accdbc21f4d0b63", "outfile": null, "outfile_hash": null, "stdout": "run-print_intrinsics-9b076f7.stdout", "stdout_hash": "63f79d4a6797570a548e0ba7510455be2c559ac15f7602f38c9bde9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr6-a926072.json0000664000175000017500000000076415141516316027327 0ustar alastairalastair{ "basename": "pass_global_stmts-expr6-a926072", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr6.f90", "infile_hash": "722af2f789e614d9acf6975aae8260e4949a360066d5aa53a3f05944", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr6-a926072.stdout", "stdout_hash": "15d902086a05770ea04e01866c6c83d7977e695fb879ffaa06c0d76a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err3-a7ea818.stderr0000664000175000017500000000020015141516316027771 0ustar alastairalastairC preprocessor error: Argument list is not closed with ')' --> tests/errors/cpp_err3.f90:3:6 | 3 | #if f(2 < 1+2 | ^ lfortran-lfortran-2f73434/tests/reference/ast-continue_body_if_loop-406ed85.json0000664000175000017500000000077715141516316027773 0ustar alastairalastair{ "basename": "ast-continue_body_if_loop-406ed85", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/continue_body_if_loop.f", "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, "stdout": "ast-continue_body_if_loop-406ed85.stdout", "stdout_hash": "4cdc30468fe93f8116412ecdc38c76fdeb8e8f8326e500e4b9fae2d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_39-f721e16.stdout0000664000175000017500000002165315141516316026462 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_time_and_date: (Program (SymbolTable 2 { date: (Variable 2 date [] Local () () Default (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), time: (Variable 2 time [] Local () () Default (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), values: (Variable 2 values [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), zone: (Variable 2 zone [] Local () () Default (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_time_and_date [] [(IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (Var 2 time) (Var 2 zone) (Var 2 values)] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (RealConstant 1.000000 (Real 4) ) (Var 2 zone) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (Var 2 time) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (Var 2 zone) (RealConstant 1.000000 (Real 4) )] 0 ) (IntrinsicImpureSubroutine DateAndTime [(Var 2 date) (Var 2 time) (Var 2 zone) (Var 2 values)] 0 ) (IntrinsicImpureSubroutine DateAndTime [(RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) (Var 2 values)] 0 ) (Print (StringFormat (StringConstant "(a,2x,a,2x,a)" (String 1 (IntegerConstant 13 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 date) (Var 2 time) (Var 2 zone)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat (StringConstant "(8i5)" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(Var 2 values)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-dnint_args-3d72f4b.json0000664000175000017500000000073215141516316025614 0ustar alastairalastair{ "basename": "asr-dnint_args-3d72f4b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/dnint_args.f90", "infile_hash": "42430aca5c0789f759c918d3059f349331b047bc5ec628b428866496", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-dnint_args-3d72f4b.stderr", "stderr_hash": "c95bfb2fbc2094b2f71e308f5166e79619d2d3d0284f62b5425679ee", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_01-d48abaa.json0000664000175000017500000000076415141516316026504 0ustar alastairalastair{ "basename": "asr-subroutines_01-d48abaa", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_01.f90", "infile_hash": "b2e2d562bcd951782b14a4d5cfe68f5ff7db528636d556aa7ea9230e", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_01-d48abaa.stdout", "stdout_hash": "6749f30743c8e481e61e0297e7bb0d18b940ee897190e5222dd079cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-read2-7b581ec.json0000664000175000017500000000065415141516316024506 0ustar alastairalastair{ "basename": "run-read2-7b581ec", "cmd": "lfortran --no-color {infile}", "infile": "tests/read2.f90", "infile_hash": "1d82aaea9497b527bc71286e7053079e21db7085521af2c81a4e6b6e", "outfile": null, "outfile_hash": null, "stdout": "run-read2-7b581ec.stdout", "stdout_hash": "801003729b11ec29f80a99e157a4a2f617230b77221f49ca8fb4bc6c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_openmp-do_concurrent_01-2a6df8c.json0000664000175000017500000000103015141516316030441 0ustar alastairalastair{ "basename": "pass_openmp-do_concurrent_01-2a6df8c", "cmd": "lfortran --pass=openmp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/do_concurrent_01.f90", "infile_hash": "6a7684b3e2ff6bfd0e1eb6c1095feb666304732379d06a99405e0aa6", "outfile": null, "outfile_hash": null, "stdout": "pass_openmp-do_concurrent_01-2a6df8c.stdout", "stdout_hash": "35303ea48adb9561379237ed4b0e3f99a222e8f331592f4413d7ab1e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_05-fa1bde9.stdout0000664000175000017500000004771015141516316025654 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_05: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_05 [] [(Assignment (Var 2 r) (RealBinOp (RealConstant 1.000000 (Real 4) ) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealBinOp (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealBinOp (RealConstant 3.000000 (Real 4) ) Sub (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Div (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Mul (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealBinOp (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) Add (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) Mul (RealBinOp (RealConstant 3.000000 (Real 4) ) Sub (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 4.000000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4) ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (RealBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Div (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 0.500000 (Real 4) ) ) RealToInteger (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-forallloop_01-d1e2bfa.stdout0000664000175000017500000001606415141516316026646 0ustar alastairalastair(TranslationUnit [(Program forallloop_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeReal [] () () None ) [(AttrDimension [(1 10000 DimensionExpr)] )] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(scalar [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (nsize [] [] () () None ())] () )] [(Assignment 0 scalar 10 () ) (Assignment 0 nsize (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (ForAll 0 () [(ConcurrentControl i 1 nsize () )] () [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 5 () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 5 () )] () () ) (SubroutineCall 0 triad [] [(() a () 0) (() b () 0) (() scalar () 0) (() c () 0)] [] [] () ) (Print 0 () [(String "End Stream Triad" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine triad [(a) (b) (scalar) (c)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (ForAllSingle 0 () [(ConcurrentControl i 1 N () )] () (Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () ) () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/run-integer_overflow-3cf26f8.json0000664000175000017500000000105315141516316027066 0ustar alastairalastair{ "basename": "run-integer_overflow-3cf26f8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integer_overflow.f90", "infile_hash": "99aeb8a8bec3fcc69c64e299272811526c026aaa3da667aca42d6776", "outfile": null, "outfile_hash": null, "stdout": "run-integer_overflow-3cf26f8.stdout", "stdout_hash": "0731a7507e03e34666eed16f15353a2ddbb05a501e36b5e5dcbaf348", "stderr": "run-integer_overflow-3cf26f8.stderr", "stderr_hash": "a4c99417a6e12ac2dd2b0053e6fd4fb8b98d15e5cb5d5fc27eb4ae7f", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-pragma2-604d549.stdout0000664000175000017500000001007315141516316025231 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { pragma2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) pragma2 [] [(Assignment (Var 2 a) (ArrayPhysicalCast (ArrayBroadcast (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 32 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, ...., 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) FixedSizeArray SIMDArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] SIMDArray ) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/fortran-char1-046b501.json0000664000175000017500000000072015141516316025173 0ustar alastairalastair{ "basename": "fortran-char1-046b501", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/char1.f90", "infile_hash": "78e727aecb70503bac5e780ad046d418a533f576cf7b276702bb6be1", "outfile": null, "outfile_hash": null, "stdout": "fortran-char1-046b501.stdout", "stdout_hash": "1eaefda83c36dbf4f0c7e0a983f35eb52878b2f5224b88ed39cdabe4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex1-322879a.stdout0000664000175000017500000000365615141516316025441 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex1 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-integerStringInput_64-3a7e5be.json0000664000175000017500000000074315141516316027742 0ustar alastairalastair{ "basename": "run-integerStringInput_64-3a7e5be", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/integerStringInput_64.f90", "infile_hash": "f64bda10179c74236d1e5aed88b279a5fa1d47231c976efa21b29044", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-integerStringInput_64-3a7e5be.stderr", "stderr_hash": "a8801ddcef42e2cf0df91ce1df2173349f8ccd709a87344df4d3b184", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-implicit11-95f56fd.stderr0000664000175000017500000000053715141516316026012 0ustar alastairalastairstyle suggestion: Use complex(8) instead of complex*16 --> tests/implicit11.f90:2:17 | 2 | implicit complex*16 (z,i) | ^ help: write this as 'complex(8)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit11.f90:8:17 | 8 | implicit complex*16 (z,i) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr-array_01-6a86c32.stderr0000664000175000017500000000016515141516316025355 0ustar alastairalastairsemantic error: Empty array constructor is not allowed --> tests/errors/array_01.f90:5:5 | 5 | a = [] | ^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-expr7-b630493.json0000664000175000017500000000071715141516316025053 0ustar alastairalastair{ "basename": "ast_f90-expr7-b630493", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/expr7.f90", "infile_hash": "9b01fedf331316b08b35441cb9f4cb6f7808edd93b29c70e1caeea03", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-expr7-b630493.stdout", "stdout_hash": "6e75863362e53e9147fdfc66548bad38114442386f0d73f0a673409c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_05-e3b524c.stderr0000664000175000017500000000022615141516316031142 0ustar alastairalastairruntime error: Argument 1 is unallocated. --> tests/errors/scalar_allocation_check_05.f90:10:14 | 10 | print *, m1%x | ^^^^ lfortran-lfortran-2f73434/tests/reference/asr-modules3-8936416.stdout0000664000175000017500000011222615141516316025363 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure: (Module (SymbolTable 13 { toml_ordered: (ExternalSymbol 13 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ) }) tomlf_structure () [tomlf_structure_base] .true. .false. .false. ), tomlf_structure_base: (Module (SymbolTable 15 { destroy: (Function (SymbolTable 18 { self: (Variable 18 self [] InOut () () Default (StructType [] [] .false. .false. ) 15 toml_structure Source Public Required .false. .true. .false. () .false. .false. ), toml_value: (ExternalSymbol 18 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) destroy (FunctionType [(StructType [] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 18 self)] [] () Public .false. .false. () ), toml_ordered: (Struct (SymbolTable 16 { }) toml_ordered (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () 15 toml_structure ), toml_structure: (Struct (SymbolTable 17 { destroy: (StructMethodDeclaration 17 destroy () destroy 15 destroy Source .true. .false. ) }) toml_structure (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .true. [] () () ) }) tomlf_structure_base () [tomlf_type_value] .true. .false. .false. ), tomlf_type: (Module (SymbolTable 2 { destroy: (ExternalSymbol 2 destroy 4 destroy tomlf_type_array [] destroy Public ), new: (ExternalSymbol 2 new 4 new tomlf_type_array [] new Public ), new_array: (ExternalSymbol 2 new_array 4 new_array tomlf_type_array [] new_array Public ), toml_array: (ExternalSymbol 2 toml_array 4 toml_array tomlf_type_array [] toml_array Public ), toml_ordered: (ExternalSymbol 2 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 2 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type () [tomlf_type_array] .false. .false. .false. ), tomlf_type_array: (Module (SymbolTable 4 { destroy: (Function (SymbolTable 6 { 1_toml_array_list: (ExternalSymbol 6 1_toml_array_list 5 list toml_array [] list Public ), 1_toml_structure: (ExternalSymbol 6 1_toml_structure 15 toml_structure tomlf_structure_base [] toml_structure Public ), 1_toml_structure_destroy: (ExternalSymbol 6 1_toml_structure_destroy 17 destroy 1_toml_structure [] destroy Public ), 1_toml_value_key: (ExternalSymbol 6 1_toml_value_key 10 key toml_value [] key Public ), self: (Variable 6 self [] InOut () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(SubroutineCall 6 1_toml_structure_destroy () [] (StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () ) .false. ) (ExplicitDeallocate [(StructInstanceMember (Var 6 self) 6 1_toml_array_list (Allocatable (StructType [] [] .false. .false. ) ) () )] )] [] )] () Public .false. .false. () ), new: (GenericProcedure 4 new [4 new_array] Public ), new_array: (Function (SymbolTable 7 { self: (Variable 7 self [] Out () () Default (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) 4 toml_array Source Public Required .false. .false. .false. () .false. .false. ) }) new_array (FunctionType [(StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 self)] [] () Public .false. .false. () ), toml_array: (Struct (SymbolTable 5 { destroy: (StructMethodDeclaration 5 destroy () destroy 4 destroy Source .false. .false. ), list: (Variable 5 list [] Local () () Default (Allocatable (StructType [] [] .false. .false. ) ) 4 toml_ordered Source Public Required .false. .false. .false. () .false. .false. ) }) toml_array (StructType [(Allocatable (StructType [] [] .false. .false. ) )] [] .true. .false. ) [] [list] [] Source Public .false. .false. [] () 4 toml_value ), toml_ordered: (ExternalSymbol 4 toml_ordered 15 toml_ordered tomlf_structure_base [] toml_ordered Public ), toml_value: (ExternalSymbol 4 toml_value 9 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_array () [tomlf_type_value tomlf_structure tomlf_structure_base] .true. .false. .false. ), tomlf_type_value: (Module (SymbolTable 9 { destroy: (Function (SymbolTable 11 { self: (Variable 11 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 9 toml_value Source Private Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self)] [] () Private .false. .false. () ), toml_value: (Struct (SymbolTable 10 { destroy: (StructMethodDeclaration 10 destroy () destroy 9 destroy Source .true. .false. ), key: (Variable 10 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Private .false. .true. [] () () ) }) tomlf_type_value () [] .true. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-parameter_01-ee9f18c.json0000664000175000017500000000074015141516316026034 0ustar alastairalastair{ "basename": "asr-parameter_01-ee9f18c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/parameter_01.f90", "infile_hash": "8d4764b6b83f24e950d8f2709419b896803acb57091452ca32556286", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-parameter_01-ee9f18c.stderr", "stderr_hash": "2f32e2b239e5c97e091d4539c43eb798b2ed5f05625ab24110edbdd3", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_fma-fma-071ac0d.stdout0000664000175000017500000014102615141516316025572 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { _lcompilers_optimization_fma_f32: (Function (SymbolTable 3 { _lcompilers_optimization_fma_f32: (Variable 3 _lcompilers_optimization_fma_f32 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) _lcompilers_optimization_fma_f32 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 _lcompilers_optimization_fma_f32) (RealBinOp (Var 3 a) Add (RealBinOp (Var 3 b) Mul (Var 3 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 3 _lcompilers_optimization_fma_f32) Public .false. .false. () ), _lcompilers_optimization_fma_f321: (Function (SymbolTable 4 { _lcompilers_optimization_fma_f321: (Variable 4 _lcompilers_optimization_fma_f321 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) _lcompilers_optimization_fma_f321 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b) (Var 4 c)] [(Assignment (Var 4 _lcompilers_optimization_fma_f321) (RealBinOp (Var 4 a) Add (RealBinOp (Var 4 b) Mul (Var 4 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 4 _lcompilers_optimization_fma_f321) Public .false. .false. () ), _lcompilers_optimization_fma_f322: (Function (SymbolTable 6 { _lcompilers_optimization_fma_f322: (Variable 6 _lcompilers_optimization_fma_f322 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 6 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 6 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 6 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) _lcompilers_optimization_fma_f322 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 a) (Var 6 b) (Var 6 c)] [(Assignment (Var 6 _lcompilers_optimization_fma_f322) (RealBinOp (Var 6 a) Add (RealBinOp (Var 6 b) Mul (Var 6 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 6 _lcompilers_optimization_fma_f322) Public .false. .false. () ), _lcompilers_optimization_fma_f323: (Function (SymbolTable 7 { _lcompilers_optimization_fma_f323: (Variable 7 _lcompilers_optimization_fma_f323 [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 7 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 7 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 7 c [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) _lcompilers_optimization_fma_f323 (FunctionType [(Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 a) (Var 7 b) (Var 7 c)] [(Assignment (Var 7 _lcompilers_optimization_fma_f323) (RealBinOp (Var 7 a) Add (RealBinOp (Var 7 b) Mul (Var 7 c) (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 7 _lcompilers_optimization_fma_f323) Public .false. .false. () ), _lcompilers_optimization_fma_f64: (Function (SymbolTable 5 { _lcompilers_optimization_fma_f64: (Variable 5 _lcompilers_optimization_fma_f64 [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), a: (Variable 5 a [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 5 c [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) _lcompilers_optimization_fma_f64 (FunctionType [(Real 8) (Real 8) (Real 8)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 a) (Var 5 b) (Var 5 c)] [(Assignment (Var 5 _lcompilers_optimization_fma_f64) (RealBinOp (Var 5 a) Add (RealBinOp (Var 5 b) Mul (Var 5 c) (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 5 _lcompilers_optimization_fma_f64) Public .false. .false. () ), fma: (Program (SymbolTable 2 { b: (Variable 2 b [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local (RealConstant 3.140000 (Real 4) ) (RealConstant 3.140000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), s1: (Variable 2 s1 [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), s2: (Variable 2 s2 [] Local (Cast (RealConstant 2.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 2.000000 (Real 8) ) ) (RealConstant 2.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (RealConstant 4.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (Cast (RealConstant 1.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 1.000000 (Real 8) ) ) (RealConstant 1.000000 (Real 8) ) Save (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) fma [] [(Assignment (Var 2 x) (FunctionCall 1 _lcompilers_optimization_fma_f321 1 _lcompilers_optimization_fma_f321 [((FunctionCall 1 _lcompilers_optimization_fma_f32 1 _lcompilers_optimization_fma_f32 [((RealBinOp (Var 2 x) Mul (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) ) (Real 4) () )) ((RealConstant 0.500000 (Real 4) )) ((IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (Var 2 x)] 0 (Real 4) () ))] (Real 4) () () )) ((RealUnaryMinus (Var 2 x) (Real 4) () )) ((Var 2 pi))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 2 z) (FunctionCall 1 _lcompilers_optimization_fma_f64 1 _lcompilers_optimization_fma_f64 [((Var 2 s1)) ((Var 2 z)) ((Var 2 s2))] (Real 8) () () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 3.940000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 z) Sub (Cast (RealConstant 3.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 3.000000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000001 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000001 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (ArrayConstant 4 [10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 1, 1, ...., 1, 1, 1] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntrinsicElementalFunction Nint [(IntrinsicElementalFunction Sign [(RealConstant 1.000000 (Real 4) ) (FunctionCall 1 _lcompilers_optimization_fma_f322 1 _lcompilers_optimization_fma_f322 [((Var 2 r)) ((Var 2 r)) ((Var 2 r))] (Real 4) () () )] 0 (Real 4) () )] 0 (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Cast (FunctionCall 1 _lcompilers_optimization_fma_f323 1 _lcompilers_optimization_fma_f323 [((Var 2 r)) ((RealUnaryMinus (Var 2 r) (Real 4) () )) ((Var 2 r))] (Real 4) () () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout0000664000175000017500000001121415141516316031502 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f2: (Variable 2 f2 [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 f2) (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) () .false. .false. )] (Var 2 f2) Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface-68156ec.json0000664000175000017500000000102215141516316030433 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface-68156ec", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface.f90", "infile_hash": "3d73fa8cc6b2a34329665b09295d1469f049597c7ab7f0c1039e4370", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface-68156ec.stdout", "stdout_hash": "803ecf946b0cf9d7718faa28b62261b20a403182501c2da4f18b5a27", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bits_03-c7d2024.stdout0000664000175000017500000004431015141516316025212 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bits_03: (Program (SymbolTable 2 { from: (Variable 2 from [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), from8: (Variable 2 from8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), to: (Variable 2 to [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), to8: (Variable 2 to8 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) bits_03 [] [(Assignment (Var 2 from) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 to) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 from8) (IntegerConstant 10 (Integer 8) Decimal) () .false. .false. ) (Assignment (Var 2 to8) (IntegerConstant 4 (Integer 8) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 0 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 6 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 0 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 6 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 10 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 10 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 10 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 from) (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) () .false. .false. ) (Assignment (Var 2 to) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 from8) (IntegerUnaryMinus (IntegerConstant 20 (Integer 8) Decimal) (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 to8) (IntegerConstant 4 (Integer 8) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 29 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 12 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 29 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 2 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 12 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to) (IntegerConstant 29 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from) NotEq (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to) NotEq (IntegerConstant 1610612748 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (IntrinsicImpureSubroutine Mvbits [(Var 2 from8) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 to8) (IntegerConstant 29 (Integer 4) Decimal)] 0 ) (If () (IntegerCompare (Var 2 from8) NotEq (Cast (IntegerUnaryMinus (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) (IntegerConstant -20 (Integer 4) Decimal) ) IntegerToInteger (Integer 8) (IntegerConstant -20 (Integer 8) Decimal) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 to8) NotEq (IntegerConstant 1610612748 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope9-bdf4288.stdout0000664000175000017500000000106615141516316026753 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i64 0 define i64 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i64, align 8 store i64 6, i64* @x, align 4 %0 = load i64, i64* @x, align 4 store i64 %0, i64* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %1 = load i64, i64* %__lfortran_evaluate_11, align 4 ret i64 %1 } lfortran-lfortran-2f73434/tests/reference/ast_f90-format_01-fa31fe9.stdout0000664000175000017500000000536715141516316026401 0ustar alastairalastairprogram format_01 implicit none integer :: x integer :: y integer :: z 1 format(/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 2 format(/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 3 format( /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 4 format(2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5) 5 format(/) 6 format(/ ) 7 format( /) 8 format(i6, /) 9 format(i6,/) 10 format(/ , /) 121 format( /, 80A, / ) 122 format( /, 80A, /) 123 format(/, 80A, /) 124 format(/, 80A, / ) 130 format( 10X, 'keyword Input Echo - Values from input or default', / ,80A, / ) 131 format( 10X, 'keyword Input Echo - Values from input or default', / ,80A, /) 158 format( 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, 4X, 'fixup = ', I1, / ) 161 format( 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',' Mats (fastest ), Moments, Groups, Groups (slowest)' ) 162 format( 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 ) 221 format( 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) ) 306 format( 2X, I4, 6(1X, ES11.4) ) 324 format( 4(2X, ES17.10) ) 422 format( /, 4X, 'Manufactured/Computed Solutions Max Diff=', ES13.6 ) 500 format( "IARRAY =", *( I0, :, ",")) 501 format(*( I0, :, ",")) 510 format(1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5) 511 format(3/,I5) 512 format(3/) 513 format(1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7) 520 format(1X, I1, 1X, 'ISN''T', 1X, I1) 530 format(1PE12.4, I10) 540 format(I12, /, ' Dates: ', 2 (2I3, I5)) 550 format(ES12.3, ES12.3E3, G3.4, G3.4E100) 600 format(//,63x,'Internal',/, 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, '(kg/m**3)',5x,'(J/kg)' ) 610 format(71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)) 620 format((1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))) 630 format( //,' Format Number ',i4) 631 format(//,' Format Number ',i4) 640 format("Table form of A"/(2F8.2)) 650 format( 5X, 'ng= ', I4, / 5X, 'mat_opt= ', I2, / 5X, 'src_opt= ', I2, / 5X, 'scatp= ', I2 ) 660 format(' Format Number ',0PF17.8,' Ry' ) 670 format(/'xx') 680 format(/"xx") 690 format(/ "xx") 700 format(/ 'xx') 710 format(/ i5, 'x') 720 format(// i5, 'x') 730 format(//) x = 5 740 format(/1X'(',I2,')', X, A) end program format_01 lfortran-lfortran-2f73434/tests/reference/asr-nested_06-1d576ad.stdout0000664000175000017500000001725315141516316025632 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_06: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_06_a [] b Public ) }) nested_06 [nested_06_a] [(SubroutineCall 5 b () [((RealConstant 6.000000 (Real 4) ))] () .false. )] ), nested_06_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 3 x [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [(Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_06_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_30-9f519b4.stdout0000664000175000017500000012007215141516316025737 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_manifest_executable_modules_30: (Module (SymbolTable 7 { default_executable: (Function (SymbolTable 9 { 1_executable_config_main: (ExternalSymbol 9 1_executable_config_main 8 main executable_config [] main Public ), 1_executable_config_name: (ExternalSymbol 9 1_executable_config_name 8 name executable_config [] name Public ), 1_executable_config_source_dir: (ExternalSymbol 9 1_executable_config_source_dir 8 source_dir executable_config [] source_dir Public ), name: (Variable 9 name [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 9 self [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 executable_config Source Public Required .false. .false. .false. () .false. .false. ) }) default_executable (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 self) (Var 9 name)] [(Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Var 9 name) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_source_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StringConstant "app" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. ) (Assignment (StructInstanceMember (Var 9 self) 9 1_executable_config_main (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StringConstant "main.f90" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] () Public .false. .false. () ), executable_config: (Struct (SymbolTable 8 { main: (Variable 8 main [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 8 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), source_dir: (Variable 8 source_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) executable_config (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name source_dir main] [] Source Public .false. .false. [] () () ) }) fpm_manifest_executable_modules_30 () [] .true. .false. .false. ), fpm_manifest_modules_30: (Module (SymbolTable 2 { default_executable: (ExternalSymbol 2 default_executable 7 default_executable fpm_manifest_executable_modules_30 [] default_executable Public ), package_config_t: (ExternalSymbol 2 package_config_t 4 package_config_t fpm_manifest_package_modules_30 [] package_config_t Public ), package_defaults: (Function (SymbolTable 10 { 1_package_config_t_executable: (ExternalSymbol 10 1_package_config_t_executable 5 executable package_config_t [] executable Public ), 1_package_config_t_name: (ExternalSymbol 10 1_package_config_t_name 5 name package_config_t [] name Public ), package: (Variable 10 package [] InOut () () Default (StructType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 package_config_t Source Public Required .false. .false. .false. () .false. .false. ), root: (Variable 10 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) package_defaults (FunctionType [(StructType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 package) (Var 10 root)] [(Allocate [((StructInstanceMember (Var 10 package) 10 1_package_config_t_executable (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 2 default_executable () [((ArrayItem (StructInstanceMember (Var 10 package) 10 1_package_config_t_executable (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () )) ((StructInstanceMember (Var 10 package) 10 1_package_config_t_name (Allocatable (String 1 () DeferredLength DescriptorString) ) () ))] () .false. )] () Public .false. .false. () ) }) fpm_manifest_modules_30 () [fpm_manifest_package_modules_30 fpm_manifest_executable_modules_30] .false. .false. .false. ), fpm_manifest_package_modules_30: (Module (SymbolTable 4 { executable_config: (ExternalSymbol 4 executable_config 7 executable_config fpm_manifest_executable_modules_30 [] executable_config Public ), package_config_t: (Struct (SymbolTable 5 { executable: (Variable 5 executable [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 4 executable_config Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 5 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) package_config_t (StructType [(Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name executable] [] Source Public .false. .false. [] () () ) }) fpm_manifest_package_modules_30 () [fpm_manifest_executable_modules_30] .true. .false. .false. ), modules_30: (Program (SymbolTable 11 { }) modules_30 [] [(Print (StringConstant "running modules_30 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr1-03e6c2a.stdout0000664000175000017500000000074015141516316025250 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define i32 @__lfortran_evaluate_1() { .entry: %__lfortran_evaluate_11 = alloca i32, align 4 store i32 5, i32* %__lfortran_evaluate_11, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return %0 = load i32, i32* %__lfortran_evaluate_11, align 4 ret i32 %0 } lfortran-lfortran-2f73434/tests/reference/asr-array_01_transfer-125156e.stdout0000664000175000017500000001002515141516316027210 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_01_transfer: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), size: (Variable 2 size [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_01_transfer [] [(Assignment (Var 2 m) (ArrayConstant 24 [1, 0, 0, 0, 5, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(BitCast (Var 2 m) (RealConstant 1.000000 (Real 4) ) (Var 2 size) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 size))] PointerArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-call1-ae0bbbd.stdout0000664000175000017500000000507615141516316025245 0ustar alastairalastair(TranslationUnit [(Program call1 () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(callf [] [] () () None ())] () )] [(SubroutineCall 0 f [] [] [] [] () ) (SubroutineCall 0 f [] [] [] [] () ) (Assignment 0 callf 5 () ) (SubroutineCall 0 f_s [] [(() 3 () 0) (() 2 () 0)] [] [] () ) (Assignment 0 (FuncCallOrArray callf_s [] [(() 3 () 0) (() 2 () 0)] [] [] [] ) 5 () ) (SubroutineCall 0 f_s [] [(() 3 () 0) (() 2 () 0) (() (FuncCallOrArray f [] [(() (String "(" ()) () 0)] [] [] [] ) () 0)] [] [] () ) (Assignment 0 (FuncCallOrArray callf_s [] [(() 3 () 0) (() 2 () 0) (() (FuncCallOrArray f [] [(() (String "(" ()) () 0)] [] [] [] ) () 0)] [] [] [] ) 5 () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_07-2d29eab.json0000664000175000017500000000075615141516316026065 0ustar alastairalastair{ "basename": "asr-functions_07-2d29eab", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_07.f90", "infile_hash": "4688c49c3c531f9e7dafd3b6a4ef2560b6e62ef554ea9df95ed61a8a", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_07-2d29eab.stdout", "stdout_hash": "4b3acd6e9bb3c1d85d3fc781ac547d6c91f5064c7bc1737e3fa2ffa1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do2-8eeb477.stdout0000664000175000017500000000101115141516316024524 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 2 () [(GoTo 0 () 1 [] () ) (Continue 1 () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_08-23f422a.stdout0000664000175000017500000005400115141516316026262 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { function_08_a: (Module (SymbolTable 2 { }) function_08_a () [] .false. .false. .false. ), functions_08: (Program (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f_real] [(Var 4 a)] [(Assignment (Var 4 x) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .false. .false. () ), f_real: (Function (SymbolTable 5 { a: (Variable 5 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 5 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 5 a)] [(If () (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(Assignment (Var 5 b) (RealConstant 2.000000 (Real 4) ) () .false. .false. )] [(Assignment (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () ) (Real 4) () ) () .false. .false. )] )] (Var 5 b) Public .false. .false. () ), p: (Variable 3 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 3 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_08 [] [(Assignment (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 3 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-defop1-57f175e.stdout0000664000175000017500000000027415141516316025624 0ustar alastairalastairprogram defop1 ! Tests for syntax (AST) only: e = a.in.b E = A.IN.B e = b%s.op.3**4 E = B%S.OP.3**4 e = a + b.x.y**x e = x**x.x.x**x E = X**X.X.X**X e = (x.x.x.in.3)**4 end program defop1 lfortran-lfortran-2f73434/tests/reference/asr-array_04-5864f91.json0000664000175000017500000000072415141516316024761 0ustar alastairalastair{ "basename": "asr-array_04-5864f91", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_04.f90", "infile_hash": "49fb2152950af75eb4ccb7c32e09995c2b0a0d7139d2f3d795407d9b", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_04-5864f91.stderr", "stderr_hash": "0b0d34dadf8e658122e619ddd91c15de32b84d034604dd745defbf69", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent1-5fba0ee.json0000664000175000017500000000073715141516316026554 0ustar alastairalastair{ "basename": "ast-do_concurrent1-5fba0ee", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/do_concurrent1.f90", "infile_hash": "455e5c83afb64c2316e774aadd27b3dbc48f7ee10948365b50d4e90f", "outfile": null, "outfile_hash": null, "stdout": "ast-do_concurrent1-5fba0ee.stdout", "stdout_hash": "10ac626ff924b2b7921c4bceaca4993b43897e130f39d66a0d89d947", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-arrays_03_func-7271066.stdout0000664000175000017500000000065715141516316026761 0ustar alastairalastairfunction mysum(a::Array{Int32, 1})::Int32 local i::Int32 local r::Int32 r = 0 for i ∈ 1:length(a) r = r + a[i] end return r end function main() local i::Int32 local s::Int32 local x::Array{Int32, 1} for i ∈ 1:length(x) x[i] = i end s = mysum(Int32(x)) println(s) if s ≠ 55 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_2-a6145a1.stderr0000664000175000017500000007642315141516316030402 0ustar alastairalastairsyntax error: End module name does not match module name --> tests/errors/continue_compilation_2.f90:20:1 - 22:28 | 20 | module my_module | ^^^^^^^^^^^^^^^^... ... | 22 | end module wrong_module_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End subroutine name does not match subroutine name --> tests/errors/continue_compilation_2.f90:44:5 - 46:33 | 44 | subroutine my_subroutine1() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 46 | end subroutine different_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End function name does not match function name --> tests/errors/continue_compilation_2.f90:48:5 - 51:32 | 48 | function my_function() result(res) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 51 | end function not_my_function | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: End subroutine name does not match subroutine name --> tests/errors/continue_compilation_2.f90:53:5 - 55:33 | 53 | subroutine my_subroutine2() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 55 | end subroutine different_name | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ syntax error: Invalid syntax for variable initialization (try inserting '::' after the type) --> tests/errors/continue_compilation_2.f90:102:5 | 102 | integer init_x = 1 | ^^^^^^^^^^^^^^^^^^ syntax error: kind 16 is not supported yet. --> tests/errors/continue_compilation_2.f90:192:5 | 192 | real*16 :: unsupported_kind | ^^^^^^^ tokenizer error: Token '?' is not recognized --> tests/errors/continue_compilation_2.f90:198:17 | 198 | integer :: ? tokenizer_error | ^ token not recognized tokenizer error: Token '@' is not recognized in `format` statement --> tests/errors/continue_compilation_2.f90:436:21 | 436 | 100 FORMAT(A10, @) | ^ semantic error: Global name is already being used --> tests/errors/continue_compilation_2.f90:24:1 - 25:21 | 24 | subroutine myname | ^^^^^^^^^^^^^^^^^... ... | 25 | end subroutine myname | ...^^^^^^^^^^^^^^^^^^^^^ 'myname' defined here | 27 | block data myname | ^^^^^^^^^^^^^^^^^... ... | 29 | | ...^ 'myname' defined here again semantic error: Duplicate DIMENSION attribute specified --> tests/errors/continue_compilation_2.f90:35:24 | 35 | common /rowns/ rowns(209) | ^^^^^^^^^^ semantic error: Intent attribute can only be applied to procedure arguments --> tests/errors/continue_compilation_2.f90:58:18 | 58 | INTEGER, INTENT(IN) :: sub_a | ^^^^^^^^^^ semantic error: Dummy argument 'a' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'b' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Dummy argument 'c' not defined --> tests/errors/continue_compilation_2.f90:57:5 - 59:36 | 57 | SUBROUTINE faulty_subroutine(a, b, c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 59 | END SUBROUTINE faulty_subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-rank variable 'x' must not have any dimensions specified. --> tests/errors/continue_compilation_2.f90:82:20 | 82 | integer :: x(.., 5) | ^^^^^^^^ semantic error: Dummy argument 'x' not defined --> tests/errors/continue_compilation_2.f90:81:5 - 83:24 | 81 | subroutine arank(x) | ^^^^^^^^^^^^^^^^^^^... ... | 83 | end subroutine arank | ...^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Implicit typing is not allowed, enable it by using --implicit-typing --> tests/errors/continue_compilation_2.f90:97:5 - 99:49 | 97 | implicit real(a-z) | ^^^^^^^^^^^^^^^^^^... ... | 99 | ! Put declarations below without empty lines | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `parameter` attribute conflicts with `pointer` attribute --> tests/errors/continue_compilation_2.f90:100:5 | 100 | integer, pointer, parameter :: v => null() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `parameter` attribute conflicts with `allocatable` attribute --> tests/errors/continue_compilation_2.f90:101:5 | 101 | integer, allocatable, parameter :: v=1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:162:54 | 162 | integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ semantic error: `kind` argument of `int` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:164:54 | 164 | integer(8), parameter :: ar2(3) = int([1, 2, 3], [8, 8, 8]) | ^^^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/continue_compilation_2.f90:166:13 | 166 | integer(4.2) :: ifoix | ^^^ semantic error: Kind 6 is not supported for Complex --> tests/errors/continue_compilation_2.f90:168:13 | 168 | complex(6) :: iiocx | ^ semantic error: Kind 3 is not supported for Integer --> tests/errors/continue_compilation_2.f90:170:13 | 170 | integer(3) :: iifix | ^ semantic error: Kind 10 is not supported for Logical --> tests/errors/continue_compilation_2.f90:172:13 | 172 | logical(10) :: iiolx | ^^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:174:13 | 174 | complex(*) :: ksoca | ^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:176:13 | 176 | integer(*) :: ksoia | ^ semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:178:13 | 178 | logical(*) :: ksola | ^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters --> tests/errors/continue_compilation_2.f90:180:13 | 180 | integer('a') :: ksoix | ^^^ semantic error: Parameter 'kvoia' is a variable, which does not reduce to a constant expression --> tests/errors/continue_compilation_2.f90:183:10 | 183 | real(kvoia) :: kvoix | ^^^^^ semantic error: Symbol is already declared in the same scope --> tests/errors/continue_compilation_2.f90:185:16 | 185 | real(3) :: x | ^ redeclaration | 110 | integer, parameter :: x = 2 | ~~~~~ original declaration semantic error: Expected initialization expression for kind --> tests/errors/continue_compilation_2.f90:187:10 | 187 | real(*) kind2_a | ^ semantic error: Parameter attribute cannot be used with Target attribute --> tests/errors/continue_compilation_2.f90:189:5 | 189 | integer, parameter, target :: foo=4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind 16 is not supported for Real --> tests/errors/continue_compilation_2.f90:192:5 | 192 | real*16 :: unsupported_kind | ^^^^^^^ semantic error: Argument was not specified --> tests/errors/continue_compilation_2.f90:194:33 | 194 | type(Circle) :: myCircle2 = Circle() | ^^^^^^^^ Argument 'radius' not specified for circle semantic error: Keyword argument not found --> tests/errors/continue_compilation_2.f90:196:33 | 196 | type(Circle) :: myCircle3 = Circle(mykeyword=10) | ^^^^^^^^^^^^^^^^^^^^ 'mykeyword' keyword argument not found semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_2.f90:199:36 | 199 | integer, dimension(3,2) :: m = [ 1, 0, 0, 2, 4, 6 ] | ^^^^^^^^^^^^^^^^^^^^ semantic error: Assumed-rank variable 'aRank1' must be a dummy argument. --> tests/errors/continue_compilation_2.f90:215:16 | 215 | integer :: aRank1(..) | ^^^^^^^^^^ semantic error: More than one main program found --> tests/errors/continue_compilation_2.f90:92:1 - 473:11 | 92 | program continue_compilation_2 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 473 | end program | ...^^^^^^^^^^^ first main program defined here | 476 | program second_program_test | ^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 479 | end program second_program_test | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second main program defined here semantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:36:18 | 36 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Cannot assign to an intent(in) variable `y` --> tests/errors/continue_compilation_2.f90:41:9 | 41 | y = 99 | ^ semantic error: Argument `val_a` with intent(in) passed to a dummy argument with modifying intent --> tests/errors/continue_compilation_2.f90:63:20 | 63 | call sub_b(val_a) | ^^^^^ semantic error: Argument `val_a` with intent(in) passed to a dummy argument with modifying intent --> tests/errors/continue_compilation_2.f90:73:26 | 73 | res = inner_func(val_a) | ^^^^^ semantic error: Deferred-length CHARACTER variable must be allocated with a character length `character(..)` --> tests/errors/continue_compilation_2.f90:232:14 | 232 | allocate(str1(i)) | ^^^^^^^ semantic error: No custom operator exists for this expression --> tests/errors/continue_compilation_2.f90:235:15 | 235 | str_t_2 = prefix // 10 | ^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:235:5 | 235 | str_t_2 = prefix // 10 | ^^^^^^^ ^^ type mismatch (string_t and integer) semantic error: No custom operator exists for this expression --> tests/errors/continue_compilation_2.f90:236:15 | 236 | str_t_2 = prefix // str_t_1 | ^^^^^^^^^^^^^^^^^ semantic error: shape argument specified in c_f_pointer even though fptr is not an array. --> tests/errors/continue_compilation_2.f90:238:38 | 238 | call c_f_pointer(queries_1, y_1, [2]) | ^^^ semantic error: shape array passed to c_f_pointer must be of rank 1 but given rank is 2 --> tests/errors/continue_compilation_2.f90:240:38 | 240 | call c_f_pointer(queries_2, y_2, shape) | ^^^^^ semantic error: Cannot assign to a constant variable --> tests/errors/continue_compilation_2.f90:242:5 | 242 | x = 1 | ^^^^^ assignment here | 110 | integer, parameter :: x = 2 | ~~~~~ declared as constant semantic error: More actual than formal arguments in procedure call --> tests/errors/continue_compilation_2.f90:245:33 | 245 | call myCircle%calculateArea(circleArea, 12) | ^^^^^^^^^^^^^^ semantic error: Invalid argument `end` supplied --> tests/errors/continue_compilation_2.f90:247:5 | 247 | CLOSE(end=200) | ^^^^^^^^^^^^^^ semantic error: Missing actual argument 'x' in call to 'cmplx' --> tests/errors/continue_compilation_2.f90:249:14 | 249 | print *, cmplx(y = 2) ! a = cmplx(y = 2) ! does not work with continue compilation | ^^^^^^^^^^^^ semantic error: Coarrays are not supported yet --> tests/errors/continue_compilation_2.f90:255:11 | 255 | val = this_image () | ^^^^^^^^^^^^^ semantic error: Coarrays are not supported yet --> tests/errors/continue_compilation_2.f90:256:5 | 256 | call co_sum (val, result_image=1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Coarrays are not supported yet --> tests/errors/continue_compilation_2.f90:257:9 | 257 | if (this_image() == 1) then | ^^^^^^^^^^^^ semantic error: Coarrays are not supported yet --> tests/errors/continue_compilation_2.f90:261:5 | 261 | call event_query(1, 1, 1) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Operands of comparison operator are of different types --> tests/errors/continue_compilation_2.f90:265:9 | 265 | if (i > x_2) then | ^^^^^^^ semantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/continue_compilation_2.f90:269:14 | 269 | size_a = size(a_2, 1, dim=1) | ^^^^^^^^^^^^^^^^^^^ semantic error: dim has already been specified as a positional/keyword argument to size --> tests/errors/continue_compilation_2.f90:270:14 | 270 | size_a = size(a_2, dim = 1, 1) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/continue_compilation_2.f90:272:31 | 272 | size_a_2 = size(a_3, kind=kindvar, dim=1) | ^^^^^^^ semantic error: Only Integer literals or expressions which reduce to constant Integer are accepted as kind parameters. --> tests/errors/continue_compilation_2.f90:273:31 | 273 | size_a_2 = size(a_3, kind=kindvar) | ^^^^^^^ semantic error: Atomic operations are not supported yet --> tests/errors/continue_compilation_2.f90:275:5 | 275 | call atomic_add (atom[1], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Atomic operations are not supported yet --> tests/errors/continue_compilation_2.f90:276:5 | 276 | call atomic_add (atom[2], this_image()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type-spec cannot contain an asterisk for a type parameter --> tests/errors/continue_compilation_2.f90:278:14 | 278 | print *, [character(*) :: "a", "b", "ball", "cat"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Different `character` lengths 1 and 4 in array constructor --> tests/errors/continue_compilation_2.f90:280:25 | 280 | print *, ["a", "b", "ball", "cat"] | ^^^^^^ semantic error: Different `character` lengths 2 and 5 in array constructor --> tests/errors/continue_compilation_2.f90:281:27 | 281 | print *, ["a1", "b1", "ball1", "cat1"] | ^^^^^^^ semantic error: Element in `real(8)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:284:20 | 284 | print *, [x_3, [1., 2.]] | ^^^^^^^^ semantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:286:18 | 286 | print *, [1, 2.] | ^^ semantic error: Element in `integer(4)` array constructor is `real(4)` --> tests/errors/continue_compilation_2.f90:288:18 | 288 | print *, [1, [1., 2.]] | ^^^^^^^^ semantic error: Argument of intrinsic must be an integer --> tests/errors/continue_compilation_2.f90:290:14 | 290 | print *, dfloat(y_3) | ^^^^^^^^^^^ semantic error: Invalid argument type for `dim` or `mask` --> tests/errors/continue_compilation_2.f90:292:29 | 292 | print *, sum([1, 2, 3], 1.1) | ^^^ semantic error: `mask` argument to `Sum` must be a scalar or array of logical type --> tests/errors/continue_compilation_2.f90:294:32 | 294 | print *, sum([1, 2, 3], 1, 1.1) | ^^^ semantic error: `dim` argument to `Sum` must be a scalar and of integer type --> tests/errors/continue_compilation_2.f90:296:37 | 296 | print *, sum([1, 2, 3], .true., 1.1) | ^^^ semantic error: Too many arguments to call `dint` --> tests/errors/continue_compilation_2.f90:298:13 | 298 | print*, dint(1.0_8, 8) | ^^^^^^^^^^^^^^ semantic error: Too many arguments to call `dint` --> tests/errors/continue_compilation_2.f90:299:13 | 299 | if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop | ^^^^^^^^^^^^^^ semantic error: Argument 1 of dlgama must be of double precision real type --> tests/errors/continue_compilation_2.f90:301:14 | 301 | print *, dlgama(2.7) | ^^^^^^^^^^^ semantic error: Too many arguments to call `dnint` --> tests/errors/continue_compilation_2.f90:303:13 | 303 | print*, dnint(1.0_8, 8) | ^^^^^^^^^^^^^^^ semantic error: Too many arguments to call `dnint` --> tests/errors/continue_compilation_2.f90:304:13 | 304 | if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop | ^^^^^^^^^^^^^^^ semantic error: Do concurrent loop variable `j` cannot be part of local expression --> tests/errors/continue_compilation_2.f90:306:30 | 306 | do concurrent (j = 1:Ny) local(i_1, j) | ^^^^^^^^^^^^^ semantic error: Assignment to loop variable `i_2` is not allowed --> tests/errors/continue_compilation_2.f90:313:9 | 313 | i_2 = j_1 + 1 | ^^^ semantic error: Step expression (Increment) in DO loop cannot be zero --> tests/errors/continue_compilation_2.f90:319:20 | 319 | do i_2 = 1, 5, 0 | ^ semantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:323:13 | 323 | print*, dprod(4.23_8, 4.3_8) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Unexpected args, Dreal expects (complex64) as arguments --> tests/errors/continue_compilation_2.f90:326:14 | 326 | print *, dreal(a_4) | ^^^^^^^^^^ semantic error: Incorrect number of arguments passed to the 'complex' intrinsic. It accepts exactly 2 arguments. --> tests/errors/continue_compilation_2.f90:328:11 | 328 | a_5 = complex(1) | ^^^^^^^^^^ semantic error: Argument of intrinsic must be an integer --> tests/errors/continue_compilation_2.f90:330:14 | 330 | print *, float(y_4) | ^^^^^^^^^^ semantic error: Invalid argument `start` supplied --> tests/errors/continue_compilation_2.f90:332:5 | 332 | FLUSH(unit=10, start=100) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Type mismatch in argument at argument (1); passed `real(4)` to `integer(4)`. --> tests/errors/continue_compilation_2.f90:334:16 | 334 | print *, f(42.9) | ^^^^ semantic error: Argument 1 to Ichar must have length 1 --> tests/errors/continue_compilation_2.f90:336:13 | 336 | print*, ichar("okay") | ^^^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:338:14 | 338 | print *, idint(4.5) | ^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:340:14 | 340 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 1(1 and 3) --> tests/errors/continue_compilation_2.f90:343:5 | 343 | arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^ semantic error: Different shape for array assignment on dimension 3(1 and 2) --> tests/errors/continue_compilation_2.f90:347:5 | 347 | idaa2_y = idaa2_x | ^^^^^^^^^^^^^^^^^ semantic error: Shapes for operands are not conformable --> tests/errors/continue_compilation_2.f90:349:14 | 349 | print *, idlalb1_x .neqv. [.true., .true.] | ^^^^^^^^^ ^^^^^^^^^^^^^^^^ semantic error: Shapes for operands are not conformable --> tests/errors/continue_compilation_2.f90:351:14 | 351 | print *, idlalb2_x1 .neqv. idlalb2_x2 | ^^^^^^^^^^ ^^^^^^^^^^ semantic error: Incompatible ranks 2 and 1 in assignment --> tests/errors/continue_compilation_2.f90:353:5 | 353 | iraa1_arr1 = [1, 2, 3] | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Incompatible ranks 1 and 3 in assignment --> tests/errors/continue_compilation_2.f90:355:5 | 355 | iraa2_arr3 = iraa2_arr1 | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: the first array argument to `where` must be of type logical --> tests/errors/continue_compilation_2.f90:357:11 | 357 | where([1, 2, 3, 4, 5]) iatw1_b = 1 | ^^^^^^^^^^^^^^^ semantic error: the first array argument to `where` must be of type logical --> tests/errors/continue_compilation_2.f90:362:11 | 362 | where(iatw2_i1) iatw2_b = 1 | ^^^^^^^^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:366:11 | 366 | where(.true.) itw1_b = 12121 | ^^^^^^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:369:11 | 369 | where(1) itw2_b = 12121 | ^ semantic error: the argument to `where` must be an array --> tests/errors/continue_compilation_2.f90:372:11 | 372 | where(max(1.33, 2.67)) itw3_b = 12121 | ^^^^^^^^^^^^^^^ semantic error: Unexpected args, Radix expects (int) or (real) as arguments --> tests/errors/continue_compilation_2.f90:378:14 | 378 | print *, radix((2.4, 1.0)) | ^^^^^^^^^^^^^^^^^ semantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/continue_compilation_2.f90:382:14 | 382 | print *, datan2(x,y) | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions semantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/continue_compilation_2.f90:383:12 | 383 | if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions semantic error: `pos` argument of `ibclr` intrinsic must be non-negative --> tests/errors/continue_compilation_2.f90:385:14 | 385 | print *, ibclr(1, -2) | ^^^^^^^^^^^^ semantic error: Kind of all the arguments of Dshiftl must be the same --> tests/errors/continue_compilation_2.f90:387:14 | 387 | print *, dshiftl(1, 1_8, 1) | ^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ior must be the same --> tests/errors/continue_compilation_2.f90:389:14 | 389 | print *, ior(1, 1_8) | ^^^^^^^^^^^ semantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/continue_compilation_2.f90:391:14 | 391 | print *, ieor(1, 1_8) | ^^^^^^^^^^^^ semantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/continue_compilation_2.f90:393:14 | 393 | print *, hypot(1.0, 2.7_8) | ^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ior must be the same --> tests/errors/continue_compilation_2.f90:395:14 | 395 | print *, ior(intr8_x, intr8_y) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Iand must be the same --> tests/errors/continue_compilation_2.f90:397:14 | 397 | print *, iand(intr9_x, intr9_y) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Ieor must be the same --> tests/errors/continue_compilation_2.f90:399:14 | 399 | print *, ieor(intr10_x, intr10_y) | ^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Kind of all the arguments of Hypot must be the same --> tests/errors/continue_compilation_2.f90:403:14 | 403 | print *, hypot(intr11_x, intr11_y) | ^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: All arguments to max0 must be of the same type --> tests/errors/continue_compilation_2.f90:405:14 | 405 | print *, max(12, 13.94) | ^^^^^^^^^^^^^^ semantic error: All arguments to min0 must be of the same type --> tests/errors/continue_compilation_2.f90:407:14 | 407 | print *, min(12, 13.94) | ^^^^^^^^^^^^^^ semantic error: Unexpected args, Scale expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:409:14 | 409 | print *, scale([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^ semantic error: Unexpected args, SetExponent expects (real, int) as arguments --> tests/errors/continue_compilation_2.f90:411:14 | 411 | print *, set_exponent([1, 2, 3], 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Non-variable expression for `iostat` --> tests/errors/continue_compilation_2.f90:414:5 | 414 | read(ici_buffer, *, iostat=ici_ios) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: `iostat` must be scalar --> tests/errors/continue_compilation_2.f90:417:5 | 417 | read(insv_buffer, *, iostat=insv_ios(1:1)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: The SHIFT argument must be less than or equal to the of SIZE argument --> tests/errors/continue_compilation_2.f90:419:14 | 419 | print *, ishftc(10, 6, 4) | ^^^^^^^^^^^^^^^^ semantic error: The first argument of `cmplx` intrinsic is of complex type, the second argument in this case must be absent --> tests/errors/continue_compilation_2.f90:421:14 | 421 | print *, cmplx(complex_z , 1) | ^^^^^^^^^^^^^^^^^^^^ semantic error: `kind` argument of `aint` intrinsic must be a scalar --> tests/errors/continue_compilation_2.f90:423:36 | 423 | print *, aint([1.0, 2.0, 3.0], [4, 4]) | ^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:425:5 | 425 | tm1_x = "x" | ^^^^^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/continue_compilation_2.f90:427:13 | 427 | tm2_x = 5 + "x" | ^ ^^^ type mismatch (integer and string) semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:427:5 | 427 | tm2_x = 5 + "x" | ^^^^^ ^^^ type mismatch (integer and string) semantic error: Variable 'foo' is not declared --> tests/errors/continue_compilation_2.f90:429:13 | 429 | print *,foo | ^^^ 'foo' is undeclared semantic error: Variable 'mycircle' doesn't have any member named, 'mymember'. --> tests/errors/continue_compilation_2.f90:434:14 | 434 | print *, myCircle%mymember | ^^^^^^^^^^^^^^^^^ semantic error: Unequal character lengths in MERGE intrinsic --> tests/errors/continue_compilation_2.f90:438:13 | 438 | print*, merge("okay", "ok", .true.) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:440:14 | 440 | print *, idint(4.23) | ^^^^^^^^^^^ semantic error: first argument of `idint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:441:14 | 441 | print *, idint(idint_kind_mismatch) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Argument 1 to Ichar must have length 1 --> tests/errors/continue_compilation_2.f90:443:14 | 443 | print *, ichar(ichar_runtime) | ^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:445:14 | 445 | print *, dprod(dprod_1, dprod_2) | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: second argument of `dprod` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:446:14 | 446 | print *, dprod(dprod_3, dprod_2) | ^^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `idnint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:448:14 | 448 | print *, idnint(3.5) | ^^^^^^^^^^^ semantic error: first argument of `idnint` must have kind equal to 8 --> tests/errors/continue_compilation_2.f90:449:14 | 449 | print *, idnint(idnint_runtime) | ^^^^^^^^^^^^^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:451:14 | 451 | print *, ifix(4.23_8) | ^^^^^^^^^^^^ semantic error: first argument of `ifix` must have kind equal to 4 --> tests/errors/continue_compilation_2.f90:452:14 | 452 | print *, ifix(ifix_runtime) | ^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:454:14 | 454 | print *, min(.true., .false.) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:455:14 | 455 | print *, min(min_max, min_max) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:457:14 | 457 | print *, max(.true., .false.) | ^^^^^^^^^^^^^^^^^^^^ semantic error: Arguments to min0 must be of real, integer or character type --> tests/errors/continue_compilation_2.f90:458:14 | 458 | print *, max(min_max, min_max) | ^^^^^^^^^^^^^^^^^^^^^ semantic error: Argument of 'size' must be an array --> tests/errors/continue_compilation_2.f90:463:19 | 463 | print *, size(ichar_runtime) | ^^^^^^^^^^^^^ semantic error: Type mismatch in assignment, the types must be compatible --> tests/errors/continue_compilation_2.f90:464:5 | 464 | lhs = rhs | ^^^ ^^^ type mismatch (string and string[:]) semantic error: Missing actual argument 'string' in call to 'index' --> tests/errors/continue_compilation_2.f90:465:14 | 465 | print *, index( substring = 'de', back = .true. ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ semantic error: Function 'compiler_options' not found (not user defined nor intrinsic) --> tests/errors/continue_compilation_2.f90:466:14 | 466 | print *, compiler_options() | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-complex_dp_param-b21353f.stdout0000664000175000017500000001756215141516316027272 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_dp_param: (Program (SymbolTable 2 { prec1: (Variable 2 prec1 [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), prec2: (Variable 2 prec2 [] Local (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 2 u [] Local (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) ) (ComplexConstant 1.050000 1.050000 (Complex 4) ) Save (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 8) ) (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) ) (ComplexConstant 1.050000 1.050000 (Complex 8) ) Save (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local (Cast (RealConstant 0.000000 (Real 4) ) RealToComplex (Complex 8) (ComplexConstant 0.000000 0.000000 (Complex 8) ) ) (ComplexConstant 0.000000 0.000000 (Complex 8) ) Save (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex_dp_param [] [(Print (StringFormat () [(Var 2 u) (Var 2 v) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-loop_unroll_small-13135c0.stdout0000664000175000017500000003230315141516316027414 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { loop_unroll_small: (Program (SymbolTable 2 { array: (Variable 2 array [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), first: (Variable 2 first [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 2 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), print_subrout: (Function (SymbolTable 3 { x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_subrout (FunctionType [(Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) loop_unroll_small [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 first) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 last) (IntegerConstant 4 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(Assignment (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (SubroutineCall 2 print_subrout () [((Var 2 x))] () .false. )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) ()) [(Assignment (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 i) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_cmake_01-4e6752a.stdout0000664000175000017500000000033415141516316027066 0ustar alastairalastair(TranslationUnit [(Program TESTFortran () [] [] [] [(Print 0 () [(String "Hello" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-volatile_02-2beae13.stdout0000664000175000017500000000460515141516316026414 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @volatile_02.iota_2 = internal global float 5.000000e-01 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) store volatile float 5.000000e-01, float* @volatile_02.iota_2, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* @volatile_02.iota_2) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_volatile_02 FINALIZE_SYMTABLE_volatile_02: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-external4-4e8bc7b.json0000664000175000017500000000076715141516316025465 0ustar alastairalastair{ "basename": "asr-external4-4e8bc7b", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external4.f90", "infile_hash": "99ee52cdcb37892af52701838b935fa68c04ab899074299c9ffd47ba", "outfile": null, "outfile_hash": null, "stdout": "asr-external4-4e8bc7b.stdout", "stdout_hash": "12b1ca2faaee692e673817e7c2a052c7ce239fa6daa6e5f16e289862", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-case_02-cf1eb8d.stdout0000664000175000017500000003101715141516316025414 0ustar alastairalastair(TranslationUnit [(Program case_02 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(marks [] [] () () None ()) (out [] [] () () None ())] () )] [(Assignment 0 marks 81 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange 91 100 )] () [(Assignment 0 out 0 () ) (Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Assignment 0 out 1 () ) (Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Assignment 0 out 2 () ) (Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Assignment 0 out 3 () ) (Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Assignment 0 out 4 () ) (Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Assignment 0 out 5 () ) (Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Assignment 0 out 6 () ) (Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= out 1) [(ErrorStop 0 () () () )] [] () () (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! case default at the top" )] ) ) (Select 0 () marks [(CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 91 100 )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! case default in the middle" )] ) ) (Select 0 () marks [(CaseStmt [(CaseCondRange 91 100 )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 81 90 )] () [(Print 0 () [(String "Very good!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid marks" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 71 80 )] () [(Print 0 () [(String "Well done!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 61 70 )] () [(Print 0 () [(String "Not bad!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange 41 60 )] () [(Print 0 () [(String "You passed!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondRange () 40 )] () [(Print 0 () [(String "Better try again!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) () ) (Print 0 () [(String "Your marks are " ()) marks] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_37-7eba027.stdout0000664000175000017500000014367115141516316026024 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_37: (Program (SymbolTable 11 { }) modules_37 [] [(Print (StringConstant "executing modules_37" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), modules_37_fpm_backend: (Module (SymbolTable 2 { build_package: (Function (SymbolTable 9 { 1_build_target_ptr_ptr: (ExternalSymbol 9 1_build_target_ptr_ptr 6 ptr build_target_ptr [] ptr Public ), associate_block: (AssociateBlock (SymbolTable 12 { 1_build_target_t_output_dir: (ExternalSymbol 12 1_build_target_t_output_dir 7 output_dir build_target_t [] output_dir Public ), 1_string_t_s: (ExternalSymbol 12 1_string_t_s 5 s string_t [] s Public ), target: (Variable 12 target [] Local () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 12 target) (StructInstanceMember (ArrayItem (Var 9 targets) [(() (Var 9 i) ())] (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) ColMajor () ) 9 1_build_target_ptr_ptr (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) () ) ) (Assignment (StructInstanceMember (Var 9 temp) 12 1_string_t_s (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (StructInstanceMember (Var 12 target) 12 1_build_target_t_output_dir (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. ) (Assignment (Var 9 build_dirs) (ArrayConstructor [(Var 9 build_dirs) (Var 9 temp)] (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) ) () ColMajor () ) () .false. .false. )] ), build_dirs: (Variable 9 build_dirs [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 9 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 9 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), model: (Variable 9 model [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. ), targets: (Variable 9 targets [] InOut () () Default (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. ), temp: (Variable 9 temp [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_t Source Public Required .false. .false. .false. () .false. .false. ), verbose: (Variable 9 verbose [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_package (FunctionType [(Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) (StructType [] [] .true. .false. ) (Logical 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 targets) (Var 9 model) (Var 9 verbose)] [(Allocate [((Var 9 build_dirs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 9 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 9 targets) () (Integer 4) () ) ()) [(AssociateBlockCall 9 associate_block )] [] )] () Public .false. .false. () ), build_target_ptr: (Struct (SymbolTable 6 { ptr: (Variable 6 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 6 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () ), build_target_t: (Struct (SymbolTable 7 { output_dir: (Variable 7 output_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_dir] [] Source Public .false. .false. [] () () ), cmd_build: (Function (SymbolTable 10 { 1_fpm_cmd_settings_verbose: (ExternalSymbol 10 1_fpm_cmd_settings_verbose 3 verbose fpm_cmd_settings [] verbose Public ), model: (Variable 10 model [] Local () () Default (StructType [] [] .true. .false. ) 2 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. ), settings: (Variable 10 settings [] In () () Default (StructType [] [] .true. .false. ) 2 fpm_build_settings Source Public Required .false. .false. .false. () .false. .false. ), targets: (Variable 10 targets [] Local () () Default (Allocatable (Array (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 build_target_ptr Source Public Required .false. .false. .false. () .false. .false. ) }) cmd_build (FunctionType [(StructType [] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [build_package] [(Var 10 settings)] [(SubroutineCall 2 build_package () [((Var 10 targets)) ((Var 10 model)) ((StructInstanceMember (Var 10 settings) 10 1_fpm_cmd_settings_verbose (Logical 4) () ))] () .false. )] () Public .false. .false. () ), fpm_build_settings: (Struct (SymbolTable 4 { }) fpm_build_settings (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () 2 fpm_cmd_settings ), fpm_cmd_settings: (Struct (SymbolTable 3 { verbose: (Variable 3 verbose [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_cmd_settings (StructType [(Logical 4)] [] .true. .false. ) [] [verbose] [] Source Public .false. .true. [] () () ), fpm_model_t: (Struct (SymbolTable 8 { }) fpm_model_t (StructType [] [] .true. .false. ) [] [] [] Source Public .false. .false. [] () () ), string_t: (Struct (SymbolTable 5 { s: (Variable 5 s [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [s] [] Source Public .false. .false. [] () () ) }) modules_37_fpm_backend () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_sub_test-7959339.json0000664000175000017500000000077515141516316027040 0ustar alastairalastair{ "basename": "llvm-complex_sub_test-7959339", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_sub_test.f90", "infile_hash": "9f572986fbed1d55d70fd8cd6941a7aaff7a29b92b0b8eada122ac20", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_sub_test-7959339.stdout", "stdout_hash": "fed5a37d8cb62952ece2a9edfbb9b99e7710afdd494a956af988e348", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-select_type_13-f465d8c.stdout0000664000175000017500000012143215141516316027056 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %shape_class = type <{ i32 (...)**, %shape* }> %shape = type {} %string_descriptor = type <{ i8*, i64 }> %circle_class = type <{ i32 (...)**, %circle* }> %circle = type { %shape, float } %rectangle_class = type <{ i32 (...)**, %rectangle* }> %rectangle = type { %shape, float, float } @_Name_shape = private unnamed_addr constant [6 x i8] c"shape\00", align 1 @_Type_Info_shape = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_Name_shape, i32 0, i32 0) }, align 8 @_VTable_shape = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_shape to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_shape to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_shape to i8*), i8* null] }, align 8 @_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1 @_Type_Info_circle = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0), i8* bitcast ({ i8* }* @_Type_Info_shape to i8*) }, align 8 @_VTable_circle = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_circle to i8*), i8* bitcast (float (%circle_class*)* @__module_select_type_13_module_circle_area to i8*)] }, align 8 @_Name_rectangle = private unnamed_addr constant [10 x i8] c"rectangle\00", align 1 @_Type_Info_rectangle = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_Name_rectangle, i32 0, i32 0), i8* bitcast ({ i8* }* @_Type_Info_shape to i8*) }, align 8 @_VTable_rectangle = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_Type_Info_rectangle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_select_type_13_module_rectangle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_select_type_13_module_rectangle to i8*), i8* bitcast (float (%rectangle_class*)* @__module_select_type_13_module_rectangle_area to i8*)] }, align 8 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [20 x i8] c"Matched as rectangle" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([20 x i8], [20 x i8]* @string_const_data, i32 0, i32 0), i64 20 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [17 x i8] c"Matched as circle" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.1, i32 0, i32 0), i64 17 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @5 = private unnamed_addr constant [114 x i8] c"At 56:7 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @7 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @8 = private unnamed_addr constant [115 x i8] c"At 57:16 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [3 x i8] c"s1\00", align 1 @11 = private unnamed_addr constant [115 x i8] c"At 58:11 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [16 x i8] c"Matched as shape" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_const_data.3, i32 0, i32 0), i64 16 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [17 x i8] c"Matched as circle" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.5, i32 0, i32 0), i64 17 }> @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [20 x i8] c"Matched as rectangle" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([20 x i8], [20 x i8]* @string_const_data.7, i32 0, i32 0), i64 20 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @21 = private unnamed_addr constant [114 x i8] c"At 72:7 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @22 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @23 = private unnamed_addr constant [114 x i8] c"At 73:7 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.9 = private unnamed_addr constant [6 x i8] c"R4,R4\00", align 1 @25 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @26 = private unnamed_addr constant [115 x i8] c"At 74:16 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @27 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @28 = private unnamed_addr constant [115 x i8] c"At 74:22 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @31 = private unnamed_addr constant [115 x i8] c"At 75:11 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [3 x i8] c"s2\00", align 1 @35 = private unnamed_addr constant [115 x i8] c"At 76:11 of file tests/../integration_tests/select_type_13.f90\0ATried to access member of unallocated variable '%s'\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.10 = private constant [16 x i8] c"Matched as shape" @string_const.11 = private global %string_descriptor <{ i8* getelementptr inbounds ([16 x i8], [16 x i8]* @string_const_data.10, i32 0, i32 0), i64 16 }> @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_select_type_13_module_circle_area(%circle_class* %this) { .entry: %circle_area = alloca float, align 4 %0 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %1 = load %circle*, %circle** %0, align 8 %2 = getelementptr %circle, %circle* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %4 = fmul float 0x400921FA00000000, %3 %5 = getelementptr %circle_class, %circle_class* %this, i32 0, i32 1 %6 = load %circle*, %circle** %5, align 8 %7 = getelementptr %circle, %circle* %6, i32 0, i32 1 %8 = load float, float* %7, align 4 %9 = fmul float %4, %8 store float %9, float* %circle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_circle_area FINALIZE_SYMTABLE_circle_area: ; preds = %return %10 = load float, float* %circle_area, align 4 ret float %10 } define float @__module_select_type_13_module_rectangle_area(%rectangle_class* %this) { .entry: %rectangle_area = alloca float, align 4 %0 = getelementptr %rectangle_class, %rectangle_class* %this, i32 0, i32 1 %1 = load %rectangle*, %rectangle** %0, align 8 %2 = getelementptr %rectangle, %rectangle* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %4 = getelementptr %rectangle_class, %rectangle_class* %this, i32 0, i32 1 %5 = load %rectangle*, %rectangle** %4, align 8 %6 = getelementptr %rectangle, %rectangle* %5, i32 0, i32 2 %7 = load float, float* %6, align 4 %8 = fmul float %3, %7 store float %8, float* %rectangle_area, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_rectangle_area FINALIZE_SYMTABLE_rectangle_area: ; preds = %return %9 = load float, float* %rectangle_area, align 4 ret float %9 } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %s1 = alloca %shape_class*, align 8 store %shape_class* null, %shape_class** %s1, align 8 %s2 = alloca %shape_class*, align 8 store %shape_class* null, %shape_class** %s2, align 8 %2 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 4, i1 false) %3 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 16, i1 false) %4 = bitcast i8* %3 to %shape_class* store %shape_class* %4, %shape_class** %s1, align 8 %5 = load %shape_class*, %shape_class** %s1, align 8 %6 = getelementptr %shape_class, %shape_class* %5, i32 0, i32 1 %7 = bitcast i8* %2 to %shape* store %shape* %7, %shape** %6, align 8 %8 = load %shape*, %shape** %6, align 8 %9 = bitcast %shape* %8 to %circle* %10 = bitcast %shape_class* %4 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %10, align 8 %11 = getelementptr %circle, %circle* %9, i32 0, i32 1 %12 = getelementptr %circle, %circle* %9, i32 0, i32 0 %13 = alloca i1, align 1 %14 = load %shape_class*, %shape_class** %s1, align 8 %15 = ptrtoint %shape_class* %14 to i64 %16 = icmp eq i64 %15, 0 br i1 %16, label %then1, label %else then: ; preds = %ifcont br label %"~select_type_block_.start" then1: ; preds = %.entry %17 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %17, align 8 %18 = bitcast i32 (...)*** %17 to i8* %19 = call i8* @__lfortran_dynamic_cast(i8* %18, i8* bitcast ({ i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %20 = icmp ne i8* %19, null store i1 %20, i1* %13, align 1 br label %ifcont else: ; preds = %.entry %21 = bitcast %shape_class* %14 to i8* %22 = call i8* @__lfortran_dynamic_cast(i8* %21, i8* bitcast ({ i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %23 = icmp ne i8* %22, null store i1 %23, i1* %13, align 1 br label %ifcont ifcont: ; preds = %else, %then1 %24 = load i1, i1* %13, align 1 br i1 %24, label %then, label %else2 "~select_type_block_.start": ; preds = %then %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %25, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %"~select_type_block_.end" "~select_type_block_.end": ; preds = %"~select_type_block_.start" br label %"FINALIZE_SYMTABLE_~select_type_block_" "FINALIZE_SYMTABLE_~select_type_block_": ; preds = %"~select_type_block_.end" br label %ifcont17 else2: ; preds = %ifcont %26 = alloca i1, align 1 %27 = load %shape_class*, %shape_class** %s1, align 8 %28 = ptrtoint %shape_class* %27 to i64 %29 = icmp eq i64 %28, 0 br i1 %29, label %then4, label %else5 then3: ; preds = %ifcont6 br label %"~select_type_block_1.start" then4: ; preds = %else2 %30 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %30, align 8 %31 = bitcast i32 (...)*** %30 to i8* %32 = call i8* @__lfortran_dynamic_cast(i8* %31, i8* bitcast ({ i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %33 = icmp ne i8* %32, null store i1 %33, i1* %26, align 1 br label %ifcont6 else5: ; preds = %else2 %34 = bitcast %shape_class* %27 to i8* %35 = call i8* @__lfortran_dynamic_cast(i8* %34, i8* bitcast ({ i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %36 = icmp ne i8* %35, null store i1 %36, i1* %26, align 1 br label %ifcont6 ifcont6: ; preds = %else5, %then4 %37 = load i1, i1* %26, align 1 br i1 %37, label %then3, label %else16 "~select_type_block_1.start": ; preds = %then3 %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %38, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %39 = load %shape_class*, %shape_class** %s1, align 8 %40 = ptrtoint %shape_class* %39 to i64 %41 = icmp eq i64 %40, 0 br i1 %41, label %then7, label %ifcont8 then7: ; preds = %"~select_type_block_1.start" call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont8: ; preds = %"~select_type_block_1.start" %42 = getelementptr %shape_class, %shape_class* %39, i32 0, i32 1 %43 = load %shape*, %shape** %42, align 8 %44 = bitcast %shape* %43 to %circle* %45 = getelementptr %circle, %circle* %44, i32 0, i32 1 store float 1.000000e+01, float* %45, align 4 %46 = alloca i64, align 8 %47 = load %shape_class*, %shape_class** %s1, align 8 %48 = ptrtoint %shape_class* %47 to i64 %49 = icmp eq i64 %48, 0 br i1 %49, label %then9, label %ifcont10 then9: ; preds = %ifcont8 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @7, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont10: ; preds = %ifcont8 %50 = getelementptr %shape_class, %shape_class* %47, i32 0, i32 1 %51 = load %shape*, %shape** %50, align 8 %52 = bitcast %shape* %51 to %circle* %53 = getelementptr %circle, %circle* %52, i32 0, i32 1 %54 = load float, float* %53, align 4 %55 = alloca float, align 4 store float %54, float* %55, align 4 %56 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %46, i32 0, i32 0, float* %55) %57 = load i64, i64* %46, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %56, i8** %58, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %57, i64* %59, align 4 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %61 = load i8*, i8** %60, align 8 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %63 = load i64, i64* %62, align 4 %64 = trunc i64 %63 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %61, i32 %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %65 = icmp eq i8* %56, null br i1 %65, label %free_done, label %free_nonnull free_nonnull: ; preds = %ifcont10 call void @_lfortran_free(i8* %56) br label %free_done free_done: ; preds = %free_nonnull, %ifcont10 %66 = load %shape_class*, %shape_class** %s1, align 8 %67 = ptrtoint %shape_class* %66 to i64 %68 = icmp eq i64 %67, 0 br i1 %68, label %then11, label %ifcont12 then11: ; preds = %free_done call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont12: ; preds = %free_done %69 = getelementptr %shape_class, %shape_class* %66, i32 0, i32 1 %70 = load %shape*, %shape** %69, align 8 %71 = bitcast %shape* %70 to %circle* %72 = getelementptr %circle, %circle* %71, i32 0, i32 1 %73 = load float, float* %72, align 4 %74 = fcmp une float %73, 1.000000e+01 br i1 %74, label %then13, label %else14 then13: ; preds = %ifcont12 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 br label %ifcont15 ifcont15: ; preds = %else14, %then13 br label %"~select_type_block_1.end" "~select_type_block_1.end": ; preds = %ifcont15 br label %"FINALIZE_SYMTABLE_~select_type_block_1" "FINALIZE_SYMTABLE_~select_type_block_1": ; preds = %"~select_type_block_1.end" br label %ifcont17 else16: ; preds = %ifcont6 br label %"~select_type_block_2.start" "~select_type_block_2.start": ; preds = %else16 %75 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %75, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) br label %"~select_type_block_2.end" "~select_type_block_2.end": ; preds = %"~select_type_block_2.start" br label %"FINALIZE_SYMTABLE_~select_type_block_2" "FINALIZE_SYMTABLE_~select_type_block_2": ; preds = %"~select_type_block_2.end" br label %ifcont17 ifcont17: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_2", %"FINALIZE_SYMTABLE_~select_type_block_1", %"FINALIZE_SYMTABLE_~select_type_block_" %76 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %76, i8 0, i32 8, i1 false) %77 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %77, i8 0, i32 16, i1 false) %78 = bitcast i8* %77 to %shape_class* store %shape_class* %78, %shape_class** %s2, align 8 %79 = load %shape_class*, %shape_class** %s2, align 8 %80 = getelementptr %shape_class, %shape_class* %79, i32 0, i32 1 %81 = bitcast i8* %76 to %shape* store %shape* %81, %shape** %80, align 8 %82 = load %shape*, %shape** %80, align 8 %83 = bitcast %shape* %82 to %rectangle* %84 = bitcast %shape_class* %78 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_rectangle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %84, align 8 %85 = getelementptr %rectangle, %rectangle* %83, i32 0, i32 1 %86 = getelementptr %rectangle, %rectangle* %83, i32 0, i32 2 %87 = getelementptr %rectangle, %rectangle* %83, i32 0, i32 0 %88 = alloca i1, align 1 %89 = load %shape_class*, %shape_class** %s2, align 8 %90 = ptrtoint %shape_class* %89 to i64 %91 = icmp eq i64 %90, 0 br i1 %91, label %then19, label %else20 then18: ; preds = %ifcont21 br label %"~select_type_block_3.start" then19: ; preds = %ifcont17 %92 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %92, align 8 %93 = bitcast i32 (...)*** %92 to i8* %94 = call i8* @__lfortran_dynamic_cast(i8* %93, i8* bitcast ({ i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %95 = icmp ne i8* %94, null store i1 %95, i1* %88, align 1 br label %ifcont21 else20: ; preds = %ifcont17 %96 = bitcast %shape_class* %89 to i8* %97 = call i8* @__lfortran_dynamic_cast(i8* %96, i8* bitcast ({ i8*, i8* }* @_Type_Info_circle to i8*), i1 false) %98 = icmp ne i8* %97, null store i1 %98, i1* %88, align 1 br label %ifcont21 ifcont21: ; preds = %else20, %then19 %99 = load i1, i1* %88, align 1 br i1 %99, label %then18, label %else22 "~select_type_block_3.start": ; preds = %then18 %100 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* %100, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1) br label %"~select_type_block_3.end" "~select_type_block_3.end": ; preds = %"~select_type_block_3.start" br label %"FINALIZE_SYMTABLE_~select_type_block_3" "FINALIZE_SYMTABLE_~select_type_block_3": ; preds = %"~select_type_block_3.end" br label %ifcont49 else22: ; preds = %ifcont21 %101 = alloca i1, align 1 %102 = load %shape_class*, %shape_class** %s2, align 8 %103 = ptrtoint %shape_class* %102 to i64 %104 = icmp eq i64 %103, 0 br i1 %104, label %then24, label %else25 then23: ; preds = %ifcont26 br label %"~select_type_block_4.start" then24: ; preds = %else22 %105 = alloca i32 (...)**, align 8 store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %105, align 8 %106 = bitcast i32 (...)*** %105 to i8* %107 = call i8* @__lfortran_dynamic_cast(i8* %106, i8* bitcast ({ i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %108 = icmp ne i8* %107, null store i1 %108, i1* %101, align 1 br label %ifcont26 else25: ; preds = %else22 %109 = bitcast %shape_class* %102 to i8* %110 = call i8* @__lfortran_dynamic_cast(i8* %109, i8* bitcast ({ i8*, i8* }* @_Type_Info_rectangle to i8*), i1 false) %111 = icmp ne i8* %110, null store i1 %111, i1* %101, align 1 br label %ifcont26 ifcont26: ; preds = %else25, %then24 %112 = load i1, i1* %101, align 1 br i1 %112, label %then23, label %else48 "~select_type_block_4.start": ; preds = %then23 %113 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %113, i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) %114 = load %shape_class*, %shape_class** %s2, align 8 %115 = ptrtoint %shape_class* %114 to i64 %116 = icmp eq i64 %115, 0 br i1 %116, label %then27, label %ifcont28 then27: ; preds = %"~select_type_block_4.start" call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @20, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont28: ; preds = %"~select_type_block_4.start" %117 = getelementptr %shape_class, %shape_class* %114, i32 0, i32 1 %118 = load %shape*, %shape** %117, align 8 %119 = bitcast %shape* %118 to %rectangle* %120 = getelementptr %rectangle, %rectangle* %119, i32 0, i32 1 store float 5.000000e+00, float* %120, align 4 %121 = load %shape_class*, %shape_class** %s2, align 8 %122 = ptrtoint %shape_class* %121 to i64 %123 = icmp eq i64 %122, 0 br i1 %123, label %then29, label %ifcont30 then29: ; preds = %ifcont28 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont30: ; preds = %ifcont28 %124 = getelementptr %shape_class, %shape_class* %121, i32 0, i32 1 %125 = load %shape*, %shape** %124, align 8 %126 = bitcast %shape* %125 to %rectangle* %127 = getelementptr %rectangle, %rectangle* %126, i32 0, i32 2 store float 4.000000e+00, float* %127, align 4 %128 = alloca i64, align 8 %129 = load %shape_class*, %shape_class** %s2, align 8 %130 = ptrtoint %shape_class* %129 to i64 %131 = icmp eq i64 %130, 0 br i1 %131, label %then31, label %ifcont32 then31: ; preds = %ifcont30 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @26, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @25, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont32: ; preds = %ifcont30 %132 = getelementptr %shape_class, %shape_class* %129, i32 0, i32 1 %133 = load %shape*, %shape** %132, align 8 %134 = bitcast %shape* %133 to %rectangle* %135 = getelementptr %rectangle, %rectangle* %134, i32 0, i32 1 %136 = load float, float* %135, align 4 %137 = alloca float, align 4 store float %136, float* %137, align 4 %138 = load %shape_class*, %shape_class** %s2, align 8 %139 = ptrtoint %shape_class* %138 to i64 %140 = icmp eq i64 %139, 0 br i1 %140, label %then33, label %ifcont34 then33: ; preds = %ifcont32 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @28, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @27, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont34: ; preds = %ifcont32 %141 = getelementptr %shape_class, %shape_class* %138, i32 0, i32 1 %142 = load %shape*, %shape** %141, align 8 %143 = bitcast %shape* %142 to %rectangle* %144 = getelementptr %rectangle, %rectangle* %143, i32 0, i32 2 %145 = load float, float* %144, align 4 %146 = alloca float, align 4 store float %145, float* %146, align 4 %147 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info.9, i32 0, i32 0), i64* %128, i32 0, i32 0, float* %137, float* %146) %148 = load i64, i64* %128, align 4 %stringFormat_desc35 = alloca %string_descriptor, align 8 %149 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 0 store i8* %147, i8** %149, align 8 %150 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 1 store i64 %148, i64* %150, align 4 %151 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 0 %152 = load i8*, i8** %151, align 8 %153 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc35, i32 0, i32 1 %154 = load i64, i64* %153, align 4 %155 = trunc i64 %154 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* %152, i32 %155, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) %156 = icmp eq i8* %147, null br i1 %156, label %free_done37, label %free_nonnull36 free_nonnull36: ; preds = %ifcont34 call void @_lfortran_free(i8* %147) br label %free_done37 free_done37: ; preds = %free_nonnull36, %ifcont34 %157 = load %shape_class*, %shape_class** %s2, align 8 %158 = ptrtoint %shape_class* %157 to i64 %159 = icmp eq i64 %158, 0 br i1 %159, label %then38, label %ifcont39 then38: ; preds = %free_done37 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @31, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @30, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont39: ; preds = %free_done37 %160 = getelementptr %shape_class, %shape_class* %157, i32 0, i32 1 %161 = load %shape*, %shape** %160, align 8 %162 = bitcast %shape* %161 to %rectangle* %163 = getelementptr %rectangle, %rectangle* %162, i32 0, i32 1 %164 = load float, float* %163, align 4 %165 = fcmp une float %164, 5.000000e+00 br i1 %165, label %then40, label %else41 then40: ; preds = %ifcont39 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont42 else41: ; preds = %ifcont39 br label %ifcont42 ifcont42: ; preds = %else41, %then40 %166 = load %shape_class*, %shape_class** %s2, align 8 %167 = ptrtoint %shape_class* %166 to i64 %168 = icmp eq i64 %167, 0 br i1 %168, label %then43, label %ifcont44 then43: ; preds = %ifcont42 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @35, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @34, i32 0, i32 0)) call void @exit(i32 1) unreachable ifcont44: ; preds = %ifcont42 %169 = getelementptr %shape_class, %shape_class* %166, i32 0, i32 1 %170 = load %shape*, %shape** %169, align 8 %171 = bitcast %shape* %170 to %rectangle* %172 = getelementptr %rectangle, %rectangle* %171, i32 0, i32 2 %173 = load float, float* %172, align 4 %174 = fcmp une float %173, 4.000000e+00 br i1 %174, label %then45, label %else46 then45: ; preds = %ifcont44 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont47 else46: ; preds = %ifcont44 br label %ifcont47 ifcont47: ; preds = %else46, %then45 br label %"~select_type_block_4.end" "~select_type_block_4.end": ; preds = %ifcont47 br label %"FINALIZE_SYMTABLE_~select_type_block_4" "FINALIZE_SYMTABLE_~select_type_block_4": ; preds = %"~select_type_block_4.end" br label %ifcont49 else48: ; preds = %ifcont26 br label %"~select_type_block_5.start" "~select_type_block_5.start": ; preds = %else48 %175 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.11, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %175, i32 16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) br label %"~select_type_block_5.end" "~select_type_block_5.end": ; preds = %"~select_type_block_5.start" br label %"FINALIZE_SYMTABLE_~select_type_block_5" "FINALIZE_SYMTABLE_~select_type_block_5": ; preds = %"~select_type_block_5.end" br label %ifcont49 ifcont49: ; preds = %"FINALIZE_SYMTABLE_~select_type_block_5", %"FINALIZE_SYMTABLE_~select_type_block_4", %"FINALIZE_SYMTABLE_~select_type_block_3" call void @_lpython_free_argv() br label %return return: ; preds = %ifcont49 br label %FINALIZE_SYMTABLE_select_type_13 FINALIZE_SYMTABLE_select_type_13: ; preds = %return br label %Finalize_Variable_s1 Finalize_Variable_s1: ; preds = %FINALIZE_SYMTABLE_select_type_13 %176 = load %shape_class*, %shape_class** %s1, align 8 %177 = icmp ne %shape_class* %176, null br i1 %177, label %is_allocated.then, label %is_allocated.else is_allocated.then: ; preds = %Finalize_Variable_s1 %178 = getelementptr %shape_class, %shape_class* %176, i32 0, i32 1 %179 = load %shape*, %shape** %178, align 8 %180 = icmp eq %shape_class* %176, null br i1 %180, label %free_done51, label %free_nonnull50 free_nonnull50: ; preds = %is_allocated.then %181 = bitcast %shape_class* %176 to i8* call void @_lfortran_free(i8* %181) br label %free_done51 free_done51: ; preds = %free_nonnull50, %is_allocated.then br label %is_allocated.ifcont is_allocated.else: ; preds = %Finalize_Variable_s1 br label %is_allocated.ifcont is_allocated.ifcont: ; preds = %is_allocated.else, %free_done51 br label %Finalize_Variable_s2 Finalize_Variable_s2: ; preds = %is_allocated.ifcont %182 = load %shape_class*, %shape_class** %s2, align 8 %183 = icmp ne %shape_class* %182, null br i1 %183, label %is_allocated.then52, label %is_allocated.else55 is_allocated.then52: ; preds = %Finalize_Variable_s2 %184 = getelementptr %shape_class, %shape_class* %182, i32 0, i32 1 %185 = load %shape*, %shape** %184, align 8 %186 = icmp eq %shape_class* %182, null br i1 %186, label %free_done54, label %free_nonnull53 free_nonnull53: ; preds = %is_allocated.then52 %187 = bitcast %shape_class* %182 to i8* call void @_lfortran_free(i8* %187) br label %free_done54 free_done54: ; preds = %free_nonnull53, %is_allocated.then52 br label %is_allocated.ifcont56 is_allocated.else55: ; preds = %Finalize_Variable_s2 br label %is_allocated.ifcont56 is_allocated.ifcont56: ; preds = %is_allocated.else55, %free_done54 ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0 define linkonce_odr void @_copy_select_type_13_module_shape(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %shape* %3 = bitcast i8* %1 to %shape* ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_shape(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %shape_class* %4 = bitcast %shape_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_shape, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %shape_class, %shape_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 0) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 0, i1 false) %7 = bitcast i8* %6 to %shape* store %shape* %7, %shape** %5, align 8 ret void } define linkonce_odr void @_copy_select_type_13_module_circle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %circle* %3 = bitcast i8* %1 to %circle* %4 = getelementptr %circle, %circle* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %circle, %circle* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %circle, %circle* %2, i32 0, i32 0 %8 = getelementptr %circle, %circle* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_circle(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %circle_class* %4 = bitcast %circle_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %circle_class, %circle_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 4) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 4, i1 false) %7 = bitcast i8* %6 to %circle* store %circle* %7, %circle** %5, align 8 %8 = getelementptr %circle, %circle* %7, i32 0, i32 1 %9 = getelementptr %circle, %circle* %7, i32 0, i32 0 ret void } define linkonce_odr void @_copy_select_type_13_module_rectangle(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %rectangle* %3 = bitcast i8* %1 to %rectangle* %4 = getelementptr %rectangle, %rectangle* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %rectangle, %rectangle* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %rectangle, %rectangle* %2, i32 0, i32 2 %8 = load float, float* %7, align 4 %9 = getelementptr %rectangle, %rectangle* %3, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %10 = getelementptr %rectangle, %rectangle* %2, i32 0, i32 0 %11 = getelementptr %rectangle, %rectangle* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_select_type_13_module_rectangle(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %rectangle_class* %4 = bitcast %rectangle_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_rectangle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %rectangle_class, %rectangle_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 8, i1 false) %7 = bitcast i8* %6 to %rectangle* store %rectangle* %7, %rectangle** %5, align 8 %8 = getelementptr %rectangle, %rectangle* %7, i32 0, i32 1 %9 = getelementptr %rectangle, %rectangle* %7, i32 0, i32 2 %10 = getelementptr %rectangle, %rectangle* %7, i32 0, i32 0 ret void } declare i8* @__lfortran_dynamic_cast(i8*, i8*, i1) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() attributes #0 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/llvm-boz_01-def9db5.stderr0000664000175000017500000000037715141516316025451 0ustar alastairalastairwarning: BOZ literal constant with 'Z' prefix truncated to maximum 16 characters from left to fit data type --> tests/../integration_tests/boz_01.f90:12:13 | 12 | boz_5 = int(Z'2234567890abcdef1') | ^^^^^^^^^^^^^^^^^^^^ BOZ truncation lfortran-lfortran-2f73434/tests/reference/wat-types_02-48df0cb.json0000664000175000017500000000072515141516316025220 0ustar alastairalastair{ "basename": "wat-types_02-48df0cb", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "wat-types_02-48df0cb.stdout", "stdout_hash": "dd5bb6346ac6911980ea47e229beebfc73f7682c073add34af7d29f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit2-f584754.stdout0000664000175000017500000000215515141516316030011 0ustar alastairalastair(TranslationUnit [(Program main () [] [(Implicit [(ImplicitSpec (AttrType TypeComplex [] () () None ) [(LetterSpec () a ) (LetterSpec () b ) (LetterSpec () c )] )] () ) (Implicit [(ImplicitSpec (AttrType TypeCharacter [(() 4 Value)] () () None ) [(LetterSpec () k ) (LetterSpec () l )] )] () )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast-do2-1ec601e.stdout0000664000175000017500000000632115141516316024514 0ustar alastairalastair(TranslationUnit [(Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) () ) (Assignment 0 b 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 do (+ a i) () ) (Assignment 0 enddo 3 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoLoop 0 () 0 () () () () [(Assignment 0 a (+ a i) (TriviaNode [] [(Semicolon)] ) ) (Assignment 0 b 3 (TriviaNode [] [(Semicolon)] ) )] (TriviaNode [] [(Semicolon)] ) () )] [] [] ) (Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 () () () () [(Assignment 0 x 1 () )] () () )] [] [] ) (Subroutine a [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(DoLoop 0 () 0 i 1 5 () [(Assignment 0 x (+ x i) () )] () () )] [] [] ) (Subroutine a [] [] () () [] [] [] [] [(DoLoop 0 () 0 i 1 5 (u- 1) [(Assignment 0 x i () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_travel_01b-db46a56.json0000664000175000017500000000100315141516316027306 0ustar alastairalastair{ "basename": "asr-template_travel_01b-db46a56", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_travel_01b.f90", "infile_hash": "631939077e36e1bc6d2f3e96e19e4981f43579d944bacbb0fd542b69", "outfile": null, "outfile_hash": null, "stdout": "asr-template_travel_01b-db46a56.stdout", "stdout_hash": "175c0f8c78eb8cd0a89529e40c22e562768c1147f6e4350f82d65cc7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-issue532-d63b703.json0000664000175000017500000000072015141516316025145 0ustar alastairalastair{ "basename": "llvm-issue532-d63b703", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/issue532.f90", "infile_hash": "75f4785bea0a877f7a902640ffcc5d276bd955349ff3df1639d6e6b7", "outfile": null, "outfile_hash": null, "stdout": "llvm-issue532-d63b703.stdout", "stdout_hash": "63e61b590ce33122d026b68ec9b838cdcef16bec53d66a14f7008e4e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_implicit_check-62ffca3.json0000664000175000017500000000101315141516316030707 0ustar alastairalastair{ "basename": "ast-fixed_form_implicit_check-62ffca3", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit_check.f", "infile_hash": "4913776655a2aab98265358375f290eedb9b92a2ef7424536067345c", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form_implicit_check-62ffca3.stdout", "stdout_hash": "0623f030fb96bf3fd397948f5c177d108aa3a0990e6602016668cd99", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-types_12-025af39.stdout0000664000175000017500000000572515141516316025432 0ustar alastairalastair(TranslationUnit [(Program types_12 () [(Use [] iso_c_binding [(UseSymbol c_int () ) (UseSymbol c_double () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Function f [(a) (b)] [(AttrType TypeInteger [(() c_int Value)] () () None )] r () () [] [(Import [c_int c_double] ImportDefault () )] [] [(Declaration (AttrType TypeInteger [(() c_int Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() c_double Value)] () () None ) [(SimpleAttribute AttrValue ) (AttrIntent In )] [(b [] [] () () None ())] () )] [] [] [] ) )] )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/wat-wasm_unary_minus-81a29ff.json0000664000175000017500000000073015141516316027075 0ustar alastairalastair{ "basename": "wat-wasm_unary_minus-81a29ff", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_unary_minus.f90", "infile_hash": "37a1e4bd375869b0066f69a42ebd7681d5ff210b6489d1ed19d7ea9b", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_unary_minus-81a29ff.stdout", "stdout_hash": "b0a8f50bbcece95d91807549aa3108b81b7b8eca743953e847483d75", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_02_size-ab6ee62.json0000664000175000017500000000076415141516316026404 0ustar alastairalastair{ "basename": "asr-arrays_02_size-ab6ee62", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_02_size.f90", "infile_hash": "38abe88ea3a7e82aa0d9dd390578cda301e16cccabaefeaab3650c5f", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_02_size-ab6ee62.stdout", "stdout_hash": "86b6ef3cc209e8ced160d926c8d97453a29d1e42c5bc050037b363a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr1-32e30b1.json0000664000175000017500000000070415141516316024430 0ustar alastairalastair{ "basename": "ast-expr1-32e30b1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr1.f90", "infile_hash": "3c49cb3157ec3feaf0f97156e5c11dca0ffd6481c97bb1a5dffaa14f", "outfile": null, "outfile_hash": null, "stdout": "ast-expr1-32e30b1.stdout", "stdout_hash": "f557132e49ac8751a23035bac82421ab5ad2213a75f4cdfafd10b1dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_02-4e306e0.stderr0000664000175000017500000000035415141516316027115 0ustar alastairalastairsemantic error: The argument `matrix_b` in `matmul` must be of type Integer, Real or Complex if first matrix is of numeric type --> tests/errors/matrix_matmul_02.f90:5:24 | 5 | print *, matmul(b, a) | ^ lfortran-lfortran-2f73434/tests/reference/ast-parameter_01-746df62.stdout0000664000175000017500000000257415141516316026254 0ustar alastairalastair(TranslationUnit [(Program parameter_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ()) (k [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(i [] [] () 1 Equal ())] () ) (Declaration () [(SimpleAttribute AttrParameter )] [(j [] [] () 2 Equal ()) (k [] [] () 3 Equal ())] () )] [(Print 0 () [i j k] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_09-2af35ec.json0000664000175000017500000000076115141516316026240 0ustar alastairalastair{ "basename": "asr-intrinsics_09-2af35ec", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_09.f90", "infile_hash": "12c64a66c84a553de209e2227f56e1da90f0ce7e51cef682cb608cea", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_09-2af35ec.stdout", "stdout_hash": "2b2c5d94bed9db45142d6a73041423a19c36fd4af42f021e4d3f0fd1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-arrays_09-721986f.json0000664000175000017500000000076015141516316025631 0ustar alastairalastair{ "basename": "ast_f90-arrays_09-721986f", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/arrays_09.f90", "infile_hash": "4807239e4f9ca8eaee4604e98cad28c2a760cf3900a1e2018d304838", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrays_09-721986f.stdout", "stdout_hash": "e891b0d0e74e6ca48c1cb1f73d2049aff561f1fea36353cb17f1c9aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-types_10-8a81911.json0000664000175000017500000000074215141516316024774 0ustar alastairalastair{ "basename": "ast-types_10-8a81911", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_10.f90", "infile_hash": "2d1357260f2fc09e94884cf4955b12f3f35407dc0b74358b32019f36", "outfile": null, "outfile_hash": null, "stdout": "ast-types_10-8a81911.stdout", "stdout_hash": "c96bb9e0d18561beddb5d878554670fb27d7c30a97784bd252a11baa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_cmake_02-d8d8f4d.json0000664000175000017500000000112115141516316026661 0ustar alastairalastair{ "basename": "ast-program_cmake_02-d8d8f4d", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/program_cmake_02.f90", "infile_hash": "c6368d319f7abf398750ad8860849dc5cb7712f0b79c55ee54604484", "outfile": null, "outfile_hash": null, "stdout": "ast-program_cmake_02-d8d8f4d.stdout", "stdout_hash": "12f0be51f073ad641e8e9ff1439a5a97b214abb1bb21188bf9647bb9", "stderr": "ast-program_cmake_02-d8d8f4d.stderr", "stderr_hash": "46bc7510f839ce095b554c75efdcb63bad2385e910d819d7305c5465", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program3-557dbe8.stdout0000664000175000017500000004454015141516316025604 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { program3: (Program (SymbolTable 2 { func1: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func1 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [func2] [(Var 3 a) (Var 3 b)] [(Assignment (Var 3 c) (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4) () ) () .false. .false. ) (Assignment (Var 3 c) (FunctionCall 2 func2 () [((Var 3 c)) ((Var 3 c))] (Real 4) () () ) () .false. .false. )] (Var 3 c) Public .false. .false. () ), func2: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) func2 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a) (Var 4 b)] [(Assignment (Var 4 c) (RealBinOp (Var 4 a) Mul (Var 4 b) (Real 4) () ) () .false. .false. )] (Var 4 c) Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) program3 [] [(Assignment (Var 2 x) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 z) (RealBinOp (Var 2 x) Mul (Var 2 y) (Real 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "10.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "49.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "10.0 ==" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_03-1824805.json0000664000175000017500000000100515141516316027066 0ustar alastairalastair{ "basename": "ast_f90-derived_types_03-1824805", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/derived_types_03.f90", "infile_hash": "fd0a87db249f310cd20a90b39d5eb4627597acf774b62bdb8c4256c4", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_03-1824805.stdout", "stdout_hash": "8f12723d8d2fb1e4c6890b2db2487fc67677b2fe12564be64ec454b9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-real8_1-0d3012c.json0000664000175000017500000000074015141516316024621 0ustar alastairalastair{ "basename": "ast-real8_1-0d3012c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/real8_1.f", "infile_hash": "be9ee08ef54c70bc74135fbbf926577a888f76aac13a389a473443e0", "outfile": null, "outfile_hash": null, "stdout": "ast-real8_1-0d3012c.stdout", "stdout_hash": "cc6dd5bf201f435e156c3d2b2b24105dddb3c8bfbce24357c0ee2788", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-arrays_02-d2f7107.stdout0000664000175000017500000000033415141516316026234 0ustar alastairalastairprogram arrays_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a(3), b a(1) = 3._dp a(2) = 2._dp a(3) = 1._dp b = sum(a) if (abs(b - 6._dp) > 1e-12_dp) then error stop end if end program arrays_02 lfortran-lfortran-2f73434/tests/reference/ast-goto_01-d8652f5.stdout0000664000175000017500000000134315141516316025236 0ustar alastairalastair(TranslationUnit [(Program goto_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 5 () ) (GoTo 0 () 1 [] () ) (Print 1 () [a] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-incorrect_number_args_subroutine-126ac8b.stderr0000664000175000017500000000026415141516316032644 0ustar alastairalastairsemantic error: More actual than formal arguments in procedure call --> tests/errors/incorrect_number_args_subroutine.f90:3:18 | 3 | call my_func(1) | ^ lfortran-lfortran-2f73434/tests/reference/cpp-case_03-5c7be5c.stdout0000664000175000017500000000226215141516316025331 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t a=1; int32_t b=2; int32_t marks; marks = 94; if (marks >= 40 + b) { std::cout<< "Pass!"<= 40 + b) { std::cout<< "Pass!"< tests/exit1.f90:6:12 | 6 | if ( i .eq. 5 ) then | ^^^^ help: write this as '==' warning: Routine `exit` is a non-standard function --> tests/exit1.f90:7:9 | 7 | call exit(1) | ^^^^^^^^^^^^ STOP 1 lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_02-6076a0f.stdout0000664000175000017500000003361215141516316030503 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Public ), tf: (Variable 5 tf [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Public ) }) main [overload_assignment_m] [(Assignment (Var 5 tf) (IntegerConstant 0 (Integer 4) Decimal) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4) Decimal))] () .false. ) .false. .false. ) (Print (StringFormat () [(StringConstant "tf=0:" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 tf)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 5 tf) (IntegerConstant 1 (Integer 4) Decimal) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4) Decimal))] () .false. ) .false. .false. ) (Print (StringFormat () [(StringConstant "tf=1:" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 tf)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), overload_assignment_m: (Module (SymbolTable 2 { logical_gets_integer: (Function (SymbolTable 3 { i: (Variable 3 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), tf: (Variable 3 tf [] Out () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) logical_gets_integer (FunctionType [(Logical 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 tf) (Var 3 i)] [(Assignment (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) () .false. .false. )] () Private .false. .false. () ), logical_gets_integer_use: (Function (SymbolTable 4 { i: (Variable 4 i [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), tf: (Variable 4 tf [] Out () () Default (Logical 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) logical_gets_integer_use (FunctionType [(Logical 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [logical_gets_integer] [(Var 4 tf) (Var 4 i)] [(Assignment (Var 4 tf) (Var 4 i) (SubroutineCall 2 logical_gets_integer 2 ~assign [((Var 4 tf)) ((Var 4 i))] () .false. ) .false. .false. )] () Private .false. .false. () ), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public ) }) overload_assignment_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/c_target_cuda-openmp_72-c617edf.json0000664000175000017500000000100615141516316027350 0ustar alastairalastair{ "basename": "c_target_cuda-openmp_72-c617edf", "cmd": "lfortran --show-c --openmp --target-offload {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_72.f90", "infile_hash": "64bbe1fef035f476516ca9529c5898c21d8fa429b426a7ff8dee7411", "outfile": null, "outfile_hash": null, "stdout": "c_target_cuda-openmp_72-c617edf.stdout", "stdout_hash": "646ba74da9de99a7b9b462e41a25b507a39c5a1479c9c7304a0148d1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-end_function_name_not_match-92ee1a1.json0000664000175000017500000000101515141516316031164 0ustar alastairalastair{ "basename": "ast-end_function_name_not_match-92ee1a1", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/end_function_name_not_match.f90", "infile_hash": "ed621e4ffbbbee94623f8abf5905f7f11b268363b61d47ff11f9e71e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-end_function_name_not_match-92ee1a1.stderr", "stderr_hash": "55a956b2feb6a8f68ece932ff14efd3e402ce9c3105c27e31c6715b5", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-functions_16-3e10090.stdout0000664000175000017500000025245215141516316026211 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_16: (Program (SymbolTable 9 { }) functions_16 [] [(Print (StringConstant "running functions_16 program" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_utils_sort: (Module (SymbolTable 2 { compare_keys_less: (Function (SymbolTable 8 { 1_toml_key_key: (ExternalSymbol 8 1_toml_key_key 3 key toml_key [] key Public ), less: (Variable 8 less [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), lhs: (Variable 8 lhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 8 rhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ) }) compare_keys_less (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 8 lhs) (Var 8 rhs)] [(Assignment (Var 8 less) (StringCompare (StructInstanceMember (Var 8 lhs) 8 1_toml_key_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) Lt (StructInstanceMember (Var 8 rhs) 8 1_toml_key_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Logical 4) () ) () .false. .false. )] (Var 8 less) Public .false. .false. () ), compare_less: (Function (SymbolTable 4 { less: (Variable 4 less [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), lhs: (Variable 4 lhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 4 rhs [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ) }) compare_less (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 lhs) (Var 4 rhs)] [] (Var 4 less) Public .false. .false. () ), quicksort: (Function (SymbolTable 6 { high: (Variable 6 high [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 6 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), idx: (Variable 6 idx [] InOut () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), last: (Variable 6 last [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), less: (Variable 6 less [] Unspecified () () Default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) 2 compare_less Source Public Required .false. .false. .false. () .false. .false. ), list: (Variable 6 list [] InOut () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 6 low [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pivot: (Variable 6 pivot [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) quicksort (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (Integer 4) (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [swap quicksort] [(Var 6 list) (Var 6 idx) (Var 6 low) (Var 6 high) (Var 6 less)] [(If () (IntegerCompare (Var 6 low) Lt (Var 6 high) (Logical 4) () ) [(SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (IntegerBinOp (IntegerBinOp (Var 6 low) Add (Var 6 high) (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) ())] (Integer 4) ColMajor () ))] () .false. ) (Assignment (Var 6 last) (Var 6 low) () .false. .false. ) (DoLoop () ((Var 6 i) (IntegerBinOp (Var 6 low) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Var 6 high) ()) [(If () (FunctionCall 6 less () [((ArrayItem (Var 6 list) [(() (ArrayItem (Var 6 idx) [(() (Var 6 i) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () )) ((ArrayItem (Var 6 list) [(() (ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ))] (Logical 4) () () ) [(Assignment (Var 6 last) (IntegerBinOp (Var 6 last) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 last) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (Var 6 i) ())] (Integer 4) ColMajor () ))] () .false. )] [] )] [] ) (SubroutineCall 2 swap () [((ArrayItem (Var 6 idx) [(() (Var 6 low) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 idx) [(() (Var 6 last) ())] (Integer 4) ColMajor () ))] () .false. ) (Assignment (Var 6 pivot) (Var 6 last) () .false. .false. ) (SubroutineCall 2 quicksort () [((ArrayPhysicalCast (Var 6 list) DescriptorArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 idx) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((Var 6 low)) ((IntegerBinOp (Var 6 pivot) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 6 less))] () .false. ) (SubroutineCall 2 quicksort () [((ArrayPhysicalCast (Var 6 list) DescriptorArray DescriptorArray (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 6 idx) DescriptorArray DescriptorArray (Array (Integer 4) [(() ())] DescriptorArray ) () )) ((IntegerBinOp (Var 6 pivot) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 6 high)) ((Var 6 less))] () .false. )] [] )] () Public .false. .false. () ), sort: (GenericProcedure 2 sort [2 sort_keys] Public ), sort_keys: (Function (SymbolTable 5 { compare: (Variable 5 compare [] Unspecified () () Default (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. ) 2 compare_less Source Public Optional .false. .false. .false. () .false. .false. ), high: (Variable 5 high [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), idx: (Variable 5 idx [] Out () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Optional .false. .false. .false. () .false. .false. ), indexarray: (Variable 5 indexarray [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), list: (Variable 5 list [] InOut () () Default (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ), low: (Variable 5 low [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sorted: (Variable 5 sorted [] Local () () Default (Allocatable (Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_key Source Public Required .false. .false. .false. () .false. .false. ) }) sort_keys (FunctionType [(Array (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [(() ())] DescriptorArray ) (Array (Integer 4) [(() ())] DescriptorArray ) (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. )] (Logical 4) Source Interface () .false. .true. .false. .false. .false. [] .false. )] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [quicksort] [(Var 5 list) (Var 5 idx) (Var 5 compare)] [(Assignment (Var 5 low) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 5 high) (ArraySize (Var 5 list) () (Integer 4) () ) () .false. .false. ) (Assignment (Var 5 sorted) (Var 5 list) () .false. .false. ) (Allocate [((Var 5 indexarray) [((IntegerConstant 1 (Integer 4) Decimal) (Var 5 high))] () () ())] () () (ArrayConstructor [(ImpliedDoLoop [(Var 5 i)] (Var 5 i) (Var 5 low) (Var 5 high) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) ) (Assignment (Var 5 indexarray) (ArrayConstructor [(ImpliedDoLoop [(Var 5 i)] (Var 5 i) (Var 5 low) (Var 5 high) () (Integer 4) () )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) ())] DescriptorArray ) () ColMajor () ) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 5 compare)] 0 (Logical 4) () ) [(SubroutineCall 2 quicksort () [((Var 5 sorted)) ((Var 5 indexarray)) ((Var 5 low)) ((Var 5 high)) ((Var 5 compare))] () .false. )] [(SubroutineCall 2 quicksort () [((Var 5 sorted)) ((Var 5 indexarray)) ((Var 5 low)) ((Var 5 high)) ((Var 2 compare_keys_less))] () .false. )] ) (DoLoop () ((Var 5 i) (Var 5 low) (Var 5 high) ()) [(Assignment (ArrayItem (Var 5 list) [(() (Var 5 i) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) (ArrayItem (Var 5 sorted) [(() (ArrayItem (Var 5 indexarray) [(() (Var 5 i) ())] (Integer 4) ColMajor () ) ())] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ColMajor () ) () .false. .false. )] [] ) (If () (IntrinsicElementalFunction Present [(Var 5 idx)] 0 (Logical 4) () ) [(Assignment (Var 5 idx) (Var 5 indexarray) () .false. .false. )] [] )] () Public .false. .false. () ), swap: (Function (SymbolTable 7 { lhs: (Variable 7 lhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 7 rhs [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 7 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 7 lhs) (Var 7 rhs)] [(Assignment (Var 7 tmp) (Var 7 lhs) () .false. .false. ) (Assignment (Var 7 lhs) (Var 7 rhs) () .false. .false. ) (Assignment (Var 7 rhs) (Var 7 tmp) () .false. .false. )] () Public .false. .false. () ), toml_key: (Struct (SymbolTable 3 { key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_key (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .false. [] () () ) }) tomlf_utils_sort () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr4-eea496b.stdout0000664000175000017500000002575315141516316030130 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { f1: (Variable 2 f1 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f2: (Variable 2 f2 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f3: (Variable 2 f3 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f4: (Variable 2 f4 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f5: (Variable 2 f5 [] Local () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ), f6: (Variable 2 f6 [] ReturnVar () () Default (Real 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Real 4) BindC Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 f1) (RealConstant 5.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 f2) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f3) (RealBinOp (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 16.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f4) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealBinOp (RealConstant 3.000000 (Real 4) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 6.000000 (Real 4) ) ) (Real 4) (RealConstant 11.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f5) (RealBinOp (RealConstant 5.000000 (Real 4) ) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f6) (RealBinOp (RealConstant 4.000000 (Real 4) ) Pow (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 64.000000 (Real 4) ) ) () .false. .false. )] (Var 2 f6) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope2-ccffd68.stdout0000664000175000017500000000056615141516316027112 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 define void @__lfortran_evaluate_1() { .entry: store i32 6, i32* @x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE___lfortran_evaluate_1 FINALIZE_SYMTABLE___lfortran_evaluate_1: ; preds = %return ret void } lfortran-lfortran-2f73434/tests/reference/ast-flush1-09001c8.json0000664000175000017500000000070715141516316024523 0ustar alastairalastair{ "basename": "ast-flush1-09001c8", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/flush1.f90", "infile_hash": "d0c80e1628d5fabcef4bf73ec7d228e08c9d37462c1a3bd0f08481d8", "outfile": null, "outfile_hash": null, "stdout": "ast-flush1-09001c8.stdout", "stdout_hash": "2045fc9cd6982df66c26cfbe2b337b178bd56ad1a4e41cc046a1a9c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-if1-6e771a0.json0000664000175000017500000000067615141516316024073 0ustar alastairalastair{ "basename": "ast-if1-6e771a0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/if1.f90", "infile_hash": "52db0c880c11effc03c530998302e40daa23a4e191ee0dbf7fa5e631", "outfile": null, "outfile_hash": null, "stdout": "ast-if1-6e771a0.stdout", "stdout_hash": "e0dc93841af8e1d643b47ec33ebb031ad3c1d0e17ba99e1ae74daf52", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_size_03-2036e61.json0000664000175000017500000000074315141516316025773 0ustar alastairalastair{ "basename": "asr-array_size_03-2036e61", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_03.f90", "infile_hash": "c8aac4225eeacbe1b0711e3af2f53ef4624804ff72cf20a07779f4bc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_03-2036e61.stderr", "stderr_hash": "fc87c40d48513d8d37fa98067ac320488d5263a4a66ff6c16723f484", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-block_02-82f9e5f.json0000664000175000017500000000106115141516316025072 0ustar alastairalastair{ "basename": "ast-block_02-82f9e5f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/block_02.f90", "infile_hash": "454b633240fa00d44de1b5374429d3d7edc1c37ccd92b8b93394d639", "outfile": null, "outfile_hash": null, "stdout": "ast-block_02-82f9e5f.stdout", "stdout_hash": "45b1d45576c28eacf2c4b9ef1ae02297750db8b8b742647b258304bf", "stderr": "ast-block_02-82f9e5f.stderr", "stderr_hash": "60488b7fcd202fd28a9fb7045091257667eed65fe1dec8040b9c2871", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_11-13a7587.json0000664000175000017500000000076115141516316026020 0ustar alastairalastair{ "basename": "asr-intrinsics_11-13a7587", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_11.f90", "infile_hash": "22ac1dd1527a39d35236a50e3b1afe37ab40b0970f22d259a077800f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_11-13a7587.stdout", "stdout_hash": "eafa9b7c13de579a23da113a96f0c48c2aaa35ec38c067b3809bab11", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_06-d802f54.json0000664000175000017500000000075415141516316026601 0ustar alastairalastair{ "basename": "asr-matrix_matmul_06-d802f54", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_06.f90", "infile_hash": "2ac4617ccffd9a39c1e70decb9c881861ed47f75310858ee3ca5a034", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_06-d802f54.stderr", "stderr_hash": "fd2fe4cf726c194ebbd4c2a605a139b49c3b1fc1dd4b80500ee6fad1", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-global_scope1-b0a630a.stdout0000664000175000017500000000011015141516316026703 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @x = global i32 0 lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit2-4d3e56c.json0000664000175000017500000000104315141516316027560 0ustar alastairalastair{ "basename": "asr-fixed_form_implicit2-4d3e56c", "cmd": "lfortran --fixed-form --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/fixed_form_implicit2.f", "infile_hash": "5300a387c8af9f01e109d5c3f7a9d8aa452020178f6e388e4bfcbce9", "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_implicit2-4d3e56c.stdout", "stdout_hash": "f5db4bb18322b5946f9b1b07708d5aa93abb8f40b7505b8050412bed", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-real_dp_param-bac42bc.json0000664000175000017500000000076415141516316026571 0ustar alastairalastair{ "basename": "llvm-real_dp_param-bac42bc", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/real_dp_param.f90", "infile_hash": "c3f349aae44d8efd8afc0b6bd017d9fdc88a0e652d6f7b3c35622828", "outfile": null, "outfile_hash": null, "stdout": "llvm-real_dp_param-bac42bc.stdout", "stdout_hash": "07870ff682c0bdfcd68cbd14b29770e728ff8ccbe2acfd275adb8471", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external2-e21d7a5.json0000664000175000017500000000076715141516316025375 0ustar alastairalastair{ "basename": "asr-external2-e21d7a5", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external2.f90", "infile_hash": "dfe22f031dc3f7982626b0de475e61ab3c4ffd0ecc03aa05e86937a7", "outfile": null, "outfile_hash": null, "stdout": "asr-external2-e21d7a5.stdout", "stdout_hash": "e24c93070ef9ab3e1d6a887d9afc7f6581b47f8d66c912d154321880", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-common_05-f767179.json0000664000175000017500000000074515141516316025143 0ustar alastairalastair{ "basename": "asr-common_05-f767179", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/common_05.f90", "infile_hash": "103a9b01bea9140a57317be18066e13d520ad14dc9edf4c0ff39c458", "outfile": null, "outfile_hash": null, "stdout": "asr-common_05-f767179.stdout", "stdout_hash": "b4f25b7795b1d6284d666d8506d2e00aeb48608cffec45e288feec19", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-substring_startidx-5fb6d57.stderr0000664000175000017500000000024315141516316027764 0ustar alastairalastairsemantic error: Substring start index at must be of type integer --> tests/errors/substring_startidx.f90:4:15 | 4 | print*, s(1.1:5) | ^^^ lfortran-lfortran-2f73434/tests/reference/asr-implicit_interface4-034a306.json0000664000175000017500000000102515141516316027223 0ustar alastairalastair{ "basename": "asr-implicit_interface4-034a306", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/implicit_interface4.f90", "infile_hash": "7cba05cff5b1be9768a73e4d33292b6af23b036642973fcef29a7069", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_interface4-034a306.stdout", "stdout_hash": "c5045b84efab1b465bec24e0f3e44a51ea94af43da80fbdcb1dc8e9e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-program4-d60edeb.stderr0000664000175000017500000000040215141516316025336 0ustar alastairalastairwarning: Assuming implicit save attribute for variable declaration --> tests/program4.f90:30:13 | 30 | real :: saved1 = 2.0 | ^^^^^^^^^^^^ help: add explicit save attribute or parameter attribute or initialize in a separate statement lfortran-lfortran-2f73434/tests/reference/ast_f90-case_02-386b648.stdout0000664000175000017500000000302415141516316025577 0ustar alastairalastairprogram case_02 implicit none ! local variable declaration integer :: marks, out marks = 81 select case (marks) case (91:100) out = 0 print *, "Excellent!" case (81:90) out = 1 print *, "Very good!" case (71:80) out = 2 print *, "Well done!" case (61:70) out = 3 print *, "Not bad!" case (41:60) out = 4 print *, "You passed!" case (:40) out = 5 print *, "Better try again!" case default out = 6 print *, "Invalid marks" end select print *, "Your marks are ", marks if (out /= 1) then error stop end if ! case default at the top select case (marks) case default print *, "Invalid marks" case (91:100) print *, "Excellent!" case (81:90) print *, "Very good!" case (71:80) print *, "Well done!" case (61:70) print *, "Not bad!" case (41:60) print *, "You passed!" case (:40) print *, "Better try again!" end select print *, "Your marks are ", marks ! case default in the middle select case (marks) case (91:100) print *, "Excellent!" case (81:90) print *, "Very good!" case default print *, "Invalid marks" case (71:80) print *, "Well done!" case (61:70) print *, "Not bad!" case (41:60) print *, "You passed!" case (:40) print *, "Better try again!" end select print *, "Your marks are ", marks end program case_02 lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor19-6d76e11.json0000664000175000017500000000077315141516316030560 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor19-6d76e11", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor19.f90", "infile_hash": "8a52da8afe0f8e0b7710633bf53282015e2a18b69ad344b5e4580c85", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor19-6d76e11.stdout", "stdout_hash": "0909335582cab5c159562f1a3340abc7d35b8b00f1ad3f8c20cf1fc2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dimension_01-2172e76.stderr0000664000175000017500000000031615141516316026143 0ustar alastairalastairsemantic error: Expecting a scalar integer or parameter annotated integer variable --> tests/errors/dimension_01.f90:2:24 | 2 | integer, dimension("abcd") :: line | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-logical1-d46903b.stdout0000664000175000017500000000455415141516316025643 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [4 x i8] c"L,L\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i1, align 1 %b = alloca i1, align 1 store i1 true, i1* %a, align 1 store i1 false, i1* %b, align 1 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, i1* %a, i1* %b) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_logical1 FINALIZE_SYMTABLE_logical1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-subroutine3-8086030.json0000664000175000017500000000072615141516316025526 0ustar alastairalastair{ "basename": "asr-subroutine3-8086030", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3-8086030.stdout", "stdout_hash": "db0f43b9007663bce78491bfc49682764668c8d2bbe715b9a4ca0077", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_slice-e254cc2.json0000664000175000017500000000074015141516316026144 0ustar alastairalastair{ "basename": "asr-string_slice-e254cc2", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/string_slice.f90", "infile_hash": "aaca6852e69f3ef20f618e36d1c1e75e52528c5ff757dd6d30538c13", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-string_slice-e254cc2.stderr", "stderr_hash": "eb2f724d3e0930b420e4c4636c9056fcd134db92d78b8abe91fbbd5e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine2-c8b0b6f.json0000664000175000017500000000105015141516316026020 0ustar alastairalastair{ "basename": "ast-subroutine2-c8b0b6f", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/subroutine2.f90", "infile_hash": "f7dd567e93e3e5af2c6a514a8f14fb96cad675b0aba7f6659efa28ab", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutine2-c8b0b6f.stdout", "stdout_hash": "057757b50b46ad7cf3c81da033a1c3c004228f826859ef94da6dad42", "stderr": "ast-subroutine2-c8b0b6f.stderr", "stderr_hash": "ac34db34d025d0d28eb5d971cf7e3173cfe8f587c51f9e8896e4f2dd", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_28-d8cdd42.json0000664000175000017500000000071515141516316025366 0ustar alastairalastair{ "basename": "run-format_28-d8cdd42", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_28.f90", "infile_hash": "e12053da38efd01671849c2d7e7ff4188ea37725fd373fee0322018e", "outfile": null, "outfile_hash": null, "stdout": "run-format_28-d8cdd42.stdout", "stdout_hash": "5a623fd42274dea41223ab2fcd021cbd0ecbf208b1c2aa96782ade02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-classes2-f926d51.stdout0000664000175000017500000002210315141516316025662 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %point_class = type <{ i32 (...)**, %point* }> %point = type {} %point2d_class = type <{ i32 (...)**, %point2d* }> %point2d = type { %point, float, float } @_Name_point = private unnamed_addr constant [6 x i8] c"point\00", align 1 @_Type_Info_point = linkonce_odr unnamed_addr constant { i8* } { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_Name_point, i32 0, i32 0) }, align 8 @_VTable_point = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8* }* @_Type_Info_point to i8*), i8* bitcast (void (i8*, i8*)* @_copy_defs_point to i8*), i8* bitcast (void (i8**)* @_allocate_struct_defs_point to i8*), i8* null] }, align 8 @_Name_point2d = private unnamed_addr constant [8 x i8] c"point2d\00", align 1 @_Type_Info_point2d = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_Name_point2d, i32 0, i32 0), i8* bitcast ({ i8* }* @_Type_Info_point to i8*) }, align 8 @_VTable_point2d = linkonce_odr unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_Type_Info_point2d to i8*), i8* bitcast (void (i8*, i8*)* @_copy_defs_point2d to i8*), i8* bitcast (void (i8**)* @_allocate_struct_defs_point2d to i8*), i8* bitcast (float (%point2d_class*)* @__module_defs_r2d to i8*)] }, align 8 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define float @__module_defs_r2d(%point2d_class* %this) { .entry: %r2d = alloca float, align 4 %0 = getelementptr %point2d_class, %point2d_class* %this, i32 0, i32 1 %1 = load %point2d*, %point2d** %0, align 8 %2 = getelementptr %point2d, %point2d* %1, i32 0, i32 1 %3 = load float, float* %2, align 4 %simplified_pow_operation = fmul float %3, %3 %4 = getelementptr %point2d_class, %point2d_class* %this, i32 0, i32 1 %5 = load %point2d*, %point2d** %4, align 8 %6 = getelementptr %point2d, %point2d* %5, i32 0, i32 2 %7 = load float, float* %6, align 4 %simplified_pow_operation1 = fmul float %7, %7 %8 = fadd float %simplified_pow_operation, %simplified_pow_operation1 %9 = call float @llvm.sqrt.f32(float %8) store float %9, float* %r2d, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_r2d FINALIZE_SYMTABLE_r2d: ; preds = %return %10 = load float, float* %r2d, align 4 ret float %10 } ; Function Attrs: nounwind readnone speculatable willreturn declare float @llvm.sqrt.f32(float) #0 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %p2d = alloca %point2d, align 8 %2 = getelementptr %point2d, %point2d* %p2d, i32 0, i32 1 %3 = getelementptr %point2d, %point2d* %p2d, i32 0, i32 2 %4 = getelementptr %point2d, %point2d* %p2d, i32 0, i32 0 %ptr = alloca %point_class*, align 8 store %point_class* null, %point_class** %ptr, align 8 %res = alloca float, align 4 %5 = getelementptr %point2d, %point2d* %p2d, i32 0, i32 1 store float 3.000000e+00, float* %5, align 4 %6 = getelementptr %point2d, %point2d* %p2d, i32 0, i32 2 store float 4.000000e+00, float* %6, align 4 %7 = load %point_class*, %point_class** %ptr, align 8 %8 = icmp eq %point_class* %7, null br i1 %8, label %then, label %else then: ; preds = %.entry %9 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %9, i8 0, i32 8, i1 false) %10 = bitcast i8* %9 to %point_class* store %point_class* %10, %point_class** %ptr, align 8 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then %11 = load %point_class*, %point_class** %ptr, align 8 %12 = bitcast %point_class* %11 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_point2d, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %12, align 8 %13 = getelementptr %point_class, %point_class* %11, i32 0, i32 1 %14 = bitcast %point2d* %p2d to %point* store %point* %14, %point** %13, align 8 %15 = load %point_class*, %point_class** %ptr, align 8 %16 = bitcast %point_class* %15 to float (%point_class*)*** %17 = load float (%point_class*)**, float (%point_class*)*** %16, align 8 %18 = getelementptr inbounds float (%point_class*)*, float (%point_class*)** %17, i32 2 %19 = load float (%point_class*)*, float (%point_class*)** %18, align 8 %20 = call float %19(%point_class* %15) store float %20, float* %res, align 4 %21 = load float, float* %res, align 4 %22 = fcmp une float %21, 5.000000e+00 br i1 %22, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) ; Function Attrs: argmemonly nounwind willreturn writeonly declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #1 define linkonce_odr void @_copy_defs_point(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %point* %3 = bitcast i8* %1 to %point* ret void } define linkonce_odr void @_allocate_struct_defs_point(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %point_class* %4 = bitcast %point_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_point, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %point_class, %point_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 0) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 0, i1 false) %7 = bitcast i8* %6 to %point* store %point* %7, %point** %5, align 8 ret void } define linkonce_odr void @_copy_defs_point2d(i8* %0, i8* %1) { entry: %2 = bitcast i8* %0 to %point2d* %3 = bitcast i8* %1 to %point2d* %4 = getelementptr %point2d, %point2d* %2, i32 0, i32 1 %5 = load float, float* %4, align 4 %6 = getelementptr %point2d, %point2d* %3, i32 0, i32 1 br i1 true, label %then, label %else then: ; preds = %entry store float %5, float* %6, align 4 br label %ifcont else: ; preds = %entry br label %ifcont ifcont: ; preds = %else, %then %7 = getelementptr %point2d, %point2d* %2, i32 0, i32 2 %8 = load float, float* %7, align 4 %9 = getelementptr %point2d, %point2d* %3, i32 0, i32 2 br i1 true, label %then1, label %else2 then1: ; preds = %ifcont store float %8, float* %9, align 4 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 %10 = getelementptr %point2d, %point2d* %2, i32 0, i32 0 %11 = getelementptr %point2d, %point2d* %3, i32 0, i32 0 ret void } define linkonce_odr void @_allocate_struct_defs_point2d(i8** %0) { entry: %1 = call i8* @_lfortran_malloc(i64 16) call void @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 16, i1 false) store i8* %1, i8** %0, align 8 %2 = load i8*, i8** %0, align 8 %3 = bitcast i8* %2 to %point2d_class* %4 = bitcast %point2d_class* %3 to i32 (...)*** store i32 (...)** bitcast (i8** getelementptr inbounds ({ [5 x i8*] }, { [5 x i8*] }* @_VTable_point2d, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8 %5 = getelementptr %point2d_class, %point2d_class* %3, i32 0, i32 1 %6 = call i8* @_lfortran_malloc(i64 8) call void @llvm.memset.p0i8.i32(i8* %6, i8 0, i32 8, i1 false) %7 = bitcast i8* %6 to %point2d* store %point2d* %7, %point2d** %5, align 8 %8 = getelementptr %point2d, %point2d* %7, i32 0, i32 1 %9 = getelementptr %point2d, %point2d* %7, i32 0, i32 2 %10 = getelementptr %point2d, %point2d* %7, i32 0, i32 0 ret void } declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() attributes #0 = { nounwind readnone speculatable willreturn } attributes #1 = { argmemonly nounwind willreturn writeonly } lfortran-lfortran-2f73434/tests/reference/wat-wasm_i64-3afdb24.json0000664000175000017500000000070015141516316025170 0ustar alastairalastair{ "basename": "wat-wasm_i64-3afdb24", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_i64.f90", "infile_hash": "9793bf432037540bb08d6e1429b2967f40f93c61e08901b587d2df2d", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_i64-3afdb24.stdout", "stdout_hash": "34529083b448f9f2c2b1d54e950f0dd60a6328bd40301a3e1ec1c19b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_div_test-21dab13.stdout0000664000175000017500000001507715141516316027377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex2 [] [(Assignment (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4) ) (RealConstant 4.000000 (Real 4) ) (Complex 4) (ComplexConstant 3.000000 4.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (ComplexBinOp (Var 2 x) Div (Cast (RealConstant 4.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 4.000000 0.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) Div (Var 2 x) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 x) (ComplexBinOp (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) ) Div (ComplexBinOp (Var 2 x) Add (ComplexConstructor (RealConstant 0.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) (Complex 4) (ComplexConstant 0.000000 3.000000 (Complex 4) ) ) (Complex 4) () ) (Complex 4) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_op_6-030b24e.json0000664000175000017500000000075315141516316025617 0ustar alastairalastair{ "basename": "asr-arrays_op_6-030b24e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_6.f90", "infile_hash": "068f85d014835f57027a1a8236c81c33d219cd281540afb6aef3720d", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_6-030b24e.stdout", "stdout_hash": "774ad21393045213def25a6ca8ef52a4fea958edb356f1ba6c323fc0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-merge_bits_comp-23a3e67.json0000664000175000017500000000075115141516316026542 0ustar alastairalastair{ "basename": "asr-merge_bits_comp-23a3e67", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/merge_bits_comp.f90", "infile_hash": "07da68f4c47a0ded636941ace875a8d1c0c31abec944e32405b95162", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-merge_bits_comp-23a3e67.stderr", "stderr_hash": "d1fab14201f28c9009c33c460571505646f71a4151917b273ffde9e3", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-array3-7b1ab3b.stdout0000664000175000017500000000765215141516316025314 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array3: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array3 [] [(Assignment (Var 2 a) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 b) (ArrayConstant 12 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_add_01c-a5654a9.json0000664000175000017500000000077215141516316026501 0ustar alastairalastair{ "basename": "asr-template_add_01c-a5654a9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01c.f90", "infile_hash": "8506b19e196f32a246b465b8b7184bb300101d2d4accb7616c130c4d", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01c-a5654a9.stdout", "stdout_hash": "ace6ae76358d18557c5a26ead3735df6d872e467f3f10e4bf20ed0f2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_03-3580222.json0000664000175000017500000000074515141516316026414 0ustar alastairalastair{ "basename": "ast-derived_types_03-3580222", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_03.f90", "infile_hash": "0367caa646d88d9d311f2157b87aa8d37c7c09500fea94cc3adacbe3", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_03-3580222.stdout", "stdout_hash": "ab37b4ff1e004fad6ff7076b8d170d77dca7854f74fd23eba69bed18", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_integer_real_array_types-c665202.jsonlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_integer_real_array_types-c665200000664000175000017500000000111115141516316034236 0ustar alastairalastair{ "basename": "asr-array_constructor_with_integer_real_array_types-c665202", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_integer_real_array_types.f90", "infile_hash": "17fbb7758226f84e587218354c221dad9ae645d719e685881fd7eea3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_integer_real_array_types-c665202.stderr", "stderr_hash": "27ae450141135b7ff688eaef0b41422c1d2ace6ac28e8f3664a7f41e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-data_12-af356bd.stdout0000664000175000017500000007517615141516316025345 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { data_12_module: (Module (SymbolTable 2 { b: (Variable 2 b [] Local (RealConstant 3.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), bf1: (Variable 2 bf1 [] Local (RealConstant 0.800000 (Real 4) ) (RealConstant 0.800000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c1: (Variable 2 c1 [] Local (ArrayConstant 16 [0.00000000e+00, 2.19999999e-01, -1.40000001e-01, -2.09999993e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 16 [0.00000000e+00, 2.19999999e-01, -1.40000001e-01, -2.09999993e-01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), td: (Variable 2 td [] Local (IntegerConstant 4 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), xx90: (Variable 2 xx90 [] Local (RealConstant 0.550000 (Real 4) ) (RealConstant 0.550000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), xx95: (Variable 2 xx95 [] Local (RealConstant 0.620000 (Real 4) ) (RealConstant 0.620000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local (RealConstant 3.000000 (Real 4) ) (RealConstant 3.000000 (Real 4) ) Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) data_12_module () [] .false. .false. .false. ), data_12_program: (Program (SymbolTable 3 { b: (ExternalSymbol 3 b 2 b data_12_module [] b Public ), bf1: (ExternalSymbol 3 bf1 2 bf1 data_12_module [] bf1 Public ), c1: (ExternalSymbol 3 c1 2 c1 data_12_module [] c1 Public ), td: (ExternalSymbol 3 td 2 td data_12_module [] td Public ), x: (ExternalSymbol 3 x 2 x data_12_module [] x Public ), xx90: (ExternalSymbol 3 xx90 2 xx90 data_12_module [] xx90 Public ), xx95: (ExternalSymbol 3 xx95 2 xx95 data_12_module [] xx95 Public ), y: (ExternalSymbol 3 y 2 y data_12_module [] y Public ), z: (ExternalSymbol 3 z 2 z data_12_module [] z Public ) }) data_12_program [data_12_module] [(Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 3 x) NotEq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 y) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 z) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Sub (RealConstant 0.220000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 3 c1) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (ArrayItem (Var 3 c1) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) Add (RealConstant 0.210000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 bf1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 bf1) Sub (RealConstant 0.800000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 xx90)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 xx90) Sub (RealConstant 0.550000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 3 xx95)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 3 xx95) Sub (RealConstant 0.620000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-cpu_time_02_wasm-fa2b15f.stdout0000664000175000017500000000456115141516316027257 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics2-68bbd81.stderr0000664000175000017500000000041115141516316026262 0ustar alastairalastairsemantic error: datan2 was declared as a variable, it can't be called as a function --> tests/errors/intrinsics2.f90:5:14 | 5 | print *, datan2(x,y) | ^^^^^^^^^^^ help: use the compiler option "--implicit-interface" to use intrinsic functions lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_08-7f7acdd.json0000664000175000017500000000074315141516316030005 0ustar alastairalastair{ "basename": "run-array_bounds_check_08-7f7acdd", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_08.f90", "infile_hash": "5b4ee4c8e59df328ecfe694741c18176b47b4000ad17c194947834c4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_08-7f7acdd.stderr", "stderr_hash": "276f14641ae84169ef2238128a62c9f981ee08a3bd383935d5f8dbae", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-types_03-ce710b0.stdout0000664000175000017500000001000315141516316025646 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %r = alloca float, align 4 store float 1.500000e+00, float* %r, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %r) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry %13 = load float, float* %r, align 4 %14 = fptosi float %13 to i32 store i32 %14, i32* %i, align 4 %15 = alloca i64, align 8 %16 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %15, i32 0, i32 0, i32* %i) %17 = load i64, i64* %15, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %16, i8** %18, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %17, i64* %19, align 4 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %21 = load i8*, i8** %20, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %23 = load i64, i64* %22, align 4 %24 = trunc i64 %23 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %21, i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %25 = icmp eq i8* %16, null br i1 %25, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %16) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done call void @_lpython_free_argv() br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_types_03 FINALIZE_SYMTABLE_types_03: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implicit13-56e851c.stdout0000664000175000017500000005352715141516316025752 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [d e] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [e] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 d) (Var 2 e)] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 d) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 4 (Integer 8) Decimal) ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 7.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 9.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 8) (ComplexConstant 10.000000 0.000000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 q) (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 11.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 12.000000 (Real 8) ) ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-interface1-1906de3.json0000664000175000017500000000072315141516316025427 0ustar alastairalastair{ "basename": "ast-interface1-1906de3", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface1.f90", "infile_hash": "de0a5bbd21c52cab270f135c27423c8570be3157fb3657b170136708", "outfile": null, "outfile_hash": null, "stdout": "ast-interface1-1906de3.stdout", "stdout_hash": "ba1400ae14c77b1c774d8a9e69ff52e8df653762105c8c458239cb0b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_complex-2513a51.stdout0000664000175000017500000010554215141516316027220 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_complex: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01_complex [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToComplex (Complex 4) () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 11 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Complex 4) ColMajor () ) (Cast (Var 2 i) IntegerToComplex (Complex 4) () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 14.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) (ComplexBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Complex 4) ColMajor () ) Sub (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 10.000000 0.000000 (Complex 4) ) ) (Complex 4) () ) () .false. .false. )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 1.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 2.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 3.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (ComplexBinOp (ComplexBinOp (ComplexBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) Add (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) Add (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (Complex 4) () ) () .false. .false. ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 17 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 17.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) () .false. .false. ) (If () (ComplexCompare (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 11 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 11.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Complex 4) ColMajor () ) (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) IntegerToComplex (Complex 4) () ) () .false. .false. )] [] )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 12 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 12.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 13 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 13.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ComplexCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerConstant 14 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 14.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-callback_05-c86f2cc.stdout0000664000175000017500000000723215141516316026347 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.x = internal global i32 5 define void @__module_callback_05_px_call1(i32* %x) { .entry: call void @__module_callback_05_px_call2(void (i32*)* @px_call1.__module_callback_05_printx, i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call1 FINALIZE_SYMTABLE_px_call1: ; preds = %return ret void } define void @px_call1.__module_callback_05_printx(i32* %x) { .entry: %0 = alloca i64, align 8 %1 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %x) %2 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %3 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %1, i8** %3, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %2, i64* %4, align 4 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %6 = load i8*, i8** %5, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %8 = load i64, i64* %7, align 4 %9 = trunc i64 %8 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %10 = icmp eq i8* %1, null br i1 %10, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %1) br label %free_done free_done: ; preds = %free_nonnull, %.entry br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_printx FINALIZE_SYMTABLE_printx: ; preds = %return ret void } define void @__module_callback_05_px_call2(void (i32*)* %f, i32* %x) { .entry: call void @__module_callback_05_px_call3(void (i32*)* %f, i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call2 FINALIZE_SYMTABLE_px_call2: ; preds = %return ret void } declare void @f(i32*) define void @__module_callback_05_px_call3(void (i32*)* %f, i32* %x) { .entry: call void %f(i32* %x) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_px_call3 FINALIZE_SYMTABLE_px_call3: ; preds = %return ret void } declare void @f.1(i32*) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_callback_05_px_call1(i32* @main.x) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_json-special_chars_json-219ee5a.stdout0000664000175000017500000001241515141516316030722 0ustar alastairalastair{ "node": "TranslationUnit", "fields": { "items": [ { "node": "Program", "fields": { "name": "special_chars_json", "trivia": { "node": "TriviaNode", "fields": { "inside": [ { "node": "EndOfLine", "fields": {}, "loc": { "first": 26, "last": 26, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 27, "last_filename": "tests/special_chars_json.f90", "last_line": 1, "last_column": 27 } }, { "node": "Comment", "fields": { "comment": "! A \"comment\"." }, "loc": { "first": 31, "last": 45, "first_filename": "tests/special_chars_json.f90", "first_line": 2, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 2, "last_column": 19 } } ], "after": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } }, "use": [], "implicit": [], "decl": [], "body": [ { "node": "Print", "fields": { "label": 0, "fmt": [], "values": [ { "node": "String", "fields": { "s": "A \"string\".", "kind": [] }, "loc": { "first": 59, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 14, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ], "trivia": [] }, "loc": { "first": 50, "last": 73, "first_filename": "tests/special_chars_json.f90", "first_line": 3, "first_column": 5, "last_filename": "tests/special_chars_json.f90", "last_line": 3, "last_column": 28 } } ], "contains": [] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } ] }, "loc": { "first": 0, "last": 77, "first_filename": "tests/special_chars_json.f90", "first_line": 1, "first_column": 1, "last_filename": "tests/special_chars_json.f90", "last_line": 4, "last_column": 3 } } lfortran-lfortran-2f73434/tests/reference/asr-polymorphic_arguments_02-bb6f3e2.stdout0000664000175000017500000005533415141516316031056 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { polymorphic_argument_02: (Program (SymbolTable 2 { c_value: (Variable 2 c_value [] Local (StringConstant "c" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "c" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), i_value: (Variable 2 i_value [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l_value: (Variable 2 l_value [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), r_value: (Variable 2 r_value [] Local (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), str: (GenericProcedure 2 str [2 str_scalar] Public ), str_scalar: (Function (SymbolTable 3 { g1: (Variable 3 g1 [] In () () Default (StructType [] [] .false. .true. ) 3 ~unlimited_polymorphic_type Source Public Required .false. .false. .false. () .false. .false. ), str_scalar: (Variable 3 str_scalar [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ~unlimited_polymorphic_type: (Struct (SymbolTable 4 { }) ~unlimited_polymorphic_type (StructType [] [] .false. .true. ) [] [] [] Source Public .false. .true. [] () () ) }) str_scalar (FunctionType [(StructType [] [] .false. .true. )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 g1)] [(Assignment (Var 3 str_scalar) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 3 str_scalar) Public .false. .false. () ) }) polymorphic_argument_02 [] [(Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 i_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 i_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 r_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 r_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 c_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 c_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar 2 str [((Var 2 l_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar 2 str [((Var 2 l_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 i_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 i_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 r_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 r_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 c_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 c_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(FunctionCall 2 str_scalar () [((Var 2 l_value))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (FunctionCall 2 str_scalar () [((Var 2 l_value))] (Integer 4) () () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor1-7e98a71.stdout0000664000175000017500000000641715141516316031051 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor1: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor1 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_dead_code_removal-case_06-e7f007f.json0000664000175000017500000000103615141516316030562 0ustar alastairalastair{ "basename": "pass_dead_code_removal-case_06-e7f007f", "cmd": "lfortran --pass=dead_code_removal --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_06.f90", "infile_hash": "3987983e4c8d162530bceffbbce0bd7d038b1f794655c222c47ad714", "outfile": null, "outfile_hash": null, "stdout": "pass_dead_code_removal-case_06-e7f007f.stdout", "stdout_hash": "8ac4ddf0ff2496c2fb109981dc66e6cf8a5aa39433a18be0915c9788", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allocate_02-3c0d7c8.stdout0000664000175000017500000015154015141516316026126 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), ierr: (Variable 2 ierr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), isource: (Variable 2 isource [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), whole_square: (Function (SymbolTable 3 { a: (Variable 3 a [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), a_2: (Variable 3 a_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), ab: (Variable 3 ab [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), abc: (Variable 3 abc [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b_2: (Variable 3 b_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), bc: (Variable 3 bc [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c_2: (Variable 3 c_2 [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), ca: (Variable 3 ca [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), status: (Variable 3 status [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) whole_square (FunctionType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Assignment (Var 3 n) (ArraySize (Var 3 a) () (Integer 4) () ) () .false. .false. ) (Allocate [((Var 3 a_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 b_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 c_2) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ())] () () () ) (Allocate [((Var 3 ab) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 bc) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 ca) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ()) ((Var 3 abc) [((IntegerConstant 1 (Integer 4) Decimal) (Var 3 n))] () () ())] () () () ) (Assignment (Var 3 status) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 ab) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 bc) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 b)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 ca) (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 3 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) Mul (Var 3 a) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 b) (Array (Integer 4) [(() ())] DescriptorArray ) () ) Mul (Var 3 c) (Array (Integer 4) [(() ())] DescriptorArray ) () ) () .false. .false. ) (Assignment (Var 3 status) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 3 status) Public .false. .false. () ) }) allocate_01 [] [(Assignment (Var 2 n) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 a) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ()) ((Var 2 b) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ()) ((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] () () ())] (Var 2 ierr) () (Var 2 isource) ) (Assignment (Var 2 a) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 b) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 c) (Var 2 isource) () .false. .false. ) (Assignment (Var 2 a) (ArrayBroadcast (IntegerConstant 1 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 a)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 b) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 b)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Assignment (Var 2 c) (ArrayBroadcast (IntegerConstant 3 (Integer 4) Decimal) (IntrinsicArrayFunction Shape [(Var 2 c)] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () ) () .false. .false. ) (Print (StringFormat () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_12-ff7ce44.json0000664000175000017500000000076115141516316026244 0ustar alastairalastair{ "basename": "asr-intrinsics_12-ff7ce44", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_12.f90", "infile_hash": "7f3ef938f03d46035bb9c845b8ab1b15ac06b209b8b464f50486baf8", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_12-ff7ce44.stdout", "stdout_hash": "26e482501e820a6b861be4230bd5d6df4bd0d3ca03099b86ebf5336c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-Subroutine_Call1-8e53e13.stdout0000664000175000017500000001421715141516316027137 0ustar alastairalastair(TranslationUnit [(Program Subroutine_Call1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! Syntax check" ) (Comment "!Subroutine CALL" )] ) )] [] [(SubroutineCall 0 randn [] [(() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 randn [] [(() x () 0)] [] [] () ) (SubroutineCall 0 random_number [] [(() U () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true.) () 0) (() x () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .true.) () 0) (() (FuncCallOrArray x [] [(() 1 () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 rand_gamma0 [] [(() a () 0) (() (Logical .false.) () 0) (() (FuncCallOrArray x [] [(() i () 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 rand_gamma_vector_n [] [(() a () 0) (() (FuncCallOrArray size [] [(() x () 0)] [] [] [] ) () 0) (() x () 0)] [] [] () ) (SubroutineCall 0 f [] [] [(a 4) (b 6) (c i)] [] () ) (SubroutineCall 0 g [] [(() (FuncCallOrArray a [] [(3 5 1 0) (i j 1 0)] [] [] [] ) () 0) (() (FuncCallOrArray b [] [(() () 1 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 g [] [(() (FuncCallOrArray a [] [(() 5 1 0) (i j 1 0)] [] [] [] ) () 0) (() (FuncCallOrArray b [] [(1 () 1 0)] [] [] [] ) () 0)] [] [] () ) (SubroutineCall 0 random_number [(a [])] [(() u () 0)] [] [] () ) (SubroutineCall 0 random_number [(a []) (b [])] [(() u () 0)] [] [] () ) (SubroutineCall 0 f [] [] [(a 4) (b 6) (c i)] [] () ) (SubroutineCall 0 e [(x []) (f [])] [] [] [] () ) (SubroutineCall 0 info [(self []) (dependency [(() ii () 0)])] [(() unit () 0) (() (- pr 1) () 0)] [] [] () ) (SubroutineCall 0 done [(self []) (dep [(() ndep [(self [])] 1 0)])] [(() a () 0)] [] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-save2-63c8bcc.json0000664000175000017500000000102015141516316024553 0ustar alastairalastair{ "basename": "asr-save2-63c8bcc", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/save2.f90", "infile_hash": "94b2d712cd16fab489e1cd6d8d1d36d005aed23e1ed44b2335109fe3", "outfile": null, "outfile_hash": null, "stdout": "asr-save2-63c8bcc.stdout", "stdout_hash": "ade6d2b71adf9d30506ded7128fc59c26375982f250e7c70afe32de6", "stderr": "asr-save2-63c8bcc.stderr", "stderr_hash": "2dc6a73d91f1eb0b136e2d0d2b5f9480c691b51e487d0f8d955b659e", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_33-b589c22.stdout0000664000175000017500000032630515141516316025744 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_cmd_install: (Module (SymbolTable 2 { build_model: (ExternalSymbol 2 build_model 4 build_model fpm_modules_33 [] build_model Public ) }) fpm_cmd_install () [fpm_modules_33] .false. .false. .false. ), fpm_dependency_modules_33: (Module (SymbolTable 7 { add_project: (Function (SymbolTable 13 { error: (Variable 13 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. ), package: (Variable 13 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 7 package_config_t Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 13 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ) }) add_project (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self) (Var 13 package) (Var 13 error)] [] () Public .false. .false. () ), add_project_dependencies: (Function (SymbolTable 14 { error: (Variable 14 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. ), main: (Variable 14 main [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), root: (Variable 14 root [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 14 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ) }) add_project_dependencies (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Logical 4) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 self) (Var 14 root) (Var 14 main) (Var 14 error)] [] () Public .false. .false. () ), dependency_config_t: (Struct (SymbolTable 8 { name: (Variable 8 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), path: (Variable 8 path [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name path] [] Source Public .false. .false. [] () () ), dependency_node_t: (Struct (SymbolTable 9 { done: (Variable 9 done [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), proj_dir: (Variable 9 proj_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), revision: (Variable 9 revision [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), update: (Variable 9 update [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_node_t (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [] [proj_dir revision done update] [] Source Public .false. .false. [] () 7 dependency_config_t ), dependency_tree_t: (Struct (SymbolTable 10 { add: (GenericProcedure 10 add [10 add_project 10 add_project_dependencies] Public ), add_project: (StructMethodDeclaration 10 add_project () add_project 7 add_project Source .false. .false. ), add_project_dependencies: (StructMethodDeclaration 10 add_project_dependencies () add_project_dependencies 7 add_project_dependencies Source .false. .false. ), cache: (Variable 10 cache [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), dep: (Variable 10 dep [] Local () () Default (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 7 dependency_node_t Source Public Required .false. .false. .false. () .false. .false. ), dep_dir: (Variable 10 dep_dir [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), ndep: (Variable 10 ndep [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 10 unit [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), update: (GenericProcedure 10 update [10 update_dependency] Public ), update_dependency: (StructMethodDeclaration 10 update_dependency () update_dependency 7 update_dependency Source .false. .false. ), verbosity: (Variable 10 verbosity [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dependency_tree_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [unit verbosity dep_dir ndep dep cache] [] Source Public .false. .false. [] () () ), error_t: (Struct (SymbolTable 11 { message: (Variable 11 message [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) error_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [message] [] Source Public .false. .false. [] () () ), package_config_t: (Struct (SymbolTable 12 { name: (Variable 12 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) package_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [name] [] Source Public .false. .false. [] () () ), update_dependency: (Function (SymbolTable 15 { error: (Variable 15 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 7 error_t Source Public Required .false. .false. .false. () .false. .false. ), name: (Variable 15 name [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 15 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) 7 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ) }) update_dependency (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 self) (Var 15 name) (Var 15 error)] [] () Public .false. .false. () ) }) fpm_dependency_modules_33 () [] .true. .false. .false. ), fpm_model_modules_33: (Module (SymbolTable 17 { dependency_tree_t: (ExternalSymbol 17 dependency_tree_t 7 dependency_tree_t fpm_dependency_modules_33 [] dependency_tree_t Public ), fpm_model_t: (Struct (SymbolTable 18 { build_prefix: (Variable 18 build_prefix [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), c_compile_flags: (Variable 18 c_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), cxx_compile_flags: (Variable 18 cxx_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), deps: (Variable 18 deps [] Local () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) 17 dependency_tree_t Source Public Required .false. .false. .false. () .false. .false. ), fortran_compile_flags: (Variable 18 fortran_compile_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), include_tests: (Variable 18 include_tests [] Local (LogicalConstant .true. (Logical 4) ) (LogicalConstant .true. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), link_flags: (Variable 18 link_flags [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), package_name: (Variable 18 package_name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_model_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [dependency_tree_t] [package_name fortran_compile_flags c_compile_flags cxx_compile_flags link_flags build_prefix deps include_tests] [] Source Public .false. .false. [] () () ) }) fpm_model_modules_33 () [fpm_dependency_modules_33] .true. .false. .false. ), fpm_modules_33: (Module (SymbolTable 4 { build_model: (Function (SymbolTable 5 { 1_add: (ExternalSymbol 5 1_add 10 add 1_dependency_tree_t [] add Private ), 1_dependency_tree_t: (ExternalSymbol 5 1_dependency_tree_t 7 dependency_tree_t fpm_dependency_modules_33 [] dependency_tree_t Private ), 1_dependency_tree_t_add_project: (ExternalSymbol 5 1_dependency_tree_t_add_project 10 add_project 1_dependency_tree_t [] add_project Public ), 1_fpm_model_t_deps: (ExternalSymbol 5 1_fpm_model_t_deps 18 deps fpm_model_t [] deps Public ), error: (Variable 5 error [] Out () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 4 error_t Source Public Required .false. .false. .false. () .false. .false. ), model: (Variable 5 model [] Out () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 4 fpm_model_t Source Public Required .false. .false. .false. () .false. .false. ), package: (Variable 5 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 4 package_config_t Source Public Required .false. .false. .false. () .false. .false. ) }) build_model (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 model) (Var 5 package) (Var 5 error)] [(SubroutineCall 5 1_dependency_tree_t_add_project 5 1_add [((Var 5 package)) ((Var 5 error))] (StructInstanceMember (Var 5 model) 5 1_fpm_model_t_deps (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (Array (StructType [(Logical 4) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Logical 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Allocatable (String 1 () DeferredLength DescriptorString) ) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) () ) .false. )] () Public .false. .false. () ), error_t: (ExternalSymbol 4 error_t 7 error_t fpm_dependency_modules_33 [] error_t Public ), fpm_model_t: (ExternalSymbol 4 fpm_model_t 17 fpm_model_t fpm_model_modules_33 [] fpm_model_t Public ), package_config_t: (ExternalSymbol 4 package_config_t 7 package_config_t fpm_dependency_modules_33 [] package_config_t Public ) }) fpm_modules_33 () [fpm_dependency_modules_33 fpm_model_modules_33] .true. .false. .false. ), modules_33: (Program (SymbolTable 19 { }) modules_33 [] [(Print (StringConstant "running modules_33 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-file_open_06-cc72219.json0000664000175000017500000000072615141516316025672 0ustar alastairalastair{ "basename": "run-file_open_06-cc72219", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/file_open_06.f90", "infile_hash": "38c29295a37c9aac5fa968468906167d4e5ae77bcf9aa7cce4be6d1b", "outfile": null, "outfile_hash": null, "stdout": "run-file_open_06-cc72219.stdout", "stdout_hash": "a8b3c28327d978bed230e9f55e67dc389ca40a82fbc5251d574c636e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-case_01-2ff47e6.json0000664000175000017500000000071415141516316024344 0ustar alastairalastair{ "basename": "c-case_01-2ff47e6", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "c-case_01-2ff47e6.stdout", "stdout_hash": "e47d0d678fec6d42d2bd1b503b34991411d09633fb062004f371c8ef", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-boz_01-dedad59.json0000664000175000017500000000105115141516316024715 0ustar alastairalastair{ "basename": "asr-boz_01-dedad59", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/boz_01.f90", "infile_hash": "58477e3f0fbdc7b41b5892cc6f876abfc5b434abe4884789d60b2d68", "outfile": null, "outfile_hash": null, "stdout": "asr-boz_01-dedad59.stdout", "stdout_hash": "9348875bdb6ea59074aa4e88f460b96f537b2eb2480189b8a32bfe0d", "stderr": "asr-boz_01-dedad59.stderr", "stderr_hash": "2c1014e4f04672dfbcc83dde266587a98d7dc9651f6401dcaab51839", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_04-024d591.stderr0000664000175000017500000000023615141516316031003 0ustar alastairalastairruntime error: Argument 1 of subroutine ff is unallocated. --> tests/errors/scalar_allocation_check_04.f90:3:13 | 3 | call ff(xx) | ^^^ lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_07-f220d33.stderr0000664000175000017500000000037415141516316030102 0ustar alastairalastairruntime error: Array shape mismatch in binary operation with operands 'x' and 'y'. Tried to match size 3 of dimension 1 of 'x' with size 4 of dimension 1 of 'y'. --> tests/errors/array_bounds_check_07.f90:12:9 | 12 | z = x + y | ^ lfortran-lfortran-2f73434/tests/reference/ast-line_continuation_01-17bec82.stdout0000664000175000017500000000300215141516316030051 0ustar alastairalastair(TranslationUnit [(Program line_continuation_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 5 () ) (If 0 () (< i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () ) (If 0 () (> i 4) [(Print 0 () [i] () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_02-6076a0f.json0000664000175000017500000000101715141516316030124 0ustar alastairalastair{ "basename": "asr-operator_overloading_02-6076a0f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_02.f90", "infile_hash": "d3f6f9065ea2f75dd235a6384cdd3f82769eb16971fac839a39430b6", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_02-6076a0f.stdout", "stdout_hash": "6991a3e04aa0307b5aaf95e7e17924d4cd07669ec75f0ed27bcb150b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-error_stop1-ccc2415.stdout0000664000175000017500000000037515141516316026312 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(ErrorStop 0 () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/run-format_29-75ca0a0.stdout0000664000175000017500000000034315141516316025641 0ustar alastairalastair 1.2346 12.3456 123.4560 0.1235 0.0012 x=0.001234 0.001234 1.234000 x=123456.0 123456.00 1234.56 x=-9.876 -9.876 -987.600 0.1235 123.4567 12345.67 9.9999 99.9990 0.000010 0.100000 lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_03-02055a5.stdout0000664000175000017500000000121615141516316030426 0ustar alastairalastair(TranslationUnit [(Subroutine sub [] [] () (TriviaNode [(Semicolon)] [(Semicolon)] ) [] [] [] [] [] [] [] ) (Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_45-1c0e790.json0000664000175000017500000000077415141516316026573 0ustar alastairalastair{ "basename": "asr_openmp-openmp_45-1c0e790", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_45.f90", "infile_hash": "839bc36c5653bbe5c190abafd9760c2cfc94d2a5da73b93c480c61cd", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp_45-1c0e790.stdout", "stdout_hash": "39d1dae7ce7059cdc1fe238ba8d41b92382f7618ab5a8d35a3320ed4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_05-e3b524c.json0000664000175000017500000000076215141516316030615 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_05-e3b524c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_05.f90", "infile_hash": "91825bf77fdb8c4fefb42a24592cd3e1e2f6039bbe91ba027bcd061e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_05-e3b524c.stderr", "stderr_hash": "1e541085fa87ab51d34a0125fb36e126dbc9cd0669117ab16ed5fd85", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-allocate_03-8219a72.json0000664000175000017500000000075315141516316025417 0ustar alastairalastair{ "basename": "asr-allocate_03-8219a72", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/allocate_03.f90", "infile_hash": "1f3440c7b139aaa793981c1458c516ddc41106d2950a39f47077b0f5", "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_03-8219a72.stdout", "stdout_hash": "2d418eb98323810fa4115375e3ee62343ee5a144d25e46b4882e608a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence4-9f1ef3e.json0000664000175000017500000000100415141516316031352 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence4-9f1ef3e", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence4.f90", "infile_hash": "9afb71d90a3901adaa0f6dc5dd1a11af7cd850f992eedebc11d0ad73", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence4-9f1ef3e.stdout", "stdout_hash": "e4e89a608ac6b98ca5b9e76bc4aafe802122c88190eb01a182b089be", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_if_variations-38b0c0a.stdout0000664000175000017500000000413515141516316031064 0ustar alastairalastair(TranslationUnit [(Subroutine f [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Print 0 () [a] () )] [] [] ) (Program main () [] [] [] [(If 0 () (< 0 1) [(Print 0 () [(String "first branch" ())] () ) (Continue 10 () )] [(Print 0 () [(String "second branch" ())] () )] () () () ) (SubroutineCall 50 f [] [(() 1 () 0)] [] [] () ) (If 0 () (< 0 2) [(Return 0 () () )] [] () () () ) (If 0 () (> 0 1) [(GoTo 0 () 50 [] () )] [] () () () ) (If 0 () (< 0 1) [(SubroutineCall 0 f [] [(() 2 () 0)] [] [] () )] [] () () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/pass_do_loops-loop_var_use_after_loop-e26183c.json0000664000175000017500000000106315141516316032370 0ustar alastairalastair{ "basename": "pass_do_loops-loop_var_use_after_loop-e26183c", "cmd": "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/loop_var_use_after_loop.f90", "infile_hash": "7155c67c016a79ec0de4c65637bdec02203cd567e2d20a7676393d09", "outfile": null, "outfile_hash": null, "stdout": "pass_do_loops-loop_var_use_after_loop-e26183c.stdout", "stdout_hash": "57f5b6bdd110e08df97311e332f32324da4d03029283c8fadecad2aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-arrays_02-d2f7107.json0000664000175000017500000000076015141516316025666 0ustar alastairalastair{ "basename": "ast_f90-arrays_02-d2f7107", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/arrays_02.f90", "infile_hash": "b5b3a6833fd727f5cce92c3c4886c4e20117f33710a1ec8b1016d8f6", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-arrays_02-d2f7107.stdout", "stdout_hash": "65298bf1c791719ae945300789a142c77cab89d2789f78665cbfab04", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_array_op-array15-079d0cd.stdout0000664000175000017500000000716015141516316027377 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array15: (Program (SymbolTable 2 { __libasr_index_0_: (Variable 2 __libasr_index_0_ [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array15 [] [(DoLoop () ((Var 2 __libasr_index_0_) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 __libasr_index_0_) ())] (Integer 4) ColMajor () ) (IntegerConstant 23 (Integer 4) Decimal) () .false. .false. )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_add_01b-bd911f4.json0000664000175000017500000000077215141516316026554 0ustar alastairalastair{ "basename": "asr-template_add_01b-bd911f4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_add_01b.f90", "infile_hash": "49bc85b4565cd612b81222b7a375987b68351569f3e6e67914e6c505", "outfile": null, "outfile_hash": null, "stdout": "asr-template_add_01b-bd911f4.stdout", "stdout_hash": "8f7b68e279c7a531cc0384b7f7379e781391bedd1a82027f94122f67", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit12-1826599.json0000664000175000017500000000106615141516316025236 0ustar alastairalastair{ "basename": "asr-implicit12-1826599", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit12.f90", "infile_hash": "b15934ce985f385fa987bbc85a37c711ad9f42818a7c50f8deeec4fc", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit12-1826599.stdout", "stdout_hash": "bee27c336ea3f374870401fc3e242a29f84c6edb6161c3d3f43ff1e4", "stderr": "asr-implicit12-1826599.stderr", "stderr_hash": "cbfd053a67ccb4e4f31052c144534fb75f43bcc33820945c7b23af09", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-enum_01-3bcfd6d.stdout0000664000175000017500000000076015141516316026330 0ustar alastairalastairprogram enum_01 implicit none enum, bind(c) enumerator :: blue = 3 enumerator :: red = 0 enumerator :: yellow = 4 end enum enum, bind(c) enumerator :: green = 10 enumerator :: purple = 11 end enum integer(4), parameter :: compiler_enum = 4 if (red /= 0) then error stop end if if (blue /= 3) then error stop end if if (yellow /= 4) then error stop end if if (green /= 10) then error stop end if if (purple /= 11) then error stop end if end program enum_01 lfortran-lfortran-2f73434/tests/reference/run-formatTesting-889403a.stderr0000664000175000017500000000016615141516316026531 0ustar alastairalastairError: Invalid format descriptor E - Proper Format is E. Period required in format specifier lfortran-lfortran-2f73434/tests/reference/asr-end_program_name-2d38a01.json0000664000175000017500000000075415141516316026674 0ustar alastairalastair{ "basename": "asr-end_program_name-2d38a01", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/end_program_name.f90", "infile_hash": "c8dd05d93a8414678b7776ec03c0db5605698346532b03217a190c19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-end_program_name-2d38a01.stderr", "stderr_hash": "16baaceda38c9b9273efe534c7c70122646b4c1ac9e3b414eb0406e8", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-crlf1-374a66c.stdout0000664000175000017500000000036415141516316024771 0ustar alastairalastair(TranslationUnit [(Program p () [] [] [] [(SubroutineCall 0 f [] [] [] [] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit13-56e851c.stderr0000664000175000017500000000254215141516316025722 0ustar alastairalastairstyle suggestion: Use integer(4) instead of integer*4 --> tests/implicit13.f90:2:34 | 2 | implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) | ^ help: write this as 'integer(4)' style suggestion: Use integer(8) instead of integer*8 --> tests/implicit13.f90:2:51 | 2 | implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) | ^ help: write this as 'integer(8)' style suggestion: Use real(4) instead of real*4 --> tests/implicit13.f90:3:14 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'real(4)' style suggestion: Use real(8) instead of real*8 --> tests/implicit13.f90:3:28 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'real(8)' style suggestion: Use complex(4) instead of complex*8 --> tests/implicit13.f90:3:59 | 3 | implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) | ^ help: write this as 'complex(4)' style suggestion: Use complex(8) instead of complex*16 --> tests/implicit13.f90:4:17 | 4 | implicit complex*16 (p), double precision (q), double precision (r) | ^ help: write this as 'complex(8)' lfortran-lfortran-2f73434/tests/reference/asr-template_error_03-b5d4715.json0000664000175000017500000000075715141516316026741 0ustar alastairalastair{ "basename": "asr-template_error_03-b5d4715", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_03.f90", "infile_hash": "4743dafccb75c38c0fc3dca110e00f7f4b196d13ddafa738fb452c2e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_03-b5d4715.stderr", "stderr_hash": "6095d56945a69f5d4751e71a00a7c318bcfff1c3eeb59cf1fa742bdb", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-expr9-ba35d31.stdout0000664000175000017500000000107015141516316025071 0ustar alastairalastair(TranslationUnit [(SubroutineCall 0 trigger [(ERROR_HANDLER [])] [] [(errors (DefUnaryOp "errors" rslt ))] [] () ) (DefUnaryOp "INVERSE" B ) (DefUnaryOp "INVERSE" (+ A B) ) (DefUnaryOp "anotherunary" 1 ) (DefUnaryOp "anotherunary" (+ 1 2) ) (DefUnaryOp "anotherunary" C ) (DefUnaryOp "anotherunary" (+ c d) )] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_04-524ec3a.stdout0000664000175000017500000005061015141516316026520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_04: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), sp: (ExternalSymbol 2 sp 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_04 [iso_fortran_env] [(Assignment (Var 2 x) (RealConstant 1.500000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 x) (IntrinsicElementalFunction Tan [(Var 2 x)] 0 (Real 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 14.101420 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Tan [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 14.101420 (Real 4) ) ) Sub (RealConstant 14.101420 (Real 4) ) (Real 4) (RealConstant -0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Tan [(RealBinOp (Cast (IntrinsicElementalFunction Tan [(RealConstant 1.500000 (Real 4) )] 0 (Real 4) (RealConstant 14.101420 (Real 4) ) ) RealToReal (Real 8) (RealConstant 14.101420 (Real 8) ) ) Add (IntrinsicElementalFunction Tan [(RealBinOp (Var 2 x) Add (IntrinsicElementalFunction Tan [(Var 2 x)] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) Sub (Cast (RealConstant 2.254825 (Real 4) ) RealToReal (Real 8) (RealConstant 2.254825 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000010 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000010 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 z) (ComplexConstructor (RealConstant 1.500000 (Real 8) ) (RealConstant 3.500000 (Real 8) ) (Complex 8) (ComplexConstant 1.500000 3.500000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 z) (IntrinsicElementalFunction Tan [(Var 2 z)] 0 (Complex 8) () ) () .false. .false. ) (Print (StringFormat () [(Var 2 z)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(Var 2 z)] 0 (Real 8) () ) Sub (RealConstant 0.000258 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (Cast (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Real [(IntrinsicElementalFunction Tan [(ComplexConstructor (RealConstant 1.500000 (Real 4) ) (RealConstant 3.500000 (Real 4) ) (Complex 4) (ComplexConstant 1.500000 3.500000 (Complex 4) ) )] 0 (Complex 4) (ComplexConstant 0.000258 1.001807 (Complex 4) ) )] 0 (Real 4) (RealConstant 0.000258 (Real 4) ) ) Sub (RealConstant 0.000258 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] 0 (Real 4) (RealConstant 0.000000 (Real 4) ) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (IntrinsicElementalFunction Aimag [(Var 2 z)] 0 (Real 8) () ) Sub (RealConstant 1.001807 (Real 8) ) (Real 8) () )] 0 (Real 8) () ) Gt (RealConstant 0.000000 (Real 8) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_07-bb03cfd.stdout0000664000175000017500000011234115141516316033305 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_07: (Program (SymbolTable 8 { f_a: (ExternalSymbol 8 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 8 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (ExternalSymbol 8 f_c 6 f_c functions_07_c [] f_c Public ), p: (Variable 8 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 8 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 8 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 8 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 8 w [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 8 z [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_07 [functions_07_c] [(Assignment (Var 8 w) (Var 8 p) () .false. .false. ) (Assignment (Var 8 x) (Var 8 w) () .false. .false. ) (Assignment (Var 8 u) (Var 8 x) () .false. .false. ) (Assignment (Var 8 v) (RealBinOp (Var 8 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 y) (RealBinOp (Var 8 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 z) (RealBinOp (Var 8 y) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 8 q) (Var 8 z) () .false. .false. ) (Print (StringFormat () [(Var 8 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_07_a: (Module (SymbolTable 2 { f_a: (Function (SymbolTable 3 { u: (Variable 3 u [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_a (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 u)] [(Assignment (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 3 v) Public .false. .false. () ) }) functions_07_a () [] .false. .false. .false. ), functions_07_b: (Module (SymbolTable 4 { f_a: (ExternalSymbol 4 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (Function (SymbolTable 5 { u: (Variable 5 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 5 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_b (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x)] [(Assignment (Var 5 u) (Var 5 x) () .false. .false. ) (Assignment (Var 5 v) (RealBinOp (Var 5 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 5 y) (RealBinOp (Var 5 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 5 y) Public .false. .false. () ) }) functions_07_b () [functions_07_a] .false. .false. .false. ), functions_07_c: (Module (SymbolTable 6 { f_a: (ExternalSymbol 6 f_a 2 f_a functions_07_a [] f_a Public ), f_b: (ExternalSymbol 6 f_b 4 f_b functions_07_b [] f_b Public ), f_c: (Function (SymbolTable 7 { u: (Variable 7 u [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 7 v [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 7 w [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 7 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 7 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 7 z [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_c (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 w)] [(Assignment (Var 7 x) (Var 7 w) () .false. .false. ) (Assignment (Var 7 u) (Var 7 x) () .false. .false. ) (Assignment (Var 7 v) (RealBinOp (Var 7 u) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 7 y) (RealBinOp (Var 7 v) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. ) (Assignment (Var 7 z) (RealBinOp (Var 7 y) Add (RealConstant 1.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] (Var 7 z) Public .false. .false. () ) }) functions_07_c () [functions_07_b] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-assign-262a444.stdout0000664000175000017500000000243015141516316025153 0ustar alastairalastair(TranslationUnit [(Program assign () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(y [] [] () () None ())] () )] [(Format 10 "'(i3)'" () ) (Assign 0 10 x () ) (Assign 20 10 x () ) (Assign 0 10 x () ) (Assign 30 10 y (TriviaNode [] [(EOLComment "! An integer variable is required in this context." )] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-float1-817e0db.json0000664000175000017500000000071615141516316024653 0ustar alastairalastair{ "basename": "asr-float1-817e0db", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/float1.f90", "infile_hash": "55dfda74a97e804376ef0789c76876426844dc611542c0c6947ef9e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-float1-817e0db.stderr", "stderr_hash": "1f0f7eed328eb29e5c62b7944807320a02636a5cda8da98f08f2d582", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_commutative-45a3ac0.json0000664000175000017500000000100615141516316027674 0ustar alastairalastair{ "basename": "asr-template_commutative-45a3ac0", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_commutative.f90", "infile_hash": "17b44264286a23c913bfa477f02febff7dcd4db7d04cf26d8cf3c413", "outfile": null, "outfile_hash": null, "stdout": "asr-template_commutative-45a3ac0.stdout", "stdout_hash": "f2926a0b3ae6f15a91944f10627fd202a0a3659b965b7e4bdee5fa4e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_06-83a7aca.stdout0000664000175000017500000006515315141516316026436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_06: (Program (SymbolTable 6 { int_return: (ExternalSymbol 6 int_return 2 int_return functions_06_m [] int_return Public ), real_return: (ExternalSymbol 6 real_return 2 real_return functions_06_m [] real_return Public ), string: (Variable 6 string [] Local (StringConstant " abc" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant " abc" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), trim_wrapper: (ExternalSymbol 6 trim_wrapper 2 trim_wrapper functions_06_m [] trim_wrapper Public ) }) functions_06 [functions_06_m] [(Print (FunctionCall 6 trim_wrapper () [((Var 6 string))] (String 1 (StringLen (Var 6 string) (Integer 4) () ) ExpressionLength DescriptorString) () () ) ) (Print (StringFormat () [(FunctionCall 6 int_return () [((Var 6 string))] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 6 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(FunctionCall 6 real_return () [((Var 6 string))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 6 string) (Integer 4) () ))] PointerArray ) () () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), functions_06_m: (Module (SymbolTable 2 { int_return: (Function (SymbolTable 4 { i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [s] ReturnVar () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 s) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 4 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) int_return (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 s)] [(DoLoop () ((Var 4 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 4 s) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. )] [] )] (Var 4 r) Public .false. .false. () ), real_return: (Function (SymbolTable 5 { i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [s] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 5 s) (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 5 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) real_return (FunctionType [(String 1 () AssumedLength DescriptorString)] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 s)] [(DoLoop () ((Var 5 i) (IntegerConstant 1 (Integer 4) Decimal) (StringLen (Var 5 s) (Integer 4) () ) ()) [(Assignment (ArrayItem (Var 5 r) [(() (Var 5 i) ())] (Real 4) ColMajor () ) (RealConstant 2.000000 (Real 4) ) () .false. .false. )] [] )] (Var 5 r) Public .false. .false. () ), trim_wrapper: (Function (SymbolTable 3 { r: (Variable 3 r [s] ReturnVar () () Default (String 1 (StringLen (Var 3 s) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Variable 3 s [] Unspecified () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) trim_wrapper (FunctionType [(String 1 () AssumedLength DescriptorString)] (String 1 (StringLen (FunctionParam 0 (String 1 () AssumedLength DescriptorString) () ) (Integer 4) () ) ExpressionLength DescriptorString) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 s)] [(Assignment (Var 3 r) (IntrinsicElementalFunction StringTrim [(Var 3 s)] 0 (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) () .false. .false. )] (Var 3 r) Public .false. .false. () ) }) functions_06_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-generic_name_01-9f2fd25.stdout0000664000175000017500000013641215141516316026764 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_module: (Module (SymbolTable 2 { complextype: (Struct (SymbolTable 3 { add: (GenericProcedure 3 add [3 integer_add_subrout 3 real_add_subrout] Public ), i: (Variable 3 i [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), integer_add_subrout: (StructMethodDeclaration 3 integer_add_subrout () integer_add_subrout 2 integer_add_subrout Source .false. .false. ), r: (Variable 3 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), real_add_subrout: (StructMethodDeclaration 3 real_add_subrout () real_add_subrout 2 real_add_subrout Source .false. .false. ) }) complextype (StructType [(Real 4) (Real 4)] [] .true. .false. ) [] [r i] [] Source Public .false. .false. [] () () ), integer_add_subrout: (Function (SymbolTable 4 { 1_complextype_i: (ExternalSymbol 4 1_complextype_i 3 i complextype [] i Public ), 1_complextype_r: (ExternalSymbol 4 1_complextype_r 3 r complextype [] r Public ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sum: (Variable 4 sum [] Out () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 2 complextype Source Public Required .false. .false. .false. () .false. .false. ), this: (Variable 4 this [] In () () Default (StructType [(Real 4) (Real 4)] [] .false. .false. ) 2 complextype Source Public Required .false. .false. .false. () .false. .false. ) }) integer_add_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .false. .false. ) (Integer 4) (Integer 4) (StructType [(Real 4) (Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 this) (Var 4 r) (Var 4 i) (Var 4 sum)] [(Print (StringConstant "Calling integer_add_subrout" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (StructInstanceMember (Var 4 sum) 4 1_complextype_r (Real 4) () ) (RealBinOp (StructInstanceMember (Var 4 this) 4 1_complextype_r (Real 4) () ) Add (Cast (Var 4 r) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 4 sum) 4 1_complextype_i (Real 4) () ) (RealBinOp (StructInstanceMember (Var 4 this) 4 1_complextype_i (Real 4) () ) Add (Cast (Var 4 i) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] () Public .false. .false. () ), real_add_subrout: (Function (SymbolTable 5 { 1_complextype_i: (ExternalSymbol 5 1_complextype_i 3 i complextype [] i Public ), 1_complextype_r: (ExternalSymbol 5 1_complextype_r 3 r complextype [] r Public ), i: (Variable 5 i [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 5 r [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sum: (Variable 5 sum [] Out () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 2 complextype Source Public Required .false. .false. .false. () .false. .false. ), this: (Variable 5 this [] In () () Default (StructType [(Real 4) (Real 4)] [] .false. .false. ) 2 complextype Source Public Required .false. .false. .false. () .false. .false. ) }) real_add_subrout (FunctionType [(StructType [(Real 4) (Real 4)] [] .false. .false. ) (Real 4) (Real 4) (StructType [(Real 4) (Real 4)] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 this) (Var 5 r) (Var 5 i) (Var 5 sum)] [(Print (StringConstant "Calling real_add_subrout" (String 1 (IntegerConstant 24 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (StructInstanceMember (Var 5 sum) 5 1_complextype_r (Real 4) () ) (RealBinOp (StructInstanceMember (Var 5 this) 5 1_complextype_r (Real 4) () ) Add (Var 5 r) (Real 4) () ) () .false. .false. ) (Assignment (StructInstanceMember (Var 5 sum) 5 1_complextype_i (Real 4) () ) (RealBinOp (StructInstanceMember (Var 5 this) 5 1_complextype_i (Real 4) () ) Add (Var 5 i) (Real 4) () ) () .false. .false. )] () Public .false. .false. () ) }) complex_module () [] .false. .false. .false. ), generic_name_01: (Program (SymbolTable 6 { 1_add: (ExternalSymbol 6 1_add 3 add complextype [] add Private ), 1_complextype_i: (ExternalSymbol 6 1_complextype_i 3 i complextype [] i Public ), 1_complextype_integer_add_subrout: (ExternalSymbol 6 1_complextype_integer_add_subrout 3 integer_add_subrout complextype [] integer_add_subrout Public ), 1_complextype_r: (ExternalSymbol 6 1_complextype_r 3 r complextype [] r Public ), 1_complextype_real_add_subrout: (ExternalSymbol 6 1_complextype_real_add_subrout 3 real_add_subrout complextype [] real_add_subrout Public ), a: (Variable 6 a [] Local () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 6 complextype Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 6 c [] Local () () Default (StructType [(Real 4) (Real 4)] [] .true. .false. ) 6 complextype Source Public Required .false. .false. .false. () .false. .false. ), complextype: (ExternalSymbol 6 complextype 2 complextype complex_module [] complextype Public ), fpone: (Variable 6 fpone [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), fptwo: (Variable 6 fptwo [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), fpzero: (Variable 6 fpzero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ione: (Variable 6 ione [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), izero: (Variable 6 izero [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), negfpone: (Variable 6 negfpone [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) generic_name_01 [complex_module] [(Assignment (Var 6 fpone) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 6 fptwo) (RealConstant 2.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 6 fpzero) (RealConstant 0.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 6 ione) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 6 izero) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 6 negfpone) (RealUnaryMinus (RealConstant 1.000000 (Real 4) ) (Real 4) (RealConstant -1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 6 c) (StructConstructor 6 complextype [((Var 6 fpone)) ((Var 6 fptwo))] (StructType [(Real 4) (Real 4)] [] .true. .false. ) () ) () .false. .false. ) (SubroutineCall 6 1_complextype_integer_add_subrout 6 1_add [((Var 6 ione)) ((Var 6 izero)) ((Var 6 a))] (Var 6 c) .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 a) 6 1_complextype_r (Real 4) () ) (StructInstanceMember (Var 6 a) 6 1_complextype_i (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (StructInstanceMember (Var 6 a) 6 1_complextype_r (Real 4) () ) NotEq (RealConstant 2.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (StructInstanceMember (Var 6 a) 6 1_complextype_i (Real 4) () ) NotEq (RealConstant 2.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 6 1_complextype_real_add_subrout 6 1_add [((Var 6 fpzero)) ((Var 6 negfpone)) ((Var 6 a))] (Var 6 c) .false. ) (Print (StringFormat () [(StructInstanceMember (Var 6 a) 6 1_complextype_r (Real 4) () ) (StructInstanceMember (Var 6 a) 6 1_complextype_i (Real 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (StructInstanceMember (Var 6 a) 6 1_complextype_r (Real 4) () ) NotEq (RealConstant 1.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (StructInstanceMember (Var 6 a) 6 1_complextype_i (Real 4) () ) NotEq (RealConstant 1.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-continue_compilation_1-04b6d40.json0000664000175000017500000000101615141516316030032 0ustar alastairalastair{ "basename": "asr-continue_compilation_1-04b6d40", "cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}", "infile": "tests/errors/continue_compilation_1.f90", "infile_hash": "cbb9bf04c8e92d2d45a0ff4575ca0a7b614f25a01abe205a54322588", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-continue_compilation_1-04b6d40.stderr", "stderr_hash": "0dc6e9d01c7beffe2ea228004a1575b4cc4e454ac24ec8b518c50553", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-modules_01-3535389.json0000664000175000017500000000075015141516316025224 0ustar alastairalastair{ "basename": "asr-modules_01-3535389", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_01.f90", "infile_hash": "592921c14763dae70e205b1eaf8b9fd0b69df11eccc0a66d109e11b8", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_01-3535389.stdout", "stdout_hash": "a2d0a58174f3efdf8bb6aeecf43ececa36a10769642f182196bbb027", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-assign_to2-d8aade7.json0000664000175000017500000000075115141516316025701 0ustar alastairalastair{ "basename": "ast-assign_to2-d8aade7", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/assign_to2.f", "infile_hash": "ee4e7d00ab3171c8b0f275f477b422d3a59370501dacc72ce4e11fc6", "outfile": null, "outfile_hash": null, "stdout": "ast-assign_to2-d8aade7.stdout", "stdout_hash": "7dd702e6ed1c8d800f06f85ac6b3116b756660e75872e846aec84fd5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit5-8745632.stdout0000664000175000017500000002715115141516316025527 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { cpdsa: (Function (SymbolTable 2 { ca0: (Variable 2 ca0 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cdn: (Variable 2 cdn [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cpdsa: (Variable 2 cpdsa [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), eps: (Variable 2 eps [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Unspecified () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pi: (Variable 2 pi [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), va0: (Variable 2 va0 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 2 z [] Unspecified () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) cpdsa (FunctionType [(Integer 4) (Real 4) (Real 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 z) (Var 2 cdn)] [(Assignment (Var 2 eps) (RealConstant 0.000000 (Real 8) ) () .false. .false. ) (Assignment (Var 2 pi) (RealConstant 3.141593 (Real 8) ) () .false. .false. ) (Assignment (Var 2 ca0) (Cast (IntrinsicElementalFunction Exp [(RealBinOp (RealBinOp (RealUnaryMinus (RealConstant 0.250000 (Real 8) ) (Real 8) (RealConstant -0.250000 (Real 8) ) ) Mul (Cast (Var 2 z) RealToReal (Real 8) () ) (Real 8) () ) Mul (Cast (Var 2 z) RealToReal (Real 8) () ) (Real 8) () )] 0 (Real 8) () ) RealToReal (Real 4) () ) () .false. .false. ) (Assignment (Var 2 va0) (RealBinOp (RealConstant 0.500000 (Real 8) ) Mul (RealBinOp (RealConstant 1.000000 (Real 8) ) Sub (Cast (Var 2 n) IntegerToReal (Real 8) () ) (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 2 cpdsa) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-nullify_04-a75db8a.json0000664000175000017500000000075015141516316025531 0ustar alastairalastair{ "basename": "asr-nullify_04-a75db8a", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_04.f90", "infile_hash": "40ca9241d7f57af3585301c6674e765dc78d3c06008da214079103a0", "outfile": null, "outfile_hash": null, "stdout": "asr-nullify_04-a75db8a.stdout", "stdout_hash": "85713d93f03344f9352d97e32a27705db6377531e8dcabeb26916728", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine6-f8dae3a.json0000664000175000017500000000071715141516316026433 0ustar alastairalastair{ "basename": "julia-subroutine6-f8dae3a", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine6-f8dae3a.stdout", "stdout_hash": "67b45ec73b3f8ce1841dcbe0d123749cbd83278d65ab2b7d5da24430", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-case_05-f054494.stdout0000664000175000017500000000060715141516316025440 0ustar alastairalastairfunction main() local grade::String = "B" if grade == "A" println("Excellent!") elseif grade == "B" elseif grade == "C" println("Well done") elseif grade == "D" println("You passed") elseif grade == "F" println("Better try again") else println("Invalid grade") end println("Your grade is ", " ", grade) end main() lfortran-lfortran-2f73434/tests/reference/asr-allocate_01-f3446f6.stdout0000664000175000017500000031076015141516316026055 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 2 g [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ierr: (Variable 2 ierr [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), reduce_sum: (Function (SymbolTable 4 { c: (Variable 4 c [] In () () Default (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] ReturnVar () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) reduce_sum (FunctionType [(Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray )] (Complex 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 c)] [(Assignment (Var 4 r) (Cast (IntegerConstant 0 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 0.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (DoLoop () ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4) ColMajor () ) (Complex 4) () ) () .false. .false. )] [] )] [] )] [] )] (Var 4 r) Public .false. .false. () ), sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] In () () Default (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 3 c [] Out () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), c_copy: (Variable 3 c_copy [] Local () () Default (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 3 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 3 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sum (FunctionType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) (Allocatable (Array (Real 4) [(() ()) (() ())] DescriptorArray ) ) (Allocatable (Array (Complex 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 b) (Var 3 c)] [(Allocate [((Var 3 c_copy) [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (Allocate [((Var 3 c) [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (DoLoop () ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4) ColMajor () ) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () ) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) (Real 4) () ) RealToComplex (Complex 4) () ) () .false. .false. ) (Assignment (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4) ColMajor () ) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) IntegerToReal (Real 4) () ) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4) ColMajor () ) (Real 4) () ) RealToComplex (Complex 4) () ) () .false. .false. )] [] )] [] )] [] ) (ExplicitDeallocate [(Var 3 c_copy)] )] () Public .false. .false. () ) }) allocate_01 [] [(Assignment (Var 2 n) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 e) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () (Var 2 d) ) (Assignment (Var 2 e) (Var 2 d) () .false. .false. ) (If () (IntegerCompare (ArraySize (Var 2 e) () (Integer 4) () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 a) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 e) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 e) ) (Assignment (Var 2 a) (Var 2 e) () .false. .false. ) (If () (IntegerCompare (ArraySize (Var 2 a) () (Integer 4) () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 a)] ) (Allocate [((Var 2 b) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((Var 2 f) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 b) ) (Assignment (Var 2 f) (Var 2 b) () .false. .false. ) (If () (LogicalBinOp (IntegerCompare (ArraySize (Var 2 f) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 f) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 b)] ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (Allocate [((Var 2 g) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () (Var 2 c) ) (Assignment (Var 2 g) (Var 2 c) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) Or (IntegerCompare (ArraySize (Var 2 g) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) () ) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (ExplicitDeallocate [(Var 2 c)] ) (Allocate [((Var 2 a) [((IntegerConstant 5 (Integer 4) Decimal) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] () () () ) (Allocate [((Var 2 b) [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Sub (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Sub (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] () () ())] (Var 2 ierr) () () ) (If () (IntegerCompare (ArraySize (Var 2 a) () (Integer 4) () ) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (ArraySize (Var 2 b) () (Integer 4) () ) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. )] [] )] [] ) (ImplicitDeallocate [(Var 2 c)] ) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] () .false. ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (IntegerConstant 5 (Integer 4) Decimal) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (Var 2 n) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) NotEq (Var 2 n) (Logical 4) () ) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4) Decimal) Mul (Var 2 n) (Integer 4) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) NotEq (Var 2 i) (Logical 4) () ) [(ErrorStop () )] [] )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(If () (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4) ColMajor () ) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Add (Var 2 k) (Integer 4) () ) IntegerToComplex (Complex 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [] )] [] ) (Assignment (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4) () () ) () .false. .false. ) (If () (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4) ) (RealConstant 0.000000 (Real 4) ) (Complex 4) (ComplexConstant 114345.000000 0.000000 (Complex 4) ) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-nullify_02-3c7ee61.json0000664000175000017500000000075315141516316025641 0ustar alastairalastair{ "basename": "llvm-nullify_02-3c7ee61", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nullify_02.f90", "infile_hash": "8603bbfc07290d14f0828e12a8b04c3521c007c844a4c901b4bb7483", "outfile": null, "outfile_hash": null, "stdout": "llvm-nullify_02-3c7ee61.stdout", "stdout_hash": "e1bcff622339eede432b224c15da72e7825baad29abdd6915dc5f6a7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_dp_param-b21353f.json0000664000175000017500000000077215141516316026714 0ustar alastairalastair{ "basename": "asr-complex_dp_param-b21353f", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp_param.f90", "infile_hash": "0d4d9eaf5bcc2cee6a8b57ee6a66b5a10ced2edf6d64b5d2e2a0bcb8", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_dp_param-b21353f.stdout", "stdout_hash": "e1b89a518f1092f95f2810647cb687e09a4f14ed72f1f2df14fbc548", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-sync1-9624944.json0000664000175000017500000000070415141516316024314 0ustar alastairalastair{ "basename": "ast-sync1-9624944", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/sync1.f90", "infile_hash": "363462c860cc54ea57727a4d2ee43782f907dd682bcafcb8fa2017cb", "outfile": null, "outfile_hash": null, "stdout": "ast-sync1-9624944.stdout", "stdout_hash": "1b5fa1990ef0452d2709b23be0b5977d1c6e69a479a811b6bd8d81ab", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_openmp-pragma1-f8a3fde.json0000664000175000017500000000074115141516316026541 0ustar alastairalastair{ "basename": "ast_openmp-pragma1-f8a3fde", "cmd": "lfortran --show-ast --no-color --openmp {infile} -o {outfile}", "infile": "tests/pragma1.f90", "infile_hash": "0b9eea06186cb7eb1866b55256263d4e562835c40920f35b92ed18ee", "outfile": null, "outfile_hash": null, "stdout": "ast_openmp-pragma1-f8a3fde.stdout", "stdout_hash": "5fe83e4aa643e6315c760999d691cf2c8e2d454961a668974dbbd005", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_16_module-4aac273.stdout0000664000175000017500000004273115141516316030554 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_16: (Program (SymbolTable 5 { 1_fpm_run_settings_bool: (ExternalSymbol 5 1_fpm_run_settings_bool 3 bool fpm_run_settings [] bool Public ), 1_fpm_run_settings_float: (ExternalSymbol 5 1_fpm_run_settings_float 3 float fpm_run_settings [] float Public ), 1_fpm_run_settings_int: (ExternalSymbol 5 1_fpm_run_settings_int 3 int fpm_run_settings [] int Public ), fpm_run_settings: (ExternalSymbol 5 fpm_run_settings 2 fpm_run_settings fpm_command_line [] fpm_run_settings Public ), get_command_line_settings: (ExternalSymbol 5 get_command_line_settings 2 get_command_line_settings fpm_command_line [] get_command_line_settings Public ), settings: (Variable 5 settings [] Local () () Default (Allocatable (StructType [(Logical 4) (Real 4) (Integer 4)] [] .false. .false. ) ) 5 fpm_run_settings Source Public Required .false. .false. .false. () .false. .false. ) }) derived_types_16 [fpm_command_line] [(Allocate [((Var 5 settings) [] () () ())] () () () ) (ImplicitDeallocate [(Var 5 settings)] ) (SubroutineCall 5 get_command_line_settings () [((Var 5 settings))] () .false. ) (If () (IntegerCompare (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_int (Integer 4) () ) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_float (Real 4) () ) Sub (RealConstant 1.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000001 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (StructInstanceMember (Var 5 settings) 5 1_fpm_run_settings_bool (Logical 4) () ) NEqv (LogicalConstant .true. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ), fpm_command_line: (Module (SymbolTable 2 { fpm_run_settings: (Struct (SymbolTable 3 { bool: (Variable 3 bool [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), float: (Variable 3 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), int: (Variable 3 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) fpm_run_settings (StructType [(Logical 4) (Real 4) (Integer 4)] [] .true. .false. ) [] [int float bool] [] Source Public .false. .false. [] () () ), get_command_line_settings: (Function (SymbolTable 4 { cmd_settings: (Variable 4 cmd_settings [] Out () () Default (Allocatable (StructType [(Logical 4) (Real 4) (Integer 4)] [] .false. .false. ) ) 2 fpm_run_settings Source Public Required .false. .false. .false. () .false. .false. ) }) get_command_line_settings (FunctionType [(Allocatable (StructType [(Logical 4) (Real 4) (Integer 4)] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 cmd_settings)] [(Assignment (Var 4 cmd_settings) (StructConstructor 2 fpm_run_settings [((IntegerConstant 0 (Integer 4) Decimal)) ((RealConstant 1.000000 (Real 4) )) ((LogicalConstant .true. (Logical 4) ))] (StructType [(Logical 4) (Real 4) (Integer 4)] [] .true. .false. ) () ) () .false. .false. )] () Public .false. .false. () ) }) fpm_command_line () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-private1-d8bb7ee.stdout0000664000175000017500000002023715141516316025737 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { foo1: (Module (SymbolTable 2 { }) foo1 () [] .false. .false. .false. ), foo2: (Module (SymbolTable 3 { f: (Function (SymbolTable 4 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 y) (RealConstant 3.000000 (Real 4) ) () .false. .false. )] () Public .false. .false. () ), y: (Variable 3 y [] Local (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) foo2 () [] .false. .false. .false. ), test: (Program (SymbolTable 5 { f: (ExternalSymbol 5 f 3 f foo2 [] f Public ), y: (ExternalSymbol 5 y 3 y foo2 [] y Public ) }) test [foo2] [(Print (StringFormat () [(Var 5 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 5 y) Sub (RealConstant 2.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (SubroutineCall 5 f () [] () .false. ) (Print (StringFormat () [(Var 5 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 5 y) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_type_05-3836aa5.json0000664000175000017500000000075115141516316026373 0ustar alastairalastair{ "basename": "asr-derived_type_05-3836aa5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/derived_type_05.f90", "infile_hash": "5987fece6fa8c1cf630060bab7fdff85f72075755e9b3f64cad7ef86", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-derived_type_05-3836aa5.stderr", "stderr_hash": "8ab69b17b3f68e3089a6b8f9633424b69a4391d810104f78380ae35c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_20-4b5a0e4.json0000664000175000017500000000074515141516316025263 0ustar alastairalastair{ "basename": "asr-arrays_20-4b5a0e4", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_20.f90", "infile_hash": "9b510b477f3e38a2dd4c07f275793e897a598f8252fcfa0870a55899", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_20-4b5a0e4.stdout", "stdout_hash": "175815bbb5332ee02891f9762b038e184509b1f0356c4e3c74bc2179", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-format_01-b8a6dbf.json0000664000175000017500000000074515141516316025423 0ustar alastairalastair{ "basename": "ast-format_01-b8a6dbf", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/format_01.f90", "infile_hash": "4cc04453f51b9adcf8108f25d26d048109fd69c30496888f6f560433", "outfile": null, "outfile_hash": null, "stdout": "ast-format_01-b8a6dbf.stdout", "stdout_hash": "985b7e32d6336a9c9632c673dcdb3545a977da8dabdf0ce724ca5023", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-boz_01-dedad59.stderr0000664000175000017500000000037715141516316025261 0ustar alastairalastairwarning: BOZ literal constant with 'Z' prefix truncated to maximum 16 characters from left to fit data type --> tests/../integration_tests/boz_01.f90:12:13 | 12 | boz_5 = int(Z'2234567890abcdef1') | ^^^^^^^^^^^^^^^^^^^^ BOZ truncation lfortran-lfortran-2f73434/tests/reference/llvm-return_01-495409d.stdout0000664000175000017500000000706115141516316025712 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [12 x i8] c"early return" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [13 x i8] c"normal return" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.1, i32 0, i32 0), i64 13 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [12 x i8] c"main1 called" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data.3, i32 0, i32 0), i64 12 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %main_out = alloca i32, align 4 %2 = call i32 @main1() store i32 %2, i32* %main_out, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } define i32 @main1() { .entry: %i = alloca i32, align 4 %main1 = alloca i32, align 4 store i32 10, i32* %i, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp sgt i32 %0, 5 br i1 %1, label %then, label %else then: ; preds = %.entry %2 = load i32, i32* %i, align 4 store i32 %2, i32* %main1, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %4, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %5 = load i32, i32* %i, align 4 store i32 %5, i32* %main1, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_main1 FINALIZE_SYMTABLE_main1: ; preds = %return %6 = load i32, i32* %main1, align 4 ret i32 %6 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/run-implicit_typing1-40bb07b.stderr0000664000175000017500000000011415141516316027301 0ustar alastairalastairCannot use --disable-implicit-typing and --implicit-typing at the same time lfortran-lfortran-2f73434/tests/reference/asr-type_mismatch2-79a25db.stderr0000664000175000017500000000027715141516316026754 0ustar alastairalastairsemantic error: Type mismatch in binary operator, the types must be compatible --> tests/errors/type_mismatch2.f90:4:5 | 4 | x = 5 + "x" | ^ ^^^ type mismatch (integer and string) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_assign_minimal-c4142fa.stdout0000664000175000017500000000140015141516316031056 0ustar alastairalastair(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ()) (b [] [] () () None ()) (c [] [] () () None ()) (d [] [] () () None ())] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_lapack_01-0d30f43.stdout0000664000175000017500000135025115141516316027400 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_lapack_01: (Program (SymbolTable 23 { cast_r: (ExternalSymbol 23 cast_r 2 cast_r template_lapack_01_m [] cast_r Public ), external_matmul_t: (ExternalSymbol 23 external_matmul_t 2 external_matmul_t template_lapack_01_m [] external_matmul_t Public ), gemm_r: (ExternalSymbol 23 gemm_r 2 gemm_r template_lapack_01_m [] gemm_r Public ), simple_external_matmul: (ExternalSymbol 23 simple_external_matmul 2 simple_external_matmul template_lapack_01_m [] simple_external_matmul Public ), test_template: (ExternalSymbol 23 test_template 2 test_template template_lapack_01_m [] test_template Public ) }) template_lapack_01 [template_lapack_01_m] [(SubroutineCall 23 test_template () [] () .false. )] ), template_lapack_01_m: (Module (SymbolTable 2 { cast_r: (Requirement (SymbolTable 5 { cast: (Function (SymbolTable 6 { arg: (Variable 6 arg [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 6 res [] ReturnVar () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast (FunctionType [(TypeParameter t )] (TypeParameter u ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 6 arg)] [] (Var 6 res) Private .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_r [t u cast] [] ), external_matmul_t: (Template (SymbolTable 7 { cast_to_t: (Function (SymbolTable 9 { arg: (Variable 9 arg [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 9 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_to_t (FunctionType [(Real 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 9 arg)] [] (Var 9 res) Private .false. .false. () ), gemm: (Function (SymbolTable 8 { a: (Variable 8 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), alpha: (Variable 8 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 8 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), beta: (Variable 8 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 8 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 8 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 8 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lda: (Variable 8 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldb: (Variable 8 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldc: (Variable 8 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 8 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 8 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), transa: (Variable 8 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), transb: (Variable 8 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 8 transa) (Var 8 transb) (Var 8 m) (Var 8 n) (Var 8 k) (Var 8 alpha) (Var 8 a) (Var 8 lda) (Var 8 b) (Var 8 ldb) (Var 8 beta) (Var 8 c) (Var 8 ldc)] [] () Private .false. .false. () ), nonsimple_external_matmul: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 10 b [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 10 c [a b] ReturnVar () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 10 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 10 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) nonsimple_external_matmul (FunctionType [(Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray )] (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cast_to_t gemm] [(Var 10 a) (Var 10 b)] [(Assignment (Var 10 m) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 n) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 10 k) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 7 gemm () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 10 m)) ((Var 10 n)) ((Var 10 k)) ((FunctionCall 7 cast_to_t () [((RealConstant 1.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 10 a) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 10 m)) ((ArrayPhysicalCast (Var 10 b) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 10 k)) ((FunctionCall 7 cast_to_t () [((RealConstant 0.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 10 c) PointerArray DescriptorArray (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 10 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () )) ((Var 10 m))] () .false. )] (Var 10 c) Private .false. .false. () ), real: (Variable 7 real [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 7 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) external_matmul_t [t gemm cast_to_t] [(Require gemm_r [t gemm] ) (Require cast_r [real t cast_to_t] )] ), gemm_r: (Requirement (SymbolTable 3 { gemm: (Function (SymbolTable 4 { a: (Variable 4 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), alpha: (Variable 4 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), beta: (Variable 4 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 4 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 4 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 4 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lda: (Variable 4 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldb: (Variable 4 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldc: (Variable 4 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 4 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 4 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), transa: (Variable 4 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), transb: (Variable 4 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 transa) (Var 4 transb) (Var 4 m) (Var 4 n) (Var 4 k) (Var 4 alpha) (Var 4 a) (Var 4 lda) (Var 4 b) (Var 4 ldb) (Var 4 beta) (Var 4 c) (Var 4 ldc)] [] () Private .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) gemm_r [t gemm] [] ), my_cast_to_double: (Function (SymbolTable 14 { a: (Variable 14 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 14 b [] ReturnVar () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. ), dp: (Variable 14 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) my_cast_to_double (FunctionType [(Real 4)] (Real 8) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 14 a)] [(Assignment (Var 14 b) (Cast (Var 14 a) RealToReal (Real 8) () ) () .false. .false. )] (Var 14 b) Private .false. .false. () ), my_cast_to_real: (Function (SymbolTable 13 { a: (Variable 13 a [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 13 b [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) my_cast_to_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .true. .true. .false. .false. .false. [] .false. ) [] [(Var 13 a)] [(Assignment (Var 13 b) (Var 13 a) () .false. .false. )] (Var 13 b) Private .false. .false. () ), my_external_matmul: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 15 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 15 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 15 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 15 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 15 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) my_external_matmul (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 15 a) (Var 15 b)] [(Assignment (Var 15 m) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 n) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 15 k) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 15 m)) ((Var 15 n)) ((Var 15 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 15 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 15 m)) ((ArrayPhysicalCast (Var 15 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 15 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 15 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 15 m))] () .false. )] (Var 15 c) Private .false. .false. () ), my_gemm_double: (Function (SymbolTable 12 { a: (Variable 12 a [lda] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 lda)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), alpha: (Variable 12 alpha [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 12 b [ldb] In () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 ldb)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), beta: (Variable 12 beta [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 12 c [ldc] Out () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (Var 12 ldc)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), dp: (Variable 12 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 12 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lda: (Variable 12 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldb: (Variable 12 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldc: (Variable 12 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 12 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 12 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), transa: (Variable 12 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), transb: (Variable 12 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ) }) my_gemm_double (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (Real 8) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Real 8) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 transa) (Var 12 transb) (Var 12 m) (Var 12 n) (Var 12 k) (Var 12 alpha) (Var 12 a) (Var 12 lda) (Var 12 b) (Var 12 ldb) (Var 12 beta) (Var 12 c) (Var 12 ldc)] [] () Private .false. .false. () ), my_gemm_real: (Function (SymbolTable 11 { a: (Variable 11 a [lda] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 lda)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), alpha: (Variable 11 alpha [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 11 b [ldb] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 ldb)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), beta: (Variable 11 beta [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 11 c [ldc] Out () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 11 ldc)) (() ())] UnboundedPointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 11 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lda: (Variable 11 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldb: (Variable 11 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldc: (Variable 11 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 11 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 11 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), transa: (Variable 11 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), transb: (Variable 11 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ) }) my_gemm_real (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (Real 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4) (Real 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] UnboundedPointerArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 transa) (Var 11 transb) (Var 11 m) (Var 11 n) (Var 11 k) (Var 11 alpha) (Var 11 a) (Var 11 lda) (Var 11 b) (Var 11 ldb) (Var 11 beta) (Var 11 c) (Var 11 ldc)] [] () Private .false. .false. () ), simple_external_matmul: (Template (SymbolTable 16 { cast_to_t: (Function (SymbolTable 18 { arg: (Variable 18 arg [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), res: (Variable 18 res [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) cast_to_t (FunctionType [(Real 4)] (TypeParameter t ) Source Implementation () .true. .true. .false. .false. .false. [] .true. ) [] [(Var 18 arg)] [] (Var 18 res) Private .false. .false. () ), gemm: (Function (SymbolTable 17 { a: (Variable 17 a [lda] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 lda)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), alpha: (Variable 17 alpha [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 17 b [ldb] In () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 ldb)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), beta: (Variable 17 beta [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 17 c [ldc] Out () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (Var 17 ldc)) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 17 k [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), lda: (Variable 17 lda [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldb: (Variable 17 ldb [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ldc: (Variable 17 ldc [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 17 m [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 17 n [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), transa: (Variable 17 transa [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ), transb: (Variable 17 transb [] In () () Default (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Private Required .false. .false. .false. () .false. .false. ) }) gemm (FunctionType [(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (Integer 4) (Integer 4) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 7 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 9 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4) (TypeParameter t ) (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 12 (Integer 4) () )) (() ())] DescriptorArray ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 17 transa) (Var 17 transb) (Var 17 m) (Var 17 n) (Var 17 k) (Var 17 alpha) (Var 17 a) (Var 17 lda) (Var 17 b) (Var 17 ldb) (Var 17 beta) (Var 17 c) (Var 17 ldc)] [] () Private .false. .false. () ), real: (Variable 16 real [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), simple_external_matmul: (Function (SymbolTable 19 { a: (Variable 19 a [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 19 b [] In () () Default (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 19 c [a b] ReturnVar () () Default (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 19 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 19 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 19 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) simple_external_matmul (FunctionType [(Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray )] (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [cast_to_t gemm] [(Var 19 a) (Var 19 b)] [(Assignment (Var 19 m) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 n) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 19 k) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 16 gemm () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 19 m)) ((Var 19 n)) ((Var 19 k)) ((FunctionCall 16 cast_to_t () [((RealConstant 1.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 19 a) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 19 m)) ((ArrayPhysicalCast (Var 19 b) DescriptorArray DescriptorArray (Array (TypeParameter t ) [(() ()) (() ())] DescriptorArray ) () )) ((Var 19 k)) ((FunctionCall 16 cast_to_t () [((RealConstant 0.000000 (Real 4) ))] (TypeParameter t ) () () )) ((ArrayPhysicalCast (Var 19 c) PointerArray DescriptorArray (Array (TypeParameter t ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 19 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () )) ((Var 19 m))] () .false. )] (Var 19 c) Private .false. .false. () ), t: (Variable 16 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) simple_external_matmul [t gemm cast_to_t] [(Require gemm_r [t gemm] ) (Require cast_r [real t cast_to_t] )] ), test_template: (Function (SymbolTable 20 { __instantiated_simple_external_matmul: (Function (SymbolTable 24 { a: (Variable 24 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 24 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 24 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 24 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 24 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 24 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_simple_external_matmul (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 24 a) (Var 24 b)] [(Assignment (Var 24 m) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 n) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 24 k) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 24 m)) ((Var 24 n)) ((Var 24 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 24 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 24 m)) ((ArrayPhysicalCast (Var 24 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 24 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 24 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 24 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 24 m))] () .false. )] (Var 24 c) Private .false. .false. () ), __instantiated_simple_external_matmul1: (Function (SymbolTable 25 { a: (Variable 25 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 25 b [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 25 c [a b] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 25 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 25 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 25 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_simple_external_matmul1 (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray ) (Array (Real 8) [(() ()) (() ())] DescriptorArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_double my_gemm_double] [(Var 25 a) (Var 25 b)] [(Assignment (Var 25 m) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 n) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 25 k) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_double () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 25 m)) ((Var 25 n)) ((Var 25 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 1.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 25 a) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 25 m)) ((ArrayPhysicalCast (Var 25 b) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 25 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 0.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 25 c) PointerArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 25 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 25 m))] () .false. )] (Var 25 c) Private .false. .false. () ), adp: (Variable 20 adp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), asp: (Variable 20 asp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), bdp: (Variable 20 bdp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), bsp: (Variable 20 bsp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), cdp: (Variable 20 cdp [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), csp: (Variable 20 csp [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ), dp: (Variable 20 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), nonsimple_external_matmul_double: (Function (SymbolTable 22 { a: (Variable 22 a [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 22 b [] In () () Default (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 22 c [a b] ReturnVar () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 22 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 22 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 22 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) nonsimple_external_matmul_double (FunctionType [(Array (Real 8) [(() ()) (() ())] DescriptorArray ) (Array (Real 8) [(() ()) (() ())] DescriptorArray )] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 8) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_double my_gemm_double] [(Var 22 a) (Var 22 b)] [(Assignment (Var 22 m) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 n) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 22 k) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_double () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 22 m)) ((Var 22 n)) ((Var 22 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 1.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 22 a) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 22 m)) ((ArrayPhysicalCast (Var 22 b) DescriptorArray UnboundedPointerArray (Array (Real 8) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 22 k)) ((FunctionCall 2 my_cast_to_double () [((RealConstant 0.000000 (Real 4) ))] (Real 8) () () )) ((ArrayPhysicalCast (Var 22 c) PointerArray UnboundedPointerArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 22 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 22 m))] () .false. )] (Var 22 c) Private .false. .false. () ), nonsimple_external_matmul_real: (Function (SymbolTable 21 { a: (Variable 21 a [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), b: (Variable 21 b [] In () () Default (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 21 c [a b] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () Source Private Required .false. .false. .false. () .false. .false. ), k: (Variable 21 k [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), m: (Variable 21 m [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 21 n [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) nonsimple_external_matmul_real (FunctionType [(Array (Real 4) [(() ()) (() ())] DescriptorArray ) (Array (Real 4) [(() ()) (() ())] DescriptorArray )] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 0 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionParam 1 (Array (Real 4) [(() ()) (() ())] DescriptorArray ) () ) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_cast_to_real my_gemm_real] [(Var 21 a) (Var 21 b)] [(Assignment (Var 21 m) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 n) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (Assignment (Var 21 k) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (SubroutineCall 2 my_gemm_real () [((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((StringConstant "n" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) )) ((Var 21 m)) ((Var 21 n)) ((Var 21 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 1.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 21 a) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 21 m)) ((ArrayPhysicalCast (Var 21 b) DescriptorArray UnboundedPointerArray (Array (Real 4) [(() ()) (() ())] UnboundedPointerArray ) () )) ((Var 21 k)) ((FunctionCall 2 my_cast_to_real () [((RealConstant 0.000000 (Real 4) ))] (Real 4) () () )) ((ArrayPhysicalCast (Var 21 c) PointerArray UnboundedPointerArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 a) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () )) ((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 21 b) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ))] UnboundedPointerArray ) () )) ((Var 21 m))] () .false. )] (Var 21 c) Private .false. .false. () ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 20 csp) (FunctionCall 20 __instantiated_simple_external_matmul () [((ArrayPhysicalCast (Var 20 asp) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 20 bsp) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. ) (Assignment (Var 20 cdp) (FunctionCall 20 __instantiated_simple_external_matmul1 () [((ArrayPhysicalCast (Var 20 adp) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 20 bdp) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] DescriptorArray ) () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () .false. .false. )] () Public .false. .false. () ) }) template_lapack_01_m () [template_lapack_01_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-complex_09-aca4085.json0000664000175000017500000000075015141516316025435 0ustar alastairalastair{ "basename": "asr-complex_09-aca4085", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_09.f90", "infile_hash": "d80903c4f2178fa8e1c18c4994aed776370f1ff7aead158c9b77c627", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_09-aca4085.stdout", "stdout_hash": "51ad4456617c0c69f299bc6b70bb7de02209ea2b6c316085617cc663", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-write4-f453580.stdout0000664000175000017500000000004215141516316025127 0ustar alastairalastairhi, how are you? I am doing good lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_03-a66333c.json0000664000175000017500000000076215141516316030534 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_03-a66333c", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_03.f90", "infile_hash": "bf42de38aa218f1c7ac50e28a2823b54baa8da6ffb1516e27b1b92b1", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_03-a66333c.stderr", "stderr_hash": "af018038d9c7ebbafdd09b0e04a876cf371595d7349e982bf850349d", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor14-07dfdb5.stdout0000664000175000017500000000362015141516316031254 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor14: (Program (SymbolTable 2 { }) preprocessor14 [] [(Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X == 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-write_12-63d1bdf.json0000664000175000017500000000071215141516316025213 0ustar alastairalastair{ "basename": "run-write_12-63d1bdf", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/write_12.f90", "infile_hash": "42394d54c876f13509a1b5262f4795cab9e6250def7e7a2ff587ae06", "outfile": null, "outfile_hash": null, "stdout": "run-write_12-63d1bdf.stdout", "stdout_hash": "fe139915db32be5a897a8db16036fbc9bddccb6ce448c78ea2562a0f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_05-00beea9.json0000664000175000017500000000074515141516316025330 0ustar alastairalastair{ "basename": "asr-nested_05-00beea9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_05.f90", "infile_hash": "83b55ebf01581813bce973f49d745813499ef9e09fc0b0a2111f8386", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_05-00beea9.stdout", "stdout_hash": "94476f95305eac31c3092d70332a3fc068166d10c8cc7f3ef70183b8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-expr_08-74f99b7.stdout0000664000175000017500000002124515141516316025272 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (type (;4;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f64 f32 f64 f32) i32.const 8 local.set 0 f32.const 3.000000 local.set 4 local.get 4 i32.const 2 drop local.get 4 f32.mul local.set 2 local.get 4 f64.promote_f32 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 2 f64.promote_f32 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 2 f32.const 9.000000 f32.sub f32.abs f32.const 0.000001 f32.gt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end f64.const 3.000000 local.set 3 local.get 3 i32.const 2 drop local.get 3 f64.mul local.set 1 local.get 3 call 4 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop local.get 1 f64.const 9.000000 f64.sub f64.abs f64.const 0.000000 f64.gt if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $4 (type 4) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 3 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 3 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (export "print_f64" (func 4)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/asr-nested_03-57ffed2.stdout0000664000175000017500000002045115141516316025710 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { nested_03: (Program (SymbolTable 5 { b: (ExternalSymbol 5 b 2 b nested_03_a [] b Public ) }) nested_03 [nested_03_a] [(SubroutineCall 5 b () [] () .false. )] ), nested_03_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { c: (Function (SymbolTable 4 { }) c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(IntegerConstant 5 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 3 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 3 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 x) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 6.000000 (Real 4) ) ) () .false. .false. ) (Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (SubroutineCall 3 c () [] () .false. )] () Public .false. .false. () ) }) nested_03_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-complex_dp-ec165b1.stdout0000664000175000017500000001451215141516316026163 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { complex_dp: (Program (SymbolTable 2 { v: (Variable 2 v [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) complex_dp [] [(Assignment (Var 2 zero) (Cast (RealConstant 0.000000 (Real 4) ) RealToComplex (Complex 4) (ComplexConstant 0.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 v) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 4) ) (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) ) ComplexToComplex (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) ) () .false. .false. ) (Assignment (Var 2 x) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4) ) (RealConstant 1.050000 (Real 8) ) (Complex 8) (ComplexConstant 1.050000 1.050000 (Complex 8) ) ) ComplexToComplex (Complex 4) (ComplexConstant 1.050000 1.050000 (Complex 4) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 v) (Var 2 x) (Var 2 zero)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor9-641e112.stdout0000664000175000017500000001253715141516316030757 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor9: (Program (SymbolTable 2 { }) preprocessor9 [] [(Print (StringFormat () [(IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) Add (IntegerConstant 4 (Integer 4) Decimal) (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 15 (Integer 4) Decimal) ) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 21 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 6 (Integer 4) Decimal) ) Add (IntegerBinOp (IntegerConstant 4 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant 3 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 12 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 23 (Integer 4) Decimal) ) Add (IntegerConstant 6 (Integer 4) Decimal) (Integer 4) (IntegerConstant 29 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_01-33c47db.stdout0000664000175000017500000004507615141516316030756 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data = private constant [4 x i8] c"T*T:" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.2 = private constant [4 x i8] c"T*F:" @string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.2, i32 0, i32 0), i64 4 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.4 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.5 = private constant [4 x i8] c"F*T:" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.5, i32 0, i32 0), i64 4 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.7 = private unnamed_addr constant [11 x i8] c"S-DESC-4,L\00", align 1 @string_const_data.8 = private constant [4 x i8] c"F*F:" @string_const.9 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.8, i32 0, i32 0), i64 4 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.10 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.11 = private constant [4 x i8] c"T+T:" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.11, i32 0, i32 0), i64 4 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.13 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.14 = private constant [4 x i8] c"T+F:" @string_const.15 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.14, i32 0, i32 0), i64 4 }> @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.16 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.17 = private constant [4 x i8] c"F+T:" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.17, i32 0, i32 0), i64 4 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.19 = private unnamed_addr constant [12 x i8] c"S-DESC-4,I4\00", align 1 @string_const_data.20 = private constant [4 x i8] c"F+F:" @string_const.21 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.20, i32 0, i32 0), i64 4 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i1* %log1, i1* %log2) { .entry: %bin_add = alloca i32, align 4 %0 = load i1, i1* %log1, align 1 %1 = load i1, i1* %log2, align 1 %2 = icmp eq i1 %0, false %3 = select i1 %2, i1 %0, i1 %1 br i1 %3, label %then, label %else then: ; preds = %.entry store i32 2, i32* %bin_add, align 4 br label %ifcont3 else: ; preds = %.entry %4 = load i1, i1* %log1, align 1 %5 = xor i1 %4, true %6 = load i1, i1* %log2, align 1 %7 = xor i1 %6, true %8 = icmp eq i1 %5, false %9 = select i1 %8, i1 %5, i1 %7 br i1 %9, label %then1, label %else2 then1: ; preds = %else store i32 0, i32* %bin_add, align 4 br label %ifcont else2: ; preds = %else store i32 1, i32* %bin_add, align 4 br label %ifcont ifcont: ; preds = %else2, %then1 br label %ifcont3 ifcont3: ; preds = %ifcont, %then br label %return return: ; preds = %ifcont3 br label %FINALIZE_SYMTABLE_bin_add FINALIZE_SYMTABLE_bin_add: ; preds = %return %10 = load i32, i32* %bin_add, align 4 ret i32 %10 } define i1 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i1* %log1, i1* %log2) { .entry: %logical_and = alloca i1, align 1 %0 = load i1, i1* %log1, align 1 %1 = load i1, i1* %log2, align 1 %2 = icmp eq i1 %0, false %3 = select i1 %2, i1 %0, i1 %1 store i1 %3, i1* %logical_and, align 1 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_logical_and FINALIZE_SYMTABLE_logical_and: ; preds = %return %4 = load i1, i1* %logical_and, align 1 ret i1 %4 } define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %f = alloca i1, align 1 store i1 false, i1* %f, align 1 %t = alloca i1, align 1 store i1 true, i1* %t, align 1 %2 = alloca i64, align 8 %3 = call i1 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i1* %t, i1* %t) %4 = alloca i1, align 1 store i1 %3, i1* %4, align 1 %5 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, %string_descriptor* @string_const, i1* %4) %6 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %5, i8** %7, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %6, i64* %8, align 4 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %10 = load i8*, i8** %9, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %12 = load i64, i64* %11, align 4 %13 = trunc i64 %12 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %14 = icmp eq i8* %5, null br i1 %14, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %5) br label %free_done free_done: ; preds = %free_nonnull, %.entry %15 = alloca i64, align 8 %16 = call i1 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i1* %t, i1* %f) %17 = alloca i1, align 1 store i1 %16, i1* %17, align 1 %18 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.1, i32 0, i32 0), i64* %15, i32 0, i32 0, %string_descriptor* @string_const.3, i1* %17) %19 = load i64, i64* %15, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %18, i8** %20, align 8 %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %19, i64* %21, align 4 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %23 = load i8*, i8** %22, align 8 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %25 = load i64, i64* %24, align 4 %26 = trunc i64 %25 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %23, i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %27 = icmp eq i8* %18, null br i1 %27, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %18) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %28 = alloca i64, align 8 %29 = call i1 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i1* %f, i1* %t) %30 = alloca i1, align 1 store i1 %29, i1* %30, align 1 %31 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.4, i32 0, i32 0), i64* %28, i32 0, i32 0, %string_descriptor* @string_const.6, i1* %30) %32 = load i64, i64* %28, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %31, i8** %33, align 8 %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %32, i64* %34, align 4 %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %36 = load i8*, i8** %35, align 8 %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %38 = load i64, i64* %37, align 4 %39 = trunc i64 %38 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %40 = icmp eq i8* %31, null br i1 %40, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %31) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 %41 = alloca i64, align 8 %42 = call i1 @__module_operator_overloading_01_overload_asterisk_m_logical_and(i1* %f, i1* %f) %43 = alloca i1, align 1 store i1 %42, i1* %43, align 1 %44 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @serialization_info.7, i32 0, i32 0), i64* %41, i32 0, i32 0, %string_descriptor* @string_const.9, i1* %43) %45 = load i64, i64* %41, align 4 %stringFormat_desc7 = alloca %string_descriptor, align 8 %46 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 store i8* %44, i8** %46, align 8 %47 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 store i64 %45, i64* %47, align 4 %48 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0 %49 = load i8*, i8** %48, align 8 %50 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1 %51 = load i64, i64* %50, align 4 %52 = trunc i64 %51 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %49, i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) %53 = icmp eq i8* %44, null br i1 %53, label %free_done9, label %free_nonnull8 free_nonnull8: ; preds = %free_done6 call void @_lfortran_free(i8* %44) br label %free_done9 free_done9: ; preds = %free_nonnull8, %free_done6 %54 = alloca i64, align 8 %55 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i1* %t, i1* %t) %56 = alloca i32, align 4 store i32 %55, i32* %56, align 4 %57 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.10, i32 0, i32 0), i64* %54, i32 0, i32 0, %string_descriptor* @string_const.12, i32* %56) %58 = load i64, i64* %54, align 4 %stringFormat_desc10 = alloca %string_descriptor, align 8 %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 store i8* %57, i8** %59, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 store i64 %58, i64* %60, align 4 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0 %62 = load i8*, i8** %61, align 8 %63 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1 %64 = load i64, i64* %63, align 4 %65 = trunc i64 %64 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %62, i32 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) %66 = icmp eq i8* %57, null br i1 %66, label %free_done12, label %free_nonnull11 free_nonnull11: ; preds = %free_done9 call void @_lfortran_free(i8* %57) br label %free_done12 free_done12: ; preds = %free_nonnull11, %free_done9 %67 = alloca i64, align 8 %68 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i1* %t, i1* %f) %69 = alloca i32, align 4 store i32 %68, i32* %69, align 4 %70 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.13, i32 0, i32 0), i64* %67, i32 0, i32 0, %string_descriptor* @string_const.15, i32* %69) %71 = load i64, i64* %67, align 4 %stringFormat_desc13 = alloca %string_descriptor, align 8 %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 store i8* %70, i8** %72, align 8 %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 store i64 %71, i64* %73, align 4 %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 0 %75 = load i8*, i8** %74, align 8 %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc13, i32 0, i32 1 %77 = load i64, i64* %76, align 4 %78 = trunc i64 %77 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %75, i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1) %79 = icmp eq i8* %70, null br i1 %79, label %free_done15, label %free_nonnull14 free_nonnull14: ; preds = %free_done12 call void @_lfortran_free(i8* %70) br label %free_done15 free_done15: ; preds = %free_nonnull14, %free_done12 %80 = alloca i64, align 8 %81 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i1* %f, i1* %t) %82 = alloca i32, align 4 store i32 %81, i32* %82, align 4 %83 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.16, i32 0, i32 0), i64* %80, i32 0, i32 0, %string_descriptor* @string_const.18, i32* %82) %84 = load i64, i64* %80, align 4 %stringFormat_desc16 = alloca %string_descriptor, align 8 %85 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 store i8* %83, i8** %85, align 8 %86 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 store i64 %84, i64* %86, align 4 %87 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 0 %88 = load i8*, i8** %87, align 8 %89 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc16, i32 0, i32 1 %90 = load i64, i64* %89, align 4 %91 = trunc i64 %90 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %88, i32 %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) %92 = icmp eq i8* %83, null br i1 %92, label %free_done18, label %free_nonnull17 free_nonnull17: ; preds = %free_done15 call void @_lfortran_free(i8* %83) br label %free_done18 free_done18: ; preds = %free_nonnull17, %free_done15 %93 = alloca i64, align 8 %94 = call i32 @__module_operator_overloading_01_overload_asterisk_m_bin_add(i1* %f, i1* %f) %95 = alloca i32, align 4 store i32 %94, i32* %95, align 4 %96 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info.19, i32 0, i32 0), i64* %93, i32 0, i32 0, %string_descriptor* @string_const.21, i32* %95) %97 = load i64, i64* %93, align 4 %stringFormat_desc19 = alloca %string_descriptor, align 8 %98 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 store i8* %96, i8** %98, align 8 %99 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 store i64 %97, i64* %99, align 4 %100 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0 %101 = load i8*, i8** %100, align 8 %102 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1 %103 = load i64, i64* %102, align 4 %104 = trunc i64 %103 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %101, i32 %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) %105 = icmp eq i8* %96, null br i1 %105, label %free_done21, label %free_nonnull20 free_nonnull20: ; preds = %free_done18 call void @_lfortran_free(i8* %96) br label %free_done21 free_done21: ; preds = %free_nonnull20, %free_done18 call void @_lpython_free_argv() br label %return return: ; preds = %free_done21 br label %FINALIZE_SYMTABLE_operator_overloading_01 FINALIZE_SYMTABLE_operator_overloading_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/cpp-types_06-a5c2d06.stdout0000664000175000017500000000565715141516316025507 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; r = (float)(2); i = 2; if (i < i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r < r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r < (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) < r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i > i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r > r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r > (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) > r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i != i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r != r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r != (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) != r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i + 1 <= i) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r + (float)(1) <= r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r + (float)(1) <= (float)(i)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i + 1) <= r) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i >= i + 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r >= r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r >= (float)(i + 1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) >= r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (i == i + 1) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r == r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if (r == (float)(i + 1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } if ((float)(i) == r + (float)(1)) { std::cerr << "ERROR STOP" << std::endl; exit(1); } } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-doloop_04-6ff18c8.stdout0000664000175000017500000003470215141516316025652 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { doloop_04: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) doloop_04 [] [(Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (Var 2 k)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 k) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) (IntegerConstant -2 (Integer 4) Decimal) ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 k)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 30 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 j)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop a ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) ()) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit a )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop b ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(Exit b )] [] )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 j) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (WhileLoop c (LogicalConstant .true. (Logical 4) ) [(Assignment (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) () ) [(Exit c )] [] ) (Assignment (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (If () (IntegerCompare (Var 2 j) NotEq (IntegerConstant 3 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 k) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (Var 2 k)) [(GoToTarget 100 100 )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fn3-5eccc1b.stdout0000664000175000017500000000464515141516316024666 0ustar alastairalastair(TranslationUnit [(Function a [] [(SimpleAttribute AttrRecursive ) (SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function b [] [(SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None ) (SimpleAttribute AttrElemental )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function c [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure ) (AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [] [] [] ) (Function cb [] [(SimpleAttribute AttrElemental ) (SimpleAttribute AttrPure )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(cb [] [] () () None ())] () )] [] [] [] ) (Function d [] [(AttrType TypeInteger [] () () None ) (SimpleAttribute AttrPure ) (SimpleAttribute AttrRecursive )] () () () [] [] [] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_13-3345127.json0000664000175000017500000000075615141516316025562 0ustar alastairalastair{ "basename": "asr-functions_13-3345127", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_13.f90", "infile_hash": "e625d7c90c838445296950a369041b1132188905e8340872684a96e5", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_13-3345127.stdout", "stdout_hash": "5269cc157dd0cd856e51369b3c495ce022a4cbf55d209811be42a51e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-statement1-481e9b6.stdout0000664000175000017500000007251015141516316026054 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { statement1: (Program (SymbolTable 2 { dfloat: (Function (SymbolTable 4 { dfloat_return_var_name: (Variable 4 dfloat_return_var_name [] ReturnVar () () Default (Real 8) 2 dfloat Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 4 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 4 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) dfloat (FunctionType [(Integer 4) (Integer 4)] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 i) (Var 4 j)] [(Assignment (Var 4 dfloat_return_var_name) (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4) () ) IntegerToReal (Real 8) () ) () .false. .false. )] (Var 4 dfloat_return_var_name) Public .false. .false. () ), dp: (Variable 2 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 0.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ifloat: (Function (SymbolTable 5 { i: (Variable 5 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ifloat_return_var_name: (Variable 5 ifloat_return_var_name [] ReturnVar () () Default (Integer 4) 2 ifloat Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 5 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) ifloat (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 i) (Var 5 j)] [(Assignment (Var 5 ifloat_return_var_name) (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4) () ) () .false. .false. )] (Var 5 ifloat_return_var_name) Public .false. .false. () ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sfloat: (Function (SymbolTable 3 { i: (Variable 3 i [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 3 j [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sfloat_return_var_name: (Variable 3 sfloat_return_var_name [] ReturnVar () () Default (Real 4) 2 sfloat Source Public Required .false. .false. .false. () .false. .false. ) }) sfloat (FunctionType [(Integer 4) (Integer 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 i) (Var 3 j)] [(Assignment (Var 3 sfloat_return_var_name) (Cast (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4) () ) IntegerToReal (Real 4) () ) () .false. .false. )] (Var 3 sfloat_return_var_name) Public .false. .false. () ), sum: (Variable 2 sum [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), ti: (Variable 2 ti [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) statement1 [] [(Assignment (Var 2 ti) (FunctionCall 2 sfloat () [((IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 8 (Integer 4) Decimal))] (Real 4) () () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 ti) Sub (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 8.000000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 sum) (RealBinOp (FunctionCall 2 sfloat () [((IntegerConstant 12 (Integer 4) Decimal)) ((IntegerConstant 9 (Integer 4) Decimal))] (Real 4) () () ) Add (RealConstant 12.420000 (Real 4) ) (Real 4) () ) () .false. .false. ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 sum) Sub (RealConstant 120.419998 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (RealConstant 0.000010 (Real 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (FunctionCall 2 dfloat () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Real 8) () () ) Sub (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) ) (Real 8) () )] 0 (Real 8) () ) Gt (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (FunctionCall 2 ifloat () [((IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 4 (Integer 4) Decimal))] (Integer 4) () () ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_30-93f854c.stdout0000664000175000017500000016424715141516316026472 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_30: (Program (SymbolTable 2 { a1: (Variable 2 a1 [] Local (TypeInquiry Range (Integer 4) (IntegerConstant 11 (Integer 4) Decimal) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a2: (Variable 2 a2 [] Local (TypeInquiry Range (Real 4) (RealConstant 22.900000 (Real 4) ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), a3: (Variable 2 a3 [] Local (TypeInquiry Range (Complex 4) (ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ar1: (Variable 2 ar1 [] Local (TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) (IntegerConstant 9 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ar2: (Variable 2 ar2 [] Local (TypeInquiry Range (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [1.00000000e+00, 2.10000000e+01, 1.30000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ar3: (Variable 2 ar3 [] Local (TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 31.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 51 (Integer 4) Decimal) (IntegerConstant 62 (Integer 4) Decimal) (Complex 4) (ComplexConstant 51.000000 62.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) (IntegerConstant 37 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), arr1: (Variable 2 arr1 [] Local (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 12 [1, 21, 13] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), arr2: (Variable 2 arr2 [] Local (Cast (ArrayConstant 12 [1.00000000e+00, 2.10000000e+01, 1.30000000e+01] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) RealToReal (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [1.0000000000000000e+00, 2.1000000000000000e+01, 1.3000000000000000e+01] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) (ArrayConstant 24 [1.0000000000000000e+00, 2.1000000000000000e+01, 1.3000000000000000e+01] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), arr3: (Variable 2 arr3 [] Local (ArrayConstructor [(ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 31 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal) (Complex 4) (ComplexConstant 31.000000 4.000000 (Complex 4) ) ) (ComplexConstructor (IntegerConstant 51 (Integer 4) Decimal) (IntegerConstant 62 (Integer 4) Decimal) (Complex 4) (ComplexConstant 51.000000 62.000000 (Complex 4) ) )] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayConstant 12 [(1.00000000e+00, 2.00000000e+00), (3.10000000e+01, 4.00000000e+00), (5.10000000e+01, 6.20000000e+01)] (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c1: (Variable 2 c1 [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), c2: (Variable 2 c2 [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), i1: (Variable 2 i1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i2: (Variable 2 i2 [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ), i3: (Variable 2 i3 [] Local () () Default (Integer 1) () Source Public Required .false. .false. .false. () .false. .false. ), i4: (Variable 2 i4 [] Local () () Default (Integer 2) () Source Public Required .false. .false. .false. () .false. .false. ), int16: (ExternalSymbol 2 int16 4 int16 lfortran_intrinsic_iso_fortran_env [] int16 Public ), int8: (ExternalSymbol 2 int8 4 int8 lfortran_intrinsic_iso_fortran_env [] int8 Public ), r1: (Variable 2 r1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r2: (Variable 2 r2 [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), ri3: (Variable 2 ri3 [i3] Local (TypeInquiry Range (Integer 1) (Var 2 i3) (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ri4: (Variable 2 ri4 [i4] Local (TypeInquiry Range (Integer 2) (Var 2 i4) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) intrinsics_30 [iso_fortran_env] [(Print (StringFormat () [(Var 2 a1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a1) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a2) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 a3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 a3) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar1) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar2)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar2) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(Var 2 ar3)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ar3) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 ri3) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ri3) NotEq (IntegerConstant 2 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 ri4) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 ri4) NotEq (IntegerConstant 4 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 4) (Var 2 i1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Integer 4) (Var 2 i1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Integer 8) (Var 2 i2) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Integer 8) (Var 2 i2) (Integer 4) (IntegerConstant 18 (Integer 4) Decimal) ) NotEq (IntegerConstant 18 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Real 4) (Var 2 r1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Real 4) (Var 2 r1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Real 8) (Var 2 r2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Real 8) (Var 2 r2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Complex 4) (Var 2 c1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Complex 4) (Var 2 c1) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Complex 8) (Var 2 c2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Complex 8) (Var 2 c2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr1) (Integer 4) (IntegerConstant 9 (Integer 4) Decimal) ) NotEq (IntegerConstant 9 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr2) (Integer 4) (IntegerConstant 307 (Integer 4) Decimal) ) NotEq (IntegerConstant 307 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] ) (Print (StringFormat () [(TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr3) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (TypeInquiry Range (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (Var 2 arr3) (Integer 4) (IntegerConstant 37 (Integer 4) Decimal) ) NotEq (IntegerConstant 37 (Integer 4) Decimal) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-goto_04-2487215.stdout0000664000175000017500000003362115141516316025074 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { goto_04: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) goto_04 [] [(Assignment (Var 2 n) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 10 (Integer 4) Decimal) () .false. .false. ) (Select () (IntegerBinOp (Var 2 n) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 1 1 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 2 2 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 3 3 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 1 1 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 2 2 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 20 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 3 3 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 30 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 70 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 4 4 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 5 5 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 6 6 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 4 4 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 40 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 5 5 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 50 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 6 6 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 60 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 130 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Select () (IntegerBinOp (Var 2 n) Mul (Var 2 n) (Integer 4) () ) [(CaseStmt [(IntegerConstant 1 (Integer 4) Decimal)] [(GoTo 7 7 )] .false. ) (CaseStmt [(IntegerConstant 2 (Integer 4) Decimal)] [(GoTo 8 8 )] .false. ) (CaseStmt [(IntegerConstant 3 (Integer 4) Decimal)] [(GoTo 9 9 )] .false. )] [] .false. ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 7 7 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 70 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 8 8 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 80 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (GoToTarget 9 9 ) (Assignment (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 90 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. ) (If () (IntegerCompare (Var 2 a) NotEq (IntegerConstant 375 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-array1-20700fb.stdout0000664000175000017500000003504315141516316025144 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array1: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b2: (Variable 2 b2 [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b3: (Variable 2 b3 [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), e2: (Variable 2 e2 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), e3: (Variable 2 e3 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 2 g [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), g2: (Variable 2 g2 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), g3: (Variable 2 g3 [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array1 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_14-8de1244.json0000664000175000017500000000074315141516316027556 0ustar alastairalastair{ "basename": "run-array_bounds_check_14-8de1244", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_14.f90", "infile_hash": "903c2c243c58a9f5be4755cc907a5af3c34f90078c03dd8850a7e932", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_14-8de1244.stderr", "stderr_hash": "a7666d009183e9e5c23db0035797111ea99d5c78d6313e5a7905ae78", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-implicit7-9099c07.stderr0000664000175000017500000000023315141516316025564 0ustar alastairalastairstyle suggestion: Use real(8) instead of real*8 --> tests/implicit7.f90:4:14 | 4 | implicit real*8 (k) | ^ help: write this as 'real(8)' lfortran-lfortran-2f73434/tests/reference/asr-openmp_36-256dd0e.json0000664000175000017500000000074515141516316025274 0ustar alastairalastair{ "basename": "asr-openmp_36-256dd0e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/openmp_36.f90", "infile_hash": "f48dc6ec6f143a79f095e90fb2647aa59956956c87447239da79a2d2", "outfile": null, "outfile_hash": null, "stdout": "asr-openmp_36-256dd0e.stdout", "stdout_hash": "0e5af3227b3134d1e7ccf3083ff387961b9f41c31fd74f50c6f5dff4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bin_op_complex_dp-26e149c.json0000664000175000017500000000077515141516316027075 0ustar alastairalastair{ "basename": "asr-bin_op_complex_dp-26e149c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bin_op_complex_dp.f90", "infile_hash": "9be1b396941b73e1466a46963ee3ade085440ce077b444ce7e2f6baf", "outfile": null, "outfile_hash": null, "stdout": "asr-bin_op_complex_dp-26e149c.stdout", "stdout_hash": "2a59aef07c8480d57562fe8d28e42a42a3e2312d98b56934592c4e22", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string1-f6332d9.json0000664000175000017500000000071215141516316024776 0ustar alastairalastair{ "basename": "asr-string1-f6332d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/string1.f90", "infile_hash": "1040f26c6305caccd70cc05aafb7f084fe9c817cc6b906ca40223634", "outfile": null, "outfile_hash": null, "stdout": "asr-string1-f6332d9.stdout", "stdout_hash": "4f8f63849ea07f8032bfcfb6ca5e8ce8cd16ce57e91e0d0ff030e6ae", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-case_01-dcc012a.stdout0000664000175000017500000000103015141516316025762 0ustar alastairalastairprogram case_01 implicit none integer(8) :: i, out i = 4 select case (i) case (1) out = 10 print *, "1" case (2) out = 20 print *, "2" case (3) out = 30 print *, "3" case (4) out = 40 print *, "4" end select if (out /= 40) then error stop end if select case (i) case (1) out = 11 print *, "1" case (2, 3, 4) out = 22 print *, "2,3,4" end select if (out /= 22) then error stop end if end program case_01 lfortran-lfortran-2f73434/tests/reference/asr-array_02_transfer-1bcc806.stdout0000664000175000017500000000701515141516316027354 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array_02_transfer: (Program (SymbolTable 2 { m: (Variable 2 m [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array_02_transfer [] [(Assignment (Var 2 m) (ArrayConstant 28 [1, 0, 0, ...., 5, 0, 0] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(BitCast (Var 2 m) (ArrayConstant 4 [1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal))] FixedSizeArray ) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_mul_test-5a74811.stdout0000664000175000017500000001572715141516316027456 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.2 = private unnamed_addr constant [8 x i8] c"{R4,R4}\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 %2 = load %complex_4, %complex_4* %x, align 1 %3 = extractvalue %complex_4 %2, 0 %4 = extractvalue %complex_4 %2, 1 %5 = fmul float %3, 4.000000e+00 %6 = fmul float %4, 0.000000e+00 %7 = fmul float %3, 0.000000e+00 %8 = fmul float %4, 4.000000e+00 %9 = fsub float %5, %6 %10 = fadd float %7, %8 %11 = insertvalue %complex_4 undef, float %9, 0 %12 = insertvalue %complex_4 %11, float %10, 1 store %complex_4 %12, %complex_4* %x, align 1 %13 = alloca i64, align 8 %14 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info, i32 0, i32 0), i64* %13, i32 0, i32 0, %complex_4* %x) %15 = load i64, i64* %13, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %14, i8** %16, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %15, i64* %17, align 4 %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %19 = load i8*, i8** %18, align 8 %20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %21 = load i64, i64* %20, align 4 %22 = trunc i64 %21 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %19, i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %23 = icmp eq i8* %14, null br i1 %23, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %14) br label %free_done free_done: ; preds = %free_nonnull, %.entry %24 = load %complex_4, %complex_4* %x, align 1 %25 = extractvalue %complex_4 %24, 0 %26 = extractvalue %complex_4 %24, 1 %27 = fmul float 2.000000e+00, %25 %28 = fmul float 0.000000e+00, %26 %29 = fmul float 2.000000e+00, %26 %30 = fmul float 0.000000e+00, %25 %31 = fsub float %27, %28 %32 = fadd float %29, %30 %33 = insertvalue %complex_4 undef, float %31, 0 %34 = insertvalue %complex_4 %33, float %32, 1 store %complex_4 %34, %complex_4* %x, align 1 %35 = alloca i64, align 8 %36 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.1, i32 0, i32 0), i64* %35, i32 0, i32 0, %complex_4* %x) %37 = load i64, i64* %35, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %36, i8** %38, align 8 %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %37, i64* %39, align 4 %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %41 = load i8*, i8** %40, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %43 = load i64, i64* %42, align 4 %44 = trunc i64 %43 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %41, i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %45 = icmp eq i8* %36, null br i1 %45, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %36) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done %46 = load %complex_4, %complex_4* %x, align 1 %47 = extractvalue %complex_4 %46, 0 %48 = extractvalue %complex_4 %46, 1 %49 = fmul float %47, 0.000000e+00 %50 = fmul float %48, 3.000000e+00 %51 = fmul float %47, 3.000000e+00 %52 = fmul float %48, 0.000000e+00 %53 = fsub float %49, %50 %54 = fadd float %51, %52 %55 = insertvalue %complex_4 undef, float %53, 0 %56 = insertvalue %complex_4 %55, float %54, 1 store %complex_4 %56, %complex_4* %x, align 1 %57 = alloca i64, align 8 %58 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @serialization_info.2, i32 0, i32 0), i64* %57, i32 0, i32 0, %complex_4* %x) %59 = load i64, i64* %57, align 4 %stringFormat_desc4 = alloca %string_descriptor, align 8 %60 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 store i8* %58, i8** %60, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 store i64 %59, i64* %61, align 4 %62 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 0 %63 = load i8*, i8** %62, align 8 %64 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc4, i32 0, i32 1 %65 = load i64, i64* %64, align 4 %66 = trunc i64 %65 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %63, i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %67 = icmp eq i8* %58, null br i1 %67, label %free_done6, label %free_nonnull5 free_nonnull5: ; preds = %free_done3 call void @_lfortran_free(i8* %58) br label %free_done6 free_done6: ; preds = %free_nonnull5, %free_done3 call void @_lpython_free_argv() br label %return return: ; preds = %free_done6 br label %FINALIZE_SYMTABLE_complex2 FINALIZE_SYMTABLE_complex2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do1-87a7869.stderr0000664000175000017500000000030715141516316027055 0ustar alastairalastairsemantic error: The end variable of the data implied do loop must be constants --> tests/errors/data_implied_do1.f90:5:24 | 5 | data(iarx(i), i=1, k) / 1, 2, 3 / | ^ lfortran-lfortran-2f73434/tests/reference/ast_f90-complex_01-e4954b1.json0000664000175000017500000000076315141516316026041 0ustar alastairalastair{ "basename": "ast_f90-complex_01-e4954b1", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/complex_01.f90", "infile_hash": "e94aebc987a1655b49e1e31229a6c24ccdbed83af0ebf6a0fb4684f2", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-complex_01-e4954b1.stdout", "stdout_hash": "9b5ef2a8f61a2e9ab570290bdd332045b33d0222f0b927bdf95114d7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface3-6416a61.json0000664000175000017500000000072315141516316025346 0ustar alastairalastair{ "basename": "ast-interface3-6416a61", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/interface3.f90", "infile_hash": "9c989830fc31137b020ceb346dcbee1b2c6d5da1795c1eebfb9ce039", "outfile": null, "outfile_hash": null, "stdout": "ast-interface3-6416a61.stdout", "stdout_hash": "fab9199efee44cc0cd905080c9f249113e50fad833b8d6ab521055a2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-dim_float_01-74fa3d6.stderr0000664000175000017500000000025215141516316026254 0ustar alastairalastairsemantic error: Invalid argument type for `dim` or `mask` --> tests/errors/dim_float_01.f90:2:26 | 2 | print *, sum([1, 2, 3], 1.1) | ^^^ lfortran-lfortran-2f73434/tests/reference/ast-subroutine2-c8b0b6f.stdout0000664000175000017500000003001015141516316026367 0ustar alastairalastair(TranslationUnit [(Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y () ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(EndOfLine) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) () )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon) (Semicolon) (EndOfLine)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon) (Semicolon) (Semicolon) (EndOfLine)] ) )] [] [] ) (Subroutine g [] [] () (TriviaNode [(Semicolon)] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 x y (TriviaNode [] [(Semicolon)] ) ) (Assignment 0 x (* 2 y) (TriviaNode [] [(Semicolon)] ) )] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Assignment 0 subroutine y () ) (Assignment 0 x (* 2 subroutine) () )] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [] [] [] ) (Subroutine f [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(x [] [] () () None ())] () )] [] [] [] ) (Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [] [] [] ) (Subroutine f [(a) (b) (c) (d)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent Out )] [(a [] [] () () None ()) (b [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(c [] [] () () None ()) (d [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(z [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(y [] [] () () None ())] () )] [] [] [] ) (Subroutine saxpy [(n) (a) (x) (y)] [] () () [] [] [] [(Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent In )] [(x [(() () DimensionExpr)] [] () () None ()) (a [] [] () () None ())] () ) (Declaration (AttrType TypeReal [(() dp Value)] () () None ) [(AttrIntent InOut )] [(y [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 n () [(Assignment 0 (FuncCallOrArray y [] [(() i () 0)] [] [] [] ) (+ (* a (FuncCallOrArray x [] [(() i () 0)] [] [] [] )) (FuncCallOrArray y [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name4-76fda17.stdout0000664000175000017500000000027215141516316030161 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":11,"line":4},"end":{"character":24,"line":4}},"uri":"tests/lookup_name4.f90"},"name":"tparset_","filename":"tests/lookup_name4.f90"}]lfortran-lfortran-2f73434/tests/reference/ast-write1-170ef53.stdout0000664000175000017500000001073715141516316025177 0ustar alastairalastair(TranslationUnit [(Program write_01 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Write 0 [(()) (())] [] [(String "a" ()) 2] () ) (Write 0 [(()) (())] [] [] () ) (Write 0 [(())] [] [a] () ) (Write 0 [(out_str) ((String "(\" Found index \", i9,\" but item is not in list.\")" ()))] [] [index] () ) (Write 0 [(out_string) (())] [] [(String "Scalar_in = " ()) scalar_in] () ) (Write 0 [(out_string) (10)] [] [int_src int_given int_expected] () ) (Write 0 [(string)] [(fmt (String "(f6.2)" ()))] [max_angle] () ) (Write 0 [(fmt) ((String "(\"(i\",i0,\".\",i0,\")\")" ()))] [] [n n] () ) (Write 0 [] [(unit ()) (fmt (String "(a)" ()))] [(StrOp (StrOp (FuncCallOrArray trim [] [(() prog () 0)] [] [] [] ) Concat (String ": " ()) ) Concat message )] () ) (Write 0 [] [(unit 0) (fmt (String "(a,i4.4)" ()))] [(StrOp (StrOp (String "Assertion failed at " ()) Concat file ) Concat (String ":" ()) ) line] () ) (Write 0 [(())] [(fmt (String "(a,l1)" ()))] [(String "exactly_conservative= " ()) exactly_conservative] () ) (Write 0 [] [(unit lun)] [vec] () ) (Write 0 [(()) ((String "(a,a)" ()))] [(advance (String "no" ()))] [(FuncCallOrArray trim [] [(() input_string () 0)] [] [] [] ) (String ": " ())] () ) (Write 0 [(ounit)] [(FMT 303) (ADVANCE (String "NO" ()))] [] () ) (Write 0 [(()) (201)] [] [(ImpliedDoLoop [star] i 1 80 () )] () ) (Write 0 [(()) ((String "(1X,A)" ()))] [] [(String "Success!" ())] () ) (Write 0 [(ounit) (())] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "2" ())] () ) (Print 0 () [] () ) (Print 0 (String "(a, es22.14)" ()) [(String "Ekin: " ()) Ekin] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit7-9099c07.json0000664000175000017500000000106215141516316025233 0ustar alastairalastair{ "basename": "asr-implicit7-9099c07", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit7.f90", "infile_hash": "f389525fdeb3f01a6e2f3902da259e8c9b117370a482a4d4bc9d1b01", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit7-9099c07.stdout", "stdout_hash": "435f9d22e0fa175dc49146ce049b25344ec740d1f41da556b20763a6", "stderr": "asr-implicit7-9099c07.stderr", "stderr_hash": "990f7ef15c8d2c60ec8d73a265e14bb411465d30f296b633a274ad4f", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-template_simple_03-17a83b7.json0000664000175000017500000000100015141516316027060 0ustar alastairalastair{ "basename": "asr-template_simple_03-17a83b7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_simple_03.f90", "infile_hash": "4b9fce92a050c8b14e32eac9f65dc1f46314f8397d313b4bd772f0d4", "outfile": null, "outfile_hash": null, "stdout": "asr-template_simple_03-17a83b7.stdout", "stdout_hash": "e5b304c0c31134d07a55d9746d7f004f8b5b17add81240f33c3da7ce", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-types_04-513a7e4.stdout0000664000175000017500000000176515141516316025426 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int32_t i; float r; float x; r = 1.50000000000000000e+00; i = 2; x = (float)(i*i); x = r*r; x = (float)(i)*r; x = r*(float)(i); x = (float)(i + i); x = r + r; x = r + (float)(i); x = (float)(i) + r; x = (float)(i - i); x = r - r; x = r - (float)(i); x = (float)(i) - r; x = (float)(i/i); x = r/r; x = (float)(i)/r; x = r/(float)(i); } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface3-7ef92cc.json0000664000175000017500000000102515141516316030662 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface3-7ef92cc", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface3.f90", "infile_hash": "5fcc5115d2a0075d81d764ef81ce63c8e8445a36670e6425bdec8ded", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface3-7ef92cc.stdout", "stdout_hash": "4011257bdcb8891eba20a2e716fc82d50dd47706054280af88994d50", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing4-c338b90.stdout0000664000175000017500000001411715141516316027247 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { clqmn: (Function (SymbolTable 3 { ls: (Variable 3 ls [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), z: (Variable 3 z [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) clqmn (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(If () (RealCompare (IntrinsicElementalFunction Aimag [(Var 3 z)] 0 (Real 8) () ) Eq (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) [(Assignment (Var 3 ls) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] [] )] () Public .false. .false. () ), dnan: (Function (SymbolTable 2 { dnan: (Variable 2 dnan [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) dnan (FunctionType [] (Real 8) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 2 dnan) (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) () .false. .false. )] (Var 2 dnan) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-data1-4f93542.json0000664000175000017500000000073215141516316024325 0ustar alastairalastair{ "basename": "ast-data1-4f93542", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/data1.f", "infile_hash": "1a4213099115ddfd47a4963a5aab51f70510f79ee1fa80eafa71d2ae", "outfile": null, "outfile_hash": null, "stdout": "ast-data1-4f93542.stdout", "stdout_hash": "5f8adfc0472681b6fd6fcad8969c7963f1a2e86b7a9974c9ae35c65b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bits_04-d0f89f1.json0000664000175000017500000000073715141516316024743 0ustar alastairalastair{ "basename": "asr-bits_04-d0f89f1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_04.f90", "infile_hash": "1cf82954b9eed57d1f61a7b86cf2aaaf4cb3a8efdf960365bab23692", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_04-d0f89f1.stdout", "stdout_hash": "c0fac706952f050773d0b767fb9e5dbc29a93923d223062bdfbe96de", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-rewind_invalid_kwarg1-54e2b4f.stderr0000664000175000017500000000023515141516316030266 0ustar alastairalastairsemantic error: Invalid argument `end` supplied --> tests/errors/rewind_invalid_kwarg1.f90:3:5 | 3 | rewind(end="world") | ^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-print1-b2e5cea.stdout0000664000175000017500000000231515141516316025406 0ustar alastairalastair(TranslationUnit [(Program print1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeReal [] () () None ) [] [(pi [] [] () () None ())] () )] [(Assignment 0 pi (Real "3.141592") (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 (String "(f6.3)" ()) [pi] () ) (Print 0 () [pi] () ) (Print 0 10 [] () ) (Format 10 "3x, \"print\"" (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_op_10-19bd9d9.stdout0000664000175000017500000003676515141516316026365 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Print (StringFormat () [(ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Cast (Var 3 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) NotEq (Cast (Var 3 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) solution (FunctionType [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 4 x) (ArrayConstant 8 [1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] (Var 4 x) Public .false. .false. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-case_05-a43ab42.stdout0000664000175000017500000000714015141516316025243 0ustar alastairalastair(TranslationUnit [(Program case_05 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine) (Comment "! local variable declaration" )] ) )] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(grade [] [] () (String "B" ()) Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Select 0 () grade [(CaseStmt [(CaseCondExpr (String "A" ()) )] () [(Print 0 () [(String "Excellent!" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "B" ()) )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] ) (CaseStmt [(CaseCondExpr (String "C" ()) )] () [(Print 0 () [(String "Well done" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "D" ()) )] () [(Print 0 () [(String "You passed" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt [(CaseCondExpr (String "F" ()) )] () [(Print 0 () [(String "Better try again" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] ) (CaseStmt_Default () [(Print 0 () [(String "Invalid grade" ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] )] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Print 0 () [(String "Your grade is " ()) grade] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/c-pragma2-a14de52.stdout0000664000175000017500000000255615141516316025023 0ustar alastairalastair #include #include #include #include #include struct dimension_descriptor { int32_t lower_bound, length, stride; }; struct i32 { int32_t *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; struct r32 { float *data; struct dimension_descriptor dims[32]; int32_t n_dims; int32_t offset; bool is_allocated; }; // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); const struct i32 __libasr_created__array_constant__value; struct i32* __libasr_created__array_constant_ = &__libasr_created__array_constant__value; int32_t __libasr_created__array_constant__data[1]; __libasr_created__array_constant_->data = __libasr_created__array_constant__data; __libasr_created__array_constant_->n_dims = 1; __libasr_created__array_constant_->offset = 0; __libasr_created__array_constant_->dims[0].lower_bound = 1; __libasr_created__array_constant_->dims[0].length = 1; __libasr_created__array_constant_->dims[0].stride = 1; float a __attribute__ (( vector_size(sizeof(float) * 8) )); a = (float __attribute__ (( vector_size(sizeof(float) * 8) ))) {(float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1), (float)(1)}; return 0; } lfortran-lfortran-2f73434/tests/reference/asr_ignore_pragma-pragma2-ba96e35.stdout0000664000175000017500000000670715141516316030273 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { pragma2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) pragma2 [] [(Assignment (Var 2 a) (ArrayBroadcast (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (ArrayConstant 4 [8] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 32 [1.00000000e+00, 1.00000000e+00, 1.00000000e+00, ...., 1.00000000e+00, 1.00000000e+00, 1.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_pow_test-2b160e8.json0000664000175000017500000000077515141516316027167 0ustar alastairalastair{ "basename": "llvm-complex_pow_test-2b160e8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_pow_test.f90", "infile_hash": "cc3e566ed81771c2b1c24916ac5bcd29fde8fef80826cc84d56d72fa", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_pow_test-2b160e8.stdout", "stdout_hash": "24a561389d0f54464c0bdf1c8f5490fb800ae87cc98991bb007c3385", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-parameter1-1a7ed3b.json0000664000175000017500000000072315141516316025600 0ustar alastairalastair{ "basename": "asr-parameter1-1a7ed3b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/parameter1.f90", "infile_hash": "89e627eefd928ded810c79f57685b062a029d924767fffd996a7552d", "outfile": null, "outfile_hash": null, "stdout": "asr-parameter1-1a7ed3b.stdout", "stdout_hash": "1eb85659a554ccc03eb352004a38cd2fbafeffe0775856e3fa451551", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-return_06-ec98b0b.json0000664000175000017500000000075015141516316025556 0ustar alastairalastair{ "basename": "llvm-return_06-ec98b0b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_06.f90", "infile_hash": "45589b7367a00e9dbec0cb3bfe91894d24c7914fda043a53043d4276", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_06-ec98b0b.stdout", "stdout_hash": "18cb80cf22771eb2b3cba820773d6e1e62bc9fcf195beaaa2c6afa2f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout0000664000175000017500000000060515141516316031432 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implicit_program_lfortran: (Program (SymbolTable 2 { }) implicit_program_lfortran [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-statement1-60b7ed3.stdout0000664000175000017500000002421315141516316026121 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { statement1: (Function (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Function (SymbolTable 3 { q_return_var_name: (Variable 3 q_return_var_name [] ReturnVar () () Default (Logical 4) 2 q Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) q (FunctionType [(Real 8)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 q_return_var_name) (LogicalNot (LogicalBinOp (RealCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) And (RealCompare (Var 2 c) Eq (Cast (RealConstant 0.000000 (Real 4) ) RealToReal (Real 8) (RealConstant 0.000000 (Real 8) ) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) () .false. .false. )] (Var 3 q_return_var_name) Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) statement1 (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-types_12-e6251f2.stdout0000664000175000017500000000045415141516316026103 0ustar alastairalastairprogram types_12 use iso_c_binding, only: c_int, c_double implicit none interface integer(c_int) function f(a, b) result(r) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function f end interface end program types_12 lfortran-lfortran-2f73434/tests/reference/llvm-functions_14-f13c087.stdout0000664000175000017500000000141415141516316026454 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define void @find_fit(i32 ()* %expr) { .entry: br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_find_fit FINALIZE_SYMTABLE_find_fit: ; preds = %return ret void } declare i32 @expr() define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_functions_14 FINALIZE_SYMTABLE_functions_14: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-doloop_01-bb1c596.json0000664000175000017500000000105115141516316025253 0ustar alastairalastair{ "basename": "asr-doloop_01-bb1c596", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/doloop_01.f90", "infile_hash": "adc11707fe019fef57cc344303ffe42ac706e339e13d094b7d65afc2", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_01-bb1c596.stdout", "stdout_hash": "553f98e7696631f4e016a1b17d3d76d07726418bc4698ee98e99ed16", "stderr": "asr-doloop_01-bb1c596.stderr", "stderr_hash": "e892e763cb5e312237fbc866f00da5aceb0f88f0aeddcaa489856b2b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-bindc4-22df995.json0000664000175000017500000000073415141516316024562 0ustar alastairalastair{ "basename": "asr-bindc4-22df995", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bindc4.f90", "infile_hash": "82f6261052d996468e9b5ef860d730cf31765f67f4eec663e5c4af11", "outfile": null, "outfile_hash": null, "stdout": "asr-bindc4-22df995.stdout", "stdout_hash": "f18dfd4f63e43a3e3a53e054906dd22361a32753a46720e8add6ead1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence4-9f1ef3e.stdout0000664000175000017500000000017615141516316031734 0ustar alastairalastair[{"kind":9,"location":{"range":{"start":{"character":12,"line":9},"end":{"character":15,"line":9}},"uri":"uri"},"name":"abc"}]lfortran-lfortran-2f73434/tests/reference/asr-compare_01-c98905f.stderr0000664000175000017500000000023315141516316025674 0ustar alastairalastairsemantic error: Operands of comparison operator are of different types --> tests/errors/compare_01.f90:6:9 | 6 | if (i > x) then | ^^^^^ lfortran-lfortran-2f73434/tests/reference/c-case_01-2ff47e6.stdout0000664000175000017500000000162615141516316024720 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); int64_t i; int64_t out; i = 4; if (i == 1) { out = 10; printf("%s\n","1"); } else if (i == 2) { out = 20; printf("%s\n","2"); } else if (i == 3) { out = 30; printf("%s\n","3"); } else if (i == 4) { out = 40; printf("%s\n","4"); } if (out != 40) { fprintf(stderr, "ERROR STOP"); exit(1); } if (i == 1) { out = 11; printf("%s\n","1"); } else if (i == 2 || i == 3 || i == 4) { out = 22; printf("%s\n","2,3,4"); } if (out != 22) { fprintf(stderr, "ERROR STOP"); exit(1); } return 0; } lfortran-lfortran-2f73434/tests/reference/asr-character_03-a7476e8.json0000664000175000017500000000106515141516316025654 0ustar alastairalastair{ "basename": "asr-character_03-a7476e8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/character_03.f90", "infile_hash": "9aebb511b0914d6e70395b36170f563c3388431dde62d3b371aea47f", "outfile": null, "outfile_hash": null, "stdout": "asr-character_03-a7476e8.stdout", "stdout_hash": "985731dc43aeb87a346b585becd60a56f25f03d90cbc70bc61ede2ab", "stderr": "asr-character_03-a7476e8.stderr", "stderr_hash": "87a0cbd848901a22fd44c9062f5c50b8c0ad5d98cfd40bbb1b98ca0c", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr_13-57b03a6.stdout0000664000175000017500000005747015141516316025245 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { flip_sign_dead_code: (Program (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ap: (Variable 2 ap [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), bp: (Variable 2 bp [] Local (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), cp: (Variable 2 cp [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 2 dp [] Local (RealConstant 2.000000 (Real 4) ) (RealConstant 2.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), eps: (Variable 2 eps [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), number: (Variable 2 number [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) flip_sign_dead_code [] [(Assignment (Var 2 number) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4) ) (Real 4) (RealConstant -5.500000 (Real 4) ) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 number) (IntegerConstant 124 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (RealConstant 5.500000 (Real 4) ) () .false. .false. ) (If () (IntegerCompare (IntrinsicElementalFunction Modulo [(Var 2 number) (IntegerConstant 2 (Integer 4) Decimal)] 0 (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4) () ) () .false. .false. )] [] ) (If () (RealCompare (IntrinsicElementalFunction Abs [(RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4) ) (Real 4) () )] 0 (Real 4) () ) Gt (Var 2 eps) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) (If () (IntegerCompare (Var 2 a) Eq (Var 2 b) (Logical 4) () ) [(Print (StringConstant "a == b" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 2 ap) Eq (Var 2 bp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "ap == bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "ap /= bp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Cast (Var 2 ap) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) Eq (Var 2 cp) (Logical 4) (LogicalConstant .true. (Logical 4) ) ) [(Print (StringConstant "ap == cp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (RealCompare (Var 2 cp) Eq (Var 2 dp) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(Print (StringConstant "cp == dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [(Print (StringConstant "cp /= dp" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] )] [(If () (RealCompare (Var 2 c) Eq (Var 2 d) (Logical 4) () ) [(Print (StringConstant "c == d" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] [] )] )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_array_op-arrays_op_10-be689f7.json0000664000175000017500000000102215141516316030050 0ustar alastairalastair{ "basename": "pass_array_op-arrays_op_10-be689f7", "cmd": "lfortran --pass=array_op --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_10.f90", "infile_hash": "b9f29a5f12342cf162fe90d308dfb51ffdf3b181b06f27fe34d52d26", "outfile": null, "outfile_hash": null, "stdout": "pass_array_op-arrays_op_10-be689f7.stdout", "stdout_hash": "351ba46680ba7dc2c1732cb4d83f967f2c58a9dd8123583ba74ef61a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-doconcurrentloop_02-2418c04.stdout0000664000175000017500000000063015141516316030244 0ustar alastairalastairprogram doconcurrentloop_02 implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i - 1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine arraySum end program doconcurrentloop_02 lfortran-lfortran-2f73434/tests/reference/asr-array2-e7997a8.stdout0000664000175000017500000003220715141516316025201 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { array2: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 2 g [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) array2 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp_err4-9f3b813.stderr0000664000175000017500000000037215141516316027725 0ustar alastairalastairC preprocessor error: Include file 'does_not_exist.inc' not found. If an include path is available, please use the `-I` option to specify it. --> tests/errors/cpp_err4.f90:2:11 | 2 | #include "does_not_exist.inc" | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-loop_test2-82d82ea.stdout0000664000175000017500000005626615141516316026146 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { indx: (Variable 2 indx [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l1: (Variable 2 l1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), l2: (Variable 2 l2 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nq: (Variable 2 nq [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 2 v [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), ve: (Variable 2 ve [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), vev: (Variable 2 vev [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), wrk5: (Variable 2 wrk5 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), zero: (Variable 2 zero [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(DoLoop () ((Var 2 l1) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nq) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 110 110 )] [] ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 120 120 )] [] ) (GoToTarget 140 140 )] [] ) (Assignment (Var 2 indx) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () .false. .false. ) (DoLoop () ((Var 2 l1) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 nq) ()) [(DoLoop () ((Var 2 l2) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 l1) ()) [(Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) (Var 2 zero) () .false. .false. ) (DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 m) ()) [(Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4) ColMajor () ) (Real 4) () ) (Real 4) () ) () .false. .false. ) (GoToTarget 210 210 )] [] ) (Assignment (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4) ColMajor () ) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4) ColMajor () ) () .false. .false. ) (GoToTarget 220 220 )] [] ) (GoToTarget 230 230 )] [] ) (Return)] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-bindc4-22df995.stdout0000664000175000017500000007405115141516316025136 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc4: (Program (SymbolTable 2 { c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_null_ptr: (ExternalSymbol 2 c_null_ptr 4 c_null_ptr lfortran_intrinsic_iso_c_binding [] c_null_ptr Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), newshape: (Variable 2 newshape [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), queries: (Variable 2 queries [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), queries2: (Variable 2 queries2 [] Local (PointerNullConstant (CPtr) () ) (PointerNullConstant (CPtr) () ) Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), xv: (Variable 2 xv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Pointer (Array (Integer 2) [(() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), yv: (Variable 2 yv [] Local () () Default (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ) }) bindc4 [iso_c_binding] [(Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 newshape) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Associate (Var 2 x) (ArrayPhysicalCast (Var 2 xv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (Associate (Var 2 y) (ArrayPhysicalCast (Var 2 yv) FixedSizeArray DescriptorArray (Array (Integer 2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] DescriptorArray ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (Var 2 newshape) () ) (Print (StringFormat () [(PointerToCPtr (Var 2 x) (CPtr) () ) (Var 2 queries)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (CPtrToPointer (Var 2 queries) (Var 2 x) (ArrayConstant 8 [3, 4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] PointerArray ) ColMajor ) () ) (Print (StringFormat () [(PointerToCPtr (Var 2 x) (CPtr) () ) (Var 2 queries)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 2 i) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(DoLoop () ((Var 2 j) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) LBound () ) (ArrayBound (Var 2 x) (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) UBound () ) ()) [(Print (StringFormat () [(Var 2 i) (Var 2 j) (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] [] )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 queries) (PointerToCPtr (GetPointer (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 2) ColMajor () ) (Pointer (Integer 2) ) () ) (CPtr) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (PointerAssociated (Var 2 queries) (PointerToCPtr (Var 2 x) (CPtr) () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 queries) (PointerToCPtr (Var 2 y) (CPtr) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (PointerAssociated (Var 2 queries2) () (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (Var 2 queries) (PointerNullConstant (CPtr) () ) () .false. .false. )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-array1-3c35261.stdout0000664000175000017500000000054415141516316025407 0ustar alastairalastairfunction main() local a::Bool local b::Array{Bool, 1} local b2::Array{Bool, 2} local b3::Array{Bool, 3} local d::Float32 local e::Array{Float32, 1} local e2::Array{Float32, 2} local e3::Array{Float32, 3} local f::Int32 local g::Array{Int32, 1} local g2::Array{Int32, 2} local g3::Array{Int32, 3} end main() lfortran-lfortran-2f73434/tests/reference/llvm-while_01-3496096.stdout0000664000175000017500000001632115141516316025424 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %i = alloca i32, align 4 %j = alloca i32, align 4 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head loop.head: ; preds = %loop.body, %.entry %2 = load i32, i32* %i, align 4 %3 = icmp slt i32 %2, 11 br i1 %3, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %4 = load i32, i32* %j, align 4 %5 = load i32, i32* %i, align 4 %6 = add i32 %4, %5 store i32 %6, i32* %j, align 4 %7 = load i32, i32* %i, align 4 %8 = add i32 %7, 1 store i32 %8, i32* %i, align 4 br label %loop.head loop.end: ; preds = %loop.head %9 = load i32, i32* %j, align 4 %10 = icmp ne i32 %9, 55 br i1 %10, label %then, label %else then: ; preds = %loop.end call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %loop.end br label %ifcont ifcont: ; preds = %else, %then %11 = load i32, i32* %i, align 4 %12 = icmp ne i32 %11, 11 br i1 %12, label %then1, label %else2 then1: ; preds = %ifcont call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head4 loop.head4: ; preds = %loop.body5, %ifcont3 %13 = load i32, i32* %i, align 4 %14 = icmp sle i32 %13, 10 br i1 %14, label %loop.body5, label %loop.end6 loop.body5: ; preds = %loop.head4 %15 = load i32, i32* %j, align 4 %16 = load i32, i32* %i, align 4 %17 = add i32 %15, %16 store i32 %17, i32* %j, align 4 %18 = load i32, i32* %i, align 4 %19 = add i32 %18, 1 store i32 %19, i32* %i, align 4 br label %loop.head4 loop.end6: ; preds = %loop.head4 %20 = load i32, i32* %j, align 4 %21 = icmp ne i32 %20, 55 br i1 %21, label %then7, label %else8 then7: ; preds = %loop.end6 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 else8: ; preds = %loop.end6 br label %ifcont9 ifcont9: ; preds = %else8, %then7 %22 = load i32, i32* %i, align 4 %23 = icmp ne i32 %22, 11 br i1 %23, label %then10, label %else11 then10: ; preds = %ifcont9 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 else11: ; preds = %ifcont9 br label %ifcont12 ifcont12: ; preds = %else11, %then10 store i32 1, i32* %i, align 4 store i32 0, i32* %j, align 4 br label %loop.head13 loop.head13: ; preds = %loop.body14, %ifcont12 %24 = load i32, i32* %i, align 4 %25 = icmp slt i32 %24, 1 br i1 %25, label %loop.body14, label %loop.end15 loop.body14: ; preds = %loop.head13 %26 = load i32, i32* %j, align 4 %27 = load i32, i32* %i, align 4 %28 = add i32 %26, %27 store i32 %28, i32* %j, align 4 %29 = load i32, i32* %i, align 4 %30 = add i32 %29, 1 store i32 %30, i32* %i, align 4 br label %loop.head13 loop.end15: ; preds = %loop.head13 %31 = load i32, i32* %j, align 4 %32 = icmp ne i32 %31, 0 br i1 %32, label %then16, label %else17 then16: ; preds = %loop.end15 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 else17: ; preds = %loop.end15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 %33 = load i32, i32* %i, align 4 %34 = icmp ne i32 %33, 1 br i1 %34, label %then19, label %else20 then19: ; preds = %ifcont18 call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont21 br label %FINALIZE_SYMTABLE_while_01 FINALIZE_SYMTABLE_while_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-arrays_op_10-19bd9d9.json0000664000175000017500000000075615141516316026003 0ustar alastairalastair{ "basename": "asr-arrays_op_10-19bd9d9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_op_10.f90", "infile_hash": "b9f29a5f12342cf162fe90d308dfb51ffdf3b181b06f27fe34d52d26", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_10-19bd9d9.stdout", "stdout_hash": "2dbe35beb2ba42a45cdfe8be8f3fecaf423e32d1f7f97500313f2fb4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string2-3425046.json0000664000175000017500000000071215141516316024626 0ustar alastairalastair{ "basename": "asr-string2-3425046", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/string2.f90", "infile_hash": "c88731a5e438f48d75ee2eb7b97ef6c1165c37ec28aa82b22ff6d49f", "outfile": null, "outfile_hash": null, "stdout": "asr-string2-3425046.stdout", "stdout_hash": "2a51fc3b8fd631e2316955dc1d5599231c8f44ce7a183eee259246a9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-sin_03-8490135.stdout0000664000175000017500000000533415141516316024715 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), sin_03: (Program (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), x: (Variable 2 x [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) sin_03 [iso_fortran_env] [(Assignment (Var 2 x) (IntrinsicElementalFunction Sin [(RealConstant 1.500000 (Real 8) )] 0 (Real 8) (RealConstant 0.997495 (Real 8) ) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_fma-fma-071ac0d.json0000664000175000017500000000075015141516316025217 0ustar alastairalastair{ "basename": "pass_fma-fma-071ac0d", "cmd": "lfortran --pass=fma --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/fma.f90", "infile_hash": "e251a7a68d3ac5b04630dacfdd015452826bc4e6954b51124d815868", "outfile": null, "outfile_hash": null, "stdout": "pass_fma-fma-071ac0d.stdout", "stdout_hash": "b0dbd5f6c32299c83ef4755b707d1fcfa5f67aaa6f8f42a4534f1a88", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_34-f98f7e3.stdout0000664000175000017500000011761615141516316026045 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_cmd_install_modules_34: (Module (SymbolTable 2 { build_model: (ExternalSymbol 2 build_model 4 build_model fpm_modules_34 [] build_model Public ) }) fpm_cmd_install_modules_34 () [fpm_modules_34] .false. .false. .false. ), fpm_manifest_modules_34: (Module (SymbolTable 8 { package_config_t: (ExternalSymbol 8 package_config_t 15 package_config_t fpm_manifest_package_modules_34 [] package_config_t Public ) }) fpm_manifest_modules_34 () [fpm_manifest_package_modules_34] .true. .false. .false. ), fpm_manifest_package_modules_34: (Module (SymbolTable 15 { package_config_t: (Struct (SymbolTable 16 { name: (Variable 16 name [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), version: (Variable 16 version [] Local () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) 15 version_t Source Public Required .false. .false. .false. () .false. .false. ) }) package_config_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. ) [version_t] [name version] [] Source Public .false. .false. [] () () ), version_t: (ExternalSymbol 15 version_t 10 version_t fpm_versioning_modules_34 [] version_t Public ) }) fpm_manifest_package_modules_34 () [fpm_versioning_modules_34] .true. .false. .false. ), fpm_modules_34: (Module (SymbolTable 4 { build_model: (Function (SymbolTable 5 { associate_block: (AssociateBlock (SymbolTable 6 { 1_package_config_t_version: (ExternalSymbol 6 1_package_config_t_version 16 version package_config_t [] version Public ), 1_version_t: (ExternalSymbol 6 1_version_t 10 version_t fpm_versioning_modules_34 [] version_t Public ), 1_version_t_to_string: (ExternalSymbol 6 1_version_t_to_string 11 to_string 1_version_t [] to_string Public ), ii: (Variable 6 ii [] Local () () Default (Pointer (Integer 4) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) associate_block [(Associate (Var 6 ii) (Var 5 i) ) (Print (StringFormat () [(Var 6 ii)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 6 1_version_t_to_string () [((Var 5 version))] (StructInstanceMember (Var 5 package) 6 1_package_config_t_version (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) () ) .false. )] ), i: (Variable 5 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), package: (Variable 5 package [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. ) 4 package_config_t Source Public Required .false. .false. .false. () .false. .false. ), version: (Variable 5 version [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_model (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. )] [] .true. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 package)] [(AssociateBlockCall 5 associate_block )] () Public .false. .false. () ), package_config_t: (ExternalSymbol 4 package_config_t 15 package_config_t fpm_manifest_package_modules_34 [] package_config_t Public ) }) fpm_modules_34 () [fpm_manifest_modules_34 fpm_versioning_modules_34] .true. .false. .false. ), fpm_versioning_modules_34: (Module (SymbolTable 10 { as_string: (Function (SymbolTable 12 { 1_version_t_to_string: (ExternalSymbol 12 1_version_t_to_string 11 to_string version_t [] to_string Public ), self: (Variable 12 self [] In () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) 10 version_t Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 12 string [] ReturnVar () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) as_string (FunctionType [(StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. )] (Allocatable (String 1 () DeferredLength DescriptorString) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 self)] [(SubroutineCall 12 1_version_t_to_string () [((Var 12 string))] (Var 12 self) .false. )] (Var 12 string) Public .false. .false. () ), char: (GenericProcedure 10 char [10 as_string] Public ), to_string: (Function (SymbolTable 13 { self: (Variable 13 self [] In () () Default (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) 10 version_t Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 13 string [] Out () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) to_string (FunctionType [(StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .false. .false. ) (Allocatable (String 1 () DeferredLength DescriptorString) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self) (Var 13 string)] [] () Public .false. .false. () ), version_t: (Struct (SymbolTable 11 { num: (Variable 11 num [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), to_string: (StructMethodDeclaration 11 to_string () to_string 10 to_string Source .false. .false. ) }) version_t (StructType [(Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) )] [] .true. .false. ) [] [num] [] Source Public .false. .false. [] () () ) }) fpm_versioning_modules_34 () [fpm_versioning_modules_34] .true. .false. .false. ), modules_34: (Program (SymbolTable 17 { }) modules_34 [] [(Print (StringConstant "running modules_34 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-complex_dp-7286fd2.json0000664000175000017500000000075315141516316025735 0ustar alastairalastair{ "basename": "llvm-complex_dp-7286fd2", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_dp.f90", "infile_hash": "2ab8a19155ace703dc52c1f26d2ecea0db08a49637452b31871a40b2", "outfile": null, "outfile_hash": null, "stdout": "llvm-complex_dp-7286fd2.stdout", "stdout_hash": "8770a0bf114a2f62c962e1ed77eb54933fe931c38077f25fd989293f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_06-fa1a99f.stdout0000664000175000017500000001306115141516316026075 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__b__x = global float 0.000000e+00 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"b()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_nested_06_a_b(float* %x) { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) %1 = load float, float* %x, align 4 store float %1, float* @__module___lcompilers_created__nested_context__b__x, align 4 call void @b.__module_nested_06_a_c() %2 = load float, float* @__module___lcompilers_created__nested_context__b__x, align 4 store float %2, float* %x, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return ret void } define void @b.__module_nested_06_a_c() { .entry: %0 = alloca i64, align 8 %1 = alloca i32, align 4 store i32 5, i32* %1, align 4 %2 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %1) %3 = load i64, i64* %0, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %4 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %2, i8** %4, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %3, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %7 = load i8*, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %11 = icmp eq i8* %2, null br i1 %11, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %2) br label %free_done free_done: ; preds = %free_nonnull, %.entry %12 = alloca i64, align 8 %13 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %12, i32 0, i32 0, float* @__module___lcompilers_created__nested_context__b__x) %14 = load i64, i64* %12, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %13, i8** %15, align 8 %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %14, i64* %16, align 4 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %18 = load i8*, i8** %17, align 8 %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %22 = icmp eq i8* %13, null br i1 %22, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %13) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_c FINALIZE_SYMTABLE_c: ; preds = %return ret void } declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca float, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) store float 6.000000e+00, float* %call_arg_value, align 4 call void @__module_nested_06_a_b(float* %call_arg_value) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_06 FINALIZE_SYMTABLE_nested_06: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-constant_kinds-b9382b6.stdout0000664000175000017500000003211215141516316026777 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { constant_kinds: (Program (SymbolTable 2 { i1: (Variable 2 i1 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i2: (Variable 2 i2 [] Local (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), i3: (Variable 2 i3 [] Local (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r1: (Variable 2 r1 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r2: (Variable 2 r2 [] Local (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r3: (Variable 2 r3 [] Local (RealConstant 1.000000 (Real 4) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r4: (Variable 2 r4 [] Local (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) (RealConstant 1.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) constant_kinds [] [(Assignment (Var 2 y) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 y) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 y) (Cast (RealConstant 1.000000 (Real 8) ) RealToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 x) (Cast (IntegerConstant 1 (Integer 8) Decimal) IntegerToInteger (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-template_array_04b-94baaad.stdout0000664000175000017500000006740015141516316027652 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_array_04b: (Program (SymbolTable 7 { default_behavior: (ExternalSymbol 7 default_behavior 2 default_behavior template_array_04b_m [] default_behavior Public ), swap: (ExternalSymbol 7 swap 2 swap template_array_04b_m [] swap Public ), test_reverse: (ExternalSymbol 7 test_reverse 2 test_reverse template_array_04b_m [] test_reverse Public ) }) template_array_04b [template_array_04b_m] [(SubroutineCall 7 test_reverse () [] () .false. )] ), template_array_04b_m: (Module (SymbolTable 2 { default_behavior: (Requirement (SymbolTable 3 { t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) default_behavior [t] [] ), swap: (Template (SymbolTable 4 { swap: (Function (SymbolTable 5 { tmp: (Variable 5 tmp [] Local () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] InOut () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) swap (FunctionType [(TypeParameter t ) (TypeParameter t )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 tmp) (Var 5 x) () .false. .false. ) (Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Assignment (Var 5 y) (Var 5 tmp) () .false. .false. )] () Private .false. .false. () ), t: (Variable 4 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) swap [t] [(Require default_behavior [t] )] ), test_reverse: (Function (SymbolTable 6 { __instantiated_swap: (Function (SymbolTable 8 { tmp: (Variable 8 tmp [] Local () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] InOut () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __instantiated_swap (FunctionType [(Integer 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 x) (Var 8 y)] [(Assignment (Var 8 tmp) (Var 8 x) () .false. .false. ) (Assignment (Var 8 x) (Var 8 y) () .false. .false. ) (Assignment (Var 8 y) (Var 8 tmp) () .false. .false. )] () Private .false. .false. () ), a: (Variable 6 a [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Private Required .false. .false. .false. () .false. .false. ) }) test_reverse (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 6 a) (ArrayConstant 8 [1, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(Var 6 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (SubroutineCall 6 __instantiated_swap () [((ArrayItem (Var 6 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )) ((ArrayItem (Var 6 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ))] () .false. ) (Print (StringFormat () [(Var 6 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) template_array_04b_m () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-loop_test2-c76adc4.json0000664000175000017500000000073615141516316025644 0ustar alastairalastair{ "basename": "ast-loop_test2-c76adc4", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", "infile_hash": "b0c94f235f33da51d9037d0833df0c1ca4aaef4f3a3a29c9426ba51b", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test2-c76adc4.stdout", "stdout_hash": "54607d56e4f9e7cecf534af805800d237a40fdb146710607ee777577", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutines_02-8f01adf.stdout0000664000175000017500000000200615141516316027311 0ustar alastairalastairfunction f(a::Int32, b::Base.RefValue{Int32}) b[] = a + 1 end function g(a::Int32, b::Base.RefValue{Int32}) b[] = a - 1 end function h(a::Int32, b::Base.RefValue{Int32}) g(a, b) end function main() local i::Int32 local j::Int32 i = 1 j = 1 __j_ref__= Ref(j) f(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) g(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end __j_ref__= Ref(j) h(i, __j_ref__) j = __j_ref__[] println(i, " ", j) if i ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if j ≠ 0 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/ast-doconcurrentloop_02-b8757f0.json0000664000175000017500000000100315141516316027305 0ustar alastairalastair{ "basename": "ast-doconcurrentloop_02-b8757f0", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doconcurrentloop_02.f90", "infile_hash": "972a21c452523a0a3060e6b1a0c75e868f5dd660ea5763358ccade86", "outfile": null, "outfile_hash": null, "stdout": "ast-doconcurrentloop_02-b8757f0.stdout", "stdout_hash": "275c444c1a61effae091b2ec68fa2755d9d06c128ddc326e3ed60b4c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp1-3056a3e.json0000664000175000017500000000074115141516316026334 0ustar alastairalastair{ "basename": "asr_openmp-openmp1-3056a3e", "cmd": "lfortran --show-asr --no-color --openmp {infile} -o {outfile}", "infile": "tests/openmp1.f90", "infile_hash": "646c17ebbdf68dc9e0ba68a1a56c2ffb73c029a9537622d13ca068b8", "outfile": null, "outfile_hash": null, "stdout": "asr_openmp-openmp1-3056a3e.stdout", "stdout_hash": "d1a8084428986626a1ad3f591b8df9b9b08b463f96509282f5c90c49", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-subroutine5-0e48a69.json0000664000175000017500000000071715141516316026217 0ustar alastairalastair{ "basename": "julia-subroutine5-0e48a69", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/subroutine5.f90", "infile_hash": "88c62ffd8f005d7a511511e43da68f25e8fe795a75fec462baa25885", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutine5-0e48a69.stdout", "stdout_hash": "94186e6ae5072480bdc1f2f5268b910b4d4e8380628a8b2a738c3f6b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-real_to_complex_cast_in_comparison-655651c.stdout0000664000175000017500000000054015141516316033671 0ustar alastairalastairprogram expr2 implicit none integer(4), parameter :: dp = 8 real(8) :: zero zero = 0.0000000000000000e+00_8 contains elemental complex(8) function dabs(x) result(r) complex(8), intent(in) :: x if (x /= cmplx(zero, 0.0, kind=8)) then r = x else r = cmplx(0, 0.0, kind=8) - x end if end function dabs end program expr2 lfortran-lfortran-2f73434/tests/reference/asr_openmp-openmp_44-1c0f6fe.stdout0000664000175000017500000053551315141516316027311 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), omp_lib: (Module (SymbolTable 8 { c_bool: (ExternalSymbol 8 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 8 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 8 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 8 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 8 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), gomp_atomic_end: (Function (SymbolTable 9 { }) gomp_atomic_end (FunctionType [] () BindC Interface "GOMP_atomic_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_atomic_start: (Function (SymbolTable 10 { }) gomp_atomic_start (FunctionType [] () BindC Interface "GOMP_atomic_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_barrier: (Function (SymbolTable 11 { }) gomp_barrier (FunctionType [] () BindC Interface "GOMP_barrier" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_end: (Function (SymbolTable 12 { }) gomp_critical_end (FunctionType [] () BindC Interface "GOMP_critical_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_critical_start: (Function (SymbolTable 13 { }) gomp_critical_start (FunctionType [] () BindC Interface "GOMP_critical_start" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_auto_next: (Function (SymbolTable 14 { gomp_loop_auto_next: (Variable 14 gomp_loop_auto_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 14 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 14 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_auto_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 14 istart) (Var 14 iend)] [] (Var 14 gomp_loop_auto_next) Public .false. .false. () ), gomp_loop_auto_start: (Function (SymbolTable 15 { end: (Variable 15 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_auto_start: (Variable 15 gomp_loop_auto_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 15 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 15 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 15 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 15 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_auto_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_auto_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 15 start) (Var 15 end) (Var 15 incr) (Var 15 istart) (Var 15 iend)] [] (Var 15 gomp_loop_auto_start) Public .false. .false. () ), gomp_loop_dynamic_next: (Function (SymbolTable 16 { gomp_loop_dynamic_next: (Variable 16 gomp_loop_dynamic_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 16 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 16 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 16 istart) (Var 16 iend)] [] (Var 16 gomp_loop_dynamic_next) Public .false. .false. () ), gomp_loop_dynamic_start: (Function (SymbolTable 17 { chunk: (Variable 17 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 17 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_dynamic_start: (Variable 17 gomp_loop_dynamic_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 17 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 17 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 17 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 17 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_dynamic_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_dynamic_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 17 start) (Var 17 end) (Var 17 incr) (Var 17 chunk) (Var 17 istart) (Var 17 iend)] [] (Var 17 gomp_loop_dynamic_start) Public .false. .false. () ), gomp_loop_end: (Function (SymbolTable 18 { }) gomp_loop_end (FunctionType [] () BindC Interface "GOMP_loop_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_end_nowait: (Function (SymbolTable 19 { }) gomp_loop_end_nowait (FunctionType [] () BindC Interface "GOMP_loop_end_nowait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_loop_guided_next: (Function (SymbolTable 20 { gomp_loop_guided_next: (Variable 20 gomp_loop_guided_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 20 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 20 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_guided_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 20 istart) (Var 20 iend)] [] (Var 20 gomp_loop_guided_next) Public .false. .false. () ), gomp_loop_guided_start: (Function (SymbolTable 21 { chunk: (Variable 21 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 21 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_guided_start: (Variable 21 gomp_loop_guided_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 21 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 21 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 21 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 21 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_guided_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_guided_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 21 start) (Var 21 end) (Var 21 incr) (Var 21 chunk) (Var 21 istart) (Var 21 iend)] [] (Var 21 gomp_loop_guided_start) Public .false. .false. () ), gomp_loop_runtime_next: (Function (SymbolTable 22 { gomp_loop_runtime_next: (Variable 22 gomp_loop_runtime_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 22 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 22 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_runtime_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 22 istart) (Var 22 iend)] [] (Var 22 gomp_loop_runtime_next) Public .false. .false. () ), gomp_loop_runtime_start: (Function (SymbolTable 23 { end: (Variable 23 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_runtime_start: (Variable 23 gomp_loop_runtime_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 23 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 23 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 23 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 23 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_runtime_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_runtime_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 23 start) (Var 23 end) (Var 23 incr) (Var 23 istart) (Var 23 iend)] [] (Var 23 gomp_loop_runtime_start) Public .false. .false. () ), gomp_loop_static_next: (Function (SymbolTable 24 { gomp_loop_static_next: (Variable 24 gomp_loop_static_next [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 24 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), istart: (Variable 24 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_loop_static_next (FunctionType [(Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_next" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 24 istart) (Var 24 iend)] [] (Var 24 gomp_loop_static_next) Public .false. .false. () ), gomp_loop_static_start: (Function (SymbolTable 25 { chunk: (Variable 25 chunk [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), end: (Variable 25 end [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_loop_static_start: (Variable 25 gomp_loop_static_start [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), iend: (Variable 25 iend [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), incr: (Variable 25 incr [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), istart: (Variable 25 istart [] Unspecified () () Default (Integer 8) () BindC Public Required .false. .false. .false. () .false. .false. ), start: (Variable 25 start [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_loop_static_start (FunctionType [(Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8) (Integer 8)] (Logical 4) BindC Interface "GOMP_loop_static_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 25 start) (Var 25 end) (Var 25 incr) (Var 25 chunk) (Var 25 istart) (Var 25 iend)] [] (Var 25 gomp_loop_static_start) Public .false. .false. () ), gomp_parallel: (Function (SymbolTable 26 { data: (Variable 26 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 26 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 26 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_threads: (Variable 26 num_threads [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_parallel (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_parallel" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 26 fn) (Var 26 data) (Var 26 num_threads) (Var 26 flags)] [] () Public .false. .false. () ), gomp_sections_end: (Function (SymbolTable 27 { }) gomp_sections_end (FunctionType [] () BindC Interface "GOMP_sections_end" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_sections_next: (Function (SymbolTable 28 { gomp_sections_next: (Variable 28 gomp_sections_next [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_next (FunctionType [] (Integer 4) BindC Interface "GOMP_sections_next" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 28 gomp_sections_next) Public .false. .false. () ), gomp_sections_start: (Function (SymbolTable 29 { count: (Variable 29 count [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), gomp_sections_start: (Variable 29 gomp_sections_start [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) gomp_sections_start (FunctionType [(Integer 4)] (Integer 4) BindC Interface "GOMP_sections_start" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 29 count)] [] (Var 29 gomp_sections_start) Public .false. .false. () ), gomp_task: (Function (SymbolTable 30 { arg_align: (Variable 30 arg_align [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), arg_size: (Variable 30 arg_size [] Unspecified () () Default (Integer 8) () BindC Public Required .true. .false. .false. () .false. .false. ), cpyfn: (Variable 30 cpyfn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), data: (Variable 30 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), depend: (Variable 30 depend [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), flags: (Variable 30 flags [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 30 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), if_clause: (Variable 30 if_clause [] Unspecified () () Default (Logical 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_task (FunctionType [(CPtr) (CPtr) (CPtr) (Integer 8) (Integer 8) (Logical 4) (Integer 4) (CPtr)] () BindC Interface "GOMP_task" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 30 fn) (Var 30 data) (Var 30 cpyfn) (Var 30 arg_size) (Var 30 arg_align) (Var 30 if_clause) (Var 30 flags) (Var 30 depend)] [] () Public .false. .false. () ), gomp_taskwait: (Function (SymbolTable 31 { }) gomp_taskwait (FunctionType [] () BindC Interface "GOMP_taskwait" .false. .false. .false. .false. .false. [] .false. ) [] [] [] () Public .false. .false. () ), gomp_teams: (Function (SymbolTable 32 { data: (Variable 32 data [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), fn: (Variable 32 fn [] Unspecified () () Default (CPtr) () BindC Public Required .true. .false. .false. () .false. .false. ), num_teams: (Variable 32 num_teams [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), thread_limit: (Variable 32 thread_limit [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) gomp_teams (FunctionType [(CPtr) (CPtr) (Integer 4) (Integer 4)] () BindC Interface "GOMP_teams_reg" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 32 fn) (Var 32 data) (Var 32 num_teams) (Var 32 thread_limit)] [] () Public .false. .false. () ), omp_get_max_threads: (Function (SymbolTable 33 { omp_get_max_threads: (Variable 33 omp_get_max_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_max_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_max_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 33 omp_get_max_threads) Public .false. .false. () ), omp_get_num_procs: (Function (SymbolTable 34 { omp_get_num_procs: (Variable 34 omp_get_num_procs [] ReturnVar () () Default (Integer 4) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_procs (FunctionType [] (Integer 4) BindC Interface "omp_get_num_procs" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 34 omp_get_num_procs) Public .false. .false. () ), omp_get_num_teams: (Function (SymbolTable 35 { omp_get_num_teams: (Variable 35 omp_get_num_teams [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_teams (FunctionType [] (Integer 4) BindC Interface "omp_get_num_teams" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 35 omp_get_num_teams) Public .false. .false. () ), omp_get_num_threads: (Function (SymbolTable 36 { omp_get_num_threads: (Variable 36 omp_get_num_threads [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_num_threads (FunctionType [] (Integer 4) BindC Interface "omp_get_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 36 omp_get_num_threads) Public .false. .false. () ), omp_get_team_num: (Function (SymbolTable 37 { omp_get_team_num: (Variable 37 omp_get_team_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_num (FunctionType [] (Integer 4) BindC Interface "omp_get_team_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 37 omp_get_team_num) Public .false. .false. () ), omp_get_team_size: (Function (SymbolTable 38 { level: (Variable 38 level [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ), omp_get_team_size: (Variable 38 omp_get_team_size [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_team_size (FunctionType [(Integer 4)] (Integer 4) BindC Interface "omp_get_team_size" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 38 level)] [] (Var 38 omp_get_team_size) Public .false. .false. () ), omp_get_thread_num: (Function (SymbolTable 39 { omp_get_thread_num: (Variable 39 omp_get_thread_num [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) omp_get_thread_num (FunctionType [] (Integer 4) BindC Interface "omp_get_thread_num" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 39 omp_get_thread_num) Public .false. .false. () ), omp_get_wtime: (Function (SymbolTable 40 { omp_get_wtime: (Variable 40 omp_get_wtime [] ReturnVar () () Default (Real 8) () BindC Public Required .false. .false. .false. () .false. .false. ) }) omp_get_wtime (FunctionType [] (Real 8) BindC Interface "omp_get_wtime" .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 40 omp_get_wtime) Public .false. .false. () ), omp_set_num_threads: (Function (SymbolTable 41 { n: (Variable 41 n [] Unspecified () () Default (Integer 4) () BindC Public Required .true. .false. .false. () .false. .false. ) }) omp_set_num_threads (FunctionType [(Integer 4)] () BindC Interface "omp_set_num_threads" .false. .false. .false. .false. .false. [] .false. ) [] [(Var 41 n)] [] () Public .false. .false. () ) }) omp_lib () [iso_c_binding] .true. .false. .false. ), openmp_44: (Program (SymbolTable 6 { c_bool: (ExternalSymbol 6 c_bool 43 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_funptr: (ExternalSymbol 6 c_funptr 43 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 6 c_int 43 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_long: (ExternalSymbol 6 c_long 43 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_ptr: (ExternalSymbol 6 c_ptr 43 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), compute_a: (ExternalSymbol 6 compute_a 2 compute_a openmp_44_parallel_sections [] compute_a Public ), compute_b: (ExternalSymbol 6 compute_b 2 compute_b openmp_44_parallel_sections [] compute_b Public ), compute_c: (ExternalSymbol 6 compute_c 2 compute_c openmp_44_parallel_sections [] compute_c Public ), gomp_atomic_end: (ExternalSymbol 6 gomp_atomic_end 8 gomp_atomic_end omp_lib [] gomp_atomic_end Public ), gomp_atomic_start: (ExternalSymbol 6 gomp_atomic_start 8 gomp_atomic_start omp_lib [] gomp_atomic_start Public ), gomp_barrier: (ExternalSymbol 6 gomp_barrier 8 gomp_barrier omp_lib [] gomp_barrier Public ), gomp_critical_end: (ExternalSymbol 6 gomp_critical_end 8 gomp_critical_end omp_lib [] gomp_critical_end Public ), gomp_critical_start: (ExternalSymbol 6 gomp_critical_start 8 gomp_critical_start omp_lib [] gomp_critical_start Public ), gomp_loop_auto_next: (ExternalSymbol 6 gomp_loop_auto_next 8 gomp_loop_auto_next omp_lib [] gomp_loop_auto_next Public ), gomp_loop_auto_start: (ExternalSymbol 6 gomp_loop_auto_start 8 gomp_loop_auto_start omp_lib [] gomp_loop_auto_start Public ), gomp_loop_dynamic_next: (ExternalSymbol 6 gomp_loop_dynamic_next 8 gomp_loop_dynamic_next omp_lib [] gomp_loop_dynamic_next Public ), gomp_loop_dynamic_start: (ExternalSymbol 6 gomp_loop_dynamic_start 8 gomp_loop_dynamic_start omp_lib [] gomp_loop_dynamic_start Public ), gomp_loop_end: (ExternalSymbol 6 gomp_loop_end 8 gomp_loop_end omp_lib [] gomp_loop_end Public ), gomp_loop_end_nowait: (ExternalSymbol 6 gomp_loop_end_nowait 8 gomp_loop_end_nowait omp_lib [] gomp_loop_end_nowait Public ), gomp_loop_guided_next: (ExternalSymbol 6 gomp_loop_guided_next 8 gomp_loop_guided_next omp_lib [] gomp_loop_guided_next Public ), gomp_loop_guided_start: (ExternalSymbol 6 gomp_loop_guided_start 8 gomp_loop_guided_start omp_lib [] gomp_loop_guided_start Public ), gomp_loop_runtime_next: (ExternalSymbol 6 gomp_loop_runtime_next 8 gomp_loop_runtime_next omp_lib [] gomp_loop_runtime_next Public ), gomp_loop_runtime_start: (ExternalSymbol 6 gomp_loop_runtime_start 8 gomp_loop_runtime_start omp_lib [] gomp_loop_runtime_start Public ), gomp_loop_static_next: (ExternalSymbol 6 gomp_loop_static_next 8 gomp_loop_static_next omp_lib [] gomp_loop_static_next Public ), gomp_loop_static_start: (ExternalSymbol 6 gomp_loop_static_start 8 gomp_loop_static_start omp_lib [] gomp_loop_static_start Public ), gomp_parallel: (ExternalSymbol 6 gomp_parallel 8 gomp_parallel omp_lib [] gomp_parallel Public ), gomp_sections_end: (ExternalSymbol 6 gomp_sections_end 8 gomp_sections_end omp_lib [] gomp_sections_end Public ), gomp_sections_next: (ExternalSymbol 6 gomp_sections_next 8 gomp_sections_next omp_lib [] gomp_sections_next Public ), gomp_sections_start: (ExternalSymbol 6 gomp_sections_start 8 gomp_sections_start omp_lib [] gomp_sections_start Public ), gomp_task: (ExternalSymbol 6 gomp_task 8 gomp_task omp_lib [] gomp_task Public ), gomp_taskwait: (ExternalSymbol 6 gomp_taskwait 8 gomp_taskwait omp_lib [] gomp_taskwait Public ), gomp_teams: (ExternalSymbol 6 gomp_teams 8 gomp_teams omp_lib [] gomp_teams Public ), omp_get_max_threads: (ExternalSymbol 6 omp_get_max_threads 8 omp_get_max_threads omp_lib [] omp_get_max_threads Public ), omp_get_num_procs: (ExternalSymbol 6 omp_get_num_procs 8 omp_get_num_procs omp_lib [] omp_get_num_procs Public ), omp_get_num_teams: (ExternalSymbol 6 omp_get_num_teams 8 omp_get_num_teams omp_lib [] omp_get_num_teams Public ), omp_get_num_threads: (ExternalSymbol 6 omp_get_num_threads 8 omp_get_num_threads omp_lib [] omp_get_num_threads Public ), omp_get_team_num: (ExternalSymbol 6 omp_get_team_num 8 omp_get_team_num omp_lib [] omp_get_team_num Public ), omp_get_team_size: (ExternalSymbol 6 omp_get_team_size 8 omp_get_team_size omp_lib [] omp_get_team_size Public ), omp_get_thread_num: (ExternalSymbol 6 omp_get_thread_num 8 omp_get_thread_num omp_lib [] omp_get_thread_num Public ), omp_get_wtime: (ExternalSymbol 6 omp_get_wtime 8 omp_get_wtime omp_lib [] omp_get_wtime Public ), omp_set_num_threads: (ExternalSymbol 6 omp_set_num_threads 8 omp_set_num_threads omp_lib [] omp_set_num_threads Public ), tid: (Variable 6 tid [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) openmp_44 [omp_lib openmp_44_parallel_sections] [(OMPRegion ParallelSections [(OMPReduction ReduceAdd [(Var 6 tid)] )] [(OMPRegion Section [] [(SubroutineCall 6 compute_a () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_b () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) (OMPRegion Section [] [(SubroutineCall 6 compute_c () [] () .false. ) (Assignment (Var 6 tid) (IntegerBinOp (Var 6 tid) Add (FunctionCall 6 omp_get_thread_num () [] (Integer 4) () () ) (Integer 4) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Thread ID:" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] )] ) (Print (StringFormat () [(StringConstant "Final Thread ID:" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 6 tid)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), openmp_44_parallel_sections: (Module (SymbolTable 2 { compute_a: (Function (SymbolTable 3 { }) compute_a (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing A" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_b: (Function (SymbolTable 4 { }) compute_b (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing B" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), compute_c: (Function (SymbolTable 5 { }) compute_c (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "Computing C" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ) }) openmp_44_parallel_sections () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-external_03-c3442bb.json0000664000175000017500000000076515141516316025773 0ustar alastairalastair{ "basename": "llvm-external_03-c3442bb", "cmd": "lfortran --show-llvm --implicit-typing --implicit-interface {infile} -o {outfile}", "infile": "tests/external_03.f90", "infile_hash": "82ee198be6d031398277671c0c2f48a832124a1458e94c3317d080ba", "outfile": null, "outfile_hash": null, "stdout": "llvm-external_03-c3442bb.stdout", "stdout_hash": "73cac86e0aeaa685c0525e073447a3aac497331abdd87d9d4143b83f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-class_04-285a1df.json0000664000175000017500000000074215141516316025074 0ustar alastairalastair{ "basename": "asr-class_04-285a1df", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/class_04.f90", "infile_hash": "0ddf2718f32dd9cfea8c4f4c9c384902ac023b5792e9fc8ec4a7648f", "outfile": null, "outfile_hash": null, "stdout": "asr-class_04-285a1df.stdout", "stdout_hash": "152510df255bd85fcc307f55c0141fb1eef53d47cd30ef83fbc7c64b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-derived_type_06-2623a81.json0000664000175000017500000000072115141516316026324 0ustar alastairalastair{ "basename": "run-derived_type_06-2623a81", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/derived_type_06.f90", "infile_hash": "002cfbfb5901ee3c9f0d5e33285543863528f17c4b8096e1a0e49134", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-derived_type_06-2623a81.stderr", "stderr_hash": "ff1b27fa36db7d6c70413cdaa96430864bfe071a1a93dfa74637034d", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-interface_01-9dc98da.json0000664000175000017500000000075615141516316026024 0ustar alastairalastair{ "basename": "asr-interface_01-9dc98da", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_01.f90", "infile_hash": "56828a66265782f7acd20520a5d25ac6246d6d44dfb8fa758507ed63", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_01-9dc98da.stdout", "stdout_hash": "a6e2aeaba6f2c18bdc5e6b6093b6eea09fb82932ea71135be1a987f9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_04-f7dffdb.json0000664000175000017500000000100115141516316030427 0ustar alastairalastair{ "basename": "asr-incorrect_type_where_04-f7dffdb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/incorrect_type_where_04.f90", "infile_hash": "42f8ace2a232052937d439ce0f429e27dd6d8ddf373aa4865c19e809", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-incorrect_type_where_04-f7dffdb.stderr", "stderr_hash": "2f1dc154ac637fbd20a8df4e194b496ba7829d58b3555e4a08845759", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/wat-abs_03-5d62cca.json0000664000175000017500000000071715141516316024620 0ustar alastairalastair{ "basename": "wat-abs_03-5d62cca", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/../integration_tests/abs_03.f90", "infile_hash": "ffb5c4ae935fc9de02705f53a5f1fe41b7acf18c9371f871897b63f4", "outfile": null, "outfile_hash": null, "stdout": "wat-abs_03-5d62cca.stdout", "stdout_hash": "6e37cfb34c5bc1bf29aebc6c4cd5120c46a8c96a4192330b73d8b011", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_03-a99cdd1.json0000664000175000017500000000075415141516316026740 0ustar alastairalastair{ "basename": "asr-matrix_matmul_03-a99cdd1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_03.f90", "infile_hash": "0127d8b9682c6b1a587f586c811d7be9bd222c3459ce7916cdaa2f5e", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_03-a99cdd1.stderr", "stderr_hash": "aa44194b2036aaa6754d00830b01c3e137396032ae25b19a86275e2b", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine5-272e7be.stdout0000664000175000017500000000100615141516316026313 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations void add(float a, float b, float &c); // Implementations void add(float a, float b, float &c) { c = a + b; } lfortran-lfortran-2f73434/tests/reference/cpp-types_03-dc774f0.json0000664000175000017500000000072515141516316025134 0ustar alastairalastair{ "basename": "cpp-types_03-dc774f0", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_03.f90", "infile_hash": "388683b8609d91d174ceb8c24787c982bf1ea22d342e94d44457b861", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_03-dc774f0.stdout", "stdout_hash": "1263bc24722b5a28a426bc3b9480c394cc2dbd0ba1ddd406d5176480", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-block_02-bdd6766.stdout0000664000175000017500000000044515141516316026120 0ustar alastairalastairprogram Block_02 integer :: A A = 10 1 loop: block integer :: B A = A + 5 if (A == 15) then go to 1 end if B = A/2 call Square(B) end block loop end program Block_02 subroutine Square(B) integer :: B, Result Result = B*B print *, Result end subroutine Square lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_03-a99cdd1.stderr0000664000175000017500000000026415141516316027266 0ustar alastairalastairsemantic error: The `matmul` intrinsic doesn't handle logical type yet --> tests/errors/matrix_matmul_03.f90:5:14 | 5 | print *, matmul(a, b) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-operator_overloading_02-adb886e.json0000664000175000017500000000102215141516316030455 0ustar alastairalastair{ "basename": "llvm-operator_overloading_02-adb886e", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_02.f90", "infile_hash": "d3f6f9065ea2f75dd235a6384cdd3f82769eb16971fac839a39430b6", "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_02-adb886e.stdout", "stdout_hash": "eaaf35b17286e4b9d6b072d2ec05a1c3c4ebdb5a3e7bcba60c1c2872", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-block_02-82f9e5f.stdout0000664000175000017500000000512715141516316025452 0ustar alastairalastair(TranslationUnit [(Program Block_02 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(A [] [] () () None ())] () )] [(Assignment 0 A 10 () ) (Block 1 loop [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ())] () )] [(Assignment 0 A (+ A 5) () ) (If 0 () (== A 15) [(GoTo 0 () 1 [] () )] [] () () () ) (Assignment 0 B (/ A 2) () ) (SubroutineCall 0 Square [] [(() B () 0)] [] [] () )] () () )] [] ) (Subroutine Square [(B)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(B [] [] () () None ()) (Result [] [] () () None ())] () )] [(Assignment 0 Result (* B B) () ) (Print 0 () [Result] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-expr5-00f7fd9.json0000664000175000017500000000070715141516316024722 0ustar alastairalastair{ "basename": "llvm-expr5-00f7fd9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "llvm-expr5-00f7fd9.stdout", "stdout_hash": "a02c5355af3fdc41f830b45e6a19a2e8bf264d1e1af15482a590a20d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-format2-ed47ddb.stdout0000664000175000017500000000511415141516316025735 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [5 x i8] c"(3l3)" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }> @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i32, align 4 %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 %3 = alloca i64, align 8 %4 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i64 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32* %a) %5 = load i64, i64* %3, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %4, i8** %6, align 8 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %5, i64* %7, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %9 = load i8*, i8** %8, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %11 = load i64, i64* %10, align 4 %12 = trunc i64 %11 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %13 = icmp eq i8* %4, null br i1 %13, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %4) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_format2 FINALIZE_SYMTABLE_format2: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-sole_intrinsic-3e826bd.json0000664000175000017500000000075215141516316026514 0ustar alastairalastair{ "basename": "asr-sole_intrinsic-3e826bd", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/sole_intrinsic.f", "infile_hash": "eb8dafc3736c80b83b7cc0b62cbe2fce5882fac022c391b7514607ea", "outfile": null, "outfile_hash": null, "stdout": "asr-sole_intrinsic-3e826bd.stdout", "stdout_hash": "592264c9622aa2a42894341ebbd3f21730e7f866a657df6d68f21f9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor5-fdb91a5.stdout0000664000175000017500000000473615141516316031205 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor5: (Program (SymbolTable 2 { }) preprocessor5 [] [(Print (StringFormat () [(IntegerConstant 1 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 12 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 3 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 6 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(IntegerConstant 15 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-if1-6dc9fe3.json0000664000175000017500000000071115141516316024710 0ustar alastairalastair{ "basename": "ast_f90-if1-6dc9fe3", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/if1.f90", "infile_hash": "52db0c880c11effc03c530998302e40daa23a4e191ee0dbf7fa5e631", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-if1-6dc9fe3.stdout", "stdout_hash": "47476381af23935043a0e3a59021dcdb204b96dcad8a2fe9e345be7b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nested_call_filter_01-2b1295b.json0000664000175000017500000000101115141516316027510 0ustar alastairalastair{ "basename": "asr-nested_call_filter_01-2b1295b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_call_filter_01.f90", "infile_hash": "8cec6df4b177816ae0e3fe2e6e58db32e27ffa4afb6640cbeabd017e", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_call_filter_01-2b1295b.stdout", "stdout_hash": "3e1c8d488d38b628bd9578b7289c3fa90ab25391fc97032ee3db5144", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor16-b846504.stdout0000664000175000017500000000224115141516316031035 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { test_cpp_hex: (Program (SymbolTable 2 { }) test_cpp_hex [] [(Print (StringConstant "yes hex and int equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "yes hex and bin equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "yes bin and int equal" (String 1 (IntegerConstant 21 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-doloop_04-4703a43.json0000664000175000017500000000074515141516316025123 0ustar alastairalastair{ "basename": "ast-doloop_04-4703a43", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_04.f90", "infile_hash": "d2027c560ba8546e31b7627200b8fb28695617c3238a8f1a086c62ef", "outfile": null, "outfile_hash": null, "stdout": "ast-doloop_04-4703a43.stdout", "stdout_hash": "d5cb209b69b54069ad695a22a3e1a200308d35141f54cc161520610a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-string_01-deb8ed3.json0000664000175000017500000000075015141516316025622 0ustar alastairalastair{ "basename": "llvm-string_01-deb8ed3", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/string_01.f90", "infile_hash": "e7d4974d8a9b9704bf0c02d7943d916b40c591de3c9e89d30de28d7d", "outfile": null, "outfile_hash": null, "stdout": "llvm-string_01-deb8ed3.stdout", "stdout_hash": "be2b3673a11f854ecfadca602eb894f64b2eb6fc59676c7d4e3c345b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_comment_01-a351b61.json0000664000175000017500000000103515141516316032356 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_comment_01-a351b61", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_comment_01.f90", "infile_hash": "e5e7342c0979e8c39e8c08bc57ecf06531f4805499dd5907b1e8a624", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_comment_01-a351b61.stderr", "stderr_hash": "dfdd308020e62292d3bb7aee51486f999e21edf5a2376e9c4fb0308f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-nested_06-1d576ad.json0000664000175000017500000000074515141516316025257 0ustar alastairalastair{ "basename": "asr-nested_06-1d576ad", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_06.f90", "infile_hash": "b94500b7f8becc154e61ec7d99e50e8c4cbbd4c0ca20bb262a670562", "outfile": null, "outfile_hash": null, "stdout": "asr-nested_06-1d576ad.stdout", "stdout_hash": "2734b7f9967fdc48161e0b7b7720eba2bfdf83196481332c04aa1ea4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope9-f638dd0.stdout0000664000175000017500000000155215141516316026563 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(Assignment (Var 1 x) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToInteger (Integer 8) (IntegerConstant 6 (Integer 8) Decimal) ) () .false. .false. ) (Var 1 x)] ) lfortran-lfortran-2f73434/tests/reference/asr-array_size_03-2036e61.stderr0000664000175000017500000000030015141516316026312 0ustar alastairalastairsemantic error: Unrecognized keyword argument kind1 passed to size intrinsic. --> tests/errors/array_size_03.f90:5:14 | 5 | size_a = size(a, kind1=4) | ^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-format_57-fd2be24.json0000664000175000017500000000071515141516316025364 0ustar alastairalastair{ "basename": "run-format_57-fd2be24", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_57.f90", "infile_hash": "122558608e06e05832cd183e40a6b9584f427d755c1e40a9f83b8f02", "outfile": null, "outfile_hash": null, "stdout": "run-format_57-fd2be24.stdout", "stdout_hash": "e442ff42ea9a10ae767fd7c4db819c36ce1e0c2dd6a26b01f20cc1f9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run_dbg-runtime_stacktrace_01-c6f5e06.json0000664000175000017500000000075615141516316030517 0ustar alastairalastair{ "basename": "run_dbg-runtime_stacktrace_01-c6f5e06", "cmd": "lfortran {infile} -g --no-color", "infile": "tests/errors/runtime_stacktrace_01.f90", "infile_hash": "3e65758e10744eea8d101be6437af3724c0ec32c832e29da968fc22d", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run_dbg-runtime_stacktrace_01-c6f5e06.stderr", "stderr_hash": "eb3c044e48ac8bbaa776077b6c9cef2ef164ade8cddef1d6a7f06792", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics1-8ebce32.json0000664000175000017500000000073515141516316026015 0ustar alastairalastair{ "basename": "asr-intrinsics1-8ebce32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics1.f90", "infile_hash": "c17e977183f2f0697725d766de0a9760cc2c8dfe7876932015490368", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics1-8ebce32.stderr", "stderr_hash": "a69fa16bae643b9253b934b298aae5af0979d43539549ac688767051", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-coarray_01-5f111e4.stderr0000664000175000017500000000022215141516316025663 0ustar alastairalastairsemantic error: Coarrays are not supported yet --> tests/errors/coarray_01.f90:3:11 | 3 | val = this_image () | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-template_error_01a-13d8554.json0000664000175000017500000000076215141516316027016 0ustar alastairalastair{ "basename": "asr-template_error_01a-13d8554", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/template_error_01a.f90", "infile_hash": "eb62f3418f54acc1174eb48b2fc68021207b031559d22e799d553b84", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-template_error_01a-13d8554.stderr", "stderr_hash": "dd98a1db76604d0f2c418b95c03b2f25d08af7e0be2bda152b5f494f", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-callback_04-0d9515f.stdout0000664000175000017500000000565215141516316026211 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [4 x i8] c"Dr. " @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [7 x i8] c"Fortran" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([7 x i8], [7 x i8]* @string_const_data.1, i32 0, i32 0), i64 7 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define void @__module_dr_fortran_cb_print_dr() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_dr FINALIZE_SYMTABLE_print_dr: ; preds = %return ret void } define void @__module_dr_fortran_cb_print_dr_fortran(void ()* %title_or_name) { .entry: call void %title_or_name() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_dr_fortran FINALIZE_SYMTABLE_print_dr_fortran: ; preds = %return ret void } declare void @title_or_name() define void @__module_dr_fortran_cb_print_fortran() { .entry: %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_print_fortran FINALIZE_SYMTABLE_print_fortran: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @__module_dr_fortran_cb_print_dr_fortran(void ()* @__module_dr_fortran_cb_print_dr) call void @__module_dr_fortran_cb_print_dr_fortran(void ()* @__module_dr_fortran_cb_print_fortran) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-Same_type-928201f.stderr0000664000175000017500000000025615141516316025605 0ustar alastairalastairsemantic error: same_type_as is not implemented yet --> tests/errors/Same_type.f90:2:14 | 2 | print *, same_type_as(1.0, 1.0) | ^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-int_02-e7de6a7.json0000664000175000017500000000073415141516316024650 0ustar alastairalastair{ "basename": "asr-int_02-e7de6a7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_02.f90", "infile_hash": "e0a72e598a44c468855decece6cfbb029978d0775ad4aae887346aed", "outfile": null, "outfile_hash": null, "stdout": "asr-int_02-e7de6a7.stdout", "stdout_hash": "fcb21ac4ec30975fef35de220b70d5ab0141a3e484c048811bba9e61", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor20-4100cdf.json0000664000175000017500000000077315141516316030614 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor20-4100cdf", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor20.f90", "infile_hash": "92d5833a5aa287f9dcaba4d229be92cebb43f929bdf60abf94329359", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor20-4100cdf.stdout", "stdout_hash": "2a725a8c93f610ba9081cde29a9c307c33f520092ed551b935df8ccb", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutines_04-cc5f6a4.stdout0000664000175000017500000000202615141516316027002 0ustar alastairalastair(TranslationUnit [(Program print_it () [] [] [] [(SubroutineCall 0 print_int [] [] [] [] () )] [(Subroutine print_int [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [] [] () () None ())] () )] [(Assignment 0 a 5 () ) (Print 0 () [a] () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-doloop_05-1dc897c.stdout0000664000175000017500000000034415141516316026323 0ustar alastairalastairprogram doloop_05 implicit none integer :: i, j 1 j = 0 2 I_LOOP: do i = 1, 10 3 if (i == 2) then cycle I_loop end if 4 j = j + i end do I_LOOP 6 if (j /= 53) then error stop end if end program doloop_05 lfortran-lfortran-2f73434/tests/reference/asr-derived_type1-c109ce6.json0000664000175000017500000000073415141516316026231 0ustar alastairalastair{ "basename": "asr-derived_type1-c109ce6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_type1.f90", "infile_hash": "ed39e2004e29457f0f83e6a1badf6ecbee98749ca624594fc0160e52", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_type1-c109ce6.stdout", "stdout_hash": "26b9e9e726ef8228b316d5ec7167547188c26a4de6b86528ea78d829", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-global_scope8-240995c.json0000664000175000017500000000073715141516316026243 0ustar alastairalastair{ "basename": "llvm-global_scope8-240995c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope8-240995c.stdout", "stdout_hash": "97bacf7b32aca9b8a255c52957b8cc7b76ac78f33a28437331018ad2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-case_01-b59db9c.json0000664000175000017500000000073715141516316024772 0ustar alastairalastair{ "basename": "asr-case_01-b59db9c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_01.f90", "infile_hash": "003a23367180e7f228e7e4ef5a6dfdb6749801b29ccf2002e2559e41", "outfile": null, "outfile_hash": null, "stdout": "asr-case_01-b59db9c.stdout", "stdout_hash": "9943edbbe8a7b785e22ef4a960594f71f6540abacb3363defd24e304", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence3-3737d89.json0000664000175000017500000000100415141516316031137 0ustar alastairalastair{ "basename": "rename_symbol-collect_occurence3-3737d89", "cmd": "lfortran --rename-symbol --no-color {infile} -o {outfile}", "infile": "tests/collect_occurence3.f90", "infile_hash": "64f44de76cd08c4e21e4f8e05bb2747574f998c95bcdb8d474c8c449", "outfile": null, "outfile_hash": null, "stdout": "rename_symbol-collect_occurence3-3737d89.stdout", "stdout_hash": "b3cdfcbdc16ad191eb06741f5a164c0b42530c8417c91b08ba740c03", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_03-54c2520.stdout0000664000175000017500000001327315141516316025644 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { access_vars: (Module (SymbolTable 2 { print_vars: (Function (SymbolTable 3 { }) print_vars (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "priv = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 priv)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "publ = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 publ)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), priv: (Variable 2 priv [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), publ: (Variable 2 publ [] Local (RealConstant 2.500000 (Real 4) ) (RealConstant 2.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) access_vars () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-codegen_function_polymorphic-834d4d1.json0000664000175000017500000000101415141516316031521 0ustar alastairalastair{ "basename": "llvm-codegen_function_polymorphic-834d4d1", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/codegen_function_polymorphic.f90", "infile_hash": "e8a86676ac666387de5e3e9d38e5dffa7c2c79a5d045b662cb990fc8", "outfile": null, "outfile_hash": null, "stdout": "llvm-codegen_function_polymorphic-834d4d1.stdout", "stdout_hash": "bd1fefe269a04a66dd111cf8ff2a4ab5aea8c4a7a598d93365b49790", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope7-70d8b93.stdout0000664000175000017500000000202415141516316026476 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { x: (Variable 1 x [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [(IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (Var 1 x) (Integer 4) () ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] ) lfortran-lfortran-2f73434/tests/reference/asr-kind_invalid_int_of_logical-6bf4989.stderr0000664000175000017500000000023515141516316031437 0ustar alastairalastairsemantic error: Kind 10 is not supported for Logical --> tests/errors/kind_invalid_int_of_logical.f90:3:13 | 3 | logical(10) :: x | ^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_03-ef06d46.json0000664000175000017500000000076115141516316026160 0ustar alastairalastair{ "basename": "asr-intrinsics_03-ef06d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", "infile_hash": "e7fb61db3237594018e226a4236884f778bd41ae0848c5667da97462", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_03-ef06d46.stdout", "stdout_hash": "9a7c2bb18754b47e590a29d03c3547922b167a2377859b6ea30ade0c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_05-4c31742.json0000664000175000017500000000076115141516316026013 0ustar alastairalastair{ "basename": "asr-intrinsics_05-4c31742", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_05.f90", "infile_hash": "735edff1f9942ce107c1b84f9ddcf00e648e553327f54dacf7b8238c", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_05-4c31742.stdout", "stdout_hash": "31d2fcd77c50489a64b5a06622909a5b106fa8222e0abb53281f41e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-use_02-fe85e54.stdout0000664000175000017500000000626415141516316025152 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), use_02: (Program (SymbolTable 7 { dp: (ExternalSymbol 7 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ), i: (Variable 7 i [] Local () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) use_02 [use_02_module] [(Assignment (Var 7 i) (IntegerConstant 1234567890123456789 (Integer 8) Decimal) () .false. .false. ) (If () (IntegerCompare (Var 7 i) NotEq (IntegerConstant 1234567890123456789 (Integer 8) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), use_02_module: (Module (SymbolTable 2 { dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public ) }) use_02_module () [iso_fortran_env] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-arrays_03_func-7c8d572.stdout0000664000175000017500000003263315141516316026610 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_03_func: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), mysum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) mysum (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 a) () (Integer 4) () ) ()) [(Assignment (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. )] [] )] (Var 3 r) Public .false. .false. () ), s: (Variable 2 s [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_03_func [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 x) () (Integer 4) (IntegerConstant 10 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Var 2 i) () .false. .false. )] [] ) (Assignment (Var 2 s) (FunctionCall 2 mysum () [((ArrayPhysicalCast (Var 2 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] DescriptorArray ) () ))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_02-74be421.json0000664000175000017500000000075015141516316025352 0ustar alastairalastair{ "basename": "asr-modules_02-74be421", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_02.f90", "infile_hash": "a52fdcb19f500c43afdd1fde1f90d5df8d34f2283a39704ab599a87c", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_02-74be421.stdout", "stdout_hash": "0fb91745245218333b297913e1e41b6aba0a609bc64857ebd3a0e1b5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-interface2-82ff094.stdout0000664000175000017500000000063515141516316026470 0ustar alastairalastairmodule interface2 implicit none abstract interface subroutine read_params(this, params) import class(porous_drag_model), intent(inout) :: this type(parameter_list), pointer, intent(in) :: params end subroutine read_params end interface interface assignment (=) module procedure SomeProc procedure SomeProc2 procedure SomeProc3 end interface assignment (=) end module interface2 lfortran-lfortran-2f73434/tests/reference/asr-do_zero_increment-06c400d.json0000664000175000017500000000075715141516316027105 0ustar alastairalastair{ "basename": "asr-do_zero_increment-06c400d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/do_zero_increment.f90", "infile_hash": "184258b59d1072b68cc129fef224f764dab47fd1087e4c7530b6de19", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-do_zero_increment-06c400d.stderr", "stderr_hash": "efaea8ebdf0ebe9f7e0393a80fd6a81698b3c5bef9f5ae6f35c5590c", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-sign_01-62b270e.stderr0000664000175000017500000000024715141516316025173 0ustar alastairalastairsemantic error: Kind of all the arguments of Sign must be the same --> tests/errors/sign_01.f90:2:14 | 2 | print *, sign(1, 1_8) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/cpp-case_01-49038b7.stdout0000664000175000017500000000240515141516316025111 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { int64_t i; int64_t out; i = 4; if (i == 1) { out = 10; std::cout<< "1"< #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/run-format_52-f04ddb1.json0000664000175000017500000000071515141516316025353 0ustar alastairalastair{ "basename": "run-format_52-f04ddb1", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_52.f90", "infile_hash": "2fe42a1ad98491fc272744dce3b07613c18da43661f2cff64f05771d", "outfile": null, "outfile_hash": null, "stdout": "run-format_52-f04ddb1.stdout", "stdout_hash": "67159b9946be8549559c52ca058592480baa7fc355f699832914bb3e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit8-5e681cf.json0000664000175000017500000000074215141516316025375 0ustar alastairalastair{ "basename": "asr-implicit8-5e681cf", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit8.f90", "infile_hash": "5ab8320f5bd93962cbba1babe7f4f17779af2d5575f625095988f4d8", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit8-5e681cf.stdout", "stdout_hash": "5685cad7cd375fc75096dd46ce1bd8f11bbdd95e7c38bf8275cb8cfc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_01_logical-13e0bd7.stdout0000664000175000017500000007454315141516316027335 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_01_logical: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Array (Logical 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_01_logical [] [(Assignment (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalConstant .true. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. )] [] ) (If () (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalConstant .false. (Logical 4) ) () .false. .false. ) (DoLoop () ((Var 2 i) (IntegerConstant 12 (Integer 4) Decimal) (IntegerConstant 14 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerBinOp (IntegerBinOp (Var 2 i) Sub (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) (LogicalBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Logical 4) ColMajor () ) And (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) () .false. .false. )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (LogicalBinOp (LogicalBinOp (LogicalBinOp (ArrayItem (Var 2 b) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) Or (ArrayItem (Var 2 b) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) Or (ArrayItem (Var 2 b) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) Or (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) () .false. .false. ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) () .false. .false. ) (If () (LogicalNot (ArrayItem (Var 2 b) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(DoLoop () ((Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(If () (IntegerCompare (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Mul (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4) () ) Div (IntegerConstant 2 (Integer 4) Decimal) (Integer 4) () ) (Integer 4) () ) (Integer 4) () ) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] [(Assignment (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Logical 4) ColMajor () ) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] [] )] [] ) (If () (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalNot (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (ArrayItem (Var 2 c) [(() (IntegerConstant 2 (Integer 4) Decimal) ()) (() (IntegerConstant 2 (Integer 4) Decimal) ())] (Logical 4) ColMajor () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-do3-54790e3.stdout0000664000175000017500000000301315141516316024364 0ustar alastairalastair(TranslationUnit [(Program do3 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 j 0 () ) (DoLoop 0 () 15 i 1 5 () [(Assignment 0 j (+ j i) () ) (Continue 15 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 j 0 () ) (DoLoop 0 () 20 i 1 6 2 [(Assignment 0 j (+ j i) () ) (Continue 20 () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-character2-bc7e2ce.stdout0000664000175000017500000001053015141516316026207 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { character2: (Program (SymbolTable 2 { char1: (Variable 2 char1 [] Local (StringConstant "Goat" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Goat" (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), char2: (Variable 2 char2 [] Local () () Default (String 1 (IntegerConstant 4 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), char_param: (Variable 2 char_param [] Local (StringConstant "App" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "App" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 3 (Integer 8) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) character2 [] [(Assignment (Var 2 char2) (StringConstant "Balle" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_return2-597f864.json0000664000175000017500000000076315141516316027017 0ustar alastairalastair{ "basename": "ast-fixedform_return2-597f864", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_return2.f", "infile_hash": "6f658841ac27efc9dc2d982f71ac53b36dbb27285a65c77b6d4ba3e7", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_return2-597f864.stdout", "stdout_hash": "a45713b76a4b8b39ab0a7d692b56859c738acf9fdb18beec1b7ea780", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_12-235fd97.json0000664000175000017500000000075615141516316025734 0ustar alastairalastair{ "basename": "asr-functions_12-235fd97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_12.f90", "infile_hash": "b0c5ee3ef02b2ff06fd9e184908e08c2c7c2753dbca9c55205be065b", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_12-235fd97.stdout", "stdout_hash": "e8264605215f4f9233d76fbcfe86b9c9d72acefc3b4b6109d03fd945", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_where-where_03-00685f9.json0000664000175000017500000000077515141516316026330 0ustar alastairalastair{ "basename": "pass_where-where_03-00685f9", "cmd": "lfortran --pass=where --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/where_03.f90", "infile_hash": "987afee1a50b146dbe0bb5ebb0052fdc3bcef478e6a2409f78b5607f", "outfile": null, "outfile_hash": null, "stdout": "pass_where-where_03-00685f9.stdout", "stdout_hash": "490b40f360b49caebe6e91ee60c587b06b865a1b921ff31d4a661641", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics5-1cd2db1.json0000664000175000017500000000073515141516316026006 0ustar alastairalastair{ "basename": "asr-intrinsics5-1cd2db1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/intrinsics5.f90", "infile_hash": "f6ab4986a500e1e177af025cc2991631cf382d103abca3355b09df16", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-intrinsics5-1cd2db1.stderr", "stderr_hash": "a7047f36c61c7a014d95d8993c15357b96d5223f6cecfb844bd3d472", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-array_01-6a86c32.json0000664000175000017500000000072415141516316025024 0ustar alastairalastair{ "basename": "asr-array_01-6a86c32", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_01.f90", "infile_hash": "d8217a9cb0fccab262234a2cd78ace42dd2ef8ef8412a6d3de9012aa", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_01-6a86c32.stderr", "stderr_hash": "590ff828b48820966380e2e27f1e5af17dda38e3bb542aee4d7f6e6a", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-expr4-eea496b.json0000664000175000017500000000076415141516316027552 0ustar alastairalastair{ "basename": "pass_global_stmts-expr4-eea496b", "cmd": "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr4.f90", "infile_hash": "104847f7b62623d6e9d6d752ab2c6c58a31b70bc70a9cae0b5809241", "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr4-eea496b.stdout", "stdout_hash": "afb0d866e29054f042e204839c271660fe2650dbc42d4ee9c0b35e7e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-functions_12-235fd97.stdout0000664000175000017500000001776215141516316026312 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_12: (Program (SymbolTable 2 { decodebase: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 3 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string_local: (Variable 3 string_local [string] Local () () Default (String 1 (StringLen (Var 3 string) (Integer 4) () ) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local (IntrinsicElementalFunction Real [(TypeInquiry Huge (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant 2147483647 (Integer 4) Decimal) )] 0 (Real 4) (RealConstant 2147483647.000000 (Real 4) ) ) (RealConstant 2147483647.000000 (Real 4) ) Parameter (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) decodebase (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 string)] [] (Var 3 r) Public .false. .false. () ) }) functions_12 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-functions_05-adf0d8b.json0000664000175000017500000000075615141516316026143 0ustar alastairalastair{ "basename": "asr-functions_05-adf0d8b", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_05.f90", "infile_hash": "cf4cc8e65f95bcf5b5aacbb6d16d2aa40ef2f4c8442d1cb19b680a35", "outfile": null, "outfile_hash": null, "stdout": "asr-functions_05-adf0d8b.stdout", "stdout_hash": "0a01f6f59cabd3a96656218ab70e413e6984d41488913bc1cae4cf68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-interface_02-c56d91f.stdout0000664000175000017500000001023415141516316026304 0ustar alastairalastair(TranslationUnit [(Module interface_02_mod (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a1 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine a3 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] )] [] [] ) (Program interface_02 () [(Use [] interface_02_mod [(UseSymbol a1 () ) (UseSymbol a2 () ) (UseSymbol a3 () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-template_triple-54fa485.stdout0000664000175000017500000051575215141516316027171 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { math_integer_m: (Module (SymbolTable 2 { add_integer: (Function (SymbolTable 3 { result: (Variable 3 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) add_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 result) (IntegerBinOp (Var 3 x) Add (Var 3 y) (Integer 4) () ) () .false. .false. )] (Var 3 result) Public .false. .false. () ), max_integer: (Function (SymbolTable 5 { result: (Variable 5 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) max_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 result) (IntrinsicElementalFunction Max [(Var 5 x) (Var 5 y)] 0 (Integer 4) () ) () .false. .false. )] (Var 5 result) Public .false. .false. () ), min_integer: (Function (SymbolTable 6 { result: (Variable 6 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 6 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 6 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) min_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 6 x) (Var 6 y)] [(Assignment (Var 6 result) (IntrinsicElementalFunction Min [(Var 6 x) (Var 6 y)] 0 (Integer 4) () ) () .false. .false. )] (Var 6 result) Public .false. .false. () ), minus_integer: (Function (SymbolTable 4 { result: (Variable 4 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus_integer (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 result) (IntegerBinOp (Var 4 x) Sub (Var 4 y) (Integer 4) () ) () .false. .false. )] (Var 4 result) Public .false. .false. () ), one_integer: (Function (SymbolTable 8 { result: (Variable 8 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) one_integer (FunctionType [] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 8 result) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. )] (Var 8 result) Public .false. .false. () ), zero_integer: (Function (SymbolTable 7 { result: (Variable 7 result [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) zero_integer (FunctionType [] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 7 result) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 7 result) Public .false. .false. () ) }) math_integer_m () [] .false. .false. .false. ), math_real_m: (Module (SymbolTable 9 { add_real: (Function (SymbolTable 10 { result: (Variable 10 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 10 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 10 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 10 x) (Var 10 y)] [(Assignment (Var 10 result) (RealBinOp (Var 10 x) Add (Var 10 y) (Real 4) () ) () .false. .false. )] (Var 10 result) Public .false. .false. () ), max_real: (Function (SymbolTable 13 { result: (Variable 13 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 13 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 13 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) max_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 13 x) (Var 13 y)] [(Assignment (Var 13 result) (IntrinsicElementalFunction Max [(Var 13 x) (Var 13 y)] 0 (Real 4) () ) () .false. .false. )] (Var 13 result) Public .false. .false. () ), min_real: (Function (SymbolTable 14 { result: (Variable 14 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 14 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 14 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) min_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 14 x) (Var 14 y)] [(Assignment (Var 14 result) (IntrinsicElementalFunction Min [(Var 14 x) (Var 14 y)] 0 (Real 4) () ) () .false. .false. )] (Var 14 result) Public .false. .false. () ), minus_real: (Function (SymbolTable 11 { result: (Variable 11 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 11 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) minus_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 11 x) (Var 11 y)] [(Assignment (Var 11 result) (RealBinOp (Var 11 x) Sub (Var 11 y) (Real 4) () ) () .false. .false. )] (Var 11 result) Public .false. .false. () ), one_real: (Function (SymbolTable 16 { result: (Variable 16 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) one_real (FunctionType [] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 16 result) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] (Var 16 result) Public .false. .false. () ), slash_real: (Function (SymbolTable 12 { result: (Variable 12 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 12 x) (Var 12 y)] [(Assignment (Var 12 result) (RealBinOp (Var 12 x) Div (Var 12 y) (Real 4) () ) () .false. .false. )] (Var 12 result) Public .false. .false. () ), zero_real: (Function (SymbolTable 15 { result: (Variable 15 result [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) zero_real (FunctionType [] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 15 result) (RealConstant 0.000000 (Real 4) ) () .false. .false. )] (Var 15 result) Public .false. .false. () ) }) math_real_m () [] .false. .false. .false. ), template_triple: (Program (SymbolTable 34 { add_integer: (ExternalSymbol 34 add_integer 2 add_integer math_integer_m [] add_integer Public ), add_real: (ExternalSymbol 34 add_real 9 add_real math_real_m [] add_real Public ), magma_r: (ExternalSymbol 34 magma_r 17 magma_r triple_m [] magma_r Public ), max_integer: (ExternalSymbol 34 max_integer 2 max_integer math_integer_m [] max_integer Public ), max_real: (ExternalSymbol 34 max_real 9 max_real math_real_m [] max_real Public ), min_integer: (ExternalSymbol 34 min_integer 2 min_integer math_integer_m [] min_integer Public ), min_real: (ExternalSymbol 34 min_real 9 min_real math_real_m [] min_real Public ), minus_integer: (ExternalSymbol 34 minus_integer 2 minus_integer math_integer_m [] minus_integer Public ), minus_real: (ExternalSymbol 34 minus_real 9 minus_real math_real_m [] minus_real Public ), one_integer: (ExternalSymbol 34 one_integer 2 one_integer math_integer_m [] one_integer Public ), one_real: (ExternalSymbol 34 one_real 9 one_real math_real_m [] one_real Public ), slash_real: (ExternalSymbol 34 slash_real 9 slash_real math_real_m [] slash_real Public ), test_add_triples: (ExternalSymbol 34 test_add_triples 24 test_add_triples use_triple_m [] test_add_triples Public ), test_max_triples: (ExternalSymbol 34 test_max_triples 24 test_max_triples use_triple_m [] test_max_triples Public ), test_minus_triples: (ExternalSymbol 34 test_minus_triples 24 test_minus_triples use_triple_m [] test_minus_triples Public ), triple_tmpl: (ExternalSymbol 34 triple_tmpl 17 triple_tmpl triple_m [] triple_tmpl Public ), zero_integer: (ExternalSymbol 34 zero_integer 2 zero_integer math_integer_m [] zero_integer Public ), zero_real: (ExternalSymbol 34 zero_real 9 zero_real math_real_m [] zero_real Public ) }) template_triple [use_triple_m] [(SubroutineCall 34 test_add_triples () [] () .false. ) (SubroutineCall 34 test_minus_triples () [] () .false. ) (SubroutineCall 34 test_max_triples () [] () .false. )] ), triple_m: (Module (SymbolTable 17 { magma_r: (Requirement (SymbolTable 18 { plus_t: (Function (SymbolTable 19 { l: (Variable 19 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 19 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 19 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 19 l) (Var 19 r)] [] (Var 19 total) Private .false. .false. () ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) magma_r [t plus_t] [] ), triple_tmpl: (Template (SymbolTable 20 { plus_t: (Function (SymbolTable 21 { l: (Variable 21 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 21 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 21 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 21 l) (Var 21 r)] [] (Var 21 total) Private .false. .false. () ), t: (Variable 20 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), triple_l: (Function (SymbolTable 22 { result: (Variable 22 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 22 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_l (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_t] [(Var 22 t)] [(Assignment (Var 22 result) (FunctionCall 20 plus_t () [((FunctionCall 20 plus_t () [((Var 22 t)) ((Var 22 t))] (TypeParameter t ) () () )) ((Var 22 t))] (TypeParameter t ) () () ) () .false. .false. )] (Var 22 result) Public .false. .false. () ), triple_r: (Function (SymbolTable 23 { result: (Variable 23 result [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 23 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_r (FunctionType [(TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_t] [(Var 23 t)] [(Assignment (Var 23 result) (FunctionCall 20 plus_t () [((Var 23 t)) ((FunctionCall 20 plus_t () [((Var 23 t)) ((Var 23 t))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 23 result) Public .false. .false. () ) }) triple_tmpl [t plus_t] [(Require magma_r [t plus_t] )] ) }) triple_m () [triple_m] .false. .false. .false. ), use_triple_m: (Module (SymbolTable 24 { add_integer: (ExternalSymbol 24 add_integer 2 add_integer math_integer_m [] add_integer Public ), add_real: (ExternalSymbol 24 add_real 9 add_real math_real_m [] add_real Public ), magma_r: (ExternalSymbol 24 magma_r 17 magma_r triple_m [] magma_r Public ), max_integer: (ExternalSymbol 24 max_integer 2 max_integer math_integer_m [] max_integer Public ), max_real: (ExternalSymbol 24 max_real 9 max_real math_real_m [] max_real Public ), min_integer: (ExternalSymbol 24 min_integer 2 min_integer math_integer_m [] min_integer Public ), min_real: (ExternalSymbol 24 min_real 9 min_real math_real_m [] min_real Public ), minus_integer: (ExternalSymbol 24 minus_integer 2 minus_integer math_integer_m [] minus_integer Public ), minus_real: (ExternalSymbol 24 minus_real 9 minus_real math_real_m [] minus_real Public ), one_integer: (ExternalSymbol 24 one_integer 2 one_integer math_integer_m [] one_integer Public ), one_real: (ExternalSymbol 24 one_real 9 one_real math_real_m [] one_real Public ), slash_real: (ExternalSymbol 24 slash_real 9 slash_real math_real_m [] slash_real Public ), test_add_triples: (Function (SymbolTable 25 { tal: (Variable 25 tal [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tar: (Variable 25 tar [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), triple_add_l: (Function (SymbolTable 26 { result: (Variable 26 result [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 26 t [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_add_l (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 26 t)] [(Assignment (Var 26 result) (FunctionCall 24 add_integer () [((FunctionCall 24 add_integer () [((Var 26 t)) ((Var 26 t))] (Integer 4) () () )) ((Var 26 t))] (Integer 4) () () ) () .false. .false. )] (Var 26 result) Public .false. .false. () ), triple_add_r: (Function (SymbolTable 27 { result: (Variable 27 result [] ReturnVar () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 27 t [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_add_r (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 27 t)] [(Assignment (Var 27 result) (FunctionCall 24 add_integer () [((Var 27 t)) ((FunctionCall 24 add_integer () [((Var 27 t)) ((Var 27 t))] (Integer 4) () () ))] (Integer 4) () () ) () .false. .false. )] (Var 27 result) Public .false. .false. () ) }) test_add_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 25 tal) (FunctionCall 25 triple_add_l () [((IntegerConstant 7 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 25 tar) (FunctionCall 25 triple_add_r () [((IntegerConstant 7 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tal = " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 25 tal) (StringConstant " tar = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 25 tar)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), test_max_triples: (Function (SymbolTable 31 { tmaxl: (Variable 31 tmaxl [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmaxr: (Variable 31 tmaxr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), triple_max_l: (Function (SymbolTable 32 { result: (Variable 32 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 32 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_max_l (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 32 t)] [(Assignment (Var 32 result) (FunctionCall 24 max_real () [((FunctionCall 24 max_real () [((Var 32 t)) ((Var 32 t))] (Real 4) () () )) ((Var 32 t))] (Real 4) () () ) () .false. .false. )] (Var 32 result) Public .false. .false. () ), triple_max_r: (Function (SymbolTable 33 { result: (Variable 33 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 33 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_max_r (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 33 t)] [(Assignment (Var 33 result) (FunctionCall 24 max_real () [((Var 33 t)) ((FunctionCall 24 max_real () [((Var 33 t)) ((Var 33 t))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 33 result) Public .false. .false. () ) }) test_max_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 31 tmaxl) (FunctionCall 31 triple_max_l () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 31 tmaxr) (FunctionCall 31 triple_max_r () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tmaxl =" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 31 tmaxl) (StringConstant " tmaxr =" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 31 tmaxr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), test_minus_triples: (Function (SymbolTable 28 { tml: (Variable 28 tml [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmr: (Variable 28 tmr [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), triple_minus_l: (Function (SymbolTable 29 { result: (Variable 29 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 29 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_minus_l (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 29 t)] [(Assignment (Var 29 result) (FunctionCall 24 minus_real () [((FunctionCall 24 minus_real () [((Var 29 t)) ((Var 29 t))] (Real 4) () () )) ((Var 29 t))] (Real 4) () () ) () .false. .false. )] (Var 29 result) Public .false. .false. () ), triple_minus_r: (Function (SymbolTable 30 { result: (Variable 30 result [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 30 t [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) triple_minus_r (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 30 t)] [(Assignment (Var 30 result) (FunctionCall 24 minus_real () [((Var 30 t)) ((FunctionCall 24 minus_real () [((Var 30 t)) ((Var 30 t))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 30 result) Public .false. .false. () ) }) test_minus_triples (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 28 tml) (FunctionCall 28 triple_minus_l () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Assignment (Var 28 tmr) (FunctionCall 28 triple_minus_r () [((RealConstant 7.000000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "tml = " (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 28 tml) (StringConstant " tmr = " (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 28 tmr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), triple_tmpl: (ExternalSymbol 24 triple_tmpl 17 triple_tmpl triple_m [] triple_tmpl Public ), zero_integer: (ExternalSymbol 24 zero_integer 2 zero_integer math_integer_m [] zero_integer Public ), zero_real: (ExternalSymbol 24 zero_real 9 zero_real math_real_m [] zero_real Public ) }) use_triple_m () [math_integer_m math_real_m triple_m use_triple_m] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do3-831f843.json0000664000175000017500000000075415141516316026516 0ustar alastairalastair{ "basename": "asr-data_implied_do3-831f843", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/data_implied_do3.f90", "infile_hash": "4c07155ba247fba917733abca349b0f913d94718d6f112b738a4b935", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-data_implied_do3-831f843.stderr", "stderr_hash": "60f5d377bcdf47e10bbe333081aa6b077dc3b4b637f3d42dee03fa97", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-expr3-1bb382e.json0000664000175000017500000000070415141516316024521 0ustar alastairalastair{ "basename": "ast-expr3-1bb382e", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/expr3.f90", "infile_hash": "a4aed9754913f48e6b1982a698f85476db8324f2d2efe0b1a2de88f5", "outfile": null, "outfile_hash": null, "stdout": "ast-expr3-1bb382e.stdout", "stdout_hash": "5e6f771ec509f32363e9d5c294dce2af51c4c3705bbca45163ff612e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_04-5864f91.stderr0000664000175000017500000000021115141516316025302 0ustar alastairalastairsemantic error: Type member a is not an array so it cannot be indexed. --> tests/errors/array_04.f90:8:1 | 8 | b%a(:) = 1 | ^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-attributes1-25126f0.stdout0000664000175000017500000000135115141516316026614 0ustar alastairalastairprogram attributes1 ! test for AST(to fmt) only character(len=4) :: a, b character, intent(in) :: str*(*) character(len=1, kind=c_char), target, bind(C, name="_binary_fclKernels_cl_start") :: fclKernelStart character(len=3) :: c(2) integer, volatile :: d, e real, external :: g equivalence (a, c(1)), (b, c(2)) type :: details sequence integer :: age character(len=50) :: name contains procedure, pass :: name => sample end type details intrinsic :: sin, cos double precision, intent(in) :: x(..) type(real(4)), allocatable :: x(:) type(integer(4)), allocatable :: x(:) type(character(len=4)), allocatable :: x(:) type(logical(4)), allocatable :: x(:) type(complex(4)), allocatable :: x(:) save :: /zzrayc/ end program attributes1 lfortran-lfortran-2f73434/tests/reference/llvm-logical3-4bbf8ea.stdout0000664000175000017500000005063315141516316026064 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [26 x i8] c"Line 1 - Condition is true" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data, i32 0, i32 0), i64 26 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [27 x i8] c"Line 1 - Condition is false" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.1, i32 0, i32 0), i64 27 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [26 x i8] c"Line 2 - Condition is true" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.3, i32 0, i32 0), i64 26 }> @7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.5 = private constant [27 x i8] c"Line 2 - Condition is false" @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.5, i32 0, i32 0), i64 27 }> @9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.7 = private constant [28 x i8] c"Line xor - Condition is true" @string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([28 x i8], [28 x i8]* @string_const_data.7, i32 0, i32 0), i64 28 }> @13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.9 = private constant [29 x i8] c"Line xor - Condition is false" @string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([29 x i8], [29 x i8]* @string_const_data.9, i32 0, i32 0), i64 29 }> @15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.11 = private constant [26 x i8] c"Line 3 - Condition is true" @string_const.12 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.11, i32 0, i32 0), i64 26 }> @19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.13 = private constant [27 x i8] c"Line 3 - Condition is false" @string_const.14 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.13, i32 0, i32 0), i64 27 }> @21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.15 = private constant [26 x i8] c"Line 4 - Condition is true" @string_const.16 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.15, i32 0, i32 0), i64 26 }> @25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @26 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.17 = private constant [27 x i8] c"Line 4 - Condition is false" @string_const.18 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.17, i32 0, i32 0), i64 27 }> @27 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @28 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @29 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @30 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.19 = private constant [26 x i8] c"Line 5 - Condition is true" @string_const.20 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.19, i32 0, i32 0), i64 26 }> @31 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @32 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @33 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @34 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.21 = private constant [27 x i8] c"Line 5 - Condition is false" @string_const.22 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.21, i32 0, i32 0), i64 27 }> @35 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @36 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.23 = private constant [26 x i8] c"Line 6 - Condition is true" @string_const.24 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.23, i32 0, i32 0), i64 26 }> @37 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @38 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.25 = private constant [27 x i8] c"Line 6 - Condition is false" @string_const.26 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.25, i32 0, i32 0), i64 27 }> @39 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @40 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @41 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @42 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.27 = private constant [26 x i8] c"Line 7 - Condition is true" @string_const.28 = private global %string_descriptor <{ i8* getelementptr inbounds ([26 x i8], [26 x i8]* @string_const_data.27, i32 0, i32 0), i64 26 }> @43 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @44 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.29 = private constant [27 x i8] c"Line 7 - Condition is false" @string_const.30 = private global %string_descriptor <{ i8* getelementptr inbounds ([27 x i8], [27 x i8]* @string_const_data.29, i32 0, i32 0), i64 27 }> @45 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @46 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @47 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @48 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.31 = private constant [30 x i8] c"Line 8 xor - Condition is true" @string_const.32 = private global %string_descriptor <{ i8* getelementptr inbounds ([30 x i8], [30 x i8]* @string_const_data.31, i32 0, i32 0), i64 30 }> @49 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @50 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @51 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @52 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.33 = private constant [31 x i8] c"Line 8 xor - Condition is false" @string_const.34 = private global %string_descriptor <{ i8* getelementptr inbounds ([31 x i8], [31 x i8]* @string_const_data.33, i32 0, i32 0), i64 31 }> @53 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %a = alloca i1, align 1 %b = alloca i1, align 1 store i1 true, i1* %a, align 1 store i1 false, i1* %b, align 1 %2 = load i1, i1* %a, align 1 %3 = load i1, i1* %b, align 1 %4 = icmp eq i1 %2, false %5 = select i1 %4, i1 %2, i1 %3 br i1 %5, label %then, label %else then: ; preds = %.entry %6 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont else: ; preds = %.entry %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %7, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) br label %ifcont ifcont: ; preds = %else, %then %8 = load i1, i1* %a, align 1 %9 = load i1, i1* %b, align 1 %10 = icmp eq i1 %8, false %11 = select i1 %10, i1 %9, i1 %8 br i1 %11, label %then1, label %else2 then1: ; preds = %ifcont %12 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %12, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1) br label %ifcont3 else2: ; preds = %ifcont %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %13, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont3 ifcont3: ; preds = %else2, %then1 %14 = load i1, i1* %a, align 1 %15 = load i1, i1* %b, align 1 %16 = icmp eq i1 %14, false %17 = xor i1 %14, %15 br i1 %17, label %then4, label %else5 then4: ; preds = %ifcont3 %18 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %18, i32 28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1) br label %ifcont6 else5: ; preds = %ifcont3 %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* %19, i32 29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont6 ifcont6: ; preds = %else5, %then4 store i1 false, i1* %a, align 1 store i1 true, i1* %b, align 1 %20 = load i1, i1* %a, align 1 %21 = load i1, i1* %b, align 1 %22 = icmp eq i1 %20, false %23 = select i1 %22, i1 %20, i1 %21 %24 = xor i1 %23, true br i1 %24, label %then7, label %else8 then7: ; preds = %ifcont6 %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.12, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %25, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0), i32 1) br label %ifcont9 else8: ; preds = %ifcont6 %26 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.14, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* %26, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont9 ifcont9: ; preds = %else8, %then7 %27 = load i1, i1* %b, align 1 %28 = load i1, i1* %a, align 1 %29 = icmp eq i1 %27, false %30 = xor i1 %27, %28 br i1 %30, label %then10, label %else11 then10: ; preds = %ifcont9 %31 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.16, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* %31, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0), i32 1) br label %ifcont12 else11: ; preds = %ifcont9 %32 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.18, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @27, i32 0, i32 0), i8* %32, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @26, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @29, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @28, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont12 ifcont12: ; preds = %else11, %then10 %33 = load i1, i1* %b, align 1 %34 = load i1, i1* %a, align 1 %35 = icmp eq i1 %33, false %36 = xor i1 %33, %34 %37 = xor i1 %36, true br i1 %37, label %then13, label %else14 then13: ; preds = %ifcont12 %38 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.20, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @31, i32 0, i32 0), i8* %38, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @30, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @33, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @32, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont15 else14: ; preds = %ifcont12 %39 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.22, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @35, i32 0, i32 0), i8* %39, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @34, i32 0, i32 0), i32 1) br label %ifcont15 ifcont15: ; preds = %else14, %then13 store i1 true, i1* %a, align 1 store i1 true, i1* %b, align 1 %40 = load i1, i1* %a, align 1 %41 = load i1, i1* %b, align 1 %42 = icmp eq i1 %40, false %43 = select i1 %42, i1 %40, i1 %41 br i1 %43, label %then16, label %else17 then16: ; preds = %ifcont15 %44 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.24, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @37, i32 0, i32 0), i8* %44, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @36, i32 0, i32 0), i32 1) br label %ifcont18 else17: ; preds = %ifcont15 %45 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.26, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @39, i32 0, i32 0), i8* %45, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @38, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @41, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @40, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont18 ifcont18: ; preds = %else17, %then16 %46 = load i1, i1* %a, align 1 %47 = load i1, i1* %b, align 1 %48 = icmp eq i1 %46, false %49 = select i1 %48, i1 %47, i1 %46 br i1 %49, label %then19, label %else20 then19: ; preds = %ifcont18 %50 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.28, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @43, i32 0, i32 0), i8* %50, i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @42, i32 0, i32 0), i32 1) br label %ifcont21 else20: ; preds = %ifcont18 %51 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.30, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @45, i32 0, i32 0), i8* %51, i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @44, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @47, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @46, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 ifcont21: ; preds = %else20, %then19 %52 = load i1, i1* %a, align 1 %53 = load i1, i1* %b, align 1 %54 = icmp eq i1 %52, false %55 = xor i1 %52, %53 br i1 %55, label %then22, label %else23 then22: ; preds = %ifcont21 %56 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.32, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @49, i32 0, i32 0), i8* %56, i32 30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @48, i32 0, i32 0), i32 1) call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @51, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @50, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 else23: ; preds = %ifcont21 %57 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.34, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @53, i32 0, i32 0), i8* %57, i32 31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @52, i32 0, i32 0), i32 1) br label %ifcont24 ifcont24: ; preds = %else23, %then22 call void @_lpython_free_argv() br label %return return: ; preds = %ifcont24 br label %FINALIZE_SYMTABLE_logical3 FINALIZE_SYMTABLE_logical3: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lcompilers_print_error(i8*, ...) declare void @exit(i32) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor1-7e98a71.json0000664000175000017500000000077015141516316030474 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor1-7e98a71", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor1.f90", "infile_hash": "a07132d08deb1a0de21dd365371df337fe07652c9d42aa4c0a7e19ab", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor1-7e98a71.stdout", "stdout_hash": "9f77a9fa93093c46ae5e913eb0c3835f60f700966b7dab0427d2af95", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_reshape_14-913f34e.json0000664000175000017500000000077515141516316026732 0ustar alastairalastair{ "basename": "asr-arrays_reshape_14-913f34e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_reshape_14.f90", "infile_hash": "0001f1a35a57d435e0471d176786ced2d1e7b86afa641941eea5b6c2", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_reshape_14-913f34e.stdout", "stdout_hash": "12d3758c6510dd1dc08df2cb5f108eadaab5ec1c7dc9916996d4eb71", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_01-b50f880.json0000664000175000017500000000077215141516316026561 0ustar alastairalastair{ "basename": "ast-derived_types_01-b50f880", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_01.f90", "infile_hash": "d5361dd7a0436fd13655dcc3ad47c98f3ce6966934537f5e9cc001c5", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_01-b50f880.stdout", "stdout_hash": "9ad1a427d553d75dee4ed8aaec8980903a8cb169804e15a0a7d308e1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-min_01-aa661b0.stderr0000664000175000017500000000047615141516316025073 0ustar alastairalastairwarning: Different kinds of args in max0 is a non-standard extension --> tests/../integration_tests/min_01.f90:58:34 | 58 | output_min_different_kinds = min(real_inp5, real_inp6) | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: ensure all arguments have the same kind to make it standard lfortran-lfortran-2f73434/tests/reference/asr-case_03-e03f722.json0000664000175000017500000000073715141516316024623 0ustar alastairalastair{ "basename": "asr-case_03-e03f722", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/case_03.f90", "infile_hash": "4fc1bb48b2136f22bb44b7c69aaa05a43b4ed2e4b8464c433340295d", "outfile": null, "outfile_hash": null, "stdout": "asr-case_03-e03f722.stdout", "stdout_hash": "d0dd9dad551d34d9567d41ffaf9f0c43ba50c7ab38cfb93625dfa3e2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-char_arr_assignment-1f9a875.stdout0000664000175000017500000001255715141516316030007 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { char_arr_assignment: (Program (SymbolTable 2 { char_arr: (Variable 2 char_arr [] Local () () Default (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) char_arr_assignment [] [(Assignment (ArraySection (Var 2 char_arr) [((ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () ) (ArrayBroadcast (StringConstant "A" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (IntrinsicArrayFunction Shape [(ArraySection (Var 2 char_arr) [((ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) LBound (IntegerConstant 1 (Integer 4) Decimal) ) (ArrayBound (Var 2 char_arr) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) UBound (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal))] (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () )] 0 (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) () ) (Array (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) [(() ())] DescriptorArray ) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-select_type_03-f21585a.stdout0000664000175000017500000010576415141516316026612 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { class_default_select_type: (Module (SymbolTable 4 { enum_stat: (Struct (SymbolTable 5 { fatal: (Variable 5 fatal [] Local (IntegerUnaryMinus (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) (IntegerConstant -1 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), success: (Variable 5 success [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) enum_stat (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) [] [success fatal] [] Source Public .false. .false. [] () () ), toml_stat: (Variable 4 toml_stat [] Local (StructConstant 4 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 4 enum_stat [((IntegerConstant 0 (Integer 4) Decimal)) ((IntegerConstant -1 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4)] [] .true. .false. ) 4 enum_stat Source Public Required .false. .false. .false. () .false. .false. ) }) class_default_select_type () [] .true. .false. .false. ), class_default_select_type_user: (Module (SymbolTable 2 { 1_enum_stat: (ExternalSymbol 2 1_enum_stat 4 enum_stat class_default_select_type [] enum_stat Public ), check_table: (Function (SymbolTable 9 { tab: (Variable 9 tab [] Out () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. ) }) check_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 9 tab)] [(Print (StringConstant "inside check_table" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] () Public .false. .false. () ), get_table: (Function (SymbolTable 8 { ptr: (Variable 8 ptr [] Out () () Default (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 8 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), table: (Variable 8 table [] InOut () () Default (StructType [(Logical 4) (Logical 4)] [] .false. .false. ) 2 toml_table Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 8 tmp [] Local () () Default (Pointer (StructType [(Real 4) (Integer 4)] [] .false. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), ~select_type_block_: (Block (SymbolTable 10 { 1_enum_stat_success: (ExternalSymbol 10 1_enum_stat_success 5 success 1_enum_stat [] success Public ) }) ~select_type_block_ [(Associate (Var 8 ptr) (Var 8 tmp) ) (If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 2 toml_stat) 10 1_enum_stat_success (Integer 4) (IntegerConstant 0 (Integer 4) Decimal) ) () .false. .false. )] [] )] ), ~select_type_block_1: (Block (SymbolTable 11 { 1_enum_stat_fatal: (ExternalSymbol 11 1_enum_stat_fatal 5 fatal 1_enum_stat [] fatal Public ) }) ~select_type_block_1 [(If () (IntrinsicElementalFunction Present [(Var 8 stat)] 0 (Logical 4) () ) [(Assignment (Var 8 stat) (StructInstanceMember (Var 2 toml_stat) 11 1_enum_stat_fatal (Integer 4) (IntegerConstant -1 (Integer 4) Decimal) ) () .false. .false. )] [] )] ) }) get_table (FunctionType [(StructType [(Logical 4) (Logical 4)] [] .false. .false. ) (Pointer (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check_table] [(Var 8 table) (Var 8 ptr) (Var 8 stat)] [(Nullify [(Var 8 ptr)] ) (If () (PointerAssociated (Var 8 tmp) () (Logical 4) () ) [(SelectType (Var 8 tmp) () [(TypeStmtName 2 toml_table [(BlockCall -1 8 ~select_type_block_ )] )] [(BlockCall -1 8 ~select_type_block_1 )] )] [(SubroutineCall 2 check_table () [((Var 8 table))] () .false. )] )] () Public .false. .false. () ), toml_stat: (ExternalSymbol 2 toml_stat 4 toml_stat class_default_select_type [] toml_stat Public ), toml_table: (Struct (SymbolTable 7 { implicit: (Variable 7 implicit [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), inline: (Variable 7 inline [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_table (StructType [(Logical 4) (Logical 4)] [] .true. .false. ) [] [implicit inline] [] Source Public .false. .false. [] () 2 toml_value ), toml_value: (Struct (SymbolTable 6 { float: (Variable 6 float [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), int: (Variable 6 int [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Real 4) (Integer 4)] [] .true. .false. ) [] [int float] [] Source Public .false. .false. [] () () ) }) class_default_select_type_user () [class_default_select_type] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-statement_01-00eefc8.json0000664000175000017500000000102515141516316026043 0ustar alastairalastair{ "basename": "asr-statement_01-00eefc8", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_01.f90", "infile_hash": "fa4dec1637f247dd008b3228459dec03794d377643c25b443ba26c08", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_01-00eefc8.stdout", "stdout_hash": "aaca17e6539a8975e980b60e827c0d524e2accb133198e1f82f0cb02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-types_01-c4e1000.stdout0000664000175000017500000000542715141516316025416 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local f32) f32.const 1.000000 local.set 0 f32.const 1.500000 local.set 0 f32.const 1.000000 local.set 0 f32.const 2.000000 local.set 0 f32.const 3.000000 local.set 0 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent_reduce3-9c6ccff.stdout0000664000175000017500000000730315141516316030466 0ustar alastairalastair(TranslationUnit [(Subroutine sum_reduce [(a) (s)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(s [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 s 0 () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMul [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMIN [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [(ConcurrentReduce ReduceMAX [s] )] [(Assignment 0 s (+ s (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/julia-arrays_04_func-2fc0cbe.json0000664000175000017500000000075515141516316026760 0ustar alastairalastair{ "basename": "julia-arrays_04_func-2fc0cbe", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/arrays_04_func.f90", "infile_hash": "50eb699e803e7dace8da286ee49cdb7381ebe3141bff17ca374f1f02", "outfile": null, "outfile_hash": null, "stdout": "julia-arrays_04_func-2fc0cbe.stdout", "stdout_hash": "1e1f59588204d803f78587c90afb9a66f5b9d495b06ab6209166984b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-nested_02-68e8526.stdout0000664000175000017500000000365215141516316025502 0ustar alastairalastair(TranslationUnit [(Module nested_02_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine b [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [] [(Print 0 () [(String "b()" ())] () ) (SubroutineCall 0 c [] [] [] [] () )] [(Subroutine c [] [] () () [] [] [] [] [(Print 0 () [5] () )] [] [] )] [] )] ) (Program nested_02 () [(Use [] nested_02_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 b [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-external5-1198a6f.json0000664000175000017500000000076715141516316025327 0ustar alastairalastair{ "basename": "asr-external5-1198a6f", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/external5.f90", "infile_hash": "9cfe44ca13ef4bb7741e5f47c62a07845fd079f51b1d82747fc20517", "outfile": null, "outfile_hash": null, "stdout": "asr-external5-1198a6f.stdout", "stdout_hash": "ad657fec5bcfdf660d89f95ce63f969ab7fd078f08ab5996220c38e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-expr_11-ab53b8f.json0000664000175000017500000000105015141516316025333 0ustar alastairalastair{ "basename": "julia-expr_11-ab53b8f", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/expr_11.f90", "infile_hash": "1d3eee7b6af3504909d82d761867baf90d2f74b36edc4a6eac4e341f", "outfile": null, "outfile_hash": null, "stdout": "julia-expr_11-ab53b8f.stdout", "stdout_hash": "da36777fb96cf532038d909e0d70c196fb8d519c9f86d86e7e903336", "stderr": "julia-expr_11-ab53b8f.stderr", "stderr_hash": "3982eb2e7c64c27254305941b9a7f4d9f69369c801f76c5dece5e3dd", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_1-3be6d43.stderr0000664000175000017500000000021015141516316026350 0ustar alastairalastairtokenizer error: Expecting terminating symbol for program --> tests/errors/fixed_form_1.f:2:7 | 2 | xinteger :: y | ^ lfortran-lfortran-2f73434/tests/reference/run-format_35-3cec85a.json0000664000175000017500000000071515141516316025363 0ustar alastairalastair{ "basename": "run-format_35-3cec85a", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_35.f90", "infile_hash": "f896fc01b6e682902fd344315307e1e7d30628de4f084373e8661259", "outfile": null, "outfile_hash": null, "stdout": "run-format_35-3cec85a.stdout", "stdout_hash": "1eb4aa6672473c6d9a100da8d292060aacac62d946b7c74b373cd04c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-read1-fd137ad.json0000664000175000017500000000070415141516316024537 0ustar alastairalastair{ "basename": "ast-read1-fd137ad", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/read1.f90", "infile_hash": "a8601ffbfb4ea0a84892d205a776a40b585951d3e69794b2b29d399a", "outfile": null, "outfile_hash": null, "stdout": "ast-read1-fd137ad.stdout", "stdout_hash": "502a60c2a6007288bf7ae468b8114e14be8975d0df9718588b038b8c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_27-4f64cb2.stdout0000664000175000017500000011540715141516316026022 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_27: (Program (SymbolTable 12 { }) modules_27 [] [(Print (StringConstant "running modules_27 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ), tomlf_build: (Module (SymbolTable 2 { get_elem_array@get_value: (ExternalSymbol 2 get_elem_array@get_value 4 get_elem_array tomlf_build_array [] get_elem_array Public ), get_elem_keyval@get_value: (ExternalSymbol 2 get_elem_keyval@get_value 4 get_elem_keyval tomlf_build_array [] get_elem_keyval Public ), get_elem_table@get_value: (ExternalSymbol 2 get_elem_table@get_value 4 get_elem_table tomlf_build_array [] get_elem_table Public ), get_value: (GenericProcedure 2 get_value [2 get_elem_table@get_value 2 get_elem_array@get_value 2 get_elem_keyval@get_value 2 get_value_float_sp@get_value 2 get_value_float_dp@get_value] Public ), get_value_float_dp@get_value: (ExternalSymbol 2 get_value_float_dp@get_value 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_sp@get_value: (ExternalSymbol 2 get_value_float_sp@get_value 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ) }) tomlf_build () [tomlf_build_array tomlf_build_keyval] .false. .false. .false. ), tomlf_build_array: (Module (SymbolTable 4 { get_elem_array: (Function (SymbolTable 5 { array: (Variable 5 array [] InOut () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), pos: (Variable 5 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 5 ptr [] Out () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 5 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) get_elem_array (FunctionType [(Complex 4) (Integer 4) (Pointer (Real 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 array) (Var 5 pos) (Var 5 ptr) (Var 5 stat)] [] () Public .false. .false. () ), get_elem_keyval: (Function (SymbolTable 6 { array: (Variable 6 array [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pos: (Variable 6 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 6 ptr [] Out () () Default (Pointer (Complex 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 6 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) get_elem_keyval (FunctionType [(Integer 4) (Integer 4) (Pointer (Complex 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 6 array) (Var 6 pos) (Var 6 ptr) (Var 6 stat)] [] () Public .false. .false. () ), get_elem_table: (Function (SymbolTable 7 { array: (Variable 7 array [] InOut () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), pos: (Variable 7 pos [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 7 ptr [] Out () () Default (Pointer (Real 4) ) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 7 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ) }) get_elem_table (FunctionType [(Integer 4) (Integer 4) (Pointer (Real 4) ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 array) (Var 7 pos) (Var 7 ptr) (Var 7 stat)] [(Assignment (Var 4 global_var) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] () Public .false. .false. () ), get_value: (GenericProcedure 4 get_value [4 get_elem_table 4 get_elem_array 4 get_elem_keyval 4 get_value_float_sp 4 get_value_float_dp] Public ), get_value_float_dp: (ExternalSymbol 4 get_value_float_dp 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_dp@get_value: (ExternalSymbol 4 get_value_float_dp@get_value 9 get_value_float_dp tomlf_build_keyval [] get_value_float_dp Public ), get_value_float_sp: (ExternalSymbol 4 get_value_float_sp 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ), get_value_float_sp@get_value: (ExternalSymbol 4 get_value_float_sp@get_value 9 get_value_float_sp tomlf_build_keyval [] get_value_float_sp Public ), global_var: (ExternalSymbol 4 global_var 9 global_var tomlf_build_keyval [] global_var Public ) }) tomlf_build_array () [tomlf_build_keyval] .true. .false. .false. ), tomlf_build_keyval: (Module (SymbolTable 9 { get_value: (GenericProcedure 9 get_value [9 get_value_float_sp 9 get_value_float_dp] Public ), get_value_float_dp: (Function (SymbolTable 10 { self: (Variable 10 self [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 10 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), val: (Variable 10 val [] Out () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_value_float_dp (FunctionType [(Complex 4) (Real 8) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 10 self) (Var 10 val) (Var 10 stat)] [] () Public .false. .false. () ), get_value_float_sp: (Function (SymbolTable 11 { self: (Variable 11 self [] In () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 11 stat [] Out () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), val: (Variable 11 val [] Out () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) get_value_float_sp (FunctionType [(Complex 4) (Real 4) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 11 self) (Var 11 val) (Var 11 stat)] [] () Public .false. .false. () ), global_var: (Variable 9 global_var [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) tomlf_build_keyval () [] .true. .false. .false. ) }) [] ) ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-functions_15-581089a.jsonlfortran-lfortran-2f73434/tests/reference/pass_transform_optional_argument_functions-functions_15-580000664000175000017500000000115115141516316034361 0ustar alastairalastair{ "basename": "pass_transform_optional_argument_functions-functions_15-581089a", "cmd": "lfortran --pass=transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_15.f90", "infile_hash": "a12bb6ea6046f7462606bd7d550d6bc8a46655d6593d5a5e4425d051", "outfile": null, "outfile_hash": null, "stdout": "pass_transform_optional_argument_functions-functions_15-581089a.stdout", "stdout_hash": "b6406c62b0b5aa96d0b8aea5a58bae93702b94377ab51455f8f7fdd9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_02-726d5e8.json0000664000175000017500000000075015141516316025365 0ustar alastairalastair{ "basename": "llvm-nested_02-726d5e8", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_02.f90", "infile_hash": "6ff700b8b837d9efad78b5ed4d8defc823333a19f8afa37c7da6899d", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_02-726d5e8.stdout", "stdout_hash": "8faf8250b4d74d54111f4663fcd9edd50b278f61021b3130e503cdde", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_01-9ec8e71.json0000664000175000017500000000115515141516316030222 0ustar alastairalastair{ "basename": "asr-operator_overloading_01-9ec8e71", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_01.f90", "infile_hash": "f44f3172b4b5235b41deb5a4d4eaadc61a6b7c51e002a983889cf38f", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_01-9ec8e71.stdout", "stdout_hash": "52148a6678548012e9f62b4b746e7dc668cc4799fa3b5a2c589f62d0", "stderr": "asr-operator_overloading_01-9ec8e71.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_array_op-arrays_op_10-be689f7.stdout0000664000175000017500000004053615141516316030436 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { compare_solutions: (Function (SymbolTable 3 { i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) compare_solutions (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solution] [] [(Print (StringFormat () [(ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (FunctionCall 2 solution () [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () () ) () (Integer 4) (IntegerConstant 2 (Integer 4) Decimal) ) ()) [(Assignment (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) (Cast (Var 3 i) IntegerToReal (Real 4) () ) () .false. .false. )] [] ) (DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) ()) [(Print (StringFormat () [(ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (RealCompare (ArrayItem (Var 3 x) [(() (Var 3 i) ())] (Real 4) ColMajor () ) NotEq (Cast (Var 3 i) IntegerToReal (Real 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] () Public .false. .false. () ), solution: (Function (SymbolTable 4 { x: (Variable 4 x [] ReturnVar () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) solution (FunctionType [] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (RealConstant 1.000000 (Real 4) ) () .false. .false. )] (Var 4 x) Public .false. .false. () ) }) main [] [(SubroutineCall 2 compare_solutions () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/fortran-enum_01-3bcfd6d.json0000664000175000017500000000075315141516316025761 0ustar alastairalastair{ "basename": "fortran-enum_01-3bcfd6d", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/enum_01.f90", "infile_hash": "5dba9f630102c9e10a43f8075bc95880e0892b33a7fb16524b5ea275", "outfile": null, "outfile_hash": null, "stdout": "fortran-enum_01-3bcfd6d.stdout", "stdout_hash": "46202d796cd96d7c3c507b59536814f0c04eb9e72b7a7798c6abdf9f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-write2-3444284.stdout0000664000175000017500000000672115141516316025036 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { write2: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) write2 [] [(FileWrite 0 () () () () [(StringFormat (StringConstant "(a)" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) [(StringConstant "Some text: " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] () (StringConstant "" (String 1 (IntegerConstant 0 (Integer 4) Decimal) ExpressionLength DescriptorString) ) () .true. () () ) (FileRead 0 () () () () () () () () [(Var 2 i)] () .false. () () ) (Print (StringFormat () [(StringConstant "Got: " (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-types_02-0b28cb7.json0000664000175000017500000000072515141516316025124 0ustar alastairalastair{ "basename": "cpp-types_02-0b28cb7", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/types_02.f90", "infile_hash": "6b9728dd8c74663d697504a17537aef00ed9210bf24fae6e7e0468bc", "outfile": null, "outfile_hash": null, "stdout": "cpp-types_02-0b28cb7.stdout", "stdout_hash": "8038845f96b485395508247d09b1e57a55077e9804005492b68ca8cf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-string_14-861794e.stdout0000664000175000017500000006375115141516316025535 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_14: (Program (SymbolTable 6 { }) string_14 [] [] ), string_14_stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { iomsg: (Variable 5 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), iostat: (Variable 5 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iotype: (Variable 5 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), line: (Variable 5 line [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 5 string [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 5 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), v_list: (Variable 5 v_list [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) read_formatted (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 string) (Var 5 unit) (Var 5 iotype) (Var 5 v_list) (Var 5 iostat) (Var 5 iomsg)] [] () Public .false. .false. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Private Required .false. .false. .false. () .false. .false. ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Private .false. .false. [] () () ), write_formatted: (Function (SymbolTable 4 { iomsg: (Variable 4 iomsg [] InOut () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), iostat: (Variable 4 iostat [] Out () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iotype: (Variable 4 iotype [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 4 string [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), unit: (Variable 4 unit [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), v_list: (Variable 4 v_list [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) write_formatted (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) (Integer 4) (String 1 () AssumedLength DescriptorString) (Array (Integer 4) [(() ())] DescriptorArray ) (Integer 4) (String 1 () AssumedLength DescriptorString)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 string) (Var 4 unit) (Var 4 iotype) (Var 4 v_list) (Var 4 iostat) (Var 4 iomsg)] [] () Public .false. .false. () ), ~read_formatted: (CustomOperator 2 ~read_formatted [2 read_formatted] Public ), ~write_formatted: (CustomOperator 2 ~write_formatted [2 write_formatted] Public ) }) string_14_stdlib_string_type () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutine4-22dcb28.stdout0000664000175000017500000000035615141516316026634 0ustar alastairalastairfunction triad(a::Array{Float32, 1}, b::Array{Float32, 1}, scalar::Float32, c::Array{Float32, 1}) local i::Int32 local n::Int32 n = length(a) Threads.@threads for i ∈ 1:n c[i] = a[i] + scalar * b[i] end end lfortran-lfortran-2f73434/tests/reference/llvm-global_scope2-ccffd68.json0000664000175000017500000000073715141516316026541 0ustar alastairalastair{ "basename": "llvm-global_scope2-ccffd68", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope2.f90", "infile_hash": "e511f118b9a040b5e7a3ff2ad75cd7942dee08d3a21bd4ca5cd668b3", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope2-ccffd68.stdout", "stdout_hash": "9bb71550ec3462f41d1b988e1482cbc5ea31944e2c1b7d06afcc27cc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_07-7f671c1.json0000664000175000017500000000072315141516316025365 0ustar alastairalastair{ "basename": "asr-modules_07-7f671c1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules_07.f90", "infile_hash": "803312680c18e8658ffb84d2288a3ed6ebdef21a99ed09fd3007f9c9", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_07-7f671c1.stdout", "stdout_hash": "d3921e918418776d9008813c5509bc1b042121b63644513e4535ef23", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_09-afed6c8.json0000664000175000017500000000074315141516316030007 0ustar alastairalastair{ "basename": "run-array_bounds_check_09-afed6c8", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_09.f90", "infile_hash": "a0763b8438157b6413dbda8eb34da783f57fcdb6f82be814b39f6a35", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_09-afed6c8.stderr", "stderr_hash": "8bccb29905a55de7a344e829574f46c6daa5f9a74a1b59246c1e8133", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/obj-subroutine3-942b3d8.json0000664000175000017500000000057315141516316025662 0ustar alastairalastair{ "basename": "obj-subroutine3-942b3d8", "cmd": "lfortran --no-color -c {infile} -o output.o", "infile": "tests/subroutine3.f90", "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-data_implied_do_01-737a2b1.json0000664000175000017500000000100015141516316026762 0ustar alastairalastair{ "basename": "asr-data_implied_do_01-737a2b1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_implied_do_01.f90", "infile_hash": "95b501e531eaccdd3dd537fd2bed661c592c8237e6ca72bf86217e60", "outfile": null, "outfile_hash": null, "stdout": "asr-data_implied_do_01-737a2b1.stdout", "stdout_hash": "22097e563537875458bca5ba3d9d6c90ee56fc93018d21a1cec4dc32", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-c_ptr_02-fce1b0e.stdout0000664000175000017500000006133615141516316025606 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), test_c_ptr_02: (Program (SymbolTable 2 { 1_test_obj_ptr: (ExternalSymbol 2 1_test_obj_ptr 11 ptr test_obj [] ptr Public ), c_arr: (Variable 2 c_arr [] Local () () Default (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .true. .false. () .false. .false. ), c_associated: (ExternalSymbol 2 c_associated 4 c_associated lfortran_intrinsic_iso_c_binding [] c_associated Public ), c_bool: (ExternalSymbol 2 c_bool 4 c_bool lfortran_intrinsic_iso_c_binding [] c_bool Public ), c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public ), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public ), c_double_complex: (ExternalSymbol 2 c_double_complex 4 c_double_complex lfortran_intrinsic_iso_c_binding [] c_double_complex Public ), c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public ), c_float_complex: (ExternalSymbol 2 c_float_complex 4 c_float_complex lfortran_intrinsic_iso_c_binding [] c_float_complex Public ), c_funloc: (ExternalSymbol 2 c_funloc 4 c_funloc lfortran_intrinsic_iso_c_binding [] c_funloc Public ), c_funptr: (ExternalSymbol 2 c_funptr 4 c_funptr lfortran_intrinsic_iso_c_binding [] c_funptr Public ), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public ), c_int16_t: (ExternalSymbol 2 c_int16_t 4 c_int16_t lfortran_intrinsic_iso_c_binding [] c_int16_t Public ), c_int32_t: (ExternalSymbol 2 c_int32_t 4 c_int32_t lfortran_intrinsic_iso_c_binding [] c_int32_t Public ), c_int64_t: (ExternalSymbol 2 c_int64_t 4 c_int64_t lfortran_intrinsic_iso_c_binding [] c_int64_t Public ), c_int8_t: (ExternalSymbol 2 c_int8_t 4 c_int8_t lfortran_intrinsic_iso_c_binding [] c_int8_t Public ), c_intptr_t: (ExternalSymbol 2 c_intptr_t 4 c_intptr_t lfortran_intrinsic_iso_c_binding [] c_intptr_t Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_long: (ExternalSymbol 2 c_long 4 c_long lfortran_intrinsic_iso_c_binding [] c_long Public ), c_long_double: (ExternalSymbol 2 c_long_double 4 c_long_double lfortran_intrinsic_iso_c_binding [] c_long_double Public ), c_long_double_complex: (ExternalSymbol 2 c_long_double_complex 4 c_long_double_complex lfortran_intrinsic_iso_c_binding [] c_long_double_complex Public ), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public ), c_new_line: (ExternalSymbol 2 c_new_line 4 c_new_line lfortran_intrinsic_iso_c_binding [] c_new_line Public ), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public ), c_null_funptr: (ExternalSymbol 2 c_null_funptr 4 c_null_funptr lfortran_intrinsic_iso_c_binding [] c_null_funptr Public ), c_null_ptr: (ExternalSymbol 2 c_null_ptr 4 c_null_ptr lfortran_intrinsic_iso_c_binding [] c_null_ptr Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), c_short: (ExternalSymbol 2 c_short 4 c_short lfortran_intrinsic_iso_c_binding [] c_short Public ), c_size_t: (ExternalSymbol 2 c_size_t 4 c_size_t lfortran_intrinsic_iso_c_binding [] c_size_t Public ), instance: (Variable 2 instance [] Local () () Default (StructType [(CPtr)] [] .true. .false. ) 2 test_obj Source Public Required .false. .false. .false. () .false. .false. ), r_ptr: (Variable 2 r_ptr [] Local () () Default (Pointer (Array (Real 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), temp_ptr: (Variable 2 temp_ptr [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), test_obj: (Struct (SymbolTable 11 { ptr: (Variable 11 ptr [] Local (PointerNullConstant (CPtr) () ) (PointerNullConstant (CPtr) () ) Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_obj (StructType [(CPtr)] [] .true. .false. ) [] [ptr] [] Source Public .false. .false. [] () () ) }) test_c_ptr_02 [iso_c_binding] [(Assignment (Var 2 temp_ptr) (StructInstanceMember (Var 2 instance) 2 1_test_obj_ptr (CPtr) () ) () .false. .false. ) (Assignment (Var 2 c_arr) (ArrayBroadcast (ComplexConstructor (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal) (Complex 4) (ComplexConstant 1.000000 2.000000 (Complex 4) ) ) (ArrayConstant 4 [2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Complex 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 2 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (CPtrToPointer (PointerToCPtr (GetPointer (Var 2 c_arr) (Pointer (Array (Complex 4) [(() ())] DescriptorArray ) ) () ) (CPtr) () ) (Var 2 r_ptr) (ArrayConstant 4 [4] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] PointerArray ) ColMajor ) () ) (Print (StringFormat () [(Var 2 c_arr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(Var 2 r_ptr)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (PointerAssociated (Var 2 temp_ptr) () (Logical 4) () ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout0000664000175000017500000000411215141516316031466 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { f: (Function (SymbolTable 2 { }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 1 x) (IntegerConstant 6 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] () Public .false. .false. () ), x: (Variable 1 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-operator_overloading_04-e28fb55.json0000664000175000017500000000101715141516316030215 0ustar alastairalastair{ "basename": "asr-operator_overloading_04-e28fb55", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/operator_overloading_04.f90", "infile_hash": "03bc0260935fa2e3a432a8eb21ad59c74bccf134d03f6d0e90873258", "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_04-e28fb55.stdout", "stdout_hash": "e75d29ab48c4baf41ade4649d20f0e575b9179acd553782233ff2fb3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-modules_04-d194daa.stdout0000664000175000017500000000036615141516316026547 0ustar alastairalastairmodule access_vars implicit none private public :: print_vars real :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-lfortran-2f73434/tests/reference/asr-document_symbols1-8238851.json0000664000175000017500000000075015141516316026722 0ustar alastairalastair{ "basename": "asr-document_symbols1-8238851", "cmd": "lfortran --show-document-symbols --no-color {infile}", "infile": "tests/document_symbols1.f90", "infile_hash": "63380b78f4939eb6236957b3c4c2a2b1beb2627acae189b56c7bb109", "outfile": null, "outfile_hash": null, "stdout": "asr-document_symbols1-8238851.stdout", "stdout_hash": "713efa6ddb19614bb35fe1992fbc3a4cf70dcb3bcb9d383f6e322246", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_24-257ddde.json0000664000175000017500000000071515141516316025364 0ustar alastairalastair{ "basename": "run-format_24-257ddde", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_24.f90", "infile_hash": "99034e6786ee2c33055ce1a71b2d06c850dded80ec23526fd1c8f163", "outfile": null, "outfile_hash": null, "stdout": "run-format_24-257ddde.stdout", "stdout_hash": "405337ca82091625fad9b9597809b2b231c029cf23254b415d71da44", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-bin_op_real_dp-224f1cf.stdout0000664000175000017500000000517315141516316027156 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [12 x i8] c"R4,R8,R4,R8\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %u = alloca double, align 8 %v = alloca double, align 8 %x = alloca float, align 4 %zero = alloca float, align 4 store float 0x3FC24924A0000000, float* %zero, align 4 store double 0x3FC2492492492492, double* %u, align 8 store double 0x3FC2492492492492, double* %v, align 8 store float 0x3FC24924A0000000, float* %x, align 4 %2 = alloca i64, align 8 %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @serialization_info, i32 0, i32 0), i64* %2, i32 0, i32 0, float* %zero, double* %v, float* %x, double* %u) %4 = load i64, i64* %2, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %3, i8** %5, align 8 %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %4, i64* %6, align 4 %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %8 = load i8*, i8** %7, align 8 %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %10 = load i64, i64* %9, align 4 %11 = trunc i64 %10 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %12 = icmp eq i8* %3, null br i1 %12, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %3) br label %free_done free_done: ; preds = %free_nonnull, %.entry call void @_lpython_free_argv() br label %return return: ; preds = %free_done br label %FINALIZE_SYMTABLE_bin_op_real_dp FINALIZE_SYMTABLE_bin_op_real_dp: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-implicit10-23a5156.stdout0000664000175000017500000006351215141516316025650 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), d: (Variable 2 d [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), d1: (Variable 2 d1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), e: (Variable 2 e [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), e1: (Variable 2 e1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Variable 2 f [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f1: (Variable 2 f1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), g: (Variable 2 g [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), h: (Variable 2 h [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), k: (Variable 2 k [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), l: (Variable 2 l [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), m: (Variable 2 m [] Local () () Default (Complex 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Complex 8) () Source Public Required .false. .false. .false. () .false. .false. ), o: (Variable 2 o [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), p: (Variable 2 p [] Local () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [d1 e1 f1] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 d1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1)) ((IntegerConstant 1 (Integer 4) Decimal) (Var 2 f1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [e1] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 e1))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) a (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (ArrayItem (Var 2 y) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (Assignment (ArrayItem (Var 2 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 a) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 d) (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 f) (Cast (IntegerConstant 4 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 4.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 h) (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 5.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 i) (Cast (IntegerConstant 6 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 6.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 l) (Cast (IntegerConstant 7 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 7.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 m) (Cast (IntegerConstant 8 (Integer 4) Decimal) IntegerToComplex (Complex 4) (ComplexConstant 8.000000 0.000000 (Complex 4) ) ) () .false. .false. ) (Assignment (Var 2 o) (Cast (IntegerConstant 9 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 9.000000 (Real 8) ) ) () .false. .false. ) (Assignment (Var 2 p) (Cast (IntegerConstant 10 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 10.000000 (Real 8) ) ) () .false. .false. )] (Var 2 a) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-types_10-8a81911.stdout0000664000175000017500000001266415141516316025353 0ustar alastairalastair(TranslationUnit [(Program types_10 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ()) (j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Declaration () [(SimpleAttribute AttrSave )] [(i [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine f [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] () )] [(Assignment 0 j i () )] [] [] ) (Subroutine g [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [(j [] [] () () None ())] () )] [(Assignment 0 j i () )] [] [] ) (Subroutine h [(i)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent In )] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(j [] [] () () None ())] () ) (Declaration () [(SimpleAttribute AttrSave )] [] () )] [(Assignment 0 j i () )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_14-75884fe.stdout0000664000175000017500000010266415141516316027155 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_types_14_module: (Module (SymbolTable 4 { enum_type: (Struct (SymbolTable 5 { boolean: (Variable 5 boolean [] Local (IntegerConstant 102 (Integer 4) Decimal) (IntegerConstant 102 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), datetime: (Variable 5 datetime [] Local (IntegerConstant 105 (Integer 4) Decimal) (IntegerConstant 105 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), float: (Variable 5 float [] Local (IntegerConstant 104 (Integer 4) Decimal) (IntegerConstant 104 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), int: (Variable 5 int [] Local (IntegerConstant 103 (Integer 4) Decimal) (IntegerConstant 103 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), invalid: (Variable 5 invalid [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), string: (Variable 5 string [] Local (IntegerConstant 101 (Integer 4) Decimal) (IntegerConstant 101 (Integer 4) Decimal) Save (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) enum_type (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) [] [invalid string boolean int float datetime] [] Source Private .false. .false. [] () () ), toml_type: (Variable 4 toml_type [] Local (StructConstant 4 enum_type [((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 101 (Integer 4) Decimal)) ((IntegerConstant 102 (Integer 4) Decimal)) ((IntegerConstant 103 (Integer 4) Decimal)) ((IntegerConstant 104 (Integer 4) Decimal)) ((IntegerConstant 105 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) (StructConstant 4 enum_type [((IntegerConstant 100 (Integer 4) Decimal)) ((IntegerConstant 101 (Integer 4) Decimal)) ((IntegerConstant 102 (Integer 4) Decimal)) ((IntegerConstant 103 (Integer 4) Decimal)) ((IntegerConstant 104 (Integer 4) Decimal)) ((IntegerConstant 105 (Integer 4) Decimal))] (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) ) Parameter (StructType [(Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4) (Integer 4)] [] .true. .false. ) 4 enum_type Source Public Required .false. .false. .false. () .false. .false. ) }) derived_types_14_module () [] .true. .false. .false. ), derived_types_14_module1: (Module (SymbolTable 2 { check: (Function (SymbolTable 7 { raw: (Variable 7 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), res: (Variable 7 res [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) check (FunctionType [(String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 7 raw)] [(Assignment (Var 7 res) (LogicalConstant .true. (Logical 4) ) () .false. .false. )] (Var 7 res) Public .false. .false. () ), enum_type: (ExternalSymbol 2 enum_type 4 enum_type derived_types_14_module [] enum_type Public ), toml_get_value_type: (Function (SymbolTable 6 { 1_enum_type_boolean: (ExternalSymbol 6 1_enum_type_boolean 5 boolean enum_type [] boolean Public ), 1_enum_type_datetime: (ExternalSymbol 6 1_enum_type_datetime 5 datetime enum_type [] datetime Public ), 1_enum_type_float: (ExternalSymbol 6 1_enum_type_float 5 float enum_type [] float Public ), 1_enum_type_int: (ExternalSymbol 6 1_enum_type_int 5 int enum_type [] int Public ), 1_enum_type_invalid: (ExternalSymbol 6 1_enum_type_invalid 5 invalid enum_type [] invalid Public ), 1_enum_type_string: (ExternalSymbol 6 1_enum_type_string 5 string enum_type [] string Public ), raw: (Variable 6 raw [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), vtype: (Variable 6 vtype [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_get_value_type (FunctionType [(String 1 () AssumedLength DescriptorString)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [check] [(Var 6 raw)] [(If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_string (Integer 4) (IntegerConstant 101 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_boolean (Integer 4) (IntegerConstant 102 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_int (Integer 4) (IntegerConstant 103 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_float (Integer 4) (IntegerConstant 104 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (If () (FunctionCall 2 check () [((Var 6 raw))] (Logical 4) () () ) [(Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_datetime (Integer 4) (IntegerConstant 105 (Integer 4) Decimal) ) () .false. .false. ) (Return)] [] ) (Assignment (Var 6 vtype) (StructInstanceMember (Var 2 toml_type) 6 1_enum_type_invalid (Integer 4) (IntegerConstant 100 (Integer 4) Decimal) ) () .false. .false. )] (Var 6 vtype) Public .false. .false. () ), toml_type: (ExternalSymbol 2 toml_type 4 toml_type derived_types_14_module [] toml_type Public ) }) derived_types_14_module1 () [derived_types_14_module derived_types_14_module1] .false. .false. .false. ), main: (Program (SymbolTable 8 { }) main [] [(Print (StringConstant "running derived_types_14 main program" (String 1 (IntegerConstant 37 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor7-4734850.json0000664000175000017500000000077015141516316030333 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor7-4734850", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor7.f90", "infile_hash": "67aeb717d19dca60cfa9d8bb49195e781ef549a0abd3b08f5d09771b", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor7-4734850.stdout", "stdout_hash": "310c4c62acb4d50c9ebec1fb6e6937ccf2d324e807bccbd08206c7e4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_implied_do_loops-modules_35-c089638.json0000664000175000017500000000104415141516316031073 0ustar alastairalastair{ "basename": "pass_implied_do_loops-modules_35-c089638", "cmd": "lfortran --pass=implied_do_loops --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_35.f90", "infile_hash": "5117017b03ab16e2fa34e13800ebd9e03539c4bd6ad2fafc1e543dbb", "outfile": null, "outfile_hash": null, "stdout": "pass_implied_do_loops-modules_35-c089638.stdout", "stdout_hash": "91dd73bc1f17b01db87b1570ae173f52525ba58051ea85006a6b10c5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-no_prescan_include2-121e523.json0000664000175000017500000000075615141516316027237 0ustar alastairalastair{ "basename": "ast-no_prescan_include2-121e523", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include2.f90", "infile_hash": "68cbbaed9ac272ba7009bc7e89270e6e2a12fd0c540413dc2a0a96eb", "outfile": null, "outfile_hash": null, "stdout": "ast-no_prescan_include2-121e523.stdout", "stdout_hash": "8de0f82041c19a65b764da84f38b8db45f0ba6114d34de25ef791999", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-string_01-e28a827.stdout0000664000175000017500000000127315141516316025566 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static std::string my_name="Dominic"; std::cout << "My name is " << " " << my_name << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-template_travel_02-4448a71.stdout0000664000175000017500000056167515141516316027411 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_travel_02: (Program (SymbolTable 26 { add_real: (ExternalSymbol 26 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (ExternalSymbol 26 operations 5 operations template_travel_02_travel [] operations Public ), slash_real: (ExternalSymbol 26 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), test_template: (ExternalSymbol 26 test_template 23 test_template template_travel_02_m [] test_template Public ), travel_tmpl: (ExternalSymbol 26 travel_tmpl 5 travel_tmpl template_travel_02_travel [] travel_tmpl Public ), travel_tmpl2: (ExternalSymbol 26 travel_tmpl2 5 travel_tmpl2 template_travel_02_travel [] travel_tmpl2 Public ) }) template_travel_02 [template_travel_02_m] [(SubroutineCall 26 test_template () [] () .false. )] ), template_travel_02_m: (Module (SymbolTable 23 { add_real: (ExternalSymbol 23 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (ExternalSymbol 23 operations 5 operations template_travel_02_travel [] operations Public ), slash_real: (ExternalSymbol 23 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), test_template: (Function (SymbolTable 24 { __asr_avg_s_from_t: (Function (SymbolTable 27 { avg: (Variable 27 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 27 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 27 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 27 t1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 27 t2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) __asr_avg_s_from_t (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 27 d1) (Var 27 t1) (Var 27 d2) (Var 27 t2)] [(Assignment (Var 27 avg) (FunctionCall 23 slash_real () [((FunctionCall 23 add_real () [((Var 27 d1)) ((Var 27 d2))] (Real 4) () () )) ((FunctionCall 23 add_real () [((Var 27 t1)) ((Var 27 t2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 27 avg) Public .false. .false. () ), avg_real_s_from_s: (Function (SymbolTable 25 { avg: (Variable 25 avg [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 25 d1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 25 d2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 25 s1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 25 s2 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_real_s_from_s (FunctionType [(Real 4) (Real 4) (Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [__asr_avg_s_from_t] [(Var 25 d1) (Var 25 s1) (Var 25 d2) (Var 25 s2)] [(Assignment (Var 25 avg) (FunctionCall 24 __asr_avg_s_from_t () [((Var 25 d1)) ((FunctionCall 23 slash_real () [((Var 25 d1)) ((Var 25 s1))] (Real 4) () () )) ((Var 25 d2)) ((FunctionCall 23 slash_real () [((Var 25 d2)) ((Var 25 s2))] (Real 4) () () ))] (Real 4) () () ) () .false. .false. )] (Var 25 avg) Private .false. .false. () ), s: (Variable 24 s [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) test_template (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 24 s) (FunctionCall 24 avg_real_s_from_s () [((RealConstant 1.100000 (Real 4) )) ((RealConstant 0.500000 (Real 4) )) ((RealConstant 2.000000 (Real 4) )) ((RealConstant 0.750000 (Real 4) ))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "s=" (String 1 (IntegerConstant 2 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 24 s)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), travel_tmpl: (ExternalSymbol 23 travel_tmpl 5 travel_tmpl template_travel_02_travel [] travel_tmpl Public ), travel_tmpl2: (ExternalSymbol 23 travel_tmpl2 5 travel_tmpl2 template_travel_02_travel [] travel_tmpl2 Public ) }) template_travel_02_m () [template_travel_02_math template_travel_02_travel template_travel_02_m] .false. .false. .false. ), template_travel_02_math: (Module (SymbolTable 2 { add_real: (Function (SymbolTable 3 { total: (Variable 3 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 3 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) add_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 3 x) (Var 3 y)] [(Assignment (Var 3 total) (RealBinOp (Var 3 x) Add (Var 3 y) (Real 4) () ) () .false. .false. )] (Var 3 total) Public .false. .false. () ), slash_real: (Function (SymbolTable 4 { total: (Variable 4 total [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) slash_real (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 4 x) (Var 4 y)] [(Assignment (Var 4 total) (RealBinOp (Var 4 x) Div (Var 4 y) (Real 4) () ) () .false. .false. )] (Var 4 total) Public .false. .false. () ) }) template_travel_02_math () [] .false. .false. .false. ), template_travel_02_travel: (Module (SymbolTable 5 { add_real: (ExternalSymbol 5 add_real 2 add_real template_travel_02_math [] add_real Public ), operations: (Requirement (SymbolTable 6 { d: (Variable 6 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d_divided_by_s: (Function (SymbolTable 10 { d: (Variable 10 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 10 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 10 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 10 n) (Var 10 d)] [] (Var 10 quotient) Private .false. .false. () ), d_divided_by_t: (Function (SymbolTable 9 { d: (Variable 9 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 9 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 9 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 9 n) (Var 9 d)] [] (Var 9 quotient) Private .false. .false. () ), plus_d: (Function (SymbolTable 7 { l: (Variable 7 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 7 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 7 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 7 l) (Var 7 r)] [] (Var 7 total) Private .false. .false. () ), plus_t: (Function (SymbolTable 8 { l: (Variable 8 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 8 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 8 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 8 l) (Var 8 r)] [] (Var 8 total) Private .false. .false. () ), s: (Variable 6 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 6 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [] ), slash_real: (ExternalSymbol 5 slash_real 2 slash_real template_travel_02_math [] slash_real Public ), travel_tmpl: (Template (SymbolTable 11 { avg_s_from_s: (Function (SymbolTable 17 { avg: (Variable 17 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 17 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 17 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 17 s1 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 17 s2 [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_s (FunctionType [(TypeParameter d ) (TypeParameter s ) (TypeParameter d ) (TypeParameter s )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [d_divided_by_s avg_s_from_t] [(Var 17 d1) (Var 17 s1) (Var 17 d2) (Var 17 s2)] [(Assignment (Var 17 avg) (FunctionCall 11 avg_s_from_t () [((Var 17 d1)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d1)) ((Var 17 s1))] (TypeParameter t ) () () )) ((Var 17 d2)) ((FunctionCall 11 d_divided_by_s () [((Var 17 d2)) ((Var 17 s2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 17 avg) Private .false. .false. () ), avg_s_from_t: (Function (SymbolTable 16 { avg: (Variable 16 avg [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 16 d1 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 16 d2 [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 16 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 16 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_t (FunctionType [(TypeParameter d ) (TypeParameter t ) (TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus_d plus_t d_divided_by_t] [(Var 16 d1) (Var 16 t1) (Var 16 d2) (Var 16 t2)] [(Assignment (Var 16 avg) (FunctionCall 11 d_divided_by_t () [((FunctionCall 11 plus_d () [((Var 16 d1)) ((Var 16 d2))] (TypeParameter d ) () () )) ((FunctionCall 11 plus_t () [((Var 16 t1)) ((Var 16 t2))] (TypeParameter t ) () () ))] (TypeParameter s ) () () ) () .false. .false. )] (Var 16 avg) Public .false. .false. () ), d: (Variable 11 d [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), d_divided_by_s: (Function (SymbolTable 15 { d: (Variable 15 d [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 15 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 15 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_s (FunctionType [(TypeParameter d ) (TypeParameter s )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 15 n) (Var 15 d)] [] (Var 15 quotient) Private .false. .false. () ), d_divided_by_t: (Function (SymbolTable 14 { d: (Variable 14 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 14 n [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 14 quotient [] ReturnVar () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ) }) d_divided_by_t (FunctionType [(TypeParameter d ) (TypeParameter t )] (TypeParameter s ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 14 n) (Var 14 d)] [] (Var 14 quotient) Private .false. .false. () ), plus_d: (Function (SymbolTable 12 { l: (Variable 12 l [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 12 r [] In () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 12 total [] ReturnVar () () Default (TypeParameter d ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_d (FunctionType [(TypeParameter d ) (TypeParameter d )] (TypeParameter d ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 12 l) (Var 12 r)] [] (Var 12 total) Private .false. .false. () ), plus_t: (Function (SymbolTable 13 { l: (Variable 13 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 13 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 13 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus_t (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 13 l) (Var 13 r)] [] (Var 13 total) Private .false. .false. () ), s: (Variable 11 s [] In () () Default (TypeParameter s ) () Source Private Required .false. .false. .false. () .false. .false. ), t: (Variable 11 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) travel_tmpl [d t s plus_d plus_t d_divided_by_t d_divided_by_s] [(Require operations [d t s plus_d plus_t d_divided_by_t d_divided_by_s] )] ), travel_tmpl2: (Template (SymbolTable 18 { avg_s_from_s: (Function (SymbolTable 21 { avg: (Variable 21 avg [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 21 d1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 21 d2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), s1: (Variable 21 s1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), s2: (Variable 21 s2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_s (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [div avg_s_from_t] [(Var 21 d1) (Var 21 s1) (Var 21 d2) (Var 21 s2)] [(Assignment (Var 21 avg) (FunctionCall 18 avg_s_from_t () [((Var 21 d1)) ((FunctionCall 18 div () [((Var 21 d1)) ((Var 21 s1))] (TypeParameter t ) () () )) ((Var 21 d2)) ((FunctionCall 18 div () [((Var 21 d2)) ((Var 21 s2))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 21 avg) Private .false. .false. () ), avg_s_from_t: (Function (SymbolTable 22 { avg: (Variable 22 avg [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), d1: (Variable 22 d1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), d2: (Variable 22 d2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t1: (Variable 22 t1 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), t2: (Variable 22 t2 [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) avg_s_from_t (FunctionType [(TypeParameter t ) (TypeParameter t ) (TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [plus div] [(Var 22 d1) (Var 22 t1) (Var 22 d2) (Var 22 t2)] [(Assignment (Var 22 avg) (FunctionCall 18 div () [((FunctionCall 18 plus () [((Var 22 d1)) ((Var 22 d2))] (TypeParameter t ) () () )) ((FunctionCall 18 plus () [((Var 22 t1)) ((Var 22 t2))] (TypeParameter t ) () () ))] (TypeParameter t ) () () ) () .false. .false. )] (Var 22 avg) Public .false. .false. () ), div: (Function (SymbolTable 20 { d: (Variable 20 d [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), n: (Variable 20 n [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), quotient: (Variable 20 quotient [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) div (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 20 n) (Var 20 d)] [] (Var 20 quotient) Private .false. .false. () ), plus: (Function (SymbolTable 19 { l: (Variable 19 l [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), r: (Variable 19 r [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ), total: (Variable 19 total [] ReturnVar () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .true. .false. .false. .false. [] .true. ) [] [(Var 19 l) (Var 19 r)] [] (Var 19 total) Private .false. .false. () ), t: (Variable 18 t [] In () () Default (TypeParameter t ) () Source Private Required .false. .false. .false. () .false. .false. ) }) travel_tmpl2 [t plus div] [(Require operations [t plus div] )] ) }) template_travel_02_travel () [template_travel_02_math template_travel_02_travel] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing1-7a0ea7d.json0000664000175000017500000000101115141516316027015 0ustar alastairalastair{ "basename": "asr-implicit_typing1-7a0ea7d", "cmd": "lfortran --std=f23 --show-asr --disable-implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit_typing1.f90", "infile_hash": "e6d1a0c4cb70b6dec80c447e80d4567c3a25f29c7164e956ddfba662", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_typing1-7a0ea7d.stderr", "stderr_hash": "6341b8dd45d0fd22c074531e4e4fa272486a24c10288fb90b558cf7e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_ifndef_01-1761667.json0000664000175000017500000000103215141516316032023 0ustar alastairalastair{ "basename": "asr_preprocess-unterminated_ifndef_01-1761667", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/unterminated_ifndef_01.f90", "infile_hash": "15182e05ae273d1a1ffd40280ce783bc0df2bf57f3ad7ed102fc71f0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr_preprocess-unterminated_ifndef_01-1761667.stderr", "stderr_hash": "c2c3a02d83fdb5ea648eead71bf83e6460c22d1a43ece2fa084e3fc2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-where1-c237415.json0000664000175000017500000000070715141516316024520 0ustar alastairalastair{ "basename": "ast-where1-c237415", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/where1.f90", "infile_hash": "cd5e0b85aa90c2bb3dff3fdc1e1e563b601c361a4b57ba16db0bf051", "outfile": null, "outfile_hash": null, "stdout": "ast-where1-c237415.stdout", "stdout_hash": "73fb69d0990b9844dd3d2849ea2807edf6b55e781d9ffa13031a226b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/c-program4-d60edeb.stdout0000664000175000017500000000222115141516316025356 0ustar alastairalastair #include #include #include #include #include float func1(float a, float b); float func2(float a, float b); // Implementations float func1(float a, float b) { float c; static float saved = 2.00000000000000000e+00; saved = saved + 1.00000000000000000e+00; c = c + a + b + saved; return c; } float func2(float a, float b) { float c; float d; static float saved1 = 2.00000000000000000e+00; static float saved2; saved1 = saved1 + 1.00000000000000000e+00; c = d + c + a + b + saved1 + saved2; saved2 = saved2 + 1.00000000000000000e+00; d = d + 3.00000000000000000e+00; return c; } int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); float x; float y; float z; x = 1.00000000000000000e+00; y = 2.00000000000000000e+00; z = func1(x, y); printf("%s%s%f\n", "6.0 == ", " ", z); z = func1(x, y); printf("%s%s%f\n", "7.0 == ", " ", z); z = func2(x, y); printf("%s%s%f\n", "6.0 == ", " ", z); z = func2(x, y); printf("%s%s%f\n", "8.0 == ", " ", z); return 0; } lfortran-lfortran-2f73434/tests/reference/llvm-external_02-99f90be.stdout0000664000175000017500000000173215141516316026362 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" define void @cobyla(void (double*)* %calcfc) { .entry: call void @cobylb(void (double*)* %calcfc) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_cobyla FINALIZE_SYMTABLE_cobyla: ; preds = %return ret void } declare void @calcfc(double*) define void @cobylb(void (double*)* %calcfc) { .entry: %con = alloca double, align 8 call void %calcfc(double* %con) br label %return unreachable_after_return: ; No predecessors! br label %return return: ; preds = %unreachable_after_return, %.entry br label %FINALIZE_SYMTABLE_cobylb FINALIZE_SYMTABLE_cobylb: ; preds = %return ret void } declare void @calcfc.1(double*) lfortran-lfortran-2f73434/tests/reference/ast-data_stmt_with_implied_do_loop-476da0f.json0000664000175000017500000000104115141516316031711 0ustar alastairalastair{ "basename": "ast-data_stmt_with_implied_do_loop-476da0f", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/data_stmt_with_implied_do_loop.f", "infile_hash": "ca1800c3b10a5aa2cddbafc00386d21ebc63b87593eb73986802f802", "outfile": null, "outfile_hash": null, "stdout": "ast-data_stmt_with_implied_do_loop-476da0f.stdout", "stdout_hash": "67fa9708e363358480f7ad635e454859e57fa459fe74015475a99688", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_02-7a95ae7.stdout0000664000175000017500000000616715141516316025521 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_02: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_02 [] [(Assignment (Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 1 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 1.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (Var 2 i) IntegerToReal (Real 4) () ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-program4-1796cb6.stdout0000664000175000017500000000305015141516316025507 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { float func1(float a, float b); float func2(float a, float b); } // Implementations namespace { float func1(float a, float b) { float c; static float saved= 2.00000000000000000e+00; saved = saved + 1.00000000000000000e+00; c = c + a + b + saved; return c; } float func2(float a, float b) { float c; float d; static float saved1= 2.00000000000000000e+00; static float saved2; saved1 = saved1 + 1.00000000000000000e+00; c = d + c + a + b + saved1 + saved2; saved2 = saved2 + 1.00000000000000000e+00; d = d + 3.00000000000000000e+00; return c; } void main2() { float x; float y; float z; x = 1.00000000000000000e+00; y = 2.00000000000000000e+00; z = func1(x, y); std::cout << "6.0 == " << " " << z << std::endl; z = func1(x, y); std::cout << "7.0 == " << " " << z << std::endl; z = func2(x, y); std::cout << "6.0 == " << " " << z << std::endl; z = func2(x, y); std::cout << "8.0 == " << " " << z << std::endl; } } int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); main2(); Kokkos::finalize(); return 0; } lfortran-lfortran-2f73434/tests/reference/ast-interface_03-c3dfda4.stdout0000664000175000017500000001253415141516316026441 0ustar alastairalastair(TranslationUnit [(Program interface_03 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a1 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Interface (InterfaceHeader) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(InterfaceProc (Subroutine a2 [(a)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) ) (InterfaceProc (Subroutine a3 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] ) (Declaration (AttrType TypeProcedure [] () a1 None ) [] [(sub [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Subroutine X [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Interface (InterfaceHeader) () [(InterfaceProc (Subroutine a4 [(a)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(AttrIntent InOut )] [(a [] [] () () None ())] () )] [] [] [] ) )] )] [] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-program_03-374e848.stdout0000664000175000017500000001031615141516316026045 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @__module___lcompilers_created__nested_context__closuretest__z = global i32 0 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value = alloca i32, align 4 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %z = alloca i32, align 4 store i32 0, i32* %z, align 4 br label %loop.head loop.head: ; preds = %free_done, %.entry %2 = load i32, i32* %z, align 4 %3 = add i32 %2, 1 %4 = icmp sle i32 %3, 10 br i1 %4, label %loop.body, label %loop.end loop.body: ; preds = %loop.head %5 = load i32, i32* %z, align 4 %6 = add i32 %5, 1 store i32 %6, i32* %z, align 4 %7 = load i32, i32* %z, align 4 store i32 %7, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 %8 = alloca i64, align 8 store i32 1, i32* %call_arg_value, align 4 %9 = call i32 @apply(i32 (i32*)* @add_z, i32* %call_arg_value) %10 = alloca i32, align 4 store i32 %9, i32* %10, align 4 %11 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %8, i32 0, i32 0, i32* %10) %12 = load i64, i64* %8, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %11, i8** %13, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %12, i64* %14, align 4 %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %16 = load i8*, i8** %15, align 8 %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %18 = load i64, i64* %17, align 4 %19 = trunc i64 %18 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %20 = icmp eq i8* %11, null br i1 %20, label %free_done, label %free_nonnull free_nonnull: ; preds = %loop.body call void @_lfortran_free(i8* %11) br label %free_done free_done: ; preds = %free_nonnull, %loop.body %21 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 store i32 %21, i32* %z, align 4 br label %loop.head loop.end: ; preds = %loop.head call void @_lpython_free_argv() br label %return return: ; preds = %loop.end br label %FINALIZE_SYMTABLE_closuretest FINALIZE_SYMTABLE_closuretest: ; preds = %return ret i32 0 } define i32 @add_z(i32* %x) { .entry: %y = alloca i32, align 4 %0 = load i32, i32* %x, align 4 %1 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4 %2 = add i32 %0, %1 store i32 %2, i32* %y, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_add_z FINALIZE_SYMTABLE_add_z: ; preds = %return %3 = load i32, i32* %y, align 4 ret i32 %3 } define i32 @apply(i32 (i32*)* %fun, i32* %x) { .entry: %y = alloca i32, align 4 %0 = call i32 %fun(i32* %x) store i32 %0, i32* %y, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_apply FINALIZE_SYMTABLE_apply: ; preds = %return %1 = load i32, i32* %y, align 4 ret i32 %1 } declare i32 @fun(i32*) declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-string_12-e72e066.stdout0000664000175000017500000004566015141516316025601 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { string_12: (Program (SymbolTable 2 { digits: (Variable 2 digits [hex_digits] Local (StringSection (Var 2 hex_digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "0123456789" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), fullhex_digits: (Variable 2 fullhex_digits [] Local (StringConstant "0123456789ABCDEFabcdef" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789ABCDEFabcdef" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), hex_digits: (Variable 2 hex_digits [fullhex_digits] Local (StringSection (Var 2 fullhex_digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 16 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "0123456789ABCDEF" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "0123456789ABCDEF" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), letters: (Variable 2 letters [] Local (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 52 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), lowercase: (Variable 2 lowercase [letters] Local (StringSection (Var 2 letters) (IntegerConstant 27 (Integer 4) Decimal) (StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) ) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "abcdefghijklmnopqrstuvwxyz" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), lowerhex_digits: (Variable 2 lowerhex_digits [] Local (StringConstant "0123456789abcdef" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "0123456789abcdef" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), octal_digits: (Variable 2 octal_digits [digits] Local (StringSection (Var 2 digits) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 8 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "01234567" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "01234567" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 2 string [letters] Local (IntrinsicElementalFunction Char [(StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) )] 0 (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), uppercase: (Variable 2 uppercase [letters] Local (StringSection (Var 2 letters) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 26 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal) (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (StringConstant "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Parameter (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_12 [] [(Print (Var 2 fullhex_digits) ) (Print (Var 2 hex_digits) ) (Print (Var 2 lowerhex_digits) ) (Print (Var 2 digits) ) (Print (Var 2 octal_digits) ) (Print (Var 2 letters) ) (Print (Var 2 uppercase) ) (Print (Var 2 lowercase) ) (Print (StringFormat () [(StringConstant "char(" (String 1 (IntegerConstant 5 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringLen (Var 2 letters) (Integer 4) (IntegerConstant 52 (Integer 4) Decimal) ) (StringConstant ") = " (String 1 (IntegerConstant 4 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 string)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (StringCompare (Var 2 string) NotEq (StringConstant "4" (String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Logical 4) (LogicalConstant .false. (Logical 4) ) ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-kind1-5b1b058.stderr0000664000175000017500000000017315141516316024736 0ustar alastairalastairsemantic error: Kind 3 is not supported for Real --> tests/errors/kind1.f90:4:10 | 4 | real(3) :: x | ^ lfortran-lfortran-2f73434/tests/reference/asr-func_arg_array-609769c.stderr0000664000175000017500000000027015141516316026651 0ustar alastairalastairsemantic error: Array passed into function has `6` elements but function expects `8`. --> tests/errors/func_arg_array.f90:4:14 | 4 | i = temp(myArray) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-template_travel_01-7f304df.stdout0000664000175000017500000006555415141516316027546 0ustar alastairalastair(TranslationUnit [(Module template_travel_01_math (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(add_real [] [] () () None ()) (slash_real [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(Function add_real [(x) (y)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(total [] [] () () None ())] () )] [(Assignment 0 total (+ x y) () )] [] [] ) (Function slash_real [(x) (y)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(x [] [] () () None ()) (y [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(total [] [] () () None ())] () )] [(Assignment 0 total (/ x y) () )] [] [] )] ) (Module template_travel_01_travel (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [(Use [] template_travel_01_math [] .false. () )] [(ImplicitNone [] () )] [(Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(travel_tmpl [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Requirement operations [D T S plus_D plus_T D_divided_by_T D_divided_by_S] [(DerivedType D [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType T [] () [(SimpleAttribute AttrDeferred )] [] [] ) (DerivedType S [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [(SimpleAttribute AttrDeferred )] [] [] )] [(Function plus_D [(l) (r)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(l [] [] () () None ()) (R [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () D None ) [] [(total [] [] () () None ())] () )] [] [] [] ) (Function plus_T [(l) (r)] [(SimpleAttribute AttrPure )] total () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(l [] [] () () None ()) (R [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(total [] [] () () None ())] () )] [] [] [] ) (Function D_divided_by_T [(n) (d)] [(SimpleAttribute AttrPure )] quotient () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(quotient [] [] () () None ())] () )] [] [] [] ) (Function D_divided_by_S [(n) (d)] [(SimpleAttribute AttrPure )] quotient () () [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(n [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [(AttrIntent In )] [(d [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [] [(quotient [] [] () () None ())] () )] [] [] [] )] ) (Template travel_tmpl [D T S plus_D plus_T D_divided_by_T D_divided_by_S] [(Require [(UnitRequire operations [(AttrNamelist D ) (AttrNamelist T ) (AttrNamelist S ) (AttrNamelist plus_D ) (AttrNamelist plus_T ) (AttrNamelist D_divided_by_T ) (AttrNamelist D_divided_by_S )] )] ) (Declaration () [(SimpleAttribute AttrPrivate )] [] () ) (Declaration () [(SimpleAttribute AttrPublic )] [(avg_S_from_T [] [] () () None ())] () )] [(Function avg_S_from_T [(d1) (t1) (d2) (t2)] [(SimpleAttribute AttrPure )] avg () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(d1 [] [] () () None ()) (d2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () T None ) [(AttrIntent In )] [(t1 [] [] () () None ()) (t2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(avg [] [] () () None ())] () )] [(Assignment 0 avg (FuncCallOrArray D_divided_by_T [] [(() (FuncCallOrArray plus_D [] [(() d1 () 0) (() d2 () 0)] [] [] [] ) () 0) (() (FuncCallOrArray plus_T [] [(() t1 () 0) (() t2 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] ) (Function avg_S_from_S [(d1) (s1) (d2) (s2)] [(SimpleAttribute AttrPure )] avg () () [] [] [] [(Declaration (AttrType TypeType [] () D None ) [(AttrIntent In )] [(d1 [] [] () () None ()) (d2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [(AttrIntent In )] [(s1 [] [] () () None ()) (s2 [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () S None ) [] [(avg [] [] () () None ())] () )] [(Assignment 0 avg (FuncCallOrArray avg_S_from_T [] [(() d1 () 0) (() (FuncCallOrArray D_divided_by_S [] [(() d1 () 0) (() s1 () 0)] [] [] [] ) () 0) (() d2 () 0) (() (FuncCallOrArray D_divided_by_S [] [(() d2 () 0) (() s2 () 0)] [] [] [] ) () 0)] [] [] [] ) () )] [] [] )] )] [] [] ) (Module template_travel_01_m (TriviaNode [(EndOfLine) (EndOfLine)] [(EndOfLine) (EndOfLine)] ) [(Use [] template_travel_01_math [] .false. () ) (Use [] template_travel_01_travel [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Subroutine test_template [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Instantiate travel_tmpl [(AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrNamelist add_real ) (AttrNamelist add_real ) (AttrNamelist slash_real ) (AttrNamelist slash_real )] [(UseSymbol avg_S_from_T avg_real_S_from_T )] ) (Instantiate travel_tmpl [(AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrType TypeReal [] () () None ) (AttrNamelist add_real ) (AttrNamelist add_real ) (AttrNamelist slash_real ) (AttrNamelist slash_real )] [(UseSymbol avg_S_from_S avg_real_S_from_S )] ) (Declaration (AttrType TypeReal [] () () None ) [] [(s1 [] [] () () None ()) (s2 [] [] () () None ())] () )] [(Assignment 0 s1 (FuncCallOrArray avg_real_S_from_T [] [(() (Real "1.0") () 0) (() (Real "3.0") () 0) (() (Real "1.5") () 0) (() (Real "4.0") () 0)] [] [] [] ) () ) (Assignment 0 s2 (FuncCallOrArray avg_real_S_from_S [] [(() (Real "1.1") () 0) (() (Real "0.5") () 0) (() (Real "2.0") () 0) (() (Real "0.75") () 0)] [] [] [] ) () ) (Print 0 () [(String "s1=" ()) s1] () ) (Print 0 () [(String "s2=" ()) s2] () )] [] [] )] ) (Program template_travel_01 () [(Use [] template_travel_01_m [] .false. () )] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [(SubroutineCall 0 test_template [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-fixed_number_of_args-051b0f1.stderr0000664000175000017500000000032315141516316030064 0ustar alastairalastairsemantic error: Incorrect number of arguments passed to the 'complex' intrinsic. It accepts exactly 2 arguments. --> tests/errors/fixed_number_of_args.f90:3:9 | 3 | a = complex(1) | ^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_07-240b0d5.json0000664000175000017500000000076115141516316026066 0ustar alastairalastair{ "basename": "asr-intrinsics_07-240b0d5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_07.f90", "infile_hash": "fb38a4369a15cd151941ce57b634ac91745bd83541722d9fbb171a18", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_07-240b0d5.stdout", "stdout_hash": "a89f9a6d6da64900da28f074c59317de4a9c297badc8edc8cd5a7212", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_openmp-pragma1-25cfcb2.stdout0000664000175000017500000004062215141516316027020 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { a1: (Function (SymbolTable 2 { a: (Variable 2 a [n] In () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [n] Out () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (Var 2 n))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) a1 (FunctionType [(Integer 4) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray ) (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (FunctionParam 0 (Integer 4) () ))] PointerArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 n) (Var 2 a) (Var 2 b)] [(OMPRegion ParallelDo [] [(DoLoop () ((Var 2 i) (IntegerConstant 2 (Integer 4) Decimal) (Var 2 n) ()) [(Assignment (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (RealBinOp (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) Add (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ) ())] (Real 4) ColMajor () ) (Real 4) () ) Div (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) (Real 4) () ) () .false. .false. )] [] )] )] () Public .false. .false. () ), parallel_sum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 3 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 3 n [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), partial_sum: (Variable 3 partial_sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), total_sum: (Variable 3 total_sum [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) parallel_sum (FunctionType [(Integer 4) (Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 n) (Var 3 a)] [(Assignment (Var 3 partial_sum) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 total_sum) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (OMPRegion Parallel [(OMPPrivate [(Var 3 partial_sum)] ) (OMPShared [(Var 3 total_sum)] )] [(OMPRegion Do [] [(DoLoop () ((Var 3 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 3 n) ()) [(Assignment (Var 3 partial_sum) (IntegerBinOp (Var 3 partial_sum) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. .false. )] [] )] )] )] () Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/rename_symbol-collect_occurence2-a095a33.stdout0000664000175000017500000000135315141516316031553 0ustar alastairalastair[{"kind":2,"location":{"range":{"start":{"character":10,"line":7},"end":{"character":15,"line":7}},"uri":"uri"},"name":"xyz"},{"kind":2,"location":{"range":{"start":{"character":15,"line":1},"end":{"character":18,"line":1}},"uri":"uri"},"name":"xyz"},{"kind":2,"location":{"range":{"start":{"character":14,"line":4},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":3},"end":{"character":4,"line":3}},"uri":"uri"},"name":"xyz"},{"kind":9,"location":{"range":{"start":{"character":1,"line":1},"end":{"character":17,"line":4}},"uri":"uri"},"name":"xyz"}]lfortran-lfortran-2f73434/tests/reference/asr-template_vector-140858c.json0000664000175000017500000000076715141516316026532 0ustar alastairalastair{ "basename": "asr-template_vector-140858c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/template_vector.f90", "infile_hash": "3b7ffe3ced86a0dcf1875f22da3a7910133d0e11b7a2866865dca1fe", "outfile": null, "outfile_hash": null, "stdout": "asr-template_vector-140858c.stdout", "stdout_hash": "fb4b8fe44b315e3ae08b1c8d18db905a746ae77979ec345632d67552", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-c_f_pointer_01-2d288d7.json0000664000175000017500000000074615141516316026207 0ustar alastairalastair{ "basename": "asr-c_f_pointer_01-2d288d7", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/c_f_pointer_01.f90", "infile_hash": "39fe25b56ce582c423fda91853a1bffd5b71f5f9065cf09aa23af814", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-c_f_pointer_01-2d288d7.stderr", "stderr_hash": "84951e59d35ac63d34db2a64736eb998f4e43b2cdbcd2b79aa63207d", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-modules_06-609dd30.stdout0000664000175000017500000001351415141516316025732 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_06: (Program (SymbolTable 4 { b: (ExternalSymbol 4 b 2 b modules_06_a [] b Public ), i: (Variable 4 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_06 [modules_06_a] [(Assignment (Var 4 i) (FunctionCall 4 b () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 4 i)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), modules_06_a: (Module (SymbolTable 2 { b: (Function (SymbolTable 3 { r: (Variable 3 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) b (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringConstant "b()" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Assignment (Var 3 r) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. )] (Var 3 r) Public .false. .false. () ) }) modules_06_a () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_02-3ebca53.json0000664000175000017500000000074315141516316027705 0ustar alastairalastair{ "basename": "run-array_bounds_check_02-3ebca53", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_02.f90", "infile_hash": "eaa31b185f0a51c3937f0238d112eb0fc90b3e410e59da7fe194c389", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_02-3ebca53.stderr", "stderr_hash": "c8b2f9668171577e5d521f7c1a57e7219f07df9711240eebb0d6cf05", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/ast-arrays_02-bc13aa6.json0000664000175000017500000000074515141516316025341 0ustar alastairalastair{ "basename": "ast-arrays_02-bc13aa6", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_02.f90", "infile_hash": "b5b3a6833fd727f5cce92c3c4886c4e20117f33710a1ec8b1016d8f6", "outfile": null, "outfile_hash": null, "stdout": "ast-arrays_02-bc13aa6.stdout", "stdout_hash": "4b2ebaa19b588121daa2e7e2ef5c16c5cfd2a058a451e3c051ae5f02", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-array_size_04-dcfa313.json0000664000175000017500000000074315141516316026212 0ustar alastairalastair{ "basename": "asr-array_size_04-dcfa313", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_size_04.f90", "infile_hash": "2984c2c4ac5b8a12bef7a8728bf6614dd5ac8517764529aeaba03c7c", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_size_04-dcfa313.stderr", "stderr_hash": "76e96b7d8e04f7a510ca8009d122eb4cc631ca43c2a2efae3e4d0b85", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor2-1db2235.stdout0000664000175000017500000000641715141516316031027 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor2: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) preprocessor2 [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (Print (StringFormat () [(Var 2 x) (IntegerConstant 12345678 (Integer 4) Decimal)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-subroutine4-97a10ca.stdout0000664000175000017500000000032115141516316026764 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar*b(i) end do end subroutine triad lfortran-lfortran-2f73434/tests/reference/asr-expr4-6c75096.stdout0000664000175000017500000000375315141516316024755 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(RealConstant 5.000000 (Real 4) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) (RealBinOp (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 8.000000 (Real 4) ) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 16.000000 (Real 4) ) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Add (RealBinOp (RealConstant 3.000000 (Real 4) ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) (RealConstant 6.000000 (Real 4) ) ) (Real 4) (RealConstant 11.000000 (Real 4) ) ) (RealBinOp (RealConstant 5.000000 (Real 4) ) Sub (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 2.000000 (Real 4) ) ) (RealBinOp (RealConstant 4.000000 (Real 4) ) Pow (RealConstant 3.000000 (Real 4) ) (Real 4) (RealConstant 64.000000 (Real 4) ) )] ) lfortran-lfortran-2f73434/tests/reference/asr-end_sub_name-b8abc97.json0000664000175000017500000000074015141516316026166 0ustar alastairalastair{ "basename": "asr-end_sub_name-b8abc97", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/end_sub_name.f90", "infile_hash": "e009a66d5776bac360c38e64071c0d20593c8162a0c40cbf5bf4e5c2", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-end_sub_name-b8abc97.stderr", "stderr_hash": "8ae9de8fb9af77931f3d42b61fe8c02ed1ae3c97af115ef36c01cfec", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-implicit_call_02-acc6d43.json0000664000175000017500000000100115141516316026634 0ustar alastairalastair{ "basename": "asr-implicit_call_02-acc6d43", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/errors/implicit_call_02.f90", "infile_hash": "24e50b64e17b6d3a7a46f02ffb24d18897a171a4e81a77686a72a5d4", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit_call_02-acc6d43.stderr", "stderr_hash": "87fac225c2b103ecdb9cbd2fc4001bcdedd8065e39e4fbf48073b9c2", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/ast-subroutine6-a3aec97.stdout0000664000175000017500000001067415141516316026413 0ustar alastairalastair(TranslationUnit [(Subroutine triad [(a) (b) (scalar) (c)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent In )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ()) (scalar [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(AttrIntent Out )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (N2 [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (Assignment 0 N2 (FuncCallOrArray size [] [(() b () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() i () 0)] [] [] [] ) (+ (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (* scalar (FuncCallOrArray b [] [(() i () 0)] [] [] [] ))) () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (DoConcurrentLoop 0 () [(ConcurrentControl j 1 N2 () )] () [] [(Assignment 0 (FuncCallOrArray c [] [(() j () 0)] [] [] [] ) (+ (FuncCallOrArray b [] [(() j () 0)] [] [] [] ) scalar) () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-character1-8679f4b.json0000664000175000017500000000075015141516316025437 0ustar alastairalastair{ "basename": "asr-character1-8679f4b", "cmd": "lfortran --show-asr --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/character1.f90", "infile_hash": "83f86b3c6ec94d478c82439a20e7af4238dbd1d867cae8efbb7b1f39", "outfile": null, "outfile_hash": null, "stdout": "asr-character1-8679f4b.stdout", "stdout_hash": "33722914184a47c7dee153a33f8149e43d3b97aac35ece577c555ad5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-open_notimplemented_kwarg1-24818cb.json0000664000175000017500000000101415141516316030717 0ustar alastairalastair{ "basename": "asr-open_notimplemented_kwarg1-24818cb", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/warnings/open_notimplemented_kwarg1.f90", "infile_hash": "7571e57fc2000c98f3c9509df26eb64375f1393ab142090b7a86e7a2", "outfile": null, "outfile_hash": null, "stdout": "asr-open_notimplemented_kwarg1-24818cb.stdout", "stdout_hash": "7ab0018ff4a9dd96b41c353d204775d1cd4f9818da0264fd224dbeff", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-bindc3-d064ff7.stdout0000664000175000017500000001103415141516316025366 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @bindc3.idx = internal global i32 1 @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [10 x i8] c"CPtr,CPtr\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info.1 = private unnamed_addr constant [10 x i8] c"CPtr,CPtr\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %queries = alloca void*, align 8 %x = alloca i16*, align 8 store i16* null, i16** %x, align 8 %y = alloca i16, align 2 %2 = load void*, void** %queries, align 8 %3 = bitcast void* %2 to i16* store i16* %3, i16** %x, align 8 %4 = alloca i64, align 8 %5 = load i16*, i16** %x, align 8 %6 = bitcast i16* %5 to void* %7 = alloca void*, align 8 store void* %6, void** %7, align 8 %8 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @serialization_info, i32 0, i32 0), i64* %4, i32 0, i32 0, void** %7, void** %queries) %9 = load i64, i64* %4, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %8, i8** %10, align 8 %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %9, i64* %11, align 4 %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %13 = load i8*, i8** %12, align 8 %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %15 = load i64, i64* %14, align 4 %16 = trunc i64 %15 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %13, i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) %17 = icmp eq i8* %8, null br i1 %17, label %free_done, label %free_nonnull free_nonnull: ; preds = %.entry call void @_lfortran_free(i8* %8) br label %free_done free_done: ; preds = %free_nonnull, %.entry store i16* %y, i16** %x, align 8 %18 = alloca i64, align 8 %19 = load i16*, i16** %x, align 8 %20 = bitcast i16* %19 to void* %21 = alloca void*, align 8 store void* %20, void** %21, align 8 %22 = bitcast i16* %y to void* %23 = alloca void*, align 8 store void* %22, void** %23, align 8 %24 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @serialization_info.1, i32 0, i32 0), i64* %18, i32 0, i32 0, void** %21, void** %23) %25 = load i64, i64* %18, align 4 %stringFormat_desc1 = alloca %string_descriptor, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 store i8* %24, i8** %26, align 8 %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 store i64 %25, i64* %27, align 4 %28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0 %29 = load i8*, i8** %28, align 8 %30 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1 %31 = load i64, i64* %30, align 4 %32 = trunc i64 %31 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %29, i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %33 = icmp eq i8* %24, null br i1 %33, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %free_done call void @_lfortran_free(i8* %24) br label %free_done3 free_done3: ; preds = %free_nonnull2, %free_done call void @_lpython_free_argv() br label %return return: ; preds = %free_done3 br label %FINALIZE_SYMTABLE_bindc3 FINALIZE_SYMTABLE_bindc3: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-nested_01-a37fe7e.stdout0000664000175000017500000000636015141516316025712 0ustar alastairalastair(TranslationUnit [(Module nested_01_a (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] [(Function b [] [(AttrType TypeInteger [] () () None )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(e [] [] () () None ())] () )] [(Print 0 () [(String "b()" ())] () ) (Assignment 0 e (FuncCallOrArray d [] [] [] [] [] ) () ) (Assignment 0 b 0 () )] [(Function d [] [(AttrType TypeInteger [] () () None )] () () () [] [] [] [] [(Print 0 () [(String "d()" ())] () ) (Assignment 0 d 1 () )] [] [] )] [] )] ) (Program nested_01 () [(Use [] nested_01_a [(UseSymbol b () )] .true. () )] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(c [] [] () () None ())] () )] [(Assignment 0 c (FuncCallOrArray b [] [] [] [] [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-data_12-af356bd.json0000664000175000017500000000073715141516316024763 0ustar alastairalastair{ "basename": "asr-data_12-af356bd", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/data_12.f90", "infile_hash": "80710a15ea7a648779263ef05c92564bd17392b333fcaeeef1880a91", "outfile": null, "outfile_hash": null, "stdout": "asr-data_12-af356bd.stdout", "stdout_hash": "f1a4c0128b6d72ef6b7ddcf4f28fe52a795cf9135a23dfc8559937f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-doconcurrentloop_01-ebe9543.json0000664000175000017500000000101615141516316030044 0ustar alastairalastair{ "basename": "ast_f90-doconcurrentloop_01-ebe9543", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/doconcurrentloop_01.f90", "infile_hash": "467f7dbdb5186badc19797a42685003effc780bd17088ab9fcc27efb", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-doconcurrentloop_01-ebe9543.stdout", "stdout_hash": "bbcd3ccdc8b250286bfc3b3c0766dea1f078a6e9bc5b3e732fc44e5d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-program3-557dbe8.json0000664000175000017500000000071515141516316025227 0ustar alastairalastair{ "basename": "asr-program3-557dbe8", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/program3.f90", "infile_hash": "f5e4a3f2a2a6f406171d0aa3895b5d7342c4d87b73ffede073827f34", "outfile": null, "outfile_hash": null, "stdout": "asr-program3-557dbe8.stdout", "stdout_hash": "3742261f770f20051584bc5600662942496869048e7beafccf591433", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixed_form_2-1350599.stderr0000664000175000017500000000021715141516316026145 0ustar alastairalastairsyntax error: Token 'x' (of type 'identifier') is unexpected here --> tests/errors/fixed_form_2.f:3:12 | 3 | y = 5x | ^ lfortran-lfortran-2f73434/tests/reference/asr-global_scope8-67fff8d.json0000664000175000017500000000073415141516316026306 0ustar alastairalastair{ "basename": "asr-global_scope8-67fff8d", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope8.f90", "infile_hash": "899df30dee274279a699110fb9af2afad0b826c0abc886f9e2460627", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope8-67fff8d.stdout", "stdout_hash": "a5f71f0f13ba61b52b8979ea0258ed5da42dd687b080bdc762d46da6", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-recursion_02-20a7daf.json0000664000175000017500000000075615141516316026055 0ustar alastairalastair{ "basename": "asr-recursion_02-20a7daf", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/recursion_02.f90", "infile_hash": "2935948fa13844b5a3b169f1d6df99e22cd1329310ef7c6d0f152583", "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_02-20a7daf.stdout", "stdout_hash": "bd0c992b179601a5c7a326cd2fcd26d94f85620b53e69d219f969ef4", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-derived_types_09-0e83add.json0000664000175000017500000000074515141516316026725 0ustar alastairalastair{ "basename": "ast-derived_types_09-0e83add", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/derived_types_09.f90", "infile_hash": "d527015d1a945260af61c70d3ae6288e719154a453713f2aa9eb4072", "outfile": null, "outfile_hash": null, "stdout": "ast-derived_types_09-0e83add.stdout", "stdout_hash": "9ed2f47ace8c6ae137ffa8c4fd6b2e084fb8af287bce887934eb511e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_transpose_01-f8038ce.stderr0000664000175000017500000000031115141516316027716 0ustar alastairalastairsemantic error: `transpose` accepts arrays of rank 2 only, provided an array with rank, 1 --> tests/errors/matrix_transpose_01.f90:4:24 | 4 | print *, transpose(a) | ^ lfortran-lfortran-2f73434/tests/reference/llvm-arrays_01-91893af.json0000664000175000017500000000075015141516316025403 0ustar alastairalastair{ "basename": "llvm-arrays_01-91893af", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_01-91893af.stdout", "stdout_hash": "0f4a2e903ff80171710ddc441b88f37a813820f0005f8124a79c4983", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-dimension_attr-12e0f2a.json0000664000175000017500000000075215141516316026474 0ustar alastairalastair{ "basename": "ast-dimension_attr-12e0f2a", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/dimension_attr.f", "infile_hash": "94df0a120cc268f419253b89bd601cc62c0c40b1ff86e8eb05849b4b", "outfile": null, "outfile_hash": null, "stdout": "ast-dimension_attr-12e0f2a.stdout", "stdout_hash": "50d574deca5876e963df776cd6c716b9a6a7283d8ab2d9528e4004ec", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-types_05-884adc8.stdout0000664000175000017500000000622115141516316025522 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 f32) f32.const 2.000000 local.set 1 f32.const 2.000000 local.set 1 f32.const 8.000000 local.set 1 f32.const 4.000000 local.set 1 f32.const 0.000000 local.set 1 f32.const 0.500000 local.set 1 f32.const 0.500000 local.set 1 i32.const 2 local.set 0 i32.const 2 local.set 0 i32.const 8 local.set 0 i32.const 4 local.set 0 i32.const 0 local.set 0 i32.const 0 local.set 0 i32.const 0 local.set 0 i32.const 0 call 0 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") ) lfortran-lfortran-2f73434/tests/reference/ast-print2-1ac10f6.stdout0000664000175000017500000000054415141516316025244 0ustar alastairalastair(TranslationUnit [(Program print2 () [] [] [] [(Print 0 (StrOp (String "(es11.5,3x " ()) Concat (String "es11.5)" ()) ) [(Real "1.d0") (Real "2.d0")] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-incorrect_type_where_03-a95b1f2.stderr0000664000175000017500000000026615141516316030543 0ustar alastairalastairsemantic error: the argument to `where` must be an array --> tests/errors/incorrect_type_where_03.f90:5:10 | 5 | where(max(1.33, 2.67)) b = 12121 | ^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-statement_03-99c9cd3.json0000664000175000017500000000102515141516316026002 0ustar alastairalastair{ "basename": "asr-statement_03-99c9cd3", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_03.f90", "infile_hash": "e697fc36c92b65627b5c34f4d10ea67c06141eba507c2700b01e24b8", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_03-99c9cd3.stdout", "stdout_hash": "50d74e11b136528b838025ed98a364af9e1ee8885f604e102f4a70f0", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-generic_name_01-d3550a6.json0000664000175000017500000000077215141516316026505 0ustar alastairalastair{ "basename": "llvm-generic_name_01-d3550a6", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/generic_name_01.f90", "infile_hash": "cf72bd4f491d240363b4f763c22fc7dbd88483b3a7e5303471f65b40", "outfile": null, "outfile_hash": null, "stdout": "llvm-generic_name_01-d3550a6.stdout", "stdout_hash": "4dd475279eb77e60c06728a9b6a20419100a3d5d9ca99b1b43d510d9", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.stdoutlfortran-lfortran-2f73434/tests/reference/llvm-module_struct_global_separate_compilation_01-043bc7f.0000664000175000017500000000121115141516316033740 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %t = type { i32 } @__module_module_struct_global_separate_compilation_01_targets = global %t zeroinitializer define void @__module_module_struct_global_separate_compilation_01_set_targets(i32* %v) { .entry: %0 = load i32, i32* %v, align 4 store i32 %0, i32* getelementptr inbounds (%t, %t* @__module_module_struct_global_separate_compilation_01_targets, i32 0, i32 0), align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_set_targets FINALIZE_SYMTABLE_set_targets: ; preds = %return ret void } lfortran-lfortran-2f73434/tests/reference/asr-bindc1-6cc9005.stdout0000664000175000017500000000655415141516316025123 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bindc1: (Program (SymbolTable 2 { c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), p: (Variable 2 p [] Local () () Default (CPtr) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Local () () Default (Pointer (Integer 4) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bindc1 [iso_c_binding] [(Assignment (Var 2 p) (PointerToCPtr (Var 2 x) (CPtr) () ) () .false. .false. )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-intrinsics12-16f1580.stderr0000664000175000017500000000025415141516316026204 0ustar alastairalastairsemantic error: All arguments to max0 must be of the same type --> tests/errors/intrinsics12.f90:2:14 | 2 | print *, max(12, 13.94) | ^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/ast-while_02_fixed_form-524b922.json0000664000175000017500000000100415141516316027130 0ustar alastairalastair{ "basename": "ast-while_02_fixed_form-524b922", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/while_02_fixed_form.f", "infile_hash": "dc82d303d9e0ec0bcec914bfa5a12ca5ed78d48eb85510d241f414b0", "outfile": null, "outfile_hash": null, "stdout": "ast-while_02_fixed_form-524b922.stdout", "stdout_hash": "d84932a8b5c7900c459aee1b654d3de889a030953760314e13476df2", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-arrays_03_func-3a62608.json0000664000175000017500000000074715141516316026143 0ustar alastairalastair{ "basename": "cpp-arrays_03_func-3a62608", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_03_func-3a62608.stdout", "stdout_hash": "dbff11115ecae844c9306d5ca561714e81131856182683512bb3c5ee", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-complex1-0e93fa9.stdout0000664000175000017500000000122315141516316025753 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %complex_4 = type <{ float, float }> define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %x = alloca %complex_4, align 8 store %complex_4 <{ float 3.000000e+00, float 4.000000e+00 }>, %complex_4* %x, align 1 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_complex1 FINALIZE_SYMTABLE_complex1: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-fixed_form2-ad2afae.json0000664000175000017500000000074115141516316026102 0ustar alastairalastair{ "basename": "ast-fixed_form2-ad2afae", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form2.f", "infile_hash": "571cbfd198e5e5c217a11df963d0f4bda8786f94fc435927d45be679", "outfile": null, "outfile_hash": null, "stdout": "ast-fixed_form2-ad2afae.stdout", "stdout_hash": "fb67dab9d7dcabe723b1c86b7fbb882257330ae5cd2f69ed9e73b683", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_02-b6aed2a.stderr0000664000175000017500000000030215141516316031267 0ustar alastairalastairruntime error: Tried to access member of unallocated variable 'var' --> tests/errors/scalar_allocation_check_02.f90:14:22 | 14 | print *, var%x | ^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-stop-c3f410b.stdout0000664000175000017500000000461415141516316025014 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { stop: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) stop [] [(Assignment (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4) Decimal) Add (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 5 (Integer 4) Decimal) ) Mul (IntegerConstant 5 (Integer 4) Decimal) (Integer 4) (IntegerConstant 25 (Integer 4) Decimal) ) () .false. .false. ) (If () (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4) Decimal) (Logical 4) () ) [(Stop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-incorrect_array_type_where_02-b821d8c.stderr0000664000175000017500000000026115141516316031735 0ustar alastairalastairsemantic error: the first array argument to `where` must be of type logical --> tests/errors/incorrect_array_type_where_02.f90:8:10 | 8 | where(i1) b = 1 | ^^ lfortran-lfortran-2f73434/tests/reference/asr-allocate_03-8219a72.stdout0000664000175000017500000010667415141516316026001 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { allocate_03: (Program (SymbolTable 2 { c: (Variable 2 c [] Local () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 3 { c: (Variable 3 c [] Out () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 c)] [(Allocate [((Var 3 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 99 (Integer 4) Decimal) () .false. .false. )] () Public .false. .false. () ), g: (Function (SymbolTable 4 { r: (Variable 4 r [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Unspecified () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) g (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 4 x)] [(Print (StringFormat () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (ImplicitDeallocate [(Var 4 x)] ) (SubroutineCall 2 f () [((Var 4 x))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 99 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 4 r) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. )] (Var 4 r) Public .false. .false. () ), h: (Function (SymbolTable 5 { c: (Variable 5 c [] Out () () Default (Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) h (FunctionType [(Allocatable (Array (Integer 4) [(() ()) (() ()) (() ())] DescriptorArray ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [f] [(Var 5 c)] [(If () (IntrinsicImpureFunction Allocated [(Var 5 c)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (ImplicitDeallocate [(Var 5 c)] ) (SubroutineCall 2 f () [((Var 5 c))] () .false. ) (Print (StringFormat () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntegerCompare (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 99 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 8 (Integer 4) Decimal) () .false. .false. )] () Public .false. .false. () ), r: (Variable 2 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), stat: (Variable 2 stat [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) allocate_03 [] [(Assignment (Var 2 stat) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Allocate [((Var 2 c) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] (Var 2 stat) () () ) (If () (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Assignment (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (IntegerConstant 3 (Integer 4) Decimal) () .false. .false. ) (ImplicitDeallocate [(Var 2 c)] ) (SubroutineCall 2 h () [((Var 2 c))] () .false. ) (Assignment (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4) () () ) () .false. .false. ) (If () (IntegerCompare (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (IntegerConstant 8 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ()) (() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-case_04-60840db.stdout0000664000175000017500000000321615141516316025171 0ustar alastairalastair(TranslationUnit [(Program case_04 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(Assignment 0 i 4 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Select 0 () i [(CaseStmt [(CaseCondExpr 1 )] () [(Print 0 () [(String "1" ())] () )] ) (CaseStmt [(CaseCondExpr 2 ) (CaseCondRange 3 5 ) (CaseCondExpr 6 ) (CaseCondRange 8 10 )] () [(Print 0 () [(String "2,3:5,6,8:10" ())] () )] )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-string_negative_start_index-643e9c0.stderr0000664000175000017500000000026115141516316031531 0ustar alastairalastairsemantic error: The first index in string section is less than 1 --> tests/errors/string_negative_start_index.f90:5:15 | 5 | print*, "s:", s(-1:4) | ^^^^^^^ lfortran-lfortran-2f73434/tests/reference/llvm-return_03-3f7087d.stdout0000664000175000017500000000675215141516316026002 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [12 x i8] c"early return" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [13 x i8] c"normal return" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([13 x i8], [13 x i8]* @string_const_data.1, i32 0, i32 0), i64 13 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @main.main_out = internal global i32 999 @4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [12 x i8] c"main1 called" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data.3, i32 0, i32 0), i64 12 }> @5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) call void @main1(i32* @main.main_out) %2 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %2, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1) call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_main FINALIZE_SYMTABLE_main: ; preds = %return ret i32 0 } define void @main1(i32* %out_var) { .entry: %i = alloca i32, align 4 store i32 10, i32* %i, align 4 %0 = load i32, i32* %i, align 4 %1 = icmp sgt i32 %0, 5 br i1 %1, label %then, label %else then: ; preds = %.entry %2 = load i32, i32* %i, align 4 store i32 %2, i32* %out_var, align 4 %3 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %3, i32 12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %return unreachable_after_return: ; No predecessors! br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %unreachable_after_return %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %4, i32 13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %5 = load i32, i32* %i, align 4 store i32 %5, i32* %out_var, align 4 br label %return return: ; preds = %ifcont, %then br label %FINALIZE_SYMTABLE_main1 FINALIZE_SYMTABLE_main1: ; preds = %return ret void } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast-return1-517cbf1.stdout0000664000175000017500000000320315141516316025430 0ustar alastairalastair(TranslationUnit [(Subroutine example [(s)] [] () (TriviaNode [] [(EndOfLine) (Comment "! Syntax check only" )] ) [] [] [] [(Declaration (AttrType TypeCharacter [] () () None ) [] [(s [] [] 32 () Asterisk ())] () )] [(Write 0 [(()) (())] [] [s] () ) (Return 0 () () )] [] [] ) (Subroutine example1 [(i) (a) (b) (c)] [] () () [] [] [] [] [(If 0 () (== i a) [(Return 0 1 () )] [] () () () ) (If 0 () (== i b) [(Return 0 2 () )] [] () () () ) (If 0 () (== i c) [(Return 0 3 () )] [] () () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutines_05-1398db3.stdout0000664000175000017500000002302215141516316026642 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { bugsize: (Program (SymbolTable 2 { f: (Function (SymbolTable 3 { e: (Variable 3 e [x] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 x) () (Integer 4) () ))] PointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Array (Integer 4) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 x)] [(Assignment (Var 3 e) (Cast (Var 3 x) IntegerToReal (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 3 x) () (Integer 4) () ))] PointerArray ) () ) () .false. .false. ) (Assignment (Var 3 e) (ArrayConstant 16 [1.00000000e+00, 2.00000000e+00, 3.00000000e+00, 4.00000000e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] PointerArray ) ColMajor ) () .false. .false. ) (Print (StringFormat () [(Var 3 e)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ), x: (Variable 2 x [] Local () () Default (Pointer (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) bugsize [] [(Allocate [((Var 2 x) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 4 (Integer 4) Decimal))] () () ())] () () () ) (SubroutineCall 2 f () [((Var 2 x))] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop-d9fb32d.json0000664000175000017500000000076015141516316027110 0ustar alastairalastair{ "basename": "ast-fixedform_doloop-d9fb32d", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop.f", "infile_hash": "bfd5fbdf93e7063f71ab6aa6aa5b1ba62a5c49b82aaef0ecaaf14ab2", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop-d9fb32d.stdout", "stdout_hash": "98c17b871e5c7c0259a7114389fa7c2e397881db2ff1df744d16461c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_48-6cf0505.json0000664000175000017500000000075015141516316025364 0ustar alastairalastair{ "basename": "asr-modules_48-6cf0505", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_48.f90", "infile_hash": "83255edc16b2873de5a0b7431a7679c296d40c86424c2a7f1ca81fff", "outfile": null, "outfile_hash": null, "stdout": "asr-modules_48-6cf0505.stdout", "stdout_hash": "80e15f20cb023f2288471e66a432e4196a4b050606359cf2c9520ca3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-expr1-32e30b1.stdout0000664000175000017500000000003315141516316024774 0ustar alastairalastair(TranslationUnit [5] ) lfortran-lfortran-2f73434/tests/reference/asr-subroutines_07-4a9f44e.json0000664000175000017500000000076415141516316026366 0ustar alastairalastair{ "basename": "asr-subroutines_07-4a9f44e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_07.f90", "infile_hash": "8467217fadf16e3376047c00527af5bf50d1bf7077f84d1e380c393c", "outfile": null, "outfile_hash": null, "stdout": "asr-subroutines_07-4a9f44e.stdout", "stdout_hash": "746bc5172a971d89a379322d55f627f794311197707dcb7ecad63df5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/fortran-real_to_real_cast_fortran_codegen-b969b0f.stdout0000664000175000017500000000034315141516316033610 0ustar alastairalastairprogram implicitrealtorealdifferentkindexample implicit none real(4) :: realnumber1 real(8) :: realnumber2 realnumber1 = 3.14000010e+00 realnumber2 = real(realnumber1, kind=8) end program implicitrealtorealdifferentkindexample lfortran-lfortran-2f73434/tests/reference/ast_f90-string-0f0b404.stdout0000664000175000017500000000064415141516316025731 0ustar alastairalastairprogram string implicit none character(len=50) :: str str = "Hi, I'm using string" str = 'Use "Double" "quote"' str = "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" str = 'random'' a"b''cd""fg""hij"kl"mno"p"qr"s''' str = """equal''" str = """Double"" 'Quote'" str = "'Single' ""Quote""" print *, "Hi, I'm using string" print *, 'This is a "sting"' print *, "'random'' ab''cd""fg''h'ij""klmno'pqr's'''" end program string lfortran-lfortran-2f73434/tests/reference/asr-dependency_test_02-6d588ae.stdout0000664000175000017500000001120415141516316027520 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { m_cli2: (Module (SymbolTable 2 { a2d: (Function (SymbolTable 3 { ivalu: (Variable 3 ivalu [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), valu: (Variable 3 valu [] Out () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) a2d (FunctionType [(Real 8)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 valu)] [(Assignment (Var 3 valu) (IntrinsicElementalFunction Real [(Var 3 ivalu)] 0 (Real 8) () ) () .false. .false. )] () Public .false. .false. () ) }) m_cli2 () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-nested_01-b01694c.json0000664000175000017500000000075015141516316025350 0ustar alastairalastair{ "basename": "llvm-nested_01-b01694c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_01.f90", "infile_hash": "a7e6c8b63a220874358dba8c3f5052714bbc579c945d1d96474842a7", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_01-b01694c.stdout", "stdout_hash": "dc47da351835522557a74d92dfcc4e7618ac7b233989ca6e3003b550", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-external1-e4cf9f2.stderr0000664000175000017500000000031615141516316026006 0ustar alastairalastairsemantic error: function interface must be specified explicitly; you can enable implicit interfaces with `--implicit-interface` --> tests/errors/external1.f90:2:13 | 2 | external f | ^ lfortran-lfortran-2f73434/tests/reference/asr-subroutine6-265d498.stderr0000664000175000017500000000033015141516316026147 0ustar alastairalastairsemantic error: Dummy argument 'array' not defined --> tests/errors/subroutine6.f90:1:1 - 3:14 | 1 | subroutine sub (array) | ^^^^^^^^^^^^^^^^^^^^^^... ... | 3 | end subroutine | ...^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/lookup_name-lookup_name2-458b8c9.json0000664000175000017500000000075415141516316027542 0ustar alastairalastair{ "basename": "lookup_name-lookup_name2-458b8c9", "cmd": "lfortran --lookup-name --no-color {infile} -o {outfile}", "infile": "tests/lookup_name2.f90", "infile_hash": "6040a3665d4455ccb812ccc763c7d458221ef5b0eb639ed341de0618", "outfile": null, "outfile_hash": null, "stdout": "lookup_name-lookup_name2-458b8c9.stdout", "stdout_hash": "2a076cd88dcc0af73a879cf1317d863ca06861b56701296213975336", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-passing_array_01-b2bde68.stderr0000664000175000017500000000052715141516316027262 0ustar alastairalastairsemantic error: Function 'test_01_interface' not found (not user defined nor intrinsic) --> tests/errors/passing_array_01.f90:24:16 | 24 | ret = test_01_interface(len,value) ! This raise error as interfaces are strict on matching the number of ranks, so it doesn't find a match. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/cpp-fn2-ff8ef37.json0000664000175000017500000000066115141516316024244 0ustar alastairalastair{ "basename": "cpp-fn2-ff8ef37", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/fn2.f90", "infile_hash": "9f61561c47397aa03014fe07094ac838ada4865e513025e384edae00", "outfile": null, "outfile_hash": null, "stdout": "cpp-fn2-ff8ef37.stdout", "stdout_hash": "2bb1359320b16c59d468f0223319c844dd9c3d60dce30003b9c67a42", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-complex_div_test-21dab13.json0000664000175000017500000000077215141516316027022 0ustar alastairalastair{ "basename": "asr-complex_div_test-21dab13", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/complex_div_test.f90", "infile_hash": "0bbb7100f12786a5fc5022ab6cfd9f97cc6ede016ed0bdab03eda670", "outfile": null, "outfile_hash": null, "stdout": "asr-complex_div_test-21dab13.stdout", "stdout_hash": "45fbaabcfcf6e7450852260e8a7b8002c149a8a1488eddcf558f214a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-end_label-a678e8c.json0000664000175000017500000000074615141516316025412 0ustar alastairalastair{ "basename": "ast-end_label-a678e8c", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/end_label.f", "infile_hash": "4e27c022f4b317fda199421736ff4444472c7c5f1bd220726699bcc7", "outfile": null, "outfile_hash": null, "stdout": "ast-end_label-a678e8c.stdout", "stdout_hash": "3aa46600812b8376d92eb20b3f4f44ea8625ec4a149af287227fc56e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit7-2fc9cda.json0000664000175000017500000000072015141516316025522 0ustar alastairalastair{ "basename": "asr-implicit7-2fc9cda", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit7.f90", "infile_hash": "f389525fdeb3f01a6e2f3902da259e8c9b117370a482a4d4bc9d1b01", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit7-2fc9cda.stderr", "stderr_hash": "c103dd0c1aad2b4cb0598bc98db32afd7c75270493322c6e09ab08bf", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor15-4cf95f9.json0000664000175000017500000000077315141516316030650 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor15-4cf95f9", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor15.f90", "infile_hash": "b47691d49753905026191cfe1a1aa17ab0a7652f8b0aea9e1b1639e5", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor15-4cf95f9.stdout", "stdout_hash": "c0f66587c53d15e184e1cfdb3aefd939f82dd63b39cab96ff58db69d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-stop1-ed69fc4.stdout0000664000175000017500000001042315141516316025174 0ustar alastairalastair(TranslationUnit [(Program stop1 () [] [(ImplicitNone [] (TriviaNode [] [(EndOfLine) (Comment "! AST only(Syntax check)" )] ) )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(stop [] [] () 15 Equal ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(errstop [] [] () 25 Equal ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(If 0 () (/= stop 15) [(Stop 0 () () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 () () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 (String "message" ()) () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 (String "message" ()) () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 0 () () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 0 () () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 () (Logical .true.) () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 () (Logical .true.) () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (/= stop 15) [(Stop 0 1 (Logical .false.) () )] [(If 0 () (/= errstop 25) [(ErrorStop 0 1 (Logical .false.) () )] [] () () () )] () () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] )] ) lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_05-5502cc1.stdout0000664000175000017500000013640315141516316033067 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { functions_01: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), a1: (Variable 2 a1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b1: (Variable 2 b1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), f: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 3 b [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 3 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [(Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a)] [(Assignment (Var 3 x) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4) () ) () .false. .false. )] (Var 3 b) Public .false. .false. () ), f_real: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 4 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 4 x [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 4 y [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f_real (FunctionType [(Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 a)] [(Assignment (Var 4 x) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 4 y) (Var 4 a) () .false. .false. ) (Assignment (Var 4 r) (Var 4 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 4 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 4 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 4 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 4 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 4 r) (Var 4 x) () .false. .false. )] [(Assignment (Var 4 r) (RealUnaryMinus (Var 4 x) (Real 4) () ) () .false. .false. )] ) (Assignment (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 r) (Real 4) () ) () .false. .false. )] (Var 4 b) Public .false. .false. () ), p: (Variable 2 p [] Local (Cast (IntegerConstant 5 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (RealConstant 5.000000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), q: (Variable 2 q [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), signr32: (Function (SymbolTable 5 { r: (Variable 5 r [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) signr32 (FunctionType [(Real 4) (Real 4)] (Real 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 5 x) (Var 5 y)] [(Assignment (Var 5 r) (Var 5 x) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 5 r) (Var 5 x) () .false. .false. )] [(Assignment (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4) () ) () .false. .false. )] )] (Var 5 r) Public .false. .false. () ), x: (Variable 2 x [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x1: (Variable 2 x1 [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x2: (Variable 2 x2 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y1: (Variable 2 y1 [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) functions_01 [] [(Assignment (Var 2 a1) (Var 2 x) () .false. .false. ) (Assignment (Var 2 x1) (IntegerConstant 2 (Integer 4) Decimal) () .false. .false. ) (Assignment (Var 2 b1) (IntegerBinOp (Var 2 a1) Add (Var 2 x1) (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 y) (Var 2 b1) () .false. .false. ) (Print (StringFormat () [(Var 2 y)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4) () () ) () .false. .false. ) (Print (StringFormat () [(Var 2 q)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 2 a) (RealConstant 20.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4) ) (Real 4) (RealConstant -30.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 x2) (Var 2 a) () .false. .false. ) (Assignment (Var 2 y1) (Var 2 b) () .false. .false. ) (Assignment (Var 2 r) (Var 2 x2) () .false. .false. ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x2) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 2 y1) GtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) Or (LogicalBinOp (RealCompare (Var 2 x2) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) And (RealCompare (Var 2 y1) LtE (RealConstant 0.000000 (Real 4) ) (Logical 4) () ) (Logical 4) () ) (Logical 4) () ) [(Assignment (Var 2 r) (Var 2 x2) () .false. .false. )] [(Assignment (Var 2 r) (RealUnaryMinus (Var 2 x2) (Real 4) () ) () .false. .false. )] ) (Assignment (Var 2 c) (Var 2 r) () .false. .false. ) (Print (StringFormat () [(Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_03-2ad875a.stdout0000664000175000017500000000105615141516316027665 0ustar alastairalastairprogram derived_types_03 ! AST only do nn = 1, ndiag ing = diag(nn)%len allocate(diag(nn)%cell_id(ing), STAT=ierr) if (ierr /= 0) then return end if ndpwds = ndpwds + SIZE(diag(nn)%cell_id) end do do k = 1, nz do j = 1, ny do i = 1, ichunk nn = i + j + k - 2 indx(nn) = indx(nn) + 1 ing = indx(nn) diag(nn)%cell_id(ing)%ic = i diag(nn)%cell_id(ing)%j = j diag(nn)%cell_id(ing)%k = k end do end do end do end program derived_types_03 lfortran-lfortran-2f73434/tests/reference/asr_enable_style_suggestion-style1-a2fdd22.stdout0000664000175000017500000000001015141516316032311 0ustar alastairalastair y is 1 lfortran-lfortran-2f73434/tests/reference/asr-idint_real4-b5321a5.json0000664000175000017500000000073515141516316025574 0ustar alastairalastair{ "basename": "asr-idint_real4-b5321a5", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/idint_real4.f90", "infile_hash": "bd122b4a77e689953e6ee65cb703713f546485a4104e5985208c98e0", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-idint_real4-b5321a5.stderr", "stderr_hash": "3eda84427fd2599286c76e6f20adfe2b7e1d404a35ec18616acefe58", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-implicit12-025d795.json0000664000175000017500000000072315141516316025305 0ustar alastairalastair{ "basename": "asr-implicit12-025d795", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/implicit12.f90", "infile_hash": "b15934ce985f385fa987bbc85a37c711ad9f42818a7c50f8deeec4fc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-implicit12-025d795.stderr", "stderr_hash": "d96c32c29baa2b317c2b6f3cc6e6f5078f33a1f353146bb8bef2ca9e", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-arrays_05-e6d3b50.stdout0000664000175000017500000001317715141516316025646 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { arrays_05: (Program (SymbolTable 2 { i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), numbers: (Variable 2 numbers [] Local (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) arrays_05 [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) ()) [(Assignment (ArrayItem (Var 2 numbers) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (Cast (Var 2 i) IntegerToReal (Real 4) () ) Mul (RealConstant 2.000000 (Real 4) ) (Real 4) () ) () .false. .false. )] [] ) (Assignment (Var 2 numbers) (ArrayConstant 20 [1.50000000e+00, 3.20000005e+00, 4.50000000e+00, 8.99999976e-01, 7.19999981e+00] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/julia-block_03-cf8537e.stdout0000664000175000017500000000062515141516316025762 0ustar alastairalastairfunction square(b::Int32) local result::Int32 result = b * b if result ≠ 100 println(Base.stderr, "ERROR STOP") exit(1) end println(result) end function main() local a::Int32 a = 10 @label label_1 let b::Int32 a = a + 5 if a == 15 @goto label_1 end b = a ÷ 2 square(b) end end main() lfortran-lfortran-2f73434/tests/reference/run-format6-f98f4d0.json0000664000175000017500000000066215141516316025074 0ustar alastairalastair{ "basename": "run-format6-f98f4d0", "cmd": "lfortran --no-color {infile}", "infile": "tests/format6.f90", "infile_hash": "45186df6d72a5fce9f892c48cdd3fe35ab0414b21dc36e8c2be45727", "outfile": null, "outfile_hash": null, "stdout": "run-format6-f98f4d0.stdout", "stdout_hash": "780182de05c90a2bc696d2b7946d171f33e3e4594f33f61dafed140b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit4-704272e.stdout0000664000175000017500000003275015141516316025577 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { idd_random_transf: (Function (SymbolTable 2 { ialbetas: (Variable 2 ialbetas [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), idd_random_transf: (Variable 2 idd_random_transf [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iixs: (Variable 2 iixs [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iww: (Variable 2 iww [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), nsteps: (Variable 2 nsteps [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 2 w [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 2 x [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 2 y [] Unspecified () () Default (Array (Real 8) [(() ())] UnboundedPointerArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) idd_random_transf (FunctionType [(Array (Real 8) [(() ())] UnboundedPointerArray ) (Array (Real 8) [(() ())] UnboundedPointerArray ) (Array (Real 8) [(() ())] UnboundedPointerArray )] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 2 x) (Var 2 y) (Var 2 w)] [(Assignment (Var 2 ialbetas) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 iixs) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 nsteps) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 iww) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 4 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () ) () .false. .false. ) (Assignment (Var 2 n) (Cast (ArrayItem (Var 2 w) [(() (IntegerConstant 5 (Integer 4) Decimal) ())] (Real 8) ColMajor () ) RealToInteger (Integer 4) () ) () .false. .false. )] (Var 2 idd_random_transf) Public .false. .false. () ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_03-e127d69.stderr0000664000175000017500000000033715141516316030512 0ustar alastairalastairsyntax error: Only function, subroutine, procedure, module, submodule or block data allowed in global scope in non-interactive mode --> tests/errors/program_without_line_03.f90:3:1 | 3 | print *, "OK" | ^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-callback_01-21b53de.json0000664000175000017500000000075315141516316025515 0ustar alastairalastair{ "basename": "asr-callback_01-21b53de", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/callback_01.f90", "infile_hash": "d2c103564620acefc4245ff5eb5dfe84478276bead512800823259da", "outfile": null, "outfile_hash": null, "stdout": "asr-callback_01-21b53de.stdout", "stdout_hash": "94fa84cfd0761a29ae7483be0bfba9b23e02cce6c2e08b7288ac0cad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop2-16b2c78.stdout0000664000175000017500000000326515141516316027405 0ustar alastairalastair(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(k [] [] () () None ())] () )] [(DoLoop 0 () 0 k 1 10 () [(Print 0 () [k] () )] () () ) (DoLoop 0 () 80 k 1 10 () [(Print 0 () [k] () ) (Continue 80 () )] () () ) (DoLoop 0 () 800 k 1 10 () [(Print 0 () [k] () ) (Continue 800 () )] () () ) (DoLoop 0 () 8000 k 1 10 () [(Print 0 () [k] () ) (Continue 8000 () )] () () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-namelist_02-5bdbd75.stdout0000664000175000017500000001666415141516316026246 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { namelist_01: (Program (SymbolTable 2 { config: (Namelist 2 config [2 count 2 max_iter 2 tolerance 2 factor 2 verbose 2 method] ), count: (Variable 2 count [] Local (IntegerConstant 10 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), factor: (Variable 2 factor [] Local (RealConstant 1.500000 (Real 4) ) (RealConstant 1.500000 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), max_iter: (Variable 2 max_iter [] Local (IntegerConstant 100 (Integer 4) Decimal) (IntegerConstant 100 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), method: (Variable 2 method [] Local (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "default" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), tolerance: (Variable 2 tolerance [] Local (RealConstant 0.000001 (Real 4) ) (RealConstant 0.000001 (Real 4) ) Save (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), verbose: (Variable 2 verbose [] Local (LogicalConstant .false. (Logical 4) ) (LogicalConstant .false. (Logical 4) ) Save (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) namelist_01 [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-parse_without_program_line-0b3170b.stdout0000664000175000017500000001341015141516316031372 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [(Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrPointer )] [(p [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Allocate 0 [(() (FuncCallOrArray a [] [(() 10 () 0)] [] [] [] ) () 0)] [] () ) (Deallocate 0 [(() a () 0)] [] () ) (Open 0 [] [(unit 10) (file (String "test.txt" ())) (status (String "old" ()))] () ) (Flush 0 [10] [] () ) (Close 0 [] [(unit 10)] () ) (Nullify 0 [p] [] () ) (Exit 0 exit () ) (Cycle 0 cycle () ) (Return 0 () () ) (Continue 0 () ) (Print 0 () [exit] () ) (Print 0 () [cycle] () ) (Print 0 () [return] () ) (Print 0 () [continue] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (SubroutineCall 0 exit [] [] [] [] () ) (SubroutineCall 0 cycle [] [] [] [] () ) (SubroutineCall 0 return [] [] [] [] () ) (SubroutineCall 0 continue [] [] [] [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Subroutine sub [] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(DoLoop 0 () 0 i 1 10 () [(Print 0 () [i] () ) (If 0 () (== i 5) [(Exit 0 () () )] [] () () () ) (If 0 () (== i 7) [(Cycle 0 () () )] [] () () () ) (If 0 () (== i 9) [(Return 0 () () )] [] () () () ) (If 0 () (== i 2) [(Continue 0 () )] [] () () () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [] [] )] )] ) lfortran-lfortran-2f73434/tests/reference/julia-subroutines_04-c6808b6.json0000664000175000017500000000075515141516316026622 0ustar alastairalastair{ "basename": "julia-subroutines_04-c6808b6", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/subroutines_04.f90", "infile_hash": "c7f14f3cfe8c42ebbf006f4e20a30b517c9e2775e5af0f8853ae05e1", "outfile": null, "outfile_hash": null, "stdout": "julia-subroutines_04-c6808b6.stdout", "stdout_hash": "f1ab22a6c4a89d1dc7cfb972058622e224439bc1b109e78520e02e9c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-nint_overflow-bf5738b.stderr0000664000175000017500000000023715141516316026716 0ustar alastairalastairsemantic error: Result of `nint` overflows its kind(4) --> tests/errors/nint_overflow.f90:2:13 | 2 | print*, nint(1e12_8) | ^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-do_loop_01-3b6a582.stderr0000664000175000017500000000021115141516316025660 0ustar alastairalastairsemantic error: Assignment to loop variable `i` is not allowed --> tests/errors/do_loop_01.f90:7:7 | 7 | i = j + 1 | ^ lfortran-lfortran-2f73434/tests/reference/pass_inline_function_calls-functions_08-49d8a27.json0000664000175000017500000000110015141516316032522 0ustar alastairalastair{ "basename": "pass_inline_function_calls-functions_08-49d8a27", "cmd": "lfortran --pass=inline_function_calls --show-asr --no-color --fast {infile} -o {outfile}", "infile": "tests/../integration_tests/functions_08.f90", "infile_hash": "625582953de25dfa6d54c1e44d22b6e19394212ca99c252ca13236e2", "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_08-49d8a27.stdout", "stdout_hash": "462fd0ada92923913fb30e7068c8ba3ac84df0df7bc625cd9196d8c9", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-case_05-96724df.json0000664000175000017500000000072215141516316024631 0ustar alastairalastair{ "basename": "cpp-case_05-96724df", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/case_05.f90", "infile_hash": "914477f4a376baf0341e522d2109b6108238cd1d9dfecf969283ab79", "outfile": null, "outfile_hash": null, "stdout": "cpp-case_05-96724df.stdout", "stdout_hash": "a15dd4d337a830a428e125ff53e362f981362b035d9606d9c75979aa", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-exit2-f1f3b2c.json0000664000175000017500000000077015141516316024613 0ustar alastairalastair{ "basename": "run-exit2-f1f3b2c", "cmd": "lfortran --no-color {infile}", "infile": "tests/exit2.f90", "infile_hash": "c5a7d81e07c46ace9d368370add645b4ae661ce043a89520234f71ba", "outfile": null, "outfile_hash": null, "stdout": "run-exit2-f1f3b2c.stdout", "stdout_hash": "61f0d87e355fe9206f69359bd0d77b9ac928ec3fdf45d6c625f90bce", "stderr": "run-exit2-f1f3b2c.stderr", "stderr_hash": "d79d075de4df8ce8a4bfbf243c5b77607fb4811cdbeacd9fad5542f1", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-recursion_02-20a7daf.stdout0000664000175000017500000007665415141516316026440 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 7 { r: (Variable 7 r [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), solver: (ExternalSymbol 7 solver 2 solver recursion_02 [] solver Public ), sub1: (ExternalSymbol 7 sub1 2 sub1 recursion_02 [] sub1 Public ) }) main [recursion_02] [(Assignment (Var 7 r) (FunctionCall 7 sub1 () [((IntegerConstant 3 (Integer 4) Decimal)) ((IntegerConstant 3 (Integer 4) Decimal))] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "r =" (String 1 (IntegerConstant 3 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 7 r)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ), recursion_02: (Module (SymbolTable 2 { solver: (Function (SymbolTable 3 { f: (Function (SymbolTable 4 { f: (Variable 4 f [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) f (FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [] [] (Var 4 f) Public .false. .false. () ), f_val: (Variable 3 f_val [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), iter: (Variable 3 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), solver: (Variable 3 solver [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) solver (FunctionType [(FunctionType [] (Integer 4) Source Interface () .false. .false. .false. .false. .false. [] .false. ) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [sub1] [(Var 3 f) (Var 3 iter)] [(Assignment (Var 3 f_val) (FunctionCall 3 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "before:" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 3 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4) Decimal)) ((IntegerBinOp (Var 3 iter) Sub (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 3 f_val) (FunctionCall 3 f () [] (Integer 4) () () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "after:" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 3 f_val)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] (Var 3 solver) Public .false. .false. () ), sub1: (Function (SymbolTable 5 { getx: (Function (SymbolTable 6 { getx: (Variable 6 getx [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) getx (FunctionType [] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(StringConstant "x in getx" (String 1 (IntegerConstant 9 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 5 x)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Assignment (Var 6 getx) (Var 5 x) () .false. .false. )] (Var 6 getx) Public .false. .false. () ), iter: (Variable 5 iter [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sub1: (Variable 5 sub1 [] ReturnVar () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), tmp: (Variable 5 tmp [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 5 x [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 5 y [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) sub1 (FunctionType [(Integer 4) (Integer 4)] (Integer 4) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [solver] [(Var 5 y) (Var 5 iter)] [(Assignment (Var 5 x) (Var 5 y) () .false. .false. ) (Print (StringConstant "in sub1" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (If () (IntegerCompare (Var 5 iter) Eq (IntegerConstant 1 (Integer 4) Decimal) (Logical 4) () ) [(Assignment (Var 5 sub1) (IntegerConstant 1 (Integer 4) Decimal) () .false. .false. ) (Return)] [] ) (Assignment (Var 5 tmp) (FunctionCall 5 getx () [] (Integer 4) () () ) () .false. .false. ) (Assignment (Var 5 sub1) (FunctionCall 2 solver () [((Var 5 getx)) ((Var 5 iter))] (Integer 4) () () ) () .false. .false. )] (Var 5 sub1) Public .false. .false. () ) }) recursion_02 () [recursion_02] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-modules_07-7f671c1.stdout0000664000175000017500000000625115141516316025740 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { modules_07_mod: (Module (SymbolTable 2 { a: (Variable 2 a [] Local (IntegerConstant 5 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local (IntegerConstant 6 (Integer 4) Decimal) (IntegerConstant 6 (Integer 4) Decimal) Parameter (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local (IntegerConstant 7 (Integer 4) Decimal) (IntegerConstant 7 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) modules_07_mod () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/llvm-string_11-e6c763f.stdout0000664000175000017500000004674015141516316026052 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @string_const_data = private constant [14 x i8] c"This is a test" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([14 x i8], [14 x i8]* @string_const_data, i32 0, i32 0), i64 14 }> @string_const_data.1 = private constant [4 x i8] c"test" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data.1, i32 0, i32 0), i64 4 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.3 = private constant [17 x i8] c"test is not found" @string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([17 x i8], [17 x i8]* @string_const_data.3, i32 0, i32 0), i64 17 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-24,I4\00", align 1 @string_const_data.5 = private constant [24 x i8] c"test is found at index: " @string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([24 x i8], [24 x i8]* @string_const_data.5, i32 0, i32 0), i64 24 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @_lcompilers_index_str(%string_descriptor* %str, %string_descriptor* %substr, i1* %back, i32* %kind) { .entry: %_lcompilers_index_str = alloca i32, align 4 %found = alloca i1, align 1 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 %pos = alloca i32, align 4 store i32 0, i32* %_lcompilers_index_str, align 4 store i32 1, i32* %i, align 4 store i1 true, i1* %found, align 1 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 4 %2 = trunc i64 %1 to i32 %3 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %4 = load i64, i64* %3, align 4 %5 = trunc i64 %4 to i32 %6 = icmp slt i32 %2, %5 br i1 %6, label %then, label %else then: ; preds = %.entry store i1 false, i1* %found, align 1 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %7 = load i32, i32* %i, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 %11 = add i32 %10, 1 %12 = icmp slt i32 %7, %11 %13 = load i1, i1* %found, align 1 %14 = zext i1 %13 to i32 %15 = icmp eq i32 %14, 1 %16 = icmp eq i1 %12, false %17 = select i1 %16, i1 %12, i1 %15 br i1 %17, label %loop.body, label %loop.end11 loop.body: ; preds = %loop.head store i32 0, i32* %k, align 4 store i32 1, i32* %j, align 4 br label %loop.head1 loop.head1: ; preds = %ifcont7, %loop.body %18 = load i32, i32* %j, align 4 %19 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 %22 = icmp sle i32 %18, %21 %23 = load i1, i1* %found, align 1 %24 = zext i1 %23 to i32 %25 = icmp eq i32 %24, 1 %26 = icmp eq i1 %22, false %27 = select i1 %26, i1 %22, i1 %25 br i1 %27, label %loop.body2, label %loop.end loop.body2: ; preds = %loop.head1 %28 = load i32, i32* %i, align 4 %29 = load i32, i32* %k, align 4 %30 = add i32 %28, %29 store i32 %30, i32* %pos, align 4 %31 = load i32, i32* %pos, align 4 %32 = load i32, i32* %pos, align 4 %33 = sext i32 %31 to i64 %34 = sext i32 %32 to i64 %35 = sub i64 %34, %33 %36 = add i64 %35, 1 %37 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = sext i32 %31 to i64 %40 = sub i64 %39, 1 %StrSliceGEP = getelementptr i8, i8* %38, i64 %40 %StrSlice_StrView = alloca %string_descriptor, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %36, i64* %42, align 4 %43 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %46 = load i64, i64* %45, align 4 %47 = load i32, i32* %j, align 4 %48 = load i32, i32* %j, align 4 %49 = sext i32 %47 to i64 %50 = sext i32 %48 to i64 %51 = sub i64 %50, %49 %52 = add i64 %51, 1 %53 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 0 %54 = load i8*, i8** %53, align 8 %55 = sext i32 %47 to i64 %56 = sub i64 %55, 1 %StrSliceGEP3 = getelementptr i8, i8* %54, i64 %56 %StrSlice_StrView4 = alloca %string_descriptor, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 store i8* %StrSliceGEP3, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 store i64 %52, i64* %58, align 4 %59 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 %62 = load i64, i64* %61, align 4 %63 = call i32 @str_compare(i8* %44, i64 %46, i8* %60, i64 %62) %64 = icmp ne i32 %63, 0 br i1 %64, label %then5, label %else6 then5: ; preds = %loop.body2 store i1 false, i1* %found, align 1 br label %ifcont7 else6: ; preds = %loop.body2 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %65 = load i32, i32* %j, align 4 %66 = add i32 %65, 1 store i32 %66, i32* %j, align 4 %67 = load i32, i32* %k, align 4 %68 = add i32 %67, 1 store i32 %68, i32* %k, align 4 br label %loop.head1 loop.end: ; preds = %loop.head1 %69 = load i1, i1* %found, align 1 %70 = zext i1 %69 to i32 %71 = icmp eq i32 %70, 1 br i1 %71, label %then8, label %else9 then8: ; preds = %loop.end %72 = load i32, i32* %i, align 4 store i32 %72, i32* %_lcompilers_index_str, align 4 %73 = load i1, i1* %back, align 1 store i1 %73, i1* %found, align 1 br label %ifcont10 else9: ; preds = %loop.end store i1 true, i1* %found, align 1 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %74 = load i32, i32* %i, align 4 %75 = add i32 %74, 1 store i32 %75, i32* %i, align 4 br label %loop.head loop.end11: ; preds = %loop.head br label %return return: ; preds = %loop.end11 br label %FINALIZE_SYMTABLE__lcompilers_index_str FINALIZE_SYMTABLE__lcompilers_index_str: ; preds = %return %76 = load i32, i32* %_lcompilers_index_str, align 4 ret i32 %76 } define i32 @_lcompilers_index_str1(%string_descriptor* %str, %string_descriptor* %substr, i1* %back, i32* %kind) { .entry: %_lcompilers_index_str1 = alloca i32, align 4 %found = alloca i1, align 1 %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 %pos = alloca i32, align 4 store i32 0, i32* %_lcompilers_index_str1, align 4 store i32 1, i32* %i, align 4 store i1 true, i1* %found, align 1 %0 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %1 = load i64, i64* %0, align 4 %2 = trunc i64 %1 to i32 %3 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %4 = load i64, i64* %3, align 4 %5 = trunc i64 %4 to i32 %6 = icmp slt i32 %2, %5 br i1 %6, label %then, label %else then: ; preds = %.entry store i1 false, i1* %found, align 1 br label %ifcont else: ; preds = %.entry br label %ifcont ifcont: ; preds = %else, %then br label %loop.head loop.head: ; preds = %ifcont10, %ifcont %7 = load i32, i32* %i, align 4 %8 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 1 %9 = load i64, i64* %8, align 4 %10 = trunc i64 %9 to i32 %11 = add i32 %10, 1 %12 = icmp slt i32 %7, %11 %13 = load i1, i1* %found, align 1 %14 = zext i1 %13 to i32 %15 = icmp eq i32 %14, 1 %16 = icmp eq i1 %12, false %17 = select i1 %16, i1 %12, i1 %15 br i1 %17, label %loop.body, label %loop.end11 loop.body: ; preds = %loop.head store i32 0, i32* %k, align 4 store i32 1, i32* %j, align 4 br label %loop.head1 loop.head1: ; preds = %ifcont7, %loop.body %18 = load i32, i32* %j, align 4 %19 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 1 %20 = load i64, i64* %19, align 4 %21 = trunc i64 %20 to i32 %22 = icmp sle i32 %18, %21 %23 = load i1, i1* %found, align 1 %24 = zext i1 %23 to i32 %25 = icmp eq i32 %24, 1 %26 = icmp eq i1 %22, false %27 = select i1 %26, i1 %22, i1 %25 br i1 %27, label %loop.body2, label %loop.end loop.body2: ; preds = %loop.head1 %28 = load i32, i32* %i, align 4 %29 = load i32, i32* %k, align 4 %30 = add i32 %28, %29 store i32 %30, i32* %pos, align 4 %31 = load i32, i32* %pos, align 4 %32 = load i32, i32* %pos, align 4 %33 = sext i32 %31 to i64 %34 = sext i32 %32 to i64 %35 = sub i64 %34, %33 %36 = add i64 %35, 1 %37 = getelementptr %string_descriptor, %string_descriptor* %str, i32 0, i32 0 %38 = load i8*, i8** %37, align 8 %39 = sext i32 %31 to i64 %40 = sub i64 %39, 1 %StrSliceGEP = getelementptr i8, i8* %38, i64 %40 %StrSlice_StrView = alloca %string_descriptor, align 8 %41 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 store i8* %StrSliceGEP, i8** %41, align 8 %42 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 store i64 %36, i64* %42, align 4 %43 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 0 %44 = load i8*, i8** %43, align 8 %45 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView, i32 0, i32 1 %46 = load i64, i64* %45, align 4 %47 = load i32, i32* %j, align 4 %48 = load i32, i32* %j, align 4 %49 = sext i32 %47 to i64 %50 = sext i32 %48 to i64 %51 = sub i64 %50, %49 %52 = add i64 %51, 1 %53 = getelementptr %string_descriptor, %string_descriptor* %substr, i32 0, i32 0 %54 = load i8*, i8** %53, align 8 %55 = sext i32 %47 to i64 %56 = sub i64 %55, 1 %StrSliceGEP3 = getelementptr i8, i8* %54, i64 %56 %StrSlice_StrView4 = alloca %string_descriptor, align 8 %57 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 store i8* %StrSliceGEP3, i8** %57, align 8 %58 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 store i64 %52, i64* %58, align 4 %59 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 0 %60 = load i8*, i8** %59, align 8 %61 = getelementptr %string_descriptor, %string_descriptor* %StrSlice_StrView4, i32 0, i32 1 %62 = load i64, i64* %61, align 4 %63 = call i32 @str_compare(i8* %44, i64 %46, i8* %60, i64 %62) %64 = icmp ne i32 %63, 0 br i1 %64, label %then5, label %else6 then5: ; preds = %loop.body2 store i1 false, i1* %found, align 1 br label %ifcont7 else6: ; preds = %loop.body2 br label %ifcont7 ifcont7: ; preds = %else6, %then5 %65 = load i32, i32* %j, align 4 %66 = add i32 %65, 1 store i32 %66, i32* %j, align 4 %67 = load i32, i32* %k, align 4 %68 = add i32 %67, 1 store i32 %68, i32* %k, align 4 br label %loop.head1 loop.end: ; preds = %loop.head1 %69 = load i1, i1* %found, align 1 %70 = zext i1 %69 to i32 %71 = icmp eq i32 %70, 1 br i1 %71, label %then8, label %else9 then8: ; preds = %loop.end %72 = load i32, i32* %i, align 4 store i32 %72, i32* %_lcompilers_index_str1, align 4 %73 = load i1, i1* %back, align 1 store i1 %73, i1* %found, align 1 br label %ifcont10 else9: ; preds = %loop.end store i1 true, i1* %found, align 1 br label %ifcont10 ifcont10: ; preds = %else9, %then8 %74 = load i32, i32* %i, align 4 %75 = add i32 %74, 1 store i32 %75, i32* %i, align 4 br label %loop.head loop.end11: ; preds = %loop.head br label %return return: ; preds = %loop.end11 br label %FINALIZE_SYMTABLE__lcompilers_index_str1 FINALIZE_SYMTABLE__lcompilers_index_str1: ; preds = %return %76 = load i32, i32* %_lcompilers_index_str1, align 4 ret i32 %76 } declare i32 @str_compare(i8*, i64, i8*, i64) define i32 @main(i32 %0, i8** %1) { .entry: %call_arg_value1 = alloca i32, align 4 %call_arg_value = alloca i1, align 1 call void @_lpython_call_initial_functions(i32 %0, i8** %1) %mystring = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %mystring, align 1 %2 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 1 store i64 30, i64* %2, align 4 %3 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %4 = call i8* @_lfortran_malloc(i64 30) store i8* %4, i8** %3, align 8 %teststring = alloca %string_descriptor, align 8 store %string_descriptor zeroinitializer, %string_descriptor* %teststring, align 1 %5 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 1 store i64 10, i64* %5, align 4 %6 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %7 = call i8* @_lfortran_malloc(i64 10) store i8* %7, i8** %6, align 8 %8 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %9 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 1 %10 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %8, i64* %9, i8 0, i8 0, i8* %10, i64 14) %11 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %12 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 1 %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_strcpy(i8** %11, i64* %12, i8 0, i8 0, i8* %13, i64 4) store i1 false, i1* %call_arg_value, align 1 store i32 4, i32* %call_arg_value1, align 4 %14 = call i32 @_lcompilers_index_str(%string_descriptor* %mystring, %string_descriptor* %teststring, i1* %call_arg_value, i32* %call_arg_value1) %15 = icmp eq i32 %14, 0 br i1 %15, label %then, label %else then: ; preds = %.entry %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) br label %ifcont else: ; preds = %.entry %17 = alloca i64, align 8 store i1 false, i1* %call_arg_value, align 1 store i32 4, i32* %call_arg_value1, align 4 %18 = call i32 @_lcompilers_index_str1(%string_descriptor* %mystring, %string_descriptor* %teststring, i1* %call_arg_value, i32* %call_arg_value1) %19 = alloca i32, align 4 store i32 %18, i32* %19, align 4 %20 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %17, i32 0, i32 0, %string_descriptor* @string_const.6, i32* %19) %21 = load i64, i64* %17, align 4 %stringFormat_desc = alloca %string_descriptor, align 8 %22 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 store i8* %20, i8** %22, align 8 %23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 store i64 %21, i64* %23, align 4 %24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0 %25 = load i8*, i8** %24, align 8 %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1 %27 = load i64, i64* %26, align 4 %28 = trunc i64 %27 to i32 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %25, i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %29 = icmp eq i8* %20, null br i1 %29, label %free_done, label %free_nonnull free_nonnull: ; preds = %else call void @_lfortran_free(i8* %20) br label %free_done free_done: ; preds = %free_nonnull, %else br label %ifcont ifcont: ; preds = %free_done, %then call void @_lpython_free_argv() br label %return return: ; preds = %ifcont br label %FINALIZE_SYMTABLE_string_11 FINALIZE_SYMTABLE_string_11: ; preds = %return br label %Finalize_Variable_mystring Finalize_Variable_mystring: ; preds = %FINALIZE_SYMTABLE_string_11 %30 = getelementptr %string_descriptor, %string_descriptor* %mystring, i32 0, i32 0 %31 = load i8*, i8** %30, align 8 %32 = icmp eq i8* %31, null br i1 %32, label %free_done3, label %free_nonnull2 free_nonnull2: ; preds = %Finalize_Variable_mystring call void @_lfortran_free(i8* %31) br label %free_done3 free_done3: ; preds = %free_nonnull2, %Finalize_Variable_mystring br label %Finalize_Variable_teststring Finalize_Variable_teststring: ; preds = %free_done3 %33 = getelementptr %string_descriptor, %string_descriptor* %teststring, i32 0, i32 0 %34 = load i8*, i8** %33, align 8 %35 = icmp eq i8* %34, null br i1 %35, label %free_done5, label %free_nonnull4 free_nonnull4: ; preds = %Finalize_Variable_teststring call void @_lfortran_free(i8* %34) br label %free_done5 free_done5: ; preds = %free_nonnull4, %Finalize_Variable_teststring ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare i8* @_lfortran_malloc(i64) declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64) declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...) declare void @_lfortran_free(i8*) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/asr-assign_01-2cf003f.stderr0000664000175000017500000000035215141516316025570 0ustar alastairalastairsemantic error: Cannot assign to a constant variable --> tests/errors/assign_01.f90:5:5 | 5 | x = 1 | ^^^^^ assignment here | 4 | integer, parameter :: x = 2 | ~~~~~ declared as constant lfortran-lfortran-2f73434/tests/reference/llvm-return_03-3f7087d.json0000664000175000017500000000107115141516316025416 0ustar alastairalastair{ "basename": "llvm-return_03-3f7087d", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/return_03.f90", "infile_hash": "c190c174edf4f26a3f53eaf52dec0323754909c2495aedbf30d13753", "outfile": null, "outfile_hash": null, "stdout": "llvm-return_03-3f7087d.stdout", "stdout_hash": "159bc30ed3640f946464d289bea06c8d53773af24072c29aff219022", "stderr": "llvm-return_03-3f7087d.stderr", "stderr_hash": "3a3e7d555e7082b1df762706047d54b39d0484046e5f72bf507b2a3b", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_cc-78281a4.json0000664000175000017500000000115115141516316030233 0ustar alastairalastair{ "basename": "ast-program_without_line_cc-78281a4", "cmd": "lfortran --continue-compilation --show-ast --no-color {infile}", "infile": "tests/errors/program_without_line_cc.f90", "infile_hash": "516860f9855615c6727a984cf5f5ac39055860c9659a3dc0a17b814b", "outfile": null, "outfile_hash": null, "stdout": "ast-program_without_line_cc-78281a4.stdout", "stdout_hash": "c2d16e91f6a6c5b3aa27c0c453b0c32588ea7993f7dfcbf97ad3eef5", "stderr": "ast-program_without_line_cc-78281a4.stderr", "stderr_hash": "3a3b524012a2e28a46d7903cb16364e434d6d222f2babe9d4a003ff0", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/asr-do_concurrent1-74bde45.json0000664000175000017500000000074615141516316026421 0ustar alastairalastair{ "basename": "asr-do_concurrent1-74bde45", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/do_concurrent1.f90", "infile_hash": "11d2f455926ea0469a0cefd4547a8df57c57d57a3c836c87f04ef3dc", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-do_concurrent1-74bde45.stderr", "stderr_hash": "9fd50196024a6f988e64b93331be1f4e244183f9b31b4ae5f3908653", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_06-5ae916e.json0000664000175000017500000000077215141516316026647 0ustar alastairalastair{ "basename": "asr-derived_types_06-5ae916e", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_06.f90", "infile_hash": "755cad69ac7bfd9d2d069a753b811e2f76bec02faf78f74031b9f2c1", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-5ae916e.stdout", "stdout_hash": "c5d76814619f689758de586428731050b76e6711986446293eb96118", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor11-dc5b2d5.stdout0000664000175000017500000001475015141516316031254 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor11: (Program (SymbolTable 2 { }) preprocessor11 [] [(Print (StringFormat () [(IntegerBinOp (IntegerConstant 1 (Integer 4) Decimal) Add (IntegerBinOp (IntegerConstant 5 (Integer 4) Decimal) Mul (IntegerConstant 3 (Integer 4) Decimal) (Integer 4) (IntegerConstant 15 (Integer 4) Decimal) ) (Integer 4) (IntegerConstant 16 (Integer 4) Decimal) )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringConstant "X is 1" (String 1 (IntegerConstant 6 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 2" (String 1 (IntegerConstant 10 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not X is not 1" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 1 and Y is 5" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not (X is 2 and Y is 5)" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X<3 and Y>3" (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Not (X>3 and Y<3)" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is 3-2" (String 1 (IntegerConstant 8 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X is not 3-1" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (6*5-5)/5" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (6*5-6)/5" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (-5+6*5)/5" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (-6+6*5)/5" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (+5+6*5)/7" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is not (+4+6*5)/7" (String 1 (IntegerConstant 19 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is (+5+6*Y)/7" (String 1 (IntegerConstant 15 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z is 16" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y defined and 1 <= Y" (String 1 (IntegerConstant 20 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "A not defined or not 1 <= A" (String 1 (IntegerConstant 27 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-cpp2-a8d63da.stderr0000664000175000017500000000022715141516316027205 0ustar alastairalastairsemantic error: Variable 'yy' is not declared --> tests/errors/cpp2.f90:7:19 | 7 | print *, x, X123, yy | ^^ 'yy' is undeclared lfortran-lfortran-2f73434/tests/reference/asr-interface_08-1848d3c.json0000664000175000017500000000075615141516316025664 0ustar alastairalastair{ "basename": "asr-interface_08-1848d3c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_08.f90", "infile_hash": "1d77bce04c4ed246e65fc8bdef857ace3850dcb72213fe0d33da8e32", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_08-1848d3c.stdout", "stdout_hash": "7d05bc34b414d9422fee6fc1467da2855391a4119790b89d3e7274e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-do_concurrent1-5fba0ee.stdout0000664000175000017500000004030115141516316027114 0ustar alastairalastair(TranslationUnit [(Subroutine dc1 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr) (() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(N [] [] () () None ()) (i [] [] () () None ()) (j [] [] () () None ())] () )] [(Assignment 0 N (FuncCallOrArray size [] [(() a () 0)] [] [] [] ) () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 N () ) (ConcurrentControl j 1 N () )] (< i j) [] [(Assignment 0 (FuncCallOrArray a [] [(() i () 0) (() j () 0)] [] [] [] ) (FuncCallOrArray a [] [(() j () 0) (() i () 0)] [] [] [] ) () )] () () )] [] [] ) (Subroutine dc2 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentLocal [x] )] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] ) (Subroutine dc3 [(a) (b)] [] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentShared [i] ) (ConcurrentLocal [x] ) (ConcurrentDefault)] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] ) (Subroutine dc4 [(a) (b)] [] () () [] [] [] [(Declaration (AttrType TypeReal [] () () None ) [(AttrIntent InOut )] [(a [(() () DimensionExpr)] [] () () None ()) (b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [] [(x [] [] () () None ())] () )] [(Assignment 0 x (Real "1.0") () ) (DoConcurrentLoop 0 () [(ConcurrentControl i 1 10 () )] () [(ConcurrentDefault) (ConcurrentLocal [x] ) (ConcurrentShared [i] )] [(If 0 () (> (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) 0) [(Assignment 0 x (FuncCallOrArray sqrt [] [(() (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) () 0)] [] [] [] ) () ) (Assignment 0 (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray a [] [(() i () 0)] [] [] [] ) (** x 2)) () )] [] () () () ) (Assignment 0 (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) (FuncCallOrArray a [] [(() i () 0)] [] [] [] )) () )] () () ) (Print 0 () [x] () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_no_prescan-no_prescan_include2-420be52.json0000664000175000017500000000102115141516316031511 0ustar alastairalastair{ "basename": "ast_no_prescan-no_prescan_include2-420be52", "cmd": "lfortran --no-prescan --show-ast --no-color {infile} -o {outfile}", "infile": "tests/no_prescan_include2.f90", "infile_hash": "68cbbaed9ac272ba7009bc7e89270e6e2a12fd0c540413dc2a0a96eb", "outfile": null, "outfile_hash": null, "stdout": "ast_no_prescan-no_prescan_include2-420be52.stdout", "stdout_hash": "6bcff69480fdc91d83ab9a9df0af32ed41d9a9f594cb553bd8ca2ee7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-entry1-5f14c6d.stdout0000664000175000017500000000043115141516316025734 0ustar alastairalastairprogram entry1 real :: dummy dummy = 10 call x(dummy) call y(dummy) end program entry1 subroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy dummy = 5.0 return entry y(dummy) print *, "Printed using entry statement: ", dummy return end subroutine x lfortran-lfortran-2f73434/tests/reference/asr-doloop_02-cc78975.json0000664000175000017500000000074515141516316025223 0ustar alastairalastair{ "basename": "asr-doloop_02-cc78975", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/doloop_02.f90", "infile_hash": "3f887434509231f48fbbbda31f34778f17ddb6871b39c44626d54f2e", "outfile": null, "outfile_hash": null, "stdout": "asr-doloop_02-cc78975.stdout", "stdout_hash": "4888a605d9484b3f47c872ee71505ef20abe9f57946a7e55488eaa8a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor10-6279d1f.stdout0000664000175000017500000000655015141516316031124 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { preprocessor10: (Program (SymbolTable 2 { }) preprocessor10 [] [(Print (StringConstant "X is defined" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Y is defined" (String 1 (IntegerConstant 12 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z is not defined" (String 1 (IntegerConstant 16 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y is defined" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z and Y is not defined" (String 1 (IntegerConstant 22 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "Z or Y is defined" (String 1 (IntegerConstant 17 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y and Z is not defined" (String 1 (IntegerConstant 28 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y or Z is defined" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and Y or Z is defined" (String 1 (IntegerConstant 23 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and !Y or !Z is defined" (String 1 (IntegerConstant 25 (Integer 4) Decimal) ExpressionLength DescriptorString) ) ) (Print (StringConstant "X and !(Y or Z) is not defined" (String 1 (IntegerConstant 30 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-implicit_typing4-df7d614.stderr0000664000175000017500000000032615141516316027311 0ustar alastairalastairsemantic error: Dummy argument 'matvect' not defined --> tests/errors/implicit_typing4.f90:1:1 - 3:3 | 1 | subroutine iddr_rsvd(matvect) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... ... | 3 | end | ...^^^ lfortran-lfortran-2f73434/tests/reference/ast_f90-expr9-c1303f2.stdout0000664000175000017500000000022715141516316025471 0ustar alastairalastaircall ERROR_HANDLER%trigger(errors=.errors.rslt) .INVERSE.B .INVERSE.(A + B) .anotherunary.1 .anotherunary.(1 + 2) .anotherunary.C .anotherunary.(c + d)lfortran-lfortran-2f73434/tests/reference/llvm-global_scope4-10fa534.json0000664000175000017500000000073715141516316026303 0ustar alastairalastair{ "basename": "llvm-global_scope4-10fa534", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope4-10fa534.stdout", "stdout_hash": "01b12543ff02e98107647165671ad9b71075d8cb4e251f4438a5409a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/llvm-associate_04-97f4e70.json0000664000175000017500000000076115141516316026063 0ustar alastairalastair{ "basename": "llvm-associate_04-97f4e70", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/associate_04.f90", "infile_hash": "902a12c91e1df67575c96534b3b5a55ca93e85aa0777e689ecc1334c", "outfile": null, "outfile_hash": null, "stdout": "llvm-associate_04-97f4e70.stdout", "stdout_hash": "d2fdc558aeeb4585f018271cabadfa1243c1b0c3cd6aae624bf3f2fc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implied_do_loops1-25d26db.stdout0000664000175000017500000002225115141516316027434 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { implied_do_loop1: (Program (SymbolTable 2 { a: (Variable 2 a [j] Local (ArrayConstructor [(ImpliedDoLoop [(Var 2 j)] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) )] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ColMajor () ) (ArrayConstant 40 [1, 2, 3, ...., 8, 9, 10] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) Save (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), j: (Variable 2 j [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), s: (Function (SymbolTable 3 { }) s (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Print (StringFormat () [(ImpliedDoLoop [(Var 2 j)] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) implied_do_loop1 [] [(SubroutineCall 2 s () [] () .false. ) (Print (StringFormat () [(ImpliedDoLoop [(ArrayItem (Var 2 a) [(() (Var 2 j) ())] (Integer 4) ColMajor () )] (Var 2 j) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 10 (Integer 4) Decimal) () (Integer 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/wat-doloop_01-4e94eaf.stdout0000664000175000017500000003765415141516316025742 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param) (result))) (type (;3;) (func (param i64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param) (result) (local i32 i32) i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 10 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 55 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 2 i32.sub local.set 0 loop local.get 0 i32.const 2 i32.add i32.const 9 i32.le_s if local.get 0 i32.const 2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 9 i32.const -2 i32.sub local.set 0 loop local.get 0 i32.const -2 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 2 i32.sub local.set 0 loop local.get 0 i32.const 2 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 2 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 25 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 3 i32.sub local.set 0 loop local.get 0 i32.const 3 i32.add i32.const 10 i32.le_s if local.get 0 i32.const 3 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 22 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 10 i32.const -3 i32.sub local.set 0 loop local.get 0 i32.const -3 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -3 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 22 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 1 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 1 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 1 i32.const 1 i32.sub local.set 0 loop local.get 0 i32.const 1 i32.add i32.const 0 i32.le_s if local.get 0 i32.const 1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 0 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 local.set 1 i32.const 0 i32.const -1 i32.sub local.set 0 loop local.get 0 i32.const -1 i32.add i32.const 1 i32.ge_s if local.get 0 i32.const -1 i32.add local.set 0 local.get 1 local.get 0 i32.add local.set 1 br 1 else end end local.get 1 i32.const 0 i32.ne if i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 call 0 unreachable else end local.get 1 i64.extend_i32_s call 3 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $3 (type 3) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "_start" (func 2)) (export "print_i64" (func 3)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00") (data (;35;) (i32.const 216) "ERROR STOP\n ") ) lfortran-lfortran-2f73434/tests/reference/asr-bits_02-e48c6d3.json0000664000175000017500000000073715141516316024740 0ustar alastairalastair{ "basename": "asr-bits_02-e48c6d3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/bits_02.f90", "infile_hash": "326043189040d63a64dac0f62cb9504336196a58ad139ffe70eeb884", "outfile": null, "outfile_hash": null, "stdout": "asr-bits_02-e48c6d3.stdout", "stdout_hash": "da17dc6208f2888d92ffecf2b47fb0a52c18c4d9f8fecc4343a1867b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-implicit11-95f56fd.json0000664000175000017500000000106615141516316025456 0ustar alastairalastair{ "basename": "asr-implicit11-95f56fd", "cmd": "lfortran --show-asr --implicit-typing --no-color {infile} -o {outfile}", "infile": "tests/implicit11.f90", "infile_hash": "b6ee32da95ff9a5b2be776f4ad79d4d7f0e0c5360d106273583e2a78", "outfile": null, "outfile_hash": null, "stdout": "asr-implicit11-95f56fd.stdout", "stdout_hash": "3dbbf4108d2d3542480b1193d6755206e4ef63aab9f8fe31c73225d9", "stderr": "asr-implicit11-95f56fd.stderr", "stderr_hash": "09a57b521bb707f6d839d4a343a1d55910508436649b6c66115d3c15", "returncode": 0 }././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.jsonlfortran-lfortran-2f73434/tests/reference/asr_disable_style_suggestion_and_warnings-save4-4eccf46.js0000664000175000017500000000106515141516316034140 0ustar alastairalastair{ "basename": "asr_disable_style_suggestion_and_warnings-save4-4eccf46", "cmd": "lfortran --show-asr --no-style-suggestions --no-warnings --no-color {infile} -o {outfile}", "infile": "tests/save4.f90", "infile_hash": "8ad16d18b9282d4bb2812bf641878b7a6738e0e34c356b94ff01ef8a", "outfile": null, "outfile_hash": null, "stdout": "asr_disable_style_suggestion_and_warnings-save4-4eccf46.stdout", "stdout_hash": "a3eb4caf18d259ea43790a9a498e716a8714031f6a17875cae6bcf2b", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_11-83e9417.stderr0000664000175000017500000000043515141516316030034 0ustar alastairalastairruntime error: Array shape mismatch in assignment to 'e'. Tried to match size 4 of dimension 1 of LHS with size 2 of dimension 1 of RHS. Use '--realloc-lhs-arrays' option to reallocate LHS automatically. --> tests/errors/array_bounds_check_11.f90:9:5 | 9 | e = a + b | ^ lfortran-lfortran-2f73434/tests/reference/llvm-nested_01-b01694c.stdout0000664000175000017500000000533115141516316025721 0ustar alastairalastair; ModuleID = 'LFortran' source_filename = "LFortran" %string_descriptor = type <{ i8*, i64 }> @0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data = private constant [3 x i8] c"d()" @string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data, i32 0, i32 0), i64 3 }> @1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @string_const_data.1 = private constant [3 x i8] c"b()" @string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([3 x i8], [3 x i8]* @string_const_data.1, i32 0, i32 0), i64 3 }> @3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 define i32 @__module_nested_01_a_b() { .entry: %b = alloca i32, align 4 %e = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1) %1 = call i32 @b.__module_nested_01_a_d() store i32 %1, i32* %e, align 4 store i32 0, i32* %b, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_b FINALIZE_SYMTABLE_b: ; preds = %return %2 = load i32, i32* %b, align 4 ret i32 %2 } define i32 @b.__module_nested_01_a_d() { .entry: %d = alloca i32, align 4 %0 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8 call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %0, i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1) store i32 1, i32* %d, align 4 br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_d FINALIZE_SYMTABLE_d: ; preds = %return %1 = load i32, i32* %d, align 4 ret i32 %1 } declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32) define i32 @main(i32 %0, i8** %1) { .entry: call void @_lpython_call_initial_functions(i32 %0, i8** %1) %c = alloca i32, align 4 %2 = call i32 @__module_nested_01_a_b() store i32 %2, i32* %c, align 4 call void @_lpython_free_argv() br label %return return: ; preds = %.entry br label %FINALIZE_SYMTABLE_nested_01 FINALIZE_SYMTABLE_nested_01: ; preds = %return ret i32 0 } declare void @_lpython_call_initial_functions(i32, i8**) declare void @_lpython_free_argv() lfortran-lfortran-2f73434/tests/reference/ast_f90-do_concurrent_reduce3-fc55bd2.stdout0000664000175000017500000000050315141516316031046 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(*: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(min: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(max: s) s = s + a(i) end do end subroutine sum_reduce lfortran-lfortran-2f73434/tests/reference/c-expr_11-8e5ae80.json0000664000175000017500000000103015141516316024374 0ustar alastairalastair{ "basename": "c-expr_11-8e5ae80", "cmd": "lfortran --no-color --show-c {infile}", "infile": "tests/../integration_tests/expr_11.f90", "infile_hash": "1d3eee7b6af3504909d82d761867baf90d2f74b36edc4a6eac4e341f", "outfile": null, "outfile_hash": null, "stdout": "c-expr_11-8e5ae80.stdout", "stdout_hash": "dd596dbc5192adba6b87e2421cae2cc8c34423c7a3bfda7930d35f92", "stderr": "c-expr_11-8e5ae80.stderr", "stderr_hash": "3982eb2e7c64c27254305941b9a7f4d9f69369c801f76c5dece5e3dd", "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data-modules_44-cd82150.json0000664000175000017500000000105215141516316031442 0ustar alastairalastair{ "basename": "pass_pass_array_by_data-modules_44-cd82150", "cmd": "lfortran --pass=pass_array_by_data --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_44.f90", "infile_hash": "64a0fe18f63bcdea0da398339103b09acfb84dd85285ec15239ea14e", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data-modules_44-cd82150.stdout", "stdout_hash": "331c02864642316522bea5db73c9467965bc4be0d40b78f253069c68", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-array5-2cde105.json0000664000175000017500000000070715141516316024663 0ustar alastairalastair{ "basename": "ast-array5-2cde105", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/array5.f90", "infile_hash": "33d963b417ddd6ec562edf7732f7c595264090883fd4b80011b7a39d", "outfile": null, "outfile_hash": null, "stdout": "ast-array5-2cde105.stdout", "stdout_hash": "d8d454a272d8513cb4631f98108ed86879f616d03bce1e5d92ddeaf3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-program_01-4418962.json0000664000175000017500000000076315141516316025705 0ustar alastairalastair{ "basename": "ast_f90-program_01-4418962", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/../integration_tests/program_01.f90", "infile_hash": "917ed02637c7a6c4e5e5407a0ccf45b4ef6ff79355c5c080e53d97e9", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-program_01-4418962.stdout", "stdout_hash": "1767245198713f882b2140749109ed41af157da8e1982e95a1868f6a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-parameter_without_start_program-a99ac57.json0000664000175000017500000000103115141516316032175 0ustar alastairalastair{ "basename": "ast-parameter_without_start_program-a99ac57", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/parser/parameter_without_start_program.f90", "infile_hash": "2e9169dd781045b7103a73b5edc20a422355169a278a6bf1f7f8323d", "outfile": null, "outfile_hash": null, "stdout": "ast-parameter_without_start_program-a99ac57.stdout", "stdout_hash": "5df73fd7386389919b5b62e9f0083173af9e8f6fd9efb263eba84599", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-array6-d640983.json0000664000175000017500000000072215141516316025215 0ustar alastairalastair{ "basename": "ast_f90-array6-d640983", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/array6.f90", "infile_hash": "bd74956aa588e4b340d6de16fc0b67a51fbf31518393a6cb4e7d2901", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-array6-d640983.stdout", "stdout_hash": "84af996e58fc5ed590391ba06cd18f3d867424266b05f8b182b31dbf", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_05-35150cd.stdout0000664000175000017500000012314615141516316027125 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { derived_type_05: (Program (SymbolTable 13 { }) derived_type_05 [] [] ), derived_types_05_stdlib_string_type: (Module (SymbolTable 2 { new_string: (Function (SymbolTable 4 { new: (Variable 4 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 4 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ) }) new_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 4 string)] [] (Var 4 new) Public .false. .false. () ), new_string_from_integer_int32: (Function (SymbolTable 5 { new: (Variable 5 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 5 val [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_integer_int32 (FunctionType [(Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 5 val)] [] (Var 5 new) Public .false. .false. () ), new_string_from_integer_int64: (Function (SymbolTable 6 { new: (Variable 6 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 6 val [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_integer_int64 (FunctionType [(Integer 8)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 6 val)] [] (Var 6 new) Public .false. .false. () ), new_string_from_logical_lk: (Function (SymbolTable 7 { new: (Variable 7 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 2 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 7 val [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_logical_lk (FunctionType [(Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Interface () .true. .true. .true. .false. .false. [] .false. ) [] [(Var 7 val)] [] (Var 7 new) Public .false. .false. () ), string_type: (Struct (SymbolTable 3 { raw: (Variable 3 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) string_type (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () () ), ~string_type: (GenericProcedure 2 ~string_type [2 new_string 2 new_string_from_integer_int32 2 new_string_from_integer_int64 2 new_string_from_logical_lk] Public ) }) derived_types_05_stdlib_string_type () [] .false. .false. .true. ), stdlib_string_type_constructor: (Module (SymbolTable 8 { new_string: (Function (SymbolTable 9 { new: (Variable 9 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. ), string: (Variable 9 string [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Optional .false. .false. .false. () .false. .false. ) }) new_string (FunctionType [(String 1 () AssumedLength DescriptorString)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 9 string)] [] (Var 9 new) Public .false. .false. () ), new_string_from_integer_int32: (Function (SymbolTable 10 { new: (Variable 10 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 10 val [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_integer_int32 (FunctionType [(Integer 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 10 val)] [] (Var 10 new) Public .false. .false. () ), new_string_from_integer_int64: (Function (SymbolTable 11 { new: (Variable 11 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 11 val [] In () () Default (Integer 8) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_integer_int64 (FunctionType [(Integer 8)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 11 val)] [] (Var 11 new) Public .false. .false. () ), new_string_from_logical_lk: (Function (SymbolTable 12 { new: (Variable 12 new [] ReturnVar () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) 8 string_type Source Public Required .false. .false. .false. () .false. .false. ), val: (Variable 12 val [] In () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) new_string_from_logical_lk (FunctionType [(Logical 4)] (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) Source Implementation () .true. .false. .true. .false. .false. [] .false. ) [] [(Var 12 val)] [] (Var 12 new) Public .false. .false. () ), string_type: (ExternalSymbol 8 string_type 2 string_type derived_types_05_stdlib_string_type [] string_type Public ), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type derived_types_05_stdlib_string_type [] ~string_type Public ) }) stdlib_string_type_constructor derived_types_05_stdlib_string_type [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-expr1-e0e6d6b.stdout0000664000175000017500000000017615141516316025156 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 5 (Integer 4) Decimal)] ) lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_03-e127d69.json0000664000175000017500000000100115141516316030145 0ustar alastairalastair{ "basename": "ast-program_without_line_03-e127d69", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/errors/program_without_line_03.f90", "infile_hash": "7f24b4f0125a80a40ddb1a2d400619fe7762e4b6f9ef34337b19964f", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "ast-program_without_line_03-e127d69.stderr", "stderr_hash": "ae510b2f7bc81b4d0514bd7324e09fb2de2c85892cc529293c7f3154", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-subroutines_04-a817e0c.stdout0000664000175000017500000000752415141516316026725 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_it: (Program (SymbolTable 2 { print_int: (Function (SymbolTable 3 { a: (Variable 3 a [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_int (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 3 a) (IntegerConstant 5 (Integer 4) Decimal) () .false. .false. ) (Print (StringFormat () [(Var 3 a)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] () Public .false. .false. () ) }) print_it [] [(SubroutineCall 2 print_int () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr_preprocess-unterminated_comment_01-a351b61.stderr0000664000175000017500000000023615141516316032712 0ustar alastairalastairC preprocessor error: Unterminated comment --> tests/errors/unterminated_comment_01.f90:3:8 | 3 | #endif /* unterminated comment starts here | ^ lfortran-lfortran-2f73434/tests/reference/ast-format_02-1ba2faf.stdout0000664000175000017500000000207315141516316025757 0ustar alastairalastair(TranslationUnit [(Program format_02 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(i6 [] [] () () None ()) (format [(1 3 DimensionExpr)] [] () () None ())] () )] [(Assignment 0 i6 2 () ) (Assignment 0 (FuncCallOrArray format [] [(() i6 () 0)] [] [] [] ) 3 () ) (Format 1 "i6" () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-private2-d3a4771.json0000664000175000017500000000072415141516316025140 0ustar alastairalastair{ "basename": "asr-private2-d3a4771", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/private2.f90", "infile_hash": "34984962bf015cefb96abba7000799bbabd4618eb80e4484fb5ca4bd", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-private2-d3a4771.stderr", "stderr_hash": "98341ad40f302acd14f7188319321a9b5a620c529f9ce700ff28c1a3", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/julia-block_03-cf8537e.json0000664000175000017500000000073315141516316025411 0ustar alastairalastair{ "basename": "julia-block_03-cf8537e", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/block_03.f90", "infile_hash": "3271e019be3575ad1c8280a5b50d7fccb0534f39241680ad66e6bc50", "outfile": null, "outfile_hash": null, "stdout": "julia-block_03-cf8537e.stdout", "stdout_hash": "dc1a8b68264dd9da21563f4ce401332633d1142fec545c6381da785c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-int_01-72c2ff1.json0000664000175000017500000000073415141516316024557 0ustar alastairalastair{ "basename": "asr-int_01-72c2ff1", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/int_01.f90", "infile_hash": "766d63f0b9cf518eb398acd6ceff8d8856637959cc0bf1890b03c89d", "outfile": null, "outfile_hash": null, "stdout": "asr-int_01-72c2ff1.stdout", "stdout_hash": "ad7a313ab20bce7910c44b0c82cb3a4eda649fcf2d32879fea21f7ad", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-reserved_01-566a18c.stdout0000664000175000017500000000060615141516316026556 0ustar alastairalastairprogram reserved_01 implicit none if (end(1, 2) /= 2) then error stop end if if (end(2, 1) /= 2) then error stop end if contains integer function end(return, integer) result(function); ; ; ; integer :: integer, return; ; ; ; ; ; ; ; function = return; if (return > integer) then return end if; ; ; ; ; function = integer; ; end function end; ; ; ; end program reserved_01 lfortran-lfortran-2f73434/tests/reference/cpp-doloop_08-cf3820d.json0000664000175000017500000000073015141516316025260 0ustar alastairalastair{ "basename": "cpp-doloop_08-cf3820d", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/doloop_08.f90", "infile_hash": "aa25755d672851ca060c0f7c42329e8ecb0444f7a037df60d525af51", "outfile": null, "outfile_hash": null, "stdout": "cpp-doloop_08-cf3820d.stdout", "stdout_hash": "e5f10e195d3811512cfb841d70331a7a897ff20972582e2f72b1aa03", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-derived_types_06-847ca73.json0000664000175000017500000000074515141516316026570 0ustar alastairalastair{ "basename": "asr-derived_types_06-847ca73", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/derived_types_06.f90", "infile_hash": "79e9585ecc476ad45f2a511049814969a07a1fd17d61eb8f49f59f64", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-847ca73.stdout", "stdout_hash": "5c3e758357e2e2238e33ba715737f83f18d28380b645cf55b612e542", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-global_scope4-1af6ab9.json0000664000175000017500000000073415141516316026261 0ustar alastairalastair{ "basename": "asr-global_scope4-1af6ab9", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/global_scope4.f90", "infile_hash": "da0256e95ad866af376d9ded3cd439463cb1e47dffac6aa88c0bbadf", "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope4-1af6ab9.stdout", "stdout_hash": "dae42d6fff20f530f2b8507f6fae1d263380d0b3913c69b6fb27bd2a", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-subroutine6-b93ebd0.json0000664000175000017500000000071115141516316026020 0ustar alastairalastair{ "basename": "cpp-subroutine6-b93ebd0", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/subroutine6.f90", "infile_hash": "1987bc648e7f4c6205190248a296d000e0f33cb57a996b6c2a6c4804", "outfile": null, "outfile_hash": null, "stdout": "cpp-subroutine6-b93ebd0.stdout", "stdout_hash": "69692d04601469d0f06a1fb96d6da8103496de4040382eca2206dbf9", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.jsonlfortran-lfortran-2f73434/tests/reference/asr-array_constructor_with_asterisk_in_type_spec-24efd03.j0000664000175000017500000000110015141516316034212 0ustar alastairalastair{ "basename": "asr-array_constructor_with_asterisk_in_type_spec-24efd03", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/array_constructor_with_asterisk_in_type_spec.f90", "infile_hash": "32cd88de1530bbe18208a1999a4a3eb975c5e679d7a5f417966d2507", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-array_constructor_with_asterisk_in_type_spec-24efd03.stderr", "stderr_hash": "a54c91b46642660539c1dc2e3abfad83c7c1b128c15b0bbcbec31518", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/llvm-nested_03-2eacab7.json0000664000175000017500000000075015141516316025566 0ustar alastairalastair{ "basename": "llvm-nested_03-2eacab7", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/nested_03.f90", "infile_hash": "690c7461fd0cb288a4f72f5fd09663a777ae1ba9f4a39dfdc5727c36", "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_03-2eacab7.stdout", "stdout_hash": "a0b8bea3f34d8bc8e7c7284133c963361700beab1aad58d1c96f3841", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-incorrect_array_type_where_01-b613ee3.stderr0000664000175000017500000000031315141516316031727 0ustar alastairalastairsemantic error: the first array argument to `where` must be of type logical --> tests/errors/incorrect_array_type_where_01.f90:5:10 | 5 | where([1, 2, 3, 4, 5]) b = 1 | ^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/run-array16-b6f006f.json0000664000175000017500000000066215141516316024770 0ustar alastairalastair{ "basename": "run-array16-b6f006f", "cmd": "lfortran --no-color {infile}", "infile": "tests/array16.f90", "infile_hash": "dce0c722304d803515ce62f5177a5d6e6bb748f800cbfbd8cb90f9bb", "outfile": null, "outfile_hash": null, "stdout": "run-array16-b6f006f.stdout", "stdout_hash": "cd2eadef20041913d0b95e4c142d983932f1379d483b02b6f1764682", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-scalar_allocation_check_04-024d591.json0000664000175000017500000000076215141516316030455 0ustar alastairalastair{ "basename": "run-scalar_allocation_check_04-024d591", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/scalar_allocation_check_04.f90", "infile_hash": "4e99063a92f0acb60e7d3a84548c218f7c962ff15af9f4b29f819eb3", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-scalar_allocation_check_04-024d591.stderr", "stderr_hash": "1ea4239de1dd1e0ff756575a07829f176df9d40008cdf2df03dc2255", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/llvm-types_05-aa71aa9.json0000664000175000017500000000074515141516316025376 0ustar alastairalastair{ "basename": "llvm-types_05-aa71aa9", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/types_05.f90", "infile_hash": "96f8e950abafbc42b9d0438efdca0a8355bb2bd7b4b168ee23063521", "outfile": null, "outfile_hash": null, "stdout": "llvm-types_05-aa71aa9.stdout", "stdout_hash": "4f54beeb28d9295aa2783e992b04ceefa824ba29c3cc673228322833", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics_334-6d740cf.stdout0000664000175000017500000011163115141516316026616 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { intrinsics_334: (Program (SymbolTable 2 { 1_toml_value_x: (ExternalSymbol 2 1_toml_value_x 4 x toml_value [] x Public ), base: (Struct (SymbolTable 3 { id: (Variable 3 id [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) base (StructType [(Integer 4)] [] .true. .false. ) [] [id] [] Source Public .false. .true. [] () () ), from: (Variable 2 from [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), struct_from: (Variable 2 struct_from [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .true. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), struct_from2: (Variable 2 struct_from2 [] Local () () Default (Allocatable (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), struct_from3: (Variable 2 struct_from3 [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .false. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), struct_to: (Variable 2 struct_to [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .true. .false. ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), struct_to2: (Variable 2 struct_to2 [] Local () () Default (Allocatable (Array (StructType [(Integer 4)] [] .true. .false. ) [(() ())] DescriptorArray ) ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ), struct_to3: (Variable 2 struct_to3 [] Local () () Default (Allocatable (StructType [(Integer 4)] [] .false. .false. ) ) 2 base Source Public Required .false. .false. .false. () .false. .false. ), to: (Variable 2 to [] Local () () Default (Allocatable (Array (Integer 4) [(() ())] DescriptorArray ) ) () Source Public Required .false. .false. .false. () .false. .false. ), toml_value: (Struct (SymbolTable 4 { x: (Variable 4 x [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_value (StructType [(Integer 4)] [] .true. .false. ) [] [x] [] Source Public .false. .false. [] () 2 base ), ~select_type_block_: (Block (SymbolTable 5 { 1_toml_value_x: (ExternalSymbol 5 1_toml_value_x 4 x toml_value [] x Public ) }) ~select_type_block_ [(If () (IntegerCompare (StructInstanceMember (Var 2 struct_to3) 5 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 123 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_1: (Block (SymbolTable 6 { 1_toml_value_x: (ExternalSymbol 6 1_toml_value_x 4 x toml_value [] x Public ) }) ~select_type_block_1 [(If () (IntegerCompare (StructInstanceMember (Var 2 struct_to3) 6 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 42 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] ), ~select_type_block_2: (Block (SymbolTable 7 { }) ~select_type_block_2 [(ErrorStop () )] ) }) intrinsics_334 [] [(Allocate [((Var 2 from) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (Assignment (Var 2 from) (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Allocate [((Var 2 to) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] () () ())] () () () ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 from) (Var 2 to)] 0 ) (Print (StringFormat () [(Var 2 to)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (IntrinsicArrayFunction Any [(IntegerCompare (Var 2 to) NotEq (ArrayConstant 20 [1, 2, 3, 4, 5] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 5 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Logical 4) [(() ())] DescriptorArray ) () )] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (Print (StringFormat () [(IntrinsicImpureFunction Allocated [(Var 2 from)] 0 (Logical 4) () )] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (IntrinsicImpureFunction Allocated [(Var 2 from)] 0 (Logical 4) () ) NEqv (LogicalConstant .false. (Logical 4) ) (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 struct_from) [] () () ())] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from) (Var 2 struct_to)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_to)] 0 (Logical 4) () ) [(If () (IntegerCompare (StructInstanceMember (Var 2 struct_to) 2 1_toml_value_x (Integer 4) () ) NotEq (IntegerConstant 42 (Integer 4) Decimal) (Logical 4) () ) [(ErrorStop () )] [] )] [(ErrorStop () )] ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (Allocate [((Var 2 struct_from2) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ())] () () () ) (DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) ()) [(Assignment (StructInstanceMember (ArrayItem (Var 2 struct_from2) [(() (Var 2 i) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 2 1_toml_value_x (Integer 4) () ) (IntegerBinOp (Var 2 i) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) () .false. .false. )] [] ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from2) (Var 2 struct_to2)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from2)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_to2)] 0 (Logical 4) () ) [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 2 struct_to2) () (Integer 4) () ) ()) [(If () (IntegerCompare (StructInstanceMember (ArrayItem (Var 2 struct_to2) [(() (Var 2 i) ())] (StructType [(Integer 4)] [] .true. .false. ) ColMajor () ) 2 1_toml_value_x (Integer 4) () ) NotEq (IntegerBinOp (Var 2 i) Mul (IntegerConstant 10 (Integer 4) Decimal) (Integer 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] [] )] [(ErrorStop () )] ) (Allocate [((Var 2 struct_from3) [] () 2 toml_value (StructType [(Integer 4)] [] .true. .false. ))] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from3) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 123 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from3) (Var 2 struct_to3)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from3)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (SelectType (Var 2 struct_to3) () [(TypeStmtName 2 toml_value [(BlockCall -1 2 ~select_type_block_ )] )] [] ) (Allocate [((Var 2 struct_from) [] () () ())] () () () ) (Assignment (StructInstanceMember (Var 2 struct_from) 2 1_toml_value_x (Integer 4) () ) (IntegerConstant 42 (Integer 4) Decimal) () .false. .false. ) (IntrinsicImpureSubroutine MoveAlloc [(Var 2 struct_from) (Var 2 struct_to3)] 0 ) (If () (IntrinsicImpureFunction Allocated [(Var 2 struct_from)] 0 (Logical 4) () ) [(ErrorStop () )] [] ) (SelectType (Var 2 struct_to3) () [(TypeStmtName 2 toml_value [(BlockCall -1 2 ~select_type_block_1 )] )] [(BlockCall -1 2 ~select_type_block_2 )] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-end_sub_name-b8abc97.stderr0000664000175000017500000000036515141516316026523 0ustar alastairalastairsyntax error: End subroutine name does not match subroutine name --> tests/errors/end_sub_name.f90:1:1 - 7:22 | 1 | subroutine swap(x, y) | ^^^^^^^^^^^^^^^^^^^^^... ... | 7 | end subroutine reverse | ...^^^^^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-interface_05-5639d22.json0000664000175000017500000000075615141516316025601 0ustar alastairalastair{ "basename": "asr-interface_05-5639d22", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_05.f90", "infile_hash": "a6509198926e454d1aa09c90a70bf6760452f8ed5923cebde47a166f", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_05-5639d22.stdout", "stdout_hash": "7e762832bece4a2172d508374ed0b1e0351ebcb81ffbaf24985266e3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-line_continuation_01-17bec82.json0000664000175000017500000000100615141516316027502 0ustar alastairalastair{ "basename": "ast-line_continuation_01-17bec82", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/line_continuation_01.f90", "infile_hash": "2a3deedd84166a5c17971c7072fd910ec8e0ef6830db82f44f19a430", "outfile": null, "outfile_hash": null, "stdout": "ast-line_continuation_01-17bec82.stdout", "stdout_hash": "a646d1b0ab9cfa9627568937763dec1602a56de0bd2d945de144bc73", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-call1-ae0bbbd.json0000664000175000017500000000073215141516316024666 0ustar alastairalastair{ "basename": "ast-call1-ae0bbbd", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixed_form/call1.f", "infile_hash": "1a410f5dd9da71aa4f4cc221b229a0c01746d7bf0b414facc7fcf202", "outfile": null, "outfile_hash": null, "stdout": "ast-call1-ae0bbbd.stdout", "stdout_hash": "736a094b443b0315b39fa3fdccbdd106da08af7beff755ef3abd78f7", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-matrix_matmul_04-90da47c.json0000664000175000017500000000075415141516316026656 0ustar alastairalastair{ "basename": "asr-matrix_matmul_04-90da47c", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/errors/matrix_matmul_04.f90", "infile_hash": "38edd0d6e98b512c930dbab4f7f9ea5105e907a6a21c64315a0bbd50", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "asr-matrix_matmul_04-90da47c.stderr", "stderr_hash": "28ff92dfbfe961c9d2241688ba8b7152296287813291c6805dbf75e7", "returncode": 2 }lfortran-lfortran-2f73434/tests/reference/asr-template_03b-0778e50.stdout0000664000175000017500000035212715141516316026170 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { template_03: (Program (SymbolTable 2 { axpy_tmpl: (Template (SymbolTable 5 { axpy: (Function (SymbolTable 8 { a: (Variable 8 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 8 x [] In () () Default (Array (TypeParameter u ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 8 y [] InOut () () Default (Array (TypeParameter v ) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy (FunctionType [(TypeParameter t ) (Array (TypeParameter u ) [(() ())] DescriptorArray ) (Array (TypeParameter v ) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [times plus] [(Var 8 a) (Var 8 x) (Var 8 y)] [(Assignment (Var 8 y) (FunctionCall 5 plus () [((Var 8 y)) ((FunctionCall 5 times () [((Var 8 a)) ((Var 8 x))] (Array (TypeParameter w ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ))] (Array (TypeParameter v ) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 8 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ) () .false. .false. )] () Public .false. .false. () ), plus: (Function (SymbolTable 6 { a: (Variable 6 a [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 6 b [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 6 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) plus (FunctionType [(TypeParameter v ) (TypeParameter w )] (TypeParameter v ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 a) (Var 6 b)] [] (Var 6 op) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), times: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 7 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 7 op [] ReturnVar () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ) }) times (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter w ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 7 a) (Var 7 b)] [] (Var 7 op) Public .false. .false. () ), u: (Variable 5 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 5 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ), w: (Variable 5 w [] In () () Default (TypeParameter w ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy_tmpl [t u v w plus times] [(Require op [v w plus] ) (Require op [t u w times] )] ), f: (Function (SymbolTable 12 { a: (Variable 12 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), axpy: (Function (SymbolTable 15 { a: (Variable 15 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 15 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 15 y [] InOut () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [~mul_intrinsic ~add_intrinsic] [(Var 15 a) (Var 15 x) (Var 15 y)] [(Assignment (Var 15 y) (FunctionCall 12 ~add_intrinsic () [((Var 15 y)) ((FunctionCall 12 ~mul_intrinsic () [((Var 15 a)) ((Var 15 x))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 15 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] PointerArray ) () () ) () .false. .false. )] () Public .false. .false. () ), dp: (Variable 12 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 12 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 12 x [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 12 y [] Local () () Default (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), ~add: (CustomOperator 12 ~add [12 ~add_intrinsic] Public ), ~add_intrinsic: (Function (SymbolTable 13 { arg0: (Variable 13 arg0 [] In () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 13 arg1 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 13 ret [] ReturnVar () () Default (Real 8) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~add_intrinsic (FunctionType [(Real 8) (Real 4)] (Real 8) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 13 arg0) (Var 13 arg1)] [(Assignment (Var 13 ret) (RealBinOp (Var 13 arg0) Add (Cast (Var 13 arg1) RealToReal (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 13 ret) Public .false. .true. () ), ~mul: (CustomOperator 12 ~mul [12 ~mul_intrinsic] Public ), ~mul_intrinsic: (Function (SymbolTable 14 { arg0: (Variable 14 arg0 [] In () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ), arg1: (Variable 14 arg1 [] In () () Default (Integer 4) () Source Private Required .false. .false. .false. () .false. .false. ), ret: (Variable 14 ret [] ReturnVar () () Default (Real 4) () Source Private Required .false. .false. .false. () .false. .false. ) }) ~mul_intrinsic (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 14 arg0) (Var 14 arg1)] [(Assignment (Var 14 ret) (RealBinOp (Var 14 arg0) Mul (Cast (Var 14 arg1) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 14 ret) Public .false. .true. () ) }) f (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Assignment (Var 12 a) (RealConstant 0.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 12 x) (ArrayBroadcast (IntegerConstant 2 (Integer 4) Decimal) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 12 [2, 2, 2] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (Assignment (Var 12 y) (ArrayBroadcast (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 2.000000 (Real 8) ) ) (ArrayConstant 4 [3] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) (ArrayConstant 24 [2.0000000000000000e+00, 2.0000000000000000e+00, 2.0000000000000000e+00] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) ) () .false. .false. ) (SubroutineCall 12 axpy () [((Var 12 a)) ((ArrayPhysicalCast (Var 12 x) FixedSizeArray DescriptorArray (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () )) ((ArrayPhysicalCast (Var 12 y) FixedSizeArray DescriptorArray (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] DescriptorArray ) () ))] () .false. )] () Public .false. .false. () ), my_add: (Function (SymbolTable 10 { a: (Variable 10 a [] In () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 10 b [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 10 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 10 op [] ReturnVar () () Default (Real 8) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 10 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_add (FunctionType [(Real 8) (Real 4)] (Real 8) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 10 a) (Var 10 b)] [(Assignment (Var 10 op) (RealBinOp (Var 10 a) Add (Cast (Var 10 b) RealToReal (Real 8) () ) (Real 8) () ) () .false. .false. )] (Var 10 op) Public .false. .false. () ), my_axpy: (Function (SymbolTable 11 { a: (Variable 11 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), dp: (Variable 11 dp [] Local (TypeInquiry Kind (Real 8) (RealConstant 1.000000 (Real 8) ) (Integer 4) (IntegerConstant 8 (Integer 4) Decimal) ) (IntegerConstant 8 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 11 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), x: (Variable 11 x [] In () () Default (Array (Integer 4) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ), y: (Variable 11 y [] InOut () () Default (Array (Real 8) [(() ())] DescriptorArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_axpy (FunctionType [(Real 4) (Array (Integer 4) [(() ())] DescriptorArray ) (Array (Real 8) [(() ())] DescriptorArray )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [my_mul my_add] [(Var 11 a) (Var 11 x) (Var 11 y)] [(Assignment (Var 11 y) (FunctionCall 2 my_add () [((Var 11 y)) ((FunctionCall 2 my_mul () [((Var 11 a)) ((Var 11 x))] (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 11 x) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ))] (Array (Real 8) [((IntegerConstant 1 (Integer 4) Decimal) (ArraySize (Var 11 y) (IntegerConstant 1 (Integer 4) Decimal) (Integer 4) () ))] DescriptorArray ) () () ) () .false. .false. )] () Public .false. .false. () ), my_mul: (Function (SymbolTable 9 { a: (Variable 9 a [] In () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 9 b [] In () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 9 op [] ReturnVar () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), sp: (Variable 9 sp [] Local (TypeInquiry Kind (Real 4) (RealConstant 1.000000 (Real 4) ) (Integer 4) (IntegerConstant 4 (Integer 4) Decimal) ) (IntegerConstant 4 (Integer 4) Decimal) Parameter (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) my_mul (FunctionType [(Real 4) (Integer 4)] (Real 4) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [] [(Var 9 a) (Var 9 b)] [(Assignment (Var 9 op) (RealBinOp (Var 9 a) Mul (Cast (Var 9 b) IntegerToReal (Real 4) () ) (Real 4) () ) () .false. .false. )] (Var 9 op) Public .false. .false. () ), op: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { a: (Variable 4 a [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 4 b [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), op: (Variable 4 op [] ReturnVar () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter u )] (TypeParameter v ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 4 a) (Var 4 b)] [] (Var 4 op) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. .false. .false. () .false. .false. ), u: (Variable 3 u [] In () () Default (TypeParameter u ) () Source Public Required .false. .false. .false. () .false. .false. ), v: (Variable 3 v [] In () () Default (TypeParameter v ) () Source Public Required .false. .false. .false. () .false. .false. ) }) op [t u v op] [] ) }) template_03 [] [(SubroutineCall 2 f () [] () .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-string_01-bda4726.stdout0000664000175000017500000000446015141516316025643 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { print_01: (Program (SymbolTable 2 { my_name: (Variable 2 my_name [] Local (StringConstant "Dominic" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (StringConstant "Dominic" (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) ) Save (String 1 (IntegerConstant 7 (Integer 4) Decimal) ExpressionLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ) }) print_01 [] [(Print (StringFormat () [(StringConstant "My name is " (String 1 (IntegerConstant 11 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 my_name)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/asr-transfer_09-a440034.stdout0000664000175000017500000004622215141516316026021 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { transfer_09: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), b: (Variable 2 b [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), c: (Variable 2 c [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ), lhs: (Variable 2 lhs [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), r1: (Variable 2 r1 [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ), rhs: (Variable 2 rhs [] Local () () Default (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () Source Public Required .false. .false. .false. () .false. .false. ) }) transfer_09 [] [(Assignment (Var 2 rhs) (ArrayConstant 12 [10, 20, 30] (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) ColMajor ) () .false. .false. ) (Assignment (Var 2 a) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 a) () (Real 4) () ) () .false. .false. ) (Assignment (Var 2 b) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 b) () (Real 4) () ) () .false. .false. ) (Assignment (Var 2 c) (BitCast (ArrayItem (Var 2 rhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Var 2 c) () (Real 4) () ) () .false. .false. ) (Assignment (ArraySection (Var 2 r1) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Real 4) [(() ())] DescriptorArray ) () ) (BitCast (Var 2 rhs) (Var 2 r1) () (Array (Real 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Assignment (ArraySection (Var 2 lhs) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal) (IntegerConstant 1 (Integer 4) Decimal))] (Array (Integer 4) [(() ())] DescriptorArray ) () ) (BitCast (Var 2 rhs) (Var 2 lhs) () (Array (Integer 4) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] FixedSizeArray ) () ) () .false. .false. ) (Print (StringFormat () [(StringConstant "Correct Values" (String 1 (IntegerConstant 14 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 rhs) (Var 2 a) (Var 2 b) (Var 2 c)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (Print (StringFormat () [(StringConstant "Transferred Values" (String 1 (IntegerConstant 18 (Integer 4) Decimal) ExpressionLength DescriptorString) ) (Var 2 lhs) (Var 2 r1)] FormatFortran (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) ) (If () (LogicalBinOp (LogicalBinOp (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) Or (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) Or (IntegerCompare (ArrayItem (Var 2 lhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) NotEq (ArrayItem (Var 2 rhs) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Integer 4) ColMajor () ) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] ) (If () (LogicalBinOp (LogicalBinOp (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 1 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 a) (Logical 4) () ) Or (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 2 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 b) (Logical 4) () ) (Logical 4) () ) Or (RealCompare (ArrayItem (Var 2 r1) [(() (IntegerConstant 3 (Integer 4) Decimal) ())] (Real 4) ColMajor () ) NotEq (Var 2 c) (Logical 4) () ) (Logical 4) () ) [(ErrorStop () )] [] )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-include_01-55ce778.json0000664000175000017500000000075015141516316025345 0ustar alastairalastair{ "basename": "ast-include_01-55ce778", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/include_01.f90", "infile_hash": "ba2b458982cee4e8d6b9f14773bf7d3121b4e6efc4b978ea9ceb4459", "outfile": null, "outfile_hash": null, "stdout": "ast-include_01-55ce778.stdout", "stdout_hash": "1e0dba7fbf0747a1db87686a815b628bd2c6d52b45882d51bfad8416", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-subroutines_03-9a95e25.json0000664000175000017500000000076415141516316026307 0ustar alastairalastair{ "basename": "ast-subroutines_03-9a95e25", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/subroutines_03.f90", "infile_hash": "432c4d3eb84ddddcc76b5371ed559a4688bf1e31676bb7e14c2aa3cf", "outfile": null, "outfile_hash": null, "stdout": "ast-subroutines_03-9a95e25.stdout", "stdout_hash": "5e7f70a6ebdee01f46f90d984e09f330fe85044ed5d493cab4365d98", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm_main_program-7a34895.json0000664000175000017500000000073315141516316027046 0ustar alastairalastair{ "basename": "wat-wasm_main_program-7a34895", "cmd": "lfortran --no-color --show-wat {infile}", "infile": "tests/wasm_main_program.f90", "infile_hash": "ab8926c68ae35c9f50cf6a99dd6afaf843e3439d51645de08baebead", "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_main_program-7a34895.stdout", "stdout_hash": "a7508a90bd07a2ef1e5d18fa0c05221e91c752cdbaf22e3d55b317dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/wat-wasm_main_program-7a34895.stdout0000664000175000017500000002250715141516316027422 0ustar alastairalastair(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i32 i32 i32 i32) (result i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param) (result))) (type (;4;) (func (param i64) (result))) (type (;5;) (func (param f64) (result))) (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) (global $0 (mut i32) (i32.const 0)) (global $1 (mut i32) (i32.const 0)) (global $2 (mut i32) (i32.const 0)) (global $3 (mut i64) (i64.const 0)) (global $4 (mut i64) (i64.const 0)) (global $5 (mut f32) (f32.const 0.000000)) (global $6 (mut f32) (f32.const 0.000000)) (global $7 (mut f64) (f64.const 0.000000)) (global $8 (mut f64) (f64.const 0.000000)) (func $2 (type 2) (param i32) (result i32) (local i32) local.get 0 local.get 0 i32.mul local.set 1 local.get 1 return ) (func $3 (type 3) (param) (result) (local i32 f32 i32 f32 i32 f32) i32.const 3 local.set 2 i32.const 5 local.set 4 local.get 2 local.get 4 call 2 i32.mul local.set 0 local.get 0 i64.extend_i32_s call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop f32.const 3.140000 local.set 3 f32.const 5.000000 local.set 5 local.get 3 local.get 5 f32.mul local.get 5 f32.mul local.set 1 local.get 1 f64.promote_f32 call 5 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 208 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 5 f64.promote_f32 call 5 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 4 i64.extend_i32_s call 4 i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 240 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop local.get 1 f64.promote_f32 call 5 i32.const 1 i32.const 4 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 264 i32.const 1 i32.const 0 call 1 drop i32.const 1 i32.const 16 i32.const 1 i32.const 0 call 1 drop i32.const 0 call 0 return ) (func $4 (type 4) (param i64) (result) (local i64 i64 i64 i64) local.get 0 i64.const 0 i64.eq if i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop return else end local.get 0 i64.const 0 i64.lt_s if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 i64.const -1 i64.mul local.set 0 else end local.get 0 local.set 4 i64.const 0 local.set 1 loop local.get 0 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 0 i64.const 10 i64.div_s local.set 0 br 1 else end end loop local.get 1 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.sub local.set 1 i64.const 1 local.set 2 i64.const 0 local.set 3 loop local.get 3 local.get 1 i64.lt_s if local.get 3 i64.const 1 i64.add local.set 3 local.get 2 i64.const 10 i64.mul local.set 2 br 1 else end end local.get 4 local.get 2 i64.div_s i64.const 10 i64.rem_s i64.const 12 i64.mul i64.const 88 i64.add local.set 0 i32.const 1 local.get 0 i32.wrap_i64 i32.const 1 i32.const 0 call 1 drop br 1 else end end return ) (func $5 (type 5) (param f64) (result) (local i64 i64 i64) local.get 0 f64.const 0.000000 f64.lt if i32.const 1 i32.const 28 i32.const 1 i32.const 0 call 1 drop local.get 0 f64.const -1.000000 f64.mul local.set 0 else end local.get 0 i64.trunc_f64_s call 4 i32.const 1 i32.const 40 i32.const 1 i32.const 0 call 1 drop local.get 0 local.get 0 i64.trunc_f64_s f64.convert_i64_s f64.sub f64.const 100000000.000000 f64.mul i64.trunc_f64_s local.set 2 local.get 2 local.set 3 i64.const 0 local.set 1 loop local.get 2 i64.const 0 i64.gt_s if local.get 1 i64.const 1 i64.add local.set 1 local.get 2 f64.convert_i64_s i64.const 10 f64.convert_i64_s f64.div i64.trunc_f64_s local.set 2 br 1 else end end loop local.get 1 i64.const 8 i64.lt_s if local.get 1 i64.const 1 i64.add local.set 1 i32.const 1 i32.const 88 i32.const 1 i32.const 0 call 1 drop br 1 else end end local.get 3 call 4 return ) (memory (;0;) 1000 1000) (export "memory" (memory 0)) (export "sqr" (func 2)) (export "_start" (func 3)) (export "print_i64" (func 4)) (export "print_f64" (func 5)) (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") (data (;1;) (i32.const 12) " ") (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") (data (;3;) (i32.const 24) "\n ") (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") (data (;5;) (i32.const 36) "- ") (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") (data (;7;) (i32.const 48) ". ") (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") (data (;9;) (i32.const 60) "( ") (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") (data (;11;) (i32.const 72) ") ") (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") (data (;13;) (i32.const 84) ", ") (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") (data (;15;) (i32.const 96) "0 ") (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") (data (;17;) (i32.const 108) "1 ") (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") (data (;19;) (i32.const 120) "2 ") (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") (data (;21;) (i32.const 132) "3 ") (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") (data (;23;) (i32.const 144) "4 ") (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") (data (;25;) (i32.const 156) "5 ") (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") (data (;27;) (i32.const 168) "6 ") (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") (data (;29;) (i32.const 180) "7 ") (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") (data (;31;) (i32.const 192) "8 ") (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") (data (;33;) (i32.const 204) "9 ") (data (;34;) (i32.const 208) "\d8\00\00\00\17\00\00\00") (data (;35;) (i32.const 216) "radius of the circle is ") (data (;36;) (i32.const 240) "\f8\00\00\00\0f\00\00\00") (data (;37;) (i32.const 248) "and its area is ") (data (;38;) (i32.const 264) "\10\01\00\00\04\00\00\00") (data (;39;) (i32.const 272) "cm^2") ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_18-e69cac3.json0000664000175000017500000000077215141516316026730 0ustar alastairalastair{ "basename": "asr-derived_types_18-e69cac3", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/derived_types_18.f90", "infile_hash": "fe7b84ad65fd65a338c06a92b43e05adbdbc69fa945465295f9aefb7", "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_18-e69cac3.stdout", "stdout_hash": "c1ba63b6c1770c4c11733f10f3e8f585401f29f6e596bf3244fb8f81", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-auxiliary_IO_1-36af6ad.stdout0000664000175000017500000000240215141516316026730 0ustar alastairalastair(TranslationUnit [(Subroutine xub [(nunit)] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () () None ) [] [(nunit [] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [] [(i [] [] () () None ())] () )] [(DoLoop 0 () 0 i 1 5 () [(Backspace 0 [nunit] [] () ) (Rewind 0 [nunit] [] () )] () () )] [] [] ) (Program main () [] [] [] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/llvm-global_scope3-00a245c.json0000664000175000017500000000073715141516316026275 0ustar alastairalastair{ "basename": "llvm-global_scope3-00a245c", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/global_scope3.f90", "infile_hash": "60cea65abfbb2228d16f175ea192462ae2379d7a9da1601cb3de9f3a", "outfile": null, "outfile_hash": null, "stdout": "llvm-global_scope3-00a245c.stdout", "stdout_hash": "7d7c57dfea185cc25e782c505ddd12f1950411f14296e41bbb09b6a5", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-array_bounds_check_07-f220d33.json0000664000175000017500000000074315141516316027550 0ustar alastairalastair{ "basename": "run-array_bounds_check_07-f220d33", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/array_bounds_check_07.f90", "infile_hash": "e41af0e94a994140f23d1bec748d4d21d0762f8500b3fa0ef54e18ca", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-array_bounds_check_07-f220d33.stderr", "stderr_hash": "f0090c75b102763367c0dc885bd562a83402dd2db09935ab051b3431", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/fortran-expr5-3a279bb.json0000664000175000017500000000072015141516316025410 0ustar alastairalastair{ "basename": "fortran-expr5-3a279bb", "cmd": "lfortran --show-fortran --no-color {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "fortran-expr5-3a279bb.stdout", "stdout_hash": "01e46e3df753a89e5a8a3a918a3cc4ab862b85e839c8ac5b078cf896", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-loop_test5-d27e6d6.stdout0000664000175000017500000000151515141516316026142 0ustar alastairalastair(TranslationUnit [(Subroutine f [] [] () () [] [] [] [] [(DoLoop 0 () 1 i 1 n () [(DoLoop 0 () 1 j 1 n () [(Continue 1 () )] () () )] () () ) (DoLoop 0 () 2 i 1 n () [(Continue 2 () )] () () )] [] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-fn_call1-fcd6b9c.stdout0000664000175000017500000000027515141516316026343 0ustar alastairalastairsize(tvec, dim=2) min(tvec(2, i), tvec(1, i)) a(1, 2, 3) f(a, b, d=5/2, c=3 + 3) A(i, j, k) X(i) X(:) X(a:) X(:b) X(a:b) X(::c) X(::c) X(a::c) X(a::c) X(:b:c) X(a:b:c) X(a:b, ::c, a:, a::c)lfortran-lfortran-2f73434/tests/reference/run-format4-aaf60f4.stderr0000664000175000017500000000012515141516316025461 0ustar alastairalastairRuntime Error : Got argument of type (CHARACTER), while the format specifier is (I) lfortran-lfortran-2f73434/tests/reference/julia-arrays_01-81f01a2.stdout0000664000175000017500000000247015141516316026065 0ustar alastairalastairfunction main() local a::Array{Int32, 1} local b::Array{Int32, 1} local i::Int32 for i ∈ 1:3 a[i] = i + 10 end if a[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if a[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if a[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 11:14 b[i - 10] = i end if b[1] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 12 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 13 println(Base.stderr, "ERROR STOP") exit(1) end if b[4] ≠ 14 println(Base.stderr, "ERROR STOP") exit(1) end for i ∈ 1:3 b[i] = a[i] - 10 end if b[1] ≠ 1 println(Base.stderr, "ERROR STOP") exit(1) end if b[2] ≠ 2 println(Base.stderr, "ERROR STOP") exit(1) end if b[3] ≠ 3 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = b[1] + b[2] + b[3] + a[1] if b[4] ≠ 17 println(Base.stderr, "ERROR STOP") exit(1) end b[4] = a[1] if b[4] ≠ 11 println(Base.stderr, "ERROR STOP") exit(1) end end main() lfortran-lfortran-2f73434/tests/reference/ast-fixedform_doloop2-16b2c78.json0000664000175000017500000000076315141516316027034 0ustar alastairalastair{ "basename": "ast-fixedform_doloop2-16b2c78", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/fixedform_doloop2.f", "infile_hash": "1e901265b799422661c4ababbb8e255b94fd6cbcfd34827ccecd54d8", "outfile": null, "outfile_hash": null, "stdout": "ast-fixedform_doloop2-16b2c78.stdout", "stdout_hash": "876d76d17f1dc1a1e5429b8ecf27d7e44afcfbe46e90a799cfe6c833", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-program_without_line_02-250a492.stdout0000664000175000017500000000032715141516316030434 0ustar alastairalastair(TranslationUnit [(Program __xx_main () [] [] [] [(Print 0 () [(String "OK" ())] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-derived_types_07-c5a29e3.stdout0000664000175000017500000024010715141516316027213 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { tomlf_structure_vector: (Module (SymbolTable 9 { find: (Function (SymbolTable 13 { 1_toml_node_val: (ExternalSymbol 13 1_toml_node_val 10 val toml_node [] val Public ), 1_toml_value_match_key: (ExternalSymbol 13 1_toml_value_match_key 3 match_key toml_value [] match_key Public ), 1_toml_vector_lst: (ExternalSymbol 13 1_toml_vector_lst 11 lst toml_vector [] lst Public ), 1_toml_vector_n: (ExternalSymbol 13 1_toml_vector_n 11 n toml_vector [] n Public ), i: (Variable 13 i [] Local () () Default (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ), key: (Variable 13 key [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), ptr: (Variable 13 ptr [] Out () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 9 toml_value Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 13 self [] InOut () () Default (StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) 9 toml_vector Source Public Required .false. .true. .false. () .false. .false. ) }) find (FunctionType [(StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .false. .false. ) (String 1 () AssumedLength DescriptorString) (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 13 self) (Var 13 key) (Var 13 ptr)] [(Nullify [(Var 13 ptr)] ) (DoLoop () ((Var 13 i) (IntegerConstant 1 (Integer 4) Decimal) (StructInstanceMember (Var 13 self) 13 1_toml_vector_n (Integer 4) () ) ()) [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () )] 0 (Logical 4) () ) [(If () (FunctionCall 13 1_toml_value_match_key () [((Var 13 key))] (Logical 4) () (StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () ) ) [(Associate (Var 13 ptr) (StructInstanceMember (ArrayItem (StructInstanceMember (Var 13 self) 13 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [(() (Var 13 i) ())] (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) ColMajor () ) 13 1_toml_node_val (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) () ) ) (Exit () )] [] )] [] )] [] )] () Public .false. .false. () ), new_vector: (Function (SymbolTable 12 { 1_toml_vector_lst: (ExternalSymbol 12 1_toml_vector_lst 11 lst toml_vector [] lst Public ), 1_toml_vector_n: (ExternalSymbol 12 1_toml_vector_n 11 n toml_vector [] n Public ), n: (Variable 12 n [] In () () Default (Integer 4) () Source Public Optional .false. .false. .false. () .false. .false. ), self: (Variable 12 self [] Out () () Default (StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) 9 toml_vector Source Public Required .false. .false. .false. () .false. .false. ) }) new_vector (FunctionType [(StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) (Integer 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 12 self) (Var 12 n)] [(Assignment (StructInstanceMember (Var 12 self) 12 1_toml_vector_n (Integer 4) () ) (IntegerConstant 0 (Integer 4) Decimal) () .false. .false. ) (If () (IntrinsicElementalFunction Present [(Var 12 n)] 0 (Logical 4) () ) [(Allocate [((StructInstanceMember (Var 12 self) 12 1_toml_vector_lst (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) () ) [((IntegerConstant 1 (Integer 4) Decimal) (IntrinsicElementalFunction Min [(IntegerConstant 1 (Integer 4) Decimal) (Var 12 n)] 0 (Integer 4) () ))] () () ())] () () () )] [] )] () Public .false. .false. () ), toml_node: (Struct (SymbolTable 10 { val: (Variable 10 val [] Local () () Default (Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) ) 9 toml_value Source Public Required .false. .false. .false. () .false. .false. ) }) toml_node (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [] [val] [] Source Public .false. .false. [] () () ), toml_value: (ExternalSymbol 9 toml_value 2 toml_value tomlf_type_value [] toml_value Public ), toml_vector: (Struct (SymbolTable 11 { lst: (Variable 11 lst [] Local () () Default (Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) 9 toml_node Source Public Required .false. .false. .false. () .false. .false. ), n: (Variable 11 n [] Local (IntegerConstant 0 (Integer 4) Decimal) (IntegerConstant 0 (Integer 4) Decimal) Save (Integer 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_vector (StructType [(Allocatable (Array (StructType [(Allocatable (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) )] [] .true. .false. ) [(() ())] DescriptorArray ) ) (Integer 4)] [] .true. .false. ) [] [n lst] [] Source Public .false. .false. [] () () ) }) tomlf_structure_vector () [tomlf_type_value] .false. .false. .false. ), tomlf_type_keyval: (Module (SymbolTable 6 { destroy: (Function (SymbolTable 8 { 1_toml_keyval_raw: (ExternalSymbol 8 1_toml_keyval_raw 7 raw toml_keyval [] raw Public ), 1_toml_value_key: (ExternalSymbol 8 1_toml_value_key 3 key toml_value [] key Public ), self: (Variable 8 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 6 toml_keyval Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 8 self)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 self) 8 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 8 self) 8 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] ) (If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 8 self) 8 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(ExplicitDeallocate [(StructInstanceMember (Var 8 self) 8 1_toml_keyval_raw (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] )] [] )] () Public .false. .false. () ), toml_keyval: (Struct (SymbolTable 7 { destroy: (StructMethodDeclaration 7 destroy () destroy 6 destroy Source .false. .false. ), raw: (Variable 7 raw [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) toml_keyval (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [raw] [] Source Public .false. .false. [] () 6 toml_value ), toml_value: (ExternalSymbol 6 toml_value 2 toml_value tomlf_type_value [] toml_value Public ) }) tomlf_type_keyval () [tomlf_type_value] .false. .false. .false. ), tomlf_type_value: (Module (SymbolTable 2 { destroy: (Function (SymbolTable 4 { self: (Variable 4 self [] InOut () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ) }) destroy (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. )] () Source Interface () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 4 self)] [] () Public .false. .false. () ), match_key: (Function (SymbolTable 5 { 1_toml_value_key: (ExternalSymbol 5 1_toml_value_key 3 key toml_value [] key Public ), key: (Variable 5 key [] In () () Default (String 1 () AssumedLength DescriptorString) () Source Public Required .false. .false. .false. () .false. .false. ), match: (Variable 5 match [] ReturnVar () () Default (Logical 4) () Source Public Required .false. .false. .false. () .false. .false. ), self: (Variable 5 self [] In () () Default (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) 2 toml_value Source Public Required .false. .false. .false. () .false. .false. ) }) match_key (FunctionType [(StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .false. .false. ) (String 1 () AssumedLength DescriptorString)] (Logical 4) Source Implementation () .false. .true. .false. .false. .false. [] .false. ) [] [(Var 5 self) (Var 5 key)] [(If () (IntrinsicImpureFunction Allocated [(StructInstanceMember (Var 5 self) 5 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () )] 0 (Logical 4) () ) [(Assignment (Var 5 match) (StringCompare (Var 5 key) Eq (StructInstanceMember (Var 5 self) 5 1_toml_value_key (Allocatable (String 1 () DeferredLength DescriptorString) ) () ) (Logical 4) () ) () .false. .false. )] [(Assignment (Var 5 match) (LogicalConstant .false. (Logical 4) ) () .false. .false. )] )] (Var 5 match) Public .false. .false. () ), toml_value: (Struct (SymbolTable 3 { destroy: (StructMethodDeclaration 3 destroy () destroy 2 destroy Source .true. .false. ), key: (Variable 3 key [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), match_key: (StructMethodDeclaration 3 match_key () match_key 2 match_key Source .false. .false. ) }) toml_value (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [key] [] Source Public .false. .true. [] () () ) }) tomlf_type_value () [] .false. .false. .false. ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-array9-fe1439d.stdout0000664000175000017500000001321015141516316025245 0ustar alastairalastair(TranslationUnit [(Program array9 (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [] [(DerivedType varying_string [] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) [] [(Declaration (AttrType TypeCharacter [(len 1 Value)] () () None ) [(SimpleAttribute AttrAllocatable )] [(characters [(() () DimensionExpr)] [] () () None ())] () )] [] ) (Declaration (AttrType TypeType [] () varying_string None ) [] [(x [] [] () () None ())] () ) (Declaration (AttrType TypeType [] () varying_string None ) [(SimpleAttribute AttrAllocatable )] [(a [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [] () () None ) [(SimpleAttribute AttrAllocatable )] [(b [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeInteger [] () () None ) [(SimpleAttribute AttrAllocatable )] [(c [(() () DimensionExpr)] [] () () None ())] () ) (Declaration (AttrType TypeReal [(kind 4 Value)] () () None ) [(SimpleAttribute AttrAllocatable )] [(d [(() () DimensionExpr)] [] () () None ())] (TriviaNode [] [(EndOfLine) (EndOfLine)] ) )] [(Assignment 0 a (ArrayInitializer () varying_string [] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeReal [] () () None ) () [] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeInteger [] () () None ) () [] ) () ) (Assignment 0 d (ArrayInitializer (AttrType TypeReal [(kind 4 Value)] () () None ) () [] ) (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Assignment 0 a (ArrayInitializer () varying_string [x x] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeReal [] () () None ) () [(Real "1.0") (Real "2.0")] ) () ) (Assignment 0 b (ArrayInitializer (AttrType TypeInteger [] () () None ) () [1 2] ) () ) (Assignment 0 d (ArrayInitializer (AttrType TypeReal [(kind 4 Value)] () () None ) () [(Real "1.0") (Real "2.0")] ) () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/asr-modules1-d3dc674.json0000664000175000017500000000071515141516316025221 0ustar alastairalastair{ "basename": "asr-modules1-d3dc674", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/modules1.f90", "infile_hash": "72ef321fb90a3d7776bca83ff88325bcf615e115cd66319677e16658", "outfile": null, "outfile_hash": null, "stdout": "asr-modules1-d3dc674.stdout", "stdout_hash": "3f4841658ce0202c0d883618e88fa3666fbdab78b93e402ddc29142c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-modules_32-ca5fb91.stdout0000664000175000017500000003735215141516316026100 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { fpm_targets: (Module (SymbolTable 2 { build_target_ptr: (Struct (SymbolTable 3 { ptr: (Variable 3 ptr [] Local (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 3 ptr) ) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 3 ptr) ) Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_ptr (StructType [(Pointer (StructType [] [] .true. .false. ) )] [] .true. .false. ) [build_target_t] [ptr] [] Source Public .false. .false. [] () () ), build_target_t: (Struct (SymbolTable 4 { output_file: (Variable 4 output_file [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ), version: (Variable 4 version [] Local () () Default (Allocatable (String 1 () DeferredLength DescriptorString) ) () Source Public Required .false. .false. .false. () .false. .false. ) }) build_target_t (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) [] [output_file version] [] Source Public .false. .false. [] () () ), func: (Function (SymbolTable 5 { target_ptr: (Variable 5 target_ptr [] ReturnVar () () Default (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) 2 build_target_t Source Public Required .false. .false. .false. () .false. .false. ) }) func (FunctionType [] (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [] [(Associate (Var 5 target_ptr) (PointerNullConstant (Pointer (StructType [(Allocatable (String 1 () DeferredLength DescriptorString) ) (Allocatable (String 1 () DeferredLength DescriptorString) )] [] .true. .false. ) ) (Var 5 target_ptr) ) )] (Var 5 target_ptr) Public .false. .false. () ) }) fpm_targets () [] .false. .false. .false. ), modules_32: (Program (SymbolTable 6 { }) modules_32 [] [(Print (StringConstant "running modules_32 program" (String 1 (IntegerConstant 26 (Integer 4) Decimal) ExpressionLength DescriptorString) ) )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/cpp-arrays_01-4fac8c3.json0000664000175000017500000000073015141516316025340 0ustar alastairalastair{ "basename": "cpp-arrays_01-4fac8c3", "cmd": "lfortran --no-color --show-cpp {infile}", "infile": "tests/../integration_tests/arrays_01.f90", "infile_hash": "f7df4142feb383f836dfa072a60673922e8873b5695f893be8329b89", "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_01-4fac8c3.stdout", "stdout_hash": "d080ea538291a00639415954ed47e7605f4a0e724c6d9c0a0d23d430", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_ignore_pragma-pragma2-ba96e35.json0000664000175000017500000000076615141516316027721 0ustar alastairalastair{ "basename": "asr_ignore_pragma-pragma2-ba96e35", "cmd": "lfortran --ignore-pragma --show-asr --no-color {infile} -o {outfile}", "infile": "tests/pragma2.f90", "infile_hash": "c76c30115a39aa0c98b24173c8517df1fb525bf101023b12dc38ca3e", "outfile": null, "outfile_hash": null, "stdout": "asr_ignore_pragma-pragma2-ba96e35.stdout", "stdout_hash": "92d5cc0b4e4483d557b5b5c33dd3bebaab31579476719dbd5050c748", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-expr5-f0a7df6.json0000664000175000017500000000070415141516316024610 0ustar alastairalastair{ "basename": "asr-expr5-f0a7df6", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/expr5.f90", "infile_hash": "030f3f956944c6d24d536fd1f434f877d95bf12aac6f367d2ad1827e", "outfile": null, "outfile_hash": null, "stdout": "asr-expr5-f0a7df6.stdout", "stdout_hash": "7831011e2fa33e8fadb4795df8697dee82926740a2edbab49f89ff95", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-format_39-1b897aa.json0000664000175000017500000000071515141516316025310 0ustar alastairalastair{ "basename": "run-format_39-1b897aa", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_39.f90", "infile_hash": "21ae932dead2ee7e13dbde215b3dafb82cd29ab48a0a3abe183e8c8d", "outfile": null, "outfile_hash": null, "stdout": "run-format_39-1b897aa.stdout", "stdout_hash": "0b239ec77538859ed5cc3e7eae13f060c35b0ec15fedabf79f07379c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-interface_10-e9eb6ea.json0000664000175000017500000000075615141516316026077 0ustar alastairalastair{ "basename": "asr-interface_10-e9eb6ea", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/interface_10.f90", "infile_hash": "8465656b7ce46b783d3db81b21e7bd48594e95e99839534c7e50cad8", "outfile": null, "outfile_hash": null, "stdout": "asr-interface_10-e9eb6ea.stdout", "stdout_hash": "ed5bb6cfda785525b146777a3234c3f3b7de2b8e16415a7846a0b0c1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast_f90-common3-fab0cfa.json0000664000175000017500000000072515141516316025730 0ustar alastairalastair{ "basename": "ast_f90-common3-fab0cfa", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/common3.f90", "infile_hash": "113991d796f59c8f9cb2babe7720663be887616a5ce127bf58767997", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-common3-fab0cfa.stdout", "stdout_hash": "267b484b68f32da42b53258c88c7f3edffc8a133474555d8ba7245d8", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-types_01-a91206c.stdout0000664000175000017500000000666615141516316025427 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { types_01: (Program (SymbolTable 2 { r: (Variable 2 r [] Local () () Default (Real 4) () Source Public Required .false. .false. .false. () .false. .false. ) }) types_01 [] [(Assignment (Var 2 r) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (RealConstant 1.500000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (RealConstant 1.000000 (Real 4) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (IntegerConstant 2 (Integer 4) Decimal) IntegerToReal (Real 4) (RealConstant 2.000000 (Real 4) ) ) () .false. .false. ) (Assignment (Var 2 r) (Cast (Cast (IntegerConstant 3 (Integer 4) Decimal) IntegerToReal (Real 8) (RealConstant 3.000000 (Real 8) ) ) RealToReal (Real 4) (RealConstant 3.000000 (Real 4) ) ) () .false. .false. )] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast-critical1-98f603a.json0000664000175000017500000000072015141516316025263 0ustar alastairalastair{ "basename": "ast-critical1-98f603a", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/critical1.f90", "infile_hash": "05948a8c6d4476986b19c2be2d0c40a9ebb19a2007eac02159ab9496", "outfile": null, "outfile_hash": null, "stdout": "ast-critical1-98f603a.stdout", "stdout_hash": "84a11b817d717f2b7c7bed084acd5bf22205710672b49b0f775b2f21", "stderr": null, "stderr_hash": null, "returncode": 0 }././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.jsonlfortran-lfortran-2f73434/tests/reference/pass_pass_array_by_data_transform_optional_argument_functi0000664000175000017500000000123415141516316035005 0ustar alastairalastair{ "basename": "pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409", "cmd": "lfortran --pass=pass_array_by_data,transform_optional_argument_functions --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/modules_40.f90", "infile_hash": "ac67135d17b966d74eb1c00c48de647510f0b5ae38596bce67d52958", "outfile": null, "outfile_hash": null, "stdout": "pass_pass_array_by_data_transform_optional_argument_functions-modules_40-2830409.stdout", "stdout_hash": "95f6b5da72c37691ddc22fa178d4abce5844ac26a1369f8b85e08d2e", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr_preprocess-preprocessor18-618bfdc.json0000664000175000017500000000077315141516316030717 0ustar alastairalastair{ "basename": "asr_preprocess-preprocessor18-618bfdc", "cmd": "lfortran --cpp --show-asr --no-color {infile} -o {outfile}", "infile": "tests/preprocessor18.f90", "infile_hash": "9ad52cd56e9f372994097685554ad24df69eb9bf87e99ebf0a005fb2", "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor18-618bfdc.stdout", "stdout_hash": "276f259bbec8e25c00e014269d2adb38790233e83906b35d7231444f", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-intrinsics4-113f724.stderr0000664000175000017500000000027215141516316026122 0ustar alastairalastairsemantic error: Kind of all the arguments of Dshiftl must be the same --> tests/errors/intrinsics4.f90:2:14 | 2 | print *, dshiftl(1, 1_8, 1) | ^^^^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/asr-array_05_cc-37bfc03.stderr0000664000175000017500000000070115141516316026075 0ustar alastairalastairsemantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05_cc.f90:12:14 | 12 | allocate(type_01%x(1, 2)) | ^^^^^^^^^^^^^^^ semantic error: Rank mismatch in array reference: the array `x` has rank `1`, but is referenced as rank `2` --> tests/errors/array_05_cc.f90:13:14 | 13 | allocate(type_01%x(2, 1)) | ^^^^^^^^^^^^^^^ lfortran-lfortran-2f73434/tests/reference/c-case_03-b50b4bf.stdout0000664000175000017500000000152115141516316024755 0ustar alastairalastair#include #include #include #include #include #include // Implementations int main(int argc, char* argv[]) { _lpython_set_argv(argc, argv); const int32_t a = 1; const int32_t b = 2; int32_t marks; marks = 94; if (marks >= 40 + b) { printf("%s\n","Pass!"); } else if (marks <= 39 - a) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); marks = -1; if (marks >= 40 + b) { printf("%s\n","Pass!"); } else if (0 <= marks <= 39 - a) { printf("%s\n","Failed!"); } else { printf("%s\n","Invalid marks"); } printf("%s%s%d\n", "Your marks are ", " ", marks); return 0; } lfortran-lfortran-2f73434/tests/reference/asr-statement_02-daaef34.json0000664000175000017500000000102515141516316026121 0ustar alastairalastair{ "basename": "asr-statement_02-daaef34", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/statement_02.f90", "infile_hash": "61034a47086bdbf3221fccdae0ad236a38d9ee626e02852cc820bc8e", "outfile": null, "outfile_hash": null, "stdout": "asr-statement_02-daaef34.stdout", "stdout_hash": "17ba608eeed391af1bece1453b17e41c09e68b56c86e92f3539011db", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-fixed_form_implicit2-4d3e56c.stdout0000664000175000017500000000053315141516316030134 0ustar alastairalastair(TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { }) main [] [] ) }) [] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-allocate_01-df1748d.json0000664000175000017500000000074115141516316026236 0ustar alastairalastair{ "basename": "ast_f90-allocate_01-df1748d", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/allocate_01.f90", "infile_hash": "7a28f6115b781d328be0829189ace20f4f862bf745740c6c78400225", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-allocate_01-df1748d.stdout", "stdout_hash": "e664086475b3e379ff22a16889c819f111434743957c3d4af54dd469", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-esub1-15eb690.stderr0000664000175000017500000000022215141516316024751 0ustar alastairalastairsyntax error: Token 'r' (of type 'identifier') is unexpected here --> tests/errors/esub1.f90:1:16 | 1 | subroutine g() r | ^ lfortran-lfortran-2f73434/tests/reference/ast-types_07-54d4a85.json0000664000175000017500000000074215141516316025064 0ustar alastairalastair{ "basename": "ast-types_07-54d4a85", "cmd": "lfortran --show-ast --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/types_07.f90", "infile_hash": "a918662a55a6896275936f024c6c39132fd389d478f71afb080995a0", "outfile": null, "outfile_hash": null, "stdout": "ast-types_07-54d4a85.stdout", "stdout_hash": "1a189b481ef5f05df33a2f9155d98535aef122b91ab033808708fea1", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-parsing_02-740c1e5.stderr0000664000175000017500000000026115141516316025676 0ustar alastairalastairstyle suggestion: Use 'end if' instead of 'endif' --> tests/../integration_tests/parsing_02.f90:49:7 | 49 | endif endif | ^^^^^ help: write this as 'end if' lfortran-lfortran-2f73434/tests/reference/run-format_22-e96df3d.json0000664000175000017500000000071515141516316025370 0ustar alastairalastair{ "basename": "run-format_22-e96df3d", "cmd": "lfortran --no-color {infile}", "infile": "tests/../integration_tests/format_22.f90", "infile_hash": "1dcaaa4dc928be3bf1cb4d6eb0c015f8a2f8b200f162c64edeb5d5ab", "outfile": null, "outfile_hash": null, "stdout": "run-format_22-e96df3d.stdout", "stdout_hash": "aaed5b96f9c6c47f2f0e9540ae90f1e75afcb8a8b0c66cfe9a278ed3", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/asr-allow_implicit_interface4-4615450.json0000664000175000017500000000104715141516316030355 0ustar alastairalastair{ "basename": "asr-allow_implicit_interface4-4615450", "cmd": "lfortran --show-asr --implicit-typing --implicit-interface --no-color {infile} -o {outfile}", "infile": "tests/allow_implicit_interface4.f90", "infile_hash": "9992b1e5744f5c2000e5692928e1413fc28b7542424999502e928afd", "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface4-4615450.stdout", "stdout_hash": "f7526db478d9766a5a7ec2e49c8e1f77e1bcbf3f86d7613a62ad6153", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/run-floatStringInput-95c963d.json0000664000175000017500000000072415141516316026753 0ustar alastairalastair{ "basename": "run-floatStringInput-95c963d", "cmd": "lfortran --no-color {infile}", "infile": "tests/errors/floatStringInput.f90", "infile_hash": "4db92554a429fc93f7f3eb205946ec7b7539f4f4b3cf7674cb9e3434", "outfile": null, "outfile_hash": null, "stdout": null, "stdout_hash": null, "stderr": "run-floatStringInput-95c963d.stderr", "stderr_hash": "50500727736157906e3452986874952b0eb79fa95622309fae659c69", "returncode": 1 }lfortran-lfortran-2f73434/tests/reference/julia-goto_04-ac607ff.json0000664000175000017500000000073015141516316025335 0ustar alastairalastair{ "basename": "julia-goto_04-ac607ff", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/goto_04.f90", "infile_hash": "302db59379e85ba1677034f61bec227f237c56085cea27ad7a1554b5", "outfile": null, "outfile_hash": null, "stdout": "julia-goto_04-ac607ff.stdout", "stdout_hash": "f80f754f041341dbbd44bde75ec93bc0ee429362cca23c59b9b1b285", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/ast-where_01-cc363a1.stdout0000664000175000017500000001442715141516316025447 0ustar alastairalastair(TranslationUnit [(Program where_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () () None ) [] [(a [(1 10 DimensionExpr)] [] () () None ()) (b [(1 10 DimensionExpr)] [] () () None ()) (i [] [] () () None ())] () )] [(Assignment 0 a (u- 2) () ) (Assignment 0 (FuncCallOrArray a [] [(() 1 () 0)] [] [] [] ) 1 () ) (Assignment 0 (FuncCallOrArray a [] [(() 5 () 0)] [] [] [] ) 8 () ) (Assignment 0 b (u- 3) () ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (Where 0 () (>= a 0) [(Assignment 0 b 1 () )] [(Assignment 0 b 0 () )] () (TriviaNode [] [(EndOfLine) (EndOfLine)] ) ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() 1 () 0)] [] [] [] ) 1) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () ) (If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() 5 () 0)] [] [] [] ) 1) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () ) (DoLoop 0 () 0 i 2 4 () [(If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 0) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () )] () () ) (DoLoop 0 () 0 i 6 10 () [(If 0 () (> (FuncCallOrArray abs [] [(() (- (FuncCallOrArray b [] [(() i () 0)] [] [] [] ) 0) () 0)] [] [] [] ) (Real "1e-6")) [(ErrorStop 0 () () () )] [] () () () )] () () ) (Print 0 () [b] () ) (Print 0 () [a] () )] [] )] ) lfortran-lfortran-2f73434/tests/reference/ast_f90-derived_types_02-2a5b79b.json0000664000175000017500000000076015141516316027314 0ustar alastairalastair{ "basename": "ast_f90-derived_types_02-2a5b79b", "cmd": "lfortran --show-ast-f90 --no-indent --no-color {infile}", "infile": "tests/derived_types_02.f90", "infile_hash": "97982d2ac648e6b5260dc06a91a3e121668752f5b642ff81d4efba5f", "outfile": null, "outfile_hash": null, "stdout": "ast_f90-derived_types_02-2a5b79b.stdout", "stdout_hash": "3dbdac0f60c4fc3563710a095e5a071aac2c72198db93e4c7ee8a1ca", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/julia-modules_11-bb73359.json0000664000175000017500000000074115141516316025677 0ustar alastairalastair{ "basename": "julia-modules_11-bb73359", "cmd": "lfortran --no-color --show-julia {infile}", "infile": "tests/../integration_tests/modules_11.f90", "infile_hash": "f19a5ba8d01ebaae3da78891afbae58462d711a364274aa3a5569fa1", "outfile": null, "outfile_hash": null, "stdout": "julia-modules_11-bb73359.stdout", "stdout_hash": "8f436714f9e8658e37c0d13431659a4b867a02ef2b2979d6a2aed8dc", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-fn2-ff8ef37.stdout0000664000175000017500000000135315141516316024614 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations int32_t a(); float b(); bool c(); int32_t d(); float e(); bool f(); // Implementations int32_t a() { int32_t a; return a; } float b() { float b; return b; } bool c() { bool c; return c; } int32_t d() { int32_t r; return r; } float e() { float r; return r; } bool f() { bool r; return r; } lfortran-lfortran-2f73434/tests/reference/asr-kwargs_02-1588831.json0000664000175000017500000000074515141516316025055 0ustar alastairalastair{ "basename": "asr-kwargs_02-1588831", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/kwargs_02.f90", "infile_hash": "b134c269925633b5b9f943802cb7efd683082e7567d4ef0e90d9ed47", "outfile": null, "outfile_hash": null, "stdout": "asr-kwargs_02-1588831.stdout", "stdout_hash": "e83110946e5528ea13ac07c1619d6b0b438533571ada33c3ce6f617c", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/reference/cpp-case_06-57ebc6f.stdout0000664000175000017500000000472115141516316025342 0ustar alastairalastair#include #include #include #include #include #include #include #include template Kokkos::View from_std_vector(const std::vector &v) { Kokkos::View r("r", v.size()); for (size_t i=0; i < v.size(); i++) { r(i) = v[i]; } return r; } // Forward declarations namespace { } // Implementations namespace { void main2() { static int32_t a=1; int32_t ap=1; static int32_t b=2; int32_t bp=2; static float c= 1.00000000000000000e+00; float cp= 1.00000000000000000e+00; static float d= 2.00000000000000000e+00; float dp= 2.00000000000000000e+00; std::string grade_fixed="B"; int32_t marks; int32_t marks_fixed=94; if (grade_fixed == "A") { std::cout<< "Excellent!"<= 40 + bp) { std::cout<< "Pass!"<= 40 + bp) { std::cout<< "Pass!"< tests/../integration_tests/logical3.f90:24:5 | 24 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension warning: .xor. is an LFortran extension --> tests/../integration_tests/logical3.f90:74:5 | 74 | if (a .xor. b) then | ^^^^^^^^^ LFortran extension lfortran-lfortran-2f73434/tests/reference/asr-arrays_03_func-7c8d572.json0000664000175000017500000000076415141516316026237 0ustar alastairalastair{ "basename": "asr-arrays_03_func-7c8d572", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/arrays_03_func.f90", "infile_hash": "9feab893fd240821f352bd8b0c12cb132cf39c706950d08f5a41cc54", "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_03_func-7c8d572.stdout", "stdout_hash": "f45ff8c0d21ff5f08c45c6863194246b876f38cc0da9063f9700ca3d", "stderr": null, "stderr_hash": null, "returncode": 0 }lfortran-lfortran-2f73434/tests/function_call1.f900000664000175000017500000000103615141516316022216 0ustar alastairalastairmodule module_function_call1 type :: softmax contains procedure :: eval_1d end type softmax contains pure function eval_1d(self, x) result(res) class(softmax), intent(in) :: self real, intent(in) :: x(:) real :: res(size(x)) end function eval_1d pure function eval_1d_prime(self, x) result(res) class(softmax), intent(in) :: self real, intent(in) :: x(:) real :: res(size(x)) res = self%eval_1d(x) end function eval_1d_prime end module module_function_call1 lfortran-lfortran-2f73434/tests/array7.f900000664000175000017500000000021515141516316020520 0ustar alastairalastairprogram array7 IMPLICIT DOUBLE PRECISION (A-H,O-Z) IMPLICIT integer (I-N) integer, parameter :: n = 10 DIMENSION SJ(0:N),DJ(0:N) end program lfortran-lfortran-2f73434/tests/flush1.f900000664000175000017500000000026215141516316020517 0ustar alastairalastairprogram flush1 ! Tests for syntax (AST only): flush (10, IOSTAT = n) flush (20, IOMSG = n) flush (ERR = label) flush (30, UNIT = 40) FLUSH 50 end program lfortran-lfortran-2f73434/tests/implicit9.f900000664000175000017500000000067715141516316021232 0ustar alastairalastairinteger function a(d, e) implicit integer (a,b-c) implicit integer*4 (d-e) implicit integer*8 (f-g) implicit real (h) implicit real*4 (i-k) implicit real*8 (l) implicit complex (m, n) implicit complex*8 (o) implicit complex*16 (p) implicit double precision (q) implicit double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end functionlfortran-lfortran-2f73434/tests/exit1.f900000664000175000017500000000021415141516316020344 0ustar alastairalastairprogram exit1 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(1) end if end do end program lfortran-lfortran-2f73434/tests/subroutine2.f900000664000175000017500000000164315141516316021602 0ustar alastairalastairsubroutine g x = y x = 2*y end subroutine subroutine g x = y x = 2*y end subroutine subroutine g x = y x = 2*y end subroutine subroutine g x = y ;;;;;; ; ; ; x = 2*y end subroutine subroutine g x = y; x = 2*y; end subroutine subroutine g x = y; ; x = 2*y;; ; end subroutine subroutine g; x = y; x = 2*y; end subroutine subroutine f subroutine = y x = 2*subroutine end subroutine subroutine f integer :: x end subroutine subroutine f() integer :: x end subroutine subroutine f(a, b, c, d) integer, intent(in) :: a, b integer, intent ( in ) :: c, d integer :: z integer::y end subroutine subroutine f(a, b, c, d) integer, intent(out) :: a, b integer, intent(in out) :: c, d integer :: z integer::y end subroutine subroutine saxpy(n, a, x, y) real(dp), intent(in) :: x(:), a real(dp), intent(inout) :: y(:) integer, intent(in) :: n integer :: i do i = 1, n y(i) = a*x(i)+y(i) enddo end subroutine saxpy lfortran-lfortran-2f73434/tests/stop.f900000664000175000017500000000012215141516316020275 0ustar alastairalastairprogram stop implicit none integer :: x x = (2+3)*5 if (x == 25) stop end program lfortran-lfortran-2f73434/tests/format6.f900000664000175000017500000000072615141516316020700 0ustar alastairalastairprogram format6 print '(SP,F6.1,F6.1,ss,F6.1)', 12.1, 122.1, 122.1 print '(SP,I5.3)', 11 print '(SP,I0.3)', 11 print '(SP,I0.2)', 11 print '(SP,I5.2)', 11 print '(SP,I0.2)', -11 print '(SP,I0.2)', -1111 print '(SP,I3.2)', 1111 print '(SP,ss,I0.2)', 11 PRINT '(SP,D25.10)', 12345.6789 print "(SP,E60.50)", 1.23456789101112e-62_8 PRINT '(SP,EN12.4, EN12.1)', 12345.6789 , 12845.6789 print '(SP,F5.1)', 1.0 end programlfortran-lfortran-2f73434/tests/array10.f900000664000175000017500000000012515141516316020572 0ustar alastairalastairprogram const_arrays integer, parameter :: x(*) = [4, 9, 6, 12, 13] print *, x end lfortran-lfortran-2f73434/tests/allow_implicit_interface3.f900000664000175000017500000000036515141516316024434 0ustar alastairalastair SUBROUTINE SSYR2(UPLO) CHARACTER UPLO INTEGER INFO LOGICAL LSAME EXTERNAL LSAME INFO = 0 IF (.NOT.LSAME(UPLO,'U') .AND. .NOT.LSAME(UPLO,'L')) THEN INFO = 1 ELSE INFO = 2 END IF RETURN END lfortran-lfortran-2f73434/tests/format2.f900000664000175000017500000000010215141516316020660 0ustar alastairalastairprogram format2 integer a print '(3l3)', a end program lfortran-lfortran-2f73434/tests/kokkos_program2.f900000664000175000017500000000100515141516316022423 0ustar alastairalastairprogram kokkos_program2 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-lfortran-2f73434/tests/wasm_bind_js.f900000664000175000017500000000057515141516316021763 0ustar alastairalastairprogram test_js_interface integer , parameter :: i_max = 600 integer , parameter :: j_max = 450 integer :: image_t(j_max, i_max) interface subroutine show_img(n, m, A) bind(js) integer, intent(in) :: n, m integer, intent(in) :: A(n,m) end subroutine end interface call show_img(j_max, i_max, image_t) end program lfortran-lfortran-2f73434/tests/array4.f900000664000175000017500000000013615141516316020517 0ustar alastairalastair! AST test only program array4 implicit none integer :: i i = some_array(5)%a end program lfortran-lfortran-2f73434/tests/preprocessor5.f900000664000175000017500000000045515141516316022134 0ustar alastairalastairprogram preprocessor5 implicit none #define X 5 #define Y #ifdef X print *, 1 #else print *, 2 #endif #ifndef X print *, 11 #else print *, 12 #endif #ifdef Y print *, 3 #else print *, 4 #endif #ifdef Z print *, 5 #else print *, 6 #endif #ifndef Z print *, 15 #else print *, 16 #endif end program lfortran-lfortran-2f73434/tests/fixedform_doloop.f0000664000175000017500000000042615141516316022505 0ustar alastairalastair program main integer k,l,m,n do k=1,10 print *, k enddo do 80 l=1,10 print *, l 80 enddo do 800 m=1,10 print *, m 800 enddo do 8000 n=1,10 print *, n 8000 enddo end program lfortran-lfortran-2f73434/tests/implied_do_loop3.f900000664000175000017500000000156415141516316022544 0ustar alastairalastair! Test implied do loops + call to intrinsic module implied_do_loops3_mod implicit none contains subroutine test_1 character(len=20) :: tmp_line(3) integer :: iii, ii tmp_line = "Hello" ii = 3 write(*, '(g0)') (trim(tmp_line(iii)), iii=1, ii) end subroutine subroutine test_2 implicit none character, allocatable :: tmp_line integer :: i tmp_line = "Hello" print *, (tmp_line, i=1, 3) end subroutine subroutine test_3 character(len=20) :: tmp_line integer :: iii, ii tmp_line = "Hello" ii = 3 write(*, '(g0)') (trim(tmp_line), iii=1, ii) end subroutine end module program implied_do_loops3 use implied_do_loops3_mod implicit none call test_1() call test_2() call test_3() end program lfortran-lfortran-2f73434/tests/preprocessor2.f900000664000175000017500000000027315141516316022127 0ustar alastairalastairprogram preprocessor2 implicit none #define X123 12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123 integer :: x, y x = (2+3)*5 print *, x, C123 end program lfortran-lfortran-2f73434/tests/block1.f900000664000175000017500000000110115141516316020461 0ustar alastairalastairprogram block1 implicit integer(a-z) integer :: B ! TODO: Fix this test case block ! use mod, only: example ! import, none ! !import, only: B B = 10 print *, B if (B == 10) then print *, "pass" end if end block end ! The variable B is implicitly declared in the scoping unit of the main program. ! The statement IMPORT, NONE makes B inaccessible in the BLOCK construct. ! If the IMPORT, NONE statement is replaced with the IMPORT statement in the ! comment, the program is conformant. lfortran-lfortran-2f73434/tests/modules9.f900000664000175000017500000000136615141516316021064 0ustar alastairalastairmodule fpm_cmd_update use fpm_dependency, only : dependency_tree_t, error_t implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_update_settings character(len=5), allocatable :: name(:) logical :: fetch_only logical :: clean end type contains subroutine cmd_update(settings) type(fpm_update_settings), intent(in) :: settings type(dependency_tree_t) :: deps type(error_t), allocatable :: error integer :: ii call deps%update(deps%dep(ii)%name, error) end subroutine cmd_update end module fpm_cmd_update lfortran-lfortran-2f73434/tests/classes2.f900000664000175000017500000000166515141516316021044 0ustar alastairalastair! Source - Page 44 of https://personalpages.manchester.ac.uk/staff/david.d.apsley/lectures/fortran/fortranB.pdf module Defs implicit none private public point, point2d type, abstract :: point contains procedure(func), deferred :: radius end type point abstract interface real function func( this ) import point class(point) this end function func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d contains real function r2d( this ) class(point2d) this r2d = sqrt( this%x ** 2 + this%y ** 2 ) end function r2d end module Defs program main use Defs implicit none real :: res class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 3, 4 ) ptr => p2d res = ptr%radius() if (res /= 5.0) error stop end program main lfortran-lfortran-2f73434/tests/do2.f900000664000175000017500000000044315141516316020002 0ustar alastairalastairsubroutine a do a = a + i b = 3 enddo do do = a + i enddo = 3 enddo do; a = a + i; b = 3; end do end subroutine subroutine a do x = 1 end do end subroutine subroutine a do i = 1, 5 x = x + i end do end subroutine subroutine a do i = 1, 5, -1 x = i end do end subroutine lfortran-lfortran-2f73434/tests/do_concurrent_reduce3.f900000664000175000017500000000047015141516316023574 0ustar alastairalastairsubroutine sum_reduce(a, s) real, intent(in) :: a(:) real, intent(out) :: s integer :: N, i N = size(a) s = 0 do concurrent (i = 1:N) reduce(*: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(MIN: s) s = s + a(i) end do do concurrent (i = 1:N) reduce(MAX: s) s = s + a(i) end do end subroutine lfortran-lfortran-2f73434/tests/critical1.f900000664000175000017500000000123015141516316021164 0ustar alastairalastairprogram critical1 implicit none integer :: joblist[*], job integer :: a, b integer :: IntegerSample character(50) :: Sample if (this_image() == 1) read(*,*) joblist sync all do critical job = joblist[1] joblist[1] = job - 1 end critical ! >>>>>>>> Syntax check(AST) >>>>>>>> critical() IntegerSample = 0 end critical critical(stat = IntegerSample) Sample = "Error message" end critical critical(errmsg = Sample) Sample = "Error message" end critical ! <<<<<<<< Syntax check(AST) <<<<<<<< if (job > 0) then b = a**2 + b**2 else exit end if end do sync all end program lfortran-lfortran-2f73434/tests/Subroutine_Call1.f900000664000175000017500000000076715141516316022502 0ustar alastairalastairprogram Subroutine_Call1 implicit none ! Syntax check !Subroutine CALL call randn(x(i)) call randn(x) call random_number(U) call rand_gamma0(a, .true., x) call rand_gamma0(a, .true., x(1)) call rand_gamma0(a, .false., x(i)) call rand_gamma_vector_n(a, size(x), x) call f(a=4, b=6, c=i) call g(a(3:5,i:j), b(:)) call g(a(:5,i:j), b(1:)) call a%random_number(u) call a%b%random_number(u) call f(a=4, b=6, c=i) call x%f%e() call self%dependency(ii)%info(unit, pr - 1) call self%dep(:self%ndep)%done(a) end lfortran-lfortran-2f73434/tests/modules1_module1.f900000664000175000017500000000037515141516316022501 0ustar alastairalastairmodule abc implicit none type :: t1 contains procedure :: f end type t1 contains pure function f(self) result(match) class(t1), intent(in), optional :: self logical :: match end function f end module abc lfortran-lfortran-2f73434/tests/interface1.f900000664000175000017500000000033315141516316021335 0ustar alastairalastairmodule interface1 implicit none interface randn module procedure randn_scalar module procedure :: randn_vector module procedure randn_matrix module procedure :: randn_vector_n end interface end module lfortran-lfortran-2f73434/tests/associate1.f900000664000175000017500000000025515141516316021353 0ustar alastairalastairassociate(x => y) endassociate associate(x => (y)) end associate associate(x => y+z) end associate associate(x => -y) end associate call some_subroutine(x, (x)) x = f((x)) lfortran-lfortran-2f73434/tests/fixed_form4.f0000664000175000017500000000014415141516316021351 0ustar alastairalastair program X implicit none integer :: y y = 5 500 pr 4int *, y end program lfortran-lfortran-2f73434/tests/wrapping1.f900000664000175000017500000000031615141516316021225 0ustar alastairalastairmodule wrapping1 implicit none integer, parameter :: c_int = 4 contains subroutine sub1(a, b) bind(c) integer(c_int), intent(in) :: a integer(c_int), intent(out) :: b b = a + 1 end subroutine end module lfortran-lfortran-2f73434/tests/scopes1.f900000664000175000017500000000025115141516316020670 0ustar alastairalastairprogram scopes1 implicit none integer :: i, j j = 1 call f(i) contains subroutine f(b) integer, intent(out) :: b b = j + 1 end subroutine end program lfortran-lfortran-2f73434/tests/modules4.f900000664000175000017500000000026215141516316021051 0ustar alastairalastairmodule tomlf_type use tomlf_type_array, only : toml_array, new_array, new use tomlf_type_keyval, only : toml_keyval, new_keyval, new implicit none end module tomlf_type lfortran-lfortran-2f73434/tests/implicit3.f900000664000175000017500000000026115141516316021211 0ustar alastairalastairinteger function a(n,m,z,k) implicit real (n,m) implicit real*8 (k) implicit complex (z) integer :: X(5), Y(8) n = 5 m = 8 k = 9.23 X = [1,2,3,4,5] z = (1.0 , 2.0) end function lfortran-lfortran-2f73434/tests/polymorphic_class_in_derived_type.f900000664000175000017500000000026715141516316026305 0ustar alastairalastairmodule fortuno_types implicit none type :: dict_item class(*), allocatable :: value class(*), allocatable :: value2 end type dict_item end module fortuno_types lfortran-lfortran-2f73434/tests/entry2.f900000664000175000017500000000012615141516316020537 0ustar alastairalastairsubroutine prini() return entry prin() call messpr() return end subroutine lfortran-lfortran-2f73434/tests/close1.f900000664000175000017500000000024215141516316020501 0ustar alastairalastairprogram close1 ! Tests for syntax (AST) only: close(u) close (unit=gmv_lun) close(unit=dxf % dunit, status='delete') CLOSE( UNIT=funit, IOSTAT=ierr ) end program lfortran-lfortran-2f73434/tests/derived_types_02.f900000664000175000017500000000217715141516316022473 0ustar alastairalastairmodule a implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type type C endtype type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains private procedure, private :: p1 procedure(something), private :: p1b procedure, pass(self) :: p2 procedure :: proc_1, proc_2 generic :: operator(/=) => p5, p6 generic :: operator(+) => p8 generic :: operator(.in.) => p7 generic :: operator(.dot.) => p10 generic :: operator(/) => p11 generic :: assignment(=) => p9 generic, public :: calcCoeffs => calcCoeffsReal, calcCoeffsKPoint generic, private :: name => sample generic :: p1 => p2; generic, public :: write(formatted) => t_write generic :: read(unformatted) => t_read final :: y end type X type matrix(k, b) integer, kind :: k = 4 integer(8), len :: b real(k) :: element(b, b) endtype matrix contains subroutine p1(this) class(X), intent(out) :: this end subroutine subroutine p2(this) class(X), intent(inout) :: this end subroutine end module lfortran-lfortran-2f73434/tests/complex2.f900000664000175000017500000000021315141516316021042 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x + 4.0 print *, x x = 2.0 + x print *, x x = 2.0 + x + (0.0, 3.0) print *, x end program lfortran-lfortran-2f73434/tests/codegen_function_polymorphic.f900000664000175000017500000000036215141516316025254 0ustar alastairalastairmodule codegen_function_polymorphic type, abstract :: AbsType end type AbsType contains function my_func() result(obj) class(AbsType), allocatable :: obj end function my_func end module codegen_function_polymorphiclfortran-lfortran-2f73434/tests/redeclaration1.f900000664000175000017500000000010015141516316022201 0ustar alastairalastairsubroutine redeclare1(piv, k) integer piv(k), k end subroutine lfortran-lfortran-2f73434/tests/fixed_form_without_newline.f0000664000175000017500000000015715141516316024575 0ustar alastairalastair PROGRAM EXAMPLE CHARACTER(len=2) X X = 'Hi' PRINT *, X END PROGRAM EXAMPLElfortran-lfortran-2f73434/tests/implicit_interface3.f900000664000175000017500000000011315141516316023225 0ustar alastairalastairsubroutine driver(f, n) integer, intent(in) :: n call f(n) end subroutine lfortran-lfortran-2f73434/tests/complex1.f900000664000175000017500000000007115141516316021043 0ustar alastairalastairprogram complex1 complex :: x x = (3.0, 4.0) end program lfortran-lfortran-2f73434/tests/preprocessor3b.h0000664000175000017500000000003315141516316022115 0ustar alastairalastair#include "preprocessor3.h" lfortran-lfortran-2f73434/tests/cast_node_m_value.f900000664000175000017500000000131015141516316022757 0ustar alastairalastair! we do casting from source to destination below during ! initialization of variable's, we save it's ASR via tests.toml ! to ensure that the `m_value` of the cast node is set ! correctly program cast_node_m_value implicit none real(4), parameter :: i4_to_r4(3) = [1, 2, 3] real(8), parameter :: i4_to_r8(3) = [1, 2, 3] complex(4), parameter :: i4_to_c4(3) = [1, 2, 3] complex(8), parameter :: i4_to_c8(3) = [1, 2, 3] complex(4), parameter :: r4_to_c4(3) = [1., 2., 3.] complex(8), parameter :: r4_to_c8(3) = [1., 2., 3.] integer(1), parameter :: i4_to_i1(3) = [1, 2, 3] complex(8), parameter :: c4_to_c8(3) = [(1.0, 0.0), (2.0, 0.0), (3.0, 0.0)] end program cast_node_m_value lfortran-lfortran-2f73434/tests/complex_to_complex_cast_fortran_codegen.f900000664000175000017500000000115315141516316027446 0ustar alastairalastairprogram ImplicitComplexToComplexDifferentKindExample implicit none complex :: complexValue1 ! Default complex type complex(kind=8) :: complexValue2 ! Complex type with higher precision ! Assign a complex value complexValue1 = (1.0, 2.0) ! Complex number with default kind ! Perform an implicit complex to complex cast with different kinds complexValue2 = complexValue1 ! Output the result print *, "Complex Value 1 (Default Kind):", complexValue1 print *, "Complex Value 2 (Kind=8):", complexValue2 end program ImplicitComplexToComplexDifferentKindExample lfortran-lfortran-2f73434/tests/fixed_form_goto_select.f0000664000175000017500000000030115141516316023647 0ustar alastairalastair program main integer k k = 1 100 print *, "hello" 200 k = k+1 integer m,n m = 1 n = 2 goto (200, 100) m goto (100, 200) n end program lfortran-lfortran-2f73434/tests/save2.f900000664000175000017500000000152315141516316020336 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function module save_module_2 implicit none public real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function end module program main real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end program lfortran-lfortran-2f73434/tests/issue532.f900000664000175000017500000000050715141516316020701 0ustar alastairalastair! This is a test for https://gitlab.com/lfortran/lfortran/-/issues/532 module issue532_mod contains integer function sfloor(x) result(r) real, intent(in) :: x r = x end function integer function imodulo(x, y) result(r) integer, intent(in) :: x, y r = sfloor(real(x))*y end function end module program issue532 end program lfortran-lfortran-2f73434/tests/interface2.f900000664000175000017500000000060515141516316021340 0ustar alastairalastairmodule interface2 implicit none abstract interface subroutine read_params(this, params) import class(porous_drag_model), intent(inout) :: this type(parameter_list), pointer, intent(in) :: params end subroutine read_params end interface INTERFACE ASSIGNMENT(=) MODULE PROCEDURE SomeProc PROCEDURE SomeProc2 PROCEDURE :: SomeProc3 END INTERFACE end module lfortran-lfortran-2f73434/tests/subroutine6.f900000664000175000017500000000043315141516316021602 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, N2, i, j N = size(a) N2 = size(b) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do do concurrent (j = 1:N2) c(j) = b(j) + scalar end do end subroutine lfortran-lfortran-2f73434/tests/implicit_interface4.f900000664000175000017500000000017015141516316023231 0ustar alastairalastairsubroutine driver(f, n) integer, intent(in) :: n real :: i real(8) :: j call f(n, i, j) call driver2(f) end subroutine lfortran-lfortran-2f73434/tests/collect_occurence2.f900000664000175000017500000000015415141516316023052 0ustar alastairalastairreal function xyz() print *, "abc" xyz = 1.0 end function xyz program main print *, xyz() end program main lfortran-lfortran-2f73434/tests/modules9_module1.f900000664000175000017500000000232315141516316022504 0ustar alastairalastairmodule fpm_dependency implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency end type dependency_tree_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency end module fpm_dependency lfortran-lfortran-2f73434/tests/fixedform_assignment.f0000664000175000017500000000041515141516316023357 0ustar alastairalastair integer a, b,c,d, k a = 1 b = 2 c = a *b/2 d = c*c print *, a, b, c, d do 80 k=1,20 print *, 1 80 end do 120 if (a < b) then a = 2 * b else b = 33 * c endif end lfortran-lfortran-2f73434/tests/entry1.f900000664000175000017500000000047315141516316020543 0ustar alastairalastairprogram entry1 real :: dummy dummy = 10 call x(dummy) call y(dummy) end program subroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy dummy = 5.0 return entry y(dummy) print *, "Printed using entry statement: ", dummy return end subroutine lfortran-lfortran-2f73434/tests/real_to_real_cast_fortran_codegen.f900000664000175000017500000000062615141516316026202 0ustar alastairalastairprogram ImplicitRealToRealDifferentKindExample implicit none real :: realNumber1 ! Default real type (usually single precision) real(kind=8) :: realNumber2 ! Double precision real ! Assign a real number realNumber1 = 3.14 ! Perform an implicit real to real cast with different kinds realNumber2 = realNumber1 end program ImplicitRealToRealDifferentKindExample lfortran-lfortran-2f73434/tests/defop1.f900000664000175000017500000000026715141516316020500 0ustar alastairalastairprogram defop1 ! Tests for syntax (AST) only: e = a.in.b E = A.IN.B e = b%s.op.3**4 E = B%S.OP.3**4 e = (a+b).x.y**x e = x**x.x.x**x E = X**X.X.X**X e = ((x.x.x).in.3)**4 end program lfortran-lfortran-2f73434/tests/fixed_form_call1.f0000664000175000017500000000025315141516316022342 0ustar alastairalastair subroutine idd_frm(m,n,w,x,y) integer m,n,w,x,y,lw call prinf('lw = *',lw,1) call prinf('16m+70 = *',16*m+70,1) return end lfortran-lfortran-2f73434/tests/flush2.f900000664000175000017500000000021715141516316020520 0ustar alastairalastairprogram flush2 implicit none call flush() open(10, file="file_01_data.txt") call flush(10) call flush() end program flush2 lfortran-lfortran-2f73434/tests/interface_generic_procedure_same_name.f900000664000175000017500000000046215141516316027030 0ustar alastairalastairmodule interface_generic_procedure_same_name implicit none interface frexp function frexp(x,n) result(r) real r real, intent(in), value :: x integer, intent(out) :: n end function frexp end interface frexp end module interface_generic_procedure_same_name lfortran-lfortran-2f73434/tests/preprocessor9.f900000664000175000017500000000026215141516316022134 0ustar alastairalastairprogram preprocessor9 ! Line continuation implicit none #define X 1+2+\ 3 + 4 \ + 5 + 6 #define Y(x) 1+2+\ 3 + 4*(x) \ + 5 + 6 print *, X print *, Y(1+2) end program lfortran-lfortran-2f73434/tests/fn4.f900000664000175000017500000000131015141516316017777 0ustar alastairalastairfunction conform(mold, val, dim) type(*), intent(in) :: mold(..) type(*), intent(in), optional :: val(..) integer, intent(in), optional :: dim logical :: conform if (present(val)) then if (present(dim)) then if (dim > 0 .and. dim <= rank(mold) .and. dim <= rank(val)) then conform = size(mold, dim=dim) == size(val, dim=dim) else error stop "Runtime error: Illegal dim argument provided in conform" end if else if (rank(val) == rank(mold)) then conform = all(shape(mold) == shape(val)) else conform = .false. end if end if else conform = .true. end if end function lfortran-lfortran-2f73434/tests/print2.f900000664000175000017500000000011315141516316020526 0ustar alastairalastairprogram print2 print"(es11.5,3x "// & "es11.5)",1.d0,2.d0 end program lfortran-lfortran-2f73434/tests/preprocessor3d.h0000664000175000017500000000003415141516316022120 0ustar alastairalastair#include lfortran-lfortran-2f73434/tests/array_op_simplifier_test.f900000664000175000017500000000020315141516316024406 0ustar alastairalastairprogram main implicit none real :: a(5, 5), b(5, 5), c real, allocatable :: d(:, :) allocate(d(5, 5)) d = a + b + c end program lfortran-lfortran-2f73434/tests/fixed_form_if_variations.f0000664000175000017500000000057115141516316024206 0ustar alastairalastair subroutine f(a) integer a print *, a end subroutine program main if (0<1) then print *, "first branch" 10 continue else print *, "second branch" endif 50 call f(1) if (0<2) return if (0>1) goto 50 if (0<1) call f(2) end program lfortran-lfortran-2f73434/tests/external_02.f900000664000175000017500000000033315141516316021437 0ustar alastairalastairSUBROUTINE COBYLA (CALCFC) IMPLICIT DOUBLE PRECISION (A-H,O-Z) EXTERNAL CALCFC CALL COBYLB (CALCFC) RETURN END SUBROUTINE COBYLB (CALCFC) IMPLICIT DOUBLE PRECISION (A-H,O-Z) EXTERNAL CALCFC CALL CALCFC(CON) RETURN END lfortran-lfortran-2f73434/tests/fn5.f900000664000175000017500000000211315141516316020002 0ustar alastairalastairmodule fn5 implicit none contains function atleast(line, length, pattern) result(strout) character(len=*), intent(in) :: line integer, intent(in) :: length character(len=*), intent(in), optional :: pattern character(len=max(length, len(trim(line)))) :: strout if(present(pattern)) then strout = line//repeat(pattern, len(strout)/len(pattern)+1) else strout = line end if end function atleast subroutine print_dictionary(header,stop) character(len=:), allocatable, save :: keywords(:) character(len=:), allocatable, save :: shorts(:) character(len=:), allocatable, save :: values(:) logical, allocatable, save :: present_in(:) character(len=*), intent(in), optional :: header logical, intent(in), optional :: stop integer :: i write(*,'(a,1x,a,1x,a,1x,a)') atleast('KEYWORD',max(len(keywords),8)),'SHORT','PRESENT','VALUE' write(*,'(*(a,1x,a5,1x,l1,8x,"[",a,"]",/))') & & (atleast(keywords(i), max(len(keywords), 8)), shorts(i), present_in(i), values(i)(:), i=1, size(keywords)) end subroutine print_dictionary end module fn5 lfortran-lfortran-2f73434/tests/read1.f900000664000175000017500000000047015141516316020312 0ustar alastairalastairprogram read1 ! AST only tests read(*,*) a, b read(unit=*,fmt=*) a, b read(*,fmt=*) a, b read(*) b read(zone(1:3), '(i3)') hour read(u) b read(u, fmt=x) b, c, e read(*, fmt=x) b, c, e READ( iunit, NML=invar, IOSTAT=ierr ) READ( UNIT=iunit, NML=invar, IOSTAT=ierr ) read 10 READ 10, A, B read *, size end program lfortran-lfortran-2f73434/tests/loop_test2.f0000664000175000017500000000125215141516316021236 0ustar alastairalastair subroutine f() integer nq, m real wrk5(5), v(3, 4, 5) real ve(3, 4, 5),vev(3, 4) real zero integer l1,j,l2 integer indx DO 140 L1 = 1,NQ DO 110 J = 1,M WRK5(J) = V(INDX,J,L1) 110 CONTINUE DO 120 J = 1,M VE(INDX,L1,J) = WRK5(J) 120 CONTINUE 140 CONTINUE indx = 1 zero = 0.0d00 DO 230 L1 = 1,NQ DO 220 L2 = 1,L1 VEV(L1,L2) = ZERO DO 210 J = 1,M VEV(L1,L2) = VEV(L1,L2) + VE(INDX,L1,J)*VE(INDX,L2,J) 210 CONTINUE VEV(L2,L1) = VEV(L1,L2) 220 CONTINUE 230 CONTINUE RETURN END lfortran-lfortran-2f73434/tests/where1.f900000664000175000017500000000104115141516316020504 0ustar alastairalastairprogram test implicit none integer :: x(2, 2) = reshape([1, 2, & 3, 4], [2, 2]) where(x == 1) x = 2 else where(x == 2) x = 3 else where x = x * 2 endwhere if (all(x == reshape([2, 3, & 6, 8], [2, 2]))) then print *, 'pass' else print *, 'fail' end if where(x == 2) x = 3 elsewhere(x == 3) x = 4 elsewhere(x == 6) x = x * 2 end where if (all(x == reshape([3, 4, & 12, 8], [2, 2]))) then print *, 'pass' else print *, 'fail' end if end program testlfortran-lfortran-2f73434/tests/coarrays_01.f900000664000175000017500000000321215141516316021436 0ustar alastairalastairprogram coarrays_01 ! This test should test most of coarray syntax: ! * declarations ! * allocations ! * coarray operations ! ! You can test the syntax manually with GFortran by: ! gfortran -fcoarray=lib -c coarrays_01.f90 -o a.o ! use iso_fortran_env, only : event_type implicit none ! Coarray Declarations real, dimension(100), codimension[*] :: A integer :: B[3,*] integer :: c[*] real :: D(100,2)[3,*] real :: E(1,2,3)[1,2,-1:3,*] real, allocatable :: F(:)[:] real, allocatable :: g(:,:,:)[:,:,:] real, dimension(20), codimension[20,*] :: h real, codimension[:], allocatable :: z(:,:) character :: r(20)[20,0:*] type(event_type) :: ok_to_overwrite[*] type(event_type), allocatable :: greeting_ready(:)[:] integer :: i, n ! Allocation n = 5 allocate(F(n)[*]) allocate(greeting_ready(num_images())[*]) allocate(g(50,50,50)[1:2, 1:2, *]) ! Array access, events, teams if (this_image() == 1) then do i= 2,num_images() c = c + c[i] event post(ok_to_overwrite[i]) end do else event wait(ok_to_overwrite) event post(greeting_ready(this_image())[1]) end if syncall syncall() sync all(stat=status) sync all(errmsg=status) event wait(variable, until_count=status) event wait(variable, until_count=status, errmsg=status) event wait(variable, errmsg=status) event wait(variable, stat=status) event post (done (sub (i)) [parent (i)], stat=status) event post(variable, stat=status) event post(variable, errmsg=status) s%a(3)(4) = 'S' s%b[3] = c[4] s%c(3)[4] = f(3)[4] c[3] = c[4] B[1,2] = B[3,4] D(99,1)[3,4] = D(1,2)[1,2] D(99,1)[3,3] = 5 D(:,1)[3,3] = 5 D(:,1)[3,3,team=3] = 5 D(:,1)[3,3,team=3,stat=i] = 5 D(:,1)[3,3,stat=i] = 5 end program lfortran-lfortran-2f73434/tests/data2.f900000664000175000017500000000044215141516316020310 0ustar alastairalastairprogram main call a() end program subroutine a() double precision factor, zero data factor,zero /1.0d2,0.0d0/ print *, "factor in a:", factor call b(factor) end subroutine subroutine b(factor) double precision factor print *, "factor: ", factor end subroutinelfortran-lfortran-2f73434/tests/fixed_form_early_doloop.f0000664000175000017500000000023415141516316024035 0ustar alastairalastair program main integer k, l do 100 k=1,2 do 100 l=1,3 print *, k, l 100 continue end program lfortran-lfortran-2f73434/tests/implied_do_loop1.f900000664000175000017500000000037715141516316022543 0ustar alastairalastairPROGRAM implied_do_loop1 INTEGER :: i, j REAL, DIMENSION(2) :: A A(1) = 12.9 A(2) = 12.9 print *, (i, A(i), i = 1, 2) ! write(11, *) (i, ( j, A(j), j = 1, 2), A(i), i = 1, 2) print *, (i, ( j, A(j), j = 1, 2), A(i), i = 1, 2) END PROGRAM implied_do_loop1 lfortran-lfortran-2f73434/tests/tests.toml0000664000175000017500000024404215141516316021042 0ustar alastairalastair# Possible tests: # tokens ... run the Lexer and output tokens, compare against reference version # ast ... run the Parser and output AST, compare against reference version # asr ... run the Semantics and output ASR, compare against reference version # bin ... run the CodeGen and output bin, compare against reference bin [[test]] filename = "subroutine1.f90" tokens = true ast_indent = true asr_indent = true asr_clojure = true ast = true julia = true [[test]] filename = "../integration_tests/template_add_01.f90" asr = true [[test]] filename = "../integration_tests/template_add_01b.f90" asr = true [[test]] filename = "../integration_tests/template_add_01c.f90" asr = true [[test]] filename = "../integration_tests/template_add_02.f90" asr = true [[test]] filename = "../integration_tests/template_add_03.f90" asr = true [[test]] filename = "../integration_tests/template_add_04.f90" asr = true [[test]] filename = "../integration_tests/template_nested.f90" ast = true asr = true [[test]] filename = "../integration_tests/template_travel_01.f90" ast = true asr = true [[test]] filename = "../integration_tests/template_travel_01b.f90" asr = true [[test]] filename = "../integration_tests/template_travel_02.f90" asr = true [[test]] filename = "../integration_tests/template_triple.f90" asr = true [[test]] filename = "../integration_tests/template_array_01.f90" asr = true [[test]] filename = "../integration_tests/template_array_02.f90" asr = true [[test]] filename = "../integration_tests/template_array_03.f90" asr = true [[test]] filename = "../integration_tests/template_array_04.f90" asr = true [[test]] filename = "../integration_tests/template_array_04b.f90" asr = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_array_05.f90" # asr = true [[test]] filename = "../integration_tests/template_02.f90" asr = true ast = true [[test]] filename = "../integration_tests/template_03.f90" asr = true [[test]] filename = "../integration_tests/template_03b.f90" ast = true asr = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_04.f90" # asr = true [[test]] filename = "../integration_tests/template_05.f90" asr = true [[test]] filename = "../integration_tests/template_struct_01.f90" asr = true ast = true # TODO: StructType - Uncomment after fixing symbol outside scope error for ttype # [[test]] # filename = "../integration_tests/template_matrix_01.f90" # asr = true [[test]] filename = "../integration_tests/template_vector.f90" asr = true [[test]] filename = "../integration_tests/template_simple_01.f90" asr = true [[test]] filename = "../integration_tests/template_simple_02.f90" asr = true [[test]] filename = "../integration_tests/template_simple_03.f90" asr = true [[test]] filename = "../integration_tests/template_simple_04.f90" asr = true [[test]] filename = "../integration_tests/template_sort_01.f90" asr = true [[test]] filename = "../integration_tests/template_sort_02.f90" asr = true [[test]] filename = "../integration_tests/template_lapack_01.f90" asr = true [[test]] filename = "../integration_tests/template_interface_01.f90" asr = true [[test]] filename = "../integration_tests/template_commutative.f90" asr = true [[test]] filename = "../integration_tests/test_backspace_01.f90" asr = true [[test]] filename = "../integration_tests/openmp_36.f90" asr = true [[test]] filename = "../integration_tests/openmp_37.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_38.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_39.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_44.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_45.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_46.f90" asr_openmp = true [[test]] filename = "../integration_tests/openmp_70.f90" c_target_omp = true [[test]] filename = "../integration_tests/openmp_71.f90" c_target_cuda = true [[test]] filename = "../integration_tests/openmp_72.f90" c_target_cuda = true [[test]] filename = "subroutine2.f90" ast = true [[test]] filename = "subroutine3.f90" ast = true asr = true llvm = true obj = true julia = true [[test]] filename = "subroutine3b.f90" ast = true asr = true julia = true [[test]] filename = "do1.f90" interactive = true ast = true [[test]] filename = "do2.f90" ast = true [[test]] filename = "do3.f90" ast = true [[test]] filename = "do4.f90" ast = true [[test]] filename = "do5.f90" ast = true [[test]] filename = "do6.f90" ast = true [[test]] filename = "do7.f90" llvm = true [[test]] filename = "subroutine4.f90" ast = true ast_f90 = true asr = true cpp = true julia = true [[test]] filename = "do_concurrent_reduce.f90" ast = true ast_f90 = true cpp = true [[test]] filename = "do_concurrent_reduce2.f90" ast = true ast_f90 = true [[test]] filename = "do_concurrent_reduce3.f90" ast = true ast_f90 = true [[test]] filename = "subroutine5.f90" ast = true asr = true cpp = true julia = true [[test]] filename = "subroutine6.f90" ast = true cpp = true julia = true [[test]] filename = "subroutine7.f90" ast = true asr = true julia = true [[test]] filename = "../integration_tests/abort_01.f90" llvm = true [[test]] filename = "errors/array_size_01.f90" asr = true [[test]] filename = "errors/array_size_02.f90" asr = true [[test]] filename = "errors/array_size_03.f90" asr = true [[test]] filename = "errors/array_size_04.f90" asr = true [[test]] filename = "errors/array_size_05.f90" asr = true [[test]] filename = "errors/matrix_transpose_01.f90" asr = true [[test]] filename = "errors/matrix_matmul_01.f90" asr = true [[test]] filename = "errors/matrix_matmul_02.f90" asr = true [[test]] filename = "errors/matrix_matmul_03.f90" asr = true [[test]] filename = "errors/matrix_matmul_04.f90" asr = true [[test]] filename = "errors/matrix_matmul_05.f90" asr = true [[test]] filename = "errors/matrix_matmul_06.f90" asr = true [[test]] filename = "errors/array_transfer_01.f90" asr = true [[test]] filename = "errors/esub1.f90" tokens = true ast = true [[test]] filename = "errors/esub2.f90" tokens = true ast = true [[test]] filename = "errors/subroutine5.f90" asr = true [[test]] filename = "errors/dim_assgn_test.f90" asr = true [[test]] filename = "errors/redeclaration1.f90" asr = true [[test]] filename = "errors/type_mismatch1.f90" asr = true [[test]] filename = "errors/type_mismatch2.f90" asr = true [[test]] filename = "errors/implicit_call_02.f90" asr_implicit_interface = true asr_implicit_argument_casting = true [[test]] filename = "errors/cpp1.f90" asr_preprocess = true [[test]] filename = "errors/cpp2.f90" asr_preprocess = true [[test]] filename = "errors/cpp3.f90" asr_preprocess = true [[test]] filename = "errors/cpp4.f90" asr_preprocess = true [[test]] filename = "errors/cpp5.f90" asr_preprocess = true [[test]] filename = "errors/cpp6.f90" asr_preprocess = true [[test]] filename = "errors/cpp7.f90" asr_preprocess = true [[test]] filename = "errors/cpp8.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err1.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err2.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err3.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err4.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err5.f90" asr_preprocess = true [[test]] filename = "errors/cpp_err6.f90" asr_preprocess = true [[test]] filename = "errors/template_error_01a.f90" asr = true [[test]] filename = "errors/template_error_01b.f90" asr = true [[test]] filename = "errors/template_error_02.f90" asr = true [[test]] filename = "errors/template_error_03.f90" asr = true [[test]] filename = "errors/template_error_04.f90" asr = true [[test]] filename = "errors/template_error_05.f90" asr = true [[test]] filename = "errors/template_error_06.f90" asr = true [[test]] filename = "errors/template_error_07a.f90" asr = true [[test]] filename = "errors/template_error_07b.f90" asr = true [[test]] filename = "errors/template_error_07c.f90" asr = true [[test]] filename = "errors/template_error_08.f90" asr = true [[test]] filename = "errors/template_error_07.f90" asr = true [[test]] filename = "errors/template_error_09.f90" asr = true [[test]] filename = "errors/maskl_incorrect_bit_size.f90" asr = true [[test]] filename = "errors/maskr_incorrect_bit_size.f90" asr = true [[test]] filename = "errors/maskl_negative.f90" asr = true [[test]] filename = "errors/maskr_negative.f90" asr = true [[test]] filename = "errors/nint_overflow.f90" asr = true [[test]] filename = "errors/dint_args.f90" asr = true [[test]] filename = "errors/dnint_args.f90" asr = true [[test]] filename = "warnings/dim_assgn_test.f90" asr = true [[test]] filename = "warnings/character_01.f90" asr = true [[test]] filename = "warnings/character_02.f90" asr = true [[test]] filename = "warnings/character_03.f90" asr = true [[test]] filename = "warnings/preprocess_01.f90" asr = true [[test]] filename = "preprocessor1.f90" asr_preprocess = true [[test]] filename = "preprocessor2.f90" asr_preprocess = true [[test]] filename = "preprocessor3.f90" asr_preprocess = true [[test]] filename = "preprocessor4.f90" asr_preprocess = true [[test]] filename = "preprocessor5.f90" asr_preprocess = true [[test]] filename = "preprocessor6.f90" asr_preprocess = true [[test]] filename = "preprocessor7.f90" asr_preprocess = true [[test]] filename = "preprocessor8.f90" asr_preprocess = true [[test]] filename = "preprocessor9.f90" asr_preprocess = true [[test]] filename = "preprocessor10.f90" asr_preprocess = true [[test]] filename = "preprocessor11.f90" asr_preprocess = true [[test]] filename = "preprocessor12.f90" asr_preprocess = true [[test]] filename = "preprocessor13.f90" asr_preprocess = true [[test]] filename = "preprocessor14.f90" asr_preprocess = true [[test]] filename = "preprocessor15.f90" asr_preprocess = true [[test]] filename = "preprocessor16.f90" asr_preprocess = true [[test]] filename = "preprocessor17.F90" cpp_infer = true asr = true [[test]] filename = "preprocessor18.f90" asr_preprocess = true [[test]] filename = "preprocessor19.f90" asr_preprocess = true [[test]] filename = "preprocessor20.f90" asr_preprocess = true [[test]] filename = "preprocessor21.f90" asr_preprocess = true [[test]] filename = "preprocessor22.f90" asr_preprocess = true [[test]] filename = "expr1.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "expr2.f90" interactive = true ast = true asr = true llvm = true obj = true pass = "global_stmts" [[test]] filename = "expr3.f90" interactive = true ast = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "expr4.f90" interactive = true ast = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "expr5.f90" ast = true asr = true llvm = true obj = true fortran = true [[test]] filename = "expr6.f90" interactive = true asr = true pass = "global_stmts" llvm = true [[test]] filename = "execute_command_line.f90" llvm = true [[test]] filename = "expr7.f90" interactive = true tokens = true ast = true ast_f90 = true [[test]] filename = "expr8.f90" tokens = true interactive = true ast = true ast_f90 = true [[test]] filename = "expr9.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "wasm1.f90" wat = true [[test]] filename = "wasm_i64.f90" wat = true [[test]] filename = "wasm_unary_minus.f90" wat = true [[test]] filename = "../integration_tests/types_16.f90" wat = true [[test]] filename = "wasm_main_program.f90" wat = true [[test]] filename = "wasm_bind_js.f90" wat = true [[test]] filename = "../integration_tests/cpu_time_02_wasm.f90" wat = true [[test]] filename = "../integration_tests/if_05.f90" wat = true julia = true [[test]] filename = "../integration_tests/abs_01.f90" wat = true [[test]] filename = "../integration_tests/abs_03.f90" wat = true [[test]] filename = "stop.f90" asr = true llvm = true [[test]] filename = "stop1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/stop_03.f90" run = true [[test]] filename = "../integration_tests/error_stop_04.f90" run = true [[test]] filename = "../integration_tests/write_12.f90" run = true [[test]] filename = "../integration_tests/submodule_01.f90" ast = true [[test]] filename = "../integration_tests/submodule_02.f90" asr = true [[test]] filename = "../integration_tests/submodule_04.f90" asr = true [[test]] filename = "program1.f90" ast = true asr = true llvm = true obj = true cpp = true x86 = true [[test]] filename = "program2.f90" ast = true [[test]] filename = "program3.f90" ast = true asr = true cpp = true c = true [[test]] filename = "program4.f90" ast = true asr = true cpp = true c = true [[test]] filename = "../integration_tests/program_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/program_cmake_01.f90" ast = true asr = true llvm = true obj = true x86 = true [[test]] filename = "../integration_tests/print_01.f90" llvm = true [[test]] filename = "../integration_tests/variables_03.f90" llvm = true [[test]] filename = "../integration_tests/while_01.f90" llvm = true [[test]] filename = "../integration_tests/while_02.f90" llvm = true [[test]] filename = "../integration_tests/program_cmake_02.f90" ast = true [[test]] filename = "../integration_tests/doconcurrentloop_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/cond_02.f90" asr = true pass = "dead_code_removal" [[test]] filename = "../integration_tests/expr_13.f90" asr = true pass = "flip_sign" cumulative = true [[test]] filename = "array_op_simplifier_test.f90" asr = true pass = "array_struct_temporary,array_op" [[test]] filename = "../integration_tests/struct_allocate.f90" asr = true [[test]] filename = "../integration_tests/doloop_01.f90" asr = true llvm = true pass = "do_loops" wat = true julia = true [[test]] filename = "../integration_tests/doloop_02.f90" asr = true llvm = true wat = true julia = true [[test]] filename = "../integration_tests/doloop_03.f90" asr = true llvm = true wat = true julia = true [[test]] filename = "../integration_tests/doloop_04.f90" ast = true ast_f90 = true asr = true llvm = true pass = "do_loops" [[test]] filename = "../integration_tests/doloop_05.f90" ast_f90 = true julia = true [[test]] filename = "../integration_tests/doloop_08.f90" c = true cpp = true julia = true [[test]] filename = "../integration_tests/subroutines_01.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_02.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_03.f90" ast = true julia = true [[test]] filename = "../integration_tests/subroutines_04.f90" ast = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/subroutines_05.f90" asr = true [[test]] filename = "../integration_tests/subroutines_06.f90" asr = true [[test]] filename = "../integration_tests/subroutines_07.f90" asr = true [[test]] filename = "../integration_tests/subroutines_09.f90" asr = true [[test]] filename = "../integration_tests/subroutines_10.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/data_01.f90" ast = true [[test]] filename = "../integration_tests/data_02.f90" ast = true [[test]] filename = "../integration_tests/data_12.f90" ast = true asr = true [[test]] filename = "../integration_tests/data_14.f90" ast = true [[test]] filename = "scopes1.f90" asr = true [[test]] filename = "global_scope1.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope2.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope3.f90" interactive = true ast = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope4.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope5.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope6.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope7.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope8.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "global_scope9.f90" interactive = true asr = true llvm = true pass = "global_stmts" [[test]] filename = "kokkos_program1.f90" cpp = true [[test]] filename = "kokkos_program2.f90" asr = true cpp = true [[test]] filename = "array1.f90" ast = true asr = true cpp = true julia = true [[test]] filename = "array2.f90" ast = true asr = true llvm = true cpp = true julia = true [[test]] filename = "array3.f90" tokens = true ast = true asr = true cpp = true julia = true [[test]] filename = "array4.f90" ast = true [[test]] filename = "array5.f90" ast = true [[test]] filename = "array6.f90" ast = true ast_f90 = true [[test]] filename = "array7.f90" ast = true ast_f90 = true [[test]] filename = "array8.f90" ast = true ast_f90 = true [[test]] filename = "array9.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_23.f90" asr = true [[test]] filename = "array12.f90" asr = true [[test]] filename = "array13.f90" pass = "init_expr" [[test]] filename = "array14.f90" run = true [[test]] filename = "array15.f90" pass = "array_op" [[test]] filename = "array16.f90" run = true [[test]] filename = "../integration_tests/arrays_01.f90" cpp = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/arrays_05.f90" asr = true julia = true [[test]] filename = "../integration_tests/arrays_01_size.f90" asr = true llvm = true julia = true [[test]] filename = "../integration_tests/arrays_02_size.f90" asr = true julia = true [[test]] filename = "../integration_tests/matrix_01_transpose.f90" asr = true [[test]] filename = "../integration_tests/matrix_02_matmul.f90" asr = true [[test]] filename = "../integration_tests/array_01_pack.f90" asr = true [[test]] filename = "../integration_tests/array_01_transfer.f90" asr = true [[test]] filename = "../integration_tests/array_02_pack.f90" asr = true [[test]] filename = "../integration_tests/array_02_transfer.f90" asr = true [[test]] filename = "../integration_tests/array_03_transfer.f90" asr = true [[test]] filename = "../integration_tests/arrays_01_real.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_01_complex.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_01_logical.f90" asr = true llvm = true [[test]] filename = "../integration_tests/array_bound_1.f90" asr = true llvm = true [[test]] filename = "../integration_tests/arrays_op_6.f90" asr = true [[test]] filename = "../integration_tests/arrays_op_10.f90" asr = true pass = "array_op" [[test]] filename = "../integration_tests/arrays_reshape_14.f90" asr = true [[test]] filename = "../integration_tests/arrays_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_03_func.f90" asr = true cpp = true julia = true [[test]] filename = "../integration_tests/arrays_04_func.f90" asr = true cpp = true julia = true [[test]] filename = "../integration_tests/arrays_08_func.f90" asr = true julia = true [[test]] filename = "../integration_tests/arrays_09.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/arrays_10.f90" asr = true [[test]] filename = "../integration_tests/arrays_20.f90" asr = true # TODO: Implement maxloc # [[test]] # filename = "../integration_tests/arrays_21.f90" # asr = true [[test]] filename = "../integration_tests/types_01.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_02.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_03.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_04.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_05.f90" asr = true llvm = true cpp = true wat = true [[test]] filename = "../integration_tests/types_06.f90" asr = true llvm = true cpp = true [[test]] filename = "../integration_tests/types_07.f90" ast = true [[test]] filename = "../integration_tests/types_08.f90" ast = true [[test]] filename = "../integration_tests/types_09.f90" ast = true [[test]] filename = "../integration_tests/types_10.f90" ast = true [[test]] filename = "../integration_tests/types_11.f90" ast = true [[test]] filename = "../integration_tests/types_12.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_15.f90" wat = true [[test]] filename = "boz1.f90" tokens = true [[test]] filename = "derived_type1.f90" asr = true [[test]] filename = "derived_types_02.f90" ast = true ast_f90 = true [[test]] filename = "derived_types_03.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/derived_types_04.f90" asr = true [[test]] filename = "../integration_tests/derived_types_05.f90" asr = true [[test]] filename = "../integration_tests/derived_types_01.f90" ast = true ast_f90 = true asr = true [[test]] filename = "../integration_tests/derived_types_02.f90" ast = true [[test]] filename = "../integration_tests/derived_types_03.f90" ast = true asr = true ast_f90 = true [[test]] filename = "../integration_tests/derived_types_06.f90" asr = true [[test]] filename = "../integration_tests/derived_types_07.f90" asr = true [[test]] filename = "../integration_tests/derived_types_08.f90" asr = true [[test]] filename = "../integration_tests/derived_types_11.f90" asr = true [[test]] filename = "../integration_tests/derived_types_17.f90" asr = true [[test]] filename = "derived_types_04.f90" asr = true [[test]] filename = "derived_types_06.f90" asr = true extrafiles = "derived_types_04.f90, derived_types_05.f90" [[test]] filename = "../integration_tests/derived_types_14.f90" asr = true extrafiles = "../integration_tests/derived_types_14_module.f90" [[test]] filename = "../integration_tests/derived_types_19.f90" asr = true extrafiles = "../integration_tests/derived_types_19_module.f90" [[test]] filename = "derived_types_07.f90" asr = true [[test]] filename = "derived_types_09.f90" ast = true [[test]] filename = "derived_types_10.f90" asr = true [[test]] filename = "modules1.f90" asr = true extrafiles = "modules1_module1.f90, modules1_module2.f90" [[test]] filename = "modules2.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90" [[test]] filename = "modules3.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90, modules2.f90" [[test]] filename = "modules4.f90" asr = true extrafiles = "modules2_module_a.f90, modules2_module_b_base.f90, modules2_module_b.f90, modules2.f90, modules3.f90, modules4_module.f90" [[test]] filename = "../integration_tests/select_type_04.f90" asr = true extrafiles = "../integration_tests/select_type_03_module.f90, ../integration_tests/select_type_03.f90" [[test]] filename = "fn2.f90" asr = true cpp = true [[test]] filename = "fn3.f90" ast = true [[test]] filename = "fn4.f90" ast = true ast_f90 = true [[test]] filename = "fn5.f90" asr = true [[test]] filename = "fn6.f90" asr = true [[test]] filename = "forall1.f90" ast = true ast_f90 = true [[test]] filename = "subroutine8.f90" ast = true [[test]] filename = "empty.f90" ast = true asr = true llvm = true obj = true wat = true [[test]] filename = "../integration_tests/line_continuation_01.f90" ast = true [[test]] filename = "../integration_tests/line_continuation_03.f90" ast = true [[test]] filename = "modules_02.f90" ast = true [[test]] filename = "interface1.f90" ast = true [[test]] filename = "interface2.f90" ast = true ast_f90 = true [[test]] filename = "interface3.f90" ast = true [[test]] filename = "interface4.f90" ast = true [[test]] filename = "errors/passing_array_01.f90" run = true [[test]] filename = "../integration_tests/modules_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/modules_02.f90" ast = true asr = true [[test]] filename = "../integration_tests/modules_03.f90" ast = true [[test]] filename = "../integration_tests/modules_04.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/modules_05.f90" ast = true [[test]] filename = "../integration_tests/modules_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/allocate_01.f90" asr = true [[test]] filename = "../integration_tests/allocate_02.f90" asr = true [[test]] filename = "../integration_tests/allocate_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/allocate_04.f90" asr = true [[test]] filename = "../integration_tests/allocate_05.f90" asr = true [[test]] filename = "allocate_01.f90" ast = true ast_f90 = true [[test]] filename = "allocate_02.f90" llvm = true [[test]] filename = "errors/allocate_01.f90" run = true [[test]] filename = "errors/allocated_04.f90" run = true [[test]] filename = "errors/allocated_05.f90" run = true [[test]] filename = "finalize_01.f90" pass = "insert_deallocate" llvm = true [[test]] filename = "finalize_02.f90" llvm = true [[test]] filename = "../integration_tests/block_01.f90" asr = true [[test]] filename = "../integration_tests/block_02.f90" ast = true ast_f90 = true julia = true [[test]] filename = "../integration_tests/block_03.f90" asr = true julia = true [[test]] filename = "../integration_tests/associate_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/associate_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_04.f90" asr = true llvm = true [[test]] filename = "../integration_tests/associate_05.f90" asr = true [[test]] filename = "../integration_tests/associate_07.f90" asr = true [[test]] filename = "../integration_tests/associate_08.f90" asr = true [[test]] filename = "write1.f90" ast = true ast_f90 = true [[test]] filename = "write2.f90" asr = true [[test]] filename = "write3.f90" llvm = true [[test]] filename = "write4.f90" run = true [[test]] filename = "write5.f90" run = true [[test]] filename = "write6.f90" run = true [[test]] filename = "write7.f90" asr = true [[test]] filename = "errors/write_01.f90" run = true [[test]] filename = "errors/write_02.f90" run = true [[test]] filename = "read1.f90" ast = true ast_f90 = true [[test]] filename = "read2.f90" run = true [[test]] filename = "open1.f90" ast = true ast_f90 = true [[test]] filename = "close1.f90" ast = true ast_f90 = true [[test]] filename = "nullify1.f90" ast = true ast_f90 = true [[test]] filename = "builtin1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/interface_01.f90" ast = true asr = true ast_f90 = true [[test]] filename = "../integration_tests/interface_02.f90" ast = true [[test]] filename = "../integration_tests/interface_03.f90" ast = true [[test]] filename = "../integration_tests/interface_04.f90" asr = true [[test]] filename = "../integration_tests/interface_05.f90" asr = true [[test]] filename = "../integration_tests/interface_08.f90" asr = true [[test]] filename = "../integration_tests/interface_10.f90" asr = true [[test]] filename = "../integration_tests/if_04.f90" ast = true wat = true [[test]] filename = "../integration_tests/case_01.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_02.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_03.f90" ast = true ast_f90 = true asr = true llvm = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_04.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/case_05.f90" ast = true ast_f90 = true asr = true julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_06.f90" asr = true pass = "dead_code_removal" julia = true c = true cpp = true [[test]] filename = "../integration_tests/case_07.f90" pass = "select_case" [[test]] filename = "../integration_tests/include_01.f90" ast = true [[test]] filename = "../integration_tests/program_02.f90" ast = true [[test]] filename = "../integration_tests/where_01.f90" ast = true asr = true pass = "where" [[test]] filename = "../integration_tests/forallloop_01.f90" ast = true [[test]] filename = "../integration_tests/parameter_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/parameter_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/parameter_03.f90" asr = true [[test]] filename = "../integration_tests/parameter_04.f90" asr = true # IntegerToReal [[test]] filename = "../integration_tests/parameter_05.f90" asr = true [[test]] filename = "do_concurrent1.f90" ast = true [[test]] filename = "do_concurrent2.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/doconcurrentloop_01.f90" ast_f90 = true [[test]] filename = "../integration_tests/do_concurrent_01.f90" pass = "openmp" options = "--mlir-gpu-offloading --openmp" [[test]] filename = "subroutine9.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_13.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/types_14.f90" asr = true [[test]] filename = "../integration_tests/namelist_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/namelist_02.f90" asr = true [[test]] filename = "select_type1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/select_type_03.f90" asr = true extrafiles = "../integration_tests/select_type_03_module.f90" [[test]] filename = "selectrank1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/select_type_01.f90" asr = true [[test]] filename = "../integration_tests/select_type_02.f90" asr = true [[test]] filename = "../integration_tests/format_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/format_02.f90" ast = true ast_f90 = true [[test]] filename = "format1.f90" run = true [[test]] filename = "format3.f90" run = true [[test]] filename = "format4.f90" run = true [[test]] filename = "format5.f90" run = true [[test]] filename = "format6.f90" run = true [[test]] filename = "format7.f90" run = true [[test]] filename = "format8.f90" run = true [[test]] filename = "../integration_tests/format_11.f90" run = true [[test]] filename = "../integration_tests/format_12.f90" run = true [[test]] filename = "../integration_tests/format_21.f90" run = true [[test]] filename = "../integration_tests/format_22.f90" run = true [[test]] filename = "../integration_tests/format_23.f90" run = true [[test]] filename = "../integration_tests/format_24.f90" run = true [[test]] filename = "../integration_tests/format_25.f90" run = true [[test]] filename = "../integration_tests/format_26.f90" run = true [[test]] filename = "../integration_tests/format_27.f90" run = true [[test]] filename = "../integration_tests/format_28.f90" run = true [[test]] filename = "../integration_tests/format_29.f90" run = true [[test]] filename = "../integration_tests/format_30.f90" run = true [[test]] filename = "../integration_tests/format_31.f90" run = true [[test]] filename = "../integration_tests/format_32.f90" run = true [[test]] filename = "../integration_tests/format_34.f90" run = true [[test]] filename = "../integration_tests/format_35.f90" run = true [[test]] filename = "../integration_tests/format_37.f90" run = true [[test]] filename = "../integration_tests/format_39.f90" run = true [[test]] filename = "../integration_tests/format_40.f90" run = true [[test]] filename = "../integration_tests/format_50.f90" run = true [[test]] filename = "../integration_tests/format_51.f90" run = true [[test]] filename = "../integration_tests/format_52.f90" run = true [[test]] filename = "../integration_tests/format_53.f90" run = true [[test]] filename = "../integration_tests/format_57.f90" run = true [[test]] filename = "../integration_tests/format_58.f90" run = true [[test]] filename = "../integration_tests/print_09.f90" run = true [[test]] filename = "interop/mod1-14.mod" mod_to_asr = true [[test]] filename = "fmt1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "assign.f90" ast = true ast_f90 = true [[test]] filename = "associate1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "fn_call1.f90" interactive = true ast = true ast_f90 = true [[test]] filename = "Subroutine_Call1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/reserved_01.f90" ast_f90 = true [[test]] filename = "../integration_tests/reserved_02.f90" ast_f90 = true [[test]] filename = "../integration_tests/complex_01.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/complex_02.f90" ast = true asr = true [[test]] filename = "../integration_tests/complex_07.f90" asr = true [[test]] filename = "../integration_tests/complex_09.f90" asr = true [[test]] filename = "errors/complex_01.f90" asr = true [[test]] filename = "errors/incorrect_array_type_where_01.f90" asr = true [[test]] filename = "errors/incorrect_array_type_where_02.f90" asr = true [[test]] filename = "errors/incorrect_type_where_01.f90" asr = true [[test]] filename = "errors/incorrect_type_where_02.f90" asr = true [[test]] filename = "errors/incorrect_type_where_03.f90" asr = true [[test]] filename = "errors/incorrect_type_where_04.f90" asr = true [[test]] filename = "../integration_tests/complex_sub_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_mul_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_div_test.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_pow_test.f90" asr = true llvm = true [[test]] filename = "complex1.f90" asr = true llvm = true [[test]] filename = "complex2.f90" asr = true llvm = true [[test]] filename = "complex3.f90" ast = true [[test]] filename = "../integration_tests/logical1.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical2.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical3.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/logical4.f90" asr = true llvm = true wat = true [[test]] filename = "../integration_tests/real_dp_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/real_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/init_values.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bin_op_real_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/const_real_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/int_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/int_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_dp.f90" asr = true llvm = true [[test]] filename = "../integration_tests/complex_dp_param.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bin_op_complex_dp.f90" asr = true llvm = true # sin [[test]] filename = "../integration_tests/intrinsics_02.f90" asr = true cpp = true llvm = true # sin [[test]] filename = "../integration_tests/sin_03.f90" asr = true llvm = true # cos [[test]] filename = "../integration_tests/intrinsics_03.f90" asr = true llvm = true # tan [[test]] filename = "../integration_tests/intrinsics_04.f90" asr = true # hyperbolics [[test]] filename = "../integration_tests/intrinsics_05.f90" asr = true llvm = true # inverse trignometric functions [[test]] filename = "../integration_tests/intrinsics_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/intrinsics_07.f90" asr = true # tiny (symboltable) [[test]] filename = "../integration_tests/intrinsics_08.f90" asr = true # tiny (body) [[test]] filename = "../integration_tests/intrinsics_09.f90" asr = true # real (body) [[test]] filename = "../integration_tests/intrinsics_10.f90" asr = true # real (symboltable) [[test]] filename = "../integration_tests/intrinsics_11.f90" asr = true # kind (body) [[test]] filename = "../integration_tests/intrinsics_12.f90" asr = true # kind (symboltable) [[test]] filename = "../integration_tests/intrinsics_13.f90" asr = true # selected_int,real_kind (parameter_04 has symboltable) [[test]] filename = "../integration_tests/intrinsics_14.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_20.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_23.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_26.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_27.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_28.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_29.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_30.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_31.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_33.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_34.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_35.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_36.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_39.f90" asr = true # all [[test]] filename = "../integration_tests/intrinsics_47.f90" asr = true # floor (body) [[test]] filename = "../integration_tests/floor_01.f90" asr = true # floor (symboltable) [[test]] filename = "../integration_tests/floor_02.f90" asr = true # int (body) [[test]] filename = "../integration_tests/int_01.f90" asr = true # int (symboltable) [[test]] filename = "../integration_tests/int_02.f90" asr = true # int (large integer) [[test]] filename = "../integration_tests/int_03.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_open_close_read_write.f90" asr = true [[test]] filename = "modules_03.f90" asr = true [[test]] filename = "modules_04.f90" asr = true ast_f90 = true [[test]] filename = "modules_05.f90" asr = true [[test]] filename = "modules_06.f90" ast = true asr = true [[test]] filename = "modules_07.f90" asr = true [[test]] filename = "modules_10.f90" asr_json = true [[test]] filename = "../integration_tests/modules_27.f90" asr = true extrafiles = "../integration_tests/modules_27_module1.f90, ../integration_tests/modules_27_module2.f90" [[test]] filename = "../integration_tests/modules_25.f90" asr = true extrafiles = "../integration_tests/modules_25_module.f90, ../integration_tests/modules_25_module1.f90" [[test]] filename = "../integration_tests/modules_28.f90" asr = true extrafiles = "../integration_tests/modules_28_module1.f90, ../integration_tests/modules_28_module2.f90" [[test]] filename = "../integration_tests/modules_29.f90" asr = true extrafiles = "../integration_tests/modules_29_module1.f90, ../integration_tests/modules_29_module2.f90, ../integration_tests/modules_29_module3.f90" [[test]] filename = "../integration_tests/modules_30.f90" asr = true extrafiles = "../integration_tests/modules_30_module1.f90, ../integration_tests/modules_30_module2.f90, ../integration_tests/modules_30_module3.f90, ../integration_tests/modules_30_module4.f90" [[test]] filename = "../integration_tests/modules_31.f90" asr = true extrafiles = "../integration_tests/modules_31_module1.f90, ../integration_tests/modules_31_module2.f90" [[test]] filename = "../integration_tests/modules_32.f90" asr = true [[test]] filename = "../integration_tests/modules_33.f90" asr = true extrafiles = "../integration_tests/modules_33_module1.f90, ../integration_tests/modules_33_module2.f90, ../integration_tests/modules_33_module3.f90" [[test]] filename = "../integration_tests/modules_34.f90" asr = true extrafiles = "../integration_tests/modules_34_module1a.f90, ../integration_tests/modules_34_module1.f90, ../integration_tests/modules_34_module2.f90, ../integration_tests/modules_34_module3.f90" [[test]] filename = "../integration_tests/modules_52.f90" asr = true extrafiles = "../integration_tests/modules_52_module3.f90, ../integration_tests/modules_52_module2.f90, ../integration_tests/modules_52_module1.f90" [[test]] filename = "../integration_tests/modules_60.f90" asr = true [[test]] filename = "../integration_tests/modules_36.f90" llvm = true [[test]] filename = "dependency_test_01.f90" asr = true [[test]] filename = "dependency_test_02.f90" asr = true [[test]] filename = "dependency_test_03.f90" asr = true extrafiles = "dependency_test_03_module.f90" [[test]] filename = "string.f90" ast_f90 = true [[test]] filename = "string1.f90" asr = true [[test]] filename = "string2.f90" asr = true extrafiles = "string1.f90" [[test]] filename = "../integration_tests/string_54.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_01.f90" ast = true asr = true llvm = true cpp = true [[test]] filename = "../integration_tests/string_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/string_03.f90" ast = true ast_f90 = true asr = true llvm = true [[test]] filename = "../integration_tests/string_04.f90" asr = true [[test]] filename = "../integration_tests/string_10.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_11.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_13.f90" asr = true llvm = true [[test]] filename = "../integration_tests/string_14.f90" asr = true [[test]] filename = "../integration_tests/string_17.f90" asr = true [[test]] filename = "../integration_tests/string_19.f90" asr = true [[test]] filename = "../integration_tests/string_12.f90" asr = true [[test]] filename = "errors/string_binop.f90" asr = true [[test]] filename = "../integration_tests/parsing_01.f90" ast = true [[test]] filename = "../integration_tests/parsing_02.f90" ast = true [[test]] filename = "../integration_tests/nested_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nested_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/expr_05.f90" ast = true cpp = true ast_f90 = true julia = true fortran = true [[test]] filename = "../integration_tests/expr_06.f90" asr = true julia = true [[test]] filename = "../integration_tests/expr_07.f90" asr = true julia = true [[test]] filename = "../integration_tests/expr_08.f90" wat = true [[test]] filename = "../integration_tests/expr_09.f90" wat = true julia = true [[test]] filename = "../integration_tests/expr_11.f90" c = true julia = true [[test]] filename = "../integration_tests/modules_11.f90" ast = true asr = true llvm = true julia = true [[test]] filename = "../integration_tests/modules_12.f90" asr = true julia = true [[test]] filename = "../integration_tests/modules_24.f90" asr = true [[test]] filename = "../integration_tests/modules_15b.f90" asr = true [[test]] filename = "../integration_tests/goto_01.f90" ast = true ast_f90 = true julia = true [[test]] filename = "../integration_tests/goto_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/goto_03.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/goto_04.f90" asr = true julia = true [[test]] filename = "if1.f90" ast = true ast_f90 = true [[test]] filename = "if2.f90" ast = true ast_f90 = true [[test]] filename = "where1.f90" ast = true ast_f90 = true [[test]] filename = "implicit1.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/intent_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nested_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_04.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_05.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_06.f90" asr = true llvm = true [[test]] filename = "../integration_tests/nested_namelist_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/nested_external_dedup_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/nested_call_filter_01.f90" asr = true pass = "nested_vars" [[test]] filename = "../integration_tests/callback_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/callback_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/callback_03.f90" llvm = true [[test]] filename = "../integration_tests/callback_04.f90" llvm = true [[test]] filename = "../integration_tests/callback_05.f90" llvm = true [[test]] filename = "../integration_tests/recursion_01.f90" llvm = true [[test]] filename = "../integration_tests/recursion_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/recursion_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/return_01.f90" llvm = true [[test]] filename = "../integration_tests/return_02.f90" llvm = true [[test]] filename = "../integration_tests/return_03.f90" llvm = true [[test]] filename = "../integration_tests/return_05.f90" llvm = true [[test]] filename = "../integration_tests/return_06.f90" llvm = true [[test]] filename = "../integration_tests/binop_03.f90" llvm = true [[test]] filename = "../integration_tests/modules_13.f90" llvm = true [[test]] filename = "coarrays_01.f90" ast = true ast_f90 = true [[test]] filename = "coarrays_02.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/program_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/program_04.f90" ast = true ast_f90 = true [[test]] filename = "use_statement.f90" ast = true [[test]] filename = "return1.f90" ast = true [[test]] filename = "defop1.f90" ast = true ast_f90 = true [[test]] filename = "critical1.f90" ast = true ast_f90 = true [[test]] filename = "block_data1.f90" ast = true ast_f90 = true [[test]] filename = "block1.f90" ast = true ast_f90 = true [[test]] filename = "common1.f90" ast = true ast_f90 = true [[test]] filename = "common3.f90" ast_f90 = true [[test]] filename = "data1.f90" ast = true ast_f90 = true [[test]] filename = "optional_01.f90" asr = true [[test]] filename = "optional_02.f90" pass = "transform_optional_argument_functions" [[test]] filename = "optional_03.f90" pass = "transform_optional_argument_functions" [[test]] filename = "attributes1.f90" ast = true ast_f90 = true [[test]] filename = "arrayelements1.f90" ast_f90 = true [[test]] filename = "flush1.f90" ast = true ast_f90 = true [[test]] filename = "flush2.f90" asr = true [[test]] filename = "../integration_tests/class_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/class_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/class_04.f90" asr = true llvm = true [[test]] filename = "print1.f90" ast = true ast_f90 = true [[test]] filename = "print2.f90" ast = true ast_f90 = true [[test]] filename = "print3.f90" print_leading_space = true asr = true run = true [[test]] filename = "print4.f90" run = true [[test]] filename = "print5.f90" run = true [[test]] filename = "print_intrinsics.f90" asr = true run = true [[test]] filename = "uppercase1.f90" asr = true [[test]] filename = "fixed_form1.f" ast = true ast_f90 = true [[test]] filename = "fixed_form2.f" ast = true [[test]] filename = "fixed_form3.f" ast = true [[test]] filename = "fixed_form4.f" ast = true [[test]] filename = "fixed_form_without_newline.f" ast = true [[test]] filename = "fixed_form_with_exit.f" ast = true [[test]] filename = "fixedform_doloop.f" ast = true [[test]] filename = "fixedform_doloop2.f" ast = true [[test]] filename = "fixedform_doloop3.f" ast = true [[test]] filename = "fixedform_assign_minimal.f" ast = true [[test]] filename = "fixedform_assignment.f" ast = true [[test]] filename = "fixedform_nestedloop_implicit.f" ast = true [[test]] filename = "fixedform_subroutine.f" ast = true [[test]] filename = "fixedform_subroutine2.f" ast = true [[test]] filename = "fixedform_return2.f" ast = true [[test]] filename = "fixedform_data.f" ast = true [[test]] filename = "fixedform_module.f" ast = true [[test]] filename = "fixed_form_interface.f" ast = true [[test]] filename = "fixed_form_line_limit.f" ast = true [[test]] filename = "../integration_tests/format_03.f" ast = true [[test]] filename = "comments1.f90" ast = true [[test]] filename = "constant_kinds.f90" asr = true [[test]] filename = "../integration_tests/const_kind_01.f90" asr = true [[test]] filename = "../integration_tests/const_kind_02.f90" asr = true [[test]] filename = "../integration_tests/generic_name_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_01.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_03.f90" asr = true llvm = true [[test]] filename = "../integration_tests/operator_overloading_04.f90" asr = true [[test]] filename = "../integration_tests/operator_overloading_08.f90" asr = true [[test]] filename = "team1.f90" ast = true ast_f90 = true [[test]] filename = "sync1.f90" ast = true ast_f90 = true [[test]] filename = "entry1.f90" ast = true ast_f90 = true asr_implicit_interface_and_typing = true [[test]] filename = "entry2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/entry_02.f90" asr = true [[test]] filename = "../integration_tests/entry_05.f90" asr = true [[test]] filename = "../integration_tests/entry_06.f90" asr = true [[test]] filename = "issue532.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bits_01.f90" asr = true [[test]] filename = "../integration_tests/bits_02.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bits_03.f90" asr = true [[test]] filename = "../integration_tests/bits_04.f90" asr = true [[test]] filename = "../integration_tests/boz_01.f90" asr = true llvm = true [[test]] filename = "substring.f90" ast = true ast_f90 = true [[test]] filename = "../integration_tests/forall_01.f90" asr = true [[test]] filename = "../integration_tests/nullify_01.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nullify_02.f90" ast = true asr = true llvm = true [[test]] filename = "../integration_tests/nullify_03.f90" asr = true [[test]] filename = "../integration_tests/nullify_04.f90" asr = true [[test]] filename = "../integration_tests/kwargs_02.f90" asr = true [[test]] filename = "../integration_tests/flip_sign.f90" asr = true pass = "flip_sign" [[test]] filename = "../integration_tests/fma.f90" asr = true pass = "fma" [[test]] filename = "../integration_tests/loop_unroll_small.f90" asr = true pass = "loop_unroll" [[test]] filename = "../integration_tests/loop_unroll_large.f90" asr = true pass = "loop_unroll" [[test]] filename = "../integration_tests/div_to_mul.f90" asr = true pass = "div_to_mul" [[test]] filename = "../integration_tests/sign_from_value.f90" asr = true pass = "sign_from_value" [[test]] filename = "../integration_tests/functions_04.f90" asr = true [[test]] filename = "../integration_tests/functions_05.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_06.f90" asr = true [[test]] filename = "../integration_tests/functions_07.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_08.f90" asr = true pass_with_llvm = true pass = "inline_function_calls" fast = true [[test]] filename = "../integration_tests/functions_09.f90" asr = true [[test]] filename = "../integration_tests/functions_10.f90" asr = true asr_clojure = true [[test]] filename = "../integration_tests/functions_12.f90" asr = true [[test]] filename = "../integration_tests/functions_13.f90" asr = true [[test]] filename = "../integration_tests/functions_14.f90" llvm = true [[test]] filename = "../integration_tests/functions_15.f90" asr = true pass = "transform_optional_argument_functions" [[test]] filename = "../integration_tests/functions_16.f90" asr = true [[test]] filename = "bits1.f90" asr = true [[test]] filename = "../integration_tests/bindc1.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bindc2.f90" asr = true [[test]] filename = "../integration_tests/bindc3.f90" asr = true llvm = true [[test]] filename = "../integration_tests/bindc4.f90" asr = true [[test]] filename = "../integration_tests/bindc_06.f90" asr = true [[test]] filename = "../integration_tests/cmd_01.f90" asr = true [[test]] filename = "../integration_tests/cmd_02.f90" asr = true [[test]] filename = "errors/c_f_pointer_01.f90" asr = true [[test]] filename = "errors/c_f_pointer_02.f90" asr = true [[test]] filename = "errors/continue_compilation_1.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_2.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_3.f90" semantics_only_cc = true [[test]] filename = "errors/continue_compilation_ff_1.f" fixed_form_cc_asr = true [[test]] filename = "errors/continue_compilation_ff_2.f" fixed_form_cc_asr = true [[test]] filename = "errors/continue_compilation_simd.f90" semantics_only_cc = true [[test]] filename = "errors/mre_segfault.f90" continue_compilation = true [[test]] filename = "errors/mre_parameter.f90" continue_compilation = true [[test]] filename = "../integration_tests/rewind_inquire_flush.f90" asr = true [[test]] filename = "../integration_tests/derived_types_16_module.f90" asr = true [[test]] filename = "../integration_tests/derived_types_15.f90" asr = true [[test]] filename = "../integration_tests/derived_types_18.f90" asr = true [[test]] filename = "../integration_tests/derived_types_32.f90" llvm = true [[test]] filename = "../integration_tests/derived_types_41.f90" asr = true [[test]] filename = "../integration_tests/derived_types_45.f90" llvm = true [[test]] filename = "../integration_tests/automatic_allocation_02.f90" llvm = true options = "--realloc-lhs-arrays" # TODO: StructType - Uncomment below test after supporting type-inheritance in type-checking # [[test]] # filename = "../integration_tests/derived_types_20.f90" # asr = true # pass = "class_constructor" # extrafiles = "../integration_tests/derived_types_20_module2.f90, ../integration_tests/derived_types_20_module1.f90" [[test]] filename = "../integration_tests/modules_35.f90" asr = true pass = "implied_do_loops" [[test]] filename = "../integration_tests/modules_37.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_39.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" extrafiles = "../integration_tests/modules_39_module.f90" [[test]] filename = "../integration_tests/modules_40.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_43.f90" asr = true pass = "array_op" [[test]] filename = "../integration_tests/modules_44.f90" asr = true extrafiles = "../integration_tests/modules_44_module.f90" pass = "pass_array_by_data" [[test]] filename = "../integration_tests/modules_45.f90" asr = true pass = "pass_array_by_data,transform_optional_argument_functions" [[test]] filename = "../integration_tests/modules_48.f90" asr = true [[test]] filename = "implicit_typing1.f90" asr_implicit_typing = true asr_disable_implicit_typing = true enable_and_disable_implicit_typing = true [[test]] filename = "implicit_typing2.f90" asr_implicit_typing = true [[test]] filename = "allow_implicit_interface.f90" asr_implicit_interface = true [[test]] filename = "allow_implicit_interface5.f90" asr_implicit_interface_and_typing = true [[test]] filename = "implicit_interface_allocatable_array.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface2.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface5.f90" asr_implicit_interface = true [[test]] filename = "implicit_interface3.f90" asr_implicit_interface_and_typing = true [[test]] filename = "implicit_interface4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "allow_implicit_interface2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/implicit_interface_04.f90" asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_01.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external_02.f90" asr_implicit_interface_and_typing = true asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_03.f90" asr_implicit_interface_and_typing = true asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "external_04.f90" asr_implicit_interface_and_typing_with_llvm = true [[test]] filename = "dimension_attr2.f90" asr_implicit_typing = true [[test]] filename = "dimension_attr.f" ast = true asr = true [[test]] filename = "errors/fixed_form_1.f" ast = true [[test]] filename = "errors/fixed_form_2.f" ast = true [[test]] filename = "errors/fixed_form_3.f" ast = true [[test]] filename = "errors/fixed_form_4.f" ast = true [[test]] filename = "errors/fixed_form_5.f" ast = true [[test]] filename = "errors/arithmetic_if1.f90" asr = true [[test]] filename = "errors/assign_01.f90" asr = true semantics_only_cc = true [[test]] filename = "fixed_form_if_variations.f" ast = true asr = true [[test]] filename = "sole_intrinsic.f" ast = true asr = true [[test]] filename = "fixed_form_simple_continue.f" ast = true asr = true [[test]] filename = "loop_test1.f" ast = true asr = true [[test]] filename = "loop_test2.f" ast = true asr = true [[test]] filename = "loop_test3.f" ast = true [[test]] filename = "loop_test4.f" ast = true [[test]] filename = "loop_test5.f" ast = true [[test]] filename = "continue_body_if_loop.f" ast = true asr = true [[test]] filename = "fixed_form/end_label.f" ast = true [[test]] filename = "fixed_form/call1.f" ast = true [[test]] filename = "fixed_form/assign1.f" ast = true [[test]] filename = "fixed_form/block_data1.f" ast = true [[test]] filename = "fixed_form/double_complex1.f" ast = true [[test]] filename = "fixed_form/auxiliary_IO_1.f" ast = true [[test]] filename = "fixed_form/include1.f" ast = true [[test]] filename = "fixed_form/real8_1.f" ast = true [[test]] filename = "fixed_form/do1.f" ast = true [[test]] filename = "fixed_form/do2.f" ast = true [[test]] filename = "fixed_form/data1.f" ast = true [[test]] filename = "fixed_form/else1.f" ast = true [[test]] filename = "fixed_form/error_stop1.f" ast = true [[test]] filename = "fixed_form/error_stop2.f" ast = true [[test]] filename = "fixed_form/crlf1.f" ast = true [[test]] filename = "fixed_form/contains1.f" ast = true [[test]] filename = "fixed_form/while_02_fixed_form.f" ast = true [[test]] filename = "fixed_form/use1.f" ast = true [[test]] filename = "intrinsic_implicit.f90" asr_implicit_interface_and_typing = true [[test]] filename = "parameter1.f90" ast = true asr = true [[test]] filename = "variable1.f90" asr_implicit_interface = true [[test]] filename = "fixed_form_implicit_check.f" ast = true asr_implicit_interface_and_typing = true fixed_free_equal_asr = true [[test]] filename = "implicit_check.f90" ast = true asr_implicit_interface_and_typing = true fixed_free_equal_asr = true [[test]] filename = "fixed_form_implicit1.f" ast = true asr = true [[test]] filename = "fixed_form_implicit2.f" ast = true asr_implicit_interface_and_typing = true [[test]] filename = "fixed_form_implicit3.f" ast = true [[test]] filename = "fixed_form_call1.f" asr_implicit_interface = true [[test]] filename = "fixed_form_call2.f" asr_implicit_interface = true [[test]] filename = "fixed_form_call3.f" asr_implicit_interface = true [[test]] filename = "fixed_form_goto_select.f" ast = true asr = true [[test]] filename = "implicit2.f90" asr = true [[test]] filename = "errors/implicit3.f90" asr = true [[test]] filename = "implicit3.f90" asr_implicit_typing = true [[test]] filename = "implicit4.f90" asr_implicit_typing = true [[test]] filename = "implicit5.f90" asr_implicit_typing = true [[test]] filename = "implicit6.f90" asr_implicit_typing = true [[test]] filename = "implicit7.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit8.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit9.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit10.f90" asr = true asr_implicit_typing = true ast_disable_style_suggestion = true [[test]] filename = "implicit11.f90" asr_implicit_typing = true [[test]] filename = "implicit12.f90" asr = true asr_implicit_typing = true [[test]] filename = "implicit13.f90" asr_implicit_typing = true [[test]] filename = "fixed_form/assign_to1.f" ast = true [[test]] filename = "fixed_form/assign_to2.f" ast = true [[test]] filename = "fixed_form/assign_to3.f" ast = true [[test]] filename = "../integration_tests/assign_to1.f90" ast = true asr_implicit_typing = true [[test]] filename = "../integration_tests/assign_to2.f90" ast = true asr_implicit_typing = true [[test]] filename = "../integration_tests/conv_complex2real.f90" asr = true [[test]] filename = "../integration_tests/statement1.f90" asr = true [[test]] filename = "no_prescan_include1.f90" interactive = true ast = true ast_no_prescan = true [[test]] filename = "no_prescan_include2.f90" ast = true ast_no_prescan = true [[test]] filename = "../integration_tests/implied_do_loops1.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops2.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops3.f90" asr = true [[test]] filename = "../integration_tests/implied_do_loops10.f90" ast = true [[test]] filename = "array10.f90" asr = true [[test]] filename = "statement1.f90" asr = true [[test]] filename = "data2.f90" asr = true [[test]] filename = "data3.f90" asr = true [[test]] filename = "special_chars_json.f90" ast_json = true asr_json = true [[test]] filename = "redeclaration1.f90" asr_implicit_typing = true [[test]] filename = "character1.f90" asr_implicit_interface = true [[test]] filename = "../integration_tests/interface_12.f90" llvm = true [[test]] filename = "save1.f90" asr = true [[test]] filename = "save2.f90" asr = true [[test]] filename = "save3.f90" asr = true [[test]] filename = "save4.f90" asr_disable_warnings = true asr_disable_style_suggestion_and_warnings = true [[test]] filename = "style1.f90" asr_disable_warnings = true asr_enable_style_suggestion = true enable_disable_style_suggestion = true [[test]] filename = "../integration_tests/c_ptr_02.f90" asr = true [[test]] filename = "../integration_tests/save_03.f90" asr = true [[test]] filename = "allow_implicit_interface3.f90" asr_implicit_interface = true [[test]] filename = "fixed_form5.f" ast = true [[test]] filename = "errors/private1.f90" asr = true [[test]] filename = "errors/private2.f90" asr = true [[test]] filename = "../integration_tests/private1.f90" asr = true [[test]] filename = "block2.f90" asr = true [[test]] filename = "errors/do_loop_01.f90" asr = true [[test]] filename = "implicit_typing4.f90" asr_implicit_typing = true [[test]] filename = "errors/kind1.f90" asr = true [[test]] filename = "errors/kind2.f90" asr = true [[test]] filename = "errors/intent1.f90" asr = true [[test]] filename = "errors/do_zero_increment.f90" asr = true [[test]] filename = "errors/implicit_typing1.f90" asr_implicit_typing = true [[test]] filename = "errors/implicit_typing2.f90" asr_implicit_typing = true [[test]] filename = "errors/implicit_typing3.f90" asr_implicit_typing = true [[test]] filename = "errors/derived_type_01.f90" asr = true [[test]] filename = "errors/derived_type_02.f90" asr = true [[test]] filename = "errors/derived_type_03.f90" asr = true [[test]] filename = "errors/derived_type_04.f90" asr = true [[test]] filename = "errors/derived_type_05.f90" asr = true [[test]] filename = "errors/derived_type_06.f90" run = true [[test]] filename = "errors/array_01.f90" asr = true [[test]] filename = "errors/array_02.f90" asr = true [[test]] filename = "errors/array_03.f90" asr = true [[test]] filename = "errors/array_04.f90" asr = true [[test]] filename = "errors/array_05.f90" asr = true [[test]] filename = "errors/array_05_cc.f90" semantics_only_cc = true [[test]] filename = "errors/array_06.f90" asr = true [[test]] filename = "../integration_tests/where_02.f90" asr = true pass = "where" [[test]] filename = "../integration_tests/where_03.f90" asr = true pass = "where" [[test]] filename = "../integration_tests/where_04.f90" asr = true pass = "where" [[test]] filename = "common2.f" ast = true asr = true [[test]] filename = "../integration_tests/common_03.f90" asr = true [[test]] filename = "../integration_tests/common_04.f90" asr = true [[test]] filename = "../integration_tests/common_05.f90" asr = true [[test]] filename = "../integration_tests/common_06.f90" asr = true [[test]] filename = "../integration_tests/common_13.f90" asr = true [[test]] filename = "errors/common1.f90" asr = true [[test]] filename = "errors/intrinsics1.f90" asr = true [[test]] filename = "errors/intrinsics2.f90" asr = true [[test]] filename = "errors/scalar_allocation_check_01.f90" run = true [[test]] filename = "errors/scalar_allocation_check_02.f90" run = true [[test]] filename = "errors/scalar_allocation_check_03.f90" run = true [[test]] filename = "errors/scalar_allocation_check_04.f90" run = true [[test]] filename = "errors/scalar_allocation_check_05.f90" run = true [[test]] filename = "errors/scalar_allocation_check_06.f90" run = true [[test]] filename = "errors/matmul_unallocated_01.f90" run = true [[test]] filename = "errors/array_bounds_check_01.f90" run = true [[test]] filename = "errors/array_bounds_check_02.f90" run = true [[test]] filename = "errors/array_bounds_check_03.f90" run = true [[test]] filename = "errors/array_bounds_check_04.f90" run = true options = "--strict-array-bounds-checking" [[test]] filename = "errors/array_bounds_check_05.f90" run = true [[test]] filename = "errors/array_bounds_check_06.f90" run = true [[test]] filename = "errors/array_bounds_check_07.f90" run = true [[test]] filename = "errors/array_bounds_check_08.f90" run = true [[test]] filename = "errors/array_bounds_check_09.f90" run = true [[test]] filename = "errors/array_bounds_check_10.f90" run = true [[test]] filename = "errors/array_bounds_check_11.f90" run = true [[test]] filename = "errors/array_bounds_check_12.f90" run = true [[test]] filename = "errors/array_bounds_check_13.f90" run = true [[test]] filename = "errors/array_bounds_check_14.f90" run = true [[test]] filename = "errors/array_bounds_check_15.f90" run = true [[test]] filename = "../integration_tests/statement_01.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/statement_02.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/statement_03.f90" asr_implicit_interface_and_typing = true [[test]] filename = "allow_implicit_interface4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external3.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external4.f90" asr_implicit_interface_and_typing = true [[test]] filename = "external5.f90" asr_implicit_interface_and_typing = true [[test]] filename = "pragma1.f90" ast_openmp = true asr_openmp = true [[test]] filename = "pragma2.f90" ast = true asr = true asr_ignore_pragma = true c = true [[test]] filename = "../integration_tests/matmul_01.f90" asr = true [[test]] filename = "errors/external1.f90" asr = true # Parser [[test]] filename = "parser/program_without_line_01.f90" ast = true [[test]] filename = "parser/program_without_line_02.f90" ast = true [[test]] filename = "parser/program_without_line_03.f90" ast = true [[test]] filename = "parser/program_without_line_04.f90" ast = true [[test]] filename = "parser/program_without_line_05.f90" ast = true [[test]] filename = "parser/program_without_line_06.f90" ast = true [[test]] filename = "parser/program_without_line_07.f90" ast = true [[test]] filename = "parser/derived_type_without_start_program.f90" ast = true [[test]] filename = "parser/enum_decl_without_start_program.f90" ast = true [[test]] filename = "parser/parameter_without_start_program.f90" ast = true [[test]] filename = "parser/procedure_with_type.f90" ast = true [[test]] filename = "parser/data_stmt_with_implied_do_loop.f" ast = true # Parser errors [[test]] filename = "errors/program_without_line_01.f90" ast = true [[test]] filename = "errors/program_without_line_cc.f90" syntax_only_cc = true show_asr_with_cc = true [[test]] filename = "errors/program_without_line_02.f90" ast = true [[test]] filename = "errors/program_without_line_03.f90" ast = true [[test]] filename = "errors/program_without_line_04.f90" ast = true [[test]] filename = "external1.f90" asr_implicit_interface_and_typing = true [[test]] filename = "errors/implicit_typing4.f90" asr_implicit_typing = true [[test]] filename = "external2.f90" asr_implicit_interface_and_typing = true [[test]] filename = "../integration_tests/data_implied_do_01.f90" asr = true [[test]] filename = "errors/subroutine1.f90" asr = true [[test]] filename = "errors/subroutine2.f90" asr = true [[test]] filename = "errors/subroutine3.f90" asr = true [[test]] filename = "errors/implicit_call_01.f90" asr_implicit_typing = true [[test]] filename = "../integration_tests/implicit_argument_casting_01.f90" asr_implicit_argument_casting = true enable_disable_implicit_argument_casting = true [[test]] filename = "../integration_tests/valid_array_assignment_same_length_different_start.f90" obj = true [[test]] filename = "errors/end_sub_name.f90" asr = true [[test]] filename = "errors/end_program_name.f90" asr = true [[test]] filename = "errors/runtime_stacktrace_01.f90" run_with_dbg = true [[test]] filename = "../integration_tests/legacy_array_sections_01.f90" llvm = true [[test]] filename = "format2.f90" llvm = true [[test]] filename = "errors/type_conflict1.f90" asr = true [[test]] filename = "char1.f90" fortran = true [[test]] filename = "integer_to_real_cast_in_comparison.f90" fortran = true [[test]] filename = "real_to_integer_cast_fortran_codegen.f90" fortran = true [[test]] filename = "real_to_real_cast_fortran_codegen.f90" fortran = true [[test]] filename = "int_to_int_cast_fortran_codegen.f90" fortran = true [[test]] filename = "real_to_complex_cast_in_comparison.f90" fortran = true [[test]] filename = "complex_to_complex_cast_fortran_codegen.f90" fortran = true [[test]] filename = "int_to_complex_cast_in_comparison.f90" fortran = true [[test]] filename = "cast_node_m_value.f90" asr = true [[test]] filename = "errors/loop_test.f90" asr = true [[test]] filename = "errors/parameter_01.f90" asr = true [[test]] filename = "errors/float1.f90" asr = true [[test]] filename = "errors/dfloat1.f90" asr = true [[test]] filename = "errors/end_module_name.f90" ast = true [[test]] filename = "errors/end_submodule_name.f90" ast = true [[test]] filename = "errors/integer16.f90" ast = true [[test]] filename = "errors/string_slice.f90" asr = true [[test]] filename = "errors/string_slice2.f90" asr = true [[test]] filename = "../integration_tests/max_01.f90" asr = true [[test]] filename = "../integration_tests/max_02.f90" asr = true [[test]] filename = "../integration_tests/min_01.f90" asr = true [[test]] filename = "../integration_tests/min_02.f90" asr = true [[test]] filename = "errors/open_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/close_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/rewind_invalid_kwarg1.f90" asr = true [[test]] filename = "errors/flush_invalid_kwarg1.f90" asr = true [[test]] filename = "warnings/open_notimplemented_kwarg1.f90" asr = true [[test]] filename = "errors/substring_startidx.f90" asr = true [[test]] filename = "errors/substring_endidx.f90" asr = true [[test]] filename = "errors/substring_stride.f90" [[test]] filename = "shiftl1.f90" asr = true [[test]] filename = "errors/fixed_number_of_args.f90" asr = true [[test]] filename = "errors/compare_01.f90" asr = true [[test]] filename = "../integration_tests/polymorphic_class_compare.f90" asr = true [[test]] filename = "../integration_tests/nested_struct_proc_01.f90" asr = true [[test]] filename = "errors/kind_string_of_int.f90" asr = true [[test]] filename = "errors/kind_float_of_int.f90" asr = true [[test]] filename = "errors/kind_var_of_int.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_int.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_logical.f90" asr = true [[test]] filename = "errors/kind_invalid_int_of_complex.f90" asr = true [[test]] filename = "errors/kind_star_of_int.f90" asr = true [[test]] filename = "errors/kind_star_of_complex.f90" asr = true [[test]] filename = "errors/kind_star_of_logical.f90" asr = true [[test]] filename = "errors/cmplx_01.f90" asr = true [[test]] filename = "errors/cmplx_02.f90" asr = true [[test]] filename = "errors/cmplx_03.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_types.f90" asr = true [[test]] filename = "errors/array_constructor_with_integer_real_array_types.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_kind.f90" asr = true [[test]] filename = "errors/array_constructor_with_asterisk_in_type_spec.f90" asr = true [[test]] filename = "errors/array_constructor_with_different_char_lengths.f90" asr = true [[test]] filename = "errors/incorrect_allocate_for_array.f90" asr = true [[test]] filename = "errors/incompatible_ranks_allocatable_arr1.f90" asr = true [[test]] filename = "errors/incompatible_ranks_allocatable_arr2.f90" asr = true [[test]] filename = "errors/incompatible_dimension_assignment_arr1.f90" asr = true [[test]] filename = "errors/incompatible_dimension_assignment_arr2.f90" asr = true [[test]] filename = "errors/incompatible_dimension_logical_arrays_logical_binop_01.f90" asr = true [[test]] filename = "errors/incompatible_dimension_logical_arrays_logical_binop_02.f90" asr = true [[test]] filename = "errors/end_function_name_not_match.f90" ast = true [[test]] filename = "errors/class_procedure_extra_args.f90" asr = true [[test]] filename = "errors/incorrect_number_args_function.f90" asr = true [[test]] filename = "errors/incorrect_number_args_subroutine.f90" asr = true [[test]] filename = "optional_argument_subroutine_in_type.f90" asr = true [[test]] filename = "errors/more_kwargs_than_acceptable_to_subroutine.f90" asr = true [[test]] filename = "warnings/doloop_01.f90" asr = true [[test]] filename = "char_arr_assignment.f90" asr = true [[test]] filename = "character2.f90" asr = true [[test]] filename = "errors/specific_type_intrinsic.f90" asr = true [[test]] filename = "errors/sqrt_neg.f90" asr = true [[test]] filename = "errors/Same_type.f90" asr = true [[test]] filename = "errors/idint_real4.f90" asr = true [[test]] filename = "errors/ishftc_size.f90" asr = true [[test]] filename = "errors/merge_bits_comp.f90" asr = true [[test]] filename = "errors/merge_bits_run.f90" asr = true [[test]] filename = "errors/dlgama_arg.f90" asr = true [[test]] filename = "errors/dreal_arg_error.f90" asr = true [[test]] filename = "errors/coarray_01.f90" asr = true [[test]] filename = "errors/coarray_02.f90" asr = true [[test]] filename = "errors/atomic_01.f90" asr = true [[test]] filename = "errors/iostat_non_scalar_value.f90" asr = true [[test]] filename = "errors/iostat_constant_integer.f90" asr = true [[test]] filename = "character_parameter_padding_trimming.f90" asr = true [[test]] filename = "errors/type_casting_01.f90" asr = true [[test]] filename = "openmp1.f90" asr_openmp = true [[test]] filename = "errors/intrinsics3.f90" asr = true [[test]] filename = "errors/intrinsics4.f90" asr = true [[test]] filename = "errors/intrinsics5.f90" asr = true [[test]] filename = "errors/intrinsics6.f90" asr = true [[test]] filename = "errors/intrinsics7.f90" asr = true [[test]] filename = "errors/intrinsics8.f90" asr = true [[test]] filename = "errors/intrinsics9.f90" asr = true [[test]] filename = "errors/intrinsics10.f90" asr = true [[test]] filename = "errors/intrinsics11.f90" asr = true [[test]] filename = "errors/int_01.f90" asr = true [[test]] filename = "errors/ichar_01.f90" asr = true [[test]] filename = "errors/do_concurrent1.f90" asr = true [[test]] filename = "errors/intrinsics12.f90" asr = true [[test]] filename = "errors/intrinsics13.f90" asr = true [[test]] filename = "errors/modulo_01.f90" asr = true [[test]] filename = "errors/sign_01.f90" asr = true [[test]] filename = "errors/dprod_01.f90" asr = true [[test]] filename = "errors/ifix_01.f90" asr = true [[test]] filename = "errors/intrinsics14.f90" asr = true [[test]] filename = "errors/intrinsics15.f90" asr = true [[test]] filename = "exit1.f90" run = true [[test]] filename = "exit2.f90" run = true [[test]] filename = "errors/kind_01.f90" asr = true [[test]] filename = "errors/dim_float_01.f90" asr = true [[test]] filename = "errors/dim_float_02.f90" asr = true [[test]] filename = "errors/dim_float_03.f90" asr = true [[test]] filename = "implied_do_loop1.f90" run = true [[test]] filename = "multi_error1.f90" ast = true semantics_only_cc = true [[test]] filename = "collect_occurence1.f90" rename_symbol = true line = 10 column = 8 [[test]] filename = "collect_occurence2.f90" rename_symbol = true line = 7 column = 11 [[test]] filename = "collect_occurence3.f90" rename_symbol = true line = 6 column = 11 [[test]] filename = "collect_occurence4.f90" rename_symbol = true line = 9 column = 13 [[test]] filename = "../integration_tests/multiple_objects_args.f90" pass = "class_constructor" [[test]] filename = "errors/incompatible_rank_assign.f90" asr = true [[test]] filename = "errors/array_shape_01.f90" asr = true [[test]] filename = "errors/array_shape_02.f90" asr = true [[test]] filename = "errors/array_shape_05.f90" run = true [[test]] filename = "function_call1.f90" asr = true lookup_name = true line = 18 column = 22 [[test]] filename = "lookup_name1.f90" lookup_name = true line = 3 column = 12 [[test]] filename = "lookup_name2.f90" lookup_name = true line = 5 column = 11 [[test]] filename = "lookup_name3.f90" lookup_name = true line = 6 column = 2 [[test]] filename = "lookup_name4.f90" lookup_name = true line = 22 column = 18 [[test]] filename = "errors/func_parameter_type.f90" asr = true [[test]] filename = "../integration_tests/func_parameter_type_02.f90" asr_implicit_interface_and_typing = true [[test]] filename = "errors/func_arg_array.f90" asr = true [[test]] filename = "errors/duplicate_module_procedures.f90" asr = true [[test]] filename = "errors/string_negative_start_index.f90" asr = true [[test]] filename = "errors/string_assignment_01.f90" run = true [[test]] filename = "errors/string_assignment_02.f90" run = true [[test]] filename = "errors/string_allocation_01.f90" run = true [[test]] filename = "errors/dimension_01.f90" asr = true [[test]] filename = "errors/dimension_02.f90" asr = true [[test]] filename = "errors/program_variable.f90" asr = true [[test]] filename = "errors/data_implied_do1.f90" asr = true [[test]] filename = "errors/data_implied_do2.f90" asr = true [[test]] filename = "errors/data_implied_do3.f90" asr = true [[test]] filename = "errors/init1.f90" ast = true [[test]] filename = "../integration_tests/enum_01.f90" fortran = true [[test]] filename = "polymorphic_class_in_derived_type.f90" asr = true [[test]] filename = "errors/show_errors1.f90" show_errors = true [[test]] filename = "document_symbols1.f90" document_symbols = true extrafiles = "document_symbols1_module.f90" [[test]] filename = "../integration_tests/loop_var_use_after_loop.f90" pass = "do_loops" options = "--use-loop-variable-after-loop" [[test]] filename = "../integration_tests/use_02.f90" asr = true [[test]] filename = "../integration_tests/polymorphic_arguments_02.f90" asr = true [[test]] filename = "parse_without_program_line.f90" ast = true [[test]] filename = "interactive_parse_without_program_line.f90" options = "--interactive-parse" ast = true [[test]] filename = "interface_generic_procedure_same_name.f90" asr = true [[test]] filename = "errors/subroutine6.f90" asr = true [[test]] filename = "errors/unterminated_comment_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_ifndef_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_ifdef_01.f90" asr_preprocess = true [[test]] filename = "errors/unterminated_if_01.f90" asr_preprocess = true [[test]] filename = "declaration1.f90" asr = true [[test]] filename = "errors/integerStringInput.f90" run = true [[test]] filename = "errors/floatStringInput.f90" run = true [[test]] filename = "errors/integerStringInput_64.f90" run = true [[test]] filename = "errors/integer_overflow.f90" run = true [[test]] filename = "errors/protected_01.f90" asr = true [[test]] filename = "errors/interface_01.f90" asr = true [[test]] filename = "../integration_tests/intrinsics_334.f90" asr = true [[test]] filename = "../integration_tests/volatile_02.f90" llvm = true [[test]] filename = "../integration_tests/volatile_03.f90" llvm = true [[test]] filename = "codegen_function_polymorphic.f90" llvm = true options = "-c --separate-compilation" [[test]] filename = "common_linkage_separate_compilation_01.f90" llvm = true options = "--separate-compilation" [[test]] filename = "module_struct_global_separate_compilation_01.f90" llvm = true options = "--separate-compilation" [[test]] filename = "../integration_tests/operator_overloading_12.f90" asr = true [[test]] filename = "errors/formatTesting.f90" run = true [[test]] filename = "../integration_tests/call_subroutine_without_type_01.f90" llvm = true [[test]] filename = "../integration_tests/functions_41.f90" ast = true [[test]] filename = "classes1.f90" llvm = true [[test]] filename = "classes2.f90" llvm = true [[test]] filename = "implied_do_loop2.f90" run = true [[test]] filename = "implied_do_loop3.f90" run = true [[test]] filename = "errors/submodule_01.f90" asr = true [[test]] filename = "../integration_tests/select_type_13.f90" llvm = true [[test]] filename = "unlimited_polymorphic_intrinsic_type_allocate.f90" llvm = true [[test]] filename = "../integration_tests/transfer_09.f90" asr = true [[test]] filename = "../integration_tests/arrays_101.f90" llvm = true [[test]] filename = "stdin_read_blank_lines_01.f90" run = true options = "< tests/stdin_read_blank_lines_01.in" [[test]] filename = "mangle_underscore_external_01.f90" llvm = true options = "--mangle-underscore-external" [[test]] filename = "../integration_tests/file_open_06.f90" run = true lfortran-lfortran-2f73434/tests/implicit12.f900000664000175000017500000000065715141516316021302 0ustar alastairalastairsubroutine a() implicit integer (b-c) implicit integer*4 (d-e) implicit integer*8 (f-g) implicit real (h) implicit real*4 (i-k) implicit real*8 (l) implicit complex (m, n) implicit complex*8 (o) implicit complex*16 (p) implicit double precision (q) implicit double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end subroutinelfortran-lfortran-2f73434/tests/mangle_underscore_external_01.f900000664000175000017500000000030715141516316025213 0ustar alastairalastairprogram mangle_underscore_external_01 implicit none interface subroutine foo() end subroutine foo end interface call foo() end program mangle_underscore_external_01 lfortran-lfortran-2f73434/tests/unordered_linking.f900000664000175000017500000000152715141516316023024 0ustar alastairalastair! This program demonstrates the use of the ISO C binding to call a C function from Fortran. ! It tests the linking of Fortran and C object files in different orders. ! The Fortran program defines an interface for the C 'add' function, which adds two integers. ! The test cases ensure the correct compilation and execution, regardless of the linking order ! between the Fortran and C files, as shown in the corresponding test script. program unordered_linking use iso_c_binding, only: c_int implicit none interface function add(a, b) bind(C) import :: c_int integer(c_int) :: add integer(c_int), value :: a, b end function add end interface integer(c_int) :: a, b, result a = 5 b = 3 result = add(a, b) print *, 'The sum is: ', result end program unordered_linking lfortran-lfortran-2f73434/tests/finalize_01.f900000664000175000017500000000322615141516316021421 0ustar alastairalastairmodule finalize_01_mod contains subroutine test_01() ! Test that we deallocate allocatable characters character(:), allocatable :: str integer :: i allocate(character(10) :: str) return ! This will have `impliciteDeallocate` inserted before it. do i=1, 2 return ! This won't have `impliciteDeallocate` inserted before it as we already have dead end. end do end subroutine test_01 subroutine ss() ! Test deallocation on arrays. integer, allocatable :: arr(:) allocate(arr(10)) if(.true.) then return ! This will have `impliciteDeallocate` inserted before it. else return ! This will have `impliciteDeallocate` inserted before it. end if end subroutine ss end module finalize_01_mod program finalize_01 use finalize_01_mod character(:), allocatable :: str integer, dimension(:), allocatable :: arr allocate(character(10) :: str) call ss() call internal_sub() return ! Should insert deallocation for arr, str before this `return`. contains subroutine internal_sub() character(:),allocatable :: str real, allocatable :: arr_real(:,:) bl : block integer, allocatable :: arr_in_block(:) exit bl ! This will have `impliciteDeallocate` inserted before it. return ! This won't have `impliciteDeallocate` inserted before it as we already have dead end. end block bl do while(.true.) return ! This will have `impliciteDeallocate` inserted before it. end do end subroutine internal_sub end program finalize_01lfortran-lfortran-2f73434/tests/do1.f900000664000175000017500000000061015141516316017775 0ustar alastairalastairdo i = 1, 5 a = a + i end do do i = 1, 5 end do do i = 1, 5, 2 a = a + i end do do a = a + i b = 3 end do subroutine g do a = a + i b = 3 enddo do, i = 1, 5 a = a + i end do n = 0 do 50, i = 1, 10 j = i do k = 1, 5 l = k n = n + 1 ! this statement executes 50 times end do ! nonlabeled do inside a labeled do 50 continue end subroutine lfortran-lfortran-2f73434/tests/do6.f900000664000175000017500000000222615141516316020007 0ustar alastairalastairprogram do6 implicit none integer :: i, j, k integer :: correct correct = 0 k = 0 do 30 i = 1, 5 do 30 j = 1, 5 30 k = k + 1 write(*,*) k correct = correct + k k = 0 do 35 i = 1, 5 do 35 j = 1, 5 k = k + 1 35 continue write(*,*) k correct = correct + k k = 0 do 40 i = 1, 25 k = k + 1 40 enddo write(*,*) k correct = correct + k k = 0 do 45 i = 1, 25 k = k + 1 45 end do write(*,*) k correct = correct + k k = 0 do 50 i = 1, 5 do 50 j = 1, 5 k = k + 0 50 k = k + 1 write(*,*) k correct = correct + k k = 0 do 60 i = 1, 25 k = k + 0 60 k = k + 1 write(*,*) k correct = correct + k k = -30 do 65 i = 1, 5 k = k + 1 do 65 j = 1, 5 if (k == 25) go to 70 k = k + 2 65 continue write(*,*) k correct = correct + k if (k == 25) then j = 0 go to 65 end if 70 continue write(*,*) k correct = correct + k k = -30 do 75 i = 1, 5 k = k + 1 do 75 j = 1, 5 if (k == 25) go to 80 k = k + 2 75 end do write(*,*) k correct = correct + k if (k == 25) then j = 0 go to 75 end if 80 continue write(*,*) k correct = correct + k write(*, *) 10*correct/25, '% correct' end programlfortran-lfortran-2f73434/tests/no_prescan_include2.f900000664000175000017500000000007115141516316023227 0ustar alastairalastairprogram include2 include 'include2b.f90' end program lfortran-lfortran-2f73434/tests/preprocessor3e.h0000664000175000017500000000003415141516316022121 0ustar alastairalastair#include "preprocessor3d.h" lfortran-lfortran-2f73434/tests/if1.f900000664000175000017500000000040415141516316017772 0ustar alastairalastairprogram if1 integer :: i i = 5 if (i == 5) print *, 'correct' if (i == 6) print *, 'incorrect' i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, 'i < 0' go to 40 60 print *, 'i == 0' go to 40 70 print *, 'i > 0' end program lfortran-lfortran-2f73434/tests/array15.f900000664000175000017500000000011515141516316020576 0ustar alastairalastairprogram array15 implicit none integer :: x(3) x = 23 end program lfortran-lfortran-2f73434/tests/optional_argument_subroutine_in_type.f900000664000175000017500000000077515141516316027063 0ustar alastairalastairmodule test_module implicit none type :: test_type real :: test_real_value contains procedure, nopass :: test_subroutine end type test_type contains subroutine test_subroutine(x) integer, optional, intent(in) :: x print *, "Hello World" end subroutine test_subroutine end module test_module program main use test_module implicit none type(test_type) :: test_type_instance call test_type_instance%test_subroutine() end program main lfortran-lfortran-2f73434/tests/fixed_form_call3.f0000664000175000017500000000027415141516316022347 0ustar alastairalastairc FAILURE test subroutine idd_frm(m,n,w,x,y) integer m,n,w,x,y,lw call prinf('lw = *',lw,1) call prinf('16m+70 = *',16*m+70,1)) return end lfortran-lfortran-2f73434/tests/finalize_02.f900000664000175000017500000000114615141516316021421 0ustar alastairalastairprogram finalize_02 type t integer :: inn end type t type tt real :: rr type(t) :: t_instance end type call ss(200) contains subroutine ss(nang) type(tt), allocatable :: arr_01(:) integer,allocatable :: arr_02(:) integer, allocatable :: arr_03 character(:), allocatable :: arr_04(:) character(20) :: arr_05(5) integer, allocatable :: arr_06(:) character(:), allocatable :: arr_07 character(:), allocatable :: arr_08(:) integer :: nang integer :: arr_09(nang) end subroutine end programlfortran-lfortran-2f73434/tests/modules1.f900000664000175000017500000000007415141516316021047 0ustar alastairalastairprogram x use y, only: t2 implicit none end program lfortran-lfortran-2f73434/tests/expr2.f900000664000175000017500000000000415141516316020347 0ustar alastairalastair5+3 lfortran-lfortran-2f73434/tests/fixed_form_with_exit.f0000664000175000017500000000016415141516316023353 0ustar alastairalastair SUBROUTINE EXAMPLE INTEGER I DO I = 2, 8 IF (I == 2) EXIT END DO ENDlfortran-lfortran-2f73434/tests/fn2.f900000664000175000017500000000040715141516316020003 0ustar alastairalastairfunction a() integer :: a end function function b() real :: b end function function c() logical :: c end function function d() result(r) integer :: r end function function e() result(r) real :: r end function function f() result(r) logical :: r end function lfortran-lfortran-2f73434/tests/expr1.f900000664000175000017500000000000215141516316020344 0ustar alastairalastair5 lfortran-lfortran-2f73434/tests/warnings/0000775000175000017500000000000015141516316020625 5ustar alastairalastairlfortran-lfortran-2f73434/tests/warnings/character_01.f900000664000175000017500000000016315141516316023401 0ustar alastairalastairprogram character_01 implicit none character(len=1, kind=1), parameter :: c_null_char = "ball" end program lfortran-lfortran-2f73434/tests/warnings/character_03.f900000664000175000017500000000015615141516316023405 0ustar alastairalastairprogram character_03 implicit none character*(2+3) str str = "hello" print *, str end program lfortran-lfortran-2f73434/tests/warnings/preprocess_01.f900000664000175000017500000000035015141516316023630 0ustar alastairalastairprogram preprocess_01 implicit none #line 10 integer :: x #ifdef pqr x = (2+3)*5 #elif mno == 18 x = 18 #else print *, "Else condition" x = 30 #endif print *, x x = 10000 #define abc(m, n) m + n #abcd end program lfortran-lfortran-2f73434/tests/warnings/dim_assgn_test.f900000664000175000017500000000017115141516316024147 0ustar alastairalastairprogram dim_assgn_test integer, private, dimension(2,2) :: a(2,2) integer, private, dimension(2,2) :: b(2,3) end program lfortran-lfortran-2f73434/tests/warnings/open_notimplemented_kwarg1.f900000664000175000017500000000044115141516316026465 0ustar alastairalastairPROGRAM open_notimplemented_kwargs implicit none ! "action" isn't supported yet, once implemented this test file ! (and other reference files) can be safely deleted ! currently raises a warning open(10, file='file_01_data.txt', status='old', action='read') END PROGRAM lfortran-lfortran-2f73434/tests/warnings/character_02.f900000664000175000017500000000021715141516316023402 0ustar alastairalastairprogram character_02 character(len=1, kind=1), parameter :: toml_base(4) = ["11", "21", "31", "$1"] print *, toml_base end program lfortran-lfortran-2f73434/tests/warnings/doloop_01.f900000664000175000017500000000015015141516316022735 0ustar alastairalastairprogram doloop_01 integer :: i do i = 1.5, 10.5, 2.4 print *, i end do end program lfortran-lfortran-2f73434/tests/subroutine5.f900000664000175000017500000000014115141516316021575 0ustar alastairalastairsubroutine add(a, b, c) real, intent(in) :: a, b real, intent(out) :: c c = a + b end subroutine lfortran-lfortran-2f73434/tests/dependency_test_01.f900000664000175000017500000000266415141516316023002 0ustar alastairalastairmodule fpm_dependency implicit none private type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity = 1 character(len=:), allocatable :: dep_dir integer :: ndep = 0 type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: add => add_dependency procedure, private :: add_dependency generic :: find => find_dependency procedure, private :: find_dependency end type dependency_tree_t contains pure subroutine add_dependency(self, dependency) class(dependency_tree_t), intent(inout) :: self type(dependency_config_t), intent(in) :: dependency integer :: id id = self%find(dependency) end subroutine add_dependency pure function find_dependency(self, dependency) result(pos) class(dependency_tree_t), intent(in) :: self class(dependency_config_t), intent(in) :: dependency integer :: pos end function find_dependency end module fpm_dependency lfortran-lfortran-2f73434/tests/print_intrinsics.f900000664000175000017500000000033115141516316022713 0ustar alastairalastairprogram print_intrinsics implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0) print *, 'pi=acos(-1.0_sp) ="', acos(-1.0_sp),'"' print *, 'pi=acos(-1.0_dp) ="', acos(-1.0_dp),'"' end program lfortran-lfortran-2f73434/tests/collect_occurence4.f900000664000175000017500000000025615141516316023057 0ustar alastairalastairmodule collect_occurence4_mod end module collect_occurence4_mod subroutine abc() end subroutine abc program main use collect_occurence4_mod integer :: abc end program main lfortran-lfortran-2f73434/tests/do_concurrent1.f900000664000175000017500000000172715141516316022251 0ustar alastairalastairsubroutine dc1(a, b) real, intent(inout) :: a(:,:) integer :: N, i, j N = size(a) do concurrent (i=1:N, j=1:N, i 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine subroutine dc3(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) shared(i) local(x) default(none) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine subroutine dc4(a, b) real, intent(inout) :: a(:), b(:) integer :: i real :: x x = 1.0 do concurrent (i=1:10) default(none) local(x) shared(i) if (a(i) > 0) then x = sqrt(a(i)) a(i) = a(i) - x**2 end if b(i) = b(i) - a(i) end do print *, x end subroutine lfortran-lfortran-2f73434/tests/open1.f900000664000175000017500000000065015141516316020340 0ustar alastairalastairprogram open1 ! Tests for syntax (AST) only: open(file='p_cc', newunit=u) open (task_lun,file=taskfile) open (unit=gmv_lun, FILE=fname, IOSTAT=ier, POSITION='rewind') open(newunit=this%lun,file=outfile,status='replace',iostat=ios) open(unit=10,file='test1.inp',position='rewind',action='read',status='old') OPEN( UNIT=funit, FILE=tname, STATUS=fstat, ACCESS='SEQUENTIAL', & ACTION=faction, IOSTAT=ierr ) end program lfortran-lfortran-2f73434/tests/print3.f900000664000175000017500000000025215141516316020533 0ustar alastairalastairprogram print_03 implicit none integer :: x x = 24 print *, "x is ", x write (*, *) "x is ", x print *, "ok" write (*, *) "ok" end program lfortran-lfortran-2f73434/tests/do3.f900000664000175000017500000000022315141516316017777 0ustar alastairalastairprogram do3 implicit none integer :: i, j j = 0 do 15 i = 1, 5 j = j + i 15 enddo j = 0 do 20 i = 1, 6, 2 j = j + i 20 end do end program lfortran-lfortran-2f73434/tests/global_scope5.f900000664000175000017500000000004515141516316022032 0ustar alastairalastairinteger :: x x = 6 2*x x = x + 1 3*x lfortran-lfortran-2f73434/tests/global_scope3.f900000664000175000017500000000003515141516316022027 0ustar alastairalastairinteger :: x x = 6 x = x + 1 lfortran-lfortran-2f73434/tests/overflow_test.txt0000664000175000017500000000001715141516316022436 0ustar alastairalastair2719 2147483648lfortran-lfortran-2f73434/tests/preprocessor20.f900000664000175000017500000000052415141516316022206 0ustar alastairalastair#if !defined pi_constant #define PI 3.14 #endif /* multi-line comment on a two separate lines */ #if !defined negative_constant #define negative_one -1 #endif /* multi-line comment on a single line */ program preprocessor20 implicit none print *, "PI: ", PI print *, "negative one: ", negative_one end program preprocessor20 lfortran-lfortran-2f73434/tests/array16.f900000664000175000017500000000015115141516316020577 0ustar alastairalastairprogram array16 integer x(0:2) integer y(-1:1) y = [1,2,3] print *, y x = [4,5,6] print *, x end program lfortran-lfortran-2f73434/tests/boz1.f900000664000175000017500000000015015141516316020164 0ustar alastairalastairb'101' B'101' b"101" B"101" o'174' O'106' o"151" O"131" z'194a' Z'b108' z"f161" Z"1d31" z"C1B1" Z"1E3A" lfortran-lfortran-2f73434/tests/block_data1.f900000664000175000017500000000053015141516316021457 0ustar alastairalastairblock data init implicit integer(a-z) common /range/ x0, x1 data x0, x1 / 1, 10 / end block data program block_data1 implicit integer(a-z) common /range/ x0, x1 print *, "Printing Even number in the Range: ", x0, " to ", x1 do i = x0, x1 if(mod(i, 2) /= 0) cycle write(*,*) i end do end program lfortran-lfortran-2f73434/tests/modules_03.f900000664000175000017500000000044215141516316021267 0ustar alastairalastairmodule access_vars implicit none public real, private :: priv = 1.5 real, public :: publ = 2.5 contains subroutine print_vars() print *, "priv = ", priv print *, "publ = ", publ end subroutine print_vars end module access_vars lfortran-lfortran-2f73434/tests/modules_05.f900000664000175000017500000000044115141516316021270 0ustar alastairalastairmodule access_vars implicit none private public publ real :: priv = 1.5 real :: publ = 2.5 contains integer function print_vars(a, b) real, intent(in) :: a real, intent(in) :: b print *, "priv = ", a print *, "publ = ", b print_vars = 1 end function print_vars end module access_vars lfortran-lfortran-2f73434/tests/common_linkage_separate_compilation_01.f900000664000175000017500000000026615141516316027065 0ustar alastairalastairprogram common_linkage_separate_compilation_01 implicit none integer :: x common /blk/ x x = 5 if (x /= 5) error stop 1 end program common_linkage_separate_compilation_01 lfortran-lfortran-2f73434/tests/preprocessor17.F900000664000175000017500000000016315141516316022153 0ustar alastairalastairprogram preprocessor1 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 print *, x, X123 end program lfortran-lfortran-2f73434/tests/modules4_module.f900000664000175000017500000000143715141516316022423 0ustar alastairalastairmodule tomlf_type_keyval implicit none type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy end type toml_value type, extends(toml_value) :: toml_keyval character(len=:), allocatable :: raw contains procedure :: destroy end type toml_keyval interface new module procedure :: new_keyval end interface contains subroutine new_keyval(self) type(toml_keyval), intent(out) :: self end subroutine new_keyval subroutine destroy(self) class(toml_keyval), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%raw)) then deallocate(self%raw) end if end subroutine destroy end module tomlf_type_keyval lfortran-lfortran-2f73434/tests/character_parameter_padding_trimming.f900000664000175000017500000000233615141516316026711 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_parameter_padding_trimming !> initializate variables to test correct padding of ' ' to the end of character string character(len=8), parameter :: x_pad = "apple" !> char length on right is 5 character(len=10), parameter :: y_pad = "Ball" !> char length on right is 4 character(len=30), parameter :: z_pad = x_pad // y_pad // x_pad !> char length on right is 26 character(len=4), parameter :: p_pad(3) = "2" !> char length on right is 1 print *, "|" // x_pad // "|" print *, y_pad print *, p_pad !> initializate variables to test correct trimming of ' ' to the end of character string character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 print *, x_trim print *, y_trim print *, z_trim print *, p_trim end program lfortran-lfortran-2f73434/tests/modules_10.f900000664000175000017500000000053215141516316021265 0ustar alastairalastairmodule my_other_module integer :: my_global = 0 contains subroutine my_other_proc print *, my_global end subroutine end module module modules_10 use my_other_module, only: my_global contains subroutine my_proc use my_other_module, only: my_other_proc call my_other_proc end subroutine end module lfortran-lfortran-2f73434/tests/preprocessor8.f900000664000175000017500000000065315141516316022137 0ustar alastairalastairprogram preprocessor8 ! pre-defined macros implicit none print *, __LFORTRAN__ #ifdef __VERSION__ print *, "__VERSION__ present" #endif #ifdef __LFORTRAN_MAJOR__ print *, "__LFORTRAN_MAJOR__ present" #endif #ifdef __LFORTRAN_MINOR__ print *, "__LFORTRAN_MINOR__ present" #endif #ifdef __LFORTRAN_PATCHLEVEL__ print *, "__LFORTRAN_PATCHLEVEL__ present" #endif print *, __FILE__ print *, __LINE__ print *, __LINE__ end program lfortran-lfortran-2f73434/tests/preprocessor16.f900000664000175000017500000000051215141516316022210 0ustar alastairalastairprogram test_cpp_hex #if 0xFF == 255 print *, "yes hex and int equal" #else print *, "no hex and int equal" #endif #if 0xa == 0b1010 print *, "yes hex and bin equal" #else print *, "no hex and bin not equal" #endif #if 0B1010 == 10 print *, "yes bin and int equal" #else print *, "no bin and int not equal" #endif end program lfortran-lfortran-2f73434/tests/interop/0000775000175000017500000000000015141516316020455 5ustar alastairalastairlfortran-lfortran-2f73434/tests/interop/mod1-14.mod0000664000175000017500000000122015141516316022233 0ustar alastairalastairYo@S!3 &)*4OV[Tǒ{|.SNmKX\;?sx,/ ).|[<̖lf%Lo'tÏLsgpT!T4M lT|p7υ\W鰌dGèyھkWWܨ' GGÁ%yR%IAcђyZf__i=?qӺEkvf/Mu. 酃NW8O* 镆.TPsʩ&QƳjH6G|Ohmۂ`իx 2W8W|_-+) ԚU7m t@lfortran-lfortran-2f73434/tests/interop/mod1.f900000664000175000017500000000143615141516316021641 0ustar alastairalastairmodule mod1 implicit none private public f1, f2, f3, f4, f2b, f3b, f5b contains integer function f1(a, b) result(r) integer, intent(in) :: a, b r = a + b end function integer function f2(n, a) result(r) integer, intent(in) :: n, a(n) r = sum(a) end function integer function f3(n, m, a) result(r) integer, intent(in) :: n, m, a(n,m) r = sum(a) end function integer function f2b(a) result(r) integer, intent(in) :: a(:) r = sum(a) end function integer function f3b(a) result(r) integer, intent(in) :: a(:,:) r = sum(a) end function integer function f4(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a f4 = 0 end function integer function f5b(a) result(r) integer, intent(in) :: a(:,:) integer :: i r = 0 do i = 1, size(a, 2) r = r + a(1, i) end do end function end module lfortran-lfortran-2f73434/tests/interop/generate_mod_files.sh0000775000175000017500000000044615141516316024633 0ustar alastairalastair#!/usr/bin/env bash set -ex gfortran-7 -c mod1.f90 -o /tmp/a.o mv mod1.mod mod1-14.mod cp mod1-14.mod mod1-14-unpacked.mod.gz gzip -df mod1-14-unpacked.mod.gz gfortran-10 -c mod1.f90 -o /tmp/a.o mv mod1.mod mod1-15.mod cp mod1-15.mod mod1-15-unpacked.mod.gz gzip -df mod1-15-unpacked.mod.gz lfortran-lfortran-2f73434/tests/preprocessor4.f900000664000175000017500000000023315141516316022125 0ustar alastairalastairprogram preprocessor4 implicit none #define XPOW(a) ((a)**2) #define X123(a,b) ((a)+XPOW(b)) integer :: x, y x = (2+3)*5 print *, x, X123(1,2) end program lfortran-lfortran-2f73434/tests/team1.f900000664000175000017500000000101315141516316020317 0ustar alastairalastairprogram team1 implicit none ! Syntax check only(AST) integer, parameter :: n = 4 type (team_type) :: column, odd_even real,codimension[n, *] :: co_array integer,dimension(2) :: my_cosubscripts my_cosubscripts (:) = this_image(co_array) form team (my_cosubscripts(2), column, new_index = my_cosubscripts(1)) sync team (column) change team (column, ca[*] => co_array) ! segment 1 end team formteam (2-mod(this_image(), 2), odd_even) changeteam (odd_even) ! segment 2 endteam end program lfortran-lfortran-2f73434/tests/subroutine7.f900000664000175000017500000000015715141516316021606 0ustar alastairalastairsubroutine f(a, b) integer, intent(inout) :: a integer, intent(in out) :: b a = b + 1 b = a + 1 end subroutine lfortran-lfortran-2f73434/tests/preprocessor21.f900000664000175000017500000000104015141516316022201 0ustar alastairalastairprogram preprocessor21 #if (!defined(VAR1) | !defined(VAR2)) print *, "Atleast one of VAR1 and VAR2 isn't defined" #else print *, 'Both VAR1 and VAR2 are defined.' #endif #if (!defined(VAR3) & !defined(VAR4)) print *, "Neither of VAR3 or VAR4 is defined" #else print *, "At least one of VAR3 or VAR4 is defined." #endif #if (!defined(VAR5) ^ !defined(VAR6)) print *, "Exactly one of VAR5 or VAR6 is not defined." #else print *, "Both VAR5 and VAR6 are defined or neither is defined." #endif end program preprocessor21 lfortran-lfortran-2f73434/tests/global_scope1.f900000664000175000017500000000001515141516316022023 0ustar alastairalastairinteger :: x lfortran-lfortran-2f73434/tests/lookup_name2.f900000664000175000017500000000012315141516316021704 0ustar alastairalastairprogram lookup_name1 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-lfortran-2f73434/tests/implicit13.f900000664000175000017500000000060015141516316021267 0ustar alastairalastairinteger function a(d, e) implicit integer (a,b-c), integer*4 (d-e), integer*8 (f-g), real (h) implicit real*4 (i-k), real*8 (l), complex (m, n), complex*8 (o) implicit complex*16 (p), double precision (q), double precision (r) integer :: Y(e) real :: X(d, e, e) real :: b Y(1) = 3 X(1, 1, 1) = 3 a = 1 b = 2 d = 3 f = 4 h = 5 i = 6 l = 7 m = 8 o = 9 p = 10 q = 11 r = 12 end function lfortran-lfortran-2f73434/tests/modules2_module_b.f900000664000175000017500000000016515141516316022717 0ustar alastairalastairmodule tomlf_structure use tomlf_structure_base, only : toml_ordered implicit none end module tomlf_structure lfortran-lfortran-2f73434/tests/errors/0000775000175000017500000000000015141516316020311 5ustar alastairalastairlfortran-lfortran-2f73434/tests/errors/modulo_01.f900000664000175000017500000000007015141516316022425 0ustar alastairalastairprogram modulo_01 print *, modulo(1, 0) end program lfortran-lfortran-2f73434/tests/errors/continue_compilation_simd.f900000664000175000017500000000115515141516316026071 0ustar alastairalastairprogram continue_compilation_simd implicit none ! This file is for testing SIMD error checks in !LF$ attributes simd :: simd_2d, simd_alloc, simd_ptr, simd_scalar, simd_char, x real :: simd_2d(8, 8) real, allocatable :: simd_alloc(:) real, pointer :: simd_ptr(:) real :: simd_scalar character :: simd_char(8) real :: x !simd_2d print *, simd_2d(1,1) !simd_alloc print *, simd_alloc !simd_ptr print *, simd_ptr !simd_scalar print *, simd_scalar !simd_char print *, simd_char !simd_array print *, x end program continue_compilation_simdlfortran-lfortran-2f73434/tests/errors/type_casting_01.f900000664000175000017500000000014515141516316023622 0ustar alastairalastairprogram type_casting_01 implicit none logical :: x(3) = [1, 1, 0] print *, x end program lfortran-lfortran-2f73434/tests/errors/type_mismatch2.f900000664000175000017500000000011215141516316023553 0ustar alastairalastairprogram type_mismatch2 implicit none integer :: x x = 5 + "x" end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_14.f900000664000175000017500000000042315141516316024761 0ustar alastairalastairmodule array_bounds_check_14_mod contains subroutine f(i) integer, intent(in) :: i(:) print *, i end subroutine end module program array_bounds_check_14 use array_bounds_check_14_mod integer, allocatable :: x(:) call f(x) end program lfortran-lfortran-2f73434/tests/errors/intrinsics10.f900000664000175000017500000000015015141516316023153 0ustar alastairalastairprogram intrinsics10 integer(4) :: x = 1 integer(8) :: y = 2 print *, ieor(x, y) end programlfortran-lfortran-2f73434/tests/errors/cpp5.f900000664000175000017500000000012615141516316021477 0ustar alastairalastairprogram cpp5 implicit none #include "cpp5.h" x = (2+3)*5 print *, x, C123 end program lfortran-lfortran-2f73434/tests/errors/cpp6.h0000664000175000017500000000002715141516316021331 0ustar alastairalastair! Not declared z12 = 5 lfortran-lfortran-2f73434/tests/errors/kind2.f900000664000175000017500000000006415141516316021640 0ustar alastairalastairprogram kind2 implicit none real(*) a end program lfortran-lfortran-2f73434/tests/errors/fixed_form_3.f0000664000175000017500000000015215141516316023022 0ustar alastairalastair program X integer :: y y = 5 500 print *, sin(y print *, "OK" end program lfortran-lfortran-2f73434/tests/errors/external1.f900000664000175000017500000000040215141516316022530 0ustar alastairalastairsubroutine sub() external f double precision f, y y = f(1.0d0) if (abs(y-1.0d0) >= 1e-8) error stop print *, y end subroutine double precision function f(x) double precision x f = x end function program main call sub() end program lfortran-lfortran-2f73434/tests/errors/unterminated_comment_01.f900000664000175000017500000000030315141516316025346 0ustar alastairalastair#if !defined pi_constant #define PI 3.14 #endif /* unterminated comment starts here program unterminated_comment_01 implicit none print *, "PI: ", PI end program unterminated_comment_01 lfortran-lfortran-2f73434/tests/errors/write_02.f900000664000175000017500000000056415141516316022271 0ustar alastairalastairprogram write_02 implicit none character(len=*), parameter :: temp_file = "lfortran_temporary_file_write_02.dat" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, form="unformatted", file=temp_file) !unformatted write(unit,*) test_line !formatted close(unit) end programlfortran-lfortran-2f73434/tests/errors/maskr_incorrect_bit_size.f900000664000175000017500000000010215141516316025677 0ustar alastairalastairprogram maskr_incorrect_bit_size print*, maskr(63) end program lfortran-lfortran-2f73434/tests/errors/intrinsics1.f900000664000175000017500000000013515141516316023076 0ustar alastairalastairprogram intrinsics1 implicit none print *, radix((2.4, 1.0)) end program intrinsics1 lfortran-lfortran-2f73434/tests/errors/array_bounds_check_15.f900000664000175000017500000000014615141516316024764 0ustar alastairalastairprogram array_bounds_check_15 implicit none integer, allocatable :: x(:) print *, x end lfortran-lfortran-2f73434/tests/errors/incorrect_number_args_subroutine.f900000664000175000017500000000022015141516316027456 0ustar alastairalastairprogram expr implicit none call my_func(1) contains subroutine my_func() print *, "hi" end subroutine end program expr lfortran-lfortran-2f73434/tests/errors/cpp6.f900000664000175000017500000000010715141516316021477 0ustar alastairalastairprogram cpp6 implicit none #include "cpp6.h" print *, "OK" end program lfortran-lfortran-2f73434/tests/errors/intrinsics9.f900000664000175000017500000000014715141516316023111 0ustar alastairalastairprogram intrinsics9 integer(4) :: x = 1 integer(8) :: y = 2 print *, iand(x, y) end programlfortran-lfortran-2f73434/tests/errors/dnint_args.f900000664000175000017500000000015715141516316022764 0ustar alastairalastairprogram main print*, dnint(1.0_8, 8) if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop end programlfortran-lfortran-2f73434/tests/errors/atomic_01.f900000664000175000017500000000017415141516316022407 0ustar alastairalastairprogram atomic use iso_fortran_env integer :: atom[*] call atomic_add (atom[1], this_image()) end program atomiclfortran-lfortran-2f73434/tests/errors/dimension_02.f900000664000175000017500000000014015141516316023112 0ustar alastairalastairprogram main integer :: linelen = 2 character, dimension(linelen) :: line end programlfortran-lfortran-2f73434/tests/errors/cpp_err3.f900000664000175000017500000000011715141516316022345 0ustar alastairalastairprogram cpp_err3 #define f(x) x #if f(2 < 1+2 #endif print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/incompatible_dimension_logical_arrays_logical_binop_01.f900000664000175000017500000000017415141516316033602 0ustar alastairalastairprogram main logical, parameter :: x1(3) = [.true., .false., .false.] print *, x1 .neqv. [.true., .true.] end program lfortran-lfortran-2f73434/tests/errors/intrinsics13.f900000664000175000017500000000007415141516316023163 0ustar alastairalastairprogram intrinsics13 print *, min(12, 13.94) end programlfortran-lfortran-2f73434/tests/errors/iostat_non_scalar_value.f900000664000175000017500000000035115141516316025526 0ustar alastairalastairprogram iostat_non_scalar_value implicit none integer :: ios(2) = 1 character(len=100) :: buffer buffer = 'Temporary date for testing purpose' read(buffer, *, iostat=ios(1:1)) end program iostat_non_scalar_value lfortran-lfortran-2f73434/tests/errors/int_01.f900000664000175000017500000000013015141516316021715 0ustar alastairalastairprogram main integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) end programlfortran-lfortran-2f73434/tests/errors/fixed_form_1.f0000664000175000017500000000012315141516316023016 0ustar alastairalastair program X xinteger :: y y = 5 500 print *, y end program lfortran-lfortran-2f73434/tests/errors/dint_args.f900000664000175000017500000000015515141516316022604 0ustar alastairalastairprogram main print*, dint(1.0_8, 8) if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop end programlfortran-lfortran-2f73434/tests/errors/incompatible_dimension_logical_arrays_logical_binop_02.f900000664000175000017500000000024515141516316033602 0ustar alastairalastairprogram main logical, parameter :: x1(3) = [.true., .false., .false.] logical, parameter :: x2(2) = [.true., .true.] print *, x1 .neqv. x2 end program lfortran-lfortran-2f73434/tests/errors/program_without_line_02.f900000664000175000017500000000005115141516316025367 0ustar alastairalastairprint *, "OK" contains print *, "OK" end lfortran-lfortran-2f73434/tests/errors/incompatible_rank_assign.f900000664000175000017500000000005715141516316025660 0ustar alastairalastairprogram main integer :: x = [1,2,3] end programlfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_05.f900000664000175000017500000000023215141516316025741 0ustar alastairalastairprogram scalar_allocation_check_05 implicit none type m integer, allocatable :: x end type type(m) :: m1 print *, m1%x end lfortran-lfortran-2f73434/tests/errors/mre_parameter.f900000664000175000017500000000022415141516316023452 0ustar alastairalastairprogram mre_parameter1 implicit none character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) print *, ar1 end program lfortran-lfortran-2f73434/tests/errors/fixed_form_2.f0000664000175000017500000000012315141516316023017 0ustar alastairalastair program X integer :: y y = 5x 500 print *, y end program lfortran-lfortran-2f73434/tests/errors/implicit_typing2.f900000664000175000017500000000026715141516316024124 0ustar alastairalastairmodule implicit_typing2_errors_module implicit none contains subroutine sub1() x = 1 end subroutine sub1 end module implicit_typing2_errors_module program main end program main lfortran-lfortran-2f73434/tests/errors/continue_compilation_1.f900000664000175000017500000003403215141516316025275 0ustar alastairalastair! If you need a function, put it into the module below and remove the same ! number of lines below the module to keep the rest of the lines in this file ! intact. module continue_compilation_1_mod use, intrinsic :: ieee_arithmetic, only: ieee_class, ieee_quiet_nan, ieee_class_type type :: MyClass integer :: value contains procedure :: display end type MyClass type :: logger_type contains private procedure, public, pass(self) :: add_log_file end type logger_type type(MyClass), PROTECTED :: protected_module_my_class_obj ! Test for Missing Declaration: type :: ctx_missing_t procedure(f_missing), pointer, nopass :: fn => null() end type procedure(missing_global_interface), pointer :: p => null() interface assignment(=) module procedure assign_func_bad module procedure assign_wrong_nargs module procedure assign_bad_lhs module procedure assign_bad_rhs end interface contains subroutine my_undefined_type_test() implicit none type(another_undefined_type) :: s3_in_subroutine end subroutine my_undefined_type_test subroutine my_func(x, y) integer, intent(in) :: x, y print *, "hi" end subroutine subroutine display(self, extra_arg) class(MyClass), intent(in) :: self integer, intent(in) :: extra_arg print *, "Value in object:", self%value end subroutine display subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), optional :: filename integer :: unit filename = "lfortran" unit = 10 end subroutine add_log_file subroutine s(c) bind(c) use iso_c_binding character(len=2, kind=c_char), intent(in) :: c end subroutine s subroutine ubound_assumed_size(a, b, c) real :: a(*) real :: b(*) real :: c(10, *) print *, ubound(a, 1) print *, ubound(b) print *, ubound(c, 2) end subroutine subroutine assumed_size_star_pos_1(a) real, intent(in) :: a(*, 10) end subroutine subroutine assumed_size_star_pos_2(a) real :: a(*, 10) end subroutine subroutine proc_param(p) procedure(ubound_assumed_size) :: p end subroutine proc_param subroutine modify_and_deallocate(s) character(5), allocatable :: s deallocate(s) end subroutine modify_and_deallocate subroutine intrinsic_polymorphic(generic) class(*), intent(in) :: generic print *, trim(generic) print *, adjustl(generic) print *, adjustr(generic) print *, len_trim(generic) end subroutine intrinsic_polymorphic integer function assign_func_bad(lhs, rhs) integer, intent(out) :: lhs integer, intent(in) :: rhs assign_func_bad = rhs end function assign_func_bad subroutine assign_wrong_nargs(lhs) integer, intent(out) :: lhs end subroutine assign_wrong_nargs subroutine assign_bad_lhs(lhs, rhs) integer, intent(in) :: lhs integer, intent(in) :: rhs end subroutine assign_bad_lhs subroutine assign_bad_rhs(lhs, rhs) integer, intent(out) :: lhs integer, intent(out) :: rhs end subroutine assign_bad_rhs end module ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_1 use continue_compilation_1_mod implicit integer(a-f), real(e-z) ! Put declarations below without empty lines integer :: a(3), b(3), b1(3, 3), a3(3, 3, 3), b4(3, 3, 3, 3), a5, c5, i, arr1(3), arr2(2, 3), arr3(2, 1, 3) character :: a1(3, 3) logical :: a2(3, 3), mask1(3), mask2(2, 3), mask3(2, 1, 3), mask4(3, 2), mask5(2, 3, 1), y integer(kind=8) :: b5 real(8) :: y1 real :: z1 integer, parameter :: i1 = 2 character(len=5) :: string = "hello" character(len=1) :: set(2) = ["l", "h"] integer :: q1 real :: r1 character :: c1 complex :: c = (1.0, 2.0) real a_real(0) integer, allocatable :: shape_(:), arr4(:), arr5(:) integer, dimension(2, 3) :: matrix integer, dimension(4) :: source = [1, 2, 3, 4] allocate(shape_(2)) real :: v character(10) :: str character(3), parameter :: ar1 = repeat(["abc", "#^1", "123"], [1, 2, 3]) integer, parameter :: zero = 0 integer :: x = 1 real :: adwf = .true. integer, volatile :: volatile_var dimension array(3) double precision array integer , dimension(3) :: array type(logger_type) :: logger integer :: unit character(len=100) :: filename type(MyClass), parameter :: myclass_array(2) = [1, MyClass(10)] type(MyClass), parameter :: myclass_array2(2) = [MyClass(1), MyClass(q1)] character(width=10) :: str_c_1 character(len=10, len=20) :: str_c_2 character(len=10, 1) :: str_c_3 character(1, len=20) :: str_c_4 character(:), allocatable :: x(2) integer, dimension(:,:), allocatable :: arr_size logical :: mask_size(size(arr_size)) integer, protected :: protected_attr_var integer, parameter, protected :: protected_parameter_var type(MyClass) :: v1, v2, v3 type(MyClass) :: arr(3) integer :: n = 2 type :: matrix integer :: elements(n) end type type(bspline_3d) :: s3_in_program integer :: j2, i2, k2(2), x2(2), y2(3) integer::tt = b'01' * 3 integer :: fmt_i1, fmt_i2, fmt_i3 ! for issue #8925 integer, allocatable :: allocate_int = 1 character(:), allocatable :: allocate_char = "H" intrinsic :: not_real call sub(not_real) integer :: param_arr(3) = [5, 10, 15] integer, parameter :: param_minloc = minloc(param_arr, 1, [.false., .false., .false.]) integer :: cc_a3(2) = [2, 3] integer :: cc_temp3(2) integer :: cc_i0 = 1 integer :: cc_a4(2) integer :: cc_temp4(5) integer :: cc_i1 = 1 character(10) :: strx type(MyClass), parameter :: uninitialized_param_local type(MyClass) :: err_obj1 = non_existent_symbol type(MyClass) :: err_obj2 = my_func integer :: non_parameter_var = 5 type(MyClass) :: err_obj3 = non_parameter_var type(MyClass) :: err_obj4 = myclass_array type(MyClass) :: err_obj5 = uninitialized_param_local ! Unary defined operator with missing procedure interface operator(.bad.) module procedure bad_op end interface integer :: bad_x type(ieee_class_type) :: ieee_cls ! Use the space above to insert new declarations, and remove the line, so ! that the lines below do not shift, to keep the diff minimal. ! ! Only put statements below. If you need to call a function, put it into a ! module above. a = 1 print *, a(10) a5 = 8 b5 = 12_8 c5 = 2 !loop_test do i=1,3 i = i + 1 print*,i end do !maskl_incorrect_bit_size print*, maskl(63) !maskr_incorrect_bit_size print*, maskr(63) !maskl_negative print*, maskl(-24) !maskr_negative print*, maskr(-24) !matrix_matmul_01 print *, matmul(a1, b1) !matrix_matmul_02 print *, matmul(b1, a1) !matrix_matmul_03 print *, matmul(a2, b1) !matrix_matmul_04 print *, matmul(a3, b1) !matrix_matmul_05 print *, matmul(b1, b4) !matrix_matmul_06 print *, matmul(a, b) !matrix_transpose_01 print *, transpose(a) !merge_bits_comp print *, merge_bits(8, 12_8, 2) !merge_bits_run print *, merge_bits(a5, b5, c5) !Does not work correctly : Issue: #5469 ------------- ! !max_01 ! y1 = 5.2d0 ! z1 = 9.0 ! print *, max(y1, z1) ! !max_02 ! print *, max(b5, a5) ! !min_01 ! print *, min(y1, z1) ! !min_02 ! print *, min(b5, a5) !------------------------------ !modulo_01 print *, modulo(1, 0) !more_kwargs_than_acceptable_to_subroutine call my_func(y=1, x=2, z=1) !nint_overflow print*, nint(1e12_8) print*, nint(1000000000000.0000000000000000d0) ! open_invalid_kwarg1 OPEN(file="numbers", hello="world") !parameter_01 i1 = 3 print*,i1 call FLUSH(1, 2) print*, verify(string, set, kind= [4, 4] ) print *, and([1, 2, 3], [1, 2, 3]) print *, dshiftl(1, 2, 34) print *, dshiftl(1, 2, -2) print *, dshiftr(1, 2, 34) print *, dshiftr(1, 2, -2) print *, selected_int_kind([1,2,3]) print *, selected_real_kind([1,2,3]) print *, selected_char_kind(['c', 'a', 'b']) arr1 = reshape([1, 2, 3], [3]) arr2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) arr3 = reshape([1, 2, 3, 4, 5, 6], [2, 1, 3]) mask1 = reshape([.true., .false., .true.], [3]) mask2 = reshape([.true., .false., .true., .true., .false., .true.], [2, 3]) mask3 = reshape([.true., .false., .true., .true., .false., .true.], [2, 1, 3]) print *, sum(arr1, dim = 2) print *, sum(arr1, dim = -1) print *, sum(arr1, mask = mask1, dim = 2) print *, sum(arr1, mask = mask1, dim = -1) print *, product(arr2, dim = 3) print *, product(arr2, dim = -1) print *, product(arr2, mask = mask2, dim = 3) print *, product(arr2, mask = mask2, dim = -1) print *, iparity(arr3, dim = 4) print *, iparity(arr3, dim = -1) print *, iparity(arr3, mask = mask3, dim = 4) print *, iparity(arr3, mask = mask3, dim = -1) if (q1) q1 = 1 if (r1) r1 = 1.0 if (c1) c1 = 'a' mask4 = reshape([.true., .false., .true., .true., .false., .true.], [3, 2]) mask5 = reshape([.true., .false., .true., .true., .false., .true.], [2, 3, 1]) print *, sum(arr1, mask2) print *, sum(arr2, mask3, 2) print *, iparity(arr2, mask4) print *, iparity(arr3, mask5, 3) ! argument_not_a_variable print *, present(a + 1) ! argument_not_optional print *, present(a) print *, pack([1, 2, 3], [.true., .true., .true., .true.]) print *, reshape("hello", [2, 3]) print *, reshape(.true., [2, 3]) print *, reshape([1, 2, 3, 4], "hello") print *, reshape([1, 2, 3, 4], .false.) print *, reshape([1, 2, 3, 4], [2, 3]) ! Division by zero print *, 1/0 print *, x/zero print *, v**str print *, str**v print *, shiftl(2, 34) print *, shiftl(2, -3) print *, shiftr(2, 34) print *, shiftr(2, -3) print *, rshift(2, 34) print *, rshift(2, -3) print *, sum([c1]) print *, product([c1]) print *, minval([c]) print *, maxval([c]) print *, sum(q1) print *, product(r1) print *, minval(q1) print *, maxval(r1) print *, sum([1, 2, 3], mask = [1, 2, 3]) z1 = y print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], 0) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0], 0) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [1.2]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], [0_8]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [1.0, 2.0]) print *, reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 3]) print *, count(1) print *, count([2]) a_real = [logical::] print *,size(a_real) print *, iparity(["a", "b"]) print *, parity(["a", "b"]) shape_ = [2, 3] matrix = reshape(source, shape_, pad=[0]) deallocate(shape_) ! c is Complex print *, c%mymember ! c1 is Character print *, c1%mymember print *, present(x,x) print *, present() print *, ieor(x) print *, ieor() exit ! calling function with less arguments call my_func(10) call my_func() ! checking for self argument too type(MyClass) :: obj obj%value = 42 call obj%display() ! checking source in allocate allocate(arr4(5), source=[1, 2, 3]) allocate(arr4(5), source=v) allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) allocate(arr4, source=7) call logger % add_log_file(filename=filename) call logger % add_log_file() allocate(arr5, status=q1) allocate(arr5, mold = arr4) print *, ["aa", "aaa"] cc_a3 = cc_temp3(cc_i0:cc_i0) print *, pack(arr2, mask1) print *, size(cc_a3) ! assigning to a *PROTECTED* struct instance member, not allowed protected_module_my_class_obj%value = 42 cc_a4 = cc_temp4(cc_i1+1:cc_i1+1) arr = [type(MyClass) :: v1, v2, v3] print *, size(cc_a4) arr = [NonExistingType :: v1, v2, v3] !Data Statements with different number of arguments on LHS and RHS data j2, x2, (y2(i2), i2=1,3), k2 / 1,2,3,4,5,6,7,3*8 / q1: do q1 = 1, 3 print *, q1 end do q1 ! Test assigned format WRITE ASSIGN 0012 TO fmt_i1 0012 FORMAT (" **** ASSIGN FORMAT NUMBER TO INTEGER VARIABLE ****" ) WRITE (6, fmt_i1) ! Test assigned format PRINT assign 100 to fmt_i2 100 format (A) print fmt_i2, "test" ! Test assigned format READ assign 13 to fmt_i3 13 format () read (5, fmt_i3) !passing non procedure to procedure parameter call proc_param(42) x = 9010 read (*, end=x) x read (*, end=9011.0) x x = 9012 read (*, err=x) x read (*, err=9013.0) x write (*, end=9014) x 9014 continue write (*, err=9015) x 9015 continue read(*, *, end=999) x read(*, *, err=500) x OPEN(unit=10, recl=10, recl=20) OPEN(unit=10, recl=10.5) i = 1 print *, string(i,i) allocate(strx) strx = "hello12345" call modify_and_deallocate(strx) print *, allocated(strx) call intrinsic_polymorphic(" Hello World ") OPEN(unit=10, encoding="UTF-8", encoding="UTF-8") OPEN(unit=10, encoding=10) character(len=10) :: str_var read(str_var, rec=1) x write(str_var, rec=1) x read(unit=10, rec=1, rec=2) y write(unit=10, rec=1, rec=2) y read(10, rec=1.5) y write(10, rec=2.5) y ! unary defined operator with no matching function bad_x = .bad. 10 ieee_cls = ieee_class(0.0) b = (ieee_cls == ieee_quiet_nan) integer, intent(out) :: out_intent integer, intent(in) :: in_intent contains subroutine sub(f) interface function f(x) integer :: x, f end function end interface end subroutine end program lfortran-lfortran-2f73434/tests/errors/string_assignment_01.f900000664000175000017500000000023715141516316024671 0ustar alastairalastairprogram string_assignment_01 implicit none character(:), allocatable :: a character(:), allocatable :: b a = b end program string_assignment_01lfortran-lfortran-2f73434/tests/errors/derived_type_06.f900000664000175000017500000000045615141516316023626 0ustar alastairalastairprogram derived_type_06 implicit none TYPE test_type2 integer :: num END TYPE test_type2 TYPE test_type1 type(test_type2):: arr_2(3) END TYPE test_type1 TYPE(test_type1), DIMENSION(5) :: main_arr main_arr%arr_2%num = 22 end program derived_type_06 lfortran-lfortran-2f73434/tests/errors/intrinsics8.f900000664000175000017500000000014615141516316023107 0ustar alastairalastairprogram intrinsics8 integer(4) :: x = 1 integer(8) :: y = 2 print *, ior(x, y) end programlfortran-lfortran-2f73434/tests/errors/cpp8.f900000664000175000017500000000031115141516316021476 0ustar alastairalastair!test location information for errors program test #ifdef SOMETHING #endif // This should work implicit none integer :: abc = 10 /* hi*/ print *, "asdjfal" print *, abcx end program test lfortran-lfortran-2f73434/tests/errors/array_02.f900000664000175000017500000000011515141516316022245 0ustar alastairalastairprogram array_02 implicit none print *, [[[], [[]]], [[]], []] end program lfortran-lfortran-2f73434/tests/errors/float1.f900000664000175000017500000000006715141516316022022 0ustar alastairalastairprogram float1 real :: y print *, float(y) end program lfortran-lfortran-2f73434/tests/errors/intrinsics7.f900000664000175000017500000000007615141516316023110 0ustar alastairalastairprogram intrinsics7 print *, hypot(1.0, 2.7_8) end programlfortran-lfortran-2f73434/tests/errors/template_error_01a.f900000664000175000017500000000546615141516316024331 0ustar alastairalastairmodule math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module travel use math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_T(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template end module module template_error_01_m use math use travel implicit none contains subroutine test_template() instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_T => avg_S_from_T instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s1, s2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s1=", s1 print *, "s2=", s2 end subroutine end module program template_error_01 use template_error_01_m implicit none call test_template() end program template_error_01lfortran-lfortran-2f73434/tests/errors/esub1.f900000664000175000017500000000006315141516316021647 0ustar alastairalastairsubroutine g() r integer :: x x = 1 end subroutine lfortran-lfortran-2f73434/tests/errors/incorrect_type_where_01.f900000664000175000017500000000015515141516316025355 0ustar alastairalastairprogram main implicit none integer :: b(5) where(.true.) b = 12121 print *, b end program main lfortran-lfortran-2f73434/tests/errors/func_parameter_type.f900000664000175000017500000000024415141516316024665 0ustar alastairalastairPROGRAM test_present print *, f(42.9) CONTAINS LOGICAL FUNCTION f(x) INTEGER, INTENT(IN), OPTIONAL :: x f = PRESENT(x) END FUNCTION END PROGRAMlfortran-lfortran-2f73434/tests/errors/interface_01.f900000664000175000017500000000047615141516316023100 0ustar alastairalastairmodule interface_01_mod implicit none interface func module function e(x) implicit none real, intent(in) :: x real :: e end function e end interface contains module function e(x) integer, intent(in) :: x real :: e e = x * 2.0 end function end module interface_01_mod lfortran-lfortran-2f73434/tests/errors/flush_invalid_kwarg1.f900000664000175000017500000000020115141516316024725 0ustar alastairalastairPROGRAM flush_invalid_kwarg1 ! "start" is an invalid keyword argument for "REWIND" FLUSH(unit=10, start=100) END PROGRAM lfortran-lfortran-2f73434/tests/errors/implicit_call_01.f900000664000175000017500000000026115141516316023735 0ustar alastairalastairsubroutine callsub (xub, i) ! xub is a variable (implicitly typed as real), ! trying to call it should fail without --implicit-interface call xub (i) end subroutine lfortran-lfortran-2f73434/tests/errors/type_mismatch1.f900000664000175000017500000000010615141516316023555 0ustar alastairalastairprogram type_mismatch1 implicit none integer :: x x = "x" end program lfortran-lfortran-2f73434/tests/errors/array_shape_05.f900000664000175000017500000000025115141516316023431 0ustar alastairalastairprogram array_shape_05 implicit none integer :: a(2) integer :: temp(5) integer :: i integer :: j i = 1 j = i a = temp(i:j) end program lfortran-lfortran-2f73434/tests/errors/end_function_name_not_match.f900000664000175000017500000000024615141516316026342 0ustar alastairalastairreal function square(x) ! Declare the type of the argument real, intent(in) :: x ! Declare the return variable square = x * x end function square_int lfortran-lfortran-2f73434/tests/errors/template_error_05.f900000664000175000017500000000212415141516316024160 0ustar alastairalastairmodule template_error_05_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains integer function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_05 use template_error_05_m implicit none call test_template() end program template_error_05 lfortran-lfortran-2f73434/tests/errors/formatTesting.f900000664000175000017500000000014215141516316023454 0ustar alastairalastairprogram main print "(2E13)", epsilon(1e0) ! the code will work as we put 2E13.5 end programlfortran-lfortran-2f73434/tests/errors/cpp_err6.f900000664000175000017500000000010115141516316022341 0ustar alastairalastairprogram cpp_err6 #if 1 + (1+2 ( #endif print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/dfloat1.f900000664000175000017500000000007115141516316022161 0ustar alastairalastairprogram dfloat1 real :: y print *, dfloat(y) end program lfortran-lfortran-2f73434/tests/errors/array_size_05.f900000664000175000017500000000024315141516316023304 0ustar alastairalastairprogram array_size_05 implicit none integer :: a(3) integer :: size_a integer :: kindvar = 4 size_a = size(a, kind=kindvar, dim=1) end program lfortran-lfortran-2f73434/tests/errors/data_implied_do3.f900000664000175000017500000000023615141516316024013 0ustar alastairalastairprogram data_implied_do3 implicit none integer :: k = 3 integer :: i, iarx(3) data(iarx(i), i=k, 3) / 1, 2, 3 / end program data_implied_do3 lfortran-lfortran-2f73434/tests/errors/cpp_err5.f900000664000175000017500000000010015141516316022337 0ustar alastairalastairprogram cpp_err5 #if 1 + @ 1 2 #endif print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/derived_type_03.f900000664000175000017500000000051115141516316023613 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester abstract interface subroutine testing_interface(self) integer, intent(inout) :: self end subroutine testing_interface end interface end module test lfortran-lfortran-2f73434/tests/errors/runtime_stacktrace_01.f900000664000175000017500000000051215141516316025016 0ustar alastairalastairprogram expr2 implicit none print *, main() contains function main() integer :: main main = 1 print *, g() end function main subroutine f() stop 1 end subroutine f function g() integer :: g g = 1 call f() end function g end program expr2 lfortran-lfortran-2f73434/tests/errors/matrix_matmul_05.f900000664000175000017500000000020515141516316024015 0ustar alastairalastairprogram matrix_matmul_05 implicit none integer :: a(3, 3) integer :: b(3, 3, 3, 3) print *, matmul(a, b) end program lfortran-lfortran-2f73434/tests/errors/maskl_negative.f900000664000175000017500000000007115141516316023620 0ustar alastairalastairprogram maskl_negative print*, maskl(-24) end program lfortran-lfortran-2f73434/tests/errors/kind_float_of_int.f900000664000175000017500000000011615141516316024277 0ustar alastairalastairprogram kind_float_of_int implicit none integer(4.2) :: x end program lfortran-lfortran-2f73434/tests/errors/ichar_01.f900000664000175000017500000000011015141516316022207 0ustar alastairalastairprogram ichar_01 implicit none print*, ichar("okay") end programlfortran-lfortran-2f73434/tests/errors/derived_type_04.f900000664000175000017500000000054015141516316023616 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred, pass(my_object) :: testing end type tester abstract interface subroutine testing_interface(a, b, c) integer, intent(inout) :: a, b, c end subroutine testing_interface end interface end module test lfortran-lfortran-2f73434/tests/errors/array_size_03.f900000664000175000017500000000016015141516316023300 0ustar alastairalastairprogram arrays_02 implicit none integer :: a(3) integer :: size_a size_a = size(a, kind1=4) end lfortran-lfortran-2f73434/tests/errors/init1.f900000664000175000017500000000004015141516316021647 0ustar alastairalastairprogram init1 integer x = 1 end lfortran-lfortran-2f73434/tests/errors/type_conflict1.f900000664000175000017500000000015715141516316023557 0ustar alastairalastairprogram type_conflict1 implicit none integer, parameter, target :: foo=4 print *,foo end program lfortran-lfortran-2f73434/tests/errors/kind_invalid_int_of_int.f900000664000175000017500000000012215141516316025467 0ustar alastairalastairprogram kind_invalid_int_of_int implicit none integer(3) :: x end program lfortran-lfortran-2f73434/tests/errors/esub2.f900000664000175000017500000000006215141516316021647 0ustar alastairalastairsubroutine g() integer :: x x = ~1 end subroutine lfortran-lfortran-2f73434/tests/errors/subroutine3.f900000664000175000017500000000014615141516316023114 0ustar alastairalastairprogram sizef call f() contains subroutine f() print *, size(f) end subroutine end programlfortran-lfortran-2f73434/tests/errors/substring_startidx.f900000664000175000017500000000023615141516316024574 0ustar alastairalastairprogram substring_noninteger_startidx implicit none character(len=8) :: s = "lfortran" print*, s(1.1:5) end program substring_noninteger_startidx lfortran-lfortran-2f73434/tests/errors/array_bounds_check_06.f900000664000175000017500000000031315141516316024760 0ustar alastairalastairprogram array_bounds_check_06 implicit none integer :: x(3) integer, allocatable :: y(:) allocate(y(4)) ! works with 3, must fail with 2 or 4 x = 2 y = 3 x = y end program lfortran-lfortran-2f73434/tests/errors/parameter_01.f900000664000175000017500000000012715141516316023111 0ustar alastairalastairprogram parameter_01 integer, parameter :: i = 2 i = 3 print*,i end programlfortran-lfortran-2f73434/tests/errors/intrinsics14.f900000664000175000017500000000007215141516316023162 0ustar alastairalastairprogram intrinsics14 print *, scale([1, 2, 3], 2) end lfortran-lfortran-2f73434/tests/errors/array_shape_01.f900000664000175000017500000000012715141516316023427 0ustar alastairalastairprogram main integer :: x(3,2) x = reshape([1,2,3,4],[2,2]) print * ,x end programlfortran-lfortran-2f73434/tests/errors/end_submodule_name.f900000664000175000017500000000061415141516316024457 0ustar alastairalastairmodule mother implicit none real, parameter :: pi = 4.*atan(1.) real :: tau interface module real elemental function pi2tau(pi) real, intent(in) :: pi end function pi2tau end interface contains end module mother submodule (mother) daughter implicit none contains module procedure pi2tau pi2tau = 2*pi end procedure pi2tau end submodule son lfortran-lfortran-2f73434/tests/errors/dimension_01.f900000664000175000017500000000010115141516316023106 0ustar alastairalastairprogram main integer, dimension("abcd") :: line end programlfortran-lfortran-2f73434/tests/errors/cpp_err1.f900000664000175000017500000000012015141516316022335 0ustar alastairalastairprogram cpp_err1 implicit none #if 2 < 1+2+ #endif print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/program_without_line_cc.f900000664000175000017500000000002715141516316025536 0ustar alastairalastairprint *, "OK" contains lfortran-lfortran-2f73434/tests/errors/passing_array_01.f900000664000175000017500000000162515141516316023777 0ustar alastairalastairMODULE passing_array_01_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface CONTAINS FUNCTION test_01 (len,value) result(res) implicit none integer :: len INTEGER, DIMENSION(3,len,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry integer:: len INTEGER, DIMENSION(6,2) :: value INTEGER :: ret len = 1 ret = test_01(len,value) ! This works with no problems. ret = test_01_interface(len,value) ! This raise error as interfaces are strict on matching the number of ranks, so it doesn't find a match. end subroutine test_entry END MODULE passing_array_01_mod program passing_array_01 use passing_array_01_mod implicit none call test_entry end program passing_array_01 lfortran-lfortran-2f73434/tests/errors/array_bounds_check_05.f900000664000175000017500000000042215141516316024760 0ustar alastairalastairprogram array_bounds_check_05 integer, allocatable :: x(:) allocate(x(3)) x = [1, 2, 3] call my(x, 5) contains subroutine my(x, i) integer, intent(in) :: x(i) integer, intent(in) :: i end subroutine end program lfortran-lfortran-2f73434/tests/errors/implicit_typing3.f900000664000175000017500000000026015141516316024116 0ustar alastairalastairmodule implicit_typing3_module implicit none contains function fun() end function fun end module implicit_typing3_module program main end program main lfortran-lfortran-2f73434/tests/errors/ifix_01.f900000664000175000017500000000006615141516316022072 0ustar alastairalastairprogram ifix_01 print *, ifix(4.23_8) end program lfortran-lfortran-2f73434/tests/errors/incompatible_ranks_allocatable_arr1.f900000664000175000017500000000035715141516316027752 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr1 implicit none ! allocatable array of rank 2 integer, allocatable :: arr1(:, :) ! RHS is a constant array of rank 1 ! incompatible assignment arr1 = [1, 2, 3] end program lfortran-lfortran-2f73434/tests/errors/continue_compilation_ff_1.f0000664000175000017500000000402015141516316025571 0ustar alastairalastairc If you need a function, put it into the module below and remove the same c number of lines below the module to keep the rest of the lines in this file c intact. module continue_compilation_1_mod CONTAINS LOGICAL FUNCTION f(x) INTEGER, INTENT(IN), OPTIONAL :: x f = PRESENT(x) END FUNCTION f end module c Only put declarations and statements here, no subroutines (those go above). PROGRAM continue_compilation_ff INTEGER :: init_x = 1 INTEGER, POINTER :: y_1 INTEGER(2), POINTER :: y_2(:) INTEGER :: shape(2, 2) INTEGER, PARAMETER :: x = 2 REAL :: circleArea COMPLEX :: a INTEGER :: val CHARACTER(1) :: x_2 INTEGER :: i INTEGER :: a_2(3) INTEGER :: size_a INTEGER :: a_3(3) INTEGER :: size_a_2 INTEGER :: kindvar = 4 REAL(8), ALLOCATABLE :: x_3(:) REAL :: y_3 INTEGER, PARAMETER :: Nx = 600, Ny = 450 INTEGER :: i_1, j, image(Nx, Ny) INTEGER :: i_2, j_1 INTEGER :: i_3 COMPLEX :: a_4 COMPLEX :: a_5 REAL :: y_4 INTEGER :: I J c Use the space above to insert new declarations, and remove the line, so c that the lines below do not shift, to keep the diff minimal. c Only put statements below. If you need to call a function, put it into a c module above. CLOSE(UNIT=200) I == 10 J = 20..5 PRINT *, "Value of I is" I CHARACTER*10 STR = 'Hello ' WRITE(*,10 FORMAT(A)) A = B + * C INTEGER K L M = 5 READ *, N 5 REAL X Y Z 10.5 COMPLEX C = (1.0,2.0 I === 10 J = .20E REAL*8 A = 1.23.45 INTEGER*4 VAR/5/ INTEGER*4 VAR/5/ EQUIVALENCE (X Y) x_2 = 'u' i = 10 IF (i > ICHAR(x_2)) THEN END IF size_a = SIZE(a_2, DIM=1) c a_5 = CMPLX(1) IF I .EQ. 10 THEN PRINT *, "Ten" CALL FUNC( 5, 6, END PROGRAM continue_compilation_ff lfortran-lfortran-2f73434/tests/errors/array_constructor_with_asterisk_in_type_spec.f900000664000175000017500000000017015141516316032113 0ustar alastairalastairprogram array_constructor_with_asterisk_in_type_spec print *, [character(*) :: "a", "b", "ball", "cat"] end program lfortran-lfortran-2f73434/tests/errors/kind_01.f900000664000175000017500000000012015141516316022047 0ustar alastairalastairprogram kind_01 implicit none print *, aint([1.0, 2.0, 3.0], [4, 4]) endlfortran-lfortran-2f73434/tests/errors/matrix_matmul_01.f900000664000175000017500000000020115141516316024005 0ustar alastairalastairprogram matrix_matmul_01 implicit none character :: a(3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-lfortran-2f73434/tests/errors/cmplx_03.f900000664000175000017500000000011715141516316022255 0ustar alastairalastairprogram cmplx_03 ! print*, cmplx((1.00000000, real(0, kind=4)), kind=8) endlfortran-lfortran-2f73434/tests/errors/template_error_06.f900000664000175000017500000000066215141516316024166 0ustar alastairalastairmodule template_error_06_m implicit none private public :: struct_t requirement r(t) type, deferred :: t end requirement template struct_t(t) require :: r(t) private public :: tuple type :: tuple type(g) :: fst type(g) :: snd end type contains end template contains end module program template_error_06 use template_error_06_m implicit none end programlfortran-lfortran-2f73434/tests/errors/intrinsics11.f900000664000175000017500000000014315141516316023156 0ustar alastairalastairprogram intrinsics11 real(4) :: x = 1 real(8) :: y = 2 print *, hypot(x, y) end programlfortran-lfortran-2f73434/tests/errors/incorrect_number_args_function.f900000664000175000017500000000032215141516316027107 0ustar alastairalastairprogram expr2 implicit none print *, helloWorld(5.1, 2) contains real function helloWorld(x) real, intent(in) :: x helloWorld = x + 1 end function helloWorld end program expr2 lfortran-lfortran-2f73434/tests/errors/template_error_07c.f900000664000175000017500000000166215141516316024333 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t, combine) type, deferred :: t elemental function combine(x, y) result(combined) type(t), intent(in) :: x, y type(t) :: combined end function end requirement requirement extended_semigroup(t, combine, sconcat, stimes) require :: semigroup(t, scombine) pure function sconcat(list) result(combined) type(t), intent(in) :: list(:) type(t) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(t), intent(in) :: a type(t) :: repeated end function end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-lfortran-2f73434/tests/errors/string_negative_start_index.f900000664000175000017500000000017715141516316026432 0ustar alastairalastairprogram string_negative_start_index implicit none character(len=8) :: s s = "lfortran" print*, "s:", s(-1:4) end program lfortran-lfortran-2f73434/tests/errors/data_implied_do1.f900000664000175000017500000000023615141516316024011 0ustar alastairalastairprogram data_implied_do1 implicit none integer :: k = 3 integer :: i, iarx(3) data(iarx(i), i=1, k) / 1, 2, 3 / end program data_implied_do1 lfortran-lfortran-2f73434/tests/errors/array_constructor_with_integer_real_array_types.f900000664000175000017500000000013715141516316032612 0ustar alastairalastairprogram array_constructor_with_integer_real_array_types print *, [1, [1., 2.]] end program lfortran-lfortran-2f73434/tests/errors/template_error_09.f900000664000175000017500000000151615141516316024170 0ustar alastairalastairmodule std_prop_m implicit none public requirement magma_r(T, bin) type, deferred :: T pure elemental function bin(x, y) result(bin) type(T), intent(in) :: x type(T), intent(in) :: y type(T) :: bin end function end requirement template commutative_prop(T,bin) require :: magma_r(T,bin) contains pure function commutative_p(x, y) result(prop) type(T), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template end module std_prop_m program test_intrinsic_p use std_prop_m instantiate commutative_prop(integer,operator(+)), only: int_plus_comm => commutative_p print *, "test commutative" print *, "int_plus_comm: ", int_plus_comm(3,4) end program lfortran-lfortran-2f73434/tests/errors/incorrect_array_type_where_02.f900000664000175000017500000000027715141516316026561 0ustar alastairalastairprogram main implicit none integer :: i1(5) integer :: b(5) i1 = [1, 2, 3, 4, 5] where(i1) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop end program main lfortran-lfortran-2f73434/tests/errors/kind_star_of_complex.f900000664000175000017500000000011415141516316025016 0ustar alastairalastairprogram kind_star_of_complex implicit none complex(*) a end program lfortran-lfortran-2f73434/tests/errors/end_sub_name.f900000664000175000017500000000024415141516316023250 0ustar alastairalastairsubroutine swap(x, y) integer, intent(inout) :: x, y integer :: tmp tmp = x x = y y = tmp end subroutine reverse program name end program name lfortran-lfortran-2f73434/tests/errors/nint_overflow.f900000664000175000017500000000015515141516316023525 0ustar alastairalastairprogram nint_overflow print*, nint(1e12_8) print*, nint(1000000000000.0000000000000000d0) end programlfortran-lfortran-2f73434/tests/errors/subroutine2.f900000664000175000017500000000016315141516316023112 0ustar alastairalastairprogram subroutine2 integer :: i i = bpe() contains subroutine bpe() end subroutine end programlfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_04.f900000664000175000017500000000031115141516316025736 0ustar alastairalastairprogram scalar_allocation_check_04 integer, allocatable :: xx call ff(xx) contains subroutine ff(x) integer :: x x = 10 end subroutine end program lfortran-lfortran-2f73434/tests/errors/maskr_negative.f900000664000175000017500000000007115141516316023626 0ustar alastairalastairprogram maskr_negative print*, maskr(-24) end program lfortran-lfortran-2f73434/tests/errors/end_module_name.f900000664000175000017500000000006015141516316023740 0ustar alastairalastairmodule name1 implicit none end module name2 lfortran-lfortran-2f73434/tests/errors/template_error_02.f900000664000175000017500000000212715141516316024160 0ustar alastairalastairmodule template_error_02_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y, a) result(z) real, intent(in) :: x, y, a z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_02 use template_error_02_m implicit none call test_template() end program template_error_02 lfortran-lfortran-2f73434/tests/errors/dim_float_02.f900000664000175000017500000000007115141516316023066 0ustar alastairalastairprogram main print *, sum([1, 2, 3], 1, 1.1) end programlfortran-lfortran-2f73434/tests/errors/integerStringInput.f900000664000175000017500000000044315141516316024476 0ustar alastairalastairprogram integerStringInput implicit none integer :: x open(unit=10, file="tests/invalidInput_integer.txt", status="unknown") do read(10, *, end=100) x print *, "Read integer:", x end do 100 continue close(10) stop end program integerStringInputlfortran-lfortran-2f73434/tests/errors/array_constructor_with_different_types.f900000664000175000017500000000012015141516316030712 0ustar alastairalastairprogram array_constructor_with_different_types print *, [1, 2.] end program lfortran-lfortran-2f73434/tests/errors/dprod_01.f900000664000175000017500000000007615141516316022244 0ustar alastairalastairprogram dprod_01 print*, dprod(4.23_8, 4.3_8) end program lfortran-lfortran-2f73434/tests/errors/incompatible_dimension_assignment_arr1.f900000664000175000017500000000034015141516316030516 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr2 implicit none ! constant array of size 1 integer :: arr1(1) ! arr1 (which is of size 1) is being assigned ! an array of size 3 arr1 = [1, 2, 3] end program lfortran-lfortran-2f73434/tests/errors/merge_bits_comp.f900000664000175000017500000000011015141516316023757 0ustar alastairalastairprogram merge_bits_comp print *, merge_bits(8, 12_8, 2) end program lfortran-lfortran-2f73434/tests/errors/program_variable.f900000664000175000017500000000007315141516316024145 0ustar alastairalastairprogram program_variable integer bar bar = foo end program lfortran-lfortran-2f73434/tests/errors/fixed_form_5.f0000664000175000017500000000013415141516316023024 0ustar alastairalastair program X integer :: y y = 5abcdef + 3 500 print *, y end program lfortran-lfortran-2f73434/tests/errors/mre_segfault.f900000664000175000017500000000031115141516316023301 0ustar alastairalastairprogram mre_segfault implicit none integer, allocatable :: arr4(:) ! checking source in allocate with reshape allocate(arr4(3), source=reshape([1, 2, 3, 4, 5, 6], [2, 3])) end program lfortran-lfortran-2f73434/tests/errors/cpp7.f900000664000175000017500000000244415141516316021506 0ustar alastairalastairprogram cpp7 ! Nested macros, tests location information implicit none #define X 5 #define Y #ifdef X # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef X # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Y print *, "1a" # else print *, "1b" # endif #else # ifdef Y print *, "2a" # else print *, "2b" # endif #endif #ifdef Z # ifdef Z print *, "1a" # else print *, "1b" # endif #else # ifdef Z print *, "2a" # else print *, "2b" # endif #endif ! ifndef #ifdef X # ifndef Y print *, "1a" # else print *, "1b" # endif #else # ifndef Y print *, "2a" # else print *, "2b" # endif #endif ! more nesting #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef Z print *, "1aa" # else print *, "1ab" # endif print *, "1ac" # else print *, "1b" # endif print *, "1c" #else print *, "20" # ifdef Y print *, "20" # ifdef Z print *, "2aa" # else print *, "2ab" # endif print *, "2a" # else print *, "2b" # endif print *, "2c" #endif #ifdef X print *, "10" # ifdef Y print *, "1a0" # ifdef X print *, "1aa", z12, 5 # else print *, "1ab" # endif print *, "1ac" # endif print *, "1c" #endif end program lfortran-lfortran-2f73434/tests/errors/continue_compilation_2.f900000664000175000017500000003057315141516316025304 0ustar alastairalastairmodule Geometry implicit none type :: Circle real :: radius contains procedure :: calculateArea end type Circle contains ! Type-bound subroutine to calculate the area of a circle subroutine calculateArea(self, area) class(Circle), intent(in) :: self real, intent(out) :: area area = 3.14 * self%radius**2 end subroutine calculateArea end module Geometry module my_module integer :: x = 10 end module wrong_module_name subroutine myname end subroutine myname block data myname end block data myname module continue_compilation_2_mod contains subroutine solsy () double precision rowns(209) common /rowns/ rowns(209) print *, set_exponent([1, 2, 3], 2) end subroutine try_to_change(y) integer, intent(in) :: y y = 99 end subroutine subroutine my_subroutine1() print *, "Inside subroutine" end subroutine different_name function my_function() result(res) integer :: res res = 42 end function not_my_function subroutine my_subroutine2() print *, "Inside subroutine" end subroutine different_name SUBROUTINE faulty_subroutine(a, b, c) INTEGER, INTENT(IN) :: sub_a END SUBROUTINE faulty_subroutine subroutine sub_a(val_a) integer, intent(in) :: val_a call sub_b(val_a) end subroutine sub_a subroutine sub_b(val_b) integer, intent(inout) :: val_b end subroutine sub_b function outer_func(val_a) result(res) integer, intent(in) :: val_a integer :: res res = inner_func(val_a) end function outer_func function inner_func(val_b) result(res) integer, intent(inout) :: val_b integer :: res end function inner_func subroutine arank(x) integer :: x(.., 5) end subroutine arank end module continue_compilation_2_mod ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_2 use continue_compilation_2_mod use iso_c_binding, only: c_ptr, c_f_pointer use Geometry implicit real(a-z) ! Put declarations below without empty lines integer, pointer, parameter :: v => null() integer, allocatable, parameter :: v=1 integer init_x = 1 ! Variable declarations type(c_ptr) :: queries_1 integer, pointer :: y_1 type(c_ptr) :: queries_2 integer(2), pointer :: y_2(:) integer :: shape(2, 2) integer, parameter :: x = 2 type(Circle) :: myCircle real :: circleArea complex :: a integer :: val character(1) :: x_2 integer :: i integer :: a_2(3) integer :: size_a integer :: a_3(3) integer :: size_a_2 integer :: kindvar = 4 integer :: atom[*] real(8), allocatable :: x_3(:) real :: y_3 integer, parameter :: Nx = 600, Ny = 450 integer :: i_1, j, image(Nx, Ny) integer :: i_2, j_1 integer :: i_3 complex :: a_4 complex :: a_5 real :: y_4 integer :: idaa2_x(1:2,1:2,1:2) integer :: idaa2_y(1:2,1:2,1:1) logical, parameter :: idlalb1_x(3) = [.true., .false., .false.] logical, parameter :: idlalb2_x1(3) = [.true., .false., .false.] logical, parameter :: idlalb2_x2(2) = [.true., .true.] integer, allocatable :: iraa1_arr1(:, :) integer, allocatable :: iraa2_arr1(:, :, :) integer, allocatable :: iraa2_arr3(:) integer :: iatw1_b(5) integer :: iatw2_i1(5) integer :: iatw2_b(5) integer :: itw1_b(5) integer :: itw2_b(5) integer :: itw3_b(5) INTEGER :: intent_x real(8) :: intr2_x, intr2_y, datan2 integer(4) :: intr8_x = 1 integer(8) :: intr8_y = 2 integer(4) :: intr9_x = 1 integer(8) :: intr9_y = 2 integer(4) :: intr10_x = 1 integer(8) :: intr10_y = 2 integer, parameter :: ici_ios = 1 character(len=100) :: ici_buffer integer :: insv_ios(2) = 1 character(len=100) :: insv_buffer complex :: complex_z = (1, 2) integer :: tm1_x integer :: tm2_x !int_01_1.f90 integer(8), parameter :: ar1(3) = int([1, 2, 3], [8, 8, 8]) !int_01_2.f90 integer(8), parameter :: ar2(3) = int([1, 2, 3], [8, 8, 8]) !kind_invalid_float_of_int integer(4.2) :: ifoix !kind_invalid_int_of_complex complex(6) :: iiocx !kind_invalid_int_of_int integer(3) :: iifix !kind_invalid_int_of_logical logical(10) :: iiolx !kind_star_of_complex complex(*) :: ksoca !kind_star_of_int integer(*) :: ksoia !kind_star_of_logical logical(*) :: ksola !kind_string_of_int integer('a') :: ksoix !kind_var_of_int integer :: kvoia = 4 real(kvoia) :: kvoix !kind1 real(3) :: x !kind2 real(*) kind2_a !type_conflict1 integer, parameter, target :: foo=4 integer :: x_bad_implicit !unsupported kind real*16 :: unsupported_kind ! argument not specified type(Circle) :: myCircle2 = Circle() ! invalid keyword argument specified type(Circle) :: myCircle3 = Circle(mykeyword=10) !tokenizer error integer :: ? tokenizer_error integer, dimension(3,2) :: m = [ 1, 0, 0, 2, 4, 6 ] real :: idint_kind_mismatch = 4.23 character(5):: ichar_runtime = "Hello" real(8) :: dprod_1, dprod_2 real(4) :: dprod_3 = 4.23 real(4) ::idnint_runtime = 3.5 real(8) :: ifix_runtime = 4.23 logical :: min_max = .true. integer :: intent_bug_sub_x = 10 character(len=2) :: lhs type string_t character(:), allocatable :: value end type string_t character :: rhs(2) type(string_t) :: str_t_1, str_t_2 character(len=10) :: prefix integer :: aRank1(..) character(:), ALLOCATABLE :: str1 allocate(str1(i)) str_t_1%value = "world!" prefix = "hello, " str_t_2 = prefix // 10 str_t_2 = prefix // str_t_1 ! c_f_pointer_01 call c_f_pointer(queries_1, y_1, [2]) ! c_f_pointer_02 call c_f_pointer(queries_2, y_2, shape) ! assign_01 x = 1 ! class_procedure_extra_args myCircle%radius = 5.0 call myCircle%calculateArea(circleArea, 12) ! close_invalid_kwarg1 CLOSE(end=200) ! cmplx_01 print *, cmplx(y = 2) ! a = cmplx(y = 2) ! does not work with continue compilation ! cmplx_02 print*, cmplx((real(1, kind=4), 0.00000000), kind=8) ! cmplx_03 print*, cmplx((1.00000000, real(0, kind=4)), kind=8) ! coarray_01 val = this_image () call co_sum (val, result_image=1) if (this_image() == 1) then write(*,*) "The sum is ", val end if ! coarray_02 call event_query(1, 1, 1) ! compare_01 x_2 = 'u' i = 10 if (i > x_2) then else end if !array_size_02 size_a = size(a_2, 1, dim=1) size_a = size(a_2, dim = 1, 1) !array_size_05 size_a_2 = size(a_3, kind=kindvar, dim=1) size_a_2 = size(a_3, kind=kindvar) !atomic_01 call atomic_add (atom[1], this_image()) call atomic_add (atom[2], this_image()) !array_constructor_with_asterisk_in_type_spec print *, [character(*) :: "a", "b", "ball", "cat"] !array_constructor_with_different_char_length print *, ["a", "b", "ball", "cat"] print *, ["a1", "b1", "ball1", "cat1"] !array_constructor_with_different_kind allocate(x_3(4)) print *, [x_3, [1., 2.]] !array_constructor_with_different_types print *, [1, 2.] !array_constructor_with_integer_real_array_types print *, [1, [1., 2.]] !dfloat1 print *, dfloat(y_3) !dim_float_01 print *, sum([1, 2, 3], 1.1) !dim_float_02 print *, sum([1, 2, 3], 1, 1.1) !dim_float_03 print *, sum([1, 2, 3], .true., 1.1) !dint_args print*, dint(1.0_8, 8) if (abs(dint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop !dlgama print *, dlgama(2.7) !dnint_args print*, dnint(1.0_8, 8) if (abs(dnint(1.0_8, 8) - 1.0_8) > 10e-5 ) error stop !do_concurrent_01 do concurrent (j = 1:Ny) local(i_1, j) do i_1 = 1, Nx end do end do !do_loop_01 do i_2 = 1, 10 do j_1 = 1, 2 i_2 = j_1 + 1 end do j_1 = i_2 + 1 print *, i_2, j_1 end do !do_zero_increment do i_2 = 1, 5, 0 write(*,*) i_3 end do !dprod print*, dprod(4.23_8, 4.3_8) !dreal_arg_error a_4 = (1.0, 2.0) print *, dreal(a_4) !fixed_number_of_args a_5 = complex(1) !float1 print *, float(y_4) !flush_invalid_kwarg FLUSH(unit=10, start=100) !func_parameter_type print *, f(42.9) !ichar_01 print*, ichar("okay") !idint_real4 print *, idint(4.5) !ifix_01 print *, ifix(4.23_8) !incompatible_dimension_assignment_arr1 integer :: arr1(1) arr1 = [1, 2, 3] !incompatible_dimension_assignment_arr2 idaa2_x = reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]) idaa2_y = reshape([1, 2, 3, 4], [2, 2, 1]) idaa2_y = idaa2_x !incompatible_dimension_logical_arrays_logical_binop_01 print *, idlalb1_x .neqv. [.true., .true.] !incompatible_dimension_logical_arrays_logical_binop_02 print *, idlalb2_x1 .neqv. idlalb2_x2 !incompatible_rank_allocatable_arr1 iraa1_arr1 = [1, 2, 3] !incompatible_rank_allocatable_arr2 iraa2_arr3 = iraa2_arr1 !incorrect_array_type_where_01 where([1, 2, 3, 4, 5]) iatw1_b = 1 print *, iatw1_b if (all(iatw1_b /= [1, 0, 1, 0, 1])) error stop !incorrect_array_type_where_02 iatw2_i1 = [1, 2, 3, 4, 5] where(iatw2_i1) iatw2_b = 1 print *, iatw2_b if (all(iatw2_b /= [1, 0, 1, 0, 1])) error stop !incorrect_type_where_01 where(.true.) itw1_b = 12121 print *, itw1_b !incorrect_type_where_02 where(1) itw2_b = 12121 print *, itw2_b !incorrect_type_where_03 where(max(1.33, 2.67)) itw3_b = 12121 print *, itw3_b !intent1 intent_x = 42 CALL try_to_change(intent_x) !intrinsics1 print *, radix((2.4, 1.0)) !intrinsics2 intr2_x = 2.33D0 intr2_y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop !intrinsics3 print *, ibclr(1, -2) !intrinsics4 print *, dshiftl(1, 1_8, 1) !intrinsics5 print *, ior(1, 1_8) !intrinsics6 print *, ieor(1, 1_8) !intrinsics7 print *, hypot(1.0, 2.7_8) !intrinsics8 print *, ior(intr8_x, intr8_y) !intrinsics9 print *, iand(intr9_x, intr9_y) !intrinsics10 print *, ieor(intr10_x, intr10_y) !intrinsics11 real(4) :: intr11_x = 1 real(8) :: intr11_y = 2 print *, hypot(intr11_x, intr11_y) !intrinsics12 print *, max(12, 13.94) !intrinsics13 print *, min(12, 13.94) !intrinsics14 print *, scale([1, 2, 3], 2) !intrinsics15 print *, set_exponent([1, 2, 3], 2) !iostat_constant_integer ici_buffer = 'Temporary date for testing purpose' read(ici_buffer, *, iostat=ici_ios) !iostat_non_scalar_value insv_buffer = 'Temporary date for testing purpose' read(insv_buffer, *, iostat=insv_ios(1:1)) !ishftc_size print *, ishftc(10, 6, 4) !complex_01 print *, cmplx(complex_z , 1) !kind_01 print *, aint([1.0, 2.0, 3.0], [4, 4]) !type_mismatch_1 tm1_x = "x" !type_mismatch_2 tm2_x = 5 + "x" print *,foo x_bad_implicit = 10 print *, x_bad_implicit ! member not found print *, myCircle%mymember 100 FORMAT(A10, @) print*, merge("okay", "ok", .true.) !idint_kind_mismatch print *, idint(4.23) print *, idint(idint_kind_mismatch) !ichar_runtime print *, ichar(ichar_runtime) !dprod_runtime print *, dprod(dprod_1, dprod_2) print *, dprod(dprod_3, dprod_2) !idnint print *, idnint(3.5) print *, idnint(idnint_runtime) !ifix print *, ifix(4.23_8) print *, ifix(ifix_runtime) !min print *, min(.true., .false.) print *, min(min_max, min_max) !max print *, max(.true., .false.) print *, max(min_max, min_max) !nested intent call sub_a(intent_bug_sub_x) print *, outer_func(intent_bug_sub_x) !size_intrinsic_check print *, size(ichar_runtime) lhs = rhs print *, index( substring = 'de', back = .true. ) print *, compiler_options() contains logical function f(x) integer, intent(in), optional :: x f = PRESENT(x) end function end program ! Test for multiple PROGRAM units in same file program second_program_test implicit none print *, "This is a second program - should cause error" end program second_program_test lfortran-lfortran-2f73434/tests/errors/private2.f900000664000175000017500000000017015141516316022363 0ustar alastairalastairmodule foo2 private real :: y = 2 end module program test use foo2, only: y print *, y end program lfortran-lfortran-2f73434/tests/errors/protected_01.f900000664000175000017500000000072015141516316023121 0ustar alastairalastairmodule module_protected_01 REAL, PROTECTED, save :: temp_c, temp_f CONTAINS SUBROUTINE set_temperature_c(c) REAL, INTENT(IN) :: c ! assignment to protected variable allowed here temp_c = c temp_f = temp_c*(9.0/5.0) + 32 END SUBROUTINE end module module_protected_01 program protected_01 use module_protected_01 call set_temperature_c(10.) ! assignment to protected variable not allowed here temp_c = 10 end program protected_01 lfortran-lfortran-2f73434/tests/errors/array_03.f900000664000175000017500000000011115141516316022242 0ustar alastairalastairprogram array_03 implicit none integer :: a(10) a(:,:) = 1 end program lfortran-lfortran-2f73434/tests/errors/array_transfer_01.f900000664000175000017500000000016315141516316024153 0ustar alastairalastairprogram arrays_01 implicit none integer :: a(3) real :: size_a print *, transfer(a, 1, size_a) end lfortran-lfortran-2f73434/tests/errors/do_zero_increment.f900000664000175000017500000000014015141516316024331 0ustar alastairalastairprogram main implicit none integer :: i do i = 1, 5, 0 write(*,*) i end do end program main lfortran-lfortran-2f73434/tests/errors/array_04.f900000664000175000017500000000015115141516316022247 0ustar alastairalastairprogram array_04 implicit none type :: t integer :: a end type type(t) :: b b%a(:) = 1 end program lfortran-lfortran-2f73434/tests/errors/fixed_form_4.f0000664000175000017500000000015415141516316023025 0ustar alastairalastair program X integer :: y y = 5 500 print *, sin), y print *, "OK" end program lfortran-lfortran-2f73434/tests/errors/template_error_03.f900000664000175000017500000000206415141516316024161 0ustar alastairalastairmodule template_error_03_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine func_arg_real(x, y) real, intent(in) :: x, y end subroutine subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_03 use template_error_03_m implicit none call test_template() end program template_error_03 lfortran-lfortran-2f73434/tests/errors/implicit3.f900000664000175000017500000000010115141516316022516 0ustar alastairalastairinteger function a() implicit None implicit real (a) end functionlfortran-lfortran-2f73434/tests/errors/array_bounds_check_10.f900000664000175000017500000000034715141516316024762 0ustar alastairalastairprogram array_bounds_check_10 integer, allocatable :: a(:, :) integer, allocatable :: b(:, :) integer, allocatable :: e(:, :) allocate(a(2, 2)) allocate(b(2, 3)) allocate(e(2, 2)) e = a + b end program lfortran-lfortran-2f73434/tests/errors/Same_type.f900000664000175000017500000000010215141516316022550 0ustar alastairalastairprogram Same_type print *, same_type_as(1.0, 1.0) end program lfortran-lfortran-2f73434/tests/errors/program_without_line_03.f900000664000175000017500000000004015141516316025366 0ustar alastairalastairprint *, "OK" end print *, "OK" lfortran-lfortran-2f73434/tests/errors/redeclaration1.f900000664000175000017500000000016115141516316023524 0ustar alastairalastairprogram redeclaration1 implicit none integer :: idx1 real :: j, idx1 idx1 = 5 j = 6 print *, idx1, j end program lfortran-lfortran-2f73434/tests/errors/idint_real4.f900000664000175000017500000000006715141516316023032 0ustar alastairalastairprogram idint_real print *, idint(4.5) end program lfortran-lfortran-2f73434/tests/errors/duplicate_module_procedures.f900000664000175000017500000000061015141516316026400 0ustar alastairalastairmodule input_module implicit none interface test_interface module procedure test_01, test_01, test_01 end interface test_interface contains subroutine test_01 (x) implicit none integer , intent(in):: x print *, x end subroutine test_01 end module input_module program main use input_module call test_interface(1) end program mainlfortran-lfortran-2f73434/tests/errors/open_invalid_kwarg1.f900000664000175000017500000000031115141516316024547 0ustar alastairalastairPROGRAM open_invalid_kwarg1 ! the file "numbers" doesn't need to exist for the test-case ! "hello" is an invalid keyword argument for "OPEN" OPEN(file="numbers", hello="world") END PROGRAM lfortran-lfortran-2f73434/tests/errors/integer16.f900000664000175000017500000000004415141516316022433 0ustar alastairalastairprogram integer16 integer*16 x end lfortran-lfortran-2f73434/tests/errors/c_f_pointer_02.f900000664000175000017500000000032115141516316023415 0ustar alastairalastairprogram c_f_pointer_01 use iso_c_binding, only: c_ptr, c_f_pointer type(c_ptr) :: queries integer(2), pointer :: x(:) integer :: shape(2, 2) call c_f_pointer(queries, x, shape) end program lfortran-lfortran-2f73434/tests/errors/kind_string_of_int.f900000664000175000017500000000011715141516316024501 0ustar alastairalastairprogram string_kind_integer implicit none integer('a') :: x end programlfortran-lfortran-2f73434/tests/errors/subroutine6.f900000664000175000017500000000007415141516316023117 0ustar alastairalastairsubroutine sub (array) dimension array(3) end subroutinelfortran-lfortran-2f73434/tests/errors/incompatible_dimension_assignment_arr2.f900000664000175000017500000000060315141516316030521 0ustar alastairalastairprogram incompatible_dimension_assignment_arr2 implicit none ! integer array of rank 3 and shape 2, 2, 2 integer :: x(1:2,1:2,1:2) ! integer array of rank 3 and shape 2, 2, 1 integer :: y(1:2,1:2,1:1) x = reshape([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]) y = reshape([1, 2, 3, 4], [2, 2, 1]) ! invalid assignment, as shapes are different y = x end program lfortran-lfortran-2f73434/tests/errors/incorrect_allocate_for_array.f900000664000175000017500000000016715141516316026535 0ustar alastairalastairprogram incorrect_allocate_for_array integer, allocatable :: a(:) allocate(a) print *, size(a) end program lfortran-lfortran-2f73434/tests/errors/iostat_constant_integer.f900000664000175000017500000000035415141516316025564 0ustar alastairalastairprogram iostat_constant_integer implicit none integer, parameter :: ios = 1 character(len=100) :: buffer buffer = 'Temporary date for testing purpose' read(buffer, *, iostat=ios) end program iostat_constant_integer lfortran-lfortran-2f73434/tests/errors/do_loop_01.f900000664000175000017500000000023715141516316022566 0ustar alastairalastairprogram main implicit none integer :: i, j do i = 1, 10 do j = 1, 2 i = j + 1 end do j = i + 1 print *, i, j end do end program lfortran-lfortran-2f73434/tests/errors/template_error_08.f900000664000175000017500000000206215141516316024164 0ustar alastairalastairmodule template_add_01b_m_e implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = x + y end function end template contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() real :: a integer :: n, s instantiate add_t(integer, func_arg_int), only: add_integer => add_generic n = add_integer(5, 9) !s = add_integer2(5, 9, 10) print*, "The result is", n end subroutine end module program template_add_01b use template_add_01b_m_e implicit none call test_template() end programlfortran-lfortran-2f73434/tests/errors/cpp2.f900000664000175000017500000000020615141516316021473 0ustar alastairalastairprogram cpp2 implicit none #define X123 12345678 integer :: x x = (2+3)*5 ! Error: `yy` not defined: print *, x, X123, yy end program lfortran-lfortran-2f73434/tests/errors/array_shape_02.f900000664000175000017500000000012415141516316023425 0ustar alastairalastairprogram main integer :: x(3,2) = reshape([1,2,3,4],[2,2]) print * ,x end programlfortran-lfortran-2f73434/tests/errors/incorrect_array_type_where_01.f900000664000175000017500000000023615141516316026553 0ustar alastairalastairprogram main implicit none integer :: b(5) where([1, 2, 3, 4, 5]) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop end program mainlfortran-lfortran-2f73434/tests/errors/end_program_name.f900000664000175000017500000000004015141516316024120 0ustar alastairalastairprogram name end program name2 lfortran-lfortran-2f73434/tests/errors/dim_float_01.f900000664000175000017500000000006615141516316023071 0ustar alastairalastairprogram main print *, sum([1, 2, 3], 1.1) end programlfortran-lfortran-2f73434/tests/errors/coarray_01.f900000664000175000017500000000042015141516316022565 0ustar alastairalastairprogram test integer :: val val = this_image () call co_sum (val, result_image=1) if (this_image() == 1) then write(*,*) "The sum is ", val ! prints (n**2 + n)/2, ! with n = num_images() end if end program testlfortran-lfortran-2f73434/tests/errors/template_error_07b.f900000664000175000017500000000051515141516316024326 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t, combine) type, deferred :: t end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-lfortran-2f73434/tests/errors/string_assignment_02.f900000664000175000017500000000024015141516316024664 0ustar alastairalastairprogram string_assignment_02 implicit none character(10), allocatable :: a character(:), allocatable :: b a = b end program string_assignment_02lfortran-lfortran-2f73434/tests/errors/continue_compilation_ff_2.f0000664000175000017500000000036115141516316025576 0ustar alastairalastair PROGRAM continue_compilation_ff_2 print *, "This is a test program" SUBROUTINE faulty_subroutine(a, b, c) INTEGER, INTENT(IN) :: sub_a END SUBROUTINE faulty_subroutine END PROGRAM continue_compilation_ff_2lfortran-lfortran-2f73434/tests/errors/dim_float_03.f900000664000175000017500000000007615141516316023074 0ustar alastairalastairprogram main print *, sum([1, 2, 3], .true., 1.1) end programlfortran-lfortran-2f73434/tests/errors/intrinsics5.f900000664000175000017500000000007015141516316023100 0ustar alastairalastairprogram intrinsics5 print *, ior(1, 1_8) end programlfortran-lfortran-2f73434/tests/errors/complex_01.f900000664000175000017500000000013415141516316022576 0ustar alastairalastairprogram complex_01 implicit none complex :: z = (1, 2) print *, cmplx(z, 1) end lfortran-lfortran-2f73434/tests/errors/intrinsics15.f900000664000175000017500000000010115141516316023154 0ustar alastairalastairprogram intrinsics15 print *, set_exponent([1, 2, 3], 2) end lfortran-lfortran-2f73434/tests/errors/loop_test.f900000664000175000017500000000014715141516316022643 0ustar alastairalastairprogram loop_test integer :: i do i=1,3 i = i + 1 print*,i end do end programlfortran-lfortran-2f73434/tests/errors/string_slice2.f900000664000175000017500000000021715141516316023400 0ustar alastairalastairprogram string_slice2 implicit none character(len=8) :: s = "lfortran" print*, "Length of s:", len(s) print*, s(1: 9) end programlfortran-lfortran-2f73434/tests/errors/unterminated_ifdef_01.f900000664000175000017500000000016515141516316024767 0ustar alastairalastair#ifdef a program unterminated_ifdef_01 implicit none print *, "Hello world" end program unterminated_ifdef_01 lfortran-lfortran-2f73434/tests/errors/array_05.f900000664000175000017500000000036515141516316022257 0ustar alastairalastairmodule module_array_05 type t real, allocatable :: x(:) end type t end module module_array_05 program array_05 use module_array_05 implicit none type(t) :: type_01 allocate(type_01%x(1, 2)) end program array_05 lfortran-lfortran-2f73434/tests/errors/array_bounds_check_11.f900000664000175000017500000000034715141516316024763 0ustar alastairalastairprogram array_bounds_check_11 integer, allocatable :: a(:, :) integer, allocatable :: b(:, :) integer, allocatable :: e(:, :) allocate(a(2, 2)) allocate(b(2, 2)) allocate(e(4, 1)) e = a + b end program lfortran-lfortran-2f73434/tests/errors/matrix_matmul_04.f900000664000175000017500000000020215141516316024011 0ustar alastairalastairprogram matrix_matmul_04 implicit none integer :: a(3, 3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-lfortran-2f73434/tests/errors/arithmetic_if1.f900000664000175000017500000000023015141516316023514 0ustar alastairalastairprogram arithmetic_if1 integer :: x, c x = -3 c = 0 if ("yy") 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop end program lfortran-lfortran-2f73434/tests/errors/matrix_matmul_03.f900000664000175000017500000000017715141516316024023 0ustar alastairalastairprogram matrix_matmul_03 implicit none logical :: a(3, 3) integer :: b(3, 3) print *, matmul(a, b) end program lfortran-lfortran-2f73434/tests/errors/incompatible_ranks_allocatable_arr2.f900000664000175000017500000000046715141516316027755 0ustar alastairalastairprogram incompatible_ranks_allocatable_arr2 implicit none ! allocatable array of rank 3 integer, allocatable :: arr1(:, :, :) ! allocatable array of rank 1 integer, allocatable :: arr3(:) ! RHS is an allocatable array of rank 3 ! incompatible assignment arr3 = arr1 end program lfortran-lfortran-2f73434/tests/errors/derived_type_01.f900000664000175000017500000000024415141516316023614 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester end module test lfortran-lfortran-2f73434/tests/errors/submodule_01.f900000664000175000017500000000052315141516316023130 0ustar alastairalastairmodule submodule_01_m implicit none interface submodule_01_m_i end interface end module submodule_01_m submodule(submodule_01_m) submodule_01_s implicit none contains module procedure func end procedure end submodule submodule_01_s program submodule_01 use submodule_01_m implicit none end program submodule_01 lfortran-lfortran-2f73434/tests/errors/template_error_07.f900000664000175000017500000000070615141516316024166 0ustar alastairalastairmodule template_error_07_m implicit none private public :: tmp requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template tmp(t, f) require :: r(t) end template contains end module program template_error_07 use template_error_07_m implicit none end program template_error_07 lfortran-lfortran-2f73434/tests/errors/private1.f900000664000175000017500000000027215141516316022365 0ustar alastairalastairmodule foo1 private real :: x = 1 end module module foo2 use foo1 real :: y = 2 end module program test use foo2 x = 5 write(*,*) x, y end program lfortran-lfortran-2f73434/tests/errors/specific_type_intrinsic.f900000664000175000017500000000007715141516316025545 0ustar alastairalastairprogram specific_type_intrinsic print*, dabs(1) end programlfortran-lfortran-2f73434/tests/errors/kind_var_of_int.f900000664000175000017500000000013415141516316023762 0ustar alastairalastairprogram kind_var_of_int implicit none integer :: a = 4 real(a) :: x end program lfortran-lfortran-2f73434/tests/errors/allocated_05.f900000664000175000017500000000033215141516316023063 0ustar alastairalastairprogram allocated_05 implicit none integer, allocatable :: arr(:) allocate(arr(10)) allocate(arr(20)) ! Error: double allocation of array print *, "Should not reach here" end program allocated_05 lfortran-lfortran-2f73434/tests/errors/template_error_07a.f900000664000175000017500000000071315141516316024325 0ustar alastairalastairmodule template_01_m implicit none private public :: op_t requirement semigroup(t) type, deferred :: t elemental function combine(x, y) result(combined) type(t), intent(in) :: x, y type(t) :: combined end function end requirement contains subroutine test_template() end subroutine end module program template_01 use template_01_m implicit none end program template_01lfortran-lfortran-2f73434/tests/errors/c_f_pointer_01.f900000664000175000017500000000025615141516316023423 0ustar alastairalastairprogram c_f_pointer_01 use iso_c_binding, only: c_ptr, c_f_pointer type(c_ptr) :: queries integer, pointer :: x call c_f_pointer(queries, x, [2]) end program lfortran-lfortran-2f73434/tests/errors/subroutine5.f900000664000175000017500000000014115141516316023111 0ustar alastairalastairsubroutine add(a, b, c) real, intent(in) :: a, b real, intent(out) :: c c = a + d end subroutine lfortran-lfortran-2f73434/tests/errors/cmplx_02.f900000664000175000017500000000011715141516316022254 0ustar alastairalastairprogram cmplx_02 ! print*, cmplx((real(1, kind=4), 0.00000000), kind=8) endlfortran-lfortran-2f73434/tests/errors/cpp4.f900000664000175000017500000000033015141516316021473 0ustar alastairalastairprogram cpp4 implicit none #define X123 z12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123 integer :: x, y x = (2+3)*5 ! Error: `z12345678` not defined: print *, x, C123, y end program lfortran-lfortran-2f73434/tests/errors/integer_overflow.f900000664000175000017500000000045515141516316024215 0ustar alastairalastairprogram read_from_file implicit none integer :: x, unit_no open(newunit=unit_no, file='./tests/overflow_test.txt', status='old') read(unit_no, *) x print *, "Read integer:", x read(unit_no, *) x print *, "Read integer:", x close(unit_no) end program read_from_file lfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_02.f900000664000175000017500000000046415141516316025745 0ustar alastairalastairprogram scalar_allocation_check_02 implicit none type :: base integer :: x end type class(base), allocatable :: var deallocate(var) select type(var) type is (base) print *, var%x class default error stop end select end program lfortran-lfortran-2f73434/tests/errors/do_concurrent1.f900000664000175000017500000000030115141516316023550 0ustar alastairalastairprogram do_concurrent1 implicit none integer, parameter :: Nx = 600, Ny = 450 integer :: i, j, image(Nx, Ny) do concurrent (j = 1:Ny) local(i, j) do i = 1, Nx end do end do end program lfortran-lfortran-2f73434/tests/errors/continue_compilation_3.f900000664000175000017500000001144315141516316025300 0ustar alastairalastair! If you need a function, put it into the module below and remove the same ! number of lines below the module to keep the rest of the lines in this file ! intact. module continue_compilation_3_mod contains subroutine check_incompatible_type(i) real :: i end subroutine check_incompatible_type subroutine intent_out_test(x) integer, intent(out) :: x x = 42 end subroutine intent_out_test subroutine intent_inout_test(y) integer, intent(inout) :: y y = y + 1 end subroutine intent_inout_test subroutine assumed_rank(x) integer, intent(in) :: x(..) print *, x print *, reshape(x, [size(x)]) print *, x(1) x = [1, 2] print *, (x /= [1, 2]) end subroutine assumed_rank end module continue_compilation_3_mod ! Only put declarations and statements here, no subroutines (those go above). program continue_compilation_3 use continue_compilation_3_fake_module use continue_compilation_3_mod ! Put declarations below without empty lines implicit none integer :: a(5), b(10), x1(3,2), c, a1(3), i, k = 3, x character(4) :: str(3) integer, parameter :: x3 = 2 character(len=8) :: s, s1 = "lfortran" rea :: test_real(12) real :: test_re() int :: type :: t integer :: xx end type type(t) :: y integer :: merge_i = 4, merge_j = 5 integer(8) :: merge_k = 8 call intent_out_test(1) ! Error: literal constant with intent(out) call intent_out_test(x + 1) ! Error: expression with intent(out) call intent_inout_test(2) ! Error: literal constant with intent(inout) call intent_inout_test(x * 2) ! Error: expression with intent(inout) call check_incompatible_type(i) ! Error: incompatible type passed ! array_01_cc a = [] ! array_02_cc print *, [[[], [[]]], [[]], []] print *, [[[], [[]]], []] ! array_03_cc b(:,:) = 1 b(:,:) = 2 ! array_04_cc y%xx(:) = 1 ! array_06_cc str(1, 2)(:) = '1234' str(1,2,3)(:) = '1234' ! array_constructor_with_asterisk_in_type_spec_cc print *, [character(*) :: "a", "b", "ball", "cat"] print *, [character(*) :: "a2", "b2", "ball2", "cat2"] !array_shape_01_cc x1 = reshape([1,2,3,4],[2,2]) x1 = reshape([1,2,3,4],[1,2]) !arithmetic_if1_cc i = -3 c = 0 if ("yy") 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop !array_size_01_cc i = size(a1, 1, 4, kind=4) i = size() !assign_01_cc x3 = 1 print *, x3 ! data_implied_do1 data(a1(i), i=1, k) / 1, 2, 3 / ! data_implied_do2 data(a1(i), i=1, 3, k) / 1, 2, 3 / ! data_implied_do3 data(a1(i), i=k, 3) / 1, 2, 3 / !program_variable i = foo !rewind_invalid_kwarg1 rewind(end="world") !Same_type print *, same_type_as(1.0, 1.0) !sign_01 print *, sign(1, 1_8) !specific_type_intrinsic print*, dabs(1) !sqrt_neg print *, sqrt(-1.0) !string_binop print *, "a" + "b" !string_negative_start_index s = "lfortran" print*, "s:", s(-1:4) !string_slice print*, s1(-2:6) !string_slice2 print*, "Length of s:", len(s) print*, s1(1: 9) !substring_noninteger_endidx print*, s1(1:5.2) !substring_noninteger_startidx print*, s1(1.1:5) !substring_noninteger_stride print*, s(1:5:2.2) !type_mismatch1 x = "x" !type_mismatch2 x = 5 + "x" !subroutine1, subroutine2, subroutine3, subroutine5 call bpe() i = bpe() print *, xx test_re = 1245.13 c(1) = 1 integer :: i_incorrect_pragma !LF$unroll 4 ! Error: Missing space after `!LF$` do i_incorrect_pragma = 1, 10 print *, i_incorrect_pragma end do !merge_bits print *, merge_bits(1, 2, 3_8) print *, merge_bits(merge_i,merge_j,merge_k) ! adding the new test for performing logical .and. between int-logical type. !and_mismatch_int_logical print *, 5 .and. .true. !and_mismatch_real_logical print *, 3.14 .and. .false. !and_okay_int_int print *, 5 .and. 6 !adding a few more cases print *, 5 .or. 6 print *, 5 .eqv. 6 print *, .true. .neqv. 6 print *, 3.14 .and. "abcd" print *, "abcd" .neqv. "cdef" print *, 1 .neqv. 2 print *, [1,2,3] .and. .true. print *, [1.0, 2.0] .or. [3.0, 4.0] print *, "str1" .or. "str2" print *, "x" .and. .false. print *, .NOT. "lf" print *, "8356" .or. 8356 print *, "8356" .eqv. 8356.00 print *, ['c', 'o', 'd', 'e'] .or. ['m', 'a', 's'] print *, ["welcome", "to", "lf"] .and. "contributors" !even size diff of array element must be caught contains subroutine bpe() print *, size(bpe) bpe = d end subroutine end program lfortran-lfortran-2f73434/tests/errors/incorrect_type_where_04.f900000664000175000017500000000034115141516316025355 0ustar alastairalastairmodule main_module implicit none character(5), parameter :: c = "hello" end module main_module program main use main_module implicit none integer :: b(5) where(c) b = 12121 print *, b end program main lfortran-lfortran-2f73434/tests/errors/kind_star_of_logical.f900000664000175000017500000000011415141516316024761 0ustar alastairalastairprogram kind_star_of_logical implicit none logical(*) a end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_03.f900000664000175000017500000000013615141516316024760 0ustar alastairalastairprogram array_bounds_check_03 integer, allocatable :: x(:) x = [1, 2, 3] end program lfortran-lfortran-2f73434/tests/errors/cmplx_01.f900000664000175000017500000000012215141516316022247 0ustar alastairalastairprogram cmplx_01 complex :: a a = cmplx(y = 2) print *, a end program lfortran-lfortran-2f73434/tests/errors/array_constructor_with_different_kind.f900000664000175000017500000000021115141516316030474 0ustar alastairalastairprogram array_constructor_with_different_kind real(8), allocatable :: x(:) allocate(x(4)) print *, [x, [1., 2.]] end program lfortran-lfortran-2f73434/tests/errors/string_binop.f900000664000175000017500000000002615141516316023324 0ustar alastairalastairprint *, "a" + "b" endlfortran-lfortran-2f73434/tests/errors/kind_invalid_int_of_complex.f900000664000175000017500000000012615141516316026350 0ustar alastairalastairprogram kind_invalid_int_of_complex implicit none complex(6) :: x end program lfortran-lfortran-2f73434/tests/errors/ishftc_size.f900000664000175000017500000000007615141516316023146 0ustar alastairalastairprogram ishftc_size print *, ishftc(10, 6, 4) end program lfortran-lfortran-2f73434/tests/errors/show_errors1.f900000664000175000017500000000024715141516316023271 0ustar alastairalastairsubroutine sub() end subroutine program show_errors1 implicit none integer :: x y = x = (2+3)*5 call sub() print *, xx print *, xz print *, fasldjkfh end program lfortran-lfortran-2f73434/tests/errors/allocated_04.f900000664000175000017500000000031215141516316023060 0ustar alastairalastairprogram allocated_04 implicit none integer, allocatable :: x allocate(x) allocate(x) ! Error: double allocation of scalar print *, "Should not reach here" end program allocated_04 lfortran-lfortran-2f73434/tests/errors/string_allocation_01.f900000664000175000017500000000031015141516316024636 0ustar alastairalastair! Refer to ./doc/src/string_allocation.md program string_allocation_01 implicit none character(:), allocatable :: a integer :: i i = -10 allocate(character(i) :: a) end programlfortran-lfortran-2f73434/tests/errors/string_slice.f900000664000175000017500000000017215141516316023316 0ustar alastairalastairprogram string_slice implicit none character(len=8) :: s = "lfortran" print*, s(-2:6) end program string_slicelfortran-lfortran-2f73434/tests/errors/dim_assgn_test.f900000664000175000017500000000015015141516316023630 0ustar alastairalastairprogram dim_assgn_test ! Warning: integer, private, dimension(2,2) :: a(2,3) ! Error: x = 5 end program lfortran-lfortran-2f73434/tests/errors/write_01.f900000664000175000017500000000053615141516316022267 0ustar alastairalastairprogram write_01 implicit none character(len=*), parameter :: temp_file = "lfortran_temporary_file_write_01.dat" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, file=temp_file) !formatted write(unit) test_line !unformatted close(unit) end programlfortran-lfortran-2f73434/tests/errors/implicit_typing4.f900000664000175000017500000000006415141516316024121 0ustar alastairalastairsubroutine iddr_rsvd(matvect) implicit none end lfortran-lfortran-2f73434/tests/errors/kind1.f900000664000175000017500000000010615141516316021634 0ustar alastairalastairprogram main implicit none real(3) :: x end program lfortran-lfortran-2f73434/tests/errors/array_size_02.f900000664000175000017500000000016115141516316023300 0ustar alastairalastairprogram arrays_02 implicit none integer :: a(3) integer :: size_a size_a = size(a, 1, dim=1) end lfortran-lfortran-2f73434/tests/errors/matrix_matmul_02.f900000664000175000017500000000020115141516316024006 0ustar alastairalastairprogram matrix_matmul_02 implicit none character :: a(3, 3) integer :: b(3, 3) print *, matmul(b, a) end program lfortran-lfortran-2f73434/tests/errors/substring_stride.f900000664000175000017500000000023415141516316024222 0ustar alastairalastairprogram substring_noninteger_stride implicit none character(len=8) :: s = "lfortran" print*, s(1:5:2.2) end program substring_noninteger_stride lfortran-lfortran-2f73434/tests/errors/intent1.f900000664000175000017500000000024515141516316022214 0ustar alastairalastairPROGRAM main INTEGER :: x x = 42 CALL try_to_change(x) END PROGRAM SUBROUTINE try_to_change(y) INTEGER, INTENT(IN) :: y y = 99 END SUBROUTINE lfortran-lfortran-2f73434/tests/errors/fixed_number_of_args.f900000664000175000017500000000011515141516316024775 0ustar alastairalastairprogram fixed_number_of_args complex :: a a = complex(1) end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_13.f900000664000175000017500000000103715141516316024762 0ustar alastairalastairmodule array_bounds_check_13_mod type :: base integer :: x end type base type, extends(base) :: derived integer :: y end type derived contains subroutine my(a, b) class(base), intent(in) :: a(:) integer, optional :: b print *, a(1)%x end subroutine end module program array_bounds_check_13 use array_bounds_check_13_mod integer, allocatable :: i type(derived), allocatable :: my_array(:) i = 10 call my(my_array, i) end program lfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_03.f900000664000175000017500000000025615141516316025745 0ustar alastairalastairprogram scalar_allocation_check_03 implicit none type :: base integer :: x end type type(base), allocatable :: var print *, var%x end program lfortran-lfortran-2f73434/tests/errors/more_kwargs_than_acceptable_to_subroutine.f900000664000175000017500000000035315141516316031310 0ustar alastairalastairprogram more_kwargs_than_acceptable_to_subroutine implicit none call my_func(y=1, x=2, z=1) contains subroutine my_func(x, y) integer, intent(in) :: x, y print *, "hi" end subroutine end program lfortran-lfortran-2f73434/tests/errors/cpp5.h0000664000175000017500000000016415141516316021332 0ustar alastairalastair#define X123 z12345678 #define Y123 X123 #define A123 Y123 #define B123 A123 #define C123 B123+B123 integer :: x, y lfortran-lfortran-2f73434/tests/errors/common1.f900000664000175000017500000000012615141516316022201 0ustar alastairalastairsubroutine solsy () double precision rowns(209) common /rowns/ rowns(209) end lfortran-lfortran-2f73434/tests/errors/implicit_call_02.f900000664000175000017500000000065715141516316023747 0ustar alastairalastair! Test: Array kind mismatch via implicit interface ! With --implicit-interface --implicit-argument-casting, passing integer(8) ! array to integer(4) parameter should produce semantic error. program implicit_call_02 implicit none integer(8) :: arr(2) arr(1) = 100 arr(2) = 200 call test_sub(arr) end program subroutine test_sub(x) implicit none integer(4) :: x(2) print *, x(1), x(2) end subroutine lfortran-lfortran-2f73434/tests/errors/matrix_matmul_06.f900000664000175000017500000000017115141516316024020 0ustar alastairalastairprogram matrix_matmul_06 implicit none integer :: a(3) integer :: b(3) print *, matmul(a, b) end program lfortran-lfortran-2f73434/tests/errors/func_arg_array.f900000664000175000017500000000041115141516316023607 0ustar alastairalastairprogram array_passing integer, dimension(3,2) :: myArray = reshape([1,2,3,4,5,6],[3,2]) integer :: i i = temp(myArray) end program array_passing integer Function temp(arr) integer, dimension(2,2,2) :: arr temp = arr(1,2,2) end functionlfortran-lfortran-2f73434/tests/errors/matrix_transpose_01.f900000664000175000017500000000015015141516316024527 0ustar alastairalastairprogram matrix_transpose_01 implicit none integer :: a(3) print *, transpose(a) end program lfortran-lfortran-2f73434/tests/errors/function_01.f900000664000175000017500000000062115141516316022755 0ustar alastairalastairmodule add_m implicit none private contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test() real :: x, y x = 5.1 y = 7.2 print*, "The result is ", func_arg_int(x, y) end subroutine end module program add use add_m implicit none call test() end program add lfortran-lfortran-2f73434/tests/errors/class_procedure_extra_args.f900000664000175000017500000000123315141516316026224 0ustar alastairalastairmodule Geometry implicit none type :: Circle real :: radius contains procedure :: calculateArea end type Circle contains ! Type-bound subroutine to calculate the area of a circle subroutine calculateArea(self, area) class(Circle), intent(in) :: self real, intent(out) :: area area = 3.14 * self%radius**2 end subroutine calculateArea end module Geometry program TestGeometry use Geometry implicit none type(Circle) :: myCircle real :: circleArea myCircle%radius = 5.0 call myCircle%calculateArea(circleArea, 12) print *, "Circle Area:", circleArea end program TestGeometry lfortran-lfortran-2f73434/tests/errors/sqrt_neg.f900000664000175000017500000000006515141516316022454 0ustar alastairalastairprogram sqrt_neg print *, sqrt(-1.0) end program lfortran-lfortran-2f73434/tests/errors/array_05_cc.f900000664000175000017500000000053415141516316022722 0ustar alastairalastairmodule module_array_05 type t real, allocatable :: x(:) end type t end module module_array_05 program array_05_cc use module_array_05 implicit none type(t) :: type_01 allocate(type_01%x(1, 2)) allocate(type_01%x(2, 1)) print *, "compilation continued despite errors" end program array_05_cc lfortran-lfortran-2f73434/tests/errors/coarray_02.f900000664000175000017500000000010715141516316022570 0ustar alastairalastairprogram coarray_02 call event_query(1, 1, 1) end program coarray_02lfortran-lfortran-2f73434/tests/errors/program_without_line_01.f900000664000175000017500000000002715141516316025371 0ustar alastairalastairprint *, "OK" contains lfortran-lfortran-2f73434/tests/errors/implicit_typing1.f900000664000175000017500000000016415141516316024117 0ustar alastairalastairsubroutine sub1() implicit none x = 1 print *, x end subroutine sub1 program main call sub1() end program main lfortran-lfortran-2f73434/tests/errors/dlgama_arg.f900000664000175000017500000000006715141516316022712 0ustar alastairalastairprogram dlgama_arg print *, dlgama(2.7) end programlfortran-lfortran-2f73434/tests/errors/kind_star_of_int.f900000664000175000017500000000011015141516316024135 0ustar alastairalastairprogram kind_star_of_int implicit none integer(*) a end program lfortran-lfortran-2f73434/tests/errors/matmul_unallocated_01.f900000664000175000017500000000036315141516316025005 0ustar alastairalastairprogram matmul_unallocated_01 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) allocate(A(3, 4), B(4, 2)) A = 1.0 B = 1.0 ! C is not allocated - should fail without --realloc-lhs-arrays C = matmul(A, B) print *, C(1,1) end program lfortran-lfortran-2f73434/tests/errors/integerStringInput_64.f900000664000175000017500000000056615141516316025015 0ustar alastairalastairprogram integerStringInput_int64 implicit none integer, parameter :: int64 = selected_int_kind(18) integer(int64) :: x open(unit=10, file="tests/invalidInput_integer.txt", status="unknown") do read(10, *, end=100) x print *, "Read int64 integer:", x end do 100 continue close(10) stop end program integerStringInput_int64 lfortran-lfortran-2f73434/tests/errors/assign_01.f900000664000175000017500000000015315141516316022414 0ustar alastairalastairprogram assign_01 implicit none integer, parameter :: x = 2 x = 1 print *, x end program lfortran-lfortran-2f73434/tests/errors/intrinsics3.f900000664000175000017500000000007115141516316023077 0ustar alastairalastairprogram intrinsics3 print *, ibclr(1, -2) end programlfortran-lfortran-2f73434/tests/errors/template_error_01b.f900000664000175000017500000000430215141516316024316 0ustar alastairalastairmodule template_travel_01b_m implicit none private public :: travel_tmpl requirement operation(A, B, C, op) type, deferred :: A type, deferred :: B type, deferred :: C pure function op(l, r) result(res) type(A), intent(in) :: l type(B), intent(in) :: r type(C) :: res end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operation(D, D, D, plus_D) !require :: operation(T, T, T, plus_T) require :: operation(D, T, S, D_divided_by_T) require :: operation(D, S, T, D_divided_by_S) private public :: avg_S_from_T, avg_S_from_S contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template contains subroutine test_template() instantiate travel_tmpl(real, real, real, operator(+), operator(+), operator(/), operator(/)), & only: avg_real_S_from_T => avg_S_from_T, avg_real_S_from_S => avg_S_from_S instantiate travel_tmpl(integer, integer, integer, operator(+), operator(+), operator(/), operator(/)), & only: avg_integer_S_from_T => avg_S_from_T, avg_integer_S_from_S => avg_S_from_S real :: s1, s2 integer :: i1, i2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, s1, 2.0, s1) i1 = avg_integer_S_from_T(1, 3, 20, 4) i2 = avg_integer_S_from_S(1, i1, 15, i1) print *, "s1=", s1 print *, "s2=", s2 print *, "i1=", i1 print *, "i2=", i2 end subroutine end module program template_travel_01b use template_travel_01b_m implicit none call test_template() end programlfortran-lfortran-2f73434/tests/errors/template_error_04.f900000664000175000017500000000212415141516316024157 0ustar alastairalastairmodule template_error_04_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_error_04 use template_error_04_m implicit none call test_template() end program template_error_04 lfortran-lfortran-2f73434/tests/errors/data_implied_do2.f900000664000175000017500000000024115141516316024006 0ustar alastairalastairprogram data_implied_do2 implicit none integer :: k = 1 integer :: i, iarx(3) data(iarx(i), i=1, 3, k) / 1, 2, 3 / end program data_implied_do2 lfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_01.f900000664000175000017500000000023715141516316025742 0ustar alastairalastairprogram scalar_allocation_check_01 implicit none integer, allocatable :: x integer, allocatable :: z integer :: y y = x + z end program lfortran-lfortran-2f73434/tests/errors/sign_01.f900000664000175000017500000000006515141516316022072 0ustar alastairalastairprogram sign_01 print *, sign(1, 1_8) end programlfortran-lfortran-2f73434/tests/errors/array_constructor_with_different_char_lengths.f900000664000175000017500000000015115141516316032213 0ustar alastairalastairprogram array_constructor_with_different_char_lengths print *, ["a", "b", "ball", "cat"] end program lfortran-lfortran-2f73434/tests/errors/program_without_line_04.f900000664000175000017500000000003015141516316025366 0ustar alastairalastairprint *, "OK" 2 + 2 end lfortran-lfortran-2f73434/tests/errors/cpp_err4.f900000664000175000017500000000011115141516316022340 0ustar alastairalastairprogram cpp_err4 #include "does_not_exist.inc" print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/floatStringInput.f900000664000175000017500000000043515141516316024147 0ustar alastairalastairprogram realStringInput implicit none real :: x open(unit=10, file="tests/invalidInput_float.txt", status="unknown") do read(10, *, end=100) x print *, "Read real number:", x end do 100 continue close(10) stop end program realStringInput lfortran-lfortran-2f73434/tests/errors/allocate_01.f900000664000175000017500000000033415141516316022715 0ustar alastairalastairprogram allocate_01 character(:), allocatable :: str allocate(character(len=10) :: str) deallocate(str) allocate(character(len=11) :: str) allocate(character(len=12) :: str) ! Error end program lfortran-lfortran-2f73434/tests/errors/incorrect_type_where_03.f900000664000175000017500000000016615141516316025361 0ustar alastairalastairprogram main implicit none integer :: b(5) where(max(1.33, 2.67)) b = 12121 print *, b end program main lfortran-lfortran-2f73434/tests/errors/derived_type_02.f900000664000175000017500000000043615141516316023620 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred :: testing end type tester abstract interface subroutine testing_interface() end subroutine testing_interface end interface end module test lfortran-lfortran-2f73434/tests/errors/unterminated_ifndef_01.f900000664000175000017500000000017015141516316025141 0ustar alastairalastair#ifndef a program unterminated_ifndef_01 implicit none print *, "Hello world" end program unterminated_ifndef_01 lfortran-lfortran-2f73434/tests/errors/merge_bits_run.f900000664000175000017500000000022315141516316023632 0ustar alastairalastairprogram merge_bits_run integer :: a, c integer(kind=8) :: b a = 8 b = 12_8 c = 2 print *, merge_bits(a, b, c) end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_07.f900000664000175000017500000000035215141516316024764 0ustar alastairalastairprogram array_bounds_check_07 integer, allocatable :: x(:) integer, allocatable :: y(:) integer, allocatable :: z(:) allocate(x(3)) allocate(y(4)) allocate(z(5)) x = 1 y = 2 z = x + y end program lfortran-lfortran-2f73434/tests/errors/func_parameter_type_02.f900000664000175000017500000000037315141516316025171 0ustar alastairalastairSUBROUTINE sub(f) IMPLICIT DOUBLE PRECISION (A-H) EXTERNAL f H=HINIT853(f) RETURN END FUNCTION HINIT853(f) IMPLICIT DOUBLE PRECISION (A-H) RETURN END program main EXTERNAL f call sub(f) end programlfortran-lfortran-2f73434/tests/errors/subroutine1.f900000664000175000017500000000016315141516316023111 0ustar alastairalastairprogram subroutine1 call bpe() contains subroutine bpe() bpe = 1 end subroutine end programlfortran-lfortran-2f73434/tests/errors/array_bounds_check_04.f900000664000175000017500000000033515141516316024762 0ustar alastairalastairprogram array_bounds_check_04 integer, allocatable :: x(:,:) allocate(x(3, 4)) call my(x) contains subroutine my(x) integer, intent(in) :: x(3, 1) end subroutine end program lfortran-lfortran-2f73434/tests/errors/compare_01.f900000664000175000017500000000030115141516316022551 0ustar alastairalastairprogram compare_01 character(1) :: x integer :: i x = 'u' i = 10 if (i > x) then print *, "Hello World" else print *, "New world" end if end program lfortran-lfortran-2f73434/tests/errors/array_01.f900000664000175000017500000000010415141516316022242 0ustar alastairalastairprogram array_01 implicit none integer :: a(5) a = [] end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_01.f900000664000175000017500000000016215141516316024755 0ustar alastairalastairprogram array_bounds_check_01 integer, allocatable :: x(:) allocate(x(10)) x = [1, 2, 3] end program lfortran-lfortran-2f73434/tests/errors/substring_endidx.f900000664000175000017500000000023215141516316024201 0ustar alastairalastairprogram substring_noninteger_endidx implicit none character(len=8) :: s = "lfortran" print*, s(1:5.2) end program substring_noninteger_endidx lfortran-lfortran-2f73434/tests/errors/dreal_arg_error.f900000664000175000017500000000013615141516316023762 0ustar alastairalastairprogram dreal_arg_error complex :: a a = (1.0, 2.0) print *, dreal(a) end programlfortran-lfortran-2f73434/tests/errors/close_invalid_kwarg1.f900000664000175000017500000000027215141516316024721 0ustar alastairalastairPROGRAM close_invalid_kwarg1 ! "end" is an invalid keyword argument for "CLOSE" ! it is ok to raise "end" being invalid before "unit" being absent CLOSE(end=200) END PROGRAM lfortran-lfortran-2f73434/tests/errors/array_bounds_check_02.f900000664000175000017500000000033215141516316024755 0ustar alastairalastairprogram array_bounds_check_02 integer :: x x = 4 call temp(x) contains subroutine temp(x) integer, intent(in) :: x integer :: y(x) y = [1, 2, 3] end subroutine end program lfortran-lfortran-2f73434/tests/errors/array_06.f900000664000175000017500000000015615141516316022256 0ustar alastairalastairprogram array_06 implicit none character(4) :: str(3) str(1, 2)(:) = '1234' end program array_06 lfortran-lfortran-2f73434/tests/errors/intrinsics12.f900000664000175000017500000000007415141516316023162 0ustar alastairalastairprogram intrinsics12 print *, max(12, 13.94) end programlfortran-lfortran-2f73434/tests/errors/array_bounds_check_09.f900000664000175000017500000000071415141516316024770 0ustar alastairalastairprogram array_bounds_check_09 integer, allocatable :: a(:) integer, allocatable :: b(:) integer, allocatable :: e(:) allocate(a(3)) allocate(b(3)) allocate(e(3)) a = 3 b = 3 e = a + b + f(a) print *, e contains function f(x) result(y) integer, intent(in) :: x(:) integer, allocatable :: y(:) allocate(y(size(x) - 1)) y = 2 end function end program lfortran-lfortran-2f73434/tests/errors/array_size_01.f900000664000175000017500000000016515141516316023303 0ustar alastairalastairprogram arrays_01 implicit none integer :: a(3) integer :: size_a size_a = size(a, 1, 4, kind=4) end lfortran-lfortran-2f73434/tests/errors/array_bounds_check_08.f900000664000175000017500000000036515141516316024771 0ustar alastairalastairprogram array_bounds_check_08 integer, allocatable :: arr(:) allocate(arr(5)) arr = ff() print *, size(arr) contains function ff() result(res) integer :: res(100000) res(100000) = 9999 end function end program lfortran-lfortran-2f73434/tests/errors/intrinsics4.f900000664000175000017500000000007715141516316023106 0ustar alastairalastairprogram intrinsics4 print *, dshiftl(1, 1_8, 1) end programlfortran-lfortran-2f73434/tests/errors/cpp_err2.f900000664000175000017500000000010515141516316022341 0ustar alastairalastairprogram cpp_err2 #if 2 < 1+2+ / 1 2 #endif print *, 'OK' end program lfortran-lfortran-2f73434/tests/errors/scalar_allocation_check_06.f900000664000175000017500000000015015141516316025741 0ustar alastairalastairprogram scalar_allocation_check_06 implicit none integer, allocatable :: x print *, x end lfortran-lfortran-2f73434/tests/errors/cpp1.f900000664000175000017500000000022015141516316021466 0ustar alastairalastairprogram cpp1 implicit none #define X123 z12345678 integer :: x, y x = (2+3)*5 ! Error: `z12345678` not defined: print *, x, X123, y end program lfortran-lfortran-2f73434/tests/errors/intrinsics2.f900000664000175000017500000000027015141516316023077 0ustar alastairalastairprogram intrinsics2 real(8) :: x, y, datan2 x = 2.33D0 y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop end programlfortran-lfortran-2f73434/tests/errors/derived_type_05.f900000664000175000017500000000063715141516316023626 0ustar alastairalastairmodule test private type, abstract :: tester contains procedure(testing_interface), deferred, pass(my_object), nopass :: testing end type tester abstract interface subroutine testing_interface(my_object, a, b) class(tester), intent(inout) :: my_object integer, intent(inout) :: a, b end subroutine testing_interface end interface end module test lfortran-lfortran-2f73434/tests/errors/unterminated_if_01.f900000664000175000017500000000020215141516316024300 0ustar alastairalastair#if a #ifdef b #endif program unterminated_if_01 implicit none print *, "Hello world" end program unterminated_if_01 lfortran-lfortran-2f73434/tests/errors/intrinsics6.f900000664000175000017500000000007115141516316023102 0ustar alastairalastairprogram intrinsics6 print *, ieor(1, 1_8) end programlfortran-lfortran-2f73434/tests/errors/array_size_04.f900000664000175000017500000000017415141516316023306 0ustar alastairalastairprogram array_size_04 implicit none integer :: a(3) integer :: size_a size_a = size(a, kind1=4, dim1=1) end lfortran-lfortran-2f73434/tests/errors/incorrect_type_where_02.f900000664000175000017500000000015015141516316025351 0ustar alastairalastairprogram main implicit none integer :: b(5) where(1) b = 12121 print *, b end program main lfortran-lfortran-2f73434/tests/errors/kind_invalid_int_of_logical.f900000664000175000017500000000012315141516316026310 0ustar alastairalastairprogram kind_invalid_of_logical implicit none logical(10) :: x end program lfortran-lfortran-2f73434/tests/errors/rewind_invalid_kwarg1.f900000664000175000017500000000017215141516316025103 0ustar alastairalastairprogram rewind_invalid_kwarg1 ! "end" is an invalid keyword argument for "REWIND" rewind(end="world") end program lfortran-lfortran-2f73434/tests/errors/cpp3.f900000664000175000017500000000021115141516316021470 0ustar alastairalastairprogram cpp3 implicit none #define X123 12345678 integer :: x, y x = (2+3)*5 ! Error: `xx` not defined: print *, xx, X123, y end program lfortran-lfortran-2f73434/tests/errors/array_bounds_check_12.f900000664000175000017500000000053515141516316024763 0ustar alastairalastairprogram array_bounds_check_12 integer, allocatable :: a(:) integer, allocatable :: e(:) allocate(a(3)) allocate(e(3)) a = 3 e = f(a) print *, e contains function f(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x) - 1) y = 2 end function end program lfortran-lfortran-2f73434/tests/errors/maskl_incorrect_bit_size.f900000664000175000017500000000010215141516316025671 0ustar alastairalastairprogram maskl_incorrect_bit_size print*, maskl(63) end program lfortran-lfortran-2f73434/tests/subroutine9.f900000664000175000017500000000060115141516316021602 0ustar alastairalastairsubroutine a() import, none implicit none end subroutine subroutine b() import, all implicit none end subroutine subroutine c() import a, b implicit none end subroutine subroutine d() import :: a, b implicit none end subroutine subroutine e() import, only: a, b implicit none end subroutine subroutine f() import :: a, b import :: c import :: d, e, f implicit none end subroutine lfortran-lfortran-2f73434/tests/array1.f900000664000175000017500000000024415141516316020514 0ustar alastairalastairprogram array1 implicit none real :: d, e(5), e2(2, 3), e3(1, 2, 3) integer :: f, g(3), g2(6, 3), g3(4, 3, 2) logical :: a, b(2), b2(3, 2), b3(2, 1, 2) end program lfortran-lfortran-2f73434/tests/global_scope7.f900000664000175000017500000000003715141516316022035 0ustar alastairalastairinteger :: x = 6 2*x x = x + 1 lfortran-lfortran-2f73434/tests/common2.f0000664000175000017500000000036015141516316020515 0ustar alastairalastair subroutine f() integer :: a, b, c, d, e, g, h, i, j, k common / block_1 / a, b, h / block_2 / c, d, / block_3 / e, & g common / block_4 / i, / block_5 / j, k end subroutine lfortran-lfortran-2f73434/tests/server/0000775000175000017500000000000015141516316020303 5ustar alastairalastairlfortran-lfortran-2f73434/tests/server/setup.py0000664000175000017500000000004515141516316022014 0ustar alastairalastairfrom setuptools import setup setup() lfortran-lfortran-2f73434/tests/server/README.md0000664000175000017500000000000015141516316021550 0ustar alastairalastairlfortran-lfortran-2f73434/tests/server/setup.cfg0000664000175000017500000000160115141516316022122 0ustar alastairalastair[metadata] name = lfortran-language-server version = 0.0.1 author = Dylon Edwards author_email = dylon.devo@gmail.com description = LSP client for testing lfortran-language-server. long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/lfortran/lfortran project_urls = Bug Tracker = https://github.com/lfortran/lfortran/issues license = BSD-3-Clause classifiers = Programming Language :: Python :: 3 Programming Language :: Python :: 3.10 License :: OSI Approved :: BSD License Operating System :: POSIX :: Linux Operating System :: MacOS Operating System :: Microsoft :: Windows [options] include_package_data = True package_dir = = src packages = find: python_requires = >=3.10 install_requires = pytest>=8.3.5 pytest-timeout>=2.3.1 llanguage-test-client>=0.0.1 [options.packages.find] where = src lfortran-lfortran-2f73434/tests/server/tests/0000775000175000017500000000000015141516316021445 5ustar alastairalastairlfortran-lfortran-2f73434/tests/server/tests/conftest.py0000664000175000017500000001736215141516316023655 0ustar alastairalastairimport os import shutil import sys from pathlib import Path from typing import Iterator, Optional import pytest from lfortran_language_server.lfortran_lsp_test_client import LFortranLspTestClient def pytest_addoption(parser: pytest.Parser) -> None: parser.addoption( "--execution-strategy", action="store", default="concurrent", help="Specifies the execution strategy for handling messages. The `parallel` strategy implies multiple messages may be processed alongside each other, while the `concurrent` strategy implies multiple messages may be processed but only one processor will be active at a time (they will yield control to each other).", choices=("concurrent", "parallel"), ) @pytest.fixture def client(request: pytest.FixtureRequest, capfd: pytest.CaptureFixture) -> Iterator[LFortranLspTestClient]: execution_strategy = request.config.getoption("--execution-strategy") server_path = None if 'LFORTRAN_PATH' in os.environ: server_path = os.environ['LFORTRAN_PATH'] if server_path is None or not os.path.exists(server_path): server_path = Path(__file__).absolute().parent.parent.parent.parent / "src" / "bin" / "lfortran" if server_path is None or not os.path.exists(server_path): server_path = shutil.which('lfortran') if server_path is None: raise RuntimeError('cannot determine location of lfortran') server_path = Path(server_path) if not (server_path.exists() and os.access(server_path, os.X_OK)): raise RuntimeError(f'Invalid or non-executable path to lfortran: {server_path}') compiler_path = server_path server_log_path = f"{request.node.name}-{execution_strategy}-server.log" client_log_path = f"{request.node.name}-{execution_strategy}-client.log" stdout_log_path = f"{request.node.name}-{execution_strategy}-stdout.log" stdin_log_path = f"{request.node.name}-{execution_strategy}-stdin.log" gdb_log_path = f"{request.node.name}-{execution_strategy}-gdb.log" lldb_log_path = f"{request.node.name}-{execution_strategy}-lldb.log" config = { "LFortran": { "openIssueReporterOnError": False, "maxNumberOfProblems": 100, "trace": { "server": "verbose", }, "compiler": { "path": "lfortran", "flags": [], }, "log": { "path": server_log_path, "level": "all", "prettyPrint": False, }, "indentSize": 4, # NOTE: Regarding timing-out and retrying requests, a timeout of 0 # means do not time-out (or retry): "timeoutMs": 0, "retry": { "maxAttempts": 3, "minSleepTimeMs": 10, "maxSleepTimeMs": 300, }, "telemetry": { "enabled": True, "frequencyMs": 1000, }, } } server_args = [] # FIXME: Find the correct combination of commands to get LLDB to dump crashes # to a log file like GDB and uncomment the following to enable it: # --------------------------------------------------------------------------- # lldb_path = shutil.which('lldb') lldb_path = None #<- FIXME: When LLDB is enabled, remove this line. # NOTE: If you have GDB on your system and would like to run the tests with # it, uncomment the following line so GDB may be found and disable the line # that assigns `None` to it: # ------------------------------------------------------------------------- # gdb_path = shutil.which('gdb') gdb_path = None if lldb_path is not None: server_args += [ "-q", "-b", "-o", "run", "-o", "bt", "-o", f"log enable lldb crashlog {lldb_log_path}", "-o", "quit", str(compiler_path), "--", ] server_path = Path(lldb_path) elif gdb_path is not None: server_args += [ "-q", "-batch", "-ex", "set logging enabled off", "-ex", "set logging redirect on", "-ex", "set logging debugredirect on", "-ex", "set logging overwrite on", "-ex", f"set logging file {gdb_log_path}", "-ex", "set logging enabled on", "-ex", "run", "-ex", "bt", "--args", str(compiler_path), ] server_path = Path(gdb_path) server_args += [ "server", "--parent-process-id", str(os.getpid()), "--log-level", config["LFortran"]["log"]["level"], "--log-path", server_log_path, "--timeout-ms", str(config["LFortran"]["timeoutMs"]), "--num-request-threads", "1", "--num-worker-threads", "1", "--config-section", "LFortran", "--open-issue-reporter-on-error", str(config["LFortran"]["openIssueReporterOnError"]).lower(), "--max-number-of-problems", str(config["LFortran"]["maxNumberOfProblems"]), "--trace-server", config["LFortran"]["trace"]["server"], "--compiler-path", str(compiler_path), "--log-pretty-print", str(config["LFortran"]["log"]["prettyPrint"]).lower(), "--indent-size", str(config["LFortran"]["indentSize"]), "--max-retry-attempts", str(config["LFortran"]["retry"]["maxAttempts"]), "--min-retry-sleep-time-ms", str(config["LFortran"]["retry"]["minSleepTimeMs"]), "--max-retry-sleep-time-ms", str(config["LFortran"]["retry"]["maxSleepTimeMs"]), "--extension-id", "lcompilers.lfortran", "--execution-strategy", execution_strategy, ] def print_log(log_path: str, heading: str) -> None: header = f"~~ {heading} [{log_path}] ~~" border = "~" * len(header) print(file=sys.stderr) print(border, file=sys.stderr) print(header, file=sys.stderr) print(border, file=sys.stderr) print(file=sys.stderr) if os.path.exists(log_path): with open(log_path) as f: print(f.read(), file=sys.stderr) else: print(f"Log file does not exist: {log_path}", file=sys.stderr) def print_logs() -> None: print_log(client_log_path, "Client Logs") print_log(stdin_log_path, "Standard Input") print_log(stdout_log_path, "Standard Output") print_log(server_log_path, "Server Logs") if lldb_path is not None: print_log(lldb_log_path, "Low-Level Debugger (LLDB)") elif gdb_path is not None: print_log(gdb_log_path, "GNU Debugger (GDB)") client: Optional[LFortranLspTestClient] = None logs_printed = False try: client = LFortranLspTestClient( server_path=server_path, server_params=server_args, workspace_path=None, timeout_ms=3000, config=config, client_log_path=client_log_path, stdout_log_path=stdout_log_path, stdin_log_path=stdin_log_path ) with client.serve(): # Steps abstracted by context manager: # 1. Send request: initialize # 2. Send notification: initialized # 3. # 4. Send request: shutdown # 5. Send notification: exit yield client except BaseException as e: if not isinstance(e, SystemExit) or e.code != 0: print_logs() logs_printed = True raise e finally: try: if client is not None and hasattr(client, 'server') \ and client.server.poll(): client.kill_server() finally: if not logs_printed: print_logs() # Consuming stderr should prevent leaks capfd.readouterr() lfortran-lfortran-2f73434/tests/server/tests/test_features.py0000664000175000017500000005200015141516316024671 0ustar alastairalastairfrom pathlib import Path from tempfile import NamedTemporaryFile from typing import List import pytest from lsprotocol.types import (CompletionItem, CompletionItemKind, DidChangeConfigurationParams, DocumentHighlight, DocumentSymbol, Hover, MarkupContent, MarkupKind, Position, Range, SymbolKind) from lfortran_language_server.lfortran_lsp_test_client import \ LFortranLspTestClient from llanguage_test_client.json_rpc import JsonArray from llanguage_test_client.lsp_test_client import IncomingEvent def test_goto_definition(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, 18 doc.cursor = line, column doc.goto_definition() assert doc.line == 8 assert doc.column == 5 def test_diagnostics(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 21, 1 doc.cursor = line, column doc.write("error") validation = client.await_validation(doc.uri, doc.version) assert validation is not None assert validation["params"]["uri"] == doc.uri assert validation["params"]["version"] == doc.version diagnostics = validation["params"]["diagnostics"] assert len(diagnostics) == 2 assert diagnostics[0]["message"] == "Statement or Declaration expected inside program, found Variable name" assert diagnostics[0]["range"]["start"]["line"] == 20 assert diagnostics[0]["range"]["start"]["character"] == 0 assert diagnostics[0]["range"]["end"]["line"] == 20 assert diagnostics[0]["range"]["end"]["character"] == 5 assert diagnostics[0]["severity"] == 1 assert diagnostics[0]["source"] == "lfortran" assert diagnostics[1]["message"] == "Variable 'error' is not declared" assert diagnostics[1]["range"]["start"]["line"] == 20 assert diagnostics[1]["range"]["start"]["character"] == 0 assert diagnostics[1]["range"]["end"]["line"] == 20 assert diagnostics[1]["range"]["end"]["character"] == 5 assert diagnostics[1]["severity"] == 1 assert diagnostics[1]["source"] == "lfortran" doc.backspace(5) validation = client.await_validation(doc.uri, doc.version) assert validation is not None assert validation["params"]["uri"] == doc.uri assert validation["params"]["version"] == doc.version diagnostics = validation["params"]["diagnostics"] assert len(diagnostics) == 0 def test_configuration_caching(client: LFortranLspTestClient) -> None: with NamedTemporaryFile( prefix="test_configuration_caching-", suffix=".f90", delete=True ) as tmp_file: doc = client.open_document("fortran", tmp_file.name) assert client.await_validation(doc.uri, doc.version) is not None doc.write("foo") doc.save() assert client.await_validation(doc.uri, doc.version) is not None def is_config_request_for_doc(event: IncomingEvent) -> bool: return event.data.get("method", None) == "workspace/configuration" and \ len(event.data["params"]["items"]) > 0 and \ event.data["params"]["items"][0]["scopeUri"] == doc.uri and \ event.data["params"]["items"][0]["section"] == "LFortran" event, index = client.find_incoming_event(is_config_request_for_doc) # The config must be requested before it may be cached: assert event is not None doc.write("bar") assert client.await_validation(doc.uri, doc.version) is not None event, index = client.find_incoming_event(is_config_request_for_doc, index + 1) # The config has been cached, so there is no need to cache it again: assert event is None # Invalidate the document caches: client.send_workspace_did_change_configuration( DidChangeConfigurationParams(client.config) ) doc.write("baz") assert client.await_validation(doc.uri, doc.version) is not None event, index = client.find_incoming_event(is_config_request_for_doc, index + 1) # The cache was invalidated so the config must be requested again: assert event is not None def test_rename(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 4, 20 doc.cursor = line, column doc.rename("foo") assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", " contains", " foo", " end type softmax", " contains", " ", " pure function foo(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function foo", " ", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", # TODO: Once lfortran can rename the function call, swap the following # two lines: # " res = self%foo(x)", " res = self%eval_1d(x)", " end function eval_1d_prime", "end module module_function_call1", ]) + "\n" def test_document_highlight(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent.parent / "examples" / "expr2.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 7, 10 doc.cursor = line, column doc.highlight_symbol() assert doc.symbol_highlights is not None # NOTE: DocumentHighlight is not hashable, so we cannot perform set comparison ... expected_highlights: List[DocumentHighlight] = [ DocumentHighlight( range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), DocumentHighlight( range=Range( start=Position( line=5, character=0, ), end=Position( line=5, character=1, ), ), ), DocumentHighlight( range=Range( start=Position( line=6, character=9, ), end=Position( line=6, character=10, ), ), ), ] for highlight in doc.symbol_highlights: expected_highlights.remove(highlight) assert len(expected_highlights) == 0 def test_document_hover(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, 22 doc.cursor = line, column doc.hover() assert doc.preview == Hover( contents=MarkupContent( kind=MarkupKind.Markdown, value="```fortran\nfunction eval_1d(self, x) result(res)\n class(softmax), intent(in) :: self\n real[:], intent(in) :: x\n real[:] :: res\nend function\n```" ), range=Range( end=Position( character=24, line=11 ), start=Position( character=4, line=7 ) ) ) def test_symbol_tree(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent.parent / "examples" / "expr2.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None assert doc.symbols == [ DocumentSymbol( children=[ DocumentSymbol( kind=SymbolKind.Variable, name="x", range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), selection_range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), ], kind=SymbolKind.Function, name="expr2", range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), selection_range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), ), ] line, column = 4, 12 doc.cursor = line, column doc.rename("y") # x -> y assert doc.symbols == [ DocumentSymbol( children=[ DocumentSymbol( kind=SymbolKind.Variable, name="y", range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), selection_range=Range( start=Position( line=3, character=11, ), end=Position( line=3, character=12, ), ), ), ], kind=SymbolKind.Function, name="expr2", range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), selection_range=Range( start=Position( line=0, character=0, ), end=Position( line=8, character=11, ), ), ), ] def test_semantic_highlighting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.semantic_highlight() expected_highlights = [ 0,0,6,15,0, # Keyword at line=0, column=0, length=6, text=`module` 0,7,21,8,0, # Variable at line=0, column=7, length=21, text=`module_function_call1` 1,4,4,15,0, # Keyword at line=1, column=4, length=4, text=`type` 0,8,7,8,0, # Variable at line=1, column=12, length=7, text=`softmax` 1,4,8,15,0, # Keyword at line=2, column=4, length=8, text=`contains` 1,6,9,8,0, # Variable at line=3, column=6, length=9, text=`procedure` 0,13,7,8,0, # Variable at line=3, column=19, length=7, text=`eval_1d` 1,4,3,15,0, # Keyword at line=4, column=4, length=3, text=`end` 0,4,4,15,0, # Keyword at line=4, column=8, length=4, text=`type` 0,5,7,8,0, # Variable at line=4, column=13, length=7, text=`softmax` 1,2,8,15,0, # Keyword at line=5, column=2, length=8, text=`contains` 2,4,4,8,0, # Variable at line=7, column=4, length=4, text=`pure` 0,5,8,15,0, # Keyword at line=7, column=9, length=8, text=`function` 0,9,7,8,0, # Variable at line=7, column=18, length=7, text=`eval_1d` 0,8,4,8,0, # Variable at line=7, column=26, length=4, text=`self` 0,6,1,8,0, # Variable at line=7, column=32, length=1, text=`x` 0,3,6,8,0, # Variable at line=7, column=35, length=6, text=`result` 0,7,3,8,0, # Variable at line=7, column=42, length=3, text=`res` 1,6,5,8,0, # Variable at line=8, column=6, length=5, text=`class` 0,6,7,8,0, # Variable at line=8, column=12, length=7, text=`softmax` 0,10,6,8,0, # Variable at line=8, column=22, length=6, text=`intent` 0,7,2,8,0, # Variable at line=8, column=29, length=2, text=`in` 0,7,4,8,0, # Variable at line=8, column=36, length=4, text=`self` 1,6,4,15,0, # Keyword at line=9, column=6, length=4, text=`real` 0,6,6,8,0, # Variable at line=9, column=12, length=6, text=`intent` 0,7,2,8,0, # Variable at line=9, column=19, length=2, text=`in` 0,7,1,8,0, # Variable at line=9, column=26, length=1, text=`x` 1,6,4,15,0, # Keyword at line=10, column=6, length=4, text=`real` 0,8,3,8,0, # Variable at line=10, column=14, length=3, text=`res` 0,4,4,8,0, # Variable at line=10, column=18, length=4, text=`size` 0,5,1,8,0, # Variable at line=10, column=23, length=1, text=`x` 1,4,3,15,0, # Keyword at line=11, column=4, length=3, text=`end` 0,4,8,15,0, # Keyword at line=11, column=8, length=8, text=`function` 0,9,7,8,0, # Variable at line=11, column=17, length=7, text=`eval_1d` 2,4,4,8,0, # Variable at line=13, column=4, length=4, text=`pure` 0,5,8,15,0, # Keyword at line=13, column=9, length=8, text=`function` 0,9,13,8,0, # Variable at line=13, column=18, length=13, text=`eval_1d_prime` 0,14,4,8,0, # Variable at line=13, column=32, length=4, text=`self` 0,6,1,8,0, # Variable at line=13, column=38, length=1, text=`x` 0,3,6,8,0, # Variable at line=13, column=41, length=6, text=`result` 0,7,3,8,0, # Variable at line=13, column=48, length=3, text=`res` 1,6,5,8,0, # Variable at line=14, column=6, length=5, text=`class` 0,6,7,8,0, # Variable at line=14, column=12, length=7, text=`softmax` 0,10,6,8,0, # Variable at line=14, column=22, length=6, text=`intent` 0,7,2,8,0, # Variable at line=14, column=29, length=2, text=`in` 0,7,4,8,0, # Variable at line=14, column=36, length=4, text=`self` 1,6,4,15,0, # Keyword at line=15, column=6, length=4, text=`real` 0,6,6,8,0, # Variable at line=15, column=12, length=6, text=`intent` 0,7,2,8,0, # Variable at line=15, column=19, length=2, text=`in` 0,7,1,8,0, # Variable at line=15, column=26, length=1, text=`x` 1,6,4,15,0, # Keyword at line=16, column=6, length=4, text=`real` 0,8,3,8,0, # Variable at line=16, column=14, length=3, text=`res` 0,4,4,8,0, # Variable at line=16, column=18, length=4, text=`size` 0,5,1,8,0, # Variable at line=16, column=23, length=1, text=`x` 1,6,3,8,0, # Variable at line=17, column=6, length=3, text=`res` 0,6,4,8,0, # Variable at line=17, column=12, length=4, text=`self` 0,5,7,8,0, # Variable at line=17, column=17, length=7, text=`eval_1d` 0,8,1,8,0, # Variable at line=17, column=25, length=1, text=`x` 1,4,3,15,0, # Keyword at line=18, column=4, length=3, text=`end` 0,4,8,15,0, # Keyword at line=18, column=8, length=8, text=`function` 0,9,13,8,0, # Variable at line=18, column=17, length=13, text=`eval_1d_prime` 1,0,3,15,0, # Keyword at line=19, column=0, length=3, text=`end` 0,4,6,15,0, # Keyword at line=19, column=4, length=6, text=`module` 0,7,21,8,0, # Variable at line=19, column=11, length=21, text=`module_function_call1` ] assert doc.semantic_highlights is not None assert doc.semantic_highlights.data == expected_highlights def test_code_completion(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None line, column = 18, -1 doc.cursor = line, column doc.newline() doc.write("self") doc.complete() expected_completions = [ CompletionItem( label="self", kind=CompletionItemKind.Variable ) ] assert doc.completions is not None assert isinstance(doc.completions, list) for completion in doc.completions: expected_completions.remove(completion) assert len(expected_completions) == 0 doc.write("%") doc.complete() expected_completions = [ CompletionItem( label="module_function_call1", kind=CompletionItemKind.Module, ), CompletionItem( label="eval_1d", kind=CompletionItemKind.Function, ), CompletionItem( label="res", kind=CompletionItemKind.Variable, ), CompletionItem( label="self", kind=CompletionItemKind.Variable, ), CompletionItem( label="x", kind=CompletionItemKind.Variable, ), CompletionItem( label="eval_1d_prime", kind=CompletionItemKind.Function, ), CompletionItem( label="1_softmax_eval_1d", kind=CompletionItemKind.Function, ), CompletionItem( label="softmax", kind=CompletionItemKind.Struct, ), ] assert doc.completions is not None assert isinstance(doc.completions, list) for completion in doc.completions: expected_completions.remove(completion) assert len(expected_completions) == 0 def test_whole_document_formatting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.format() assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", "", "contains", "", "procedure :: eval_1d", " end type softmax", "", "contains", "", " pure function eval_1d(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function eval_1d", "", "", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " res = self%eval_1d(x)", " end function eval_1d_prime", "", "end module module_function_call1", "" ]) def test_partial_document_formatting(client: LFortranLspTestClient) -> None: path = Path(__file__).absolute().parent.parent.parent / "function_call1.f90" doc = client.open_document("fortran", path) assert client.await_validation(doc.uri, doc.version) is not None doc.select(14, 5, 19, 31) doc.format_range() assert doc.text == "\n".join([ "module module_function_call1", " type :: softmax", " contains", " procedure :: eval_1d", " end type softmax", " contains", " ", " pure function eval_1d(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " end function eval_1d", " ", " pure function eval_1d_prime(self, x) result(res)", " class(softmax), intent(in) :: self", " real, intent(in) :: x(:)", " real :: res(size(x))", " res = self%eval_1d(x)", " end function eval_1d_prime", "", "end module module_function_call1", "" ]) def test_telemetry_event(client: LFortranLspTestClient) -> None: telemetry: JsonArray = client.get_telemetry() if not any(filter(lambda event: event["key"] == "processUsage", telemetry)): pytest.skip("ProcessUsage is not supported on this platform") lfortran-lfortran-2f73434/tests/server/tests/test_document_manipulation.py0000664000175000017500000002430515141516316027460 0ustar alastairalastairimport os from tempfile import NamedTemporaryFile from lsprotocol.types import (TextDocumentContentChangeEvent_Type1, TextDocumentDidChangeNotification, TextDocumentDidOpenNotification, WorkspaceDidRenameFilesNotification) from llanguage_test_client.lsp_test_client import OutgoingEvent from lfortran_language_server.lfortran_lsp_test_client import LFortranLspTestClient def test_document_manipulation(client: LFortranLspTestClient): with NamedTemporaryFile( prefix="test_document_manipulation-", suffix=".f90", delete=True ) as tmp_file_1: with NamedTemporaryFile( prefix="test_document_manipulation-", suffix=".f90", delete=True ) as tmp_file_2: doc = client.new_document("fortran") doc.write("module module_function_call1\n") doc.write("end module module_function_call1\n") doc.save(tmp_file_1.name) assert os.path.exists(tmp_file_1.name) def sent_text_document_did_open(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidOpenNotification): notification = event.data return notification.params.text_document.uri == doc.uri return False assert client.has_outgoing_event(sent_text_document_did_open) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.write("foo") doc.save() def sent_text_document_did_write_foo(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 5 \ and content_change.text == "foo" return False assert client.has_outgoing_event(sent_text_document_did_write_foo) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulfooe module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.replace("bar") doc.save() def sent_text_document_did_replace_foo_with_bar( event: OutgoingEvent ) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 8 \ and content_change.text == "bar" return False assert client.has_outgoing_event( sent_text_document_did_replace_foo_with_bar ) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulbare module_function_call1", "end module module_function_call1", ]) + "\n" doc.backspace() doc.save() def sent_text_document_did_backspace_r(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 7 \ and end.line == 0 \ and end.character == 8 \ and content_change.text == "" return False assert client.has_outgoing_event(sent_text_document_did_backspace_r) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "modulbae module_function_call1", "end module module_function_call1", ]) + "\n" doc.cursor = 1,6 doc.delete(2) doc.save() def sent_text_document_did_delete_ba(event: OutgoingEvent) -> bool: if isinstance(event.data, TextDocumentDidChangeNotification): notification = event.data params = notification.params if params.text_document.uri == doc.uri: content_changes = params.content_changes if len(content_changes) == 1: content_change = content_changes[0] if isinstance(content_change, TextDocumentContentChangeEvent_Type1): range = content_change.range start = range.start end = range.end return start.line == 0 \ and start.character == 5 \ and end.line == 0 \ and end.character == 7 \ and content_change.text == "" return False assert client.has_outgoing_event(sent_text_document_did_delete_ba) assert client.await_validation(doc.uri, doc.version) is not None rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_1.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.move(tmp_file_2.name) def sent_workspace_did_rename_file(event: OutgoingEvent) -> bool: if isinstance(event.data, WorkspaceDidRenameFilesNotification): notification = event.data for record in notification.params.files: if record.old_uri == f"file://{tmp_file_1.name}" \ and record.new_uri == f"file://{tmp_file_2.name}": return True return False assert client.has_outgoing_event(sent_workspace_did_rename_file) assert not os.path.exists(tmp_file_1.name) open(tmp_file_1.name, "w").close() # ensure it exists during clean-up assert os.path.exists(tmp_file_2.name) rdoc = client.get_remote_document(doc.uri) assert doc.uri == rdoc["uri"] assert doc.version == rdoc["version"] with open(tmp_file_2.name) as f: assert doc.text == rdoc["text"] == f.read() == "\n".join([ "module module_function_call1", "end module module_function_call1", ]) + "\n" doc.remove() assert not os.path.exists(tmp_file_2.name) open(tmp_file_2.name, "w").close() # ensure it exists during clean-up lfortran-lfortran-2f73434/tests/server/tests/__init__.py0000664000175000017500000000000015141516316023544 0ustar alastairalastairlfortran-lfortran-2f73434/tests/server/function_call1.f900000664000175000017500000000000015141516316023512 0ustar alastairalastairlfortran-lfortran-2f73434/tests/server/src/0000775000175000017500000000000015141516316021072 5ustar alastairalastairlfortran-lfortran-2f73434/tests/server/src/lfortran_language_server/0000775000175000017500000000000015141516316026152 5ustar alastairalastairlfortran-lfortran-2f73434/tests/server/src/lfortran_language_server/lfortran_lsp_test_client.py0000664000175000017500000004161115141516316033631 0ustar alastairalastairfrom pathlib import Path from typing import Any, Dict, List, Optional, Sequence, Union from lsprotocol.types import ( CompletionClientCapabilities, CompletionClientCapabilitiesCompletionItemType, CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType, CompletionClientCapabilitiesCompletionItemTypeResolveSupportType, CompletionClientCapabilitiesCompletionItemTypeTagSupportType, CompletionItemTag, DefinitionClientCapabilities, DefinitionParams, DidChangeTextDocumentParams, DocumentFormattingClientCapabilities, DocumentHighlightClientCapabilities, DocumentRangeFormattingClientCapabilities, DocumentSymbolClientCapabilities, HoverClientCapabilities, InitializeParams, InsertTextMode, Location, LocationLink, MarkupKind, Position, RenameClientCapabilities, RenameParams, SemanticTokensClientCapabilities, SemanticTokensClientCapabilitiesRequestsType, TextDocumentCompletionResponse, TextDocumentContentChangeEvent, TextDocumentContentChangeEvent_Type1, TextDocumentContentChangeEvent_Type2, TextDocumentDefinitionRequest, TextDocumentDefinitionResponse, TextDocumentDocumentHighlightResponse, TextDocumentDocumentSymbolResponse, TextDocumentFormattingResponse, TextDocumentHoverResponse, TextDocumentIdentifier, TextDocumentPublishDiagnosticsNotification, TextDocumentRangeFormattingResponse, TextDocumentRenameRequest, TextDocumentRenameResponse, TextDocumentSemanticTokensFullResponse, TextDocumentSyncKind, TokenFormat, VersionedTextDocumentIdentifier, WorkspaceEdit) from llanguage_test_client.json_rpc import JsonArray, JsonObject from llanguage_test_client.lsp_test_client import LspTestClient from llanguage_test_client.lsp_text_document import LspTextDocument class LFortranLspTestClient(LspTestClient): def __init__( self, server_path: Path, server_params: List[str], workspace_path: Optional[Path], timeout_ms: float, config: Dict[str, Any], client_log_path: str, stdout_log_path: str, stdin_log_path: str ) -> None: super().__init__( server_path, server_params, workspace_path, timeout_ms, config, client_log_path, stdout_log_path, stdin_log_path ) def await_validation(self, uri: str, version: int) -> Any: def is_validation(message: Any) -> bool: if message.get("method", None) == "textDocument/publishDiagnostics": params = message["params"] return params["uri"] == uri \ and params.get("version", None) == version return False event, _ = self.find_incoming_event(lambda event: is_validation(event.data)) if event is not None: return event.data while not self.stop.is_set(): message = self.receive_message() if is_validation(message): return message return None def dispatch_method(self, message: JsonObject) -> None: match message["method"]: case "textDocument/publishDiagnostics": notification = self.converter.structure( message, TextDocumentPublishDiagnosticsNotification ) self.receive_text_document_publish_diagnostics(notification) self.respond_to_notification() case _: super().dispatch_method(message) def initialize_params(self) -> InitializeParams: params = super().initialize_params() text_document = params.capabilities.text_document if text_document is not None: text_document.completion = CompletionClientCapabilities( dynamic_registration=True, completion_item=CompletionClientCapabilitiesCompletionItemType( snippet_support=False, commit_characters_support=False, documentation_format=[ MarkupKind.PlainText, MarkupKind.Markdown, ], deprecated_support=True, preselect_support=False, tag_support=CompletionClientCapabilitiesCompletionItemTypeTagSupportType( value_set=[ CompletionItemTag.Deprecated, ], ), insert_replace_support=False, resolve_support=CompletionClientCapabilitiesCompletionItemTypeResolveSupportType( properties=[], ), insert_text_mode_support=CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType( value_set=[ InsertTextMode.AsIs, InsertTextMode.AdjustIndentation, ], ), label_details_support=True, ), context_support=True, ) text_document.hover = HoverClientCapabilities( content_format=[ MarkupKind.PlainText, MarkupKind.Markdown, ], ) text_document.definition = DefinitionClientCapabilities() text_document.rename = RenameClientCapabilities() text_document.document_highlight = DocumentHighlightClientCapabilities() text_document.document_symbol = DocumentSymbolClientCapabilities( hierarchical_document_symbol_support=True, ) text_document.semantic_tokens = SemanticTokensClientCapabilities( requests=SemanticTokensClientCapabilitiesRequestsType( full=True, ), token_types=[ "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator", ], token_modifiers=[ "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", ], formats=[TokenFormat.Relative], ) text_document.formatting = DocumentFormattingClientCapabilities() text_document.range_formatting = DocumentRangeFormattingClientCapabilities() return params def receive_text_document_publish_diagnostics( self, notification: TextDocumentPublishDiagnosticsNotification ) -> None: pass def server_supports_text_document_definition(self) -> bool: # NOTE: This returns True if `definition_provider` is True or an instance # of `DefinitionOptions` return bool(self.server_capabilities.definition_provider) def send_text_document_definition(self, params: DefinitionParams) -> int: request_id = self.next_request_id() request = TextDocumentDefinitionRequest(request_id, params) self.send_request(request_id, request, self.receive_text_document_definition) return request_id def receive_text_document_definition( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDefinitionResponse ) loc: Optional[Union[Location, LocationLink]] = None match response.result: case Location(): loc = response.result case _ if isinstance(response.result, Sequence) \ and not isinstance(response.result, str) \ and len(response.result) > 0: loc = response.result[0] doc: Optional[LspTextDocument] = None pos: Optional[Position] = None match loc: case Location(): doc = self.documents_by_uri.get(loc.uri, None) pos = loc.range.start case LocationLink(): doc = self.documents_by_uri.get(loc.target_uri, None) pos = loc.target_range.start if doc is not None and pos is not None: self.active_document = doc doc.cursor = (pos.line + 1, pos.character + 1) def goto_definition(self, uri: str, line: int, column: int) -> None: if self.server_supports_text_document_definition(): params = DefinitionParams( text_document=TextDocumentIdentifier( uri=uri, ), position=Position( line=line, character=column ), ) request_id = self.send_text_document_definition(params) self.await_response(request_id) def build_custom_request( self, method: str, request_id: int, params: Optional[Union[JsonObject, JsonArray]] = None ) -> JsonObject: request = { "jsonrpc": "2.0", "method": method, "id": request_id, } if params is not None: request["params"] = params return request def send_document(self, params: JsonObject) -> int: request_id = self.next_request_id() request = self.build_custom_request("$/document", request_id, params) self.send_request(request_id, request, self.receive_document) return request_id def receive_document( self, request: Any, message: JsonObject ) -> None: pass def get_remote_document(self, uri: str) -> JsonObject: request_id = self.send_document({ "uri": uri, }) response = self.await_response(request_id) return response["result"] def server_supports_text_document_rename(self) -> bool: return bool(self.server_capabilities.rename_provider) def send_text_document_rename(self, params: RenameParams) -> int: request_id = self.next_request_id() request = TextDocumentRenameRequest(request_id, params) self.send_request(request_id, request, self.receive_text_document_rename) return request_id def apply(self, workspace_edit: WorkspaceEdit) -> None: changes = workspace_edit.changes if changes is not None: for uri, text_edits in changes.items(): document = self.get_document("fortran", uri) document.apply(text_edits) if self.server_supports_text_document_did_change(): version = document.bump_version() content_changes: List[TextDocumentContentChangeEvent] if self.server_supports_text_document_sync_kind( TextDocumentSyncKind.Incremental ): content_changes = [ TextDocumentContentChangeEvent_Type1( range=text_edit.range, text=text_edit.new_text ) for text_edit in text_edits ] else: content_changes = [ TextDocumentContentChangeEvent_Type2( text=document.text ) ] params = DidChangeTextDocumentParams( text_document=VersionedTextDocumentIdentifier( version=version, uri=uri ), content_changes=content_changes ) self.send_text_document_did_change(params) document.signal_change() def receive_text_document_rename( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentRenameResponse ) if response.result is not None: self.apply(response.result) def rename(self, uri: str, line: int, column: int, new_name: str) -> None: if self.server_supports_text_document_rename(): params = RenameParams( text_document=TextDocumentIdentifier( uri=uri, ), position=Position( line=line, character=column, ), new_name=new_name, ) request_id = self.send_text_document_rename(params) self.await_response(request_id) def receive_text_document_document_highlight( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDocumentHighlightResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.symbol_highlights = response.result def receive_text_document_hover( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentHoverResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.preview = response.result def receive_text_document_document_symbol( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentDocumentSymbolResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.symbols = response.result def receive_text_document_semantic_tokens_full( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentSemanticTokensFullResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.semantic_highlights = response.result def receive_text_document_completion( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentCompletionResponse ) uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.completions = response.result def receive_text_document_formatting( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentFormattingResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.apply(response.result) def receive_text_document_range_formatting( self, request: Any, message: JsonObject ) -> None: response = self.converter.structure( message, TextDocumentRangeFormattingResponse ) if response.result is not None: uri = request.params.text_document.uri doc = self.get_document("fortran", uri) doc.apply(response.result) def send_telemetry(self) -> int: request_id = self.next_request_id() request = self.build_custom_request("$/telemetry", request_id) self.send_request(request_id, request, self.receive_telemetry) return request_id def receive_telemetry( self, request: Any, message: JsonObject ) -> None: pass def get_telemetry(self) -> Any: request_id = self.send_telemetry() response = self.await_response(request_id) return response["result"] lfortran-lfortran-2f73434/tests/server/src/lfortran_language_server/__init__.py0000664000175000017500000000000015141516316030251 0ustar alastairalastairlfortran-lfortran-2f73434/tests/char1.f900000664000175000017500000000012715141516316020313 0ustar alastairalastairprogram char1 character(len=1, kind=1), parameter :: c_null_char = char(0) end program lfortran-lfortran-2f73434/tests/implicit_typing4.f900000664000175000017500000000022115141516316022600 0ustar alastairalastairFUNCTION DNAN() DOUBLE PRECISION DNAN DNAN = 0.0 END SUBROUTINE CLQMN() IMPLICIT COMPLEX*16 (C,Z) IF (DIMAG(Z) == 0.0) LS=1 END lfortran-lfortran-2f73434/tests/logical_to_int_cast_fortran_codegen.f900000664000175000017500000000052115141516316026532 0ustar alastairalastairprogram ImplicitLogicalToIntCastExample implicit none logical :: logicalValue integer :: integerValue ! Assign a logical value logicalValue = .TRUE. ! Perform an implicit logical to integer cast integerValue = logicalValue print *, integerValue end program ImplicitLogicalToIntCastExample lfortran-lfortran-2f73434/tests/array6.f900000664000175000017500000000036315141516316020523 0ustar alastairalastairprogram array6 implicit none contains subroutine t(n, a, b, c, d, e) integer, intent(in) :: n real :: a(*), b(3:*) real, dimension(3,n,*) :: c real, dimension(3,n,4:*) :: d real :: e(n:*) end subroutine end program lfortran-lfortran-2f73434/tests/sync1.f900000664000175000017500000000045615141516316020357 0ustar alastairalastairprogram sync1 implicit none integer :: iam real :: x[*] iam = this_image() if (iam == 1) x = 1.0 sync memory call external_sync () syncmemory(stat=status) if (iam == 2) write (*,*) x[1] if (this_image() == 1) then sync images(*) else syncimages(1, stat=status) end if end program sync1 lfortran-lfortran-2f73434/tests/return1.f900000664000175000017500000000032615141516316020716 0ustar alastairalastairsubroutine example (s) character s* 32 write (*,*) s return end ! Syntax check only subroutine example1 (i, a, b, c) if (i .eq. a) return 1 if (i .eq. b) return 2 if (i .eq. c) return 3 end lfortran-lfortran-2f73434/tests/implicit4.f900000664000175000017500000000023615141516316021214 0ustar alastairalastairinteger function idd_random_transf(x,y,w) implicit real *8 (a-h,o-z) dimension x(*),y(*),w(*) ialbetas=w(1) iixs=w(2) nsteps=w(3) iww=w(4) n=w(5) end functionlfortran-lfortran-2f73434/tests/coarrays_02.f900000664000175000017500000000212215141516316021436 0ustar alastairalastairprogram coarrays_02 ! Source https://j3-fortran.org/doc/year/18/18-007r1.pdf Page no - 541 use, intrinsic :: iso_fortran_env integer, allocatable :: node (:) ! tree nodes that this image handles. integer, allocatable :: nc (:) ! node(i) has nc(i) children. integer, allocatable :: parent (:), sub (:) ! the parent of node (i) is node (sub (i)) [parent (i)]. type (event_type), allocatable :: done (:) [:] integer :: i, j, status ! set up the tree, including allocation of all arrays. do i = 1, size (node) ! wait for children to complete if (nc (i) > 0) then event wait (done (i), until_count=nc (i), stat=status) if (status/=0) exit end if ! process node, using data from children. if (parent (i)>0) then ! node is not the root. ! place result on image parent (i) for node node (sub) [parent (i)] ! tell parent (i) that this has been done. event post (done (sub (i)) [parent (i)], stat=status) if (status/=0) exit end if end do end program lfortran-lfortran-2f73434/tests/implicit5.f900000664000175000017500000000023715141516316021216 0ustar alastairalastairinteger function CPDSA(n,z,cdn) IMPLICIT DOUBLE PRECISION (A-B,D-H,O-Y) EPS=1.0D-15 PI=3.141592653589793D0 CA0=EXP(-.25D0*Z*Z) VA0=0.5D0*(1.0D0-N) end functionlfortran-lfortran-2f73434/tests/if2.f900000664000175000017500000000053115141516316017774 0ustar alastairalastairprogram expr2 implicit none integer :: x time = 12 if (time < 10) then ! Comment 1 print *, "Good morning" else if (time < 20) then ! Comment 2 print *, "Good day" else ! Comment 3 print *, "Good evening" end if ! Comment 4 end program lfortran-lfortran-2f73434/tests/expr4.f900000664000175000017500000000005215141516316020354 0ustar alastairalastair5. 5.+3. (5.+3.)*2. 5.+3.*2. 5.-3. 4.**3. lfortran-lfortran-2f73434/tests/intrinsic_implicit.f900000664000175000017500000000034615141516316023214 0ustar alastairalastair! Test combination of implicit-interface and intrinsic functions ! Check if intrinsic function is used when it is declared as an integer subroutine fppasu() integer max0 a = max0(1,2) b = max0(1,2/2,1) end lfortran-lfortran-2f73434/tests/bits1.f900000664000175000017500000000020015141516316020327 0ustar alastairalastairprogram bits1 implicit none integer(8) :: arr2(3) = [1042890_8, 20_8, 30_8] print *, ibits(arr2, 2, 2) end program lfortran-lfortran-2f73434/tests/dependency_test_03_module.f900000664000175000017500000000046415141516316024345 0ustar alastairalastairmodule m_cli2 implicit none contains subroutine check_commandline() call default_help() contains subroutine default_help() integer :: ilength call get_command_argument(number=0, length=ilength) end subroutine default_help end subroutine check_commandline end module m_cli2 lfortran-lfortran-2f73434/tests/preprocessor18.f900000664000175000017500000000023415141516316022213 0ustar alastairalastairprogram preprocessor18 #if (defined __flang__ && __flang_major__ <= 19) integer,parameter :: x = 0 #else integer,parameter :: y = 0 #endif end programlfortran-lfortran-2f73434/tests/allow_implicit_interface4.f900000664000175000017500000000037415141516316024435 0ustar alastairalastairsubroutine dqc25c(f) double precision f call dqk15w(f) print *, f(hlgth) end function func(f) double precision c call sub2(c) print *, c(d) end function program main double precision a call sub(a) print *, a(b) end program lfortran-lfortran-2f73434/tests/write4.f900000664000175000017500000000044615141516316020537 0ustar alastairalastairprogram write4 implicit none write (*, "(a)", advance="no") "hi, " write (*, "(a)") "how are you?" write (*, "(a)", advance="yes") "I " write (*, "(a)", advance="yes") "am" write (*, "(a)", advance="no") "doing " write (*, "(a)", advance="yes") "good" end program lfortran-lfortran-2f73434/tests/print1.f900000664000175000017500000000023115141516316020526 0ustar alastairalastairprogram print1 implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program lfortran-lfortran-2f73434/tests/comments1.f900000664000175000017500000000025415141516316021224 0ustar alastairalastairprogram comments1 ! Next line comment 0 print *, "1" ! end of line comment 1 ! Next line comment 1 print *, "2" ! end of line comment 2 ! Next line comment 2 end program lfortran-lfortran-2f73434/tests/continue_body_if_loop.f0000664000175000017500000000034715141516316023520 0ustar alastairalastair REAL U, S DIMENSION U(100) S = 0.0 INTEGER J DO 1 J = 1, 100 S = S + U(J) IF ( S .GE. 1000000 ) GO TO 2 1 CONTINUE STOP 2 CONTINUE END lfortran-lfortran-2f73434/tests/write3.f900000664000175000017500000000014315141516316020530 0ustar alastairalastairprogram main integer nwrite data nwrite/6/ write (nwrite,*) "Hello World" end program lfortran-lfortran-2f73434/tests/common1.f900000664000175000017500000000040015141516316020660 0ustar alastairalastairprogram common1 implicit real(a-z) real A, B common /sample/ A, B common /c/ c, /b/ d, e, f, /c/ g, h, i(5) common x, y, z(10) A = 10 B = 20 call pass() stop end program subroutine pass() real A, B common /sample/ A, B print *, A, B return end subroutine lfortran-lfortran-2f73434/tests/substring.f900000664000175000017500000000027315141516316021337 0ustar alastairalastairprogram substring implicit none character(5) :: str character(5), parameter :: s = "Hello World"(7:11) str = "12345"(2:4) print *, str print *, s print *, "SubString"(4:9) end program lfortran-lfortran-2f73434/tests/modules2_module_b_base.f900000664000175000017500000000107715141516316023714 0ustar alastairalastairmodule tomlf_structure_base implicit none public :: toml_structure, toml_ordered type, abstract :: toml_structure contains procedure(destroy), deferred :: destroy end type toml_structure type, abstract, extends(toml_structure) :: toml_ordered end type toml_ordered abstract interface subroutine destroy(self) use tomlf_type_value, only: toml_value import :: toml_structure class(toml_structure), intent(inout), target :: self end subroutine destroy end interface end module tomlf_structure_base lfortran-lfortran-2f73434/tests/modules_02.f900000664000175000017500000000576215141516316021300 0ustar alastairalastairmodule random use types, only: dp use utils, only: stop_error implicit none private public randn, rand_gamma interface randn module procedure randn_scalar module procedure randn_vector module procedure randn_matrix module procedure randn_vector_n end interface interface rand_gamma module procedure rand_gamma_scalar module procedure rand_gamma_vector module procedure rand_gamma_matrix module procedure rand_gamma_vector_n end interface contains subroutine randn_scalar(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for Generating ! Normal Variables. SIAM Review, 6(3), 260-264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u-1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) exit end do u = u * sqrt(-2*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine subroutine randn_vector_n(n, x) integer, intent(in) :: n real(dp), intent(out) :: x(n) integer :: i do i = 1, size(x) call randn(x(i)) end do end subroutine subroutine randn_vector(x) real(dp), intent(out) :: x(:) call randn_vector_n(size(x), x) end subroutine subroutine randn_matrix(x) real(dp), intent(out) :: x(:, :) call randn_vector_n(size(x), x) end subroutine subroutine rand_gamma0(a, first, fn_val) ! Returns a psuedorandom scalar drawn from the gamma distribution. ! ! The shape parameter a >= 1. ! ! [1] Marsaglia, G., & Tsang, W. W. (2000). A Simple Method for Generating ! Gamma Variables. ACM Transactions on Mathematical Software (TOMS), 26(3), ! 363-372. real(dp), intent(in) :: a logical, intent(in) :: first real(dp), intent(out) :: fn_val real(dp), save :: c, d real(dp) :: U, v, x if (a < 1) call stop_error("Shape parameter must be >= 1") if (first) then d = a - 1._dp/3 c = 1/sqrt(9*d) end if do do call randn(x) v = (1 + c*x)**3 if (v > 0) exit end do call random_number(U) ! Note: the number 0.0331 below is exact, see [1]. if (U < 1 - 0.0331_dp*x**4) then fn_val = d*v exit else if (log(U) < x**2/2 + d*(1 - v + log(v))) then fn_val = d*v exit end if end do end subroutine subroutine rand_gamma_scalar(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x call rand_gamma0(a, .true., x) end subroutine subroutine rand_gamma_vector_n(a, n, x) real(dp), intent(in) :: a integer, intent(in) :: n real(dp), intent(out) :: x(n) integer :: i call rand_gamma0(a, .true., x(1)) do i = 2, size(x) call rand_gamma0(a, .false., x(i)) end do end subroutine subroutine rand_gamma_vector(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x(:) call rand_gamma_vector_n(a, size(x), x) end subroutine subroutine rand_gamma_matrix(a, x) real(dp), intent(in) :: a real(dp), intent(out) :: x(:, :) call rand_gamma_vector_n(a, size(x), x) end subroutine end module lfortran-lfortran-2f73434/tests/preprocessor12.f900000664000175000017500000000101315141516316022201 0ustar alastairalastair#include "assert.fpp" program preprocessor12 ! Test that a typical ASSERT macro works implicit none ASSERT(.true.) ASSERT(5 > 3) ASSERT(5+3*8 > 3) ASSERT(fn(3, 5)) ASSERT(5 < 3) contains logical function fn(a, b) integer, intent(in) :: a, b fn = a < b end function subroutine f90_assert(file, line) character(len=*), intent(in) :: file integer, intent(in) :: line print *, "Assertion failed at " // file // ":", line error stop end subroutine f90_assert end program lfortran-lfortran-2f73434/tests/expr6.f900000664000175000017500000000001215141516316020352 0ustar alastairalastair5 + 3 5.3 lfortran-lfortran-2f73434/tests/use_statement.f900000664000175000017500000000244115141516316022176 0ustar alastairalastairprogram use_statement ! AST ! Syntax check only use, intrinsic :: example, only: name=>rename, NAME=>RENAME use, intrinsic :: example, only: operator (**) use, intrinsic :: example, only: operator (.not.) use, intrinsic :: example, only: operator (.in.) use, intrinsic :: example, only: operator (.plus.) => operator (.add.) use, non_intrinsic :: example USE, NON_INTRINSIC :: EXAMPLE use, non_intrinsic :: example, only: assignment(=) use, non_intrinsic :: example, only: operator (==) use, non_intrinsic :: example, only: operator (.or.) use, non_intrinsic :: example, only: operator (.definedoperator.) use :: example, only: operator (+) use :: example, only: sample use :: example, only: sample=>rename use example, only: operator (*) use example, only: operator ( / ) use example, only: operator (/) use example, only: operator (/=) use example, only: operator (>) use example, only: operator (<=) use example, only: operator (.and.) use example, only: operator (.eqv.) use example, only: operator (.dot.) use example, only: write(formatted) use example, only: read(unformatted) use example, only: use example, operator (.localDefop.) => operator (.useDefop.), a => b end lfortran-lfortran-2f73434/tests/implicit2.f900000664000175000017500000000024215141516316021207 0ustar alastairalastairinteger function a() implicit real (a,b,c,d) implicit integer (e,f,g) implicit real (h-l, r-y) implicit complex (x-z) implicit double precision (m-q) end functionlfortran-lfortran-2f73434/tests/program3.f900000664000175000017500000000066315141516316021054 0ustar alastairalastairprogram program3 real :: x, y, z x = 5.0 y = 2.0 z = x*y print *, "10.0 ==", z z = func1(x, y) print *, "49.0 ==", z z = func2(x, y) print *, "10.0 ==", z contains function func1(a, b) result(c) real, intent(in) :: a, b real :: c c = a + b c = func2(c, c) end function function func2(a, b) result(c) real, intent(in) :: a, b real :: c c = a * b ! c = func1(c, c) end function end program program3lfortran-lfortran-2f73434/tests/invalidInput_integer.txt0000664000175000017500000000002315141516316023714 0ustar alastairalastairxasxacscsd123s15x6 lfortran-lfortran-2f73434/tests/do4.f900000664000175000017500000000042215141516316020001 0ustar alastairalastairprogram do4 implicit none integer :: i, j, k j = 0 do 15 i = 1, 5 j = j + i 15 continue j = 0 do 20 i = 1, 6, 2 j = j + i 20 continue k = 0 do 30 i = 1, 5 do 35 j = 1, 5 k = k + 1 31 continue 35 continue 33 continue 30 continue 40 continue end program lfortran-lfortran-2f73434/tests/forall1.f900000664000175000017500000000203615141516316020656 0ustar alastairalastairprogram forall1 implicit none ! Only for Syntax check !>>>>>>>>>>>>> Single line statments <<<<<<<<<<<<<< FORALL (i=1:n) A(i,i) = B(i) forall (i=1:n:3, j=1:n:5) A(i,j) = SIN(A(j,i)) forall (i=1:n, j=1:n, i/=j) A(i,j) = REAL(i+j) forall (i=1:n, j=1:m, A(i,j).NE.0) & A(i,j) = 1/A(i,j) forall (i=1:1000, j=1:1000, i /= j) A(i,j) = A(j,i) !>>>>>>>>>>>>> Multipe line statements <<<<<<<<<<<<<< forall (j = 1:n) shared(i) local(x) default(none) forall (i=1:j) A(i,j) = B(i) end forall forall (i = 1:N) reduce(*: s) s = s + a(i) end forall FORALL(i = 3:N + 1, j = 3:N + 1) C(i, j) = C(i, j + 2) + C(i, j - 2) D(i, j) = C(i, j) + C(i + 2, j) + C(i - 2, j) end FORALL forall (x=1:100, J(x)>0) where (I(x,:)<0) I(x,:)=0 elsewhere I(x,:)=1 end where end forall outer: forall (i=1:100) inner: forall (j=1:100, i.NE.j) A(i,j) = A(j,i) end forall inner end forall outer end program lfortran-lfortran-2f73434/tests/implicit_typing1.f900000664000175000017500000000015615141516316022604 0ustar alastairalastairprogram X L = 3 a = 3 integerx = 12 datap = 1.0 realr = 1.5 print *, L, a, integerx, datap, realr end program lfortran-lfortran-2f73434/tests/wasm_i64.f900000664000175000017500000000135415141516316020751 0ustar alastairalastairprogram wasm1 implicit none print *, a_sqr_i64(1000000_8) print *, add_i64(1000000000000_8, 1000000000000_8) print *, test_i64() contains function a_sqr_i64(x) result(r) implicit none integer(8), intent(in):: x integer(8) :: r r = x * x return end function function add_i64(x, y) result(r) implicit none integer(8), intent(in):: x, y integer(8) :: r r = x + y return end function function test_i64() result(r) implicit none integer(8) :: x64, y64 integer(8) :: r x64 = 1000000000000_8 y64 = 2000000000000_8 r = add_i64(x64, y64) return end function end program lfortran-lfortran-2f73434/tests/int_to_complex_cast_in_comparison.f900000664000175000017500000000046115141516316026273 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) contains elemental complex(dp) function dabs(x) result(r) complex(dp), intent(in) :: x if (x /= 0) then r = x else r = 0 - x end if end function dabs end program lfortran-lfortran-2f73434/tests/add.c0000664000175000017500000000010015141516316017660 0ustar alastairalastair#include int add(int a, int b) { return a + b; } lfortran-lfortran-2f73434/tests/fixed_form_simple_continue.f0000664000175000017500000000003215141516316024536 0ustar alastairalastair continue end lfortran-lfortran-2f73434/tests/program1.f900000664000175000017500000000012615141516316021044 0ustar alastairalastairprogram program1 implicit none integer :: i i = 5 print *, i print *, i+1 end program lfortran-lfortran-2f73434/tests/fixed_form1.f0000664000175000017500000001437215141516316021356 0ustar alastairalastair subroutine dqawse(f,a,b,alfa,beta,integr,epsabs,epsrel,limit, * result,abserr,neval,ier,alist,blist,rlist,elist,iord,last) c***begin prologue dqawse c***date written 800101 (yymmdd) c***revision date 830518 (yymmdd) c***category no. h2a2a1 c***keywords automatic integrator, special-purpose, c algebraico-logarithmic end point singularities, c clenshaw-curtis method c***author piessens,robert,appl. math. & progr. div. - k.u.leuven c de doncker,elise,appl. math. & progr. div. - k.u.leuven c***purpose the routine calculates an approximation result to a given c definite integral i = integral of f*w over (a,b), c (where w shows a singular behaviour at the end points, c see parameter integr). c hopefully satisfying following claim for accuracy c abs(i-result).le.max(epsabs,epsrel*abs(i)). c***description c c integration of functions having algebraico-logarithmic c end point singularities c standard fortran subroutine c double precision version c***references (none) c***routines called d1mach,dqc25s,dqmomo,dqpsrt c***end prologue dqawse c double precision a,abserr,alfa,alist,area,area1,area12,area2,a1, * a2,b,beta,blist,b1,b2,centre,dabs,dmax1,d1mach,elist,epmach, * epsabs,epsrel,errbnd,errmax,error1,erro12,error2,errsum,f, * resas1,resas2,result,rg,rh,ri,rj,rlist,uflow integer ier,integr,iord,iroff1,iroff2,k,last,limit,maxerr,nev, * neval,nrmax c external f c dimension alist(limit),blist(limit),rlist(limit),elist(limit), * iord(limit),ri(25),rj(25),rh(25),rg(25) c c list of major variables c ----------------------- c c c***first executable statement dqawse epmach = d1mach(4) uflow = d1mach(1) c c test on validity of parameters c ------------------------------ c ier = 6 neval = 0 last = 0 rlist(1) = 0.0d+00 elist(1) = 0.0d+00 iord(1) = 0 result = 0.0d+00 abserr = 0.0d+00 if(b.le.a.or.(epsabs.eq.0.0d+00.and. * epsrel.lt.dmax1(0.5d+02*epmach,0.5d-28)).or.alfa.le.(-0.1d+01) * .or.beta.le.(-0.1d+01).or.integr.lt.1.or.integr.gt.4.or. * limit.lt.2) go to 999 ier = 0 c c compute the modified chebyshev moments. c call dqmomo(alfa,beta,ri,rj,rg,rh,integr) c c integrate over the intervals (a,(a+b)/2) and ((a+b)/2,b). c centre = 0.5d+00*(b+a) call dqc25s(f,a,b,a,centre,alfa,beta,ri,rj,rg,rh,area1, * error1,resas1,integr,nev) neval = nev call dqc25s(f,a,b,centre,b,alfa,beta,ri,rj,rg,rh,area2, * error2,resas2,integr,nev) last = 2 neval = neval+nev result = area1+area2 abserr = error1+error2 c c test on accuracy. c errbnd = dmax1(epsabs,epsrel*dabs(result)) c c initialization c -------------- c if(error2.gt.error1) go to 10 alist(1) = a alist(2) = centre blist(1) = centre blist(2) = b rlist(1) = area1 rlist(2) = area2 elist(1) = error1 elist(2) = error2 go to 20 10 alist(1) = centre alist(2) = a blist(1) = b blist(2) = centre rlist(1) = area2 rlist(2) = area1 elist(1) = error2 elist(2) = error1 20 iord(1) = 1 iord(2) = 2 if(limit.eq.2) ier = 1 if(abserr.le.errbnd.or.ier.eq.1) go to 999 errmax = elist(1) maxerr = 1 nrmax = 1 area = result errsum = abserr iroff1 = 0 iroff2 = 0 c c main do-loop c ------------ c do 60 last = 3,limit c c bisect the subinterval with largest error estimate. c a1 = alist(maxerr) b1 = 0.5d+00*(alist(maxerr)+blist(maxerr)) a2 = b1 b2 = blist(maxerr) c call dqc25s(f,a,b,a1,b1,alfa,beta,ri,rj,rg,rh,area1, * error1,resas1,integr,nev) neval = neval+nev call dqc25s(f,a,b,a2,b2,alfa,beta,ri,rj,rg,rh,area2, * error2,resas2,integr,nev) neval = neval+nev c c improve previous approximations integral and error c and test for accuracy. c area12 = area1+area2 erro12 = error1+error2 errsum = errsum+erro12-errmax area = area+area12-rlist(maxerr) if(a.eq.a1.or.b.eq.b2) go to 30 if(resas1.eq.error1.or.resas2.eq.error2) go to 30 c c test for roundoff error. c if(dabs(rlist(maxerr)-area12).lt.0.1d-04*dabs(area12) * .and.erro12.ge.0.99d+00*errmax) iroff1 = iroff1+1 if(last.gt.10.and.erro12.gt.errmax) iroff2 = iroff2+1 30 rlist(maxerr) = area1 rlist(last) = area2 c c test on accuracy. c errbnd = dmax1(epsabs,epsrel*dabs(area)) if(errsum.le.errbnd) go to 35 c c set error flag in the case that the number of interval c bisections exceeds limit. c if(last.eq.limit) ier = 1 c c c set error flag in the case of roundoff error. c if(iroff1.ge.6.or.iroff2.ge.20) ier = 2 c c set error flag in the case of bad integrand behaviour c at interior points of integration range. c if(dmax1(dabs(a1),dabs(b2)).le.(0.1d+01+0.1d+03*epmach)* * (dabs(a2)+0.1d+04*uflow)) ier = 3 c c append the newly-created intervals to the list. c 35 if(error2.gt.error1) go to 40 alist(last) = a2 blist(maxerr) = b1 blist(last) = b2 elist(maxerr) = error1 elist(last) = error2 go to 50 40 alist(maxerr) = a2 alist(last) = a1 blist(last) = b1 rlist(maxerr) = area2 rlist(last) = area1 elist(maxerr) = error2 elist(last) = error1 c c call subroutine dqpsrt to maintain the descending ordering c in the list of error estimates and select the subinterval c with largest error estimate (to be bisected next). c 50 call dqpsrt(limit,last,maxerr,errmax,elist,iord,nrmax) c ***jump out of do-loop if (ier.ne.0.or.errsum.le.errbnd) go to 70 60 continue c c compute final result. c --------------------- c 70 result = 0.0d+00 do 80 k=1,last result = result+rlist(k) 80 continue abserr = errsum 999 return end lfortran-lfortran-2f73434/tests/character2.f900000664000175000017500000000026115141516316021332 0ustar alastairalastairprogram character2 implicit none CHARACTER, parameter :: char_param*3 = "App" CHARACTER :: char1*4 = "Goat" CHARACTER :: char2*4 char2 = "Balle" end program lfortran-lfortran-2f73434/tests/common3.f900000664000175000017500000000046315141516316020673 0ustar alastairalastair! AST only subroutine test implicit none real a,b,c,d common // a,b common / / a,b common a, b common a /b1/ c,d // b common a, /b1/ c,d, // b common // b(2:4) common b(:4) common b(4) common /b1/ c,d, // a,b common /b1/ c,d // a, b common /b1/ c,d / / a, b end subroutine test lfortran-lfortran-2f73434/tests/modules_07.f900000664000175000017500000000024415141516316021273 0ustar alastairalastairmodule modules_07_mod implicit none private save integer, parameter, public :: a = 5 integer, parameter :: b = 6 integer, parameter :: c = 7 public :: c end module lfortran-lfortran-2f73434/tests/builtin1.f900000664000175000017500000000076115141516316021050 0ustar alastairalastairprogram builtin_01 ! AST only tests implicit none inquire(unit=n, opened=inuse) INQUIRE (UNIT = JOAN, OPENED = LOG_01, NAMED = LOG_02, & FORM = CHAR_VAR, IOSTAT = IOS) INQUIRE (IOLENGTH = IOL) A (1:N) rewind(s) rewind s rewind 10 rewind(err=label, unit=s) rewind iunit(13) backspace (u) backspace io_unit backspace 10 BACKSPACE (10, IOSTAT = N) backspace iunit(13) END FILE K end file 5 endfile (k) endfile (10, iostat = n) endfile(unit=iout,iostat=ios,iomsg=msg) end program lfortran-lfortran-2f73434/tests/derived_types_05.f900000664000175000017500000000144415141516316022472 0ustar alastairalastairmodule tomlf_utils_convert use tomlf_datetime, only : toml_datetime, toml_date, toml_time implicit none public :: convert_raw public :: toml_raw_to_timestamp interface convert_raw module procedure :: toml_raw_to_timestamp end interface convert_raw contains function toml_raw_to_timestamp(raw, timestamp) result(stat) !> Raw value to convert character(len=*), intent(in) :: raw !> TOML datetime value type(toml_datetime), intent(out) :: timestamp !> Status of the evaluation logical :: stat integer :: err, dot_pos, first first = 1 timestamp%date = toml_date() ! read(raw(1:4), *, iostat=err) timestamp%date%year stat = err == 0 ! timestamp%time = toml_time() end function toml_raw_to_timestamp end module tomlf_utils_convert lfortran-lfortran-2f73434/tests/array8.f900000664000175000017500000000013515141516316020522 0ustar alastairalastairprogram array8 implicit none character(255) :: a(4) character b(4)*255, c(4)*255 end program lfortran-lfortran-2f73434/tests/derived_types_09.f900000664000175000017500000000014515141516316022473 0ustar alastairalastairprogram type_parsing type :: SomeType contains end type SomeType end program type_parsing lfortran-lfortran-2f73434/tests/array3.f900000664000175000017500000000014715141516316020520 0ustar alastairalastairprogram array3 implicit none real, dimension(3) :: a, b a = [1, 2, 3] b = (/ 1, 2, 3 /) end program lfortran-lfortran-2f73434/tests/kokkos_program1.f900000664000175000017500000000045715141516316022434 0ustar alastairalastairprogram kokkos_program1 implicit none contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-lfortran-2f73434/tests/write5.f900000664000175000017500000000064515141516316020541 0ustar alastairalastairprogram write5 implicit none character(10) :: adv_val = "no" character(10) :: first_name, last_name first_name = "first" last_name = "last" write (*, "(a)", advance=adv_val) "hi" write (*, "(a)") "bye" write (*, "(a)", advance="n"//"o") first_name//", " write (*, "(a)", advance="y"//"e"//"s") last_name write(*,'("Hello ")',advance='NO') write(*,'("world!")') end program lfortran-lfortran-2f73434/tests/fixedform_doloop3.f0000664000175000017500000000130115141516316022561 0ustar alastairalastair SUBROUTINE START1(N, F, L, LOUT) C C ALGORITHM AS 93.1 APPL. STATIST. (1976) VOL.25, NO.1 C C GENERATES A 1,N ANSARI-BRADLEY DISTRIBUTION IN F. C REAL F(L), ONE, TWO DATA ONE, TWO /1.0, 2.0/ LOUT = 1 + N / 2 DO 1 I = 1, LOUT 1 F(I) = TWO IF (MOD(N, 2) .EQ. 0) F(LOUT) = ONE RETURN END SUBROUTINE f(N) DO 1 I = 1, LOUT a = 1 do j = 3, n b = 2 do 4 k = 3, n c = 3 do 5 l = 3, n d = 4 5 xx = 5 e = 5 4 end do kmn = 6 end do g = 8 1 kmn(I) = TWO h = 9 END lfortran-lfortran-2f73434/tests/implicit7.f900000664000175000017500000000023015141516316021211 0ustar alastairalastairinteger function a(n,m) implicit real (n) implicit integer (m) implicit real*8 (k) integer :: X(m), Y(m) n = 5 m = 8 X = [1,2,3,4,5,6,7,8] end function lfortran-lfortran-2f73434/tests/parser/0000775000175000017500000000000015141516316020271 5ustar alastairalastairlfortran-lfortran-2f73434/tests/parser/program_without_line_02.f900000664000175000017500000000003215141516316025346 0ustar alastairalastairprint *, "OK" end program lfortran-lfortran-2f73434/tests/parser/program_without_line_05.f900000664000175000017500000000014015141516316025351 0ustar alastairalastairsubroutine x end subroutine implicit none call y end subroutine y print *, "x" end subroutine lfortran-lfortran-2f73434/tests/parser/program_without_line_07.f900000664000175000017500000000002615141516316025356 0ustar alastairalastairerror stop endprogram lfortran-lfortran-2f73434/tests/parser/enum_decl_without_start_program.f900000664000175000017500000000010515141516316027267 0ustar alastairalastair enum, bind(c) enumerator yellow end enum END program lfortran-lfortran-2f73434/tests/parser/program_without_line_03.f900000664000175000017500000000010515141516316025350 0ustar alastairalastair subroutine sub (); end subroutine; integer i end program lfortran-lfortran-2f73434/tests/parser/parameter_without_start_program.f900000664000175000017500000000002415141516316027314 0ustar alastairalastairparameter(x=10) end lfortran-lfortran-2f73434/tests/parser/program_without_line_06.f900000664000175000017500000000001115141516316025347 0ustar alastairalastairstop end lfortran-lfortran-2f73434/tests/parser/derived_type_without_start_program.f900000664000175000017500000000006615141516316030025 0ustar alastairalastair type :: test_t real :: a end type end lfortran-lfortran-2f73434/tests/parser/data_stmt_with_implied_do_loop.f0000664000175000017500000000036115141516316026671 0ustar alastairalastair PROGRAM data_stmt_with_implied_do_loop IMPLICIT NONE INTEGER i INTEGER P(1), C(1,1) CHARACTER(1) :: ch DATA P( 1), (C( 1,i), i=1, 1) / 31, 12 / DATA ch / "=" / END PROGRAM lfortran-lfortran-2f73434/tests/parser/procedure_with_type.f900000664000175000017500000000061015141516316024672 0ustar alastairalastairprogram procedure_with_type procedure(), pointer :: x procedure(double precision), pointer :: y procedure(doubleprecision), pointer :: yb procedure(integer), pointer :: z procedure(real), pointer :: a procedure(complex), pointer :: b procedure(real(8)), pointer :: c integer, parameter :: dp = kind(0.d0) procedure(real(dp)), pointer :: d procedure(character(1, 1)), pointer :: e end program lfortran-lfortran-2f73434/tests/parser/program_without_line_01.f900000664000175000017500000000002215141516316025344 0ustar alastairalastairprint *, "OK" end lfortran-lfortran-2f73434/tests/parser/program_without_line_04.f900000664000175000017500000000007515141516316025357 0ustar alastairalastair subroutine sub (); end subroutine; integer i end lfortran-lfortran-2f73434/tests/dimension_attr.f0000664000175000017500000000044115141516316022162 0ustar alastairalastair subroutine f(a) integer a print *, a end subroutine c this is a test comment program main integer , dimension (3,3) :: z integer a, b dimension a(2,2), b(10,10) integer, dimension(2,2) :: d call f(1) end lfortran-lfortran-2f73434/tests/array9.f900000664000175000017500000000077615141516316020536 0ustar alastairalastairprogram array9 type :: varying_string character(len=1), allocatable :: characters(:) endtype type(varying_string) :: x type(varying_string), allocatable :: a(:) real, allocatable :: b(:) integer, allocatable :: c(:) real(kind=4), allocatable :: d(:) a = [varying_string::] b = [real::] b = [integer::] d = [real(kind=4)::] a = [varying_string::x,x] b = [real::1.0,2.0] b = [integer::1,2] d = [real(kind=4)::1.0,2.0] endprogram lfortran-lfortran-2f73434/tests/selectrank1.f900000664000175000017500000000122115141516316021525 0ustar alastairalastairsubroutine process(x) real x(..) select rank(x) rank (0) x = 0 rank (2) if (size(x,2)>=2) x(:,2) = 2 rank default print *, 'i did not expect rank', rank(x), 'shape', shape(x) error stop 'process bad arg' end select return end subroutine process subroutine initialize (arg, size) real,contiguous :: arg(..) integer :: size, i select rank (arg) rank (0) ! special case the scalar case arg = 0.0 rank (*) do i = 1, size arg(i) = 0.0 end do end select return end subroutine lfortran-lfortran-2f73434/tests/program2.f900000664000175000017500000000017615141516316021052 0ustar alastairalastairprogram program2 implicit none call b call b() contains subroutine b() print *, "b" end subroutine end program lfortran-lfortran-2f73434/tests/assign.f900000664000175000017500000000031415141516316020577 0ustar alastairalastairprogram assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x ASSIGN 10 TO x 30 ASSIGN 10 TO y ! An integer variable is required in this context. end program lfortran-lfortran-2f73434/tests/select_type1.f900000664000175000017500000000072315141516316021720 0ustar alastairalastairprogram select_type1 implicit none select type (uptr => iter%value()) type is (integer) print *, iter%key(), ' = ', uptr type is (real) print *, iter%key(), ' = ', uptr type is (character(*)) print *, iter%key(), ' = ', uptr type is (point) print *, iter%key(), ' = ', uptr class is (point2) print *, iter%key(), ' = ', uptr class default print *, iter%key(), ' = ', uptr end select end program lfortran-lfortran-2f73434/tests/document_symbols1.f900000664000175000017500000000026015141516316022762 0ustar alastairalastairsubroutine add() end subroutine program document_symbols1 use module_document_symbols1 implicit none integer :: x x = (2+3)*5 print *, x, xy call sub() call add() end program lfortran-lfortran-2f73434/tests/derived_types_07.f900000664000175000017500000000453615141516316022501 0ustar alastairalastairmodule tomlf_type_value implicit none type, abstract :: toml_value character(len=:), allocatable :: key contains procedure(destroy), deferred :: destroy procedure :: match_key end type toml_value abstract interface subroutine destroy(self) import toml_value class(toml_value), intent(inout) :: self end subroutine destroy end interface contains pure function match_key(self, key) result(match) class(toml_value), intent(in) :: self character(len=*), intent(in) :: key logical :: match if (allocated(self%key)) then match = key == self%key else match = .false. end if end function match_key end module module tomlf_type_keyval use tomlf_type_value, only : toml_value implicit none type, extends(toml_value) :: toml_keyval character(len=:), allocatable :: raw contains procedure :: destroy end type toml_keyval contains subroutine destroy(self) class(toml_keyval), intent(inout) :: self if (allocated(self%key)) then deallocate(self%key) end if if (allocated(self%raw)) then deallocate(self%raw) end if end subroutine destroy end module tomlf_type_keyval module tomlf_structure_vector use tomlf_type_value, only : toml_value implicit none type :: toml_node class(toml_value), allocatable :: val end type toml_node type :: toml_vector integer :: n = 0 type(toml_node), allocatable :: lst(:) end type toml_vector contains subroutine new_vector(self, n) type(toml_vector), intent(out) :: self integer, intent(in), optional :: n self%n = 0 if (present(n)) then allocate(self%lst(min(1, n))) end if end subroutine new_vector subroutine find(self, key, ptr) class(toml_vector), intent(inout), target :: self character(len=*), intent(in) :: key class(toml_value), pointer, intent(out) :: ptr integer :: i nullify(ptr) do i = 1, self%n if (allocated(self%lst(i)%val)) then if (self%lst(i)%val%match_key(key)) then ptr => self%lst(i)%val exit end if end if end do end subroutine find end module tomlf_structure_vector lfortran-lfortran-2f73434/tests/allocate_01.f900000664000175000017500000000050715141516316021403 0ustar alastairalastairprogram hello implicit none character(:), allocatable :: cmd integer :: cmdlen integer :: ierr call get_command(length=cmdlen) if (cmdlen>0) then allocate(character(cmdlen) :: cmd) call get_command(cmd) print *, "hello ", cmd end if deallocate(cmd, stat = ierr) end program lfortran-lfortran-2f73434/tests/fixed_form_call2.f0000664000175000017500000000025415141516316022344 0ustar alastairalastair subroutine idd_frm(m) integer m, a a = 2 call prinf('lw = *',1) call prinf('16m+70 = *',1) m = 1 return end lfortran-lfortran-2f73434/tests/openmp1.f900000664000175000017500000000071215141516316020674 0ustar alastairalastairsubroutine increment_ctr(n, ctr) ! use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp1 integer, parameter :: n = 1000000 integer :: ctr ctr = 0 call increment_ctr(n, ctr) print *, ctr end program lfortran-lfortran-2f73434/tests/attributes1.f900000664000175000017500000000137015141516316021565 0ustar alastairalastairprogram attributes1 ! test for AST(to fmt) only character (len = 4) :: a, b character, intent(in) :: str*(*) character(len=1,kind=c_char), target, & bind(C,name="_binary_fclKernels_cl_start") :: fclKernelStart character (len = 3) :: c (2) integer, volatile :: d, e real, external :: g equivalence (a, c (1)), (b, c (2)) type details sequence integer:: age character(50):: name contains procedure, pass:: name => sample end type details intrinsic sin, cos doubleprecision, intent (in) :: x(..) type(real(kind=4)), allocatable :: x(:) type(integer(kind=4)), allocatable :: x(:) type(character(len=4)), allocatable :: x(:) type(logical(kind=4)), allocatable :: x(:) type(complex(kind=4)), allocatable :: x(:) save /zzrayc/ end program lfortran-lfortran-2f73434/tests/real_to_complex_cast_in_comparison.f900000664000175000017500000000053415141516316026425 0ustar alastairalastairprogram expr2 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: zero zero = 0.0_dp contains elemental complex(dp) function dabs(x) result(r) complex(dp), intent(in) :: x if (x /= zero) then r = x else r = 0 - x end if end function dabs end program lfortran-lfortran-2f73434/tests/lookup_name4.f900000664000175000017500000000102415141516316021707 0ustar alastairalastairmodule lookup_name4_time_module_xx IMPLICIT NONE PUBLIC REAL :: tparset_ = 0.0 REAL :: wtime_ = 0.0 END module lookup_name4_time_module_xx module lookup_name4_plib_module_xx use lookup_name4_time_module_xx, only: wtime_ PUBLIC INTEGER :: iproc = 0 INTEGER :: root = 0 INTEGER :: pinit = 0 INTEGER :: pcomm_set = 0 end module PROGRAM lookup_name4 USE lookup_name4_time_module_xx, ONLY: tparset_ USE lookup_name4_plib_module_xx, ONLY: pinit, & pcomm_set tparset_ = tparset_ + 1.0 END PROGRAM lookup_name4 lfortran-lfortran-2f73434/tests/style1.f900000664000175000017500000000042015141516316020532 0ustar alastairalastairprogram save4 implicit none integer :: y = 1 if (y .eq. 1) then print *, "y is 1" end if contains subroutine f() integer :: x = 5 if (x .eq. 1) then print *, "x is 1" end if end subroutine end programlfortran-lfortran-2f73434/tests/loop_test4.f0000664000175000017500000000052715141516316021244 0ustar alastairalastair PROGRAM TEST DO 240 K=1+1/2-3**4,MP CON(K)=-DATMAT(K,NP) DO 220 J=f()/2,N 220 W(J)=DATMAT(K,J)+CON(K) DO 240 I=f(2,3,x=5,z="o""k'(")/2,N TEMP=0.0d0 DO 230 J=((1+2)+((1+3)/4)+f((3+2),k=(4+sum(A(:,:,:,4))))),N 230 TEMP=TEMP+W(J)*SIMI(J,I) IF (K .EQ. MP) TEMP=-TEMP 240 A(I,K)=TEMP END lfortran-lfortran-2f73434/tests/dependency_test_02.f900000664000175000017500000000031315141516316022770 0ustar alastairalastairmodule m_cli2 implicit none contains subroutine a2d(valu) doubleprecision, intent(out) :: valu integer :: ivalu valu = real(ivalu, kind=kind(0.0d0)) end subroutine a2d end module m_cli2 lfortran-lfortran-2f73434/tests/stdin_read_blank_lines_01.in0000664000175000017500000000001515141516316024276 0ustar alastairalastair10 5 20 10 lfortran-lfortran-2f73434/tests/fixed_form_early_doloop2.f0000664000175000017500000000033615141516316024122 0ustar alastairalastair program main integer k, l, m, n do 100 k=1,2 do 100 l=1,3 do 100 m=1,4 do 100 n=1,5 print *, k, l 100 continue end program lfortran-lfortran-2f73434/tests/expr8.f900000664000175000017500000000033515141516316020364 0ustar alastairalastairi = 123 j = 123456789824390874092509458720948720947502984752098457242092870987 k = 2*18446744073709551616 i = 123_i8 j = 123456789824390874092509458720948720947502984752098457242092870987_i8 k = 2*18446744073709551616_i8 lfortran-lfortran-2f73434/tests/shiftl1.f900000664000175000017500000000012715141516316020667 0ustar alastairalastairprogram shiftl1 integer :: x,y print *, shiftl(1, 2) print *, shiftl(x,y) end program lfortran-lfortran-2f73434/tests/array14.f900000664000175000017500000000023115141516316020574 0ustar alastairalastairprogram array14 implicit none real :: x(5) real :: z(3) x = [5, -1, 3, 4, 2] print *, x z = x(1:3) print *, z end program lfortran-lfortran-2f73434/tests/subroutine1.f900000664000175000017500000000025115141516316021573 0ustar alastairalastairsubroutine g() integer :: x, i x = 1 do i = 1, 10 x = x*i end do end subroutine subroutine h() integer :: x, i x = 1 do i = 1, 10 x = i*x end do end subroutine lfortran-lfortran-2f73434/tests/loop_test5.f0000664000175000017500000000016015141516316021236 0ustar alastairalastair subroutine f() do 1 i=1,n do 1 j=1,n 1 continue do 2 i=1,n 2 continue end lfortran-lfortran-2f73434/tests/global_scope6.f900000664000175000017500000000004115141516316022027 0ustar alastairalastairinteger :: x x = 6 2*x x = x + 1 lfortran-lfortran-2f73434/tests/character1.f900000664000175000017500000000023415141516316021331 0ustar alastairalastairsubroutine xerror(mess) character*(*) mess !This is string whose length is decided at compile time print *, mess(1) return end subroutine lfortran-lfortran-2f73434/tests/external_01.f900000664000175000017500000000022215141516316021433 0ustar alastairalastair subroutine foo(a,b,f) complex, intent(out) :: a complex, intent(in) :: b complex, external :: f a = f(b) end subroutine foo lfortran-lfortran-2f73434/tests/external2.f900000664000175000017500000000010615141516316021216 0ustar alastairalastairsubroutine f(sub2) external :: sub2 call sub2(x) end subroutine lfortran-lfortran-2f73434/tests/array5.f900000664000175000017500000000023215141516316020515 0ustar alastairalastairprogram array5 implicit none real, dimension(3) :: a, b, c real :: e(0) a = [1, 2, 3] b = (/ 1, 2, 3 /) c = [real:: 1, 2, 3] e = [real ::] end program lfortran-lfortran-2f73434/tests/uppercase1.f900000664000175000017500000000023315141516316021363 0ustar alastairalastairmodule uppercase1 real, dimension(3) :: x, y contains subroutine sub(a) integer, intent(inout) :: a a = a + SIZE(x) + SIZE(y) end subroutine end module lfortran-lfortran-2f73434/tests/preprocessor11.f900000664000175000017500000000334615141516316022213 0ustar alastairalastairprogram preprocessor11 ! #if with >, <, == implicit none #define X 1 #define Y 5 #define Z 1+Y*3 print *, Z #if X == 1 print *, "X is 1" #else print *, "X is not 1" #endif #if X == 2 print *, "X is 2" #else print *, "X is not 2" #endif #if X != 1 print *, "X is not 1" #else print *, "Not X is not 1" #endif #if X == 1 && Y == 5 print *, "X is 1 and Y is 5" #else print *, "Not (X is 1 and Y is 5)" #endif #if X == 2 && Y == 5 print *, "X is 2 and Y is 5" #else print *, "Not (X is 2 and Y is 5)" #endif #if X < 3 && Y > 3 print *, "X<3 and Y>3" #else print *, "Not (X<3 and Y>3)" #endif #if X > 3 && Y < 3 print *, "X>3 and Y<3" #else print *, "Not (X>3 and Y<3)" #endif #if X == 3-2 print *, "X is 3-2" #else print *, "X is not 3-2" #endif #if X == 3-1 print *, "X is 3-1" #else print *, "X is not 3-1" #endif #if Y == (6*5-5)/5 print *, "Y is (6*5-5)/5" #else print *, "Y is not (6*5-5)/5" #endif #if Y == (6*5-6)/5 print *, "Y is (6*5-6)/5" #else print *, "Y is not (6*5-6)/5" #endif #if Y == (-5+6*5)/5 print *, "Y is (-5+6*5)/5" #else print *, "Y is not (-5+6*5)/5" #endif #if Y == (-6+6*5)/5 print *, "Y is (-6+6*5)/5" #else print *, "Y is not (-6+6*5)/5" #endif #if Y == (+5+6*5)/7 print *, "Y is (+5+6*5)/7" #else print *, "Y is not (+5+6*5)/7" #endif #if Y == (+4+6*5)/7 print *, "Y is (+4+6*5)/7" #else print *, "Y is not (+4+6*5)/7" #endif #if Y == (+5+6*Y)/7 print *, "Y is (+5+6*Y)/7" #else print *, "Y is not (+5+6*Y)/7" #endif #if Z == 16 print *, "Z is 16" #else print *, "Z is not 16" #endif #if defined(Y) && (3 <= Y) print *, "Y defined and 1 <= Y" #else print *, "Y not defined or not 1 <= Y" #endif #if defined(A) && (3 <= A) print *, "A defined and 1 <= A" #else print *, "A not defined or not 1 <= A" #endif end program lfortran-lfortran-2f73434/tests/fixed_form_implicit2.f0000664000175000017500000000027115141516316023242 0ustar alastairalastair program main c TODO: SymbolTable stays empty upon running with `--show-asr`. Needs c rechecking implicit complex (a,b,c) implicit character*4 (k,l) end program lfortran-lfortran-2f73434/tests/expr9.f900000664000175000017500000000022615141516316020364 0ustar alastairalastaircall ERROR_HANDLER%trigger(errors=.errors.rslt) .INVERSE. B .INVERSE. (A + B) .anotherunary.1 .anotherunary.(1+2) .anotherunary.C .anotherunary.(c+d) lfortran-lfortran-2f73434/tests/fixed_form_decls.f0000664000175000017500000000023415141516316022437 0ustar alastairalastair include 'stdmap.f' integer a integer b complex aaaaaaaaaaaaaaaaaaaaaaaaaaaaa logical*1 iiiiiiiii goto1000 end lfortran-lfortran-2f73434/tests/fixed_form_implicit3.f0000664000175000017500000000136315141516316023246 0ustar alastairalastair CHARACTER FUNCTION C0(A) END CHARACTER*1 FUNCTION C1(A) END CHARACTER*11 FUNCTION C11(A) END CHARACTER*111 FUNCTION C111(A) END CHARACTER*(*) FUNCTION CSTAR(A) END INTEGER FUNCTION I0(A) END INTEGER*4FUNCTION I4(A) END INTEGER*8FUNCTION I8(A) END REAL FUNCTION R0(A) END REAL*4 FUNCTION R4(A) END REAL*8 FUNCTION R8(A) END COMPLEX FUNCTION CM0(A) END COMPLEX*8 FUNCTION CM4(A) END COMPLEX*16 FUNCTION CM8(A) END LOGICAL FUNCTION L0(A) END LOGICAL*1 FUNCTION L1(A) END LOGICAL*4 FUNCTION L4(A) END lfortran-lfortran-2f73434/tests/preprocessor13.f900000664000175000017500000001520415141516316022211 0ustar alastairalastair#if defined(__GFORTRAN__) print *, "1 GFortran" #elif defined(__LFORTRAN__) print *, "1 LFortran" #else print *, "1 Other" #endif #if defined(__GFORTRAN__) print *, "2 GFortran" #elif defined(__LFORTRAN__) print *, "2 LFortran 1" #elif defined(__LFORTRAN__) print *, "2 LFortran 2" #else print *, "2 Other" #endif #if defined(__GFORTRAN__) print *, "3 GFortran 1" #elif defined(__GFORTRAN__) print *, "3 GFortran 2" #elif defined(__LFORTRAN__) print *, "3 LFortran 1" #elif defined(__LFORTRAN__) print *, "3 LFortran 2" #else print *, "3 Other" #endif #if defined(__GFORTRAN__) print *, "4 GFortran 1" #elif defined(__GFORTRAN__) print *, "4 GFortran 2" # if defined(__GFORTRAN__) print *, "41 GFortran 1" # elif defined(__GFORTRAN__) print *, "41 GFortran 2" # elif defined(__LFORTRAN__) print *, "41 LFortran 1" # elif defined(__LFORTRAN__) print *, "41 LFortran 2" # else print *, "41 Other" # endif #elif defined(__LFORTRAN__) print *, "4 LFortran 1" # if defined(__GFORTRAN__) print *, "42 GFortran 1" # elif defined(__GFORTRAN__) print *, "42 GFortran 2" # elif defined(__LFORTRAN__) print *, "42 LFortran 1" # elif defined(__LFORTRAN__) print *, "42 LFortran 2" # else print *, "42 Other" # endif #elif defined(__LFORTRAN__) print *, "4 LFortran 2" # if defined(__GFORTRAN__) print *, "43 GFortran 1" # elif defined(__GFORTRAN__) print *, "43 GFortran 2" # elif defined(__LFORTRAN__) print *, "43 LFortran 1" # elif defined(__LFORTRAN__) print *, "43 LFortran 2" # else print *, "43 Other" # endif #else print *, "4 Other" # if defined(__GFORTRAN__) print *, "44 GFortran 1" # elif defined(__GFORTRAN__) print *, "44 GFortran 2" # elif defined(__LFORTRAN__) print *, "44 LFortran 1" # elif defined(__LFORTRAN__) print *, "44 LFortran 2" # else print *, "44 Other" # endif #endif #define X 1 #define Y 1 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 2 #define Y 3 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 4 #define Y 4 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif #define X 5 #define Y 5 #if X == 1 print *, "X is 1" # if Y == 1 print *, "1 Y is 1" # elif Y == 2 print *, "1 Y is 2" # elif Y == 3 print *, "1 Y is 3" # elif Y == 4 print *, "1 Y is 4" # else print *, "1 Y is not 1-4" # endif #elif X == 2 print *, "X is 2" # if Y == 1 print *, "2 Y is 1" # elif Y == 2 print *, "2 Y is 2" # elif Y == 3 print *, "2 Y is 3" # elif Y == 4 print *, "2 Y is 4" # else print *, "2 Y is not 1-4" # endif #elif X == 3 print *, "X is 3" # if Y == 1 print *, "3 Y is 1" # elif Y == 2 print *, "3 Y is 2" # elif Y == 3 print *, "3 Y is 3" # elif Y == 4 print *, "3 Y is 4" # else print *, "3 Y is not 1-4" # endif #elif X == 4 print *, "X is 4" # if Y == 1 print *, "4 Y is 1" # elif Y == 2 print *, "4 Y is 2" # elif Y == 3 print *, "4 Y is 3" # elif Y == 4 print *, "4 Y is 4" # else print *, "4 Y is not 1-4" # endif #else print *, "X is not 1-4" # if Y == 1 print *, "5 Y is 1" # elif Y == 2 print *, "5 Y is 2" # elif Y == 3 print *, "5 Y is 3" # elif Y == 4 print *, "5 Y is 4" # else print *, "5 Y is not 1-4" # endif #endif end lfortran-lfortran-2f73434/tests/global_scope9.f900000664000175000017500000000003015141516316022030 0ustar alastairalastairinteger(8) :: x x = 6 x lfortran-lfortran-2f73434/tests/implicit8.f900000664000175000017500000000012615141516316021216 0ustar alastairalastairinteger function a(n,m) n = 5 m = 8 integer :: X(n), Y(m) X = [1,2,3,4,5] end functionlfortran-lfortran-2f73434/tests/subroutine4.f900000664000175000017500000000031515141516316021577 0ustar alastairalastairsubroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine lfortran-lfortran-2f73434/tests/preprocessor19.f900000664000175000017500000000013115141516316022210 0ustar alastairalastair#define Fn(x) program preprocessor19 implicit none Fn(1) end program preprocessor19 lfortran-lfortran-2f73434/tests/fn_call1.f900000664000175000017500000000027615141516316021001 0ustar alastairalastairsize(tvec, dim=2) min(tvec(2, i), tvec(1, i)) a(1, 2, 3) f(a, b, d=5/2, c=3+3) A(i,j,k) X(i) X(:) X(a:) X(:b) X(a:b) X(::c) X(: :c) X(a::c) X(a: :c) X(:b:c) X(a:b:c) X(a:b, : :c, a:, a: :c) lfortran-lfortran-2f73434/tests/derived_types_06.f900000664000175000017500000000014115141516316022464 0ustar alastairalastairmodule tomlf_utils use tomlf_utils_convert implicit none contains end module tomlf_utils lfortran-lfortran-2f73434/tests/fixed_form2.f0000664000175000017500000000237215141516316021354 0ustar alastairalastairc Test comments and line continuation program fixed_form2 c Comment 1 C Comment 2 ! Comment col 1 ! Comment col 2 ! Comment col 3 ! Comment col 4 ! Comment col 5 ! Comment col 7 ! Comment col 8 ! Comment 3 integer :: a ! Comment 4 print *, "OK1" !, "OK2" ! The first ! is not a comment, but line continuation print *, "OK1" ! !, "F2" ! This whole line is a comment c !, "F3" ! This whole line is a comment C !, "F4" ! This whole line is a comment * !, "F5" ! This whole line is a comment ! !, "F6" ! This whole line is a comment ! !, "F7" ! This whole line is a comment ! !, "F8" ! This whole line is a comment !!, "F9" ! This whole line is a comment ;, "OK2" ! line continuation to the previous non-comment line 1, "OK3" ! line continuation $, "OK4" ! line continuation 0print *, "1" ! not line continuation, new statement print *, "2" ! not line continuation, new statement print *, "1", "1 ! not comment $ finish string" print *, "1", "1 "" ' 2 """" 3 $ ! also not comment $ finish string" print *, "1", '1 '' " 2 '''' 3 $ ! also not comment $ finish string' end ! Comment 5 ! Comment lfortran-lfortran-2f73434/tests/allocate_02.f900000664000175000017500000000031515141516316021401 0ustar alastairalastairprogram allocate_02 implicit none integer, allocatable :: arr(:) integer :: i allocate(arr(1)) do i = 1, 1000000 deallocate(arr) allocate(arr(1)) end do end program lfortran-lfortran-2f73434/tests/expr5.f900000664000175000017500000000013315141516316020355 0ustar alastairalastairprogram expr_05 implicit none integer :: x x = (2+3)*5 if (x == 25) error stop end program lfortran-lfortran-2f73434/tests/int_to_int_cast_fortran_codegen.f900000664000175000017500000000074615141516316025723 0ustar alastairalastairprogram ImplicitIntToIntCastExample implicit none integer :: integerValue1 ! Default integer type integer(kind=8) :: integerValue2 ! 8-byte integer ! Assign an integer value integerValue1 = 10 ! Perform an implicit integer to integer cast integerValue2 = integerValue1 ! Output the result print *, "Integer Value 1:", integerValue1 print *, "Integer Value 2 (Kind=8):", integerValue2 end program ImplicitIntToIntCastExample lfortran-lfortran-2f73434/tests/wasm1.f900000664000175000017500000000167215141516316020353 0ustar alastairalastairprogram wasm1 implicit none print *, sqr(5) print *, add(5, 4) print *, add64(4_8, 5_8) print *, computeCircleArea(5) print *, my_add(5, 4) contains function sqr(x) result(r) implicit none integer, intent(in):: x integer :: r r = x * x end function function add(x, y) result(r) implicit none integer, intent(in):: x, y integer :: r r = x + y end function function add64(x, y) result(r) implicit none integer(8), intent(in):: x, y integer(8) :: r r = x + y end function function computeCircleArea(radius) result(area) implicit none integer, intent(in):: radius integer :: PI, area PI = 3 area = PI * sqr(radius) end function integer function my_add(a, b) result(c) integer, intent(in) :: a, b c = a + b end function end program lfortran-lfortran-2f73434/tests/modules_06.f900000664000175000017500000000040515141516316021271 0ustar alastairalastairmodule modules_06_b implicit none private public b contains integer function b() b = 5 end function end module module modules_06_a use modules_06_b, only: b implicit none private public a contains integer function a() a = 3 + b() end function end module lfortran-lfortran-2f73434/.gitattributes0000664000175000017500000000007115141516316020524 0ustar alastairalastair*.sh text eol=lf tests/**/*.f90 -text tests/**/*.f -text lfortran-lfortran-2f73434/build1.sh0000775000175000017500000000106215141516316017351 0ustar alastairalastair#!/usr/bin/env bash set -e set -x cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=yes \ -DWITH_RUNTIME_STACKTRACE=yes \ -DWITH_LSP=no \ -DUSE_DYNAMIC_ZSTD=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_LIBDIR=share/lfortran/lib \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_C_FLAGS="${CFLAGS} -fdiagnostics-color=always" \ -DCMAKE_CXX_FLAGS="${CXXFLAGS} -fdiagnostics-color=always" \ -G Ninja \ . cmake --build . lfortran-lfortran-2f73434/Dockerfile0000664000175000017500000000173615141516316017634 0ustar alastairalastairFROM ubuntu:22.04 AS build USER root RUN apt-get update && \ apt-get install -y curl git build-essential binutils-dev zlib1g-dev clang libunwind-dev && \ rm -rf /var/lib/apt/lists/* # fix version of miniforge to 24.11.0-0 as that fixes the version of mamba RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/download/24.11.0-0/Miniforge3-$(uname)-$(uname -m).sh" RUN bash Miniforge3-$(uname)-$(uname -m).sh -b RUN /root/miniforge3/bin/mamba init bash WORKDIR /lfortran_build COPY . . RUN /root/miniforge3/bin/mamba env create -f environment_linux.yml -y SHELL ["/root/miniforge3/bin/mamba", "run", "-n", "lf", "/bin/bash", "-c"] RUN ./build_release.sh RUN ctest RUN LFORTRAN_TEST_ENV_VAR='STATUS OK!' python integration_tests/run_tests.py RUN python run_tests.py FROM ubuntu:22.04 AS app RUN apt-get update && \ apt-get install -y --no-install-recommends binutils clang && \ rm -rf /var/lib/apt/lists/* COPY --from=build /lfortran_build/inst /app lfortran-lfortran-2f73434/src/0000775000175000017500000000000015141516316016422 5ustar alastairalastairlfortran-lfortran-2f73434/src/bin/0000775000175000017500000000000015141516316017172 5ustar alastairalastairlfortran-lfortran-2f73434/src/bin/language_server_interface.cpp0000664000175000017500000005233515141516316025077 0ustar alastairalastair#include #include #include #include #include #include #include #include #include #include #include #ifndef CLI11_HAS_FILESYSTEM #define CLI11_HAS_FILESYSTEM 0 #endif // CLI11_HAS_FILESYSTEM #include #include #include #include namespace LCompilers::LLanguageServer::Interface { namespace fs = std::filesystem; namespace lc = LCompilers; namespace lsp = LCompilers::LanguageServerProtocol; auto validateConfigSection(const std::string &configSection) -> std::string { if (!std::regex_match(configSection, RE_CONFIG_SECTION)) { return ("Configuration section is not a valid sequence of dot-separated, " "ECMAScript Ids: " + configSection) ; } if (std::regex_match(configSection, RE_RESERVED_CONFIG_IDS)) { return ("Configuration section contains a reserved Id for ECMAScript: " + configSection); } return ""; } auto existsAndIsWritable(const std::string &pathString) -> std::string { fs::path path = fs::absolute(pathString).lexically_normal(); fs::path dir = path.parent_path(); if (!fs::exists(dir) && !fs::create_directories(dir)) { throw lc::LCompilersException( "Cannot create log directory: " + dir.string() ); } std::ofstream ofs(path); if (!ofs.is_open()) { throw lc::LCompilersException( "Path is not writable: " + path.string() ); } ofs.close(); return path.string(); } auto existsAndIsExecutable(const std::string &pathString) -> std::string { fs::path path = fs::absolute(pathString).lexically_normal(); if (!fs::exists(path)) { throw lc::LCompilersException( "Path does not exist: " + path.string() ); } std::error_code ec; fs::file_status status = std::filesystem::status(path, ec); if (ec) { throw lc::LCompilersException( "Error getting file status: " + ec.message() ); } fs::perms permissions = status.permissions(); #ifdef _WIN32 if ((permissions & fs::perms::owner_exec) == fs::perms::none) #else if ((permissions & (fs::perms::owner_exec | fs::perms::group_exec | fs::perms::others_exec)) == fs::perms::none) #endif { throw lc::LCompilersException( "Path is not executable: " + path.string() ); } return path.string(); } const std::map LanguageNames = { {Language::FORTRAN, "FORTRAN"}, }; const std::map LanguageValues = { {Language::FORTRAN, "fortran"}, }; auto languageByValue(const std::string &value) -> Language { for (const auto &[lang_key, lang_value] : LanguageValues) { if (lang_value == value) { return lang_key; } } throw std::invalid_argument( "Invalid Language value: \"" + value + "\"" ); } const std::map DataFormatNames = { {DataFormat::JSON_RPC, "JSON_RPC"}, }; const std::map DataFormatValues = { {DataFormat::JSON_RPC, "json-rpc"}, }; auto dataFormatByValue(const std::string &value) -> DataFormat { for (const auto &[fmt_key, fmt_value] : DataFormatValues) { if (fmt_value == value) { return fmt_key; } } throw std::invalid_argument( "Invalid DataFormat value: \"" + value + "\"" ); } const std::map CommunicationProtocolNames = { {CommunicationProtocol::STDIO, "STDIO"}, }; const std::map CommunicationProtocolValues = { {CommunicationProtocol::STDIO, "stdio"}, }; auto communicationProtocolByValue(const std::string &value) -> CommunicationProtocol { for (const auto &[protocol_key, protocol_value] : CommunicationProtocolValues) { if (protocol_value == value) { return protocol_key; } } throw std::invalid_argument( "Invalid CommunicationProtocol value: \"" + value + "\"" ); } const std::map ServerProtocolNames = { {ServerProtocol::LSP, "LSP"}, }; const std::map ServerProtocolValues = { {ServerProtocol::LSP, "lsp"}, }; auto serverProtocolByValue(const std::string &value) -> ServerProtocol { for (const auto &[protocol_key, protocol_value] : ServerProtocolValues) { if (protocol_value == value) { return protocol_key; } } throw std::invalid_argument( "Invalid ServerProtocol value: \"" + value + "\"" ); } const std::map ExecutionStrategyNames = { {ExecutionStrategy::PARALLEL, "PARALLEL"}, {ExecutionStrategy::CONCURRENT, "CONCURRENT"}, }; const std::map ExecutionStrategyValues { {ExecutionStrategy::PARALLEL, "parallel"}, {ExecutionStrategy::CONCURRENT, "concurrent"}, }; auto executionStrategyByValue(const std::string &value) -> ExecutionStrategy { for (const auto &[strategy_key, strategy_value] : ExecutionStrategyValues) { if (strategy_value == value) { return strategy_key; } } throw std::invalid_argument( "Invalid ExecutionStrategy value: \"" + value + "\"" ); } LanguageServerInterface::LanguageServerInterface() : workspaceConfig(std::make_shared()) { // empty } auto LanguageServerInterface::prepare(CLI::App &app) -> CLI::App * { CLI::App *server = app.add_subcommand( "server", "LCompilers Language Server: Serves requests from language extensions in supported editors." ); opts.language = Language::FORTRAN; server->add_option( "--language", opts.language, "Specifies the language to serve." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(LanguageValues), CLI::ignore_case ) ); opts.dataFormat = DataFormat::JSON_RPC; server->add_option( "--data-format", opts.dataFormat, "Specifies the data exchange format for requests." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(DataFormatValues), CLI::ignore_case ) ); opts.communicationProtocol = CommunicationProtocol::STDIO; server->add_option( "--communication-protocol", opts.communicationProtocol, "Specifies the communication protocol over which to serve requests." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(CommunicationProtocolValues), CLI::ignore_case ) ); opts.serverProtocol = ServerProtocol::LSP; server->add_option( "--server-protocol", opts.serverProtocol, "Specifies the language server protocol that defines how to serve requests." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(ServerProtocolValues), CLI::ignore_case ) ); opts.executionStrategy = ExecutionStrategy::CONCURRENT; server->add_option( "--execution-strategy", opts.executionStrategy, "Specifies the execution strategy for handling messages. The `parallel` strategy implies multiple messages may be processed alongside each other, while the `concurrent` strategy implies multiple messages may be processed but only one processor will be active at a time (they will yield control to each other)." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(ExecutionStrategyValues), CLI::ignore_case ) ); opts.numRequestThreads = 5; server->add_option( "--num-request-threads", opts.numRequestThreads, "Number of threads that serve requests." )->capture_default_str(); opts.numWorkerThreads = std::thread::hardware_concurrency(); server->add_option( "--num-worker-threads", opts.numWorkerThreads, "Number of threads that will handle sub-tasks of requests." )->capture_default_str(); opts.enableLogging = false; server->add_flag( "--enable-logging", opts.enableLogging, "Enable logging to a file." )->capture_default_str(); opts.configSection = "LFortran"; server->add_option( "--config-section", opts.configSection, ("Identifies the server's configuration section within the " "workspace configuration.") )->capture_default_str()->check(validateConfigSection); workspaceConfig->openIssueReporterOnError = true; server->add_option( "--open-issue-reporter-on-error", workspaceConfig->openIssueReporterOnError, "Open a bug report if an internal error occurs." )->capture_default_str(); workspaceConfig->maxNumberOfProblems = 100; server->add_option( "--max-number-of-problems", workspaceConfig->maxNumberOfProblems, "Maximum number of errors and warnings to report." )->capture_default_str(); workspaceConfig->trace.server = lsp::TraceValues::Off; server->add_option( "--trace-server", workspaceConfig->trace.server, "Traces the communication between the language client and server." )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(lsp::TraceValuesValues), CLI::ignore_case ) ); server->add_option( "--compiler-path", workspaceConfig->compiler.path, "Path to the LFortran compiler executable." )->transform(existsAndIsExecutable); server->add_option( "compiler_flags", workspaceConfig->compiler.flags, "Additional flags to pass to the LFortran compiler." ); if (opts.enableLogging) { workspaceConfig->log.path = existsAndIsWritable("lfortran-language-server.log"); } else { workspaceConfig->log.path = ""; } server->add_option( "--log-path", workspaceConfig->log.path, "Path to where logs should be written." )->capture_default_str()->transform(existsAndIsWritable); workspaceConfig->log.level = lsl::Level::LOG_LEVEL_INFO; server->add_option( "--log-level", workspaceConfig->log.level, "Verbosity of log output" )->capture_default_str()->transform( CLI::CheckedTransformer( transpose(lsl::LevelValues), CLI::ignore_case ) ); workspaceConfig->log.prettyPrint = true; server->add_option( "--log-pretty-print", workspaceConfig->log.prettyPrint, "Whether to pretty-print JSON objects and arrays." )->capture_default_str(); workspaceConfig->indentSize = 4; server->add_option( "--indent-size", workspaceConfig->indentSize, "Number of spaces per level of indentation." )->capture_default_str(); workspaceConfig->timeoutMs = 100; server->add_option( "--timeout-ms", workspaceConfig->timeoutMs, "Number of milliseconds to await requests from server-to-client." )->capture_default_str(); workspaceConfig->retry.maxAttempts = 5; server->add_option( "--max-retry-attempts", workspaceConfig->retry.maxAttempts, "Maximum number of times to attempt a request before giving up." )->capture_default_str(); workspaceConfig->retry.minSleepTimeMs = 10; server->add_option( "--min-retry-sleep-time-ms", workspaceConfig->retry.minSleepTimeMs, "Minimum number of milliseconds to wait between request attempts." )->capture_default_str(); workspaceConfig->retry.maxSleepTimeMs = 10; server->add_option( "--max-retry-sleep-time-ms", workspaceConfig->retry.maxSleepTimeMs, "Maximum number of milliseconds to wait between request attempts." )->capture_default_str(); workspaceConfig->telemetry.enabled = false; server->add_option( "--telemetry-enabled", workspaceConfig->telemetry.enabled, "Whether to enable telemetry events (may require a restart)." )->capture_default_str(); workspaceConfig->telemetry.frequencyMs = 1000; server->add_option( "--telemetry-frequency-ms", workspaceConfig->telemetry.frequencyMs, "Number of milliseconds to wait between telemetry events." )->capture_default_str(); opts.extensionId = "lcompilers.lfortran-lsp"; server->add_option( "--extension-id", opts.extensionId, "Identifies the language client extension that interacts with this server." )->capture_default_str(); opts.parentProcessId = -1; server->add_option( "--parent-process-id", opts.parentProcessId, "Process ID (PID) of the process that has spawned this language server." )->capture_default_str(); return server; } auto LanguageServerInterface::buildMessageStream( lsl::Logger &logger ) -> std::unique_ptr { switch (opts.serverProtocol) { case ServerProtocol::LSP: { return std::make_unique(std::cin, logger); } default: { throw lc::LCompilersException( ("Unsupported server protocol: ServerProtocol::" + ServerProtocolNames.at(opts.serverProtocol)) ); } } } auto LanguageServerInterface::buildLanguageServer( ls::MessageQueue &incomingMessages, ls::MessageQueue &outgoingMessages, lsl::Logger &logger, std::atomic_bool &start, std::condition_variable &startChanged, std::mutex &startMutex ) -> std::unique_ptr { if (opts.language == Language::FORTRAN) { if (opts.dataFormat == DataFormat::JSON_RPC) { if (opts.serverProtocol == ServerProtocol::LSP) { switch (opts.executionStrategy) { case ExecutionStrategy::PARALLEL: { std::random_device randomSeed; return std::make_unique( incomingMessages, outgoingMessages, opts.numRequestThreads, opts.numWorkerThreads, logger, opts.configSection, opts.extensionId, LFORTRAN_VERSION, opts.parentProcessId, randomSeed(), workspaceConfig, start, startChanged, startMutex ); break; } case ExecutionStrategy::CONCURRENT: { return std::make_unique( incomingMessages, outgoingMessages, logger, opts.configSection, opts.extensionId, LFORTRAN_VERSION, opts.parentProcessId, workspaceConfig, start, startChanged, startMutex ); break; } default: { throw lc::LCompilersException( ("Unsupported execution strategy: " + ExecutionStrategyValues.at(opts.executionStrategy)) ); } } } else { throw lc::LCompilersException( ("Unsupported server protocol for fortran: " + ServerProtocolValues.at(opts.serverProtocol)) ); } } else { throw lc::LCompilersException( ("Unsupported data format for fortran: " + DataFormatValues.at(opts.dataFormat)) ); } } else { throw lc::LCompilersException( ("Unsupported language: " + LanguageValues.at(opts.language)) ); } } auto LanguageServerInterface::buildCommunicationProtocol( ls::LanguageServer &languageServer, ls::MessageStream &messageStream, ls::MessageQueue &incomingMessages, ls::MessageQueue &outgoingMessages, lsl::Logger &logger, std::atomic_bool &start, std::condition_variable &startChanged, std::mutex &startMutex ) -> std::unique_ptr { switch (opts.communicationProtocol) { case CommunicationProtocol::STDIO: { return std::make_unique( languageServer, messageStream, incomingMessages, outgoingMessages, logger, start, startChanged, startMutex ); } default: { throw lc::LCompilersException( ("Unsupported communication protocol: " + std::to_string(static_cast(opts.communicationProtocol))) ); } } } auto LanguageServerInterface::serve() -> void { try { lsl::Logger logger(opts.enableLogging ? workspaceConfig->log.path : "", "LanguageServerInterface"); logger.setLevel(workspaceConfig->log.level); logger.threadName("main"); std::atomic_bool start{false}; std::condition_variable startChanged; std::mutex startMutex; std::unique_ptr messageStream = buildMessageStream(logger); ls::MessageQueue communicatorToServer(logger, "communicator-to-server"); ls::MessageQueue serverToCommunicator(logger, "server-to-communicator"); std::unique_ptr languageServer = buildLanguageServer( communicatorToServer, serverToCommunicator, logger, start, startChanged, startMutex ); std::unique_ptr communicationProtocol = buildCommunicationProtocol( *languageServer, *messageStream, serverToCommunicator, communicatorToServer, logger, start, startChanged, startMutex ); { std::unique_lock startLock(startMutex); start = true; } startChanged.notify_all(); communicationProtocol->serve(); logger.info() << "Language server terminated cleanly." << std::endl; } catch(const LCompilers::LCompilersException &e) { std::cerr << "Caught unhandled exception" << std::endl; std::vector d = e.stacktrace_addresses(); get_local_addresses(d); get_local_info(d); std::cerr << stacktrace2str(d, LCompilers::stacktrace_depth, false); std::cerr << e.name() + ": " << e.msg() << std::endl; throw e; } catch (const std::exception &e) { std::string buffer = "Caught unhandled exception: "; buffer.append(e.what()); throw lc::LCompilersException(buffer); } catch (...) { std::cerr << "Unknown Exception" << std::endl; } } } // LCompilers::LLanguageServer::Interface lfortran-lfortran-2f73434/src/bin/concurrent_lfortran_lsp_language_server.h0000664000175000017500000000306615141516316027550 0ustar alastairalastair#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include namespace LCompilers::LanguageServerProtocol { namespace lsl = LCompilers::LLanguageServer::Logging; class ConcurrentLFortranLspLanguageServer : public ConcurrentLspLanguageServer , public LFortranLspLanguageServer { public: ConcurrentLFortranLspLanguageServer( ls::MessageQueue &incomingMessages, ls::MessageQueue &outgoingMessages, lsl::Logger &logger, const std::string &configSection, const std::string &extensionId, const std::string &compilerVersion, int parentProcessId, std::shared_ptr workspaceConfig, std::atomic_bool &start, std::condition_variable &startChanged, std::mutex &startMutex ); protected: lsl::Logger logger; auto validate( std::shared_ptr document ) -> void override; auto updateHighlights( std::shared_ptr document ) -> void override; }; // class ConcurrentLFortranLspLanguageServer } // namespace LCompilers::LanguageServerProtocol lfortran-lfortran-2f73434/src/bin/glfortran0000775000175000017500000000667515141516316021134 0ustar alastairalastair#!/usr/bin/env python """ Simple wrapper around lfortran that tries hard to match gfortran interface """ import argparse import logging import subprocess logger = logging.getLogger(__name__) _supported_opt_levels = 3 def build_parser(): parser = argparse.ArgumentParser() parser.add_argument("-c", action="store_true") parser.add_argument("-S", action="store_true") parser.add_argument("-o", metavar="outfile") ## preprocessing_group = parser.add_argument_group("Preprocessing Options") preprocessing_group.add_argument("-E", action="store_true") preprocessing_group.add_argument("-cpp", action="store_true") preprocessing_group.add_argument( "-D", metavar="macro[=defn]", action="append", default=[] ) preprocessing_group.add_argument("-U", metavar="macro", default=[]) ## debugging_group = parser.add_argument_group("Debugging Options") debugging_group.add_argument("-g", action="store_true") ## directory_group = parser.add_argument_group("Directory Options") directory_group.add_argument("-I", metavar="dir", action="append", default=[]) ## link_group = parser.add_argument_group("Link Options") link_group.add_argument("-L", metavar="dir", action="append", default=[]) ## codegen_group = parser.add_argument_group("Code Generation Options") codegen_group.add_argument("-O", action="store_true") for lvl in range(1 + _supported_opt_levels): codegen_group.add_argument("-O{}".format(lvl), action="store_true") codegen_group.add_argument("-fPIC", action="store_true") ## parser.add_argument("infile", action="append") return parser ############################################################################## def build_lfortran_command(args): lfortran_args = [] # Default values to match gfortran behavior as closely as possible lfortran_args.extend(("--fixed-form-infer", "--cpp-infer", "--implicit-interface")) # Then forward original argument, adjusting the value if needs be. if args.c: lfortran_args.append("-c") lfortran_args.append("--separate-compilation") if args.S: lfortran_args.append("-S") if args.o: lfortran_args.append("-o") lfortran_args.append(args.o) if args.E: lfortran_args.append("-E") if args.cpp: lfortran_args.append("--cpp") for define in args.D: lfortran_args.append("-D" + define) for undefine in args.U: lfortran_args.append("-U" + undefine) if args.g: lfortran_args.append("-g") for include in args.I: lfortran_args.append("-I" + include) for libdir in args.L: lfortran_args.append("-L" + libdir) if args.O: optlvl = 1 else: optlvl = None for lvl in range(1 + _supported_opt_levels): if getattr(args, "O{}".format(lvl)): optlvl = lvl if optlvl: lfortran_args.append("-O{}".format(optlvl)) if args.fPIC: lfortran_args.append("-fPIC") lfortran_args.extend(args.infile) return lfortran_args ############################################################################## if __name__ == "__main__": parser = build_parser() args, unknowns = parser.parse_known_args() for unknown in unknowns: logger.warning("Ignoring unknown argument " + unknown) lfortran_args = build_lfortran_command(args) # Invoke lfortran subprocess.call(["lfortran"] + lfortran_args) lfortran-lfortran-2f73434/src/bin/lfortran_command_line_parser.cpp0000664000175000017500000007400315141516316025612 0ustar alastairalastair#include #include #include #include #include #include #include #ifndef CLI11_HAS_FILESYSTEM #define CLI11_HAS_FILESYSTEM 0 #endif // CLI11_HAS_FILESYSTEM #include #include namespace LCompilers::CommandLineInterface { namespace lc = LCompilers; LFortranCommandLineParser::LFortranCommandLineParser(std::vector &args) : args(args) { // empty } LFortranCommandLineParser::LFortranCommandLineParser(int argc, const char *const *argv) : argc(argc) , argv(argv) { // empty } static std::string to_lower(const std::string &s) { std::string result = s; std::transform(result.begin(), result.end(), result.begin(), [](unsigned char c) { return std::tolower(c); }); return result; } static std::string group_key(const std::string &group_name) { std::string key; for (char c : group_name) { if (c == ' ') break; key += static_cast(std::tolower(static_cast(c))); } return key; } static std::vector get_groups(const CLI::App &app) { std::vector groups; for (const auto *opt : app.get_options()) { std::string g = opt->get_group(); if (g.empty() || g == "Options") continue; if (std::find(groups.begin(), groups.end(), g) == groups.end()) { groups.push_back(g); } } return groups; } static std::string find_help_category_arg(int argc, const char *const *argv, const std::vector &args) { if (argv != nullptr) { for (int i = 1; i < argc; ++i) { std::string arg = argv[i]; if (arg.rfind("--help=", 0) == 0) { return arg.substr(7); } } } else { for (const auto &arg : args) { if (arg.rfind("--help=", 0) == 0) { return arg.substr(7); } } } return ""; } static void handle_help_category(const CLI::App &app, const std::string &help_arg) { std::string query = to_lower(help_arg); std::vector groups = get_groups(app); for (const auto &group_name : groups) { std::string key = group_key(group_name); if (key == query || key.rfind(query, 0) == 0) { std::cout << group_name << ":\n"; for (const auto *opt : app.get_options([&group_name](const CLI::Option *o) { return o->get_group() == group_name; })) { std::cout << " " << std::left << std::setw(30) << opt->get_name(false, true) << " " << opt->get_description() << "\n"; } std::exit(0); } } std::cerr << "Unknown help category: " << help_arg << "\n"; std::cerr << "Available categories: "; bool first = true; for (const auto &group_name : groups) { if (!first) std::cerr << ", "; std::cerr << group_key(group_name); first = false; } std::cerr << "\n"; std::exit(1); } auto LFortranCommandLineParser::parse() -> void { CompilerOptions &compiler_options = opts.compiler_options; compiler_options.po.runtime_library_dir = LCompilers::LFortran::get_runtime_library_dir(); std::string group_warning_options = "Warning Options"; std::string group_language_options = "Language Options"; std::string group_preprocessing_options = "Preprocessing Options"; std::string group_output_debugging_options = "Output and Debugging Options"; std::string group_pass_transformation_options = "Pass and Transformation Options"; std::string group_backend_codegen_options = "Backend and Codegen Options"; std::string group_symbol_lookup_options = "Symbol and Lookup Options"; std::string group_mangling_options = "Mangling Options"; std::string group_miscellaneous_options = "Miscellaneous Options"; std::string group_lsp_options = "LSP Options"; bool disable_bounds_checking = false; bool style_suggestions = false; bool disable_warnings = false; bool disable_implicit_argument_casting = false; bool disable_error_banner = false; bool disable_realloc_lhs = false; bool old_classes = false; // Standard options compatible with gfortran, gcc or clang // We follow the established conventions app.add_option("files", opts.arg_files, "Source files"); app.add_flag("-S", opts.arg_S, "Emit assembly, do not assemble or link"); app.add_flag("-c", opts.arg_c, "Compile and assemble, do not link"); // TODO(2025-09-14; CMake <= 4.1.1; https://gitlab.kitware.com/cmake/cmake/-/issues/27225): remove legacy alias when fix is widely available. CLI::Option *legacy_generate_object_code = app.add_flag( "--generate-object-code", compiler_options.separate_compilation, "DEPRECATED: legacy alias for --separate-compilation"); app.add_option("-o", compiler_options.arg_o, "Specify the file to place the compiler's output into"); app.add_flag("-v", opts.arg_v, "Be more verbose"); app.add_flag("-E", opts.arg_E, "Preprocess only; do not compile, assemble or link"); app.add_option("-l", opts.arg_l, "Link library option")->allow_extra_args(false); app.add_option("-L", opts.arg_L, "Library path option")->allow_extra_args(false); app.add_option("-I", compiler_options.po.include_dirs, "Include path")->allow_extra_args(false); app.add_option("-J", compiler_options.po.mod_files_dir, "Where to save mod files"); app.add_flag("-g", compiler_options.emit_debug_info, "Compile with debugging information"); app.add_option("-D", compiler_options.c_preprocessor_defines, "Define = (or 1 if omitted)")->allow_extra_args(false); app.add_flag("--version", opts.arg_version, "Display compiler version information"); app.add_option("-W", opts.linker_flags, "Linker flags")->allow_extra_args(false); app.add_option("-f", opts.f_flags, "All `-f*` flags (only -fPIC & -fdefault-integer-8 supported for now)")->allow_extra_args(false); app.add_option("-O", opts.O_flags, "Optimization level (ignored for now)")->allow_extra_args(false); // LFortran specific options // Warning-related flags app.add_flag("--no-warnings", disable_warnings, "Turn off all warnings")->group(group_warning_options); app.add_flag("--no-style-suggestions", opts.disable_style_suggestions, "Turn off style suggestions")->group(group_warning_options); app.add_flag("--style-suggestions", style_suggestions, "Enable style suggestions")->group(group_warning_options); app.add_flag("--no-error-banner", disable_error_banner, "Turn off error banner")->group(group_warning_options); app.add_option("--error-format", compiler_options.error_format, "Control how errors are produced (human, short)")->capture_default_str()->group(group_warning_options); // Language-related flags (affecting Fortran language behavior, typing, and interfaces) app.add_flag("--fixed-form", compiler_options.fixed_form, "Use fixed form Fortran source parsing")->group(group_language_options); app.add_flag("--fixed-form-infer", opts.fixed_form_infer, "Use heuristics to infer if a file is in fixed form")->group(group_language_options); app.add_option("--std", opts.arg_standard, "Select standard conformance (lf, f23, legacy)")->group(group_language_options); app.add_flag("--implicit-typing", compiler_options.implicit_typing, "Allow implicit typing")->group(group_language_options); app.add_flag("--disable-implicit-typing", opts.disable_implicit_typing, "Disable implicit typing")->group(group_language_options); app.add_flag("--implicit-interface", compiler_options.implicit_interface, "Allow implicit interface")->group(group_language_options); app.add_flag("--implicit-argument-casting", compiler_options.implicit_argument_casting, "Allow implicit argument casting")->group(group_language_options); app.add_flag("--disable-implicit-argument-casting", disable_implicit_argument_casting, "Disable implicit argument casting")->group(group_language_options); app.add_flag("--logical-casting", compiler_options.logical_casting, "Allow logical casting")->group(group_language_options); app.add_flag("--use-loop-variable-after-loop", compiler_options.po.use_loop_variable_after_loop, "Allow using loop variable after the loop")->group(group_language_options); app.add_flag("--legacy-array-sections", compiler_options.legacy_array_sections, "Enables passing array items as sections if required")->group(group_language_options); // Preprocessing-related flags app.add_flag("--cpp", opts.cpp, "Enable C preprocessing")->group(group_preprocessing_options); app.add_flag("--cpp-infer", opts.cpp_infer, "Use heuristics to infer if a file needs preprocessing")->group(group_preprocessing_options); app.add_flag("--no-cpp", opts.no_cpp, "Disable C preprocessing")->group(group_preprocessing_options); app.add_flag("--no-prescan", opts.arg_no_prescan, "Turn off prescanning")->group(group_preprocessing_options); app.add_flag("--show-prescan", opts.show_prescan, "Show the source code after prescanning and exit")->group(group_preprocessing_options); // Output and debugging-related flags app.add_flag("--show-tokens", opts.show_tokens, "Show tokens for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-ast", opts.show_ast, "Show AST for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-asr", opts.show_asr, "Show ASR for the given file and exit")->group(group_output_debugging_options); app.add_flag("--with-intrinsic-mods", compiler_options.po.with_intrinsic_mods, "Show intrinsic modules in ASR")->group(group_output_debugging_options); app.add_flag("--show-ast-f90", opts.show_ast_f90, "Show Fortran from AST for the given file and exit")->group(group_output_debugging_options); app.add_flag("--no-color", opts.arg_no_color, "Turn off colored AST/ASR")->group(group_output_debugging_options); app.add_flag("--runtime-color", opts.arg_runtime_color, "Enable colored runtime errors")->group(group_output_debugging_options); app.add_flag("--no-indent", opts.arg_no_indent, "Turn off Indented print ASR/AST")->group(group_output_debugging_options); app.add_flag("--tree", compiler_options.po.tree, "Tree structure print ASR/AST")->group(group_output_debugging_options); app.add_flag("--json", compiler_options.po.json, "Print ASR/AST Json format")->group(group_output_debugging_options); app.add_flag("--clojure", compiler_options.po.clojure, "Print ASR in clojure format")->group(group_output_debugging_options); app.add_flag("--no-loc", compiler_options.po.no_loc, "Skip location information in ASR/AST Json format")->group(group_output_debugging_options); app.add_flag("--visualize", compiler_options.po.visualize, "Print ASR/AST Visualization")->group(group_output_debugging_options); app.add_flag("--show-llvm", opts.show_llvm, "Show LLVM IR for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-mlir", opts.show_mlir, "Show MLIR for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-llvm-from-mlir", opts.show_llvm_from_mlir, "Show LLVM IR translated from MLIR for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-cpp", opts.show_cpp, "Show C++ translation source for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-c", opts.show_c, "Show C translation source for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-asm", opts.show_asm, "Show assembly for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-wat", opts.show_wat, "Show WAT (WebAssembly Text Format) and exit")->group(group_output_debugging_options); app.add_flag("--show-julia", opts.show_julia, "Show Julia translation source for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-fortran", opts.show_fortran, "Show Fortran translation source for the given file and exit")->group(group_output_debugging_options); app.add_flag("--show-stacktrace", compiler_options.show_stacktrace, "Show internal stacktrace on compiler errors")->group(group_output_debugging_options); app.add_flag("--time-report", compiler_options.time_report, "Show compilation time report")->group(group_output_debugging_options); app.add_flag("--old-classes", old_classes, "Use the old design for OOPs (deprecated)")->group(group_output_debugging_options); // Pass and transformation-related flags app.add_option("--pass", opts.arg_pass, "Apply the ASR pass and show ASR (implies --show-asr)")->group(group_pass_transformation_options); app.add_option("--skip-pass", opts.skip_pass, "Skip an ASR pass in default pipeline")->group(group_pass_transformation_options); app.add_flag("--dump-all-passes", compiler_options.po.dump_all_passes, "Apply all the passes and dump the ASR into a file")->group(group_pass_transformation_options); app.add_flag("--dump-all-passes-fortran", compiler_options.po.dump_fortran, "Apply all passes and dump the ASR after each pass into fortran file")->group(group_pass_transformation_options); app.add_flag("--cumulative", compiler_options.po.pass_cumulative, "Apply all the passes cumulatively till the given pass")->group(group_pass_transformation_options); // Backend and code generation-related flags app.add_option("--backend", opts.arg_backend, "Select a backend (llvm, c, cpp, x86, wasm, fortran, mlir)")->capture_default_str()->group(group_backend_codegen_options); app.add_flag("--openmp", compiler_options.openmp, "Enable openmp")->group(group_backend_codegen_options); app.add_flag("--target-offload", compiler_options.target_offload_enabled, "Enable Target Offloading")->group(group_backend_codegen_options); app.add_flag("--openmp-lib-dir", compiler_options.openmp_lib_dir, "Pass path to openmp library")->capture_default_str()->group(group_backend_codegen_options); app.add_flag("--rtlib", compiler_options.rtlib, "Include the full runtime library in the LLVM output")->group(group_backend_codegen_options); app.add_flag("--separate-compilation", compiler_options.separate_compilation, "Generate object code into .o files")->group(group_backend_codegen_options); app.add_flag("--static", opts.static_link, "Create a static executable")->group(group_backend_codegen_options); app.add_flag("--shared", opts.shared_link, "Create a shared executable")->group(group_backend_codegen_options); app.add_flag("--linker", opts.linker, "Specify the linker to be used, available options: clang or gcc")->capture_default_str()->group(group_backend_codegen_options); app.add_flag("--linker-path", opts.linker_path, "Use the linker from this path")->capture_default_str()->group(group_backend_codegen_options); app.add_option("--target", compiler_options.target, "Generate code for the given target")->capture_default_str()->group(group_backend_codegen_options); app.add_flag("--print-targets", opts.print_targets, "Print the registered targets")->group(group_backend_codegen_options); app.add_flag("--wasm-html", compiler_options.wasm_html, "Generate HTML file using emscripten for LLVM->WASM")->group(group_backend_codegen_options); app.add_option("--emcc-embed", compiler_options.emcc_embed, "Embed a given file/directory using emscripten for LLVM->WASM")->group(group_backend_codegen_options); app.add_flag("--mlir-gpu-offloading", compiler_options.po.enable_gpu_offloading, "Enables gpu offloading using MLIR backend")->group(group_backend_codegen_options); // Symbol and lookup-related flags app.add_flag("--lookup-name", compiler_options.lookup_name, "Lookup a name specified by --line & --column in the ASR")->group(group_symbol_lookup_options); app.add_flag("--rename-symbol", compiler_options.rename_symbol, "Returns list of locations where symbol specified by --line & --column appears in the ASR")->group(group_symbol_lookup_options); app.add_option("--line", compiler_options.line, "Line number for --lookup-name")->capture_default_str()->group(group_symbol_lookup_options); app.add_option("--column", compiler_options.column, "Column number for --lookup-name")->capture_default_str()->group(group_symbol_lookup_options); app.add_flag("--symtab-only", compiler_options.symtab_only, "Only create symbol tables in ASR (skip executable stmt)")->group(group_symbol_lookup_options); // Mangling-related flags app.add_flag("--module-mangling", compiler_options.po.module_name_mangling, "Mangles the module name")->group(group_mangling_options); app.add_flag("--intrinsic-module-mangling", compiler_options.po.intrinsic_module_name_mangling, "Mangles only intrinsic module name")->group(group_mangling_options); app.add_flag("--global-mangling", compiler_options.po.global_symbols_mangling, "Mangles all the global symbols")->group(group_mangling_options); app.add_flag("--intrinsic-mangling", compiler_options.po.intrinsic_symbols_mangling, "Mangles all the intrinsic symbols")->group(group_mangling_options); app.add_flag("--all-mangling", compiler_options.po.all_symbols_mangling, "Mangles all possible symbols")->group(group_mangling_options); app.add_flag("--bindc-mangling", compiler_options.po.bindc_mangling, "Mangles functions with abi bind(c)")->group(group_mangling_options); app.add_flag("--apply-fortran-mangling", compiler_options.po.fortran_mangling, "Mangle symbols with Fortran supported syntax")->group(group_mangling_options); app.add_flag("--mangle-underscore", compiler_options.po.mangle_underscore, "Mangles with underscore")->group(group_mangling_options); app.add_flag("--mangle-underscore-external", compiler_options.po.mangle_underscore_external, "Mangles external symbols with underscore")->group(group_mangling_options); // Miscellaneous flags app.add_flag("--continue-compilation", compiler_options.continue_compilation, "collect error message and continue compilation")->group(group_miscellaneous_options); app.add_flag("--semantics-only", compiler_options.semantics_only, "do parsing and semantics, and report all the errors")->group(group_miscellaneous_options); app.add_flag("--print-leading-space", compiler_options.print_leading_space, "Print leading white space if format is unspecified")->group(group_miscellaneous_options); app.add_flag("--interactive-parse", compiler_options.interactive, "Use interactive parse")->group(group_miscellaneous_options); app.add_flag("--verbose", compiler_options.po.verbose, "Print debugging statements")->group(group_miscellaneous_options); app.add_flag("--fast", compiler_options.po.fast, "Best performance (disable strict standard compliance)")->group(group_miscellaneous_options); app.add_flag("--realloc-lhs-arrays", compiler_options.po.realloc_lhs_arrays, "Reallocate left hand side automatically for arrays")->group(group_miscellaneous_options); app.add_flag("--disable-realloc-lhs-arrays", disable_realloc_lhs, "Disables reallocating left hand side automatically for arrays")->group(group_miscellaneous_options); app.add_flag("--ignore-pragma", compiler_options.ignore_pragma, "Ignores all the pragmas")->group(group_miscellaneous_options); app.add_flag("--stack-arrays", compiler_options.stack_arrays, "Allocate memory for arrays on stack")->group(group_miscellaneous_options); app.add_flag("--descriptor-index-64", compiler_options.descriptor_index_64, "Use 64-bit indices in array descriptors (implied by -fdefault-integer-8)")->group(group_miscellaneous_options); app.add_flag("--array-bounds-checking", compiler_options.po.bounds_checking, "Enables runtime array bounds checking")->group(group_miscellaneous_options); app.add_flag("--no-array-bounds-checking", disable_bounds_checking, "Disables runtime array bounds checking")->group(group_miscellaneous_options); app.add_flag("--strict-array-bounds-checking", compiler_options.po.strict_bounds_checking, "Enables strict runtime array bounds checking: Array passed into subroutine must exactly match the expected size")->group(group_miscellaneous_options); // LSP specific options app.add_flag("--show-errors", opts.show_errors, "Show errors when LSP is running in the background")->group(group_lsp_options); app.add_flag("--show-document-symbols", opts.show_document_symbols, "Show symbols in lfortran file")->group(group_lsp_options); /* * Subcommands: */ // fmt fmt = app.add_subcommand("fmt", "Format Fortran source files."); fmt->add_option("file", opts.arg_fmt_file, "Fortran source file to format")->required(); fmt->add_flag("-i", opts.arg_fmt_inplace, "Modify in-place (instead of writing to stdout)"); fmt->add_option("--spaces", opts.arg_fmt_indent, "Number of spaces to use for indentation")->capture_default_str(); fmt->add_flag("--indent-unit", opts.arg_fmt_indent_unit, "Indent contents of sub / fn / prog / mod"); fmt->add_flag("--no-color", opts.arg_fmt_no_color, "Turn off color when writing to stdout"); // kernel kernel = app.add_subcommand("kernel", "Run in Jupyter kernel mode."); kernel->add_option("-f", opts.arg_kernel_f, "The kernel connection file")->required(); // mod mod = app.add_subcommand("mod", "Fortran mod file utilities."); mod->add_option("file", opts.arg_mod_file, "Mod file (*.mod)")->required(); mod->add_flag("--show-asr", opts.arg_mod_show_asr, "Show ASR for the module"); mod->add_flag("--no-color", opts.arg_mod_no_color, "Turn off colored ASR"); // pywrap pywrap = app.add_subcommand("pywrap", "Python wrapper generator"); pywrap->add_option("file", opts.arg_pywrap_file, "Fortran source file (*.f90)")->required(); pywrap->add_option("--array-order", opts.arg_pywrap_array_order, "Select array order (c, f)")->capture_default_str(); #ifdef WITH_LSP // server server = languageServerInterface.prepare(app); #endif app.get_formatter()->column_width(25); app.require_subcommand(0, 1); std::string help_arg = find_help_category_arg(argc, argv, args); if (!help_arg.empty()) { handle_help_category(app, help_arg); } if (argv != nullptr) { app.parse(argc, argv); } else { app.parse(args); } if (opts.disable_style_suggestions) { compiler_options.show_style_suggestions = false; } if (disable_warnings) { compiler_options.show_warnings = false; } if (disable_error_banner) { compiler_options.show_error_banner = false; } // Emit deprecation warning for legacy flag alias, unless warnings are disabled if (legacy_generate_object_code && legacy_generate_object_code->count() > 0) { if (!disable_warnings) { std::cerr << "warning: `--generate-object-code` is deprecated and will be " << "removed in a future release; use `--separate-compilation` instead.\n"; } } if (opts.arg_standard == "" || opts.arg_standard == "lf") { // The default LFortran behavior, do nothing } else if (opts.arg_standard == "f23") { compiler_options.show_style_suggestions = false; if (style_suggestions) { compiler_options.show_style_suggestions = true; } compiler_options.implicit_typing = true; if (opts.disable_implicit_typing) { compiler_options.implicit_typing = false; } compiler_options.implicit_argument_casting = true; if (disable_implicit_argument_casting) { compiler_options.implicit_argument_casting = false; } compiler_options.implicit_interface = true; compiler_options.print_leading_space = true; compiler_options.logical_casting = false; compiler_options.po.realloc_lhs_arrays = true; } else if (opts.arg_standard == "legacy") { // f23 compiler_options.show_style_suggestions = false; if (style_suggestions) { compiler_options.show_style_suggestions = true; } compiler_options.implicit_typing = true; if (opts.disable_implicit_typing) { compiler_options.implicit_typing = false; } compiler_options.implicit_argument_casting = true; if (disable_implicit_argument_casting) { compiler_options.implicit_argument_casting = false; } compiler_options.implicit_interface = true; compiler_options.print_leading_space = true; compiler_options.logical_casting = false; // legacy options compiler_options.fixed_form = true; compiler_options.legacy_array_sections = true; compiler_options.use_loop_variable_after_loop = true; compiler_options.separate_compilation = true; } else { throw lc::LCompilersException( "The option `--std=" + opts.arg_standard + "` is not supported" ); } if (disable_bounds_checking || compiler_options.po.fast) { compiler_options.po.bounds_checking = false; compiler_options.po.strict_bounds_checking = false; } if (disable_realloc_lhs) { compiler_options.po.realloc_lhs_arrays = false; } if (old_classes) { compiler_options.new_classes = false; } compiler_options.use_colors = !opts.arg_no_color; compiler_options.use_runtime_colors = opts.arg_runtime_color; compiler_options.indent = !opts.arg_no_indent; compiler_options.prescan = !opts.arg_no_prescan; // set openmp in pass options compiler_options.po.openmp = compiler_options.openmp; for (auto &f_flag : opts.f_flags) { if (f_flag == "PIC") { // Position Independent Code // We do this by default, so we ignore for now } else if (f_flag == "default-integer-8") { compiler_options.po.default_integer_kind = 8; compiler_options.descriptor_index_64 = true; compiler_options.po.descriptor_index_64 = true; } else { throw lc::LCompilersException( "The flag `-f" + f_flag + "` is not supported" ); } } // if it's the only file, then we use that file // to set the compiler_options if (opts.arg_files.size() > 0) { opts.arg_file = opts.arg_files[0]; for (const auto& file : opts.arg_files) { // if any Fortran file is present, use the first file to // set compiler_options if (endswith(file, ".f90") || endswith(file, ".f") || endswith(file, ".F90") || endswith(file, ".F")) { opts.arg_file = file; break; } } } if (opts.disable_style_suggestions && style_suggestions) { throw lc::LCompilersException("Cannot use --no-style-suggestions and --style-suggestions at the same time"); } if (opts.disable_implicit_typing && compiler_options.implicit_typing) { throw lc::LCompilersException("Cannot use --disable-implicit-typing and --implicit-typing at the same time"); } if (disable_implicit_argument_casting && compiler_options.implicit_argument_casting) { throw lc::LCompilersException("Cannot use --disable-implicit-argument-casting and --implicit-argument-casting at the same time"); } // Decide if a file is fixed format based on the extension // Gfortran does the same thing if (opts.fixed_form_infer && (endswith(opts.arg_file, ".f") || endswith(opts.arg_file, ".F"))) { compiler_options.fixed_form = true; } if (opts.disable_implicit_typing) { compiler_options.implicit_typing = false; } if (disable_implicit_argument_casting) { compiler_options.implicit_argument_casting = false; } if (opts.cpp && opts.no_cpp) { throw LCompilers::LCompilersException("Cannot use --cpp and --no-cpp at the same time"); } else if(opts.cpp) { compiler_options.c_preprocessor = true; } else if(opts.no_cpp) { compiler_options.c_preprocessor = false; // Decide if a file gets preprocessing based on the extension // Gfortran does the same thing } else if (opts.cpp_infer && (endswith(opts.arg_file, ".F90") || endswith(opts.arg_file, ".F"))) { compiler_options.c_preprocessor = true; } else { compiler_options.c_preprocessor = false; } // Propagate descriptor_index_64 to PassOptions if (compiler_options.descriptor_index_64) { compiler_options.po.descriptor_index_64 = true; } } } // namespace LCompilers::CommandLineInterface lfortran-lfortran-2f73434/src/bin/tpl/0000775000175000017500000000000015141516316017771 5ustar alastairalastairlfortran-lfortran-2f73434/src/bin/tpl/whereami/0000775000175000017500000000000015141516316021572 5ustar alastairalastairlfortran-lfortran-2f73434/src/bin/tpl/whereami/whereami.cpp0000664000175000017500000003771515141516316024114 0ustar alastairalastair// (‑●‑●)> dual licensed under the WTFPL v2 and MIT licenses // without any warranty. // by Gregory Pakosz (@gpakosz) // https://github.com/gpakosz/whereami // in case you want to #include "whereami.c" in a larger compilation unit #if !defined(WHEREAMI_H) #include "whereami.h" #endif #ifdef __cplusplus extern "C" { #endif #if defined(__linux__) || defined(__CYGWIN__) #undef _DEFAULT_SOURCE #define _DEFAULT_SOURCE #elif defined(__APPLE__) #undef _DARWIN_C_SOURCE #define _DARWIN_C_SOURCE #define _DARWIN_BETTER_REALPATH #endif #if !defined(WAI_MALLOC) || !defined(WAI_FREE) || !defined(WAI_REALLOC) #include #endif #if !defined(WAI_MALLOC) #define WAI_MALLOC(size) malloc(size) #endif #if !defined(WAI_FREE) #define WAI_FREE(p) free(p) #endif #if !defined(WAI_REALLOC) #define WAI_REALLOC(p, size) realloc(p, size) #endif #ifndef WAI_NOINLINE #if defined(_MSC_VER) #define WAI_NOINLINE __declspec(noinline) #elif defined(__GNUC__) #define WAI_NOINLINE __attribute__((noinline)) #else #error unsupported compiler #endif #endif #if defined(_MSC_VER) #define WAI_RETURN_ADDRESS() _ReturnAddress() #elif defined(__GNUC__) #define WAI_RETURN_ADDRESS() __builtin_extract_return_addr(__builtin_return_address(0)) #else #error unsupported compiler #endif #if defined(_WIN32) #ifndef NOMINMAX #define NOMINMAX #endif // NOMINMAX #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #if defined(_MSC_VER) #pragma warning(push, 3) #endif #include #include #if defined(_MSC_VER) #pragma warning(pop) #endif #include static int WAI_PREFIX(getModulePath_)(HMODULE module, char* out, int capacity, int* dirname_length) { wchar_t buffer1[MAX_PATH]; wchar_t buffer2[MAX_PATH]; wchar_t* path = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { DWORD size; int length_, length__; size = GetModuleFileNameW(module, buffer1, sizeof(buffer1) / sizeof(buffer1[0])); if (size == 0) break; else if (size == (DWORD)(sizeof(buffer1) / sizeof(buffer1[0]))) { DWORD size_ = size; do { wchar_t* path_; path_ = (wchar_t*)WAI_REALLOC(path, sizeof(wchar_t) * size_ * 2); if (!path_) break; size_ *= 2; path = path_; size = GetModuleFileNameW(module, path, size_); } while (size == size_); if (size == size_) break; } else path = buffer1; if (!_wfullpath(buffer2, path, MAX_PATH)) break; length_ = (int)wcslen(buffer2); length__ = WideCharToMultiByte(CP_UTF8, 0, buffer2, length_ , out, capacity, NULL, NULL); if (length__ == 0) length__ = WideCharToMultiByte(CP_UTF8, 0, buffer2, length_, NULL, 0, NULL, NULL); if (length__ == 0) break; if (length__ <= capacity && dirname_length) { int i; for (i = length__ - 1; i >= 0; --i) { if (out[i] == '\\') { *dirname_length = i; break; } } } length = length__; } if (path != buffer1) WAI_FREE(path); return ok ? length : -1; } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { return WAI_PREFIX(getModulePath_)(NULL, out, capacity, dirname_length); } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { HMODULE module; int length = -1; #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable: 4054) #endif if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)WAI_RETURN_ADDRESS(), &module)) #if defined(_MSC_VER) #pragma warning(pop) #endif { length = WAI_PREFIX(getModulePath_)(module, out, capacity, dirname_length); } return length; } #elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(WAI_USE_PROC_SELF_EXE) #include #include #include #if defined(__linux__) //#include #define PATH_MAX 16384 #else #include #endif #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif #include #include #if !defined(WAI_PROC_SELF_EXE) #if defined(__sun) #define WAI_PROC_SELF_EXE "/proc/self/path/a.out" #else #define WAI_PROC_SELF_EXE "/proc/self/exe" #endif #endif WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { resolved = realpath(WAI_PROC_SELF_EXE, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } return ok ? length : -1; } #if !defined(WAI_PROC_SELF_MAPS_RETRY) #define WAI_PROC_SELF_MAPS_RETRY 5 #endif #if !defined(WAI_PROC_SELF_MAPS) #if defined(__sun) #define WAI_PROC_SELF_MAPS "/proc/self/map" #else #define WAI_PROC_SELF_MAPS "/proc/self/maps" #endif #endif #if defined(__ANDROID__) || defined(ANDROID) #include #include #include #endif #include WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { int length = -1; FILE* maps = NULL; for (int r = 0; r < WAI_PROC_SELF_MAPS_RETRY; ++r) { maps = fopen(WAI_PROC_SELF_MAPS, "r"); if (!maps) break; for (;;) { char buffer[PATH_MAX < 1024 ? 1024 : PATH_MAX]; uint64_t low, high; char perms[5]; uint64_t offset; uint32_t major, minor; char path[PATH_MAX]; uint32_t inode; if (!fgets(buffer, sizeof(buffer), maps)) break; if (sscanf(buffer, "%" PRIx64 "-%" PRIx64 " %s %" PRIx64 " %x:%x %u %s\n", &low, &high, perms, &offset, &major, &minor, &inode, path) == 8) { uint64_t addr = (uintptr_t)WAI_RETURN_ADDRESS(); if (low <= addr && addr <= high) { char* resolved; resolved = realpath(path, buffer); if (!resolved) break; length = (int)strlen(resolved); #if defined(__ANDROID__) || defined(ANDROID) if (length > 4 &&buffer[length - 1] == 'k' &&buffer[length - 2] == 'p' &&buffer[length - 3] == 'a' &&buffer[length - 4] == '.') { int fd = open(path, O_RDONLY); if (fd == -1) { length = -1; // retry break; } char* begin = (char*)mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0); if (begin == MAP_FAILED) { close(fd); length = -1; // retry break; } char* p = begin + offset - 30; // minimum size of local file header while (p >= begin) // scan backwards { if (*((uint32_t*)p) == 0x04034b50UL) // local file header signature found { uint16_t length_ = *((uint16_t*)(p + 26)); if (length + 2 + length_ < (int)sizeof(buffer)) { memcpy(&buffer[length], "!/", 2); memcpy(&buffer[length + 2], p + 30, length_); length += 2 + length_; } break; } --p; } munmap(begin, offset); close(fd); } #endif if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } break; } } } fclose(maps); maps = NULL; if (length != -1) break; } return length; } #elif defined(__APPLE__) #include #include #include #include #include #include WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* path = buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { uint32_t size = (uint32_t)sizeof(buffer1); if (_NSGetExecutablePath(path, &size) == -1) { path = (char*)WAI_MALLOC(size); if (!_NSGetExecutablePath(path, &size)) break; } resolved = realpath(path, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } if (path != buffer1) WAI_FREE(path); return ok ? length : -1; } WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #elif defined(__QNXNTO__) #include #include #include #include #include #include #if !defined(WAI_PROC_SELF_EXE) #define WAI_PROC_SELF_EXE "/proc/self/exefile" #endif WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* resolved = NULL; FILE* self_exe = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { self_exe = fopen(WAI_PROC_SELF_EXE, "r"); if (!self_exe) break; if (!fgets(buffer1, sizeof(buffer1), self_exe)) break; resolved = realpath(buffer1, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } fclose(self_exe); return ok ? length : -1; } WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #elif defined(__DragonFly__) || defined(__FreeBSD__) || \ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) #include #include #include #include #include #include #include #if defined(__OpenBSD__) #include WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[4096]; char buffer2[PATH_MAX]; char buffer3[PATH_MAX]; char** argv = (char**)buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { int mib[4] = { CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_ARGV }; size_t size; if (sysctl(mib, 4, NULL, &size, NULL, 0) != 0) break; if (size > sizeof(buffer1)) { argv = (char**)WAI_MALLOC(size); if (!argv) break; } if (sysctl(mib, 4, argv, &size, NULL, 0) != 0) break; if (strchr(argv[0], '/')) { resolved = realpath(argv[0], buffer2); if (!resolved) break; } else { const char* PATH = getenv("PATH"); if (!PATH) break; size_t argv0_length = strlen(argv[0]); const char* begin = PATH; while (1) { const char* separator = strchr(begin, ':'); const char* end = separator ? separator : begin + strlen(begin); if (end - begin > 0) { if (*(end -1) == '/') --end; if (((end - begin) + 1 + argv0_length + 1) <= sizeof(buffer2)) { memcpy(buffer2, begin, end - begin); buffer2[end - begin] = '/'; memcpy(buffer2 + (end - begin) + 1, argv[0], argv0_length + 1); resolved = realpath(buffer2, buffer3); if (resolved) break; } } if (!separator) break; begin = ++separator; } if (!resolved) break; } length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } if (argv != (char**)buffer1) WAI_FREE(argv); return ok ? length : -1; } #else WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) { char buffer1[PATH_MAX]; char buffer2[PATH_MAX]; char* path = buffer1; char* resolved = NULL; int length = -1; bool ok; for (ok = false; !ok; ok = true) { #if defined(__NetBSD__) int mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME }; #else int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; #endif size_t size = sizeof(buffer1); if (sysctl(mib, 4, path, &size, NULL, 0) != 0) break; resolved = realpath(path, buffer2); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } return ok ? length : -1; } #endif WAI_NOINLINE WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) { char buffer[PATH_MAX]; char* resolved = NULL; int length = -1; for(;;) { Dl_info info; if (dladdr(WAI_RETURN_ADDRESS(), &info)) { resolved = realpath(info.dli_fname, buffer); if (!resolved) break; length = (int)strlen(resolved); if (length <= capacity) { memcpy(out, resolved, length); if (dirname_length) { int i; for (i = length - 1; i >= 0; --i) { if (out[i] == '/') { *dirname_length = i; break; } } } } } break; } return length; } #else #error unsupported platform #endif #ifdef __cplusplus } #endif lfortran-lfortran-2f73434/src/bin/tpl/whereami/whereami.h0000664000175000017500000000374115141516316023551 0ustar alastairalastair// (‑●‑●)> dual licensed under the WTFPL v2 and MIT licenses // without any warranty. // by Gregory Pakosz (@gpakosz) // https://github.com/gpakosz/whereami #ifndef WHEREAMI_H #define WHEREAMI_H #ifdef __cplusplus extern "C" { #endif #ifndef WAI_FUNCSPEC #define WAI_FUNCSPEC #endif #ifndef WAI_PREFIX #define WAI_PREFIX(function) wai_##function #endif /** * Returns the path to the current executable. * * Usage: * - first call `int length = wai_getExecutablePath(NULL, 0, NULL);` to * retrieve the length of the path * - allocate the destination buffer with `path = (char*)malloc(length + 1);` * - call `wai_getExecutablePath(path, length, NULL)` again to retrieve the * path * - add a terminal NUL character with `path[length] = '\0';` * * @param out destination buffer, optional * @param capacity destination buffer capacity * @param dirname_length optional recipient for the length of the dirname part * of the path. * * @return the length of the executable path on success (without a terminal NUL * character), otherwise `-1` */ WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length); /** * Returns the path to the current module * * Usage: * - first call `int length = wai_getModulePath(NULL, 0, NULL);` to retrieve * the length of the path * - allocate the destination buffer with `path = (char*)malloc(length + 1);` * - call `wai_getModulePath(path, length, NULL)` again to retrieve the path * - add a terminal NUL character with `path[length] = '\0';` * * @param out destination buffer, optional * @param capacity destination buffer capacity * @param dirname_length optional recipient for the length of the dirname part * of the path. * * @return the length of the module path on success (without a terminal NUL * character), otherwise `-1` */ WAI_FUNCSPEC int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length); #ifdef __cplusplus } #endif #endif // #ifndef WHEREAMI_H lfortran-lfortran-2f73434/src/bin/tpl/cpp-terminal/0000775000175000017500000000000015141516316022364 5ustar alastairalastairlfortran-lfortran-2f73434/src/bin/tpl/cpp-terminal/terminal.h0000664000175000017500000005615115141516316024360 0ustar alastairalastair#ifndef TERMINAL_H #define TERMINAL_H /* This file is all platform independent, it contains the logic to build * the features that users need in a terminal application. * * The ANSI escape sequences used here are supported by all terminals (Linux, * macOS, Windows). All the functionality here must work on all platforms. The * Windows terminal is probably the most limiting, and so we restrict to the * capabilities that it supports, as documented at: * * https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences */ #include #include #include #include #include #include #define CTRL_KEY(k) (char)(((unsigned char)(k) & 0x1f)) #define ALT_KEY(k) (char)(((unsigned char)(k) + 0x80)) namespace Term { enum class style { reset = 0, bold = 1, dim = 2, italic = 3, underline = 4, blink = 5, rblink = 6, reversed = 7, conceal = 8, crossed = 9 }; enum class fg { black = 30, red = 31, green = 32, yellow = 33, blue = 34, magenta = 35, cyan = 36, gray = 37, reset = 39 }; enum class bg { black = 40, red = 41, green = 42, yellow = 43, blue = 44, magenta = 45, cyan = 46, gray = 47, reset = 49 }; enum class fgB { black = 90, red = 91, green = 92, yellow = 93, blue = 94, magenta = 95, cyan = 96, gray = 97 }; enum class bgB { black = 100, red = 101, green = 102, yellow = 103, blue = 104, magenta = 105, cyan = 106, gray = 107 }; template std::string color(T const value) { return "\033[" + std::to_string(static_cast(value)) + "m"; } inline std::string cursor_off() { return "\x1b[?25l"; } inline std::string cursor_on() { return "\x1b[?25h"; } // If an attempt is made to move the cursor out of the window, the result is // undefined. // TODO: switch col/row inline std::string move_cursor(size_t row, size_t col) { return "\x1b[" + std::to_string(row) + ";" + std::to_string(col) + "H"; } // If an attempt is made to move the cursor to the right of the right margin, // the cursor stops at the right margin. inline std::string move_cursor_right(int col) { return "\x1b[" + std::to_string(col) + "C"; } // If an attempt is made to move the cursor below the bottom margin, the cursor // stops at the bottom margin. inline std::string move_cursor_down(int row) { return "\x1b[" + std::to_string(row) + "B"; } inline std::string cursor_position_report() { return "\x1b[6n"; } inline std::string erase_to_eol() { return "\x1b[K"; } enum Key { BACKSPACE = 1000, ENTER, ALT_ENTER, TAB, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ARROW_DOWN, CTRL_UP, CTRL_DOWN, CTRL_RIGHT, CTRL_LEFT, NUMERIC_5, DEL, HOME, INSERT, END, PAGE_UP, PAGE_DOWN, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, }; class Terminal: public BaseTerminal { bool restore_screen_; public: Terminal(bool enable_keyboard=false, bool disable_ctrl_c=true) : BaseTerminal(enable_keyboard, disable_ctrl_c), restore_screen_{false} {} virtual ~Terminal() { restore_screen(); } void restore_screen() { if (restore_screen_) { write("\033[?1049l"); // restore screen write("\033" "8"); // restore current cursor position restore_screen_ = false; } } void save_screen() { restore_screen_ = true; write("\033" "7"); // save current cursor position write("\033[?1049h"); // save screen } inline void write(const std::string& s) const { std::cout << s << std::flush; } // Waits for a key press, translates escape codes int read_key() const { int key; while ((key = read_key0()) == 0) { std::this_thread::sleep_for(std::chrono::milliseconds(10)); } return key; } // If there was a key press, returns the translated key from escape codes, // otherwise returns 0. If the escape code is not supported, returns a // negative number. int read_key0() const { char c; if (!read_raw(&c)) return 0; if (c == '\x1b') { char seq[4]; if (!read_raw(&seq[0])) return Key::ESC; if (!read_raw(&seq[1])) { if (seq[0] >= 'a' && seq[0] <= 'z') { // gnome-term, Windows Console return ALT_KEY(seq[0]); } if (seq[0] == '\x0d') { // gnome-term return Key::ALT_ENTER; } return -1; } if (seq[0] == '[') { if (seq[1] >= '0' && seq[1] <= '9') { if (!read_raw(&seq[2])) { return -2; } if (seq[2] == '~') { switch (seq[1]) { case '1': return Key::HOME; case '2': return Key::INSERT; case '3': return Key::DEL; case '4': return Key::END; case '5': return Key::PAGE_UP; case '6': return Key::PAGE_DOWN; case '7': return Key::HOME; case '8': return Key::END; } } else if (seq[2] == ';') { if (seq[1] == '1') { if (!read_raw(&seq[2])) { return -10; } if (!read_raw(&seq[3])) { return -11; } if (seq[2] == '5') { switch (seq[3]) { case 'A': return Key::CTRL_UP; case 'B': return Key::CTRL_DOWN; case 'C': return Key::CTRL_RIGHT; case 'D': return Key::CTRL_LEFT; } } return -12; } } else { if (seq[2] >= '0' && seq[2] <= '9') { if (!read_raw(&seq[3])) { return -3; } if (seq[3] == '~') { if (seq[1] == '1') { switch (seq[2]) { case '5': return Key::F5; case '7': return Key::F6; case '8': return Key::F7; case '9': return Key::F8; } } else if (seq[1] == '2') { switch (seq[2]) { case '0': return Key::F9; case '1': return Key::F10; case '3': return Key::F11; case '4': return Key::F12; } } } } } } else { switch (seq[1]) { case 'A': return Key::ARROW_UP; case 'B': return Key::ARROW_DOWN; case 'C': return Key::ARROW_RIGHT; case 'D': return Key::ARROW_LEFT; case 'E': return Key::NUMERIC_5; case 'H': return Key::HOME; case 'F': return Key::END; } } } else if (seq[0] == 'O') { switch (seq[1]) { case 'F': return Key::END; case 'H': return Key::HOME; case 'P': return Key::F1; case 'Q': return Key::F2; case 'R': return Key::F3; case 'S': return Key::F4; } } //std::cout << "Unsupported escape sequence:" << std::endl; //std::cout << seq[0] << seq[1] << seq[2] << seq[3] << std::endl; return -4; } else { switch (c) { case '\x09': // TAB return Key::TAB; case '\x0a': // LF return Key::ENTER; case '\x0d': // CR return Key::ENTER; case '\x7f': // DEL return Key::BACKSPACE; } if (c == '\xc3') { if (!read_raw(&c)) { return -8; } else { if (c >= '\xa1' && c <= '\xba') { // xterm return ALT_KEY(c+'a'-'\xa1'); } return -9; } } else if (c == '\xc2') { if (!read_raw(&c)) { return -10; } else { if (c == '\x8d') { // xterm return Key::ALT_ENTER; } return -11; } } return c; } } // TODO: switch rows, cols void get_cursor_position(int& rows, int& cols) const { char buf[32]; unsigned int i = 0; write(cursor_position_report()); while (i < sizeof(buf) - 1) { while (!read_raw(&buf[i])) { }; if (buf[i] == 'R') break; i++; } buf[i] = '\0'; if (i < 5) { throw std::runtime_error("get_cursor_position(): too short response"); } // Find the result in the response, drop the rest: i = 0; while (i < sizeof(buf) - 1 - 5) { if (buf[i] == '\x1b' && buf[i+1] == '[') { if (sscanf(&buf[i+2], "%d;%d", &rows, &cols) == 2) { return; } else { throw std::runtime_error("get_cursor_position(): result could not be parsed"); } } if (buf[i] == '\0') break; i++; } throw std::runtime_error("get_cursor_position(): result not found in the response"); } // This function takes about 23ms, so it should only be used as a fallback void get_term_size_slow(int& rows, int& cols) const { struct CursorOff { const Terminal& term; CursorOff(const Terminal& term) : term{ term } { term.write(cursor_off()); } ~CursorOff() { term.write(cursor_on()); } }; CursorOff cursor_off(*this); int old_row, old_col; get_cursor_position(old_row, old_col); write(move_cursor_right(999) + move_cursor_down(999)); get_cursor_position(rows, cols); write(move_cursor(old_row, old_col)); } }; /*----------------------------------------------------------------------------*/ #define UTF8_ACCEPT 0 #define UTF8_REJECT 0xf static inline uint8_t utf8_decode_step(uint8_t state, uint8_t octet, uint32_t *cpp) { static const uint32_t utf8_classtab[0x10] = { 0x88888888UL,0x88888888UL,0x99999999UL,0x99999999UL, 0xaaaaaaaaUL,0xaaaaaaaaUL,0xaaaaaaaaUL,0xaaaaaaaaUL, 0x222222ffUL,0x22222222UL,0x22222222UL,0x22222222UL, 0x3333333bUL,0x33433333UL,0xfff5666cUL,0xffffffffUL, }; static const uint32_t utf8_statetab[0x10] = { 0xfffffff0UL,0xffffffffUL,0xfffffff1UL,0xfffffff3UL, 0xfffffff4UL,0xfffffff7UL,0xfffffff6UL,0xffffffffUL, 0x33f11f0fUL,0xf3311f0fUL,0xf33f110fUL,0xfffffff2UL, 0xfffffff5UL,0xffffffffUL,0xffffffffUL,0xffffffffUL, }; const uint8_t reject = (state >> 3), nonascii = (octet >> 7); const uint8_t class_ = (!nonascii? 0 : (0xf & (utf8_classtab[(octet >> 3) & 0xf] >> (4 * (octet & 7))))); *cpp = (state == UTF8_ACCEPT ? (octet & (0xffU >> class_)) : ((octet & 0x3fU) | (*cpp << 6))); return (reject? 0xf : (0xf & (utf8_statetab[class_] >> (4 * (state & 7))))); } /*----------------------------------------------------------------------------*/ inline void codepoint_to_utf8(std::string &s, char32_t c) { if (c > 0x0010FFFF) { throw std::runtime_error("Invalid UTF32 codepoint."); } char bytes[4]; int nbytes = 1; char32_t d = c; if (c >= 0x10000) { nbytes++; bytes[3] = ((d | 0x80) & 0xBF); d >>= 6; } if (c >= 0x800) { nbytes++; bytes[2] = ((d | 0x80) & 0xBF); d >>= 6; } if (c >= 0x80) { nbytes++; bytes[1] = ((d | 0x80) & 0xBF); d >>= 6; } static const unsigned char mask[4] = {0x00, 0xC0, 0xE0, 0xF0}; bytes[0] = static_cast(d | mask[nbytes-1]); s.append(bytes, nbytes); } /*----------------------------------------------------------------------------*/ // Converts an UTF8 string to UTF32. inline std::u32string utf8_to_utf32(const std::string &s) { uint32_t codepoint; uint8_t state=UTF8_ACCEPT; std::u32string r; for (size_t i=0; i < s.size(); i++) { state = utf8_decode_step(state, s[i], &codepoint); if (state == UTF8_ACCEPT) { r.push_back(codepoint); } if (state == UTF8_REJECT) { throw std::runtime_error("Invalid byte in UTF8 encoded string"); } } if (state != UTF8_ACCEPT) { throw std::runtime_error("Expected more bytes in UTF8 encoded string"); } return r; } // Converts an UTF32 string to UTF8. inline std::string utf32_to_utf8(const std::u32string &s) { std::string r; for (size_t i=0; i < s.size(); i++) { codepoint_to_utf8(r, s[i]); } return r; } // TODO: // * Rename Window to Screen, as it really is a model of the terminal screen, // and should only be used once per application. If an application has windows, // those should be built on top, and they should render to Screen. // * Remember cursor position also (and if it is on or off) // * Implement screen diffing (taking another Window instance as an argument in // render()) /* Represents a rectangular window, as a 2D array of characters and their * attributes. The render method can convert this internal representation to a * string that when printed will show the Window on the screen. * * Note: the characters are represented by char32_t, representing their UTF-32 * code point. The natural way to represent a character in a terminal would be * a "unicode grapheme cluster", but due to a lack of a good library for C++ * that could handle those, we simply use a Unicode code point as a character. */ class Window { private: size_t w, h; // width and height of the window size_t cursor_x, cursor_y; // current cursor position std::vector chars; // the characters in row first order std::vector m_fg; std::vector m_bg; std::vector lfortran-lfortran-2f73434/doc/src/_static/css/0000775000175000017500000000000015141516316021405 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/_static/css/ansi.css0000664000175000017500000000547115141516316023060 0ustar alastairalastair.output_text pre { font-size: 12px; line-height: 14px; background-color: #000000; color: #FFFFFF; padding: 2px; } /* CSS font colors for translated ANSI escape sequences */ /* The color values are a mix of http://www.xcolors.net/dl/baskerville-ivorylight and http://www.xcolors.net/dl/euphrasia */ .ansi-black-fg { color: #3E424D; } .ansi-black-bg { background-color: #3E424D; } .ansi-black-intense-fg { color: #282C36; } .ansi-black-intense-bg { background-color: #282C36; } .ansi-red-fg { color: #E75C58; } .ansi-red-bg { background-color: #E75C58; } .ansi-red-intense-fg { color: #B22B31; } .ansi-red-intense-bg { background-color: #B22B31; } .ansi-green-fg { color: #4E9A06; } .ansi-green-bg { background-color: #00A250; } .ansi-green-intense-fg { color: #8AE234; } .ansi-green-intense-bg { background-color: #007427; } .ansi-yellow-fg { color: #DDB62B; } .ansi-yellow-bg { background-color: #DDB62B; } .ansi-yellow-intense-fg { color: #B27D12; } .ansi-yellow-intense-bg { background-color: #B27D12; } .ansi-blue-fg { color: #208FFB; } .ansi-blue-bg { background-color: #208FFB; } .ansi-blue-intense-fg { color: #729FCF; } .ansi-blue-intense-bg { background-color: #0065CA; } .ansi-magenta-fg { color: #D160C4; } .ansi-magenta-bg { background-color: #D160C4; } .ansi-magenta-intense-fg { color: #A03196; } .ansi-magenta-intense-bg { background-color: #A03196; } .ansi-cyan-fg { color: #60C6C8; } .ansi-cyan-bg { background-color: #60C6C8; } .ansi-cyan-intense-fg { color: #258F8F; } .ansi-cyan-intense-bg { background-color: #258F8F; } .ansi-white-fg { color: #C5C1B4; } .ansi-white-bg { background-color: #C5C1B4; } .ansi-white-intense-fg { color: #A1A6B2; } .ansi-white-intense-bg { background-color: #A1A6B2; } .ansi-default-inverse-fg { color: #FFFFFF; } .ansi-default-inverse-bg { background-color: #000000; } .ansi-bold { font-weight: bold; } .ansi-underline { text-decoration: underline; } /* The following styles are deprecated an will be removed in a future version */ .ansibold { font-weight: bold; } .ansi-inverse { outline: 0.5px dotted; } /* use dark versions for foreground, to improve visibility */ .ansiblack { color: black; } .ansired { color: darkred; } .ansigreen { color: darkgreen; } .ansiyellow { color: #c4a000; } .ansiblue { color: darkblue; } .ansipurple { color: darkviolet; } .ansicyan { color: steelblue; } .ansigray { color: gray; } /* and light for background, for the same reason */ .ansibgblack { background-color: black; } .ansibgred { background-color: red; } .ansibggreen { background-color: green; } .ansibgyellow { background-color: yellow; } .ansibgblue { background-color: blue; } .ansibgpurple { background-color: magenta; } .ansibgcyan { background-color: cyan; } .ansibggray { background-color: gray; } lfortran-lfortran-2f73434/doc/src/_static/css/custom.css0000664000175000017500000000022315141516316023426 0ustar alastairalastair.md-header { color: #000; font-weight: 700; } .md-tabs { color: #000; } .md-hero { color: #000; } .dropdown-content { color: #000; } lfortran-lfortran-2f73434/doc/src/developer_tutorial.ipynb0000664000175000017500000000655515141516316024155 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Developer Tutorial\n", "\n", "This is a tutorial for anybody who wants to either develop LFortran or build\n", "tools on top.\n", "\n", "## Introduction\n", "\n", "LFortran is structured around two independent modules, AST and ASR, both of\n", "which are standalone (completely independent of the rest of LFortran) and users\n", "are encouraged to use them independently for other applications and build tools\n", "on top:\n", "\n", "* Abstract Syntax Tree (AST): Represents any Fortran\n", " source code, strictly based on syntax, no semantic is included. The AST\n", " module can convert itself to Fortran source code.\n", "\n", "* Abstract Semantic Representation (ASR): Represents a\n", " valid Fortran source code, all semantic is included. Invalid Fortran code is\n", " not allowed (an error will be given). The ASR module can convert itself to an\n", " AST.\n", "\n", "## Abstract Syntax Tree (AST)\n", "\n", "Fortran source code can be parsed into an AST using the `src_to_ast()`\n", "function:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can pretty print it using the `%%showast` magic:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "%%showast\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can convert AST to Fortran source code using `%%showfmt`:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showfmt\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All AST nodes and their arguments are described in\n", "[AST.asdl](https://github.com/lfortran/lfortran/blob/master/grammar/AST.asdl).\n", "\n", "## Abstract Semantic Representation (ASR)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can pretty print using the `%%showasr` magic:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasr\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "r = a + b\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All ASR nodes and their arguments are described in\n", "[ASR.asdl](https://github.com/lfortran/lfortran/blob/master/src/libasr/ASR.asdl)." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-lfortran-2f73434/doc/src/asr/0000775000175000017500000000000015141516316017754 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/generics.md0000664000175000017500000002525415141516316022105 0ustar alastairalastair# Generics From a high-level perspective generics are supported in LFortran by three main elements: 1. **Requirements** declaring deferred types and their abstract functions 2. **Templates** implementing generic symbols (functions, subroutines, derived types) using deferred types and abstract functions described by requirements 3. **Instantiations** by passing concrete types and functions into templates ## Requirements Requirements declare deferred types (generic types) and its associated functions, similar to *typeclasses* in Haskell and *traits* in Rust. For example, the signature for a generic monoid of any type can be represented by the following requirement: ```fortran requirement monoid(T, op) ! declaring a deferred type (generic type) type, deferred :: T ! declaring a function associated with the deferred type function op(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function empty() result(z) type(T) :: z end function end requirement ``` The `monoid` requirement declares a deferred type `T` and two functions,`op` that takes arguments of type `T` and return a value with the same type `T` and `empty` that returns a value of type `T`. The deferred type `T` is internally interpreted as a variable `T` typed as `TypeParameter T` (for brevity we will write it just as `T`). Functions declared in requirements are abstract (without function body). On ASR level, the requirement is represented by the symbol [`Requirement`](asr_nodes/symbol_nodes/Requirement.md). ASR for requirements are built during symbol table visit in the function `visit_Requirement`. `monoid`'s symbol table would contain a variable `T` with the type `T`, a function `op` with the type `T * T -> T`, and a function `empty` with the type `() -> T`. A requirement is checked to see if all the parameters have a corresponding symbol declared inside of it. A warning is generated if a parameter is declared but no symbol is found with the same name. On its own, a requirement does not do any computation. It is also not compiled into the target language when the ASR is compiled. ## Templates Templates take the role of a scope for generic functions. A template uses generic types and its associated type signatures obtained from requirements to check generic operations. As a running example, we will consider a generic function for n-times multiplication for argument of any type. This function can be represented as: ```fortran module generics_example ! same requirement as before requirement monoid(T, op, empty) ... end requirement ! the template starts from here template array_t(S, op_temp, empty_temp) require :: monoid(S, op_temp, empty_temp) contains ! below is the generic function function array_sum(arr) result(r) type(S), intent(in) :: arr(:) type(S) :: r integer :: n, i n = size(arr) r = empty_temp(0) if (n > 0) then r = arr(1) do i = 2, n res = op_temp(r, arr(i)) end do end if end function end template end module ``` The template `array_t` contains the generic function `array_sum` that takes an array `arr` of type `S`. The template later on will be added to the parent symbol table as a `Template` symbol with the name `array_t`. Typing context has to be obtained to type the parameter `arr` and the addition operation `op_temp(r, arr(i))`. Such typing context can be made available within the scope of the template by using a requirement. Here, the `Require` statement `require :: monoid(S, op_temp, empty_temp)` builds the types of the template's parameters `S`, `op_temp`, and `empty_temp` based on the types of the symbols in `monoid`. This corresponds to the `visit_UnitRequire` that can be found in `visit_Template` during symbol table visit. Calling a require statement copies the symbols from the requiremement and replaces their names with the argument names given by the require statement. In this case, the symbol `T`, `op`, and `empty` from the requirement `monoid` are replaced by `S`, `op_temp`, and `empty_temp` that are passed as arguments. This replacement is done by the function `rename_symbol`. Eventually the require statement adds into `array_t`'s symbol table two symbols, `S` as a variable with type `S`, `op_temp` and `empty_temp` as functions with types `S * S -> S` and `() -> S` based on `monoid`'s symbol table. Symbol table visit checks the variable declarations in `array_sum`. Since `S` is available in the symbol table now, both variables `arr` and `r` can be typed. Later during body visit, with type `S`, `op_temp`, and `empty_temp` in the symbol table, the function call `op_temp(r, arr(i))` in `array_sum` would be checked in the same way as non-generic functions. ASR representation of templates are also not compiled into the target language. ## Instantiations Generic functions need to be instantiated with concrete types and functions to be used in run-time. The process of instantiation replaces the generic types in the function definition with concrete types (such as `integer`, `real`) and replace the abstract functions with implemented functions. The generic function described in the previous section can be instantiated as a function that computes array sum by the following instantiation: ```fortran module functions public :: add_integer, empty_integer contains function add_integer(x, y) integer, intent(in) :: x, y integer :: add_integer add_integer = x + y end function function empty_integer() integer :: empty_integer empty_integer = 0 end function end module program instantiate_template use functions, only: add_integer, empty_integer instantiate array_t(integer, add_integer, empty_integer), & only: array_sum_integer => array_sum ! function argument for basic arithmetic operations can be replaced with an operator instantiate array_t(integer, operator(+), empty_integer), & only: array_sum_integer => array_sum ! eliding function renaming would instantiating all generic functions with the same name instantiate array_t(integer, operator(+), empty_integer) end program ``` This instantiation statement ``` instantiate array_t(integer, add_integer, empty_integer), only: array_sum_integer => array_sum ``` passes the type `integer`, an integer addition function `add_integer`, and a function describing empty integer value `empty_integer` as arguments to template `array_t`, then instantiates the function `array_sum` as a new function named `array_sum_integer`. This instantiation wants to replace `S` in `array_t` with the type `integer`, `op_temp` function calls with `add_integer` function calls, and `empty_temp` function calls with `empty_integer` function calls. ### Type Checking Before a function is generated on ASR level by an instantiation, the compiler checks the consistency of its type substitution based on the given symbol arguments. Currently there is no notion of subtyping in LFortran, so checking is limited to exact type checks. This is done by tracking the type substitutions made by the symbol arguments and rejecting any contradicting type subsitutition. Checking is done during symbol table visit in `visit_Instantiate`. We will explain this in detail through the instantiation example above. The first argument `integer` substitutes the type parameter `S` in template `array_t` (maps `S` to `integer`). The second argument `add_integer` substitutes the type `S * S -> S` of `op_temp` with `integer * integer -> integer` (checks `S` substitution). This is allowed because the function argument gives a consistent substitution with the previous argument. If it passes the type checks, the instantiated function would be generated as a function on ASR level. Successfully checked symbol arguments are put inside the variable `type_subs` for type substitution (`S` to `integer`) and `symbol_subs` for function substitution (`op_temp` to `add_integer`). Now, suppose that we have the following instantiation where instead of `integer`, we pass `real` as an argument: ``` instantiate array_t(real, add_integer, empty_integer), only: array_sum_integer => array_sum ``` Here, the first type argument maps `S` to `real` but the second function argument maps `S` to `integer`, resulting in a contradiction. Hence ending in a type error. This check is tracked by the two variables `type_subs` and `symbol_subs`. Function arguments are checked by the function `check_restriction` during symbol table visit. **Handling Operator Arguments** Instantiations can be made simpler for basic binary operations (addition, multiplication, etc.) by passing `operator()` instead of pre-defined functions. If the type substitution tracked by `type_subs` is consistent for a binary arithmetic operation, then a function is implicitly generated as a function argument. From the example before, we will have a function that is equivalent to the following LFortran function generated implicitly: ```fortran function ~add_intrinsic(arg0, arg1) result(ret) integer, intent(in) :: arg0, arg1 integer :: ret ret = arg0 + arg1 end function ``` ### ASR Generation Instantiating the function as a function on the ASR level is simply a symbol replacement process. The generation process is split into two, generating the function signature during symbol table visit and generating the function body during body visit. The whole generation is not done during body visit because derived types generated from a template may be used to type variable declarations. During symbol table visit, after checking arguments and placing the symbol substitution into `type_subs` and `symbol_subs`, the instantiated function is added into the symbol table and its signature is built by the function `instantiate_symbol` where the deferred types are replaced with concrete types. For the example above, a function equivalent to the following is generated: ```fortran elemental function array_sum_integer(arr) result(res) integer, intent(in) :: arr(:) ! type replaced integer :: r ! type replaced integer :: n, i end function ``` The substitution in `type_subs` and `symbol_subs` are preserved and then passed to the body visitor. During body visit, the body of the instantiated function is built in `visit_Instantiate` by the function `instantiate_body`, replacing any abstract functions with concrete functions: ```fortran function array_sum_integer(n, a) result(res) integer, intent(in) :: arr(:) integer :: r integer :: n, i n = size(arr) r = empty_integer(0) ! function call replaced if (n > 0) then r = arr(1) do i = 2, n res = add_integer(r, arr(i)) ! function call replaced end do end if end do end function ``` ## See Also * [Programming With Generics](programming_generics.md), for simpler explaining about using generics in LFortranlfortran-lfortran-2f73434/doc/src/asr/asr.md0000664000175000017500000002335515141516316021073 0ustar alastairalastair# Abstract Semantic Representation (ASR) The aim of ASR is to represent all semantics in a non-redundant way, and that has all the semantic information available locally, so that the backend can do a single pass over ASR and have all the information at hand to generate code. ASR is always semantically valid Fortran code. It is as far from the original Fortran language code as possible (i.e. everything is explicitly figured out, all semantic information gathered and readily available locally from each ASR node), while ensuring no semantic information was lost (no lowering was done), so one can still generate Fortran code from ASR that will be logically equivalent to the original code. ASR can be used to do Fortran-level transformations (such as optimizations). ## Abstract Syntax Description Language (ASDL) Abstract Syntax Description Language describes the abstract syntax of the compiler IRs and other tree-like data structures. IRs described with ASDL are converted into an implementation automatically by tools. Tools generate the data structure definitions for a target language, pickling functions, and other codes. ASDL consists of three fundamental constructs: ***types, constructors***, and ***productions***. Let's take an example of a node from [ASR.asdl](https://github.com/lfortran/lfortran/blob/main/src/libasr/ASR.asdl): ```asdl symbol = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic) | Function(symbol_table symtab, identifier name, ttype function_signature, identifier* dependencies, expr* args, stmt* body, expr? return_var, access access, bool deterministic, bool side_effect_free, string? module_file) ``` #### Types The **types** are required to begin with a lowercase. ASDL's builtin types are: - identifier - int (signed integers of infinite precision) - string We extend these by: - bool (.true. / .false.) - float (floating point number of infinite precision) - symbol_table (scoped Symbol Table implementation) - node (any ASR node) > ***Note***: symbol_table contains `identifier` -> `symbol` mappings In the above example, `symbol_table`, `identifier`, `stmt`, `bool`, etc are types. #### Constructors The **constructors** names must begin with an upper case. In above example has three constructors, `Program`, `Module`, and `Function`, where the Program constructor has four fields whose values are of type `symbol_table`, `identifier`, `identifier*`, and `stmt*`. These are, basically, subtrees. ## Symbol type Each symbol has either `symtab` (local symbol table) or `parent_symtab` (where this symbol is stored). One can get to parent_symtab via symtab, so only one is present. Each symbol has a `name` for easy lookup of the name of the symbol when only having a pointer to it. `abi=Source` means the symbol's implementation is included (full ASR), otherwise, it is external (interface ASR, such as procedure interface). `SubroutineCall`/`FunctionCall` stores the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of: `null`, `GenericProcedure` or `ExternalSymbol`. When a module is compiled, it is parsed into full ASR, an object file is produced, and the full ASR (abi=Source, "body" is non-empty) is transformed into interface ASR (abi=LFortran, "body" is empty). Both interface and full ASR are saved into the mod file. When a module is used, it is first looked up in the symbol table (as either full or interface ASR) and used if it is present. Otherwise, a mod file is found on the disk, loaded (as either full or interface ASR for LFortran's mod file, depending on LFortran's compiler options; or for GFortran's mod file, the corresponding interface ASR is constructed with abi=GFortran) and used. After the ASR is loaded, the symbols that are used are represented as ExternalSymbols in the current scope of the symbol table. ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However, if a symbol is used from a different module, then it is an external symbol because the usual symbol resolution by going to the parents will not find the definition. The `module_name` member is the name of the module the symbol is in, and the `scope_names` is a list of names if the symbol is in a nested symbol table. For example, if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]`. REPL: each cell is parsed into full ASR, compiled + executed, and the full ASR is transformed into interface ASR (abi=LFortran) and kept in the symbol table. A new cell starts with an empty symbol table, whose parent symbol table is the previous cell. That allows function/declaration shadowing. ## ABI Type ```asdl abi -- External ABI = Source -- No Unspecified | LFortranModule -- Yes LFortran | GFortranModule -- Yes GFortran | BindC -- Yes C | BindPython -- Yes Python | BindJS -- Yes Javascript | Interactive -- Yes Unspecified | Intrinsic -- Yes Unspecified ``` - **External Yes**: the symbol's implementation is not part of ASR; the symbol is just an interface (e.g., subroutine/function interface, or variable marked as external, not allocated by this ASR). - **External No**: the symbol's implementation is part of ASR (e.g., subroutine/function body is included, variables must be allocated). - **abi=Source**: The symbol's implementation is included in ASR, and the backend is free to use any ABI it wants (it might also decide to inline or eliminate the code in optimizations). - **abi=LFortranModule/GFortranModule/BindC**: the symbol's implementation is stored as machine code in some object file that must be linked in. It uses the specified ABI (one of the LFortran modules, GFortran module, or C ABI). An interface that uses `iso_c_binding` and `bind(c)` is represented using abi=BindC. - **abi=BindPython**: the symbol's implementation is stored in text format in the user source code file. The symbol is executed using the CPython interpreter. LPython manages the conversion of arguments to be passed to such symbols and also converts the return values from such symbols. - **abi=BindJS**: the symbol's implementation is available with Javascript. This abi type is to be mainly used with the WASM Backend. - **abi=Interactive**: the symbol's implementation has been provided by the previous REPL execution (e.g., if LLVM backend is used for the interactive mode, the previous execution generated machine code for this symbol's implementation that was loaded into memory). Note: this option might be converted/eliminated to just use LFortran ABI in the future. - **abi=Intrinsic**: the symbol's implementation is implicitly provided by the language itself as an intrinsic function. That means the backend is free to implement it in any way it wants. The function does not have a body, it is just an interface. ## Short notes on ASR nodes ### Stmt nodes 1. **ExplicitDeallocate**: It deallocates if allocated otherwise throws a runtime error. 2. **ImplicitDeallocate**: It deallocates if allocated otherwise does nothing. 3. **GoTo**: It points to a GoToTarget with the corresponding target_id within the same procedure. We currently use `int` IDs to link GoTo with GoToTarget to avoid issues with serialization. 4. **GoToTarget**: An empty statement, a target of zero or more GoTo statements the `id` is only unique within a procedure. ### Expr nodes 1. **Cast**: It changes the value (the bits) of the `arg`. 2. **ArrayPhysicalCast**: This ArrayPhysicalCast we only change the physical type, the logical type does not change > Note: the "new" physical type here will also be part of the "type" member This allows to represent any combination, but we'll only support a few; at least we need: Maybe it's easier to add an enumeration here: - Descriptor -> Pointer - Pointer -> Descriptor - CompileTimeFixedSizeArray -> Pointer - CompileTimeFixedSizeArray -> Descriptor - Descriptor -> NumPy - NumPy -> Descriptor - ISODescriptor -> Descriptor - Descriptor -> ISODescriptor ### Ttype nodes ```asdl ttype = Integer(int kind) | UnsignedInteger(int kind) | Real(int kind) | ... ``` **`len`** in Character: - $>=0$ ... the length of the string, known at compile time - $-1$ ... character( * ), i.e., inferred at runtime - $-2$ ... character(:), allocatable (possibly we might use -1 for that also) - $-3$ ... character(n+3), i.e., a runtime expression stored in `len_expr` **`kind`**: The `kind` member selects the kind of a given type. We currently support the following: - Integer kinds: 1 (i8), 2 (i16), 4 (i32), 8 (i64) - Real kinds: 4 (f32), 8 (f64) - Complex kinds: 4 (c32), 8 (c64) - Character kinds: 1 (utf8 string) - Logical kinds: 1, 2, 4: (boolean represented by 1, 2, 4 bytes; the default kind is 4, just like the default integer kind, consistent with Python and Fortran: in Python, "Booleans in Python are implemented as a subclass of integers"; in Fortran the "default logical kind has the same storage size as the default integer"; we currently use kind=4 as default integer, so we also use kind=4 for the default logical.) ### String format kind ```asdl string_format_kind = FormatFortran -- "(f8.3,i4.2)", a, b | FormatC -- "%f: %d", a, b | FormatPythonPercent -- "%f: %d" % (a, b) | FormatPythonFString -- f"{a}: {b}" | FormatPythonFormat -- "{}: {}".format(a, b) ``` lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/0000775000175000017500000000000015141516316021731 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/cast_kind_nodes/0000775000175000017500000000000015141516316025060 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/cast_kind_nodes/cast_kind.md0000664000175000017500000004607215141516316027352 0ustar alastairalastair# cast_kind Cast Kind nodes or cast kind types. ## Declaration ### Syntax ``` cast_kind = RealToInteger | IntegerToReal | LogicalToReal | RealToReal | IntegerToInteger | RealToComplex | IntegerToComplex | IntegerToLogical | RealToLogical | CharacterToLogical | CharacterToInteger | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal | ComplexToInteger | LogicalToInteger | RealToCharacter | IntegerToCharacter | LogicalToCharacter ``` ### Arguments None. ### Return values None. ## Description **cast_kind** nodes or cast kind types denotes kinds to typecast one idenfier to another. `cast_kind` denotes the types supported for cast in LFortran. ## Types It denotes all types supported in LFortran, which are: 1. `RealToInteger` denotes `cast_kind` of `real` to `integer` type. 2. `IntegerToReal` denotes `cast_kind` of `integer` to `real` type. 3. `LogicalToReal` denotes `cast_kind` of `logical` to `real` type. 4. `RealToReal` denotes `cast_kind` of `Real` to `Real`. 5. `IntegerToInteger` denotes `cast_kind` of `integer` to `integer`. 6. `RealToComplex` denotes `cast_kind` of `Real` to `complex`. 7. `IntegerToComplex` denotes `cast_kind` of `integer` to `complex`. 8. `IntegerToLogical` denotes `cast_kind` of `integer` to `logical`. 9. `RealToLogical` denotes `cast_kind` of `real` to `logical`. 10. `CharacterToLogical` denotes `cast_kind` of `character` to `logical`. 11. `CharacterToInteger` denotes `cast_kind` of `character` to `integer`. 12. `CharacterToList` denotes `cast_kind` of `character` to `list`. 13. `ComplexToLogical` denotes `cast_kind` of `complex` to `logical`. 14. `ComplexToComplex` denotes `cast_kind` of `complex` to `complex`. 15. `ComplexToReal` denotes `cast_kind` of `complex` to `real`. 16. `ComplexToInteger` denotes `cast_kind` of `complex` to `integer`. 17. `LogicalToInteger` denotes `cast_kind` of `logical` to `integer`. 18. `RealToCharacter` denotes `cast_kind` of `real` to `character`. 19. `IntegerToCharacter` denotes `cast_kind` of `integer` to `character`. 20. `LogicalToCharacter` denotes `cast_kind` of `logical` to `character`. ## Examples Example for `RealToInteger`: ```fortran program types_03 implicit none real :: r integer :: i r = 1.5 print *, r i = r print *, i end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_03 [] [(= (Var 2 r) (RealConstant 1.500000 (Real 4 []) ) () ) (Print () [(Var 2 r)] () () ) (= (Var 2 i) (Cast (Var 2 r) RealToInteger (Integer 4 []) () ) () ) (Print () [(Var 2 i)] () () )] ) }) [] ) ``` Example for `IntegerToReal`: ```fortran program types_02 implicit none real :: r integer :: i i = 1 r = 1 r = i end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_02: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_02 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (= (Var 2 r) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) () ) (= (Var 2 r) (Cast (Var 2 i) IntegerToReal (Real 4 []) () ) () )] ) }) [] ) ``` Example of `RealToReal`: ```fortran program types_01 implicit none real :: r r = 1.0 r = 1.5 r = 1. r = float(2) r = dble(3) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { types_01: (Program (SymbolTable 2 { r: (Variable 2 r Local () () Default (Real 4 []) Source Public Required .false. ) }) types_01 [] [(= (Var 2 r) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r) (RealConstant 1.500000 (Real 4 []) ) () ) (= (Var 2 r) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r) (Cast (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []) ) ) RealToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) () ) (= (Var 2 r) (Cast (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.000000 (Real 8 []) ) ) RealToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []) ) ) () )] ) }) [] ) ``` Example of `IntegerToLogical`: ```fortran program logical4 ! this program checks logical operators implicit none ! variable declaration logical :: a, b, c ! assigning values a = 2 b = -1 c = 0 print *, a, b, c end program logical4 ``` ASR: ``` (TranslationUnit (SymbolTable 1 { logical4: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Logical 4 []) Source Public Required .false. ), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false. ), c: (Variable 2 c Local () () Default (Logical 4 []) Source Public Required .false. ) }) logical4 [] [(= (Var 2 a) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToLogical (Logical 4 []) () ) () ) (= (Var 2 b) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) IntegerToLogical (Logical 4 []) () ) () ) (= (Var 2 c) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToLogical (Logical 4 []) () ) () ) (Print () [(Var 2 a) (Var 2 b) (Var 2 c)] () () )] ) }) [] ) ``` Example of `ComplexToComplex`: ```fortran program complex_dp complex(4) :: zero complex(8) :: v complex :: x zero = 0.0_4 v = (1.05_4, 1.05_4) x = (1.05_4, 1.05_8) print *, v, x, zero end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { complex_dp: (Program (SymbolTable 2 { v: (Variable 2 v Local () () Default (Complex 8 []) Source Public Required .false. ), x: (Variable 2 x Local () () Default (Complex 4 []) Source Public Required .false. ), zero: (Variable 2 zero Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex_dp [] [(= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 4 []) ) RealToComplex (Complex 4 []) (ComplexConstant 0.000000 0.000000 (Complex 4 []) ) ) () ) (= (Var 2 v) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4 []) ) (RealConstant 1.050000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 1.050000 1.050000 (Complex 4 []) ) ) ComplexToComplex (Complex 8 []) () ) () ) (= (Var 2 x) (Cast (ComplexConstructor (RealConstant 1.050000 (Real 4 []) ) (RealConstant 1.050000 (Real 8 []) ) (Complex 8 []) (ComplexConstant 1.050000 1.050000 (Complex 8 []) ) ) ComplexToComplex (Complex 4 []) () ) () ) (Print () [(Var 2 v) (Var 2 x) (Var 2 zero)] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/type_nodes/0000775000175000017500000000000015141516316024102 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/type_nodes/ttype.md0000664000175000017500000002176315141516316025602 0ustar alastairalastair# ttype Type nodes. ## Declaration ### Syntax ```fortran ttype = Integer(int kind, dimension* dims) | Real(int kind, dimension* dims) | Complex(int kind, dimension* dims) | Character(int kind, int len, expr? len_expr, dimension* dims) | Logical(int kind, dimension* dims) | Set(ttype type) | List(ttype type) | Tuple(ttype* type) | Struct(symbol derived_type, dimension* dims) | Enum(symbol enum_type, dimension *dims) | UnionType(symbol union_type, dimension *dims) | Class(symbol class_type, dimension* dims) | Dict(ttype key_type, ttype value_type) | Pointer(ttype type) | CPtr() | TypeParameter(identifier param, dimension* dims) ``` ### Arguments `kind` member selects the kind of a given type. `dims` denotes dimension descriptor. `expr` denotes expression. `len` denotes length of variable allowed. `derived_type` denotes derived type of class. `derived_type` must point to a symbol with a symbol table. `enum_type` denotes enumeration type. `union_type` denotes union type. `class_type` denotes class type. `key_type` denotes key type in dictonary type. `value_type` denotes value type in dictionary type. `param` denotes identifier or variable's. ### Return values None. ## Description `ttype` denotes type of variables supported by LFortran. It consists of: 1. `Integer` denotes integer type. 2. `Real` denotes real type. 3. `Complex` denotes complex type. 4. `Character` denotes character type. 5. `Logical` denotes logical type. 6. `Set` denotes set type. 7. `List` denotes list type. 8. `Tuple` denotes tuple type. 9. `Struct` denotes structure type. 10. `Enum` denotes enumeration type. 11. `UnionType` denotes union type. 12. `Class` denotes class type. 13. `Dict` denotes dictionary type. 14. `Pointer` denotes Pointer type. 15. `CPtr` denotes C pointer type. 16. `TypeParameter` denotes type of parameter. ## Types **ttype** defines types of variables or identifiers supported by LFortran. ## Examples Example for `integer`: ```fortran integer(8) :: x x = 6 x ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 8 []) Source Public Required .false. ) }) [(= (Var 1 x) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 6 (Integer 8 [])) ) () ) (Var 1 x)] ) ``` Example for `derived_type`: ```fortran program t01_derived_type implicit none type type_A integer :: i real :: r end type type(type_A) :: A A%i = 5 A%r = 5.5 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { t01_derived_type: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Struct 2 type_a [] ) Source Public Required .false. ), type_a: (StructType (SymbolTable 3 { i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false. ) }) type_a [i r] Source Public () ) }) t01_derived_type [] [(= (StructInstanceMember (Var 2 a) 3 i (Integer 4 []) () ) (IntegerConstant 5 (Integer 4 [])) () ) (= (StructInstanceMember (Var 2 a) 3 r (Real 4 []) () ) (RealConstant 5.500000 (Real 4 []) ) () )] ) }) [] ) ``` Example for `complex`: ```fortran program complex1 complex :: x x = (3.0, 4.0) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { complex1: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex1 [] [(= (Var 2 x) (ComplexConstructor (RealConstant 3.000000 (Real 4 []) ) (RealConstant 4.000000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 3.000000 4.000000 (Complex 4 []) ) ) () )] ) }) [] ) ``` Example for `dimension`: ```fortran integer :: x dimension x(3) ``` ASR: ``` (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/type_nodes/StringPhysicalType.md0000664000175000017500000000577115141516316030243 0ustar alastairalastair# String Physical Type ## Types ```ASDL string_physical_type = PointerString | DescriptorString ``` ## Description - **PointerString :** - It's the normal C `char*`. The memory for it gets allocated by the runtime `lfortran_str_copy()`. - PointerString can't be an `allocatable` unless it's an allocatable-array or string [casted](../expression_nodes/StringPhysicalCast.md) from `descriptorString` to `pointerString` so it remains to be identified as an allocatable variable in the whole code base, like avoiding some semantic errors when you use the string with some intrinsic function that requires the string to be an allocatable. - **DescriptorString :** - It's an LLVM struct to hold information about data, size and capacity. - It's represented in LLVM IR as : `{char*, int64, int64}`. The benefit from having `size` and `capacity` is that it gives us the ability to have dynamic string that's not computationally expensive, just like `std::string` (`std::vector`) in c++. So the key points are: - `size` avoids calling `strlen` when we want to know the size of a string. - `capacity` gives us the flexibility of extending the string without losing performance by doubling the memory location every time we run out of allocated memory space. - DescriptorString must always be an allocatable. ## Usage - **DescriptorString** DescriptorString is used only with allocatable strings. ```Fortran character(:) , allocatable:: chr ``` ```Clojure (Variable 2 chr [] Local () () Default (Allocatable (Character 1 -2 () DescriptorString) ; Notice the physical type. ) () Source Public Required .false. ) ``` ``` Fortran character(5) :: chr character(:),allocatable :: chr_RHS chr_RHS = chr ! Cast RHS from PointerString --> DescriptorString ``` ``` Clojure (Assignment (Var 2 chr_rhs) (StringPhysicalCast (Var 2 chr) PointerString DescriptorString (Allocatable (Character 1 5 () DescriptorString) ; Notice Physical type ) () ) () ) ``` - **PointerString** It could be used with allocatable strings and non-allocatable strings. - non-allocatable + pointerString --> fixed-size string and literal string ```Fortran character(5) :: chr chr = "Hello" ``` ``` Clojure chr: (Variable 2 chr [] Local () () Default (Character 1 5 () PointerString) ; Notice The Physical Type. () Source Public Required .false. ) (Assignment (Var 2 chr) (StringConstant "Hello" (Character 1 5 () PointerString) ; Notice The Physical Type ) () ) ``` - allocatable + pointerString --> When string casted from descriptorString to pointerString. ```Fortran character(5) :: chr character(:), allocatable :: chr_RHS chr = chr_RHS ! Cast RHS from DescriptorString to PointerString ``` ``` Clojure (Assignment (Var 2 chr) (StringPhysicalCast (Var 2 chr_rhs) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ; Notice alloctable pointerString. ) () ) () ) ``` ### See Also [stringPhysicalCast](../expression_nodes/StringPhysicalCast.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/0000775000175000017500000000000015141516316024426 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/Requirement.md0000664000175000017500000001545315141516316027260 0ustar alastairalastair# Requirement A **Requirement** is a `symbol` node for declaring generic types and operations associated with the types. ## Declaration ### Syntax ```fortran Requirement(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` | symbol table of the requirement | | `name` | name of the requirement | | `args` | symbol names inside the requirement | | `require_instantiation` | instantiating argument types through require calls | ### Return values N/A ## Description Generic types and their abstract methods (whose implementation are not yet known) are needed during implementation of generic functions. Requirements fills the hole here by declaring (adhoc) generic types and their associated methods. Requirements are analoguos to *typeclasses* in Haskell and *traits* in Rust. `name` denotes the name of the requirement. In the example below, the `name` of the requirements are `semigroup` and `monoid`. `args` denotes the parameters of the requirement. A warning is generated if there is no corresponding symbol found in the requirement's `symtab` for a given paramater. In the example below, the parameters `(T, op)` make up the `args` of the `semigroup` requirement. `symtab` denotes the symbol table of the requirement. It contains generic types, represented by variables typed with `TypeParameter`, and *abstract* functions whose signatures may contain generic types. An error is generated if a symbol found in the `symtab` but not declared in `args`. In the example below, `semigroup`'s `symtab` contains the variable `T` with type `TypeParameter T` and the function `op` with type `TypeParameter T x TypeParameter T -> TypeParameter T`. `require_instantiation` (`Require` statements) are calls to requirements that replace the types of the arguments with the corresponding parameters' types in the requirement. As an example the requirement `monoid` below reuses `semigroup` through `require :: semigroup(S, combine)`. Although `S` and `combine` are not declared as symbols inside `monoid`, this statement maps the typing for both `S` and `combine` with the parameter `T` and `op` in `semigroup` that defines `S` as a type parameter. As a result, `type(S)` is a valid type in `monoid` and two methods `combine` and `empty` are associated with it. ## Types ## Examples LFortran: ```fortran module semigroup_m requirement semigroup(T, op) type, deferred :: T function op(x,y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement requirement monoid(S, combine, empty) require :: semigroup(S, combine) pure function empty() type(S) :: empty end function end requirement end module ``` ASR: ``` semigroup_m: (Module (SymbolTable 2 { semigroup: (Requirement (SymbolTable 3 { op: (Function (SymbolTable 4 { x: (Variable 4 x [] In () () Default (TypeParameter t ) () Source Public Required .false. ), y: (Variable 4 y [] In () () Default (TypeParameter t ) () Source Public Required .false. ), z: (Variable 4 z [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .false. .false. .false. .false. .false. [] .true. ) [] [(Var 4 x) (Var 4 y)] [] (Var 4 z) Public .false. .false. () ), t: (Variable 3 t [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) semigroup [t op] [] ) }) semigroup_m [] .false. .false. ) ``` ## See Also * [Symbols](symbol.md) * [Template](Template.md) * [Generics](../../generics.md)lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/Block.md0000664000175000017500000001132215141516316026001 0ustar alastairalastair# Block The **Block** is a `symbol` node that represents a scoped list of statements (block). ## Declaration ### Syntax ``` Block(symbol_table symtab, identifier name, stmt* body) ``` ### Arguments | Argument Name | Denotes | |-----------------|--------------------------------------------------| | `parent_symtab` | the parent symbol table that contains the block | | `name` | the name of the block in the parent symbol table | | `body` | the list of statements in the block | ### Return values None. ## Description The Block node represents a scoped list of statements. In C one uses `{}` to represent a block, in Fortran one uses `block` / `end block`. The Block contains its own symbol table and can contain variable declarations that are local to the block. The Block itself is part of a symbol table and one uses the BlockCall `stmt` node to call (enter) the block from a list of statements. A `BlockCall` is different from a `FunctionCall` in the sense that it does not expect/accept any arguments. Also, the statements inside a `Block` can access the variables in the parent/caller scope, unlike `Function` where statements cannot access variables of the caller scope. ## Types ## Examples An example in C is: ```c { int i = 5; print("%d\n", i); } ``` An example in Fortran is: ```fortran program test_block integer :: i i = 5 block integer :: j j = i + 1 print *, i, j end block end program ``` ASR: ```clojure (TranslationUnit (SymbolTable 1 { test_block: (Program (SymbolTable 2 { block: (Block (SymbolTable 3 { j: (Variable 3 j [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) block [(= (Var 3 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (Print () [(Var 2 i) (Var 3 j)] () () )] ), i: (Variable 2 i [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) test_block [] [(= (Var 2 i) (IntegerConstant 5 (Integer 4 [])) () ) (BlockCall -1 2 block )] ) }) [] ) ``` ## See Also [symbol](symbol.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/symbol.md0000664000175000017500000011502115141516316026255 0ustar alastairalastair# symbol A textual denotation having special meaning to the compiler. The value can be determined from the text of the basic *symbol*. ## Declaration ### Syntax ```fortran symbol = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic) | Function(symbol_table symtab, identifier name, expr* args, stmt* body, expr? return_var, abi abi, access access, deftype deftype, string? bindc_name, bool elemental, bool pure, bool module, bool inline, bool static, ttype* type_params, symbol* restrictions, bool is_restriction) | GenericProcedure(symbol_table parent_symtab, identifier name, symbol* procs, access access) | CustomOperator(symbol_table parent_symtab, identifier name, symbol* procs, access access) | ExternalSymbol(symbol_table parent_symtab, identifier name, symbol external, identifier module_name, identifier* scope_names, identifier original_name, access access) | StructType(symbol_table symtab, identifier name, identifier* members, abi abi, access access, symbol? parent) | EnumType(symbol_table symtab, identifier name, identifier* members, abi abi, access access, enumtype enum_value_type, ttype type, symbol? parent) | Union(symbol_table symtab, identifier name, identifier* members, abi abi, access access, symbol? parent) | Variable(symbol_table parent_symtab, identifier name, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, abi abi, access access, presence presence, bool value_attr) | ClassType(symbol_table symtab, identifier name, abi abi, access access) | StructMethodDeclaration(symbol_table parent_symtab, identifier name, identifier? self_argument, identifier proc_name, symbol proc, abi abi) | AssociateBlock(symbol_table symtab, identifier name, stmt* body) | Block(symbol_table symtab, identifier name, stmt* body) | Requirement(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) | Template(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` |local symbol table | | `name` |symbol name for easy lookup | | `dependencies` |dependencies of symbol | | `body` |statement body | | `loaded_from_mod` |boolean value if loaded from mode | | `intrinsic` |boolean value if intrinsic | | `args` |arguments of expression | | `abi` |source | | `original_name` |original symbol | | `parent_symtab` |where symbol is stored | | `scope_names` |list of names if the symbol is in a nested symbol table | | `storage_type` | Default/Save/Parameter/Allocatable | | `access` | Public/Private | | `intent` |Local/In/Out/InOut/ReturnVar/Unspecified| | `deftype` |Implementation/Interface| | `presence` |Required/Optional| | `self_argument` |the argument which contains the object calling the class procedure | | `requires` |assigning types to requirement or template arguments | ### Return values None. ## Description Each symbol has either `symtab` (local symbol table) or `parent_symtab` (where this symbol is stored). One can get to parent_symtab via symtab, so only one is present. Each symbol has a `name` for easy lookup of the name of the symbol when only having a pointer to it. abi=Source means the symbol's implementation is included (full ASR), otherwise it is external (interface ASR, such as procedure interface). SubroutineCall/FunctionCall store the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of: null, GenericProcedure or ExternalSymbol. When a module is compiled, it is parsed into full ASR, an object file is produced, the full ASR (abi=Source, "body" is non-empty) is transformed into interface ASR (abi=LFortran, "body" is empty). Both interface and full ASR is saved into the mod file. When a module is used, it is first looked up in the symbol table (as either full or interface ASR) and used if it is present. Otherwise a mod file is found on the disk, loaded (as either full or interface ASR for LFortran's mod file, depending on LFortran's compiler options; or for GFortran's mod file the corresponding interface ASR is constructed with abi=GFortran) and used. After the ASR is loaded, the symbols that are used are represented as ExternalSymbols in the current scope of the symbol table. ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However if a symbol is used from a different module, then it is an external symbol, because usual symbol resolution by going to the parents will not find the definition. The `module_name` member is the name of the module the symbol is in, the `scope_names` is a list of names if the symbol is in a nested symbol table. For example if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]`. REPL: each cell is parsed into full ASR, compiled + executed, the full ASR is transformed into interface ASR (abi=LFortran) and kept in the symbol table. A new cell starts with an empty symbol table, whose parent symbol table is the previous cell. That allows function / declaration shadowing. Symbols in LFortran are: 1. Program 2. Module 3. Function 4. GenericProcedure 5. CustomOperator 6. ExternalSymbol 7. DerivedType 8. Variable 9. ClassType 10. StructMethodDeclaration 11. AssociateBlock 12. Block 13. Requirement 14. Template ## Types Special meaning textual denotations. ## Examples Example of function: ```fortran integer function a() end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Function (SymbolTable 2 { a: (Variable 2 a ReturnVar () () Default (Integer 4 []) Source Public Required .false. ) }) a [] [] (Var 2 a) Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` Example of GenericProcedure: ```fortran module stdlib_quadrature_simps interface simps38_weights module procedure simps38_weights_dp end interface simps38_weights contains function simps38_weights_dp(x) result(w) real(8), intent(in) :: x(4) real(8) :: w(size(x)) end function simps38_weights_dp subroutine simps38_weights_dp_use(x1) real(8), intent(in) :: x1(4) print *, simps38_weights(x1) end subroutine simps38_weights_dp_use end module program stdlib_quadrature use stdlib_quadrature_simps, only: simps38_weights_dp implicit none real(8) :: x1(4) print *, simps38_weights_dp(x1) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_quadrature: (Program (SymbolTable 5 { simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public ), x1: (Variable 5 x1 Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) stdlib_quadrature [stdlib_quadrature_simps] [(Print () [(FunctionCall 5 simps38_weights_dp () [((Var 5 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () () )] () () )] ), stdlib_quadrature_simps: (Module (SymbolTable 2 { simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public ), simps38_weights_dp: (Function (SymbolTable 3 { w: (Variable 3 w ReturnVar () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), x: (Variable 3 x In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) simps38_weights_dp [(Var 3 x)] [] (Var 3 w) Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), simps38_weights_dp_use: (Function (SymbolTable 4 { x1: (Variable 4 x1 In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) simps38_weights_dp_use [(Var 4 x1)] [(Print () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () () )] () () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_quadrature_simps [] .false. .false. ) }) [] ) ``` Example of Module and CustomOperator: ```fortran module stdlib_string_type type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface write(formatted) module procedure :: write_formatted end interface interface read(formatted) module procedure :: read_formatted end interface contains subroutine write_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(in) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg end subroutine write_formatted subroutine read_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(inout) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=:), allocatable :: line end subroutine read_formatted end module program string_14 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { formatted: (CustomOperator 2 formatted [2 read_formatted] Public ), read_formatted: (Function (SymbolTable 5 { iomsg: (Variable 5 iomsg InOut () () Default (Character 1 -1 () []) Source Private Required .false. ), iostat: (Variable 5 iostat Out () () Default (Integer 4 []) Source Private Required .false. ), iotype: (Variable 5 iotype In () () Default (Character 1 -1 () []) Source Private Required .false. ), line: (Variable 5 line Local () () Allocatable (Character 1 -2 () []) Source Private Required .false. ), string: (Variable 5 string InOut () () Default (Struct 2 string_type [] ) Source Private Required .false. ), unit: (Variable 5 unit In () () Default (Integer 4 []) Source Private Required .false. ), v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Private Required .false. ) }) read_formatted [(Var 5 string) (Var 5 unit) (Var 5 iotype) (Var 5 v_list) (Var 5 iostat) (Var 5 iomsg)] [(ImplicitDeallocate [5 line] )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), string_type: (StructType (SymbolTable 3 { raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Private Required .false. ) }) string_type [raw] Source Private () ), write_formatted: (Function (SymbolTable 4 { iomsg: (Variable 4 iomsg InOut () () Default (Character 1 -1 () []) Source Private Required .false. ), iostat: (Variable 4 iostat Out () () Default (Integer 4 []) Source Private Required .false. ), iotype: (Variable 4 iotype In () () Default (Character 1 -1 () []) Source Private Required .false. ), string: (Variable 4 string In () () Default (Struct 2 string_type [] ) Source Private Required .false. ), unit: (Variable 4 unit In () () Default (Integer 4 []) Source Private Required .false. ), v_list: (Variable 4 v_list In () () Default (Integer 4 [(() ())]) Source Private Required .false. ) }) write_formatted [(Var 4 string) (Var 4 unit) (Var 4 iotype) (Var 4 v_list) (Var 4 iostat) (Var 4 iomsg)] [] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ), string_14: (Program (SymbolTable 6 { }) string_14 [] [] ) }) [] ) ``` Example of StructMethodDeclaration: ```fortran module bitset type, abstract :: bitset_type private integer(8) :: num_bits contains procedure(all_abstract), deferred, pass(self) :: all end type bitset_type abstract interface elemental function all_abstract( self ) result(all) import :: bitset_type logical :: all class(bitset_type), intent(in) :: self end function all_abstract end interface end module program debug implicit none end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bitset: (Module (SymbolTable 2 { all_abstract: (Function (SymbolTable 4 { all: (Variable 4 all ReturnVar () () Default (Logical 4 []) Source Private Required .false. ), self: (Variable 4 self In () () Default (Class 2 bitset_type [] ) Source Private Required .false. ) }) all_abstract [(Var 4 self)] [] (Var 4 all) Source Private Interface () .true. .false. .false. .false. .false. [] [] .false. ), bitset_type: (StructType (SymbolTable 3 { all: (StructMethodDeclaration 3 all all_abstract 2 all_abstract Source ), num_bits: (Variable 3 num_bits Local () () Default (Integer 8 []) Source Private Required .false. ) }) bitset_type [num_bits] Source Private () ) }) bitset [] .false. .false. ), debug: (Program (SymbolTable 5 { }) debug [] [] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/symbol_nodes.md0000664000175000017500000000022015141516316027437 0ustar alastairalastair# ASR Symbol Nodes ```{toctree} --- maxdepth: 1 --- Block.md ExternalSymbol.md Variable.md program.md Requirement.md Template.md symbol.md ``` lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/ExternalSymbol.md0000664000175000017500000001066215141516316027725 0ustar alastairalastair# ExternalSymbol The **ExternalSymbol** is a `symbol` node that represents a symbol declared in another module. ## Declaration ### Syntax ```fortran ExternalSymbol(symbol_table parent_symtab, identifier name, symbol external, identifier module_name, identifier* scope_names, identifier original_name, access access) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `parent_symtab` | the parent symbol table that contains the external symbol | | `name` | the name of the external symbol in the current symbol table | | `external` | pointer to the actual symbol definition | | `module_name` | the name of the module the symbol is in | | `scope_names` | a list of names if the symbol is in a nested symbol table. For example if it is a local variable in a function `f` that is nested in function `g`, then `scope_names=[g, f]` | | `original_name` | the name of the symbol in the external symbol table | | `access` | access type `Public/Private` | ### Return values None. ## Description ExternalSymbol represents symbols that cannot be looked up in the current scoped symbol table. As an example, if a variable is defined in a module, but used in a nested subroutine, that is not an external symbol because it can be resolved in the current symbol table (nested subroutine) by following the parents. However if a symbol is used from a different module, then it is an external symbol, because usual symbol resolution by going to the parents will not find the definition. The `ExternalSymbol` is the only way to reference a symbol that cannot be accessed in the scoped symbol table by visiting the parents. There is a special handling for it in the serialization and deserialization: the `external` member is not serialized (since it is a pointer) and in deserialization the pointer is reconstructed from the `original_name` and `scope_names`. The `scope_names` contains the names of the external symbol table starting from the top how to get to the symbol. This approach allows to reference any nested symbol (such as a local variable in a function in a module). However, we might later change the design to only allow referencing top level module entities. One can think of the `ExternalSymbol` as the "import" statement in Python, or the "use" statement in Fortran. ## Types ## Examples ```fortran module module_num integer :: my_num = 5 end module program main use module_num print *, my_num end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 3 { my_num: (ExternalSymbol 3 my_num 2 my_num module_num [] my_num Public ) }) main [module_num] [(Print () [(Var 3 my_num)] () () )] ), module_num: (Module (SymbolTable 2 { my_num: (Variable 2 my_num [] Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ) }) module_num [] .false. .false. ) }) [] ) ``` ## See Also [symbol](symbol.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/Template.md0000664000175000017500000002444415141516316026533 0ustar alastairalastair# Template A **Template** is a `symbol` node for declaring generic functions. ## Declaration ### Syntax ```fortran Template(symbol_table symtab, identifier name, identifier* args, require_instantiation* requires) ``` ### Arguments | Argument Name | Denotes | |----------------------------|----------------------------| | `symtab` | symbol table of the template | | `name` | name of the template | | `args` | symbol names inside the template | | `require_instantiation` | instantiating argument types through require calls | ### Return values ## Description Generic functions are declared within the scope of a template. In the example below, a generic n-times multiplication is implemented in a template. A template can contain multiple generic functions that depend on one another. `name` denotes the name of the template. Template names are needed for specifying which generic functions will be used in the program. In the example below, the `name` of the template is `derive_semigroup`. `args` denotes the parameters of the template. The parameters of a template represent the generic elements that need to be instantiated with concrete types and functions so that the generic functions inside the template can be used during run-time. A warning is generated if there is no corresponding symbol found in the template's `symtab` for a given parameter. In the example below, the parameters '(T, op)' make up the `args` of the `derive_semigroup` template. `require_instantiation` (`Require` statements) are calls to requiremens that replace the types of the arguments with the corresponding parameters' types in the requirement. In the generic function `stimes` below, `a` is a variable with a generic type and `op` is a function utilizing such generic variable. To assign types to both, the statement `require :: semigroup(T, op)` maps the typing for `T` and `op` according to its signature in the `semigroup`. ## Types ## Examples LFortran: ```fortran module semigroup_m requirement semigroup(T, op) ... end requirement template derive_semigroup(T, op) require :: semigroup(T, op) contains elemental function stimes(n, a) result(res) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: res integer :: i res = a do i = 2, n res = op(res, a) end do end function end template end semigroup ``` ASR: ``` semigroup_m: (Module (SymbolTable 2 { derive_semigroup: (Template (SymbolTable 5 { op: (Function (SymbolTable 6 { combined: (Variable 6 combined [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ), x: (Variable 6 x [] In () () Default (TypeParameter t ) () Source Public Required .false. ), y: (Variable 6 y [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) op (FunctionType [(TypeParameter t ) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .true. ) [] [(Var 6 x) (Var 6 y)] [] (Var 6 combined) Public .false. .false. () ), stimes: (Function (SymbolTable 7 { a: (Variable 7 a [] In () () Default (TypeParameter t ) () Source Public Required .false. ), i: (Variable 7 i [] Local () () Default (Integer 4) () Source Public Required .false. ), n: (Variable 7 n [] In () () Default (Integer 4) () Source Public Required .false. ), res: (Variable 7 res [] ReturnVar () () Default (TypeParameter t ) () Source Public Required .false. ) }) stimes (FunctionType [(Integer 4) (TypeParameter t )] (TypeParameter t ) Source Implementation () .true. .false. .false. .false. .false. [] .false. ) [op] [(Var 7 n) (Var 7 a)] [(Assignment (Var 7 res) (Var 7 a) () ) (DoLoop () ((Var 7 i) (IntegerConstant 2 (Integer 4)) (Var 7 n) ()) [(Assignment (Var 7 res) (FunctionCall 5 op () [((Var 7 res)) ((Var 7 a))] (TypeParameter t ) () () ) () )] )] (Var 7 res) Public .false. .false. () ), t: (Variable 5 t [] In () () Default (TypeParameter t ) () Source Public Required .false. ) }) derive_semigroup [t op] [(Require semigroup [t op] )] ), ... (semigroup requirement's tree) }) semigroup_m [semigroup_m] .false. .false. ) ``` ## See Also * [Symbols](symbol.md) * [Requirement](Requirement.md) * [Generics](../../generics.md)lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/Variable.md0000664000175000017500000001040215141516316026472 0ustar alastairalastair# Variable Variable is a **symbol** node representing a variable declaration. ## Declaration ### Syntax ``` Variable(symbol_table parent_symtab, identifier name, identifier* dependencies, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, symbol type_declaration, abi abi, access access, presence presence, bool value_attr) ``` ### Arguments `parent_symtab` integer id of the parent symbol table that contains the variable `name` the name of the variable `dependencies` other symbols that this variable depends on; must all be defined in the `parent_symtab` `intent` specifies intent (Local, `intent(in)`, `intent(inout)`, etc.) `symbolic_value` the optional symbolic expression to initialize the variable (e.g. `2+3+4+x`), this value must be compile time, but it is not necessarily a constant (e.g., can contain binary operations, other variables, etc.) `value` the optional constant expression holding the compile time value (e.g. `5`, or `5.5`), it is a compile time constant. `storage` whether `Save`, `Parameter`, `Allocatable` `type` the ttype of the variable `type_declaration` null for primitive types; for composite types that are declared elsewhere in the program (struct, function, enum) it points to the symbol that declares the type `abi` abi such as: `Source`, `Interface`, `BindC` `access` visibility: `Public`, `Private` `presence` for parameters: `Required` or `Optional` `value_attr` if true, this parameter has a `value` attribute set ### Return values None. ## Description A `Variable` node represents a declaration of any variable in the program. It contais information about the type, visibility, compile-time value, etc. The type of the variable can be any of the primitive types like integer, real, complex, pointers, arrays. In such cases, the `type_declaration` member of the `Variable` is null. `Variable` might also have a non-primitive type like `StructType`, or types for classes, enums, and function pointers. Such types are not declared inline to the `Variable` node itself. In such cases, the `type_declaration` member of `Variable` points to the symbol containing the declaration of the type. `Variable` represents declarations of variables. `Var` nodes represent instances of variables in code. To represent the use of a variable in an expression, employ the ASR `expr Var` node. ## Examples ```fortran program expr2 integer :: x x = (2+3)*5 print *, x end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { expr2: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. () ) }) expr2 [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (Print () [(Var 2 x)] () () )] ) }) [] ) ``` ## See Also [Var](../expression_nodes/Var.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/symbol_nodes/program.md0000664000175000017500000000467515141516316026433 0ustar alastairalastair# Program Program symbol, a **symbol** node. ## Declaration ### Syntax ```fortran Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body) ``` ### Arguments `symtab` the symbol table of the program. `name` the name of the program. `dependencies` the module names that the program depends on. `body` the list of statements that the program contains. ### Return values None. ## Description ASR pass transforms (in-place) the ASR tree and wraps all global statements and expressions into a program. ## Types ## Examples ```fortran program expr2 integer :: x x = (2+3)*5 print *, x end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { expr2: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ) }) expr2 [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (Print () [(Var 2 x)] () () )] ) }) [] ) ``` ## See Also [Module](Module.md), [Function](Function.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/0000775000175000017500000000000015141516316025125 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/associateblockcall.md0000664000175000017500000002020415141516316031267 0ustar alastairalastair# AssociateBlockCall Associate statements' blocks' call, a `stmt` node. ## Declaration ### Syntax ```fortran AssociateBlockCall(symbol m) ``` ### Arguments `m` contains symbol. ### Return values None. ## Description **AssociateBlockCall** statement is for the call to the associate block. For more information see [associate](associate.md). ## Types ## Examples ```fortran module stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Public Required .false. ) }) read_formatted [(Var 5 v_list)] [(SubroutineCall 2 unused_dummy_argument () [((Var 5 v_list))] () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), unused_dummy_argument: (Function (SymbolTable 3 { associate_block: (AssociateBlock (SymbolTable 6 { dummy: (Variable 6 dummy Local () () Default (Pointer (Class 3 ~unlimited_polymorphic_type [] ) ) Source Private Required .false. ) }) associate_block [(=> (Var 6 dummy) (Var 3 dummy) )] ), dummy: (Variable 3 dummy In () () Default (Class 3 ~unlimited_polymorphic_type [] ) Source Public Required .false. ), ~unlimited_polymorphic_type: (StructType (SymbolTable 4 { }) ~unlimited_polymorphic_type [] Source Public () ) }) unused_dummy_argument [(Var 3 dummy)] [(AssociateBlockCall 3 associate_block )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/subroutinecall.md0000664000175000017500000001154515141516316030510 0ustar alastairalastair# SubroutineCall SubroutineCall/FunctionCall to store the actual final resolved subroutine or function (`name`) member, a `stmt` node. ## Declaration ### Syntax ```fortran SubroutineCall(symbol name, symbol? original_name, call_arg* args, expr? dt, bool strict_bounds_checking) ``` ### Arguments `name` contains symbol name. `original_name` contains name present in program unit. `args` contains arguments passed to subroutine call. `dt` contains expression for variable name, array name, an aseterist e.t.c. `strict_bounds_checking` indicates if this SubroutineCall was a FunctionCall before getting converted by subroutine_from_function pass, if it was then we need to do strict_bounds_checking for the return argument. ### Return values None. ## Description **SubroutineCall** stores the actual final resolved subroutine or function (`name` member). They also store the original symbol (`original_name`), which can be one of null, GenericProcedure or ExternalSymbol. ## Types Not Applicable. ## Examples ```fortran program Subroutine_Call implicit none integer(4) :: from, to from = 10 to = 4 call mvbits(from, 2, 2, to, 0) if (from /= 10) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), subroutine_call: (Program (SymbolTable 2 { from: (Variable 2 from Local () () Default (Integer 4 []) Source Public Required .false. ), mvbits: (ExternalSymbol 2 mvbits 4 mvbits lfortran_intrinsic_bit [] mvbits Private ), mvbits@mvbits32: (ExternalSymbol 2 mvbits@mvbits32 4 mvbits32 lfortran_intrinsic_bit [] mvbits32 Private ), to: (Variable 2 to Local () () Default (Integer 4 []) Source Public Required .false. ) }) subroutine_call [] [(= (Var 2 from) (IntegerConstant 10 (Integer 4 [])) () ) (= (Var 2 to) (IntegerConstant 4 (Integer 4 [])) () ) (SubroutineCall 2 mvbits@mvbits32 2 mvbits [((Var 2 from)) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((Var 2 to)) ((IntegerConstant 0 (Integer 4 [])))] () ) (If (IntegerCompare (Var 2 from) NotEq (IntegerConstant 10 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/statement_nodes.md0000664000175000017500000000067515141516316030653 0ustar alastairalastair# ASR Statement Nodes ```{toctree} --- maxdepth: 1 --- allocate.md assert.md assign.md assignment.md associate.md associateblockcall.md blockcall.md cptrtopointer.md cycle.md doconcurrentloop.md doloop.md errorstop.md exit.md explicitdeallocate.md flush.md forallsingle.md goto.md gototarget.md if.md ifarithmetic.md implicitdeallocate.md nullify.md ompregion.md print.md return.md select.md stop.md subroutinecall.md where.md whileloop.md ``` lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/doloop.md0000664000175000017500000001107215141516316026744 0ustar alastairalastair# DoLoop The `DO` statement to repeatedly execute a set of statements. ## Declaration ### Syntax ```fortran DoLoop(do_loop_head head, stmt* body) ``` ### Arguments `head` contains do loop header or loop control. `body` contains do loop statements. ### Return values None. ## Description **DoLoop** statement nodes repeatedly executes a set of statements. A labeled `DO` loop consists of the following: - `DO` statement - Set of executable statements i.e., body of the `do` loop - Terminal statement, like `CONTINUE` statement The `DO` variable must not be modified in any way within the range of the `DO` loop. Control must not jump into the range of a `DO` loop from outside its range. After the terminal statement of a `DO` loop is executed, the following steps are performned: - The value of the `DO` variable, if any, is incremented. - The iteration count of the loop statement is decremented by one. - The iteration count of condition is tested. ## Types Accessible global identifier and a sequence of zero or more statements or construst that make the `DO` range. ## Examples ```fortran program doloop implicit none integer :: i, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_03 [] [(= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])) ()) [(If (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(Cycle)] [] ) (= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 j)] () () )] ) }) [] ) ``` ## See Also [doconcurrentloop](doconcurrentloop.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/setinsert.md0000664000175000017500000000035015141516316027465 0ustar alastairalastair# SetInsert ## Declaration ### Syntax ```fortran SetInsert(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **SetInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/assignment.md0000664000175000017500000003035015141516316027620 0ustar alastairalastair# Assignment Assignment statement, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Assignment(expr target, expr value, stmt? overloaded, bool realloc_lhs, bool move_allocation) ``` ### Arguments `target` contains expression target. `value` expressions giving the value to be assigned. `overloaded` denotes if overloaded. `realloc_lhs` denotes if target has to be reallocated to the size of value before the assignment. `move_allocation` denotes if this is a move assignment for allocatable arrays. ### Return values None. ## Description **assignment** statement assigns a value to a variable, substring, array element, record, or record field. The value can be a constant or the result of an expression. The kinds of assignment statements: are arithmetic, logical, character, and record assignments. If realloc_lhs is true then before the assignment the target is reallocated to the size of the value. move_allocation must only be true if both target and value are allocatable arrays of DescriptorArray physical type. The data pointer of value's descriptor is copied to the target's descriptor. And rest of the fields of value's descriptor are copied into target's descriptor. After the move, the data pointer of value's descriptor is set to null. ## Types Numeric type, a name of a variable, array element, or record field. Arithmentic expression, chracter constant, or a logical expression. ## Examples ```fortran module overload_assignment_m implicit none private public assignment (=) interface assignment (=) module procedure logical_gets_integer end interface contains subroutine logical_gets_integer(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = (i == 0) end subroutine subroutine logical_gets_integer_use(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = i end subroutine end module program main use overload_assignment_m, only: assignment(=) implicit none logical :: tf tf = 0 print *, "tf=0:", tf ! Yields: T tf = 1 print *, "tf=1:", tf ! Yields: F end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 5 { logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Private ), tf: (Variable 5 tf Local () () Default (Logical 4 []) Source Private Required .false. ), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Private ) }) main [overload_assignment_m] [(= (Var 5 tf) (IntegerConstant 0 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4 [])))] () ) ) (Print () [(StringConstant "tf=0:" (Character 1 5 () []) ) (Var 5 tf)] () () ) (= (Var 5 tf) (IntegerConstant 1 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4 [])))] () ) ) (Print () [(StringConstant "tf=1:" (Character 1 5 () []) ) (Var 5 tf)] () () )] ), overload_assignment_m: (Module (SymbolTable 2 { logical_gets_integer: (Function (SymbolTable 3 { i: (Variable 3 i In () () Default (Integer 4 []) Source Private Required .false. ), tf: (Variable 3 tf Out () () Default (Logical 4 []) Source Private Required .false. ) }) logical_gets_integer [(Var 3 tf) (Var 3 i)] [(= (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), logical_gets_integer_use: (Function (SymbolTable 4 { i: (Variable 4 i In () () Default (Integer 4 []) Source Private Required .false. ), tf: (Variable 4 tf Out () () Default (Logical 4 []) Source Private Required .false. ) }) logical_gets_integer_use [(Var 4 tf) (Var 4 i)] [(= (Var 4 tf) (Var 4 i) (SubroutineCall 2 logical_gets_integer 2 ~assign [((Var 4 tf)) ((Var 4 i))] () ) )] () Source Private Implementation () .false. .false. .false. .false. .false. [] [] .false. ), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public ) }) overload_assignment_m [] .false. .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/ompregion.md0000664000175000017500000000651015141516316027450 0ustar alastairalastair# OMPRegion The OMPRegion node represents an OpenMP region directive and its enclosed statements. ## Declaration ### Syntax ``` OMPRegion(omp_region_type region, omp_clause* clauses, stmt* body) ``` ### Arguments | Argument name | Argument Description | |---------------|----------------------| | `region` | The type of OpenMP region (e.g., Parallel, Target, Teams). | | `clauses` | A list of OpenMP clauses associated with the region. | | `body` | A list of statements enclosed within the OpenMP region. | ### Return values None. ## Description OMPRegion encapsulates OpenMP directives and their associated constructs in the Abstract Semantic Representation (ASR). It supports various OpenMP region types, such as Parallel, Do, ParallelDo, Sections, Single, Master, Task, Teams, Distribute, Target, and others. Each region can include clauses like private, shared, reduction, map, schedule, num_threads, and num_teams to specify behavior such as data sharing, loop scheduling, or device offloading. The node decouples OpenMP pragmas from general loop constructs, enabling targeted lowering to runtime libraries like libgomp for parallel execution. ## Types The `region` field uses the `omp_region_type` enumeration, which includes values like Parallel, Target, Teams, and ParallelDo. Clauses are represented by the `omp_clause` union, supporting types such as OMPPrivate, OMPShared, OMPReduction, OMPMap (with map_type like To, From, ToFrom), and OMPSchedule (with schedule_type like Static, Dynamic, Runtime). The body consists of ASR statement nodes. ## Examples ```fortran program openmp_52 use omp_lib implicit none integer, parameter :: N = 100, init=0 integer :: a(N), i, total a = 1 ! Initialize all elements to 1 !$omp parallel shared(a, total) private(i) total = init ! Initialize total to 0 !$omp barrier !$omp do do i = 1, N !$omp critical total = total + a(i) !$omp end critical end do !$omp end do !$omp end parallel print *, "Total sum:", total if (total /= N) error stop "Incorrect sum" end program openmp_52 ``` ASR: ```clojure (OMPRegion Parallel [(OMPShared [(Var 2 a) (Var 2 total)] ) (OMPPrivate [(Var 2 i)] )] [(Assignment (Var 2 total) (Var 2 init) () .false. ) (OMPRegion Barrier [] [] ) (OMPRegion Do [] [(DoLoop () ((Var 2 i) (IntegerConstant 1 (Integer 4) Decimal) (Var 2 n) ()) [(OMPRegion Critical [] [(Assignment (Var 2 total) (IntegerBinOp (Var 2 total) Add (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4) ColMajor () ) (Integer 4) () ) () .false. )] )] [] )] )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/listremove.md0000664000175000017500000000035215141516316027640 0ustar alastairalastair# ListRemove ## Declaration ### Syntax ```fortran ListRemove(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **ListRemove** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/select.md0000664000175000017500000000037115141516316026727 0ustar alastairalastair# Select ## Declaration ### Syntax ```fortran Select(expr test, case_stmt* body, stmt* default) ``` ### Arguments ### Return values None. ## Description **Select** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/listappend.md0000664000175000017500000000041415141516316027611 0ustar alastairalastair# ListAppend Append to list, a `stmt` node. ## Declaration ### Syntax ```fortran ListAppend(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **ListAppend** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/ifarithmetic.md0000664000175000017500000001514615141516316030126 0ustar alastairalastair# IfArithmetic The arithmetic `IF` statement branches to one of three specified statements, depending on the value of an arithmetic expression. ## Declaration ### Syntax ```fortran IfArithmetic(expr test, int lt_label, int eq_label, int gt_label) ``` ### Arguments `test` contains conditional expression to be evaluated. `lt_label` contains `eq_label` contains `gt_label` contains ### Return values None. ## Description **IfArithmetic** is the arithmetic `if` statement which branches to one of three specified statements, depending on the value of an arithmetic expression. ## Types `test` can be arithmetic expression of type integer, real, double precision, or quadruple precision. The other three lables are labels of executable statements. ## Examples ```fortran program ifarithmetic integer :: i i = 5 if (i == 5) print *, 'correct' if (i == 6) print *, 'incorrect' i = -2 40 i = i + 1 if (i) 50, 60, 70 50 print *, 'i < 0' go to 40 60 print *, 'i == 0' go to 40 70 print *, 'i > 0' end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if1: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) if1 [] [(= (Var 2 i) (IntegerConstant 5 (Integer 4 [])) () ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ) [(Print () [(StringConstant "correct" (Character 1 7 () []) )] () () )] [] ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ) [(Print () [(StringConstant "incorrect" (Character 1 9 () []) )] () () )] [] ) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 [])) ) () ) (GoToTarget 40 40 ) (= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 i) Lt (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 50 50 )] [(If (IntegerCompare (Var 2 i) Gt (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 70 70 )] [(GoTo 60 60 )] )] ) (GoToTarget 50 50 ) (Print () [(StringConstant "i < 0" (Character 1 5 () []) )] () () ) (GoTo 40 40 ) (GoToTarget 60 60 ) (Print () [(StringConstant "i == 0" (Character 1 6 () []) )] () () ) (GoTo 40 40 ) (GoToTarget 70 70 ) (Print () [(StringConstant "i > 0" (Character 1 5 () []) )] () () )] ) }) [] ) ``` ## See Also [If](if.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/listclear.md0000664000175000017500000000033515141516316027432 0ustar alastairalastair# ListClear ## Declaration ### Syntax ```fortran ListClear(expr a) ``` ### Arguments ### Return values None. ## Description **ListClear** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/whileloop.md0000664000175000017500000001134315141516316027453 0ustar alastairalastair# While Loop While statement of `do while` loop, a `stmt` node. ## Declaration ### Syntax ```fortran WhileLoop(expr test, stmt* body) ``` ### Arguments `test` contains expression to be tested. `body` contains 0 or more statements or constructs. ### Return values None. ## Description **While** statement of `do while` loop constitues `test` expression to be evaulated at each run on the `while` statement, and after first run. Execution proceeds as: 1. The specified expression is evaluated. 2. If the value of the expression is true, the statements in the range of the `DO WHILE` loop are executed. 3. If the value of the expression is false, control is transferred to the statement following the `DO WHILE` loop. ## Types Expression and pointer to body of the `DO WHILE loop`. ## Examples ```fortran program while implicit none integer :: i, j i = 1 j = 0 do while (i < 11) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { while_01: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) while_01 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (WhileLoop (IntegerCompare (Var 2 i) Lt (IntegerConstant 11 (Integer 4 [])) (Logical 4 []) () ) [(= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () ) (= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (If (IntegerCompare (Var 2 i) NotEq (IntegerConstant 11 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/allocate.md0000664000175000017500000000440415141516316027235 0ustar alastairalastair# Allocate Allocate an allocatable variable. ## Declaration ### Syntax ```fortran Allocate(alloc_arg* args, expr? stat, expr? errmsg, expr? source) ``` ### Arguments Input argument of `args`, `stat` of type expression, `errmsg` of type expression, and `source` of type expression. `args` contains the arrays to be allocated. `stat` is a variable to receive the status integer (success/failure). `errmsg` is variable to receive error message. `source` contains the source location. `source` will not do a copy, it will only use it for a runtime decision how to allocate. ### Return values None. ## Description **allocate** allocates all arrays in `args` to the sizes specified in the `alloc_arg`. ## Types Only accepts integer whole number value, that can be allocated on available heap memory. ## Examples Following example code allocates a memory block of size 2: ```fortran program allocate_mem real, allocatable :: a(:) allocate(a(3)) end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { allocate_mem: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Allocatable (Real 4 [(() ())]) Source Public Required .false. ) }) allocate_mem [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () () ) (ImplicitDeallocate [2 a] )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/assign.md0000664000175000017500000000626515141516316026744 0ustar alastairalastair# Assign Assign function, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Assign(int label, identifier variable) ``` ### Arguments `label` contains statement label. `variable` contains integer variable. ### Return values None. ## Description **assign** statement assigns a statement label to a variable. The label is the label of an executable statement or a FORMAT statement. The integer variable, once assigned a statement label, can be reassigned the same statement label, a different label, or an integer. ## Types ## Examples ```fortran program assign integer :: x real :: y 10 format('(i3)') assign 10 to x 20 assign 10 to x ASSIGN 10 TO x 30 ASSIGN 10 TO y ! An integer variable is required in this context. end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { assign: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false. ) }) assign [] [(GoToTarget 10 10 ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 20 20 ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (= (Var 2 x) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 30 30 ) (= (Var 2 y) (IntegerConstant 10 (Integer 4 [])) () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/return.md0000664000175000017500000000431715141516316026773 0ustar alastairalastair# Return Return statement to return control to the calling program unit, a stmt node. ## Declaration ### Syntax ```fortran Return() ``` ### Arguments None. ### Return values None. ## Description **Return** statement returns control to the calling program unit. Execution of `RETURN` statement terminates the reference of a function or subroutine. ## Types None. ## Examples ```fortran subroutine example (s) character s* "32" write (*,*) s return end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { example: (Function (SymbolTable 2 { s: (Variable 2 s Unspecified (StringConstant "32" (Character 1 2 () []) ) () Save (Character 1 1 () []) Source Public Required .false. ) }) example [(Var 2 s)] [(FileWrite 0 () () () () () [(Var 2 s)] () () ) (Return)] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/listinsert.md0000664000175000017500000000036515141516316027653 0ustar alastairalastair# ListInsert ## Declaration ### Syntax ```fortran ListInsert(expr a, expr pos, expr ele) ``` ### Arguments ### Return values None. ## Description **ListInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/setremove.md0000664000175000017500000000035015141516316027456 0ustar alastairalastair# SetRemove ## Declaration ### Syntax ```fortran SetRemove(expr a, expr ele) ``` ### Arguments ### Return values None. ## Description **SetRemove** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/if.md0000664000175000017500000000407115141516316026047 0ustar alastairalastair# If Conditionally executes on block of statements depending on the evaluation of a logical expression, a `stmt` node. ## Declaration ### Syntax ```fortran If(expr test, stmt* body, stmt* orelse) ``` ### Arguments `test` contains statement or condition to be tested. `body` contains block of 0 or more statements to be executed as per evaluation of `test`. `orelse` contains pointer target to `else` block. ### Return values None. ## Description **If** conditionally executes one block of constructs or statements depending on the evaluation of a logical expression. If a construct name is specfied at the beginning of an `IF THEN` statement, the same name must appear in the corresponding `END IF` statement. If a construct name is specified on an `ELSE IF` or `ELSE` statement, the same name must appear in the corresponding `IF THEN` and `END IF` statements. Depending on the evaluation of the logical expression, one block or no block is executed. The logical expressions are evaluated in the order in which they appear, until a true value is found or an `ELSE` or `END IF` statement is encountered. Once a true value is found or an `ELSE` statement is encountered, the block immediately following it is executed and the construct execution terminates. ## Types expression and block of statements, including a pointer. ## Examples ```fortran program if implicit none if (.false.) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if_01: (Program (SymbolTable 2 { }) if_01 [] [(If (LogicalConstant .false. (Logical 4 []) ) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also [IfArithmetic](ifarithmetic.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/implicitdeallocate.md0000664000175000017500000000121715141516316031300 0ustar alastairalastair# ImplicitDeallocate Deallocates if allocated otherwise does nothing, a `stmt` ASR node. ## Declaration ### Syntax ```fortran ImplicitDeallocate(symbol* vars) ``` ### Arguments `vars` contains pointer target. ### Return values None. ## Description **ImplicitDeallocate** frees the storage allocated for allocatable variables and nonprocedure pointer targets. It also disassociates pointer. It is done by `Deallocate()` statement. If not allocated, it does nothing. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also [explicitdeallocate](explicitdeallocate.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/nullify.md0000664000175000017500000000650715141516316027141 0ustar alastairalastair# Nullify Disassociates a pointer from a target, a `stmt` node. ## Declaration ### Syntax ```fortran Nullify(symbol* vars) ``` ### Arguments `vars` contains pointer object to symbol variables. ### Return values None. ## Description **Nullify** disassociates a pointer from a target. The initial disassociation status of a pointer is undefined. It is used to `NULLIFY` to initialize an undefined pointer, giving it disassociated status. ## Types ## Examples ```fortran program nullify implicit none integer, pointer :: p1, p2 integer, target :: t1 p1=>t1 p2=>t1 p1 = 1 nullify(p1, p2) end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { nullify: (Program (SymbolTable 2 { p1: (Variable 2 p1 Local () () Default (Pointer (Integer 4 []) ) Source Public Required .false. ), p2: (Variable 2 p2 Local () () Default (Pointer (Integer 4 []) ) Source Public Required .false. ), t1: (Variable 2 t1 Local () () Default (Integer 4 []) Source Public Required .false. ) }) nullify [] [(=> (Var 2 p1) (Var 2 t1) ) (=> (Var 2 p2) (Var 2 t1) ) (= (Var 2 p1) (IntegerConstant 1 (Integer 4 [])) () ) (Nullify [2 p1 2 p2] )] ) }) [] ) ``` ## See Also [Flush](flush.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/stop.md0000664000175000017500000000516115141516316026437 0ustar alastairalastair# Stop To terminate execution of the program. ## Declaration ### Syntax ```fortran Stop(expr? code) ``` ### Arguments `code` contains string of less than or equal to 5 digits or a character constant. ### Return values None. ## Description **Stop** statement terminates execution of the program. The argument `code` is displayed when the program stops. If nothing is specified, no message is displayed. ## Types Expression for optional `code` input parameter. ## Examples ```fortran program stop implicit none integer :: x x = (2+3)*5 if (x == 25) stop end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stop: (Program (SymbolTable 2 { x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false. ) }) stop [] [(= (Var 2 x) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) ) () ) (If (IntegerCompare (Var 2 x) Eq (IntegerConstant 25 (Integer 4 [])) (Logical 4 []) () ) [(Stop () )] [] )] ) }) [] ) ``` ## See Also [Return](return.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/explicitdeallocate.md0000664000175000017500000000116715141516316031313 0ustar alastairalastair# ExplicitDeallocate Deallocates if allocated otherwise throws a runtime error, a `stmt` ASR node. ## Declaration ### Syntax ```fortran ExplicitDeallocate(symbol* vars) ``` ### Arguments `vars` contains pointer target. ### Return values None. ## Description **ExplicitDeallocate** frees the storage allocated for allocatable variables and nonprocedure pointer targets. It also disassociates pointer. It is done by `Deallocate()` statement. If not allocated, it throws a runtime error. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/where.md0000664000175000017500000000175615141516316026572 0ustar alastairalastair# Where Where, masks the evaluation of expression and assignments of values in array assignment statements, a `stmt` node. ## Declaration ### Syntax ```fortran Where(expr test, stmt* body, stmt* orelse) ``` ### Arguments `test` contains condition or expression to be tested. `body` contains statement body. `orelse` contains the else condition if `where` is not true or served. ### Return values None. ## Description **Where** statement masks the evaluation of expression and assignments of values in array assignment statements. It does this according to the value of logical array expression. If the `where` statement is not the first statement of `where` construct, it can be used as the terminal statement of a `do` or `do while` construct. ## Types Not applicable. ## Examples ```fortran program main real :: x(10) x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] where (x/=5) x = 32.0 elsewhere x = 0.0 end where print *, x end program ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/errorstop.md0000664000175000017500000000540115141516316027506 0ustar alastairalastair# ErrorStop Error termination, a statement node. ## Declaration ### Syntax ```fortran ErrorStop(expr? code) ``` ### Arguments `code` is an integer or default character constant expression and has the same meaning as for the `stop` statement. ### Return values May or may not return an error code. ## Description **ErrorStop** for error termination, happens otherwise on input/output, allocation or other such forms. It is useful for stopping all running images or processes. ## Types Name of variable, must be a pointer or allocatable variable. ## Examples ```fortran program errorstop implicit none integer :: i i = 0 do i = 1, 2 print i end do if (i /= 2) error stop print *, i end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { errorstop: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) errorstop [] [(= (Var 2 i) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(Print (Var 2 i) [] () () )] ) (If (IntegerCompare (Var 2 i) NotEq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 i)] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/cptrtopointer.md0000664000175000017500000001530315141516316030365 0ustar alastairalastair# CPtrToPointer Associtates a data pointer with the target of a C pointer and specifies its shape, a `stmt` node. ## Declaration ### Syntax ```fortran CPtrToPointer(expr cptr, expr ptr, expr? shape) ``` ### Arguments `cptr` contains the C address of an interoperable data entity, or the result of a reference to function `C_LOC` with a noninteroperable argument. If the value of `cptr` is the C address of a Fortran varible, it must have the `TARGET` attribute. `ptr` contains data pointer. If it is an array, `shape` must be specified. `shape` is of type integer and rank one. Its size equals the rank of `ptr`. ### Return values None. ## Description **CPtrToPointer** is the statement node for conversion from C pointer to data pointer. If the `ptr` is an array, it has the shape specified by `shape` and each lower bound is 1. ## Types `cptr` and `ptr` should be of type pointer holding an address. `shape` must be of type integer. ## Examples ```fortran program bindc use iso_c_binding, only: c_loc, c_ptr, c_f_pointer type(c_ptr) :: queries integer :: idx = 1 integer(2), pointer :: x integer(2), target :: y call c_f_pointer(queries, x) print *, c_loc(x), queries x => y print *, c_loc(x), c_loc(y) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bindc: (Program (SymbolTable 2 { c_f_pointer: (ExternalSymbol 2 c_f_pointer 4 c_f_pointer lfortran_intrinsic_iso_c_binding [] c_f_pointer Public ), c_loc: (ExternalSymbol 2 c_loc 4 c_loc lfortran_intrinsic_iso_c_binding [] c_loc Public ), c_ptr: (ExternalSymbol 2 c_ptr 4 c_ptr lfortran_intrinsic_iso_c_binding [] c_ptr Public ), idx: (Variable 2 idx Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ), queries: (Variable 2 queries Local () () Default (CPtr) Source Public Required .false. ), x: (Variable 2 x Local () () Default (Pointer (Integer 2 []) ) Source Public Required .false. ), y: (Variable 2 y Local () () Default (Integer 2 []) Source Public Required .false. ) }) bindc [iso_c_binding] [(CPtrToPointer (Var 2 queries) (Var 2 x) () ) (Print () [(PointerToCPtr (Var 2 x) (CPtr) () ) (Var 2 queries)] () () ) (=> (Var 2 x) (Var 2 y) ) (Print () [(PointerToCPtr (Var 2 x) (CPtr) () ) (PointerToCPtr (GetPointer (Var 2 y) (Pointer (Integer 2 []) ) () ) (CPtr) () )] () () )] ), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/goto.md0000664000175000017500000000262015141516316026417 0ustar alastairalastair# GoTo Branches to a statement label, a statement node. ## Declaration ### Syntax ```fortran GoTo(int target_id, identifier name) ``` ### Arguments `target_id` contains `int` IDs to link `GoTo` with GoToTarget. `name` contains the identifier name. ### Return values None. ## Description **GoTo** statement points to a GoToTarget with the corresponding `target_id` within the same procedure. We currently use `int` IDs to link GoTo with GoToTarget to avoid issues with serialization. ## Types Integer or `target_id` and a valid identifier name. ## Examples ```fortran program goto implicit none integer :: a a = 5 go to 1 1 print *, a end program ``` ASR: ```fortran (TranslationUnit [(Program goto_01 () [] [(ImplicitNone [] () )] [(Declaration (AttrType TypeInteger [] () None ) [] [(a [] [] () None ())] () )] [(= 0 a 5 () ) (GoTo 0 () 1 [] () ) (Print 1 () [a] () )] [] )] ) ``` ## See Also [GoToTarget](gototarget.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/blockcall.md0000664000175000017500000002027615141516316027404 0ustar alastairalastair# BlockCall Call to block symbol, a `stmt` node. ## Declaration ### Syntax ```fortran BlockCall(int label, symbol m) ``` ### Arguments `label` contains integer value of a label. `m` points to the Block symbol to call. ### Return values None. ## Description **BlockCall** signifies the block symbol call. The Block represents a scoped collection of statements and its own symbol table. The Block itself is part of a symbol table, and the BlockCall node is used to call it in order to execute the statements inside the block i.e., once the control reaches the `BlockCall` only then the statements inside the block it refers to are executed. Find more information on [block](../symbol_nodes/symbol.md). ## Types `label` must be of type integer. `m` must be of type symbol. ## Examples ```fortran program block integer :: a a = 10 1 loop: block integer :: b a = a + 5 if (a == 15) go to 1 b = a / 2 call square(b) end block loop end program block subroutine square(b) integer :: b, result result = b * b if (result /= 100) error stop print *, result end subroutine square ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { block: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false. ), block: (Block (SymbolTable 4 { b: (Variable 4 b Local () () Default (Integer 4 []) Source Public Required .false. ) }) block [(= (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4 [])) (Logical 4 []) () ) [(GoTo 1 1 )] [] ) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) () ) () ) (SubroutineCall 1 square () [((Var 4 b))] () )] ) }) block [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) () ) (GoToTarget 1 1 ) (BlockCall -1 2 block )] ), square: (Function (SymbolTable 3 { b: (Variable 3 b Unspecified () () Default (Integer 4 []) Source Public Required .false. ), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false. ) }) square [(Var 3 b)] [(= (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 3 result)] () () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/doconcurrentloop.md0000664000175000017500000003244715141516316031060 0ustar alastairalastair# DoConcurrentLoop DoConcurrentLoop specifies that there are no data dependencies between the iterations of a DO loop. ## Declaration ### Syntax ```fortran DoConcurrentLoop(do_loop_head head, expr* shared, expr* local, stmt* body) ``` ### Arguments `head` contains do loop concurrent header. `shared` contains a list of variables that are shared amongst all threads `local` contains a list of variables that are local to each thread `body` contains loop body. ### Return values None. ## Description **DoConcurrentLoop** specifies that there are no data dependencies between the iterations of a DO loop. Within the body of a `DoConcurrent` loop the program must adhere to a the list of restrictions specified on its use of Fortran language features. Actions that can't be executed in parallel or that don't allow all iterations to execute are prohibited, like: - Control flow statements which prevents the loop nest from executing all its iterations. - Image control statements, like `STOP`, `SYNC`, `ALLOCATE/DEALLOCATE`. `OMPPragma` is converted to `DoConcurrentLoop` in the AST->ASR phase. ## Types Accessible global identifier and a sequence of zero or more statements or construct that make the `DO` range. ## Examples ```fortran program doconcurrentloop implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i-1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doconcurrentloop: (Program (SymbolTable 2 { a: (Variable 2 a [] Local () () Default (Array (Real 4) [((IntegerConstant 1 (Integer 4)) (IntegerConstant 10 (Integer 4)))] FixedSizeArray ) () Source Public Required .false. ), arraysum: (Function (SymbolTable 3 { a: (Variable 3 a [] In () () Default (Array (Real 4) [(() ())] DescriptorArray ) () Source Public Required .false. ), sum: (Variable 3 sum [] Out () () Default (Real 4) () Source Public Required .false. ) }) arraysum (FunctionType [(Array (Real 4) [(() ())] DescriptorArray ) (Real 4)] () Source Implementation () .false. .false. .false. .false. .false. [] .false. ) [] [(Var 3 a) (Var 3 sum)] [(DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4)) (Var 2 n) ()) [] [] [(Assignment (Var 3 sum) (RealBinOp (Var 3 sum) Add (ArrayItem (Var 3 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (Real 4) () ) () )] )] () Public .false. .false. () ), i: (Variable 2 i [] Local () () Default (Integer 4) () Source Public Required .false. ), n: (Variable 2 n [] Local () () Default (Integer 4) () Source Public Required .false. ), sum: (Variable 2 sum [] Local () () Default (Real 4) () Source Public Required .false. ) }) doconcurrentloop [] [(Assignment (Var 2 n) (ArraySize (Var 2 a) () (Integer 4) (IntegerConstant 10 (Integer 4)) ) () ) (Assignment (Var 2 sum) (Cast (IntegerConstant 0 (Integer 4)) IntegerToReal (Real 4) (RealConstant 0.000000 (Real 4) ) ) () ) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4)) (Var 2 n) ()) [] [] [(Assignment (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4) ColMajor () ) (RealBinOp (ArrayItem (Var 2 a) [(() (IntegerBinOp (Var 2 i) Sub (IntegerConstant 1 (Integer 4)) (Integer 4) () ) ())] (Real 4) ColMajor () ) Add (Cast (IntegerConstant 5 (Integer 4)) IntegerToReal (Real 4) (RealConstant 5.000000 (Real 4) ) ) (Real 4) () ) () )] ) (SubroutineCall 2 arraysum () [((ArrayPhysicalCast (Var 2 a) FixedSizeArray DescriptorArray (Array (Real 4) [((IntegerConstant 1 (Integer 4)) (IntegerConstant 10 (Integer 4)))] DescriptorArray ) () )) ((Var 2 sum))] () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/cycle.md0000664000175000017500000000734715141516316026561 0ustar alastairalastair# Cycle Cycle function, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Cycle() ``` ### Arguments None. ### Return values None. ## Description **cycle** skips whatever is left of the loop and goes into the next cycle. ## Types Not applicable. ## Examples ```fortran program doloop_03 implicit none integer :: i, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_03: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_03 [] [(= (Var 2 j) (IntegerConstant 0 (Integer 4 [])) () ) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])) ()) [(If (IntegerCompare (Var 2 i) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ) [(Cycle)] [] ) (= (Var 2 j) (IntegerBinOp (Var 2 j) Add (Var 2 i) (Integer 4 []) () ) () )] ) (If (IntegerCompare (Var 2 j) NotEq (IntegerConstant 53 (Integer 4 [])) (Logical 4 []) () ) [(ErrorStop () )] [] ) (Print () [(Var 2 j)] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/associate.md0000664000175000017500000002053415141516316027426 0ustar alastairalastair# Associate Associate statement, a **statement (stmt)** node. ## Declaration ### Syntax ```fortran Associate(expr target, expr value) ``` ### Arguments `target` contains expression target. `value` contains expression value. ### Return values None. ## Description **associate** statement creates an association between an idetifier and a variable, or the value of an expression, during the execution of that comstruct. The idetifier specified becomes an associating entity. The name of the associating entity is an associate name. ## Types Identifier and variable. ## Examples ```fortran module stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { stdlib_string_type: (Module (SymbolTable 2 { read_formatted: (Function (SymbolTable 5 { v_list: (Variable 5 v_list In () () Default (Integer 4 [(() ())]) Source Public Required .false. ) }) read_formatted [(Var 5 v_list)] [(SubroutineCall 2 unused_dummy_argument () [((Var 5 v_list))] () )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ), unused_dummy_argument: (Function (SymbolTable 3 { associate_block: (AssociateBlock (SymbolTable 6 { dummy: (Variable 6 dummy Local () () Default (Pointer (Class 3 ~unlimited_polymorphic_type [] ) ) Source Private Required .false. ) }) associate_block [(=> (Var 6 dummy) (Var 3 dummy) )] ), dummy: (Variable 3 dummy In () () Default (Class 3 ~unlimited_polymorphic_type [] ) Source Public Required .false. ), ~unlimited_polymorphic_type: (StructType (SymbolTable 4 { }) ~unlimited_polymorphic_type [] Source Public () ) }) unused_dummy_argument [(Var 3 dummy)] [(AssociateBlockCall 3 associate_block )] () Source Public Implementation () .false. .false. .false. .false. .false. [] [] .false. ) }) stdlib_string_type [] .false. .false. ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/assert.md0000664000175000017500000000162315141516316026752 0ustar alastairalastair# Assert Test for condition or expression to be true, a stmt node. ## Declaration ### Syntax ```fortran Assert(expr test, expr? msg) ``` ### Arguments `test` contains the expression or condition to be tested for true. `msg` contains the error message if the condition tested is not true and assert fails. ### Return values None. ## Description **Assert** statement consists of the `assert` keyword, the expression or conditoon to test, and an optional message. The condtion or expression being tested is always true. If the assertion expression or conditoon is true, nothing happens and the program unit continues to normal executions otherwise the program unit is halted and aborted at `assert` statement, when it fails. ## Types Expression for condtion and message to be printed. ## Examples ```fortran program assert implicit none ASSERT(.true.) end program ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/forallsingle.md0000664000175000017500000000603315141516316030132 0ustar alastairalastair# ForAllSingle For array assignments, a statement node. ## Declaration ### Syntax ```fortran ForAllSingle(do_loop_head head, stmt assign_stmt) ``` ### Arguments `head` contains do loop head. `assign_stmt` contains assignment statement. ### Return values None. ## Description **ForAllSingle** is for array assginment. It - can access unusual sections, - can use indices in RHS expression - can use indirection (vector subscripting). ## Types Array or vector. ## Examples ```fortran program forall_01 implicit none integer :: ivec(3), i forall(i=1:3) ivec(i)=i print *,ivec end program forall_01 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { forall_01: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ), ivec: (Variable 2 ivec Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) forall_01 [] [(ForAllSingle ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])) ()) (= (ArrayItem (Var 2 ivec) [(() (Var 2 i) ())] (Integer 4 []) ColMajor () ) (Var 2 i) () ) ) (Print () [(Var 2 ivec)] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/dictinsert.md0000664000175000017500000000036715141516316027625 0ustar alastairalastair# DictInsert ## Declaration ### Syntax ```fortran DictInsert(expr a, expr key, expr value) ``` ### Arguments ### Return values None. ## Description **DictInsert** ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/print.md0000664000175000017500000000556115141516316026612 0ustar alastairalastair# Print Print statement, a stmt node. ## Declaration ### Syntax ```fortran Print(expr? fmt, expr* values, expr? separator, expr? end) ``` ### Arguments `fmt` contains format identifier `values` contains pointer to values of expression. `separator` contains separator for expressions. `end` contains end of expressions. ### Return values None. ## Description **Print** statement writes from a list to `stdout`. `fmt` the format identifier can be: - An asterist (\*), which indicates list-directed I/O. - The lable of a `FORMAT` statement that appears in the same program unit. - An integer variable name that has been assigned the label of a `FORMAT` statement that appears in the same program unit. - A character expression or interger array that specifies the format string. ## Types format indetifier and expressions. ## Examples ```fortran program print implicit none real :: pi pi = 3.141592 print "(f6.3)", pi print *, pi print 10 10 format(3x, "print") end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { print1: (Program (SymbolTable 2 { pi: (Variable 2 pi Local () () Default (Real 4 []) Source Public Required .false. ) }) print1 [] [(= (Var 2 pi) (RealConstant 3.141592 (Real 4 []) ) () ) (Print (StringConstant "(f6.3)" (Character 1 6 () []) ) [(Var 2 pi)] () () ) (Print () [(Var 2 pi)] () () ) (Print (IntegerConstant 10 (Integer 4 [])) [] () () ) (GoToTarget 10 10 )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/exit.md0000664000175000017500000000530415141516316026422 0ustar alastairalastair# Exit Immediate termination of the program with status, a statement node. ## Declaration ### Syntax ```fortran Exit() ``` ### Arguments None. ### Return values `STATUS` is passed to the parent process or calling process on exit. ## Description **Exit** causes immediate termination of the program with status. If status is omitted it returns the canonical `succes` for the system. It is useful for exit from loops or process. ## Types Not applicable. ## Examples ```fortran program exit implicit none integer :: i i = 1 do i = i + 1 if (i == 10) exit end do end program exit ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { doloop_08: (Program (SymbolTable 2 { i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) doloop_08 [] [(= (Var 2 i) (IntegerConstant 1 (Integer 4 [])) () ) (WhileLoop (LogicalConstant .true. (Logical 4 []) ) [(= (Var 2 i) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ) () ) (If (IntegerCompare (Var 2 i) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ) [(Exit)] [] )] )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/gototarget.md0000664000175000017500000000717015141516316027633 0ustar alastairalastair# GoToTarget A target of zero or more GoTo statements, a stmt node. ## Declaration ### Syntax ```fortran GoToTarget(int id, identifier name) ``` ### Arguments `id` contains target unique id within a procedure. `name` contins identifier name. ### Return values None. ## Description **GoToTarget** is an empty statement, a target of zero or more GoTo statements. The `id` is only unique within a procedure. ## Types Integer for `id` and name of the identifier. ## Examples ```fortran program gototarget 1000 if (0<1) assign 15 to k 100 goto k 15 print *, "run" end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { main: (Program (SymbolTable 2 { k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Optional .false. ) }) main [] [(GoToTarget 1000 1000 ) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) ) [(= (Var 2 k) (IntegerConstant 15 (Integer 4 [])) () )] [] ) (GoToTarget 100 100 ) (Select (Var 2 k) [(CaseStmt [(IntegerConstant 100 (Integer 4 []))] [(GoTo 100 100 )] ) (CaseStmt [(IntegerConstant 1000 (Integer 4 []))] [(GoTo 1000 1000 )] ) (CaseStmt [(IntegerConstant 15 (Integer 4 []))] [(GoTo 15 15 )] )] [] ) (GoToTarget 15 15 ) (Print () [(StringConstant "run" (Character 1 3 () []) )] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/statement_nodes/flush.md0000664000175000017500000002131015141516316026565 0ustar alastairalastair# Flush Flushes Fortran unit currently open for output, a `stmt` node. ## Declaration ### Syntax ```fortran Flush(int label, expr unit, expr? err, expr? iomsg, expr? iostat) ``` ### Arguments `label` contains label of the branch target statement that receives control if an error occurs. `unit` contains external unit specifier. `err` contains error message. `iomsg` contains an explanatory message if an I/O error occurs. `iostat` contains return value of the operation, the status code. ### Return values None. ## Description **Flush** statement makes the data written to a file or i/o unit to become available to other processes or causes data written to a file outside of Fortran to be accessible to a READ statement. ## Types ## Examples ```fortran program rewind_inquire_flush implicit none integer :: ios, len, a, b character :: fm logical :: ext rewind(unit=9, iostat=ios, err=10) inquire (file='file_b', exist=ext) inquire (4, form=fm, iostat=ios, err=20) inquire (iolength=len) a, b 10 print *, "err rewind" 20 print *, "err inquire" end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { rewind_inquire_flush: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false. ), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false. ), ext: (Variable 2 ext Local () () Default (Logical 4 []) Source Public Required .false. ), fm: (Variable 2 fm Local () () Default (Character 1 1 () []) Source Public Required .false. ), ios: (Variable 2 ios Local () () Default (Integer 4 []) Source Public Required .false. ), len: (Variable 2 len Local () () Default (Integer 4 []) Source Public Required .false. ) }) rewind_inquire_flush [] [(FileRewind 0 (IntegerConstant 9 (Integer 4 [])) (Var 2 ios) (IntegerConstant 10 (Integer 4 [])) ) (FileInquire 0 () (StringConstant "file_b" (Character 1 6 () []) ) () () (Var 2 ext) () () () () () () () () () () () () () () () () () () () () () () () () () ) (FileInquire 0 (IntegerConstant 4 (Integer 4 [])) () (Var 2 ios) (IntegerConstant 20 (Integer 4 [])) () () () () () () () () (Var 2 fm) () () () () () () () () () () () () () () () () () ) (FileInquire 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () (Var 2 len) ) (GoToTarget 10 10 ) (Print () [(StringConstant "err rewind" (Character 1 10 () []) )] () () ) (GoToTarget 20 20 ) (Print () [(StringConstant "err inquire" (Character 1 11 () []) )] () () )] ) }) [] ) ``` ## See Also [Nullify](nullify.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/omp_nodes/0000775000175000017500000000000015141516316023714 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/omp_nodes/omp_clauses.md0000664000175000017500000000556115141516316026557 0ustar alastairalastair# omp_clause The ``omp_clause`` union represents OpenMP clauses that modify the behavior of an ``OMPRegion`` directive. ## Declaration ### Syntax ``` omp_clause = OMPPrivate(expr* vars) | OMPShared(expr* vars) | OMPFirstPrivate(expr* vars) | OMPReduction(reduction_op operator, expr* vars) | OMPCollapse(expr count) | OMPNumThreads(expr num_threads) | OMPSchedule(schedule_type kind, expr? chunk_size) | OMPNumTeams(expr num_teams) | OMPThreadLimit(expr thread_limit) | OMPMap(map_type type, expr* vars) ``` ### Arguments | Clause Type | Arguments | |-----------------------|---------------------------------------------------| | `OMPPrivate` | `vars`: List of variables to privatize. | | `OMPShared` | `vars`: List of variables to share. | | `OMPFirstPrivate` | `vars`: List of variables to first-privatize. | | `OMPReduction` | `operator`: Reduction operator (e.g., ReduceAdd). `vars`: List of variables for reduction. | | `OMPCollapse` | `count`: Number of loops to collapse. | | `OMPNumThreads` | `num_threads`: Number of threads. | | `OMPSchedule` | `kind`: Schedule type (e.g., Static). `chunk_size`: Optional chunk size expression. | | `OMPNumTeams` | `num_teams`: Number of teams. | | `OMPThreadLimit` | `thread_limit`: Thread limit per team. | | `OMPMap` | `type`: Mapping type (e.g., ToFrom). `vars`: List of variables to map. | ### Return values None. ## Description ``omp_clause`` defines modifiers for OpenMP regions in the Abstract Semantic Representation (ASR). Clauses control aspects like data scoping (e.g., ``OMPPrivate``, ``OMPShared``), reductions (``OMPReduction``), loop scheduling (``OMPSchedule``), team configuration (``OMPNumTeams``), and device data mapping (``OMPMap``). These clauses are attached to ``OMPRegion`` nodes to specify runtime behavior during execution. ## More enums - ``map_type``: Enumeration for mapping directions in ``OMPMap``. - ``To``: Map data to device. - ``From``: Map data from device. - ``ToFrom``: Map data to and from device. - ``Alloc``: Allocate on device. - ``Release``: Release from device. - ``Delete``: Delete from device. - ``schedule_type``: Enumeration for loop scheduling in ``OMPSchedule``. - ``Static``: Static scheduling. - ``Dynamic``: Dynamic scheduling. - ``Guided``: Guided scheduling. - ``Auto``: Compiler-decided scheduling. - ``Runtime``: Runtime-decided scheduling. ## See OpenMp Documentation to understand each of the constructs with examples - [OpenMP API 6.0 Specification Guide](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf) - [OpenMP API 6.0 Reference Guide](https://www.openmp.org/wp-content/uploads/OpenMP-RefGuide-6.0-OMP60SC24-web.pdf)lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/omp_nodes/omp_region_type.md0000664000175000017500000000367015141516316027443 0ustar alastairalastair # omp_region_type The ``omp_region_type`` enumeration defines the types of OpenMP regions supported in the Abstract Semantic Representation (ASR). ## Declaration ### Syntax ``` omp_region_type = Parallel | Do | ParallelDo | Sections | Section | ParallelSections | Critical | Atomic | Barrier | Single | Master | Task | Taskwait | Taskloop | Simd | Teams | Distribute | TeamsDistribute | DistributeParallelDo | Target | TargetData ``` ### Arguments None. ### Return values None. ## Description ``omp_region_type`` specifies the category of an OpenMP directive within an ``OMPRegion`` node. Each value corresponds to a specific OpenMP construct, such as parallel execution (``Parallel``), loop distribution (``Distribute``), or device offloading (``Target``). This enumeration enables the ASR to represent diverse OpenMP behaviors, facilitating lowering to appropriate runtime calls. ## Types An enumeration with the following values: - ``Parallel``: Parallel region. - ``Do``: Loop construct. - ``ParallelDo``: Combined parallel loop. - ``Sections``: Sections construct. - ``Section``: Single section within sections. - ``ParallelSections``: Combined parallel sections. - ``Critical``: Critical section. - ``Atomic``: Atomic update. - ``Barrier``: Synchronization barrier. - ``Single``: Single execution. - ``Master``: Master thread execution. - ``Task``: Task construct. - ``Taskwait``: Task synchronization. - ``Taskloop``: Task loop. - ``Teams``: Teams construct. - ``Distribute``: Distribute construct. - ``TeamsDistribute``: Combined teams distribute. - ``DistributeParallelDo``: Combined distribute parallel loop. - ``Target``: Target offloading. ## See OpenMp Documentation to understand each of the constructs with examples - [OpenMP API 6.0 Specification Guide](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf) - [OpenMP API 6.0 Reference Guide](https://www.openmp.org/wp-content/uploads/OpenMP-RefGuide-6.0-OMP60SC24-web.pdf)lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/omp_nodes/omp_nodes.md0000664000175000017500000000013315141516316026216 0ustar alastairalastair# ASR OpenMp Nodes ```{toctree} --- maxdepth: 1 --- omp_clauses.md omp_region_type.md ``` lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/0000775000175000017500000000000015141516316025320 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IfExp.md0000664000175000017500000000254015141516316026656 0ustar alastairalastair# IfExp If Expression, a `expr` ASR node. ## Declaration ### Syntax ```fortran IfExp(expr test, expr body, expr orelse, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |--|--| | `test`| expression to be tested | | `body`| 0 or more statements or constructs to be executed inside `if` | | `orelse` | construct to be executed if `if` fails | | `type` | table entry type | | `value` | expression | ### Return values The return value is the expression that the IfExp represents. ## Description **IfExp** represents If expression type. More information on `if` can be found in [if](../statement_nodes/if.md). ## Types Not applicable. ## Examples Following example code creates LFortran expression from ASR's `IntegerBinOp`: ```fortran program if if(1) error stop end ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { if: (Program (SymbolTable 2 { }) if [] [(If (IntegerConstant 1 (Integer 4 [])) [(ErrorStop () )] [] )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/StringConstant.md0000664000175000017500000000167315141516316030631 0ustar alastairalastair# StringConstant A string of characters enclosed in apostrophes or quotes, an `expr` node. ## Declaration ### Syntax ```fortran StringConstant(string s, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`s` | value of string | | `type` | table entry type | ### Return values The return value is the expression that the StringConstant represents. ## Description **StringConstant** represents string constant. Each character string constant appearing outside a DATA statement is followed by a null character to ease communication with C routines. ## Types Only accepts 1 or more characters. ## Examples ```fortran "string" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringConstant "string" (Character 1 6 () []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [RealConstant](RealConstant.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/NamedExpr.md0000664000175000017500000000050515141516316027525 0ustar alastairalastair# NamedExpr ## Declaration ### Syntax ```fortran NamedExpr(expr target, expr value, ttype type) ``` ### Arguments ### Return values The return value is the expression that the NamedExpr represents. ## Description **NamedExpr** represents ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/Cast.md0000664000175000017500000000525315141516316026541 0ustar alastairalastair# Cast Cast to different type and/or kind. ## Declaration ### Syntax ```fortran Cast(expr arg, cast_kind kind, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `arg`| expression argument | |`kind` | cast to kind | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the Cast represents. ## Description **Cast** represents cast to different type and/or kind. ## Types Only accepts integer, real. ## Examples ```fortran real :: r integer :: i r = 1. * 2 i = 1. * 2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false. ), r: (Variable 1 r Local () () Default (Real 4 []) Source Public Required .false. ) }) [(= (Var 1 r) (RealBinOp (RealConstant 1.000000 (Real 4 []) ) Mul (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) () ) (= (Var 1 i) (Cast (RealBinOp (RealConstant 1.000000 (Real 4 []) ) Mul (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) (Real 4 []) (RealConstant 2.000000 (Real 4 []) ) ) RealToInteger (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayBound.md0000664000175000017500000000374315141516316027717 0ustar alastairalastair# ArrayBound Array upper and lower bound. ## Declaration ### Syntax ```fortran ArrayBound(expr v, expr? dim, ttype type, arraybound bound, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v`| expression | |`dim`| dimension | |`type` | table entry type | |`bound` | array bound | |`value` | expression value | ### Return values The return value is the expression that the ArrayBound represents. ## Description **ArrayBound** represents bounds of array. It can be upper or lower bound. ## Types Only accepts integers. ## Examples ```fortran integer :: a(2:5, 3:9, 7) print *, lbound(a, 1), lbound(a, 2), lbound(a, 3) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 2 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])) (IntegerConstant 7 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 7 (Integer 4 [])))]) Source Public Required .false. ) }) [(Print () [(ArrayBound (Var 1 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound () ) (ArrayBound (Var 1 a) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound () ) (ArrayBound (Var 1 a) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound () )] () () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerCompare.md0000664000175000017500000000220315141516316030543 0ustar alastairalastair# IntegerCompare Integer comparison `expr` ASR node. ## Declaration ### Syntax ```fortran IntegerCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the IntegerCompare represents. ## Description **IntegerCompare** represents integer comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts integers. ## Examples ```fortran 2 > 1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerCompare (IntegerConstant 2 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/expression_nodes.md0000664000175000017500000000110615141516316031227 0ustar alastairalastair# ASR Expression Nodes ```{toctree} --- maxdepth: 1 --- ArrayBound ArrayConstant ArrayItem ArrayMatMul ArrayPack ArrayReshape ArraySection ArraySize ArrayTranspose BitCast Cast ComplexBinOp ComplexCompare ComplexConstant ComplexConstructor ComplexUnaryMinus DerivedTypeConstructor FunctionCall IfExp ichar implieddoloop IntegerBOZ IntegerBinOp IntegerBitNot IntegerCompare IntegerConstant IntegerUnaryMinus IntrinsicFunction LogicalBinOp LogicalCompare LogicalConstant RealBinOp RealCompare RealConstant RealUnaryMinus StringCompare StringConcat StringConstant TypeInquiry Var ``` lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerBOZ.md0000664000175000017500000000225415141516316027615 0ustar alastairalastair# IntegerBOZ Integer typeless constants, Binary, Octal, and Hexadecimal. ## Declaration ### Syntax ```fortran IntegerBOZ(int v, integerboz intboz_type, ttype? type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `v` | integer value | | `intboz_type` | integerboz = Binary | Hex | Octal | | `type` | table entry type | ### Return values The return value is the expression that the IntegerBOZ represents. ## Description **IntegerBOZ** represents integer **B**inary **O**ctal **H/Z**exadecimal constants. These are typeless numeric constants as their expressions assume data types based on how they are used. These constants are enclosed a string of appropriate digits in apostrophes and prefix it with the letter B, O, X, or Z. ## Types Only accepts integers and real. ## Examples ```fortran B'0001000' O'777' Z'FFF99A' ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerBOZ 8 Binary () ) (IntegerBOZ 511 Octal () ) (IntegerBOZ 16775578 Hex () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArraySection.md0000664000175000017500000000433215141516316030247 0ustar alastairalastair# ArraySection Section of Array. ## Declaration ### Syntax ```fortran ArraySection(expr v, array_index* args, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`args` | array index arguments | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArraySection represents. ## Description **ArraySection** represents section of the array. ## Types Only accepts section of arrays. ## Examples ```fortran integer, dimension(3) :: x x(0) = 0 x(1) = 1 x(2) = 2 print *, x(1:) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 x) [(() (IntegerConstant 0 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 0 (Integer 4 [])) () ) (= (ArrayItem (Var 1 x) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 1 (Integer 4 [])) () ) (= (ArrayItem (Var 1 x) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 2 (Integer 4 [])) () ) (Print () [(ArraySection (Var 1 x) [((IntegerConstant 1 (Integer 4 [])) () (IntegerConstant 1 (Integer 4 [])))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () )] () () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerConstant.md0000664000175000017500000000245015141516316030752 0ustar alastairalastair# IntegerConstant Integer literal constant, an `expr` node. ## Declaration ### Syntax ```fortran IntegerConstant(int n, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `n` | value of integer | | `type` | tabel entry type | ### Return values The return value is the expression that the IntegerConstant represents. ## Description **IntegerConstant** represents integer constant which consists of a optional plus or minus sign, followed by a string of decimal digits. No other characters are allowed except, a space. If no sign is present, the constant is assumed to be non negative. The value must be in the `INTEGER*4` range (-2147483648, 2147483647). If `INTEGER*8` range is (-9223372036854775808,9223372036854775807). ## Types Only accepts integers. ## Examples ```fortran +199 29002 -2147483648 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerConstant 199 (Integer 4 [])) (IntegerConstant 29002 (Integer 4 [])) (IntegerUnaryMinus (IntegerConstant 2147483648 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2147483648 (Integer 4 [])) )] ) ``` ## See Also [RealConstant](RealConstant.md), [ComplexConstant](ComplexConstant.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ComplexBinOp.md0000664000175000017500000000362015141516316030202 0ustar alastairalastair# ComplexBinOp Complex Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran ComplexBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the ComplexBinOp represents. ## Description **ComplexBinOp** represents complex binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts real constants, real exponents, floating point values, integer, as real and imaginary part of the complex constant. ## Examples ```fortran (2.1, 3.1) + 5.1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexBinOp (ComplexConstructor (RealConstant 2.100000 (Real 4 []) ) (RealConstant 3.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 2.100000 3.100000 (Complex 4 []) ) ) Add (Cast (RealConstant 5.100000 (Real 4 []) ) RealToComplex (Complex 4 []) (ComplexConstant 5.100000 0.000000 (Complex 4 []) ) ) (Complex 4 []) (ComplexConstant 7.200000 3.100000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [RealBinOp](RealBinOp.md), [LogicalBinOp](LogicalBinOp.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/RealConstant.md0000664000175000017500000000256315141516316030245 0ustar alastairalastair# RealConstant Real literal constant, an `expr` node. ## Declaration ### Syntax ```fortran RealConstant(floar r, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `r` | value of real | | `type` | tabel entry type | ### Return values The return value is the expression that the RealConstant represents. ## Description **RealConstant** represents real constant which consists of a optional plus or minus sign, followed by a string of decimal digits, before or after decimal point. If no sign is present, the constant is assumed to be non negative. The value must be in the `REAL*4` range, uses 4 bytes of storage. It can have a decimal point or an exponent. ## Types Only accepts real constant, real exponent, floating point values. ## Examples ```fortran +199. -1.2 1.6E12 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealConstant 199.000000 (Real 4 []) ) (RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) ) (RealConstant 1600000000000.000000 (Real 4 []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [ComplexConstant](ComplexConstant.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/StringPhysicalCast.md0000664000175000017500000001326015141516316031422 0ustar alastairalastair# String Physical Cast Cast string physical type from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) and vice versa ## Declaration ### Syntax ```ASDL StringPhysicalCast(expr arg, string_physical_type old, string_physical_type new, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------- | | `arg` | String expression argument | | `old` | Current physical string type of the string expression `arg`.
**Possible values** : `DescriptorString`, `PointerString`. | | `new` | The target physical string type to cast to.
**Possible values** : `DescriptorString`, `PointerString`. | | `type` | Type of expression (It's always a string with physical type equivalent to `new` StringPhysicalType) | | `value` | The type of the expression. It is always a string type corresponding to the new StringPhysicalType. | ### Return values The return value is a string expression in the _new_ physical type. It's a message to the back end to know which physical type to use on this string expression. ## Description **StringPhysicalCast** casts the physical type from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) and vice versa. It dispatches a message to the backend to cast the physical type of the passed string expression from one type to another, so we can do some runtime string operations like **assignment**, **slicing**, **printing** and **comparing** with no issues when using the *DescriptorString* `{char* data, int64 size, int64 capacity}` and also to keep using it and utilizing the size and capacity members when needed. **The intention behind casting from [`DescriptorString`](../type_nodes/StringPhysicalType.md) to [`PointerString`](../type_nodes/StringPhysicalType.md) :** - The intention is to tell the back end to operate on pointerString `char*`instead of the whole descriptorString llvm struct`{char* data, int64 size, int64 capacity}` - This happens by fetching `char* data` from the LLVM descriptor - **NOTE** : This kind of casting is widely used in the code base as most of the runtime operations use `char*` and don't need to utilize `size` and `capacity` member of the LLVM **The intention behind casting from [`PointerString`](../type_nodes/StringPhysicalType.md) to [`DescriptorString`](../type_nodes/StringPhysicalType.md):**\ - The intention is to tell the back end to operate on the whole descriptorString llvm struct`{char* data, int64 size, int64 capacity}` instead of pointerString `char*` - This happens by creating an LLVM struct (which represents the descriptorString) called `casted_string_ptr_to_desc` then we just make its internal `char*` point to the passed pointerString arg, and then we fill `size` and `capacity` with `-1` value to be an indication later for any function that utilizes these 2 values - telling it that this string is casted and it's originally a pointer (fixed memory location) and don't extend it. - **NOTE** : This isn't widely used in the code base unless we're dealing with some LHS-RHS kinda of operations on strings, that's where we make the two sides have equal physical string types *like function-argument passing*. apart from that, it makes our life easier when implementing LHS-RHS string expression visitors just be knowing a small fact that the internals of this LHS-RHS string expression are of descriptorString physical type. ## Types Only accepts strings. ## Examples ``` Fortran program main character(:),allocatable :: char_dynamic character(20):: char_fixed = "Hello World" char_dynamic = char_fixed char_fixed = char_dynamic print *, char_dynamic allocate(character(3) :: char_dynamic) end program main ``` ASR: ```Clojure (Assignment ; here we store char_fixed content into char_dynamic ; So We convert the physical type of rhs to the physical type of lhs by ; creating a StringPhysicalCast node. (Var 2 char_dynamic) (StringPhysicalCast (Var 2 char_fixed) PointerString DescriptorString (Allocatable (Character 1 20 () DescriptorString) ) () ) () ) (Assignment ;; Here happens the opposite ;; here we store char_dynamic content into char_fixed ;; To create a clean assignment in the back end we had to convert ;; the RHS side to the physical type of the LHS (Var 2 char_fixed) (StringPhysicalCast (Var 2 char_dynamic) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ) () ) () ) (Print (StringFormat () ;; StringFormat uses a runtime function to do handle the formatting ;; which means it operates on char* and doesn't utilized size or ;; capacity. This forces us to convert to pointerString. [(StringPhysicalCast (Var 2 char_dynamic) DescriptorString PointerString (Allocatable (Character 1 -2 () PointerString) ) () )] FormatFortran (Character -1 0 () PointerString) () ) ) ;; allocate utilizes size and capacity, so we don't cast here. (Allocate [((Var 2 char_dynamic) [] (IntegerConstant 3 (Integer 4) Decimal) ())] () () () ) ``` ## See Also [`PointerString`](../type_nodes/../type_nodes/StringPhysicalType.md), [`DescriptorString`](../type_nodes/../type_nodes/StringPhysicalType.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/LogicalCompare.md0000664000175000017500000000236715141516316030533 0ustar alastairalastair# LogicalCompare Logical comparison `expr` ASR node. ## Declaration ### Syntax ```fortran LogicalCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the LogicalCompare represents. ## Description **LogicalCompare** represents logical comparison operation. Comparison operation can be: 1. Equal to or not equal to `.TRUE.` 2. Equal to or not equal to `.FALSE.` ## Types Only accepts `.TRUE`, `.FALSE`. ## Examples ```fortran .FALSE. == .TRUE. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(LogicalCompare (LogicalConstant .false. (Logical 4 []) ) Eq (LogicalConstant .true. (Logical 4 []) ) (Logical 4 []) (LogicalConstant .false. (Logical 4 []) ) )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayMatMul.md0000664000175000017500000000531515141516316030044 0ustar alastairalastair# ArrayMatMul Array matrix multiplication. ## Declaration ### Syntax ```fortran ArrayMatMul(expr matrix_a, expr matrix_b, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`matrix_a` | matrix first | |`matrix_b` | second matrix | |`type` | table entry type | |`value | expression value |` ### Return values The return value is the expression that the ArrayMatMul represents. ## Description **ArrayMatMul** represents array matrix multiplication. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3, 4) real :: b(4, 3), cmat(3, 3) cmat = matmul(a, b) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ), cmat: (Variable 1 cmat Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 cmat) (ArrayMatMul (Var 1 a) (Var 1 b) (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayPack.md0000664000175000017500000000617515141516316027530 0ustar alastairalastair# ArrayPack Pack an array into an array of rank one. ## Declaration ### Syntax ```fortran ArrayPack(expr array, expr mask, expr? vector, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`array` | expression array | |`mask` | array mask | |`vector` | vector expression | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the ArrayPack represents. ## Description **ArrayPack** stores the elements of array in an array or rank one. The beginning of the resulting array is made up of elements whose MASK equals TRUE. Afterwards, positions are filled with elements taken from VECTOR. The result is an array of rank one and the same type as that of ARRAY. If VECTOR is present, the result size is that of VECTOR, the number of TRUE values in MASK otherwise. ## Types Only accepts integers. ## Examples ```fortran integer :: m(6), p(2) m = [ 1, 0, 0, 0, 5, 0 ] p = pack(m, m /= 0) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { m: (Variable 1 m Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 6 (Integer 4 [])))]) Source Public Required .false. ), p: (Variable 1 p Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 m) (ArrayConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 6 (Integer 4 [])))]) ) () ) (= (Var 1 p) (ArrayPack (Var 1 m) (IntegerCompare (Var 1 m) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (ArraySize (IntegerCompare (Var 1 m) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ) () (Integer 4 []) () ))]) () ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayReshape.md0000664000175000017500000000516615141516316030240 0ustar alastairalastair# ArrayReshape Function to reshape an array. ## Declaration ### Syntax ```fortran ArrayReshape(expr array, expr shape, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`array` | array expression | |`shape` | integer value and an array of rank one, positive or zero | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the ArrayReshape represents. ## Description **ArrayReshape** reshape an array. If necessary, the new array may be padded with elements from PAD or permuted as defined by ORDER. ## Types Only accepts integers. ## Examples ```fortran real(8), intent(in) :: a(:, :) real(8) :: b(256) integer :: newshape(1) newshape(1) = 256 b = reshape(a, newshape) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false. ), newshape: (Variable 1 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 256 (Integer 4 [])) () ) (= (Var 1 b) (ArrayReshape (Var 1 a) (Var 1 newshape) (Real 8 [(() ())]) () ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntrinsicFunction.md0000664000175000017500000000744215141516316031321 0ustar alastairalastair# IntrinsicFunction An intrinsic function. An **expr** node. ## Declaration ### Syntax ``` IntrinsicFunction(expr* args, int intrinsic_id, int overload_id, ttype type, expr? value) ``` ### Arguments * `args` represents all arguments passed to the function * `intrinsic_id` is the unique ID of the generic intrinsic function * `overload_id` is the ID of the signature within the given generic function * `type` represents the type of the output * `value` is an optional compile time value ### Return values The return value is the expression that the `IntrinsicFunction` represents. ## Description **IntrinsicFunction** represents an intrinsic function (such as `Abs`, `Modulo`, `Sin`, `Cos`, `LegendreP`, `FlipSign`, ...) that either the backend or the middle-end (optimizer) needs to have some special logic for. Typically a math function, but does not have to be. IntrinsicFunction is both side-effect-free (no writes to global variables) and deterministic (no reads from global variables). They can be used inside parallel code and cached. There are two kinds: * `elemental`: the function is defined as a scalar function and it can be vectorized over any argument(s). Examples: `Sin`, `Cos`, `LegendreP`, `Abs` * `non-elemental`: it accepts arrays as arguments and the function cannot be defined as a scalar function. Examples: `Sum`, `Any`, `MinLoc` The `intrinsic_id` determines the generic function uniquely (`Sin` and `Abs` have different number, but `IntegerAbs` and `RealAbs` share the number) and `overload_id` uniquely determines the signature starting from 0 for each generic function (e.g., `IntegerAbs`, `RealAbs` and `ComplexAbs` can have `overload_id` equal to 0, 1 and 2, and `RealSin`, `ComplexSin` can be 0, 1). Backend use cases: Some architectures have special hardware instructions for operations like Sqrt or Sin and if they are faster than a software implementation, the backend will use it. This includes the `FlipSign` function which is our own "special function" that the optimizer emits for certain conditional floating point operations, and the backend emits an efficient bit manipulation implementation for architectures that support it. Middle-end use cases: the middle-end can use the high level semantics to simplify, such as `sin(e)**2 + cos(e)**2 -> 1`, or it could approximate expressions like `if (abs(sin(x) - 0.5) < 0.3)` with a lower accuracy version of `sin`. We provide ASR -> ASR lowering transformations that substitute the given intrinsic function with an ASR implementation using more primitive ASR nodes, typically implemented in the surface language (say a `sin` implementation using argument reduction and a polynomial fit, or a `sqrt` implementation using a general power formula `x**(0.5)`, or `LegendreP(2,x)` implementation using a formula `(3*x**2-1)/2`). This design also makes it possible to allow selecting using command line options how certain intrinsic functions should be implemented, for example if trigonometric functions should be implemented using our own fast implementation, `libm` accurate implementation, we could also call into other libraries. These choices should happen at the ASR level, and then the result further optimized (such as inlined) as needed. ## Types The argument types in `args` have the types of the corresponding signature as determined by `intrinsic_id`. For example `IntegerAbs` accepts an integer, but `RealAbs` accepts a real. ## Examples The following example code creates `IntrinsicFunction` ASR node: ```fortran sin(0.5) ``` ASR: ``` (TranslationUnit (SymbolTable 1 { }) [(IntrinsicFunction [(RealConstant 0.500000 (Real 4 []) )] 0 0 (Real 4 []) (RealConstant 0.479426 (Real 4 [])) )] ) ``` ## See Also [FunctionCall](FunctionCall.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/RealUnaryMinus.md0000664000175000017500000000211415141516316030556 0ustar alastairalastair# RealUnaryMinus Floating point unary minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran RealUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the RealUnaryMinus represents. ## Description **RealUnaryMinus** represents real unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `a = b.x * -c.x` ## Types Only accepts floating point values, exponents. ## Examples ```fortran -1.2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) )] ) ``` ## See Also [IntegerUnaryMinus](IntegerUnaryMinus.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/TypeInquiry.md0000664000175000017500000000453215141516316030150 0ustar alastairalastair# TypeInquiry An **expr** node, which is used to represent the `Inquiry` intrinsic function whose value is computed based on the argument type. ## Declaration ### Syntax ```fortran TypeInquiry(int inquiry_id, ttype arg_type, expr? arg, ttype type, expr value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `inquiry_id` | Function unique ID | | `arg_type` | argument type | | `arg` | argument passed | | `type` | output type | | `value` | compile time value | ### Return value The return value is the expression that the TypeInquiry represents. ## Description **TypeInquiry** is used to represent the `Inquiry` function. This node accepts exactly one `ttype` as it's only argument (`arg_type`), and it returns a value depending on `inquiry_id` of `ttype` `type`. Since the type `arg_type` is known at compile time, also the compile time value is always present in `value`. There is an optional argument `arg` that specifies the variable used in the frontend language (used in LFortran, but not present in LPython/NumPy). Here a list of inquiry_id that we support so far | Inquiry function | Output | Output type | |------------------|--------------------------|-------------| | `Epsilon` | smallest number E | `arg_type` | | `Huge` | largest number | `arg_type` | | `Precision` | decimal precision | `int32` | | `Radix` | base of a numeric model | `int32` | | `Range` | decimal exponent range | `int32` | | `Rank` | rank of a data object | `int32` | | `Tiny` | smallest positive number | `arg_type` | > Note: All the functions output are computed based on the `arg_type` ## Types The `arg_type` and `type` vary for each inquiry_id signature. The output is either the default integer or the same as the argument type. ## Examples The following example code creates `TypeInquiry` ASR node: ```fortran print *, tiny(5.0) ``` ASR: ```clojure (Print [(TypeInquiry Tiny (Real 4) (RealConstant 5.000000 (Real 4) ) (Real 4) (RealConstant 0.000000 (Real 4) ) )] () () ) ``` ## See Also [IntrinsicFunction](IntrinsicFunction.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayConstant.md0000664000175000017500000000402515141516316030433 0ustar alastairalastair# ArrayConstant Array constant. ## Declaration ### Syntax ```fortran ArrayConstant(expr* args, ttype type, arraystorage storage_format) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`args` | expression arguments | |`type` | table entry type | |`storage_format` | array storage format | ### Return values The return value is the expression that the Array Constant represents. ## Description **ArrayConstant** represents array constant. Array can be one or multi dimensional. The dimension of an array may be specified by a type specification statement `DIMENSION`. The value of the individual array elements of the array A may be initialized to the values 1, 2, 3, ..., 10. The assignment of the values of one array to another is allowed provided that both arrays in question have the same physical dimension. An array may be allocatable, i.e., it may be assigned memory storage during execution. ## Types Only accepts integers, floating points as values of array indexes. ## Examples ```fortran integer :: m(4) m = [ 1, 0, 0, 2 ] ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { m: (Variable 1 m Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 m) (ArrayConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 0 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ) () )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArraySize.md0000664000175000017500000000324615141516316027560 0ustar alastairalastair# ArraySize Size of array. ## Declaration ### Syntax ```fortran ArraySize(expr v, expr? dim, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`dim` | expression dimension | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArraySize represents. ## Description **ArraySize** represents size of array. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3) integer(8) :: size_a8 size_a8 = size(a, kind=8) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ), size_a8: (Variable 1 size_a8 Local () () Default (Integer 8 []) Source Public Required .false. ) }) [(= (Var 1 size_a8) (ArraySize (Var 1 a) () (Integer 8 []) (IntegerConstant 3 (Integer 8 [])) ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ComplexUnaryMinus.md0000664000175000017500000000257315141516316031313 0ustar alastairalastair# ComplexUnaryMinus Complex unary minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran ComplexUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the ComplexUnaryMinus represents. ## Description **ComplexUnaryMinus** represents complex unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `z = -a + ic` ## Types Only accepts floating point values, exponents, integers. ## Examples ```fortran (-1.2, 3) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexConstructor (RealUnaryMinus (RealConstant 1.200000 (Real 4 []) ) (Real 4 []) (RealConstant -1.200000 (Real 4 []) ) ) (IntegerConstant 3 (Integer 4 [])) (Complex 4 []) (ComplexConstant -1.200000 3.000000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerUnaryMinus](IntegerUnaryMinus.md), [RealUnaryMinus](RealUnaryMinus.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerUnaryMinus.md0000664000175000017500000000170715141516316031277 0ustar alastairalastair# IntegerUnaryMinus Uniry minus operator as the second operand of binary arithmetic operators, a `expr` node. ## Declaration ### Syntax ```fortran IntegerUnaryMinus(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg` | expression arguments | |`type`| table entry type | |`value`| expression value| ### Return values The return value is the expression that the IntegerUnaryMinus represents. ## Description **IntegerUnaryMinus** represents integer unary minus operand of binary arithmetic operators, to be used without parantheses. Example : `a = b * -c` ## Types Only accepts integers. ## Examples ```fortran -1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/RealBinOp.md0000664000175000017500000000306115141516316027455 0ustar alastairalastair# RealBinOp Real Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran RealBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the RealBinOp represents. ## Description **RealBinOp** represents real binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts real constants, real exponents, floating point values. ## Examples ```fortran (2.1+3.1)*5.1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealBinOp (RealBinOp (RealConstant 2.100000 (Real 4 []) ) Add (RealConstant 3.100000 (Real 4 []) ) (Real 4 []) (RealConstant 5.200000 (Real 4 []) ) ) Mul (RealConstant 5.100000 (Real 4 []) ) (Real 4 []) (RealConstant 26.520000 (Real 4 []) ) )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [ComplexBinOp](ComplexBinOp.md), [LogicalBinOp](LogicalBinOp.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayTranspose.md0000664000175000017500000000432015141516316030616 0ustar alastairalastair# ArrayTranspose Array or matrix transpose. ## Declaration ### Syntax ```fortran ArrayTranspose(expr matrix, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`matrix` | expression array, single or multi dimensional, square matrix | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArrayTranspose represents. ## Description **ArrayTranspose** represents transpose of square matrix, where row are stored in column values and column values are store in rows. ## Types Only accepts integers. ## Examples ```fortran integer :: a(3, 4), b(4, 3) b = transpose(a) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), b: (Variable 1 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (Var 1 b) (ArrayTranspose (Var 1 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) () ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ComplexConstructor.md0000664000175000017500000001131115141516316031514 0ustar alastairalastair# ComplexConstructor Complex constructor expression. ## Declaration ### Syntax ```fortran ComplexConstructor(expr re, expr im, ttype type, expr? value) ``` ### Arguments | Argument name | Argument Description | | --------------|----------------------| | `re` | real expression | | `im` | imaginary expression | | `ttype` | table entry type | | `value` | expression value | ### Return values The return value is the expression that the ComplexConstructor represents. ## Description **ComplexConstructor** represents constructor of complex type. A complex literal constant is a complex constructor where each expression if a pair of initialisation expressions. ## Types Only accepts complex and real types. The imaginary part can be 0 or can have value. ## Examples ```fortran program complex integer :: i = 42 real :: x = 3.14 complex :: z1, z2 z1 = cmplx(i, x) print *, z1, cmplx(x, kind=8) z2 = cmplx(z2, kind=8) end program complex ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { complex: (Program (SymbolTable 2 { i: (Variable 2 i Local (IntegerConstant 42 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ), x: (Variable 2 x Local (RealConstant 3.140000 (Real 4 []) ) () Save (Real 4 []) Source Public Required .false. ), z1: (Variable 2 z1 Local () () Default (Complex 4 []) Source Public Required .false. ), z2: (Variable 2 z2 Local () () Default (Complex 4 []) Source Public Required .false. ) }) complex [] [(= (Var 2 z1) (ComplexConstructor (Var 2 i) (Var 2 x) (Complex 4 []) () ) () ) (Print () [(Var 2 z1) (ComplexConstructor (Var 2 x) (RealConstant 0.000000 (Real 8 []) ) (Complex 8 []) () )] () () ) (= (Var 2 z2) (Var 2 z2) () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/StringConcat.md0000664000175000017500000000210615141516316030237 0ustar alastairalastair# StringConcat String concatenation, an `expr` node. ## Declaration ### Syntax ```fortran StringConcat(expr left, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left string | |`right` | right string | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the StringConcat represents. ## Description **StringConcat** represents string concatenation. Two strings can be combined one after the other using this node. ## Types Only accepts strings. ## Examples ```fortran "left"//"right" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringConcat (StringConstant "left" (Character 1 4 () []) ) (StringConstant "right" (Character 1 5 () []) ) (Character 1 9 () []) (StringConstant "leftright" (Character 1 9 () []) ) )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerBinOp.md0000664000175000017500000000312415141516316030167 0ustar alastairalastair# IntegerBinOp Integer Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran IntegerBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the IntegerBinOp represents. ## Description **IntegerBinOp** represents integer binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. If an binary expression is applying binary operator on integer operands, `IntegerBinOp` is called which then creates LFortran expression `EXPR` using, `ASR::make_IntegerBinOp_t` method call. The binary operations accept two arguments of the same type. **IntegerBinOp** only accepts integers. ## Types Only accepts integers. ## Examples Following example code creates LFortran expression from ASR's `IntegerBinOp`: ```fortran (2+3)*5 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ) Mul (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant 25 (Integer 4 [])) )] ) ``` ## See Also [RealBinOp](), [ComplexBinOp](), [LogicalBinOp]() lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayItem.md0000664000175000017500000000331315141516316027537 0ustar alastairalastair# ArrayItem Array item, value stored at each index. ## Declaration ### Syntax ```fortran ArrayItem(expr v, array_index* args, ttype type, arraystorage storage_format, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`args` | array indeces | |`type` | table entry type | |`storage_format` | array storage format | |`value` | expression value | ### Return values The return value is the expression that the ArrayItem represents. ## Description **ArrayItem** represents Array Item. ## Types Only accepts array indexes. ## Examples ```fortran integer :: a(2) a(0) = 0 a(1) = 1 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { a: (Variable 1 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false. ) }) [(= (ArrayItem (Var 1 a) [(() (IntegerConstant 0 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 0 (Integer 4 [])) () ) (= (ArrayItem (Var 1 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) () ) (IntegerConstant 1 (Integer 4 [])) () )] ) ``` ## See Also [ArrayConstant](ArrayConstant.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ComplexCompare.md0000664000175000017500000000324215141516316030561 0ustar alastairalastair# ComplexCompare Complex comparison `expr` ASR node. ## Declaration ### Syntax ```fortran ComplexCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the ComplexCompare represents. ## Description **ComplexCompare** represents complex comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts integers, real constants, real exponents, floating point values as real and imaginary part of complex constant. ## Examples ```fortran (2.1, 1.1) /= 2 ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexCompare (ComplexConstructor (RealConstant 2.100000 (Real 4 []) ) (RealConstant 1.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 2.100000 1.100000 (Complex 4 []) ) ) NotEq (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 4 []) () ) (Logical 4 []) () )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md), [RealCompare](RealCompare.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/BitCast.md0000664000175000017500000000255615141516316027203 0ustar alastairalastair# BitCast Cast bits to 1 or 0. ## Declaration ### Syntax ```fortran BitCast(expr source, expr mold, expr? size, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `source`| source expression | |`mold` | mold expression | |`size` | size of expression | |`type` | table entry type | |`value`| expression value | ### Return values The return value is the expression that the BitCast represents. ## Description **BitCast** represents casting bits to 0 or 1. ## Types Only accepts integers. ## Examples ```fortran integer :: x = 21432 print *, transfer(x, 1.0) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { x: (Variable 1 x Local (IntegerConstant 21432 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false. ) }) [(Print () [(BitCast (Var 1 x) (RealConstant 1.000000 (Real 4 []) ) () (Real 4 []) () )] () () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/StringCompare.md0000664000175000017500000000234215141516316030420 0ustar alastairalastair# StringCompare String comparison. ## Declaration ### Syntax ```fortran StringCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of comparison operator | |`right` | right side of comparison operator | |`type` | table entry type | | `value` | expression value| |`op` | operand | ### Return values The return value is the expression that the StringCompare represents. ## Description **StringCompare** represents string comparison expression type. Comparisons are: 1. lexicographically less than, or less than equal to 2. lexicographically greater than, or greater than or equal to 3. Equal to 4. Not equal to ## Types Only accepts strings. ## Examples ```fortran "aaa" > "bbb" ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(StringCompare (StringConstant "aaa" (Character 1 3 () []) ) Gt (StringConstant "bbb" (Character 1 3 () []) ) (Logical 4 []) (LogicalConstant .false. (Logical 4 []) ) )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayPhysicalCast.md0000664000175000017500000002023515141516316031232 0ustar alastairalastair# Array Physical Cast Casts array from one physical type to another. ## Declaration ### Syntax ```ASDL ArrayPhysicalCast(expr arg, array_physical_type old, array_physical_type new, ttype type, expr? value) ``` > array_physical_type = DescriptorArray | PointerArray | UnboundedPointerArray | FixedSizeArray | StringArraySinglePointer | NumPyArray | ISODescriptorArray | SIMDArray | AssumedRankArrays ### Arguments | Argument Name | Argument Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------- | | `arg` | Array expression argument | | `old` | Current physical array type of the array expression `arg`.
**Possible values** : `PointerArray`, `DescriptorArray`, etc | | `new` | The target physical array type to cast to.
**Possible values** : `PointerArray`, `DescriptorArray`, etc | | `type` | Type of expression (It's always an array with physical type equivalent to `new` ArrayPhysicalType) | | `value` | The type of the expression. It is always an array type corresponding to the new ArrayPhysicalType. | ### Return values The return value is an array expression in the _new_ physical type. It's a message to the back end to know which physical type to use on this array expression. ## Description **ArrayPhysicalCast** casts the physical type from one array type to another. It dispatches a message to the backend to cast the physical type of the passed array expression from one type to another, so we can do some runtime array operations like **assignment**, **slicing**, **printing** and **comparing** with no issues. ### Physical Types **PointerArray** : The size is not known at compile time, but we know an expression for it at runtime. This type is used for `bind(c)`; represented by just a pointer, the compiler knows expressions dimensions at compile time. We know the expression for all dimensions. The expression can contain runtime parameters. It is represented by just a pointer. The compiler knows the dimensions at compile time, but they are not stored at runtime explicitly. You can call size(A), the compiler will determine the size expression at compile time (using runtime variables). Any PointerArray can be cast to a DescriptorArray and DescriptorArray can in general be used without any additional code/logic in all places where PointerArray is used. The other direction is more complicated: It is possible to cast a DescriptorArray to a PointerArray, but sometimes a temporary copy is needed unless the DescriptorArray was contiguous. Also in order to obtain expressions for the dimensions, one often requires to create a temporary and then use ArraySize on the temporary as dimension expressions for the PointerArray. ```fortran subroutine f(n, m, A) bind(c) integer, intent(in) :: n, m real, intent(in) :: A(n, m) end subroutine ``` ```fortran subroutine f(n, m, A) integer, intent(in) :: n, m real, intent(in) :: A(n, 2*m) end subroutine ``` Note: this is currently PointerArray, but it could also be FixedSizeArray. ```fortran subroutine f(A) real, intent(in) :: A(10, 20) end subroutine ``` LHS is PointerArray (can also be FixedSizeArray), RHS is FixedSizeArray ```fortran real :: x(3), a, b, c x = [a, b, c] ! LHS is PointerArray/FixedSizeArray, RHS is FixedSizeArray ArrayConstructor ``` **FixedSizeArray**: The size is known at compile time. The array elements are either runtime (expressions) or compile time. Any FixedSizeArray can be cast to PointerArray, and PointerArray can in general be used in all places where FixedSizeArray is used (but not vice versa). The advantage of FixedSizeArray is that the size is known at compile time and it is enforced at the type level, so if both PointerArray adn FixedSizeArray can be used, we generally prefer to use FixedSizeArray. By knowing the size at compile time, the backend has the option to represent the array as a struct of a known number of elements, and even pass this struct by value. The PointerArray on the other hand can naturally only be passed as a pointer, because the size is not known at compile time. We enforce FixedSizeArray over PointerArray in the following cases: * Both ArrayConstant and ArrayConstructor should always be FixedSizeArray. In other cases we currently allow both. Maybe in the future we can restrict things more. Examples of what can be a FixedSizeArray type: ```fortran program main real :: A(10, 20) end program ``` ```fortran subroutine f(A) real, intent(in) :: A(10, 20) end subroutine ``` ```fortran real :: x(3), a, b, c x = [1, 2, 3] ! LHS is FixedSizeArray, RHS is FixedSizeArray (ArrayConstant) x = [a, b, c] ! LHS is FixedSizeArray, RHS is FixedSizeArray (ArrayConstructor) ``` In the above currently only the ArrayConstant/Constructor is enforced, the other cases can also be a PointerArray, and usually it is. **DescriptorArray**: Array is represented by an array descriptor (struct that contains the pointer to data, dimensions, strides, etc.) ```fortran subroutine f(A) real, intent(in) :: A(:,:) end subroutine ``` ```fortran subroutine f() real, pointer :: A(:, :) end subroutine ``` ```fortran real, allocatable :: x(:) real :: a, b, c allocate(x(3)) x = [a, b, c] ! LHS is DescriptorArray, RHS is FixedSizeArray (ArrayConstructor) x = [1, 2, 3] ! LHS is DescriptorArray, RHS is FixedSizeArray (ArrayConstant) ``` **UnboundedPointerArray**: Used for `A(*)`. Represented by just a pointer. The compiler does *not* know the size of the array at compile time, and there is no information about it at runtime. So you cannot call size(A). The `A(*)` usage deprecated, one should use either `A(:)` or `A(n)`. The compiler can check this in Debug mode by passing the expression for the dimension as an argument (the NAG compiler does this, for example). ```fortran subroutine f(n, A) integer, intent(in) :: n real, intent(in) :: A(n, *) ! print *, size(A) ! Not allowed, does not compile end subroutine ``` **CharacterArraySinglePointer** ``` subroutine f(s) character(len=*), intent(in) :: s end subroutine ``` **NumPyArray**: This is using NumPy array descriptor, mostly for LPython, but can be used by any compiler (LFortran can use this in the future for `bind(python)` functions). It is used for easy interoperability with NumPy. An array with this physical type can be accepted from Python and no conversion is needed, the descriptor is used as is. **ISODescriptorArray**: This is Fortran 2018 ISO array descriptor, as described in the standard. Used for C interoperability. It is for being able to pass `DescriptorArray` arrays (`A(:)`) into C. The `DescriptorArray` is LCompilers specific, while `ISODescriptorArray` is standardized, so we must cast one to the other to make it work. ```fortran subroutine f(A) bind(c) real, intent(in) :: A(:,:) end subroutine ``` **SIMDArray**: Used for arrays that are represented by a SIMD vector in the hardware, or maps directly into a vector register. LFortran provides a `simd` attribute (extension), or one can also use a pragma. ```fortran subroutine f() real, simd :: A(64) end subroutine ``` **AssumedRankArrays**: Usedf for writing procedures that can accept arrays of any rank without creating multiple procedure overloads. They can only be used as dummy arguments in procedures and cannot be declared as local variables or function results. The rank of an assumed rank array is not known at compile-time and is determined at runtime from desriptor of the array which is used in the function/subroutine call. Only a limited set of operations are allowed on assumed-rank arrays, such as `rank`, `shape`, `size`, `lbound`, `ubound` where the results of the operation can be completely determined from the array descriptor. Other operations and functions can be performed by using the `select_rank` construct to handle different ranks explicitly. ```fortran subroutine f(x) integer :: a(..) end subroutine ``` Here, the `(..)` represents that the array `a` is an assumed-rank array. lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/LogicalConstant.md0000664000175000017500000000211115141516316030721 0ustar alastairalastair# LogicalConstant Logical literal constant, an `expr` node. ## Declaration ### Syntax ```fortran LogicalConstant(bool value, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `value` | value of boolean | | `type` | tabel entry type | ### Return values The return value is the expression that the LogicalConstant represents. ## Description **LogicalConstant** represents logical constant, is either logical value true or false. The only logical constants are `.TRUE` and `.FALSE`. The period delimiters are necessary. The value must be in the uses 4 bytes of storage. ## Types Only accepts TRUE or FAlSe values. ## Examples ```fortran .TRUE. .FALSE. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(LogicalConstant .true. (Logical 4 []) ) (LogicalConstant .false. (Logical 4 []) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [ComplexConstant](ComplexConstant.md), [RealConstant](RealConstant.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/FunctionCall.md0000664000175000017500000001002415141516316030220 0ustar alastairalastair# FunctionCall Function Call expression type. ## Declaration ### Syntax ```fortran FunctionCall(symbol name, symbol? original_name, call_arg* args, ttype type, expr? value, expr? dt) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `name` | symbol name | | `original_name`| original name of the symbol | | `args` | arguments of the called function | | `type` | table entry type | | `value` | expression value | | `dt` | ? | ### Return values The return value is the expression that the `FunctionCall` represents. ## Description **FunctionCall** represents function call expression. ## Types Not applicable. ## Examples ```fortran program intrinsics integer, dimension(-1:1, -1:2) :: a print *, shape(a) ! (/ 3, 4 /) print *, size(shape(42)) ! (/ /) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { intrinsics: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 3 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), shape: (ExternalSymbol 2 shape 4 shape lfortran_intrinsic_builtin [] shape Private ) }) intrinsics [] [(Print () [(FunctionCall 2 shape () [((Var 2 a))] (Integer 4 []) () () )] () () ) (Print () [(ArraySize (FunctionCall 2 shape () [((IntegerConstant 42 (Integer 4 [])))] (Integer 4 []) () () ) () (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) )] () () )] ), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ichar.md0000664000175000017500000000234115141516316026730 0ustar alastairalastair# Ichar Integer code for character. ## Declaration ### Syntax ```fortran Ichar(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg`| expression argument | |`type` | table entry type| |`value`| value of expression | ### Return values The return value is the expression that the Ichar represents. ## Description **Ichar** represents integer code for character. ## Types Only accepts characters. ## Examples ```fortran integer :: i i = ichar(' ') ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false. ) }) [(= (Var 1 i) (Ichar (StringConstant " " (Character 1 1 () []) ) (Integer 4 []) (IntegerConstant 32 (Integer 4 [])) ) () )] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ArrayRank.md0000664000175000017500000000304215141516316027533 0ustar alastairalastair# ArrayRank Rank of array. ## Declaration ### Syntax ```fortran ArrayRank(expr v, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`v` | expression | |`type` | table entry type | |`value` | expression value | ### Return values The return value is the expression that the ArrayRank represents. ## Description **ArrayRank** represents the rank (number of dimensions) of an array expression. - At *compile-time*, the rank is determined from the declared shape of the array. It can be used for all arrays except assumed-rank arrays where the rank is determined at runtime. It is stored in the `value` argument of the ASR Node. - At *runtime*, the rank is determined for assumed-rank arrays (`dimension(..)`) where the rank is not known at compile-time. It is determined at runtime using the descriptor of the array. ## Usage ## Compile-Time Usage ```fortran integer :: a(3) integer :: r r = rank(a) ``` ASR Node for the above example: ```clojure (ArrayRank (Var 2 a) (Integer 4) (IntegerConstant 1 (Integer 4) Decimal) ) ``` Here the `value` argument of the ASR Node is `1` because the rank of array `a` is known at compile-time and it is `1`. ## Runtime Usage ```fortran integer :: a(..) integer :: r r = rank(a) ``` ASR Node for the above example: ```clojure (ArrayRank (Var 2 a) (Integer 4) () ) ``` Here the `value` argument of the ASR Node is empty because the rank of array `a` is not known at compile-time and it will be determined at runtime. lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/Var.md0000664000175000017500000000767115141516316026405 0ustar alastairalastair# Var **Var** is an expression node that represents a reference to a declared variable, function, enum, etc. ## Declaration ### Syntax ```fortran Var(symbol v) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `v` | symbol name | ### Return values The return value is the expression that the Var represents. ## Description `Var` represents a declaration when used within an expression. Every declaration is represented in the symbol table, for example: * `integer :: x`: here `x` is represented by `Variable`, which has `type` as an "Integer" type, `type_declaration` is empty * `procedure(fn) :: x`: here `x` is represented by `Variable`, which has `type` as a "FunctionType" type, and `type_declaration` as a "Function" symbol representing the interface declaration "fn" * `function my_fn(...) ... end function`: represented by `Function` When these are to be used in an expression, one uses `Var` which points to one of these. For example, if we have a declaration `integer :: x`, then the assignment `x = 5` is represented as `(Assignment (Var 2 x) (IntegerConstant 5 (Integer 4 [])) ())`. Here `Var` points to the `Variable` symbol in the symbol table. See below for a full example. Another example: if `procedure(fn), pointer :: f`, then `f => myf` is represented by `(Associate (Var 2 f) (Var 2 myf))`, where `myf` is a `Function`. Most often `Var` points to a `Variable`. For referencing functions it points to `Function`. For enums it points to `Enum`. These can be hidden behind `ExternalSymbol`. It cannot point to any other symbol. ## Types `Var`'s argument `v` can point to the following symbols (and nothing else): * `Variable` (for expressions like `2*x+5` where `x` is a variable) * `Function` (for expressions like `myf`, where `myf` is a user defined function, such as passing it as a callback argument to a function call `call f(myf)`, or assigning to a pointer procedure variable `f => myf`) * `Enum` * `ExternalSymbol` (the above symbols can be behind an `ExternalSymbol` if they are declared in another module) ## Examples ```fortran program test_var integer :: x x = 5 print *, 3*x+5 end program ``` ASR: ``` (TranslationUnit (SymbolTable 1 { test_var: (Program (SymbolTable 2 { x: (Variable 2 x [] Local () () Default (Integer 4 []) Source Public Required .false. ) }) test_var [] [(= (Var 2 x) (IntegerConstant 5 (Integer 4 [])) () ) (Print () [(IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 x) (Integer 4 []) () ) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) () )] () () )] ) }) [] ) ``` ## See Also [Variable](../symbol_nodes/Variable.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/ComplexConstant.md0000664000175000017500000000306015141516316030762 0ustar alastairalastair# ComplexConstant Complex literal constant, an `expr` node. ## Declaration ### Syntax ```fortran ComplexConstant(floar re, float im, ttype type) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `re` | value of real part | | `im` | value of imaginary part | | `type` | tabel entry type | ### Return values The return value is the expression that the ComplexConstant represents. ## Description **ComplexConstant** represents complex constant which consists of a optional imaginary part. Both real and imaginary part can have integer or floating point values, followed by a string of decimal digits, before or after decimal point. If no sign is present, the constant is assumed to be non negative. The value must be in the `Complex*8` range, uses 8 bytes of storage. The constants are separated by a comma, and the pair is enclosed in parentheses. The first constant is the real part, and the second is the imaginary part. ## Types Only accepts complex contants. ## Examples ```fortran (1.0, 2.1) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(ComplexConstructor (RealConstant 1.000000 (Real 4 []) ) (RealConstant 2.100000 (Real 4 []) ) (Complex 4 []) (ComplexConstant 1.000000 2.100000 (Complex 4 []) ) )] ) ``` ## See Also [IntegerConstant](IntegerConstant.md), [RealConstant](RealConstant.md). lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/LogicalBinOp.md0000664000175000017500000000412015141516316030141 0ustar alastairalastair# LogicalBinOp Logical Binary Operation expression type. An **expr** node. ## Declaration ### Syntax ```fortran LogicalBinOp(expr left, binop op, expr right, ttype type, expr? value) ``` ### Arguments `left` and `right` represent expression on the left and right side of operator `op`. `type` represents table entry type and `value` represents expression. ### Return values The return value is the expression that the LogicalBinOp represents. ## Description **LogicalBinOp** represents logical binary operation expression type. It is an ASR expr node. ASR has multiple binary expression types, for example: for Integer, real, complex, and logical. The binary operations accept two arguments of the same type. ## Types Only accepts `.TRUE.` and `.FALSE.` ## Examples ```fortran bgt(10, 4) .neqv. .true. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { bgt: (ExternalSymbol 1 bgt 3 bgt lfortran_intrinsic_bit [] bgt Private ), bgt@bgt32: (ExternalSymbol 1 bgt@bgt32 3 bgt32 lfortran_intrinsic_bit [] bgt32 Private ), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit) }) [(LogicalBinOp (FunctionCall 1 bgt@bgt32 1 bgt [((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Logical 4 []) () () ) NEqv (LogicalConstant .true. (Logical 4 []) ) (Logical 4 []) () )] ) ``` ## See Also [IntegerBinOp](IntegerBinOp.md), [ComplexBinOp](ComplexBinOp.md), [RealBinOp](RealBinOp.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/RealCompare.md0000664000175000017500000000263615141516316030043 0ustar alastairalastair# RealCompare Real comparison `expr` ASR node. ## Declaration ### Syntax ```fortran RealCompare(expr left, cmpop op, expr right, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`left` | left side of the comparison operand | |`right` | right side of the comparison operand | |`op` | comparison operator | |`type` | table entry type | |`value`| expression value| ### Return values The return value is the expression that the RealCompare represents. ## Description **RealCompare** represents real floating point comparison operation. Comparison operation can be: 1. Less than 2. Greater than 3. Less than or equal to 4. Greater than or equal to 5. Equal to ## Types Only accepts real constants, real exponents, floating point values. ## Examples ```fortran 2.1 > 1. ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { }) [(RealCompare (RealConstant 2.100000 (Real 4 []) ) Gt (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) (Logical 4 []) (LogicalConstant .true. (Logical 4 []) ) )] ) ``` ## See Also [IntegerCompare](IntegerCompare.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/IntegerBitNot.md0000664000175000017500000000253215141516316030361 0ustar alastairalastair# IntegerBitNot Not conversion of integer bits, a `expr` node. ## Declaration ### Syntax ```fortran IntegerBitNot(expr arg, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| |`arg`| expression arguments | |`type`| table entry type | |`value`|expression value | ### Return values The return value is the expression that the IntegerBitNot represents. ## Description **IntegerBitNot** represents integer binary not operation. It is used when flipping bits of integer from `1` to `0` or `0` to `1`. ## Types Only accepts integers. ## Examples ```fortran not(1) ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), not: (ExternalSymbol 1 not 3 not lfortran_intrinsic_bit [] not Private ) }) [(IntegerBitNot (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 [])) )] ) ``` ## See Also [LogicalNot](logicalnot.md) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/DerivedTypeConstructor.md0000664000175000017500000000071015141516316032332 0ustar alastairalastair# DerivedTypeConstructor ## Declaration ### Syntax ```fortran ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | | | ### Return values The return value is the expression that the DerivedTypeConstructor represents. ## Description **DerivedTypeConstructor** represents Derived Type Constructor expression. ## Types ## Examples ```fortran ``` ASR: ```fortran ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/expression_nodes/implieddoloop.md0000664000175000017500000001057115141516316030506 0ustar alastairalastair# ImpliedDoLoop Implied Do Loop expression. ## Declaration ### Syntax ```fortran ImpliedDoLoop(expr* values, expr var, expr start, expr end, expr? increment, ttype type, expr? value) ``` ### Arguments | Argument Name | Argument Description | |---------------|----------------------| | `values` | expression value | | `var` | expression variables | | `start` | expression start | | `end` | expression end | | `increment | expression increment | | `type` | table entry type | | `value` | expression value | ### Return values The return value is the expression that the Implied Do Loop represents. ## Description **ImpliedDoLoop** represents implied do loop expression. The simples and most efficient way to read or write all elements of an array is to put its name, unsubscripted, in the data-transfer list. An `ImpliedDoLoop` allows the elements to be transferred selectively or in some non-standard order. The rules for an implied-DO are similar to that of an ordinary DO-loop but the loop forms a single item in the data-transfer list. ## Types Not applicable. ## Examples ```fortran program implied_do_loop integer :: j integer :: a(10)=(/(j,j=1,10)/) print*, (a(j),j=1,10) end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { intrinsics: (Program (SymbolTable 2 { a: (Variable 2 a Local () () Default (Integer 4 [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 3 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])) ) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false. ), shape: (ExternalSymbol 2 shape 4 shape lfortran_intrinsic_builtin [] shape Private ) }) intrinsics [] [(Print () [(FunctionCall 2 shape () [((Var 2 a))] (Integer 4 []) () () )] () () ) (Print () [(ArraySize (FunctionCall 2 shape () [((IntegerConstant 42 (Integer 4 [])))] (Integer 4 []) () () ) () (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) )] () () )] ), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/helper_nodes/0000775000175000017500000000000015141516316024400 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/helper_nodes/alloc_arg.md0000664000175000017500000000343115141516316026646 0ustar alastairalastair# alloc_arg An **allocation argument** used inside the `Allocate` and `ReAlloc` statement. ## Declaration ### Syntax ```fortran alloc_arg(expr a, dimension* dims, expr? len_expr, symbol? sym_subclass, ttype? type) ``` ### Arguments Input arguments of `a`, `dims`, optional `len_expr`, optional `sym_subclass`, and optional `type`. `a` contains the variable to be allocated. `dims` contains a list of dimension bounds in the form of tuples `(lower, upper)` representing shape. `len_expr` is an optional expression specifying length, used for character and derived types. `sym_subclass` is an optional symbol representing subclass type for polymorphic allocation. `type` is an optional type that specifies the target type of allocation. ### Return values None. ## Description **alloc_arg** specifies one element in the `Allocate` statement. It defines what variable to allocate, with what dimensions, type, subclass, and optional length parameters. It is used only as part of the `Allocate` and `ReAlloc` node. ## Types The variable `a` must be allocatable. Dimensions must be valid integer expressions. Optional fields may be used for polymorphic or character allocations. ## Examples Following example code allocates a memory block of size 3: ```fortran program allocate_mem real, allocatable :: a(:) allocate(a(3)) end program ``` ASR (portion corresponding to `alloc_arg`): ``` ((Var 2 a) [((IntegerConstant 1 (Integer 4) Decimal) (IntegerConstant 3 (Integer 4) Decimal))] () () ()) ``` ```fortran type :: base integer :: x end type type, extends(base) :: derived real :: y end type class(base), allocatable :: obj allocate(derived :: obj) ``` ``` ((Var 2 obj) [] () 2 derived (StructType [] [] .true. 2 derived )) ``` ## See Also [Allocate](#allocate) lfortran-lfortran-2f73434/doc/src/asr/asr_nodes/kinds_nodes/0000775000175000017500000000000015141516316024231 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/asr/asr_nodes/kinds_nodes/kinds.md0000664000175000017500000001423015141516316025663 0ustar alastairalastair# kinds The `kind` member selects the kind of a given type. ## Declaration ### Syntax ```fortran Integer Real Complex Character Logical kind ``` ### Arguments None. ### Return values None. ## Description **kind** denotes the kind of a given type. LFortran supports the following: 1. Integer kinds: 1 (i8), 2 (i16), 4 (i32), 8 (i64) 2. Real kinds: 4 (f32), 8 (f64) 3. Complex kinds: 4 (c32), 8 (c64) 4. Character kinds: 1 (utf8 string) 5. Logical kinds: 1, 2, 4: (boolean represented by 1, 2, 4 bytes; the default kind is 4, just like the default integer kind, consistent with Python and Fortran: in Python "Booleans in Python are implemented as a subclass of integers", in Fortran the "default logical kind has the same storage size as the default integer"; we currently use kind=4 as default integer, so we also use kind=4 for the default logical.) ## Types LFortan supports the following types: 1. Integer kinds 2. Real kinds 3. Complex kinds 4. Character kinds 5. Logical kinds ## Examples ```fortran program const_kind_01 integer, parameter :: sp = 4, dp = 8 real(sp), parameter :: r1 = 1.0_sp real(dp), parameter :: r2 = 1.0_dp real :: r3 r3 = 1.0_sp r3 = 1.0_dp print *, sp, dp, r1, r2, r3 end program ``` ASR: ```fortran (TranslationUnit (SymbolTable 1 { const_kind_01: (Program (SymbolTable 2 { dp: (Variable 2 dp Local (IntegerConstant 8 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false. ), r1: (Variable 2 r1 Local (RealConstant 1.000000 (Real 4 []) ) (RealConstant 1.000000 (Real 4 []) ) Parameter (Real 4 []) Source Public Required .false. ), r2: (Variable 2 r2 Local (RealConstant 1.000000 (Real 8 []) ) (RealConstant 1.000000 (Real 8 []) ) Parameter (Real 8 []) Source Public Required .false. ), r3: (Variable 2 r3 Local () () Default (Real 4 []) Source Public Required .false. ), sp: (Variable 2 sp Local (IntegerConstant 4 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false. ) }) const_kind_01 [] [(= (Var 2 r3) (RealConstant 1.000000 (Real 4 []) ) () ) (= (Var 2 r3) (Cast (RealConstant 1.000000 (Real 8 []) ) RealToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []) ) ) () ) (Print () [(Var 2 sp) (Var 2 dp) (Var 2 r1) (Var 2 r2) (Var 2 r3)] () () )] ) }) [] ) ``` ## See Also lfortran-lfortran-2f73434/doc/src/asr/programming_generics.md0000664000175000017500000002350315141516316024502 0ustar alastairalastair# Programming with Generics in LFortran In this page we will explore how to write generics in LFortran. ## Prerequisite Variables inside of a generic function are typed with a *deferred types*. For example, we may want to define a function that calculate the sum of a generic array which can take any number type. Using a deferred type `T`, we may want to declare the following generic function: ```fortran function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r r = set_to_zero() do i = 1, n ! uses a function instead of + because T ! can be any type, even a derived type r = add_element(arr(i), r) end do end function ``` As we can see here, we need to define the functions associated with the deferred type `T`. To do so in LFortran, we use *requirements* to define both deferred types and their associated functions. ```fortran requirement number_type(T, add_element, set_to_zero) type, deferred :: T function add_element(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function set_to_zero() result(z) type(T) :: z end function end requirement ``` ## Defining and Using a Generic Function Having defined the necessary requirement to use the deferred type `T`, we can proceed to define our generic array sum. LFortran provides two different ways to write and instantiate generic functions: 1. With a template 2. Without a template (simpler syntax) ### With Template **Defining a generic function** A template works as a closure for a generic function. A template takes as parameters symbols that would replace the generic symbols inside a generic function. ```fortran template array_t(T, add_element, set_to_zero) ... public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` Then to connect the parameters with the functions defined in the requirement, we use a `require` statement. ```fortran template array_t(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` `require :: number_type(T, add_element, set_to_zero)` sets the type signature for the parameters within the scope of the template. This makes it possible for the LFortran compiler to type check the computations associated with the deferred type `T`. A template can also contains multiple functions that may depend on each other. ```fortran template array_t(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: array_sum contains function array_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function function array_avg(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: s s = array_sum(arr) ... end function end template ``` **Using a generic function** To use a generic function we first need to instantiate (replace) the generic symbols inside a template with symbols with concrete types. The instantiation is done through the `instantiate` statement. For example, if we want to instantiate 'array_sum' with integer types, the instantiation would be as follows: ```fortran instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum ``` First we pass the concrete symbols to the template in the form of a template call `array_t(integer, add_element_integer, set_to_zero_integer)`. We are replacing the deferred type `T` with a concrete type `integer`, `add_element` with a function that computes addition between two integers `add_element_integer`, and `set_to_zero` with a function that returns a zero integer value `set_to_zero_integer`. These functions would have to be defined prior to the instantiation for them to be passed as symbol arguments to a template: ```fortran function add_element_integer(x, y) result(z) integer, intent(in) :: x, y integer :: z z = x + y end function function set_to_zero_integer() result(z) integer :: z z = 0 end function ``` After `only: ` we decide which function inside in the template we want to instantiate, in this case `array_sum`, and give the new instantiated function a new name `array_sum_integer`. After instantiation, we can then use the instantiated function similar to ordinary functions: ```fortran integer :: arr(10), sum sum = array_sum_integer(arr) ``` The main benefit of generics is reuse. We can have different instantiations for different types using the same template. For example we can instantiate both integer and real `array_sum`: ```fortran ! instantiation with integer type instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum ! instantiation with real type instantiate array_t(real, add_element_real, set_to_zero_real), & only: array_sum_real => array_sum ``` Also, because a template may contain multiple generic functions, a single instantiation can be used to instantiate multiple functions: ```fortran instantiate array_t(integer, add_element_integer, set_to_zero_integer), & only: array_sum_integer => array_sum, array_avg_integer => array_avg instantiate array_t(real, add_element_real, set_to_zero_real), & only: array_sum_real => array_sum, array_avg_real => array_avg ``` ### Without Template The template notation can be cumbersome for defining a single generic function. To alleviate this, LFortran also supports a simpler syntax for declaring generic functions without having to declare an enclosing template. For example, our running `array_sum` example can be written as follows in the simpler syntax: ```fortran function generic_sum {T, add_element, set_to_zero} (arr) result(r) require :: number_type(T, add_element, set_to_zero) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function ``` The first difference is that the template parameters are now included as the function's generic symbol parameters enclosed by braces `{T, add_element, set_to_zero}`. Since we still need to identify these generic symbols a requirement, the require statement is moved into the generic function itself. The rest of the function is the same as the generic function inside the template. This is merely a syntax sugar for the original templated function. Inside the compiler this generic function is treated as the following template: ```fortran template generic_sum(T, add_element, set_to_zero) require :: number_type(T, add_element, set_to_zero) public :: generic_sum contains function generic_sum(arr) result(r) type(T), intent(in) :: arr(:) type(T) :: r integer :: n, i n = size(arr) r = set_to_zero(0) if (n > 0) then r = arr(1) do i = 2, n res = add_element(r, arr(i)) end do end if end function end template ``` The instantiation is also made simpler by having the instantiation and function call together: ```fortran integer :: arr(10), sum sum = array_sum{integer, add_element_integer, set_to_zero_integer}(arr) ``` ### Further Simplifying Instantiations **Passing operator instead of functions** So far to replace the generic addition `add_element` we have used a concrete function `add_element_integer`. To simplify this, it is possible to just pass `operator(+)` without having to define a function separately: ```fortran instantiate array_t(integer, operator(+), set_to_zero_integer), & only: array_sum_integer => array_sum ``` **Skipping function instantiation names** Generic functions can also be instantiated without having to rename each function one-by-one. Suppose we want to instantiate every generic functions inside the template `array_t`, we can shorten the instantiation into: ```fortran instantiate array_t(integer, operator(+), set_to_zero_integer) ``` Doing so would generate the function `array_sum` and `array_avg` without any renaming. ## Generic Derived Types LFortran also supports generic derived types. Let's say we want a generic tuple. We can define a derived type for tuples as usual inside a template: ```fortran template derived_type_t(T) ! for brevity we have the deferred type ! declared directly inside the template type, deferred :: T public :: tuple type :: tuple type(T) :: fst type(T) :: snd end type end template ``` We can also define generic functions accessing this generic tuple as: ```fortran template derived_type_t(T) type, deferred :: T public :: tuple type :: tuple type(T) :: fst type(T) :: snd end type contains function get_fst(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%fst end function function get_snd(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%snd end function end template ``` The instantiation for derived types are also similar to generic functions. If we want an integer tuple type and its functions, then we can instantiate `derived_type_t` as: ```fortran instantiate derived_type_t(integer), only: & tuple_int => tuple, get_fst_int => get_fst, get_snd_int => get_snd ``` ## See Also * [Generics](generics.md), for details about the generics implementation and its related ASR.lfortran-lfortran-2f73434/doc/src/installation.md0000664000175000017500000002676215141516316022227 0ustar alastairalastair# Installation All the instructions below work on Linux, macOS and Windows. ## Binaries The recommended way to install LFortran is using Conda. Install Conda for example by installing the [Miniconda](https://conda.io/en/latest/miniconda.html) installation by following instructions there for your platform. Then create a new environment (you can choose any name, here we chose `lf`) and activate it: ```bash conda create -n lf conda activate lf ``` Then install LFortran by: ```bash conda install lfortran -c conda-forge ``` Now the `lf` environment has the `lfortran` compiler available, you can start the interactive prompt by executing `lfortran`, or see the command line options using `lfortran -h`. The Jupyter kernel is automatically installed by the above command, so after installing Jupyter itself: ```bash conda install jupyter -c conda-forge ``` You can create a Fortran based Jupyter notebook by executing: ```bash jupyter notebook ``` and selecting `New->Fortran`. ## Build From a Source Tarball This method is the recommended method if you just want to install LFortran, either yourself or in a package manager (Spack, Conda, Debian, etc.). The source tarball has all the generated files included and has minimal dependencies. The source tarball of LFortran depends on: * Python * cmake * LLVM 10-19 * zstd-static * zlib First we have to install dependencies, for example using Conda: ```bash conda create -n lf python cmake llvmdev zstd-static zlib conda activate lf ``` On a Linux system, we additionally need to install `libunwind`: ```bash conda install libunwind ``` Then download a tarball from [https://lfortran.org/download/](https://lfortran.org/download/), e.g.: ```bash wget https://github.com/lfortran/lfortran/releases/download/v0.42.0/lfortran-0.42.0.tar.gz tar xzf lfortran-0.42.0.tar.gz cd lfortran-0.42.0 ``` And build: ```bash cmake -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=`pwd`/inst . make -j8 make install ``` This will install `lfortran` into `inst/bin`. It assumes that c++ and cc are available, which on Linux are typically the GNU C++/C compilers. ## Build From Git We assume you have C++ compilers installed, as well as `git` and `wget`. In Ubuntu, you can also install `binutils-dev` for stacktraces. If you do not have Conda installed, you can do so on Linux (and similarly on other platforms): ```bash wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p $HOME/conda_root export PATH="$HOME/conda_root/bin:$PATH" ``` Clone the LFortran git repository: ``` git clone https://github.com/lfortran/lfortran.git cd lfortran ``` Then prepare the environment: ```bash conda env create -f environment_linux.yml conda activate lf ``` Generate files that are needed for the build (this step depends on `re2c`, `bison` and `python`): ```bash ./build0.sh ``` Now you can use our script `./build1.sh` to build in Debug mode: ```bash ./build1.sh ``` and can use `ninja` to rebuild. To do a clean rebuild, you can use: ```bash # NOTE: the below git command deletes all untracked files git clean -dfx # reset repository to a clean state by removing artifacts generated during the build process ./build0.sh ./build1.sh ``` Run an interactive prompt: ```bash ./src/bin/lfortran ``` See [how to run tests](#Tests) to make sure all tests pass ## Build from Git on Windows with Visual Studio Install Visual Studio (MSVC), for example the version 2022, you can download the Community version for free from: https://visualstudio.microsoft.com/downloads/. Install miniforge using the Windows installer from https://github.com/conda-forge/miniforge. Launch the Miniforge Prompt from the Desktop. In the shell, initialize the MSVC compiler using: ``` call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd" -arch=x64 ``` You can optionally test that MSVC works by: ``` cl /? link /? ``` Both commands must print help (several pages). Now you can download and build LFortran: ``` git clone https://github.com/lfortran/lfortran.git cd lfortran conda env create -f environment_win.yml conda activate lf build0.bat build1.bat ``` If everything compiled, then you can use LFortran as follows: ``` inst\bin\lfortran examples/expr2.f90 expr2.exe inst\bin\lfortran ``` And so on. Note: LFortran currently uses the MSVC's linker program (`link`), which is only available when the MSVC bat script above is ran. If you forget to activate it, LFortran's linking will fail. Note: the miniforge shell seems to be running some version of `git-bash` (although it is `cmd.exe`), which has some unix-like filesystem mounted in `/usr` and several commands available such as `ls`, `which`, `git`, `vim`. For this reason the Conda build `environment_win.yml` contains everything needed, including `git`. ## Build from Git on Windows with WSL * In windows search "turn windows features on or off". * Tick Windows subsystem for Linux. * Press OK and restart computer. * Go to Microsoft store and download Ubuntu (20.04 or 22.04 or 24.04), and launch it. * Now setup LFortran by running the following commands. ```bash wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p $HOME/conda_root echo "export PATH=$HOME/conda_root/bin:$PATH" >> ~/.bashrc ``` * After that restart the Ubuntu terminal. * Now clone the LFortran git repository (you should clone it inside a linux owned directory like `~` or any of its sub-directories). ```bash cd ~ git clone https://github.com/lfortran/lfortran.git cd lfortran ``` * Run the following ```bash conda env create -f environment_linux.yml conda init bash ``` * Restart Ubuntu terminal again ```bash conda activate lf sudo apt update sudo apt-get install build-essential sudo apt-get install zlib1g-dev libzstd-dev sudo apt install clang ``` * Run the following commands ```bash conda activate lf ./build0.sh cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=`pwd`/inst . make -j8 ``` * If everything compiles, you can use LFortran as follows ```bash ./src/bin/lfortran ./examples/expr2.f90 ./expr2.out ``` * Run an interactive prompt ```bash ./src/bin/lfortran ``` See [how to run tests](#Tests) to make sure all tests pass ## Enabling the Jupyter Kernel To install the Jupyter kernel, install the following Conda packages also: ``` conda install xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json ``` and enable the kernel by `-DWITH_XEUS=yes` and install into `$CONDA_PREFIX`. For example: ``` cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_XEUS=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ . cmake --build . -j4 --target install ``` To use it, install Jupyter (`conda install jupyter`) and test that the LFortran kernel was found: ``` jupyter kernelspec list --json ``` Then launch a Jupyter notebook as follows: ``` jupyter notebook ``` Click `New->Fortran`. To launch a terminal jupyter LFortran console: ``` jupyter console --kernel=fortran ``` ## Build From Git with Nix There's a provided Nix shell for making a consistent build environment with the exact same dependency versions across users. ### Using the Environment Enter the development environment: ```bash nix develop ./ci/nix ``` To change the compilation environment from `gcc` (default) to `clang`: ```bash nix develop ./ci/nix#clangOnly ``` Depending on your system configuration, you might have to run `nix develop` with the following extra nix features explicitly enabled: ```bash nix --extra-experimental-features "flakes nix-command" develop ./ci/nix ``` ### Building the Code The build steps are the same as when building from git: ```bash ./build0.sh ./build1.sh ``` As of 2025-11-10, the environment passes the CI tests, provided you tell it where to install the Jupyter kernel: ```bash LFORTRAN_CMAKE_GENERATOR=Ninja CONDA_PREFIX=$(pwd) JUPYTER_PATH=$(pwd)/share/jupyter bash ci/build.sh ``` (take note that the Nix shell does not use conda) Give the same `JUPYTER_PATH` when running `jupyter notebook` / `jupyter lab` to use the same jupyter kernel. ## Note About Dependencies End users (and distributions) are encouraged to use the tarball from [https://lfortran.org/download/](https://lfortran.org/download/), which only depends on LLVM, CMake and a C++ compiler. The tarball is generated automatically by our CI (continuous integration) and contains some autogenerated files: the parser, the AST and ASR nodes, which is generated by an ASDL translator (requires Python). The instructions from git are to be used when developing LFortran itself. ## Note for users who do not use Conda Following are the dependencies necessary for installing this repository in development mode, - [Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz) - [LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz) - [re2c - 2.0.3](https://re2c.org/install/install.html) - [binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2.31.90.tar.xz) - Make sure that you should enable the required options related to this dependency to build the dynamic libraries (the ones ending with `.so`). ## Stacktraces LFortran can print stacktraces when there is an unhandled exception, as well as on any compiler error with the `--show-stacktrace` option. This is very helpful for developing the compiler itself to see where in LFortran the problem is. The stacktrace support is turned off by default, to enable it, compile LFortran with the `-DWITH_STACKTRACE=yes` cmake option after installing the prerequisites on each platform per the instructions below. ### LLVM In all platforms having LLVM, stacktraces can be shown with LLVM, so no additional prerequisites are required. If LLVM is not available, you can use the following instructions, depending on your platform. ### Ubuntu In Ubuntu, `apt install binutils-dev`. ### macOS If you use the default Clang compiler on macOS, then the stacktraces should just work on both Intel and M1 based macOS (the CMake build system automatically invokes the `dsymtuil` tool and our Python scripts to store the debug information, see `src/bin/CMakeLists.txt` for more details). If it does not work, please report a bug. If you do not like the default way, an alternative is to use bintutils. For that, first install [Spack](https://spack.io/), then: ```bash spack install binutils spack find -p binutils ``` The last command will show a full path to the installed `binutils` package. Add this path to your shell config file, e.g.: ```bash export CMAKE_PREFIX_PATH_LFORTRAN=/Users/ondrej/repos/spack/opt/spack/darwin-catalina-broadwell/apple-clang-11.0.0/binutils-2.36.1-wy6osfm6bp2323g3jpv2sjuttthwx3gd ``` and compile LFortran with the `-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX"` cmake option. The `$CONDA_PREFIX` is there if you install some other dependencies (such as `llvm`) using Conda, otherwise you can remove it. ## Tests #### Run tests: ```bash ctest ./run_tests.py ``` #### Update test references: ```bash ./run_tests.py -u ``` #### Run integration tests ```bash cd integration_tests ./run_tests.py ``` #### Speed up integration tests on macOS Integration tests run slowly because Apple checks the hash of each executable online before running. You can turn off that feature in the Privacy tab of the Security and Privacy item of System Preferences > Developer Tools > Terminal.app > "allow the apps below to run software locally that does not meet the system's security policy." lfortran-lfortran-2f73434/doc/src/string_allocation.md0000664000175000017500000000543115141516316023227 0ustar alastairalastair# String Allocation In LFortran ### Note : This taking in consideration the LLVM backend only. *** ### General Rules : - Allocation with length=`0` (`allocate(character(0) :: str)`) is fine, and string is considered **allocated** even when the length=`0`. - We make sure to follow this statement when allocating strings -> `MAX(alloc_len, 1)`; That makes sure that the preceding point is valid and working properly. - Allocation with length<`0` (`allocate(character(-1) :: str)`) isn't tolerated in LFortran, It raises error on both compile-time and run-time. - Copying from unallocated string (`str1 = str2`) isn't tolerated and raises run-time error. We don't know how to determine the **allocation** state of the LHS so we don't tolerate that case; In addition, Fortran standards don't allow referencing non-allocated variables. ## Explicit Allocation **Example** : ```fortran allocate(character(10) :: STR) ! 1 allocate(character(0) :: STR) ! 2 allocate(character(-10) :: STR) ! 3 allocate(character(N) :: STR) ! 4 ``` 1 - Allocates `str` with compile-time value `10`, hence we evaluate `len = max(10, 1)` then we end up inserting this call `malloc(10)`. 2 - Allocates `str` with compile-time value `0`, hence we evaluate `len = max(0, 1)` at compile-time, we end up inserting this call at runtime `malloc(1)`. 3 - Allocates `str` with compile-time value `-10`, hence we raise an error at compile-time. 4 - Allocates `str` with run-time value `N`, hence we insert call `lfortran_string_malloc(N)` ## Runtime Function `lfortran_string_malloc()` #### It makes sure to do the same things we do when the length is compile-time value. - Raises runtime error when `length < 0`. - Makes sure to set length at minimum of length `1` --> `malloc(MAX(length, 1))`, To handle case of `allocate(character(0) :: str)` properly. ## Copying #### Copying from string into another requires automatic allocation or reallocation (reallocation is on by default). **Example** (realloc): ```fortran character(:), allocatable :: STR character(:), allocatable :: STR_2 STR = "HelloWorld" ! 1 STR = "BYE" ! 2 STR = STR_2 ! 3 ``` 1 - Allocates memory equal to `rhs_len` --> `malloc(MAX(1, rhs_len))` 2 - Calls `realloc` at runtime with length of minimum 1 --> `realloc(lhs_data_ptr, MAX(rhs_len, 1))` 3 - Raises error as it copies from unallocated string. **Example** (malloc): ```fortran character(10), allocatable :: STR character(:) , allocatable :: STR_2 STR = "HelloWorld" ! 1 STR = "BYE" ! 2 STR = STR_2 ! 3 ``` 1 - Calls `malloc` at runtime with length of minimum 1 --> `malloc(MAX(lhs_len, 1))`. 2 - Copies from RHS into LHS + pads LHS. No need for `malloc()` or `realloc` calls as the LHS is already allocated and its length is fixed. 3 - Raises error as it copies from unallocated string. lfortran-lfortran-2f73434/doc/src/llvm_utils.md0000664000175000017500000000560115141516316021705 0ustar alastairalastair# LLVMFinalize Class ## Brief - Finalizes symbol-table's variables. - It's used right after inserting return or end block of an ASR construct (program, function, block, etc.) ## How To Use ? - Create an instance by using the exposed constructor. - Call the only exposed member function `finalize_symtab()` with the desired symbol table to finalize. - Use it after declaring the return block OR the end block of the construct you're freeing the symbol table of. - Notice it doesn't work with module's symbol table. ## Design Flow Global variables aren't finalized; They live till program ends anyway so we don't care much about them. The Class has a main finalizer function `finalize()` that either dispatches to `finalize_allocatable()` or `finalize_type()` #### Main Finalizers - `finalize_allocatable()` : It finalizes the type first by calling `finalize_type()` that consequently dispatches to the actual finalizer function based on the type of couse. Next, It frees the allocated memory (due to the nature of the `allocatable` attribute for sure). **Example**: `type(t), allocatable :: n` - Calls `finalize()` -> `finalize_allocatable()` -> `finalize_type()` -> `free_allocatable()` - `finalize_type()` This disptaches to one of following : `finalize_scalars()`, `finalize_struct()`, `finalize_string()`,`finalize_array()`, `finalize_list()`, `finalize_set()` ,`finalize_dict()` ,`finalize_tuple()`, `finalize_union()` Each one of those is responsible of finalizing the type it's named after. **Example**: `type(t), allocatable :: n` `finalize_struct()` once works on that `t` type, it will loop on each and every variable (struct member) and free it using `finalize()`. ## Examples #### `type(t), alloatable :: t_arr(:)` - `finalize()` --> Dispatches to `finalize_allocatable()` - `finalize_allocatable()` --> Calls `finalize_type()` - `finalize_type()` --> Calls `finalize_array()` - `finalize_array()` --> Finalizes internals elements and other info (if any is heap allocated). Let's see how. - `finalize_array()` --> Calls utility `finalize_array_data()` to free array's elements as different array types require different handling, they don't go and just call `finalize` on the type of array. - `finalize_array_data()` --> Loops on the array size to get each and every struct `t` . - `finalize_array_data()` --> Calls `finalize_struct()` on each element. - `finalize_struct()` --> Loops on each and every element attempting to finalize each memeber within the struct by its own finalizer based on the struct member type using `finalize_type()` - `finalize_array()` --> Calls `free_array_ptr_to_consecutive_data()` this is responsible of freeing consecutively allocated memory of the array. - `finalize_allocatable()`--> Calls `free_allocatable_ptr()` which should have the logic if allocatable arrays need a finalization (They physical array type).lfortran-lfortran-2f73434/doc/src/usage.md0000664000175000017500000001557115141516316020626 0ustar alastairalastair# LFortran User Guide ## About LFortran LFortran's goal is an implementation of the latest Fortran standard (currently F2018) with some added extensions. It works on Linux, macOS, most BSDs and on Windows. The LFortran compiler consists of the following components: * The LFortran compiler itself. * A runtime library supporting language elements and intrinsic functions. * Several module definitions which define the external environment and supply particular details about the computer running the program. * The capability to read additional module definitions which define the interfaces to external libraries such as OpenMPI. * Generation of executable code with the LLVM compiler infrastructure. * Generation of C, C++, WebAssembly or Julia code. * Interactive usage via LLVM JIT * Source file formatting (`lfortran fmt`). ## Standards The LFortran compiler is currently in the alpha stage and is actively under development. It is designed to support the following Fortran standards and modes: Supported Standards: * ISO Fortran 2023 (`--std=f23`): Partial support for the latest Fortran 2023 features. Use this option to enable conformance to Fortran 2023 where supported. * Legacy Mode (`--std=legacy`): Allows compilation of older Fortran codebases that use non-standard or deprecated syntax. * LFortran Mode (`--std=lf`): Default mode focusing on modern Fortran features, including experimental extensions beyond the current standards. ## Extensions The extensions are currently in development and are planned to include: * Global Scope (statements outside of a program block). * Interactive Fortran (in alpha). * Jupyter integration. * Support for GPUs and other accelerators ## Interactive Compiler LFortran supports an interactive mode; just run the `lfortran` command to start it. ## Invoking LFortran The LFortran compiler supports numerous command-line flags to select compilation options, output options, link options and so on. ### Compiler information * `--print-targets`, Print the registered CPU targets * `--version`, Show the current version ### Source code format * `--fixed-form`, Parse the file assuming Fortran 66 format (6 spaces) * `--fixed-form-infer`, Use heuristics to infer if a file is in fixed form ### Source code processing * `--cpp`, Enable C preprocessing * `-E`, Preprocess only; do not compile, assemble or link ### Other inputs * `-D =` Define a macro (or 1 if omitted) * `-I `, Include path for `include` statements * `-L `, Library path for shared libraries * `-l `, Link library naming a linkable shared library ### Compiler feature selections * `--fast`, Best performance (disable strict standard compliance) * `--implicit-argument-casting`, Allow implicit argument casting * `--implicit-interface`, Allow implicit interface * `--implicit-typing`, Allow implicit typing * `--openmp`, Enable OpenMP * `--print-leading-space`, Print leading white space if format is unspecified * `--realloc-lhs-arrays`, Reallocate left hand side automatically for arrays * `--disable-realloc-lhs-arrays`, Disables reallocating left hand side automatically for arrays * `--target `, Generate code for the given target * `--backend` flag is used to specify the target backend for code generation in LFortran. The supported backends are: - `llvm`: The most advanced and default backend, used for generating LLVM IR or machine code through LLVM. - `wasm`: For generating `Webassembly` via our custom `wasm` backend. - `c`: For generating C code. - `cpp`: For generating C++ code (requires the Kokkos library). - `x86`: For generating x86 machine code directly (without LLVM). - `fortran`: For generating Fortran code. - `julia`: For generating Julia code. ### Compiler text outputs * `--error-format `, Control how errors are produced (human, short) * `--no-error-banner`, Turn off error banner * `--no-warnings`, Turn off all warnings * `-S`, Emit assembly, do not assemble or link * `--time-report`, Show compilation time report * `-v`, Be more verbose ### Compiler binary outputs * `-c`, Compile and assemble, do not link * `--separate-compilation`, Generate object code into .o files * `-J `, Where to save mod files * `-o `, Specify the file to place the compiler's output into * `--static`, Create a static executable ### Compiler debugging A number of command-line options select various text outputs useful for debugging the compiler. See `lfortran --help` for a list. ## Examples The following commands and code demonstrate basic operation of the compiler. ``` lfortran helloworld.f90 Hello World! lfortran -o hw helloworld.f90 ./hw Hello World! cat helloworld.f90 program hello_world implicit none write (*, *) 'Hello World!' end program hello_world ``` Here is a simple example with a module: ``` lfortran -c varray.f90 lfortran usev.f90 sum is 7.20000000e+01 cat varray.f90 module varray integer :: nsize end module varray cat usev.f90 program usev use varray real, allocatable, dimension(:) :: A integer :: i nsize = 8 allocate(A(nsize)) do i = 1, nsize A(i) = 2.0*i end do print *, " sum is ", (A(1)+A(nsize))*nsize/2.0 deallocate(A) end program usev ``` The compile command for the module requires `-c` to avoid automatic running of the code. ## Formatting Fortran source files The `lfortran` compiler will automatically format source files with the `fmt` option. You can select auto-indent for modules, and in-place update of the Fortran source file with the `-i` option (use with caution!). ``` lfortran fmt varray.f90 module varray integer :: nsize real, allocatable, dimension(:) :: A end module varray ``` Or add spaces and indentation as follows: ``` lfortran fmt --spaces 4 --indent-unit varray.f90 module varray integer :: nsize real, allocatable, dimension(:) :: A end module varray ``` ## Selecting the C Compiler By default LFortran uses the `clang` compiler. On some systems the compiler has a version number or spelling difference. The compiler can be changed with the `LFORTRAN_CC` symbol: ``` unset LFORTRAN_CC lfortran hw.f90 Hello World! export LFORTRAN_CC=gcc lfortran hw.f90 Hello World! export LFORTRAN_CC=clang-14 lfortran hw.f90 sh: clang-14: not found ...(further error messages)... ``` ## Differences from other compilers GNU, Intel and LLVM Fortran use "standard" Fortran carriage control where the first character of each output line controls a conceptual "line printer". A space " " means single-space, a zero "0" means double-space and one "1" means form-feed before printing. This is obsolete and LFortran omits this unless `--print-leading-space` is selected at compile-time. There is currently no way to specify detailed compiler options to Clang such as `-O3` or `-flto` (optimization and link-time optimization). GNU extension declarations `real*8 xvalue` are accepted but deprecated. This is valid Fortran-77 but not Fortran-2018. lfortran-lfortran-2f73434/doc/src/conf.py0000664000175000017500000000307715141516316020475 0ustar alastairalastairimport json from pathlib import Path root = Path(__file__).parent with open(root / "_static" / "languages.json", "r", encoding="utf-8") as fd: all_languages = json.load(fd) if "language" not in globals(): language = "en" project = "LFortran" author = f"{project} contributors" copyright = f"2022 {author}" extensions = [ "myst_parser", "nbsphinx", "sphinx_copybutton", ] myst_enable_extensions = [ "dollarmath", ] html_theme = "sphinx_material" html_title = project html_logo = "_static/img/lfortran-logo.svg" html_favicon = html_logo html_css_files = ["css/custom.css", "css/ansi.css"] html_static_path = ["_static"] html_show_sourcelink = False html_theme_options = { "nav_title": f"{project} Documentation", "base_url": f"https://docs.lfortran.org/{language}/", "repo_name": project, "color_primary": "amber", "color_accent": "orange", "repo_url": "https://github.com/lfortran/lfortran", "nav_links": [ dict(href="installation", internal=True, title="Getting started"), dict(href="progress", internal=True, title="LFortran Development Status"), dict(href="design", internal=True, title="Developers's Guide"), dict(href="intrinsics/array", internal=True, title="Intrinsics"), ], "version_info": { lang: f"/../{code}/" for lang, code in all_languages.items() }, "globaltoc_depth": 2, } html_sidebars = { "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"] } templates_path = ["_templates"] locale_dirs = ["../locale"] gettext_compact = "docs" lfortran-lfortran-2f73434/doc/src/index.md0000664000175000017500000001564315141516316020631 0ustar alastairalastair# LFortran Documentation LFortran is a modern open-source (BSD licensed) interactive Fortran compiler built on top of LLVM. It can execute user's code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user's code on modern architectures such as multi-core CPUs and GPUs. Website: [https://lfortran.org/](https://lfortran.org/) Main repository: [https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran) Try online using Binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) ## Feature Highlights LFortran is in development, there are features that work today, and there are features that are being implemented. You can also check out the [Development Status](progress.md) section for more information on features being supported and being worked on. ### Works today * **Interactive, Jupyter support** LFortran can be used from Jupyter as a Fortran kernel, allowing a Python/Julia style rapid prototyping and exploratory workflow (see the [static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c) or [interactive](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or it can be used from the command-line in an interactive prompt (REPL). * **Clean, modular design, usable as a library** LFortran is structured around two independent modules, AST and ASR, both of which are standalone (completely independent of the rest of LFortran) and users are encouraged to use them independently for other applications and build tools on top. See the [Design](design.md) and [Developer Tutorial](developer_tutorial.md) documents for more details. * **Interoperation with GFortran** LFortran can parse GFortran module files into an ASR and generate a Fortran wrapper that can be compiled with any Fortran compiler and linked with the original GFortran compiled module. * **Create executables** It can create executables just like other Fortran compilers. * **Runs on Linux, Mac and Windows** All three platforms are regularly tested by our CI. ### Planned These features are under development, there is a link to the corresponding issue so that you can track the progress by following it. * **Native interoperation with other languages (and other Fortran compilers)** It can automatically call code written in other languages (such as C or Python) just by using the `use` statement, see [#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands other Fortran compilers module files (one can just "use" them) and their ABI to link correctly (GFortran is supported, other compilers are planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), which allows to use LFortran with production codes today. * **Modern hardware support** Thanks to LLVM, the goal of LFortran is to run on modern hardware and take advantage of native Fortran language constructs (such as `do concurrent`) to run on multi-core CPUs and GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57). * **Full Fortran 2018 support** Currently only a subset of Fortran is implemented, but the goal is to have a full implementation of the latest Fortran 2018 standard, see [#58](https://gitlab.com/lfortran/lfortran/issues/58). Please vote on issues in our [issue tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to prioritize (feel free to create new ones if we are missing anything). ## Roadmap Here is our roadmap how to get all the planned features above implemented: 1. Port code generation to use ASR and pass all the current tests ([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Remove the old code generation and old semantics, that used to annotate the AST tree, which was messy. 2. Get GFortran module files working with `use` module, both assumed-size and assumed-shape arrays ([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow right away to use production codes with LFortran. 3. Do these at the same time: a) Implement more Fortran features, until eventually full Fortran 2018 is supported ([#58](https://gitlab.com/lfortran/lfortran/issues/58)). b) Gradually move to C++ for robustness and speed ([#70](https://gitlab.com/lfortran/lfortran/issues/70)). The Python API will not change (or only minimally), so the user experience from Python will not change. c) Implement all the other cool features: `use` module for C and Python and automatic wrappers ([#44](https://gitlab.com/lfortran/lfortran/issues/44)), modern hardware support ([#57](https://gitlab.com/lfortran/lfortran/issues/57)), generating an older standard of Fortran ([#72](https://gitlab.com/lfortran/lfortran/issues/72)), Fortran doctest feature ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy integration ([#71](https://gitlab.com/lfortran/lfortran/issues/71)), language service for IDEs ([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas ([#29](https://gitlab.com/lfortran/lfortran/issues/29)). The step 1. is an internal refactoring that will not take long. The step 2. will allow LFortran to be used interactively with production codes right away (the production code will get compiled with GFortran, then one "uses" any module in LFortran and functions/subroutines can be interactively called, the module itself can use any GFortran supported feature, but the API must fit into the subset that LFortran understands --- for large number of applications simple functions/subroutines with array arguments are enough). This will make LFortran usable for first users and one can always use GFortran temporarily until LFortran supports the given feature. We expect to be finished with the step 2. by the end of summer 2019, hopefully sooner. Finally the step 3. will improve LFortran overall, allowing the first users to contribute back, growing the community and making LFortran gradually useful for more and more people. ```{toctree} :caption: Getting started :hidden: installation language usage ``` ```{toctree} :caption: LFortran Development Status :hidden: progress ``` ```{toctree} :caption: Developer's Guide :hidden: design developer_tutorial ast_and_asr contributing ``` ```{toctree} :caption: LFortran Intrinsics :hidden: intrinsics/array intrinsics/bit intrinsics/character intrinsics/kind-type intrinsics/mathematical intrinsics/numeric intrinsics/misc ``` ```{toctree} :caption: LFortran ASR Nodes :hidden: asr/asr_nodes/cast_kind_nodes/cast_kind.md asr/asr_nodes/expression_nodes/expression_nodes.md asr/asr_nodes/kinds_nodes/kinds.md asr/asr_nodes/statement_nodes/statement_nodes.md asr/asr_nodes/symbol_nodes/symbol_nodes.md asr/asr_nodes/type_nodes/ttype.md asr/asr_nodes/omp_nodes/omp_nodes.md ``` lfortran-lfortran-2f73434/doc/src/javascripts/0000775000175000017500000000000015141516316021520 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/javascripts/mathjax.js0000664000175000017500000000045415141516316023515 0ustar alastairalastairwindow.MathJax = { tex: { inlineMath: [["\\(", "\\)"]], displayMath: [["\\[", "\\]"]], processEscapes: true, processEnvironments: true }, options: { ignoreHtmlClass: ".*|", processHtmlClass: "arithmatex" } }; document$.subscribe(() => { MathJax.typesetPromise() }) lfortran-lfortran-2f73434/doc/src/design.md0000664000175000017500000002565315141516316020775 0ustar alastairalastair# LFortran Design ## High Level Overview LFortran is structured around two independent modules, AST and ASR, both of which are standalone (completely independent of the rest of LFortran) and users are encouraged to use them independently for other applications and build tools on top: * Abstract Syntax Tree (AST), module `lfortran.ast`: Represents any Fortran source code, strictly based on syntax, no semantic is included. The AST module can convert itself to Fortran source code. * Abstract Semantic Representation (ASR), module `lfortran.asr`: Represents a valid Fortran source code, all semantic is included. Invalid Fortran code is not allowed (an error will be given). The ASR module can convert itself to an AST. The LFortran compiler is then composed of the following independent stages: * Parsing: converts Fortran source code to an AST * Semantic: converts an AST to an ASR * High level optimizations: optimize ASR to a possibly faster/simpler ASR (things like inlining functions, eliminating redundant expressions or statements, etc.) * LLVM IR code generation and lower level optimizations: converts an ASR to an LLVM IR. This stage also does all other optimizations that do not produce an ASR, but still make sense to do before passing to LLVM IR. * Machine code generation: LLVM then does all its optimizations and generates machine code (such as a binary executable, a library, an object file, or it is loaded and executed using JIT as part of the interactive LFortran session or in a Jupyter kernel). LFortran is structured as a library, and so one can for example use the parser to obtain an AST and do something with it, or one can then use the semantic analyzer to obtain ASR and do something with it. One can generate the ASR directly (e.g., from SymPy) and then either convert to AST and to a Fortran source code, or use LFortran to compile it to machine code directly. In other words, one can use LFortran to easily convert between the three equivalent representations: * Fortran source code * Abstract Syntax Tree (AST) * Abstract Semantic Representation (ASR) They are all equivalent in the following sense: * Any ASR can always be converted to an equivalent AST * Any AST can always be converted to an equivalent Fortran source code * Any Fortran source code can always be either converted to an equivalent AST or one gets a syntax error * Any AST can always be either converted to an equivalent ASR or one gets a semantic error So when a conversion can be done, they are equivalent, and the conversion can always be done unless the code is invalid. ## ASR Design Details The ASR is designed to have the following features: * ASR is still semantically equivalent to the original Fortran code (it did not lose any semantic information). ASR can be converted to AST, and AST to Fortran source code which is functionally equivalent to the original. * ASR is as simple as possible: it does not contain any information that could not be inferred from ASR. * The ASR C++ classes (down the road) are designed similarly to SymEngine: they are constructed once and after that they are immutable. The constructor checks in Debug more that all the requirements are met (e.g., that all Variables in a Function have a dummy argument set, that explicit-shape arrays are not allocatable and all other Fortran requirements to make it a valid code), but in Release mode it quickly constructs the class without checks. Then there are builder classes that construct the ASR C++ classes to meet requirements (checked in Debug mode) and the builder gives an error message if a code is not a valid Fortran code, and if it doesn't give an error message, then the ASR C++ classes are constructed correctly. Thus by construction, the ASR classes always contain valid Fortran code and the rest of LFortran can depend on it. ## Compilation Modes We support two compilation modes: 1. Monolithic Compilation Mode: The standard compilation mode. In this mode, LFortran produces empty object files (`.o` files) with `-c` flag (the only reason to produce those is to satisfy existing build systems that typically expect `.o` files to be created). The object code is generated only when main program is encountered: all modules are loaded from `.mod` files and everything compiled and linked at once. When a module is compiled, only a `.mod` file is generated with full code. For files with global procedures, LFortran identifies those automatically and sets `generate_code_for_global_procedures` compiler option to `true` (not exposed to user), which then generates object code only for global procedures (you must thus link these generated `.o` object files with the main program), and rest of the modules are serialized to `.mod` files which do not contain global procedure. 2. Separate Compilation Mode: This mode is enabled with `--separate-compilation` flag. In this mode, LFortran generates full code for each file into object files (`.o` files) with full symbol information. This is usually the default mode used by most other Fortran compilers. We create object code, and we still create `.mod` files for modules and they contain everything just like for direct mode but when any `.mod` file is loaded, we change all symbols to `ExternalUndefined` ABI. We don't change the ABI for `bind(c)` (since those are undefined already in object code, the user is responsible to provide an implementation at link time). Note: **_If you enable separate compilation mode, you have to enable it for all the files._** ## Notes: Information that is lost when parsing source to AST: whitespace, multiline/single line if statement distinction, case sensitivity of keywords. Information that is lost when going from AST to ASR: detailed syntax how variables were defined and the order of type attributes (whether array dimension is using the `dimension` attribute, or parentheses at the variable; or how many variables there are per declaration line or their order), as ASR only represents the aggregated type information in the symbol table. ASR is the simplest way to generate Fortran code, as one does not have to worry about the detailed syntax (as in AST) about how and where things are declared. One specifies the symbol table for a module, then for each symbol (functions, global variables, types, ...) one specifies the local variables and if this is an interface then one needs to specify where one can find an implementation, otherwise a body is supplied with statements, those nodes are almost the same as in AST, except that each variable is just a reference to a symbol in the symbol table (so by construction one cannot have undefined variables). The symbol table for each node such as Function or Module also references its parent (for example a function references a module, a module references the global scope). The ASR can be directly converted to an AST without gathering any other information. And the AST directly to Fortran source code. The ASR is always representing a semantically valid Fortran code. This is enforced by checks in the ASR C++ constructors (in Debug build). When an ASR is used, one can assume it is valid. ## Fortran 2008 Fortran 2008 [standard](https://j3-fortran.org/doc/year/10/10-007.pdf) chapter 2 "Fortran concepts" specifies that Fortran code is a collection of _program units_ (either all in one file, or in separate files), where each _program unit_ is one of: * main program * module or submodule * function or subroutine Note: It can also be a _block data_ program unit, that is used to provide initial values for data objects in named _common blocks_, but we do not recommend the use of _common blocks_ (use modules instead). ## LFortran Extension We extend the Fortran language by introducing a _global scope_, which is not only the list of _program units_ (as in F2008) but can also include statements, declarations, use statements and expressions. We define _global scope_ as a collection of the following items: * main program * module or submodule * function or subroutine * use statement * declaration * statement * expression In addition, if a variable is not defined in an assignment statement (such as `x = 5+3`) then the type of the variable is inferred from the right hand side (e.g., `x` in `x = 5+3` would be of type `integer`, and `y` in `y = 5._dp` would be of type `real(dp)`). This rule only applies at the top level of _global scope_. Types must be fully specified inside main programs, modules, functions and subroutines, just like in F2008. The _global scope_ has its own symbol table. The main program and module/submodule do not see any symbols from this symbol table. But functions, subroutines, statements and expressions at the top level of _global scope_ use and operate on this symbol table. The _global scope_ has the following symbols predefined in the symbol table: * the usual standard set of Fortran functions (such as `size`, `sin`, `cos`, ...) * the `dp` double precision symbol, so that one can use `5._dp` for double precision. Each item in the _global scope_ is interpreted as follows: main program is compiled into an executable with the same name and executed; modules, functions and subroutines are compiled and loaded; use statement and declaration adds those symbols with the proper type into the _global scope_ symbol table, but do not generate any code; statement is wrapped into an anonymous subroutine with no arguments, compiled, loaded and executed; expression is wrapped into an anonymous function with no arguments returning the expression, compiled, loaded, executed and the return value is returned to the user. The _global scope_ is always interpreted, item by item, per the previous paragraph. It is meant to allow interactive usage, experimentations and writing simple scripts. Code in _global scope_ must be interpreted using `lfortran`. For more complex (production) code it is recommended to turn it into modules and programs (by wrapping loose statements into subroutines or functions and by adding type declarations) and compile it with `lfortran` or any other Fortran compiler. Here are some examples of valid code in _global scope_: ### Example 1 ```fortran a = 5 print *, a ``` ### Example 2 ```fortran a = 5 subroutine p() print *, a end subroutine call p() ``` ### Example 3 ```fortran module a implicit none integer :: i end module use a, only: i i = 5 ``` ### Example 4 ```fortran x = [1, 2, 3] y = [1, 2, 1] call plot(x, y, "o-") ``` ## Design Considerations The LFortran extension of Fortran was chosen in a way so as to minimize the number of changes. In particular, only the top level of the _global scope_ has relaxed some of the Fortran rules (such as making specifying types optional) so as to allow simple and quick interactive usage, but inside functions, subroutines, modules or programs this relaxation does not apply. The number of changes were kept to minimum in order to make it straightforward to turn code at _global scope_ into standard compliant Fortran code using programs and modules, so that it can be compiled by any Fortran compiler. lfortran-lfortran-2f73434/doc/src/passes/0000775000175000017500000000000015141516316020465 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/passes/subroutine_from_function.md0000664000175000017500000000650215141516316026141 0ustar alastairalastair### Class `AllocateVarBasedOnFuncCall` ======== What Is It Doing? ======== It allocates a Var based on the return type of a FunctionCall. ======== Why This Class? ======== While we're using the return type of the functionCall we might face FunctionParam nodes OR We might face already replaced FunctionParam nodes. The problem : That FuncParam node could be a functionCall node. If we allocate using the return type rightaway without creating temporary to hold the functionCall result, We'll end up double calling the function. one for the allocate statement and one for the passed argument. Another Problem : Having a functionCall (argument) inplace of a functionParam but the functionCall got replaced into a temporary variable, hence we got Revaluate and replace that old functionCall with the temporary -- otherwise we'll double call the function also. How to fix that ?? Use the Function's return type (the one that has FunctionParam nodes) and start traversing through the type node attempting to replace functionCalls with temporaries inplace of the FunctinonParam and also the FunctionCall argument Note : We're attempting to create temporaries for functionCalls -- We rely on the fact that we're applying this whole pass logic in depth first manner -- making us creating temporaries for simple functionCalls. NO AGGREGATE RETURNS ======== Example ======== ```.f90 function foo(x) result (r) integer :: x character(len=x) :: r end function print *, foo(f()) ! ASSUME `f()` returns an integer ``` WITHOUT THIS CLASS : ```.f90 allocate(character(len=f()) :: return_slot) ! DOUBLE EVALUATION OF `f()` call foo(f(), return_slot) print *, return_slot ``` WITH THIS CLASS : ```.f90 temp_var = f() allocate(character(len=funcCall_temp_var) :: return_slot) call foo(temp_var, return_slot) print *, return_slot ``` ======== How It Works? ======== 1. We use entry static function `Allocate()` to prevent using other functions by mistake. 2. Pass to it Var to allocate + FunctionCall we're allocating against its return type + Other helper members. 3. We get function return type (the one with FunctionParams). 4. We call the replacer on the type. 5. The replacer replaces FunctionParam nodes with arguments in the functionCall. 6. FunctionCalls arguments are replaced with temporaries in both FunctionParam site and also the functionCall's argument site. 7. Any other argument expression is just used normally. 8. Then we insert an allocate statement (the main purpose of this class) --- ### Class `CreateFunctionFromSubroutine` ================= What Is It Doing? ================= This pass transforms functions that return aggregate types (like arrays, structs, strings, etc.) into subroutines. ================= How It works? ================= 1. It visits only Function nodes in the ASR tree. 2. We use `handle_fn_return_var()` to identify whether this function needs transformation or not. 3. `is_aggregate_or_array_or_nonPrimitive_type()` have the roles on which we decide. 4. If transformation is needed, We transform function's member `return_var` into intentOUT argument and we nullify the member. 5. We also store the original return type in a map for later use. lfortran-lfortran-2f73434/doc/src/language.md0000664000175000017500000000405415141516316021277 0ustar alastairalastair# Fortran Language ## Background and Motivation Fortran was designed from the ground up to naturally and simply translate mathematics to code that compiles and runs at maximum speed. And being specifically targeted for such fundamentally computational tasks, it contains a broad range of key functionality within the language itself, standard across all platforms, with no need for external libraries that may or may not be well optimized or maintained, at present or down the road. Some highlights: * Multidimensional arrays which can be allocated and indexed as the math/science dictates (not restricted to start at 0 or 1) and can be sliced as desired (as, e.g., in MATLAB); * Operators which operate naturally upon the aforementioned arrays/matrices, as they do scalars; * Complex numbers; * Special functions; * Structures and pointers for more general data representation. Because the essentials are contained in the language itself, it is simple to read and write, without need of choosing from among or deciphering a proliferation of external classes to do the same thing. And because the essentials are self-contained, compilers can provide detailed compile-time (e.g., argument mismatch) and run-time (e.g., memory access) checks, as well as highly optimized executables, directly from natural, readable code without need of extensive optimization heroics by the developer. See our blog posts for more information: * [Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-created-lfortran/) * [Why to Use Fortran For New Projects](https://lfortran.org/blog/2019/05/why-to-use-fortran-for-new-projects/) ## How to Learn Fortran Fortran is relatively quick to learn because it is so much simpler and smaller than C/C++ (in practice, that is, with all needed libraries included). If you are interested in learning more, please see our webpage at [fortran90.org] with recommended practices for writing code, side by side comparison with Python/NumPy, links to other online Fortran resources and books, and an FAQ. [fortran90.org]: https://www.fortran90.org/ lfortran-lfortran-2f73434/doc/src/llvm/0000775000175000017500000000000015141516316020141 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/llvm/array_descriptor.md0000664000175000017500000000301115141516316024032 0ustar alastairalastair# Array Descriptor in LLVM IR In Fortran, arrays whose shape cannot be fully determined at compile time are represented at runtime using array descriptors. An array descriptor encapsulates both a pointer to the underlying data buffer and the metadata required to interpret the array (such as dimensions, strides, and bounds). --- ## Array Descriptor Struct The LLVM IR representation of an array descriptor: ```llvm %array = type { i32*, i32, %dimension_descriptor*, i1, i32 } ``` ## Field Descriptors | Field Name | Type | Description | |------------|------|-------------| | `data_pointer` | `i32*` | Pointer to the beginning of the raw array data | | `base_offset` | `i32` | Offset from the data_pointer to the logical first element of the array | | `dimension_descriptor` | `%dimension_descriptor*` | Pointer to a contiguous block of `N` dimension descriptors structs, where N is the array rank| | `is_pointer` | `i1` | Indicates whether this is a Fortran pointer array | | `rank` | `i32` | The number of dimensions in the array (Rank)| ## Dimension Descriptor Struct Each dimension of the array has an associated dimension descriptor: ```llvm %dimension_descriptor = type { i32, i32, i32 } ``` ## Field Descriptors | Field Name | Type | Description | |------------|------|-------------| | `stride` | `i32` | The offset between consecutive values along this dimension | | `lower_bound` | `i32` | The Lower bound of the dimension | | `size` | `i32` | The extent of the dimension (number of elements along this axis) | lfortran-lfortran-2f73434/doc/src/contributing.md0000664000175000017500000002010115141516316022212 0ustar alastairalastair# Contributing We welcome contributions from anyone, even if you are new to open source. It might sound daunting to contribute to a compiler at first, but please do, it is not complicated. We will help you with any technical issues and help improve your contribution so that it can be merged. ## Basic Setup To contribute, make sure your set up: * Your username + email * Your `~/.gitconfig` * Your shell prompt to display the current branch name ### Fork LFortran Step 1. Create a fork of the [project repository](https://github.com/lfortran/lfortran) Step 2. Set up your [SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) with GitHub Step 3. Clone the project repository from GitHub and set up your remote repository ``` git clone https://github.com/lfortran/lfortran.git cd lfortran git remote add REMOTE_NAME git@github.com:YOUR_GITHUB_ID/lfortran.git ``` :fontawesome-solid-edit: `REMOTE_NAME` is the name of your remote repository and could be any name you like, for example your first name. :fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and should be part of your account path. You can use `git remote -v` to check if the new remote is set up correctly. ### Send a New Merge Request Step 1. Create a new branch ``` git checkout -b fix1 ``` Step 2. Make changes in relevant file(s) Step 3. Commit the changes: ``` git add FILE1 (FILE2 ...) git commit -m "YOUR_COMMIT_MESSAGE" ``` [Here](https://chris.beams.io/posts/git-commit/) are some great tips on writing good commit messages. Step 4. Check to ensure that your changes look good ``` git log --pretty=oneline --graph --decorate --all ``` Step 5. Send the merge request ``` git push REMOTE_NAME fix1 ``` The command will push the new branch `fix1` into your remote repository `REMOTE_NAME` that you created earlier. Additionally, it will also display a link that you can click on to open the new merge request. After clicking on the link, write a title and a concise description then click the "Create" button. Yay you are now all set. ### How to Fix Things: A Tutorial Here’s a tutorial video that explains LFortran's design and how to fix bugs: [Watch here](https://www.youtube.com/watch?v=yuYsyM08bss). ## Add New Features The example below shows the steps it would take to create a caret binary operator **^** which computes the average value of the two operands. ### Create New Token(s) We extend the *tokenizer.re* as well as *parser.yy* to add the new token **^**. We also tell LFortran how to print the new token in *parser.cpp*. :fontawesome-solid-code: *src/lfortran/parser/tokenizer.re* ``` // "^" { RET(TK_CARET) } ``` :fontawesome-solid-code: *src/lfortran/parser/parser.yy* ``` %token TK_CARET "^" ``` :fontawesome-solid-code: *src/lfortran/parser/parser.cpp* ``` std:string token2text(const int token) { switch (token) { T(TK_CARET, "^") } } ``` The added code is tested with `lfortran --show-tokens examples2/expr2.f90` ### Parse the New Token Now we have to parse the new operator. We add it to the AST by extending the BinOp with a caret operator and modifying the *AST.asdl* file. Then we add it in *parse.yy* to properly parse and generate the new AST in *semantics.h*.Finally we extend *pickle.cpp* so that the new operator can print itself. :fontawesome-solid-code:*grammar/AST.asdl* ``` operator = Add | Sub | Mul | Div | Pow | Caret ``` :fontawesome-solid-code:*src/lfortran/parser/parser.yy* ``` %left "^" expr : id { $$=$1; } | expr "^" expr { $$ = CARET($1, $3, @$); } ``` :fontawesome-solid-code:*src/lfortran/parser/semantics.h* ``` #define CARET(x,y,l) make_BinOp_t(p.m_a, l, EXPR(x), operatorType::Caret, EXPR(y)) ``` :fontawesome-solid-code:*src/lfortran/pickle.cpp* ``` std::string op2str(const operatorType type) { switch (type) { case (operatorType::Caret) : return "^"; } // now the caret operator can print itself } ``` The section is tested with `lfortran --show-ast examples/expr2.f90` ### Implement the Semantics of the New Token We first extend the ASR in *ASR.asdl* and add ^ as a BinOp operator option. :fontawesome-solid-code:*src/libasr/ASR.asdl* ``` binop = Add | Sub | Mul | Div | Pow | Caret ``` :fontawesome-solid-code:*src/lfortran/semantics/ast_common_visitor.h* ``` namespace LFortran { class CommonVisitorMethods { public: inline static void visit_BinOp(Allocator &al, const AST::BinOp_t &x, ASR::expr_t *&left, ASR::expr_t *&right, ASR::asr_t *&asr) { ASR::binopType op; switch (x.m_op) { case (AST::Caret): op = ASR::Caret; break; } if (LFortran::ASRUtils::expr_value(left) != nullptr && LFortran::ASRUtils::expr_value(right) != nullptr) { if (ASR::is_a(*dest_type)) { int64_t left_value = ASR::down_cast( LFortran::ASRUtils::expr_value(left)) ->m_n; int64_t right_value = ASR::down_cast( LFortran::ASRUtils::expr_value(right)) ->m_n; int64_t result; switch (op) { case (ASR::Caret): result = (left_value + right_value)/2; break; } } } } } } ``` Then we transform it from AST to ASR by extending *src/lfortran/semantics/ast_common_visitor.h*. We also add it into compile time evaluation triggered by expressions such as `e = (2+3)^5` which is evaluated at compile time. An expression such as `e = x^5` is evaluated at run time only. The section is tested with `lfortran --show-asr examples/expr2.f90` ### Implement the New Token in LLVM To implement in LLVM, we extend the BinOp translation by handling the new operator. We first add the two numbers then divide by two. :fontawesome-solid-code:*src/lfortran/codegen/asr_to_llvm.cpp* ``` void visit_BinOp(const ASR::BinOp_t &x) { if (x.m_value) { this->visit_expr_wrapper(x.m_value, true); return; } this->visit_expr_wrapper(x.m_left, true); llvm::Value *left_val = tmp; this->visit_expr_wrapper(x.m_right, true); llvm::Value *right_val = tmp; if (x.m_type->type == ASR::ttypeType::Integer || x.m_type->type == ASR::ttypeType::IntegerPointer) { switch (x.m_op) { case ASR::binopType::Caret: { tmp = builder->CreateAdd(left_val, right_val); llvm::Value *two = llvm::ConstantInt::get(context, llvm::APInt(32, 2, true)); tmp = builder->CreateUDiv(tmp, two); break; }; } } } ``` The section is tested with `lfortran --show-llvm examples/expr2.f90` Now when LLVM works, we can test the final executable by: ``` lfortran examples/expr2.f90 ./a.out ``` And it should print 6. It also works interactively: ``` $ lfortran Interactive Fortran. Experimental prototype, not ready for end users. * Use Ctrl-D to exit * Use Enter to submit * Use Alt-Enter or Ctrl-N to make a new line - Editing (Keys: Left, Right, Home, End, Backspace, Delete) - History (Keys: Up, Down) >>> 4^8 1,4 ] 6 >>> integer :: x 1,13 ] >>> x = 4 1,6 ] >>> x^8 1,4 ] 6 ``` ## Reach Out If you have any questions or need help, please ask as at our [mailinglist](https://groups.io/g/lfortran) or a [chat](https://lfortran.zulipchat.com/). Please note that all participants of this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md). By submitting a PR you agree to license your contribution under the LFortran's BSD [license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless explicitly noted otherwise. lfortran-lfortran-2f73434/doc/src/ast_and_asr.ipynb0000664000175000017500000000663015141516316022515 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Difference between an AST and ASR\n", "\n", "Let us take a simple Fortran code:\n", "```fortran\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function\n", "```\n", "and look at what the AST and ASR look like.\n", "\n", "## AST" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showast\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The AST does not have any semantic information, but has nodes to represent declarations such as `integer, intent(in) :: a`. Variables such as `a` are represented by a `Name` node, and are not connected to their declarations yet.\n", "\n", "The AST can also be exported in JSON, including source file name, line and column information: `lfortran example.f90 --show-ast --json`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ASR" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasr\n", "integer function f(a, b) result(r)\n", "integer, intent(in) :: a, b\n", "integer :: c, d\n", "c = a + b - d\n", "r = c * a\n", "end function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ASR has all the semantic information (types, etc.), nodes like `Function` have a symbol table and do not have any declaration nodes. Variables are simply pointers to the symbol table.\n", "\n", "The ASR can also be exported in JSON, including source file name, line and column information: `lfortran example.f90 --show-asr --json`\n", "\n", "## Discussion\n", "\n", "The above was a simple example. Things get more apparent for more complicated examples, such as:\n", "```fortran\n", "integer function f2b(a) result(r)\n", "use gfort_interop, only: c_desc1_int32\n", "integer, intent(in) :: a(:)\n", "interface\n", " integer function f2b_c_wrapper(a) bind(c, name=\"__mod1_MOD_f2b\")\n", " use gfort_interop, only: c_desc1_t\n", " type(c_desc1_t), intent(in) :: a\n", " end function\n", "end interface\n", "r = f2b_c_wrapper(c_desc1_int32(a))\n", "end function\n", "```\n", "AST must represent all the `use` statements and the `interface` block, and keep things semantically consistent.\n", "\n", "ASR, on the other hand, keeps track of the `c_desc1_int32`, `c_desc1_t` and `f2b_c_wrapper` in the symbol table and it knows they are defined in the `gfort_interop` module, and so ASR does not have any of these declaration nodes.\n", "\n", "When converting from ASR to AST, LFortran will create all the appropriate AST declaration nodes automatically and correctly." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-lfortran-2f73434/doc/src/intrinsics/0000775000175000017500000000000015141516316021354 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/kind-type/0000775000175000017500000000000015141516316023260 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/kind-type/kind.md0000664000175000017500000000225715141516316024535 0ustar alastairalastair# kind(x): Kind of an Entity Kind of an entity. ## Declaration ### Syntax ```fortran retval = kind(x) integer function kind(x) ``` ### Arguments `x` the input value, can be logical, integer, real, complex, or character. It may be a scalar or array valued i.e., any intrinsic type. ### Return values The return value is of integer type and of default integer kind. ## Description **kind(x)** returns the kind parameter of the input argument `x`. ## Types Supported argument types are logical, integer, real, complex, or character. ```fortran module lfortran_intrinsic_kind implicit none contains integer function kind(x) result(r) logical(4), intent(in) :: x r = 4 end function integer function skind(x) result(r) real(4), intent(in) :: x r = 4 end function integer function dkind(x) result(r) real(8), intent(in) :: x r = 8 end function integer function lkind(x) result(r) logical(4), intent(in) :: x r = 4 end function end module ``` ## Examples ```fortran program intrinsics_kind use lfortran_intrinsic_kind, only: kind implicit none logical :: l4d logical(4) :: l4 print *, kind(l4d) print *, kind(l4) end program ``` **Result:** ``` 4 4 ``` ## See Also None. lfortran-lfortran-2f73434/doc/src/intrinsics/character/0000775000175000017500000000000015141516316023310 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/character/char.md0000664000175000017500000000226715141516316024556 0ustar alastairalastair# char(x, [, kind]): Integer to Character Integer to character conversion. ## Declaration ### Syntax ```fortran retval = char(x) character function char(x) ``` ### Arguments `x`: the input value of integer type. `kind`: an optional input value of type integer constant expression for initialization. This indicates the kind parameter of the result. ### Return value The return value is of type character of length 1. The return value is of kind `kind` if optional input value is passed, otherwise the kind is default kind. ## Description **char(x)** returns the character represented by the ASCII character set at `x` position. If `x` is outside the ASCII character set integer value, i.e., if `x` is not represented in the ASCII character set, the return value is undefined. It is a runtime builtin function. ## Types Supported argument type is integer. ```fortran interface character function char(x) integer, intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_char implicit none character :: L = char(76) print *, L end program ``` **Result:** ``` L ``` ## See Also [achar](achar.md), [iachar](iachar.md), [ichar](ichar.md) lfortran-lfortran-2f73434/doc/src/intrinsics/character/lge.md0000664000175000017500000000255315141516316024406 0ustar alastairalastair# lge(x, y): Lexically Greater or Equal Lexically greater than or equal. ## Declaration ### Syntax ```fortran retval = lge(x, y) function lge(x, y) ``` ### Arguments `x` input value of type character. `y` input value of type character. `x` and `y` can be seen as string A and string B. ### Return values The return value is of logical `true` or `false` type. `True` if `x` string is lexically greater than or equal to `y`. `False` if they are not. ## Description **lge(x, y)** determines if input string `x` is lexically greater than or equal to input string `y`. The two strings in comparison are interpreted as containing ASCII character codes. ## Types Argument types should be of type character literal. ```fortran module lfortran_intrinsic_string use, intrinsic :: iso_fortran_env, only: i64 => int64 implicit none interface repeat module procedure repeati32, repeati64 end interface contains function lge(x, y) result(r) character(len=*),intent(in) :: x character(len=*),intent(in) :: y logical :: r end function ``` ## Examples ```fortran program intrinsics_lge implicit none character(len = 10) :: s1 = 'abcde' character(len = 10) :: s2 = 'xyz' character(len = 10) :: s3 = 'AB' character(len = 10) :: s4 = 'AAB' print *, lge(s1, s2) end program ``` **Result:** ``` false true ``` ## See Also [len_trim](len_trim.md). lfortran-lfortran-2f73434/doc/src/intrinsics/character/adjustr.md0000664000175000017500000000177715141516316025322 0ustar alastairalastair# adjustr(string): Right Adjust String Right adjust a string. ## Declaration ### Syntax ```fortran retval = adjustr(string) elemental function adjustr(string) ``` ### Arguments `string`: the input value must be of character type. ### Return value The return value is of type character and of the same kind as of input value `string`, with trailing spaces removed and same number of spaces added at the start. ## Description **adjustr(string)** adjusts input string by removing any trailing spaces and adding same number of spaces at the start of the input string. ## Types Supported argument type is character. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains function adjustr(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_adjustr implicit none character(*), parameter :: s1 = "A B " print *, adjustr(s1) end program ``` **Result:** ``` A B ``` ## See Also [adjustl](adjustl.md). lfortran-lfortran-2f73434/doc/src/intrinsics/character/adjustl.md0000664000175000017500000000171615141516316025305 0ustar alastairalastair# adjustl(string): Left Adjust String Left adjust a string. ## Declaration ### Syntax ```fortran retval = adjustl(string) elemental function adjustl(string) ``` ### Arguments `string`: the input value must be of character type. ### Return value The return value is of type character and of the same kind as of input value `string`, with leading spaces removed and same number of spaces appended. ## Description **adjustl(string)** adjusts input string by removing any leading spaces and appending same number of spaces. ## Types Supported argument type is character. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains function adjustl(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_adjustl implicit none character(*), parameter :: s1 = " A B " print *, adjustl(s1) end program ``` **Result:** ``` A B ``` ## See Also [lge](lge.md). lfortran-lfortran-2f73434/doc/src/intrinsics/character/len_trim.md0000664000175000017500000000174515141516316025452 0ustar alastairalastair# len_trim(string): Length Ignoring Trailing Blanks Length of a character string ignoring trailing blank character(s). ## Declaration ### Syntax ```fortran retval = len_trim(string) integer elemental function len_trim(string) ``` ### Arguments `string` the input value of character type. ### Return value The return value is of type unsigned integer. ## Description **len_trim(string)** returns the length of the character argument without including trailing blank character(s). ## Types Supported argument type is character scalar. ```fortran interface repeat module procedure repeati32, repeati64 end interface contains integer elemental function len_trim(string) character(len=*), intent(in) :: string end function ``` ## Examples ```fortran program intrinsics_len_trim implicit none character(*), parameter :: s1 = " A B " integer:: retval retval = len_trim(s1) print *, retval end program ``` **Result:** ``` 4 ``` ## See Also [lge](lge.md). lfortran-lfortran-2f73434/doc/src/intrinsics/character/achar.md0000664000175000017500000000232615141516316024713 0ustar alastairalastair# achar(x, kind): To Character in ASCII set. Character represented by in the ASCII character set. ## Declaration ### Syntax ```fortran retval = achar(x, kind) character(len=1) elemental function achar(x, kind) ``` ### Arguments `x`: the input value of integer type. `kind`: an optional input value of type integer constant expression for initialization. ### Return value The return value is of type character of length 1. The return value is of kind `kind` if optional input value is passed, otherwise the kind is default kind. ## Description **achar(x, kind)** returns the character represented by the ASCII character set at `x` position. If `x` is outside the ASCII character set integer value, i.e., if `x` is not represented in the ASCII character set, the return value is undefined. It is a runtime builtin function. ## Types Supported argument type is integer. ```fortran interface character(len=1) function achar(x, kind) integer, intent(in) :: x integer, optional :: kind end function end interface ``` ## Examples ```fortran program intrinsics_achar implicit none character :: exclamation = achar(33) print *, exclamation end program ``` **Result:** ``` ! ``` ## See Also [lge](lge.md). lfortran-lfortran-2f73434/doc/src/intrinsics/character.md0000664000175000017500000000022615141516316023632 0ustar alastairalastair# Character Intrinsic Functions ```{toctree} character/achar character/adjustl character/adjustr character/char character/lge character/len_trim ``` lfortran-lfortran-2f73434/doc/src/intrinsics/bit.md0000664000175000017500000000017115141516316022453 0ustar alastairalastair# Bit Intrinsic Functions ```{toctree} bit/bge bit/bgt bit/bit_size bit/ble bit/blt bit/btest bit/shiftl bit/shiftr ``` lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical.md0000664000175000017500000000031515141516316024326 0ustar alastairalastair# Mathematical Intrinsic Functions ```{toctree} mathematical/acos mathematical/acosh mathematical/asin mathematical/asinh mathematical/atan mathematical/atan2 mathematical/atanh mathematical/fraction ``` lfortran-lfortran-2f73434/doc/src/intrinsics/array/0000775000175000017500000000000015141516316022472 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/array/allocated.md0000664000175000017500000000172615141516316024752 0ustar alastairalastair# allocated(x): Status Check Logical status of an allocatable integer. ## Declaration ### Syntax ```fortran retval = allocated(x) logical function allocated(x) ``` ### Arguments `x` is an integer input parameter. ### Return values The return value is a logical scalar with the default logical kind type parameter. ## Description `allocated(x)` checks the allocation status of a integer input parameter. It returns a logical value as `TRUE` if the input argument `x` is allocated, `FALSE` otherwise. ## Types Supported argument type is integer. ```fortran module lfortran_intrinsic_builtin implicit none interface logical function allocated(x) integer, intent(in) :: x(:) end function end interface end module ``` ## Examples ```fortran program intrinsics_allocated implicit none integer :: i = 1 real(1), allocatable :: x(:) if (.not. allocated(x)) allocate(x(i)) print *, allocated(i) end program ``` **Result**: ``` TRUE ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/array/cshift.md0000664000175000017500000000242615141516316024300 0ustar alastairalastair# cshift(A, shift [, dim]): Circular Shift Circular shift elements of an array. ## Declaration ### Syntax ```fortran retval = cshift(A, shift [, dim]) integer function cshift(A, shift, [, dim]) ``` ### Arguments `A` the input array of any type or rank. `shift` the input value of integer type. `dim` optional dimension, if present, `cshift` returns the result of this dimension. ### Return values The return value is of input array type and rank as the `A` array input argument. ## Description **cshift(A, shift [, dim])** performs a circular shift on elements of `A` array along the dimension of `dim`. Default value of `dim` is 1, used when `dim` is not passed. If the rank of array is 1, then all elements of array are shifted by `shift` places. If rank is greater than one, then all complexte rank one sections of array along the given dimension are shifted. Elements shifted out one end of each rank one section are shifted back in the other end. ## Types Supported argument type is array for `A` and integer for `shift` and `dim`. ## Examples ```fortran program intrinsics_cshift implicit none integer, dimension(5):: a = [1, 2, 3, 4, 5] print '(5i3)', a a = cshift(a, shift = 2) print *, size(A, 2) end program ``` **Result**: ``` 1, 2, 3 4, 5, 1 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/array/size.md0000664000175000017500000000170615141516316023772 0ustar alastairalastair# size(x): Size of Array Returns the size of an array `x`. ## Declaration ### Syntax ```fortran retval = size(A[, dim[, kind]]) integer function size(x) ``` ### Arguments `A` the input array of any type or rank. `dim` optional dimension, if present, `size` returns the size of this dimension. `kind` optional the kind of the return value. ### Return values `n` the size of an array (integer). ## Description The `size` intrinsic function returns the size of an array. It returns the product of all dimensions, unless the `dim` argument is specified, in which case it only returns the size of this particular dimension. The `kind` argument can be used to specify the integer kind of the result. ## Types Supported argument type is integer. ## Examples ```fortran program intrinsics_size implicit none real :: A(3, 4) print *, size(A) print *, size(A, 2) end program ``` **Result**: ``` 12 4 ``` ## See Also [shape](), [reshape](). lfortran-lfortran-2f73434/doc/src/intrinsics/array.md0000664000175000017500000000012615141516316023013 0ustar alastairalastair# Array Intrinsic Functions ```{toctree} array/allocated array/cshift array/size ``` lfortran-lfortran-2f73434/doc/src/intrinsics/numeric.md0000664000175000017500000000041115141516316023334 0ustar alastairalastair# Numeric Intrinsic Functions ```{toctree} numeric/abs numeric/aimag numeric/aint numeric/anint numeric/ceiling numeric/cmplx numeric/conjg numeric/digits numeric/dim numeric/epsilon numeric/erf numeric/erfc numeric/exp numeric/floor numeric/gamma numeric/mod ``` lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/0000775000175000017500000000000015141516316023016 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/numeric/cmplx.md0000664000175000017500000000325115141516316024464 0ustar alastairalastair# cmplx(x [, [, kind]]): Convert to Complex Conversion to complex type. ## Declaration ### Syntax ```fortran retval = cmplx(x, y) #define CMPLX(x, y) ``` `cmplx(x, y)` is one of the intrinsic present in ASR. ### Arguments `x` the input value must be of integer, real, or complex. `y` the optional input value must be of type integer or real. It should be only present in case `x` is not complex. `kind` the optional input value of integer expression type for initialisation indicating the kind parameter of the result. ### Return values The return value is of complex type, with a kind defined by input `kind` type specified. If the `kind` is not specified, the return value is of default `kind` `complex` type. ## Description **cmplx(x, [, y [, kind]])** converts the input value to complex representation: `x` to real component of complex number. if `y` is present, it is converted to the imaginary component. If `y` is not present, the imaginary component is set to 0.0. If `x` is complex then `y` must not be present. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ $i$ the imaginary part is the result. ## Types Supported argument types are integer, real, or complex. ```c #define _Imaginary_I (I) #define CMPLX(x, y) ((double complex)((double)(x) + _Imaginary_I * (double)(y))) #define CMPLXF(x, y) ((float complex)((float)(x) + _Imaginary_I * (float)(y))) #define CMPLXL(x, y) ((long double complex)((long double)(x) + \ _Imaginary_I * (long double)(y))) ``` ## Examples ```fortran program intrinsics_cmplx implicit none print *, cmplx(1.0, -3.0) end program ``` **Result:** ``` 1 - 3i ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/exp.md0000664000175000017500000000203515141516316024134 0ustar alastairalastair# exp(x): Exponential Exponential function. ## Declaration ### Syntax ```fortran retval = exp(x) elemental real function exp(x) ``` ### Arguments `x` the input value must be of type real or complex. ### Return values The return value is of same type as of the input argument, `x`. ## Description **exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$. If `x` is of type complex, its imaginary part is considered as a value in radians. ## Types Supported argument types is real and complex. ```fortran interface exp module procedure sexp, dexp, cexp, zexp end interface contains elemental real(sp) function sexp(x) real(sp), intent(in) :: x end function elemental real(dp) function dexp(x) real(dp), intent(in) :: x end function elemental complex(sp) function cexp(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zexp(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_exp print *, exp(0.5) end program ``` **Result:** ``` 1.64872 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/ceiling.md0000664000175000017500000000167215141516316024760 0ustar alastairalastair# ceiling(x): Integer Ceiling Integer ceiling function ## Declaration ### Syntax ```fortran retval = ceiling(x) elemental integer function ceiling(x) ``` ### Arguments The input value `x` may be of type real or integer. ### Return values The return value is of type integer and nearest greater integer. ## Description **ceiling(x)** returns the least integer greater than or equal to `x`. ## Types Supported input parameter types are integer and real. ```fortran interface ceiling module procedure sceiling, dceiling end interface contains elemental integer function sceiling(x) real(sp), intent(in) :: x end function elemental integer function dceiling(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_ceiling implicit none real :: x = 63.29 print *, ceiling(x) print *, ceiling(-63.29) end program ``` **Result:** ``` 64 -63 ``` ## See Also [floor](floor.md), [mod](mod.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/aint.md0000664000175000017500000000176015141516316024277 0ustar alastairalastair# aint(x, [kind]): Truncate to a Whole Number Truncate to a whole number. ## Declaration ### Syntax ```fortran retval = aint(x, [kind]) elemental real function aint(x, [kind]) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter initialises the kind of the result. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind real is returned. The return value is equal to or nearest largest whole number greater than or equal to `x` not exceeding its magnitude. ## Description **aint(x)** returns the nearest largest whole number greater than or equal to `x` not exceeding input value's magnitude. The optional parameter `kind` specifies the kind of the result. ## Types Supported argument types is real. ## Examples ```fortran program intrinsics_aint print *, aint(3.1) print *, floor(-3.1) end program ``` **Result:** ``` 3 -3 ``` ## See Also [ceiling](ceiling.md), [mod](mod.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/aimag.md0000664000175000017500000000206115141516316024415 0ustar alastairalastair# aimag(x): Imaginary Part Imaginary part of complex number. ## Declaration ### Syntax ```fortran retval = aimag(x) elemental real(sp) function aimag(x) elemental real(dp) function aimag(x) ``` ### Arguments `x` the input value must be of complex type. ### Return values The return value is imaginary part of type real and kind same as of `x`. ## Description **aimag(x)** returns the imaginary part of the input complex argument `x`. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ $i$ the imaginary part is the result. ## Types Supported argument types are complex. ```fortran interface aimag module procedure saimag, daimag end interface contains elemental real(sp) function saimag(x) complex(sp), intent(in) :: x end function elemental real(dp) function daimag(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_aimag implicit none print *, aimag(1.0, -3.0) end program ``` **Result:** ``` -3.0 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/mod.md0000664000175000017500000000330315141516316024116 0ustar alastairalastair# mod(x, y): Modulus Modulus or remainder function. ## Declaration ### Syntax ```fortran retval = mod(x, y) elemental integer function imod(x, y) elemental real(sp) function mod(x, y) ``` ### Arguments `x` the input value, can be integer or real. `y` second input parameter should be same type and kind as `x` and not equal to 0. ### Return values The return value is of type and kind same as of `x`. The result is calculated using mathematical modulo or remainder as: `x - INT (x / y) * y`. If `y` is 0, the result is undefined like `any integer value / 0`. ## Description **mod(x, y)** calculates and returns modulo or remainder when `x` is divided by `y`. The result is calculated using `x - INT(x / y) * y` i.e., result is remainder when first argument is mathematically divided by second argument. The return value should be less than `y`. ## Types Supported argument types are real and integer. ```fortran interface mod module procedure i8mod, i16mod, imod, i64mod, smod, dmod end interface contains elemental integer(i16) function i16mod(x, y) integer(i16), intent(in) :: x, y end function elemental integer(i8) function i8mod(x, y) integer(i8), intent(in) :: x, y end function elemental integer function imod(x, y) integer, intent(in) :: x, y end function elemental integer function i64mod(x, y) integer(i64), intent(in) :: x, y end function elemental real(sp) function smod(x, y) real(sp), intent(in) :: x, y end function elemental real(dp) function dmod(x, y) real(dp), intent(in) :: x, y end function ``` ## Examples ```fortran program intrinsics_mod implicit none print *, mod(-5, 3) end program ``` **Result:** ``` -2 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/epsilon.md0000664000175000017500000000152215141516316025011 0ustar alastairalastair# epsilon(x): Epsilon Epsilon function. ## Declaration ### Syntax ```fortran retval = epsilon(x) elemental real function epsilon(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of same type as of the input argument. ## Description **epsilon(x)** computes the smallest number $\epsilon$ of the same kind as `x` following: $1 + \epsilon > 1$ ## Types Supported argument types is real. ```fortran interface epsilon module procedure sepsilon, depsilon end interface contains elemental real(sp) function sepsilon(x) real(sp), intent(in) :: x end function elemental real(dp) function depsilon(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_epsilon print *, epsilon(3.143) end program ``` **Result:** ``` 1.19209290E-07 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/floor.md0000664000175000017500000000310215141516316024455 0ustar alastairalastair# floor(x, kind): Integer Floor Integer floor function. ## Declaration ### Syntax ```fortran retval = floor(x) elemental integer function floor(x, kind) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter must be a scalar integer constant expression. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind integer is returned. The return value is equal to or nearest greatest integer less than or equal to `x`. ## Description **floor(x)** returns the greatest integer less than or equal to x. It returns an integer value unless spefically specified using second optional paramter. ## Types Supported argument types is real. ```fortran interface floor module procedure sfloor_i32, sfloor_i64, dfloor_i32, dfloor_i64 end interface contains elemental integer(i32) function sfloor_i32(x, kind) real(sp), intent(in) :: x integer(i32), intent(in) :: kind end function elemental integer(i64) function sfloor_i64(x, kind) real(sp), intent(in) :: x integer(i64), intent(in) :: kind end function elemental integer(i32) function dfloor_i32(x, kind) real(dp), intent(in) :: x integer(i32), intent(in) :: kind end function elemental integer(i64) function dfloor_i64(x, kind) real(dp), intent(in) :: x integer(i64), intent(in) :: kind end function ``` ## Examples ```fortran program intrinsics_floor implicit none real, parameter :: x = 3.1 print *, floor(x) print *, floor(-3.1) end program ``` **Result:** ``` 3 -4 ``` ## See Also [ceiling](ceiling.md), [mod](mod.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/abs.md0000664000175000017500000000311615141516316024106 0ustar alastairalastair# abs(x): Absolute Value Absolute value. ## Declaration ### Syntax ```fortran retval = abs(x) elemental integer function iabs(x) elemental real(sp) function abs(x) ``` ### Arguments `x` the input value, can be integer, real, or complex. ### Return values The return value is of type and kind same as of `x`. For complex input value, return value is real. ## Description **abs(x)** calculates and returns absolute value of `x`. Result is calculated using mathematical formula: $|x|$ If `x` is complex, the result is calculated using mathematical formula: $\sqrt{(x^2 + y^2)}$ ## Types Supported argument types are real and integer. ```fortran interface mod module procedure iabs, i8abs, i16abs, i64abs, sabs, dabs, cabs, zabs end interface contains elemental integer(i16) function i16abs(x) integer(i16), intent(in) :: x end function elemental integer(i8) function i8abs(x) integer(i8), intent(in) :: x end function elemental integer function iabs(x) integer, intent(in) :: x end function elemental integer function i64abs(x) integer(i64), intent(in) :: x end function elemental real(sp) function sabs(x) real(sp), intent(in) :: x end function elemental real(dp) function dabs(x) real(dp), intent(in) :: x end function elemental real(sp) function cabs(x) complex(sp), intent(in) :: x end function elemental real(dp) function zabs(x) complex(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_abs implicit none print *, abs(1.5) print *, abs(-1.5) end program ``` **Result:** ``` 1.5 1.5 ``` ## See Also [ceiling](ceiling.md), [floor](floor.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/erf.md0000664000175000017500000000160715141516316024120 0ustar alastairalastair# erf(x): Error Error function. ## Declaration ### Syntax ```fortran retval = erf(x) elemental real function erf(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of type real and of the same kind as of the input parameter `x`. ## Description **erf(x)** computes the error function of `x`. The result lies in the range: $-1 \leq erf (x) \leq 1$ It is calculated using: $\frac{2}{\sqrt\pi}\int_0^xe^{-t^2}dt$ ## Types Supported argument types is real. ```fortran interface erf module procedure serf, derf end interface contains elemental real(sp) function serf(x) real(sp), intent(in) :: x end function elemental real(dp) function derf(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_erf print *, erf(0.5) end program ``` **Result:** ``` 0.520499877 ``` ## See Also [erfc](erfc.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/erfc.md0000664000175000017500000000214615141516316024262 0ustar alastairalastair# erfc(x): Complementary Error Complementary error function. ## Declaration ### Syntax ```fortran retval = erfc(x) elemental real function erfc(x) ``` ### Arguments `x` the input value must be of type real. ### Return values The return value is of type real and of the same kind as of the input parameter `x`. `erfc(x)` returns $1 - erf(x)$. ## Description **erf(x)** computes the error function of `x`. The result lies in the range: $0 \leq erf (x) \leq 2$ It is calculated using: $\frac{2}{\sqrt\pi}\int_{x}^{\infty}e^{-t^2}dt$ It is used in instances when the large loss of relative accuracy occurs if `erf(x)` is called for large `x` and the result is subtracted from 1. ## Types Supported argument types is real. ```fortran interface erfc module procedure serfc, derfc end interface contains elemental real(sp) function serfc(x) real(sp), intent(in) :: x end function elemental real(dp) function derfc(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_erfc print *, erfc(1.0) end program ``` **Result:** ``` 0.1572992057 ``` ## See Also [erf](erf.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/conjg.md0000664000175000017500000000163515141516316024445 0ustar alastairalastair# conjg(x): Complex Conjugate Complex conjugate function. ## Declaration ### Syntax ```fortran retval = conjg(x) function conjgz32(x) function conjgz64(x) ``` ### Arguments `x` the input value must be of type complex. ### Return values The return value is of complex type. ## Description **conjg(x)** converts the input value `x` to its conjugate. For `x` complex input value, the result is calculated using mathematical formula: $x + iy$ converted to $x - iy$ $i$ the imaginary part is the result. ## Types Supported argument types is complex. ```fortran interface conjg module procedure conjgz32, conjgz64 end interface contains function conjgz32(x) complex(sp) :: x end function function conjgz64(x) complex(dp) :: x end function ``` ## Examples ```fortran program intrinsics_conjg implicit none print *, conjg((1.0, -3.0)) end program ``` **Result:** ``` 1 + 3i ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/dim.md0000664000175000017500000000117615141516316024116 0ustar alastairalastair# dim(x, y): Positive Difference or 0 Positive difference or 0. ## Declaration ### Syntax ```fortran retval = dim(x, y) ``` ### Arguments `x` the input value must be of type real or integer. `y` the input value must of of the same type and kind as of `x`. ### Return values The return value is of type integer or real. ## Description **dim(x)** computes the difference $x - y$, if the result is positive, otherwise returns 0. ## Types Supported argument types are real and integer. ## Examples ```fortran program intrinsics_dim print *, dim(2, 3) print *, dim(3, 2) end program ``` **Result:** ``` 0 1 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/anint.md0000664000175000017500000000202015141516316024443 0ustar alastairalastair# anint(x, [kind]): Round to Nearest Whole Number Round to nearest whole number. ## Declaration ### Syntax ```fortran retval = anint(x, [kind]) elemental real function anint(x, [kind]) ``` ### Arguments `x` the input value must be of type real. `kind` the optional input parameter initialises the kind of the result. ### Return values The return value is of type integer(kind) if kind is passed as input parameter. If not, default kind real is returned. The return value is equal to rounded whole number. ## Description **anint(x)** calculates rounded value of input parameter `x`. If `x` is less than or equal to 0 i.e., if `x` is negative or 0, `anint(x)` returns `aint(x - 0.5)`. If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`. The optional parameter `kind` specifies the kind of the result. ## Types Supported argument types is real. ## Examples ```fortran program intrinsics_anint print *, anint(2.6) print *, anint(-2.6) end program ``` **Result:** ``` 3.0 -3.0 ``` ## See Also [aint](aint.md). lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/gamma.md0000664000175000017500000000217315141516316024425 0ustar alastairalastair# gamma(x): Gamma Gamma function. ## Declaration ### Syntax ```fortran retval = gamma(x) elemental real function gamma(x) ``` ### Arguments `x` the input value must be of type real. It should not be zero or a negative integer. ### Return values The return value is of same type and kind as of `x`. ## Description **gamma(x)** computes $\gamma(x)$. For positive, integer value of `x`, the Gamma function simplifies to factorial function: $\gamma(x) = (x-1)!$ In general, if $x > 0$: $\gamma(x) = \int_{0}^{\infty} e^{-t} dt$ and if $-n-1 < x < -n$ where n is an integer >= 0: $\gamma(x) = \int_{0}^{\infty}(e ^{-t} - \sum\limits_{k=0}^n \frac{(-t)^k}{k!} dt)$ ## Types Supported argument types is real. ```fortran interface gamma module procedure sgamma, dgamma end interface contains elemental real(sp) function sgamma(x) real(sp), intent(in) :: x end function elemental real(dp) function dgamma(x) real(dp), intent(in) :: x end function ``` ## Examples ```fortran program intrinsics_gamma print *, gamma(0.5) print *, gamma(1.0) end program ``` **Result:** ``` 1.77245 1.000 ``` ## See Also [epsilon](epsilon.md) lfortran-lfortran-2f73434/doc/src/intrinsics/numeric/digits.md0000664000175000017500000000106615141516316024626 0ustar alastairalastair# digits(x): Significant Binary Digits Significant binary digits. ## Declaration ### Syntax ```fortran retval = digits(x) ``` ### Arguments `x` the input value must be of type real or integer. ### Return values The return value is of type integer. ## Description **digits(x)** returns the number of significant binary digits of the internal mopdel representation of `x`. ## Types Supported argument types are real and integer. ## Examples ```fortran program intrinsics_digits print *, digits(3.1) end program ``` **Result:** ``` 24 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/kind-type.md0000664000175000017500000000010115141516316023572 0ustar alastairalastair# Kind Type Intrinsic Functions ```{toctree} kind-type/kind ``` lfortran-lfortran-2f73434/doc/src/intrinsics/misc/0000775000175000017500000000000015141516316022307 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/misc/cpu_time.md0000664000175000017500000000223515141516316024440 0ustar alastairalastair# cpu_time(x): CPU Elapsed Time CPU elapsed time in seconds. ## Declaration ### Syntax ```fortran retval = cpu_time(x) pure subroutine cpu_time(x) ``` ### Arguments `x` the input value should be of type real with `intent(out)`. ### Return values None. ## Description **cpu_time(time)** returns a real value representing the elapsed CPU time in seconds. If tine source is available, time will be reported with microsecond resolution. If no time source is available, TIME is set to -1.0. This is useful for testing segments of code to determine computation time. For `cpu_time(time)` the absolute value is meaningless, only differences between subsequent calls to this subroutine, as shown in the example below, should be used. ## Types Supported input parameter types is real with `intent(out)`. ```fortran pure subroutine cpu_time(t) real(dp), intent(out) :: t call c_cpu_time(t) end subroutine ``` ## Examples ```fortran program intrinsics_cpu_time implicit none real(dp) :: t1, t2 call cpu_time(t1) print *, "Some computation" call cpu_time(t2) print *, "Total time: ", t2-t1 end program ``` **Result:** ``` Some computation 20 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/misc/command_argument_count.md0000664000175000017500000000124715141516316027365 0ustar alastairalastair# command_argument_count(): Number of Command Line Arguments Get number of command line arguments. ## Declaration ### Syntax ```fortran retval = command_argument_count() function command_argument_count() ``` ### Arguments None. ### Return values The return value is of integer type and of default kind. ## Description **command_argument_count()** returns the number of arguments passed on the command line when the named program was invoked. ## Types Any. ## Examples ```fortran program intrinsics_command_argument_count implicit none print *, command_argument_count() end program ``` **Result:** ``` intrinsics_command_argument_count a b 2 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/misc/date_and_time.md0000664000175000017500000000451715141516316025415 0ustar alastairalastair# date_and_time([date, time, zone, values]): Date and Time Date and time subroutine. ## Declaration ### Syntax ```fortran call date_and_time([date, time, zone, values]) subroutine date_and_time(date, time, zone, values) ``` ### Arguments `date` the input value of character type, which has length 8 or larger. It is of default kind. It is `intent(out)` and has form `ccyymmdd`. `time` the input value of character type, which has length 10 or larger. It is of default kind. It is `intent(out)` and has form `hhmmss.sss`. `zone` the input value of character type, which has length 5 or larger. It is of default kind. It is `intent(out)` and has from `(+-)hhmm`, representing the difference with respect to Coordinates Universal Time (UTC). Unavailable time and date parameters return blanks. `values` the input value of integer type, 8 bits. It is `intent(out)`. It provides the following: - `value(1)`: The year. - `value(2)`: The month. - `value(3)`: The day of the month. - `value(4)`: Time difference with UTC in minutes. - `value(5)`: The hour of the day. - `value(6)`: The minutes of the hour. - `value(7)`: The seconds of the minutes. - `value(8)`: The milliseconds of the second. ### Return values None. ## Description **date_and_time([date, time, zone, values])** reports the corresponding date and time information from the real time system clock. `date`, `time`, `zone`, `values` represents date, time, zone, and values as decribed in arguments above. Unavailable or errorneous date and time parameters return blanks. ## Types Supported input parameter types is real with `intent(out)`. ```fortran subroutine date_and_time(date, time, zone, values) character(len=*), intent(out), optional :: date, time, zone integer, intent(out), optional :: values(8) end subroutine ``` ## Examples ```fortran program intrinsics_date_and_time implicit none character(len=8) :: date character(len=10) :: time character(len=5) :: zone integer,dimension(8) :: values ! using keyword arguments call date_and_time(date,time,zone,values) call date_and_time(date=date,zone=zone) call date_and_time(time=time) call date_and_time(values=values) print '(a,2x,a,2x,a)', date, time, zone print '(8i5)', values end program ``` **Result:** ``` 20220812 075654.679 +0000 2022 8 12 0 7 56 54 679 ``` ## See Also [cpu_time](cpu_time.md). lfortran-lfortran-2f73434/doc/src/intrinsics/misc/new_line.md0000664000175000017500000000157215141516316024436 0ustar alastairalastair# new_line(x): New Line Character New line character. ## Declaration ### Syntax ```fortran retval = new_line(x) function new_line(c) ``` ### Arguments The input parameter `x` must be of type character. It can be a scalar or an array. ### Return values The return value is a character of length one with the new line character appended of the same kind as of `x`. ## Description **new_line(x)** returns the new line character. The return value is the ASCII newline character. ## Types Supported input parameter types is character. ```fortran function new_line(c) result(r) character(len=1), intent(in) :: c character(len=1) :: r end function ``` ## Examples ```fortran program intrinsics_new_line implicit none print *, 'This is record 1.'//new_line('A')//'This is record 2.' end program ``` **Result:** ``` This is record 1.A This is record 2. ``` ## See Also None. lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/0000775000175000017500000000000015141516316024005 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/atan.md0000664000175000017500000000316515141516316025257 0ustar alastairalastair# atan(x): Trigonometric ArcTangent Trigonometric arctangent (inverse arctangent) function. ## Declaration ### Syntax ```fortran retval = atan(x) elemental real(p) function atan(x) elemental complex(p) function atan(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **atan(x)** computes the arctangent of the argument **x**. The arc tangent is the inverse function of the arctangent function. It is commonly used in trigonometry to find the angle when the lengths of the opposite side of a right triangle and base are known, i.e., perpendicular and base length. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface atan module procedure satan, datan, catan, zatan end interface contains interface elemental real(sp) function satan(x) real(sp), intent(in) :: x end function elemental real(dp) function datan(x) real(dp), intent(in) :: x end function elemental complex(sp) function catan(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zatan(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_atan implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = atan(0.84147098) print *, ret_val_x retval_x = atan(x1) print *, ret_val_x end program ``` **Result**: ``` 0.699521642 0.699521642 ``` ## See Also [asin](asin.md), [acos](acos.md). lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/acos.md0000664000175000017500000000311315141516316025252 0ustar alastairalastair# acos(x): Trigonometric Arc Cosine Trigonometric arc cosine (inverse cosine) function. ## Declaration ### Syntax ```fortran retval = acos(x) elemental real(p) function acos(x) elemental complex(p) function acos(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **acos(x)** computes the arcsine of the argument **x**. The arc cosine is the inverse function of the cosine function. It is commonly used in trigonometry to find the angle when the lengths of the hypotenuse and the base side of a right triangle are known. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface acos module procedure sacos, dacos, cacos, zacos end interface contains interface elemental real(sp) function sacos(x) real(sp), intent(in) :: x end function elemental real(dp) function dacos(x) real(dp), intent(in) :: x end function elemental complex(sp) function cacos(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zacos(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_acos implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = acos(0.84147098) print *, ret_val_x retval_x = acos(x1) print *, ret_val_x end program ``` **Result**: ``` 0.570796336 0.570796336 ``` ## See Also [asin](asin.md), [atan](atan.md). lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/asin.md0000664000175000017500000000311615141516316025262 0ustar alastairalastair# asin(x): Trigonometric Arcsine Trigonometric arcsine function. ## Declaration ### Syntax ```fortran retval = asin(x) elemental real(p) function asin(x) elemental complex(p) function asin(x) ``` ### Arguments `x` the input value, can be real or complex; less than or equal to 1. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **asin(x)** computes the arcsine of the argument **x**. The arcsine is the inverse function of the sine function. It is commonly used in trigonometry to find the angle when the lengths of the hypotenuse and the opposite side of a right triangle are known. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface asin module procedure sasin, dasin, casin, zasin end interface contains interface elemental real(sp) function sasin(x) real(sp), intent(in) :: x end function elemental real(dp) function dasin(x) real(dp), intent(in) :: x end function elemental complex(sp) function casin(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zasin(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_asin implicit none integer, parameter :: arg_x = kind(0.0) real(arg_x) :: x1 real :: retval_x real :: arg_x retval_x = asin(0.84147098) print *, ret_val_x retval_x = asin(x1) print *, ret_val_x end program ``` **Result**: ``` 0.99999 0.99999 ``` ## See Also [acos](acos.md), [atan](atan.md). lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/fraction.md0000664000175000017500000000141715141516316026137 0ustar alastairalastair# fraction(x): Fractional Part in Model Representation Fractional part of the model representation. ## Declaration ### Syntax ```fortran retval = fraction(x) elemental real(p) function fraction(x) ``` ### Arguments `x` the input value, must be real. ### Return values The returned value has the kind of the input value. The fractional part of the model representation of the input value is returned. ## Description **fraction(x)** computes the fractional part of the model representation of **x**. It is calculated using: $x * {radix(x)}^{(-exponent(x))}$ ## Types Supported argument type is real. ## Examples ```fortran program intrinsics_fraction implicit none real :: x = 3.0 print *, fraction(x) end program ``` **Result**: ``` 0.75 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/asinh.md0000664000175000017500000000277115141516316025440 0ustar alastairalastair# asinh(x): Inverse Hyperbolic Arcsine Inverse hyperbolic arcsine function. ## Declaration ### Syntax ```fortran retval = asinh(x) elemental real(p) function asinh(x) elemental complex(p) function asinh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **asinh(x)** computes the inverse hyperbolic arcsine function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the real part is non-negative, and the imaginary part is expressed in radians and lies in the range $\frac{-\pi}{2} <= aimag (asinh(x)) <= \frac{\pi}{2}$ ## Types Supported argument types float, double, complex float, complex double. ```fortran interface asinh module procedure sasinh, dasinh, casinh, zasinh end interface contains interface elemental real(sp) function sasinh(x) real(sp), intent(in) :: x end function elemental real(dp) function dasinh(x) real(dp), intent(in) :: x end function elemental complex(sp) function casinh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zasinh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_asinh implicit none print *, asinh(1.0) end program ``` **Result**: ``` -0.88137 ``` ## See Also [acosh](acosh.md), [atanh](atanh.md). lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/atan2.md0000664000175000017500000000341315141516316025335 0ustar alastairalastair# atan2(y, x): ArcTangent Arctangent function or inverse tangent function. ## Declaration ### Syntax ```fortran retval = atan2(y, x) elemental real(p) function atan2(y, x) ``` ### Arguments `y` the input value is the imaginary part of the complex expression $x + iy$ `x` the input value, must be real part of the complex expression. ### Return values The returned value has the kind and TYPE as of the input value `y`. The principal value of the argument function of the complex expression $x + iy$ is returned. ## Description **atan2(y, x)** computes the principal value of the argument function of the complex expression $x + iy$. This is used to transform from cartesian into polar coordinates and allows to determine the angle in the correct quadrant. It is also represented as: $tan^{-1}(\frac{y}{x})$ If `x` is nonzero, the result lies in the range: $-\pi <= atan(x) <= \pi$ The sign is positive if `y` is positive. If `y` is zero and `x` is strictly positive, then the result is 0. If `x` is negative and `y` is positive zero, then the result is $\pi$. If `x` is negative and `y` is negative zero, then the result is $-\pi$. If `x` is zero, then the magnitude of the result is $\frac{\pi}{2}$. If `y` is negative real zero, the result is $\frac{-\pi}{2}$. ## Types Supported argument type is real. ```fortran interface atan2 module procedure satan2, datan2 end interface contains interface elemental real(sp) function satan2(y, x) real(sp), intent(in) :: y, x end function elemental real(dp) function datan2(y, x) real(dp), intent(in) :: y, x end function end interface ``` ## Examples ```fortran program intrinsics_atan2 implicit none print *, atan2(2.679676, 1.0) end program ``` **Result**: ``` 0.699521642 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/atanh.md0000664000175000017500000000302715141516316025424 0ustar alastairalastair# atanh(x): Inverse Hyperbolic Tangent Inverse hyperbolic tangent function. ## Declaration ### Syntax ```fortran retval = atanh(x) elemental real(p) function atanh(x) elemental complex(p) function atanh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **atanh(x)** computes the inverse hyperbolic tangent function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the imaginary part is expressed in radians and lies in the range $\frac{-\pi}{2} <= aimag (atanh(x)) <= \frac{\pi}{2}$ If the result is real, it lies in the range $-1.0 < atanh(x) < 1.0$ ## Types Supported argument types float, double, complex float, complex double. ```fortran interface atanh module procedure satanh, datanh, catanh, zatanh end interface contains interface elemental real(sp) function satanh(x) real(sp), intent(in) :: x end function elemental real(dp) function datanh(x) real(dp), intent(in) :: x end function elemental complex(sp) function catanh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zatanh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_atanh implicit none print *, atanh(0.0) end program ``` **Result**: ``` 0.0 ``` ## See Also [asinh](asinh.md), [acosh](acosh.md). lfortran-lfortran-2f73434/doc/src/intrinsics/mathematical/acosh.md0000664000175000017500000000334115141516316025425 0ustar alastairalastair# acosh(x): Inverse Hyperbolic Cosine Inverse hyperbolic cosine function. ## Declaration ### Syntax ```fortran retval = acosh(x) elemental real(p) function acosh(x) elemental complex(p) function acosh(x) ``` ### Arguments `x` the input value, can be real with value greater than or equal to 1 or of type complex. ### Return values The returned value has the kind of the input value and TYPE may be real or complex. ## Description **acosh(x)** computes the inverse hyperbolic cosine function of **x**. The result type and kind are the same as input value `x`. If the result is complex, the real part is non-negative, and the imaginary part is expressed in radians and lients in the range $-\pi <= img (acosh(x)) <= \pi$ For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine satisifies: $cosh^{-1}(x) = \log(x + \sqrt{(x^2 - 1)})$ For complex numbers $x = x + iy$, as well as real values in the domain $-\infty < z <= 1$, the call $acosh(z)$ returns complex results. ## Types Supported argument types float, double, complex float, complex double. ```fortran interface acosh module procedure sacosh, dacosh, cacosh, zacosh end interface contains interface elemental real(sp) function sacosh(x) real(sp), intent(in) :: x end function elemental real(dp) function dacosh(x) real(dp), intent(in) :: x end function elemental complex(sp) function cacosh(x) complex(sp), intent(in) :: x end function elemental complex(dp) function zacosh(x) complex(dp), intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_acosh implicit none print *, acosh(1.0) end program ``` **Result**: ``` 0.0 ``` ## See Also [asinh](asinh.md), [atanh](atanh.md). lfortran-lfortran-2f73434/doc/src/intrinsics/misc.md0000664000175000017500000000020115141516316022622 0ustar alastairalastair# Miscellaneous Intrinsic Functions ```{toctree} misc/command_argument_count misc/cpu_time misc/date_and_time misc/new_line ``` lfortran-lfortran-2f73434/doc/src/intrinsics/bit/0000775000175000017500000000000015141516316022132 5ustar alastairalastairlfortran-lfortran-2f73434/doc/src/intrinsics/bit/shiftl.md0000664000175000017500000000307415141516316023751 0ustar alastairalastair# shiftl(x, shift): Shift Left Logical shift left function. ## Declaration ### Syntax ```fortran retval = shiftl(int(number), 31); integer(int32) function shiftli32(i, shift) ``` ### Arguments `x` is an integer input value. `shift` an unsigned integer value less than or equal to the bit size of `x`. The possible values are 7, 31, and 63. ### Return values The return value is of type integer and of the same kind as `x`. ## Description **shiftl(x, shift)** logically left shifts `x` by `shift` number of bits. `shiftl` shifts from LSB(**L**east **S**ignificant **B**it) to MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end i.e., MSB bits are lost. Zeroes are appended to the opposite right end. ## Types Supported types in unsigned integer value `x` and unsigned integer value `shift` from (7, 31, 63) less than or equal to bit size of `x`. ``` interface shiftl module procedure shiftli8, shiftli32, shiftli64 end interface contains interface integer(int8) function shiftli8(i, shift) result(r) integer(int8), intent(in) :: i integer :: shift end function integer(int32) function shiftli32(i, shift) result(r) integer(int32) :: i integer :: shift end function integer(int64) function shiftli64(i, shift) result(r) integer(int64) :: i integer :: shift end function end interface ``` ## Examples ```fortran program intrinsics_shiftl implicit none integer, parameter :: x = kind(2) integer :: retval retval = shiftl(int(x), 7) print *, retval end program ``` **Result:** ``` 4 ``` ## See Also [shiftr](shiftr.md). lfortran-lfortran-2f73434/doc/src/intrinsics/bit/shiftr.md0000664000175000017500000000307715141516316023762 0ustar alastairalastair# shiftr(x, shift): Shift Right Logical shift right function. ## Declaration ### Syntax ```fortran retval = shiftr(int(number), 31); integer(int32) function shiftri32(i, shift) ``` ### Arguments `x` is an integer input value. `shift` an unsigned integer value less than or equal to the bit size of `x`. The possible values are 7, 31, and 63. ### Return values The return value is of type integer and of the same kind as `x`. ## Description **shiftr(x, shift)** logically right shifts `x` by `shift` number of bits. `shiftr` shifts from MSB(**M**ost **S**ignificant **B**it) to LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end i.e., LSB bits are lost. Zeroes are appended to the opposite left end. ## Types Supported types in unsigned integer value `x` and unsigned integer value `shift` from (7, 31, 63) less than or equal to bit size of `x`. ``` interface shiftr module procedure shiftri8, shiftri32, shiftri64 end interface contains interface integer(int8) function shiftri8(i, shift) result(r) integer(int8), intent(in) :: i integer :: shift end function integer(int32) function shiftri32(i, shift) result(r) integer(int32) :: i integer :: shift end function integer(int64) function shiftri64(i, shift) result(r) integer(int64) :: i integer :: shift end function end interface ``` ## Examples ```fortran program intrinsics_shiftr implicit none integer, parameter :: x = kind(4) integer :: retval retval = shiftr(int(x), 7) print *, retval end program ``` **Result:** ``` 2 ``` ## See Also [shiftl](shiftl.md). lfortran-lfortran-2f73434/doc/src/intrinsics/bit/blt.md0000664000175000017500000000175715141516316023247 0ustar alastairalastair# blt(x, y): Bitwise Less Than Bitwise less than. ## Declaration ### Syntax ```fortran retval = blt(x, y); elemental logical function btt(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `blt(x, y)` calculates if one integer input values is bitwise less than the other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface blt module procedure blt32, blt64 end interface contains interface elemental logical function blt32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function blt64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_blt implicit none print *, blt(10, 4) print *, blt(10, -4) end program ``` **Result:** ``` false true ``` ## See Also [bge](bge.md), [ble](ble.md), [bgt](bgt.md). lfortran-lfortran-2f73434/doc/src/intrinsics/bit/bit_size.md0000664000175000017500000000134715141516316024271 0ustar alastairalastair# bit_size(x): Bit Size Bit size. ## Declaration ### Syntax ```fortran retval = bit_size(x); elemental logical function bit_size(x) ``` ### Arguments `x` is integer input value. ### Return values The return value is of type integer. ## Description `bit_size(x)` calculates the number of bits including sign bit of binary representation of `x`. ## Types Supported input types is integer. ``` module lfortran_intrinsic_builtin implicit none contains interface integer function bit_size(x) integer, intent(in) :: x end function end interface ``` ## Examples ```fortran program intrinsics_bit_size implicit none print *, bit_size(123) print *, bit_size(-1) end program ``` **Result:** ``` 32 32 ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/bit/ble.md0000664000175000017500000000204215141516316023214 0ustar alastairalastair# bge(x, y): Bitwise Less or Equal Bitwise less than or equal to. ## Declaration ### Syntax ```fortran retval = ble(x, y); elemental logical function ble(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `ble(x, y)` calculates if one integer input values is bitwise less than or equal to other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface ble module procedure ble32, ble64 end interface contains interface elemental logical function ble32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function ble64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_ble implicit none print *, ble(10, 4) print *, ble(10, -4) print *, ble(10, 10) end program ``` **Result:** ``` false true true ``` ## See Also [bgt](bgt.md), [bge](bge.md), [blt](blt.md). lfortran-lfortran-2f73434/doc/src/intrinsics/bit/bgt.md0000664000175000017500000000177015141516316023235 0ustar alastairalastair# bgt(x, y): Bitwise Greater Than Bitwise greater than. ## Declaration ### Syntax ```fortran retval = bgt(x, y); elemental logical function bgt(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `bgt(x, y)` calculates if one integer input values is bitwise greater than the other. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface bgt module procedure bgt32, bgt64 end interface contains interface elemental logical function bgt32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function bgt64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_bgt implicit none print *, bgt(10, 4) print *, bgt(10, -4) end program ``` **Result:** ``` true false ``` ## See Also [bge](bge.md), [ble](ble.md), [blt](blt.md). lfortran-lfortran-2f73434/doc/src/intrinsics/bit/btest.md0000664000175000017500000000227515141516316023603 0ustar alastairalastair# btest(x, pos): Bit Test at Position Bit test. ## Declaration ### Syntax ```fortran retval = btest(x, pos); elemental logical function btest(x, pos) ``` ### Arguments `x` and `pos` are integer input values. Both input values are of same kind. `pos` represents position in `x`. ### Return values The return value is of type logical. ## Description `btest(x, pos)` calculates if `pos` bit in input integer value `x` is set. The counting of the bits starts at 0, at least significant bit (LSB) i.e., the rightmost bit in `x`. If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors with not allowed message. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface btest module procedure btest32, btest64 end interface contains interface elemental logical function btest32(x, pos) integer(int32), intent(in) :: x integer, intent(in) :: pos end function elemental logical function btest64(x, pos) integer(int64), intent(in) :: x integer, intent(in) :: pos end function end interface ``` ## Examples ```fortran program intrinsics_btest implicit none print *, btest(2, 0) end program ``` **Result:** ``` false ``` ## See Also lfortran-lfortran-2f73434/doc/src/intrinsics/bit/bge.md0000664000175000017500000000205515141516316023213 0ustar alastairalastair# bge(x, y): Bitwise Greater or Equal Bitwise greater than or equal to. ## Declaration ### Syntax ```fortran retval = bge(x, y); elemental logical function bge(x, y) ``` ### Arguments `x` and `y` are integer input values. Both input values are of same kind. ### Return values The return value is of type logical and of the default kind. ## Description `bge(x, y)` calculates if two integer input values is bitwise greater than or equal to another. ## Types Supported input types is integer of 32 bit and 64 bit size. ``` interface bge module procedure bge32, bge64 end interface contains interface elemental logical function bge32(x, y) integer(int32), intent(in) :: x, y end function elemental logical function bge64(x, y) integer(int64), intent(in) :: x, y end function end interface ``` ## Examples ```fortran program intrinsics_bge implicit none print *, bge(10, 4) print *, bge(10, -4) print *, bge(10, 10) end program ``` **Result:** ``` true false true ``` ## See Also [bgt](bgt.md), [ble](ble.md), [blt](blt.md). lfortran-lfortran-2f73434/doc/src/progress.md0000664000175000017500000005264115141516316021365 0ustar alastairalastair# LFortran Development Status This page documents what Fortran features are supported by LFortran. For each feature we list a short description, the filename with the test and current status for each parts of the compiler: * AST: The code can be parsed to AST (`lfortran --show-ast test.f90`) * ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`) * LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`) * BIN: The LLVM IR can compile to a binary * RUN: The binary runs without errors If all are green it means the feature fully works and you can use it in your codes. Otherwise you can see what the status is of each feature. This page is generated automatically using the [Compiler Tester](https://gitlab.com/lfortran/compiler_tester) repository which contains all the Fortran tests and scripts to run LFortran to produce the tables below. We are looking for contributors to contribute more tests. Our goal is to have a comprehensive Fortran testsuite that can be used to test any Fortran compiler. Testing the LFortran compiler version: ```console $ lfortran --version LFortran version: 0.12.0-491-gaf48ff273 Platform: macOS Default target: x86_64-apple-darwin20.3.0 ``` # Topics ## Full programs that compute something interesting ### Basic Numerics Directory: `tests/programs/numerics` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Pure Fortran sin(x) implementation` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90) | ## Modules ### Basic Usage Directory: `tests/modules/basic` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Basic modules` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90) | ### Module Functions and Subroutines Directory: `tests/modules/procedures` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Module functions` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90) | | `Module subroutines` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90) | | `Nested subroutines` | ✅ | ✅ | ✅ | ✅ | ✅ | [t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90) | ## Expressions ### Arithmetic Operations Directory: `tests/expressions/arit` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `+,-,*,/,**` | ✅ | ✅ | ✅ | ✅ | ✅ | [basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90) | ### Integers Directory: `tests/expressions/integers` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `integers` | ✅ | ✅ | ✅ | ✅ | ✅ | [integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90) | | `relational operations` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90) | | `logical operations` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90) | ### Real Numbers Directory: `tests/expressions/reals` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `single/double reals` | ✅ | ✅ | ✅ | ✅ | ✅ | [real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90) | | `defined operator` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90) | ### Complex Numbers Directory: `tests/expressions/complex` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90) | ### Strings Directory: `tests/expressions/character` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `character` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90) | | `string concatenation` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90) | ### Derived Types Directory: `tests/expressions/derived_type` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `basic derived types` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90) | ## Statements ### Allocate Statement Directory: `tests/statements/allocate` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `allocate statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90) | ### Block Statement Directory: `tests/statements/block` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `block statement` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90) | ### Goto Statement Directory: `tests/statements/goto` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `computed go-to statement` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90) | | `go-to statement` | ✅ | ❌ | ❌ | ❌ | ❌ | [t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90) | ### If Statement Directory: `tests/statements/if` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Test .false.` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90) | | `single line if statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90) | | `multi line if statement` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90) | | `nested if statements` | ✅ | ✅ | ✅ | ✅ | ✅ | [if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90) | ### While Statement Directory: `tests/statements/while` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Simple while loops` | ✅ | ✅ | ✅ | ✅ | ✅ | [while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90) | | `exit / cycle in while loops` | ✅ | ✅ | ✅ | ✅ | ✅ | [while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90) | ### Print Statement Directory: `tests/statements/print` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `Basic print` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90) | ### Open, Read, Write, Close Statement Directory: `tests/statements/file_io` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `open/read/write/close` | ✅ | ✅ | ❌ | ❌ | ❌ | [t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90) | ## Intrinsic Functions ### abs Directory: `tests/intrinsic/abs` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ❌ | ❌ | ❌ | ❌ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90) | ### exp Directory: `tests/intrinsic/exp` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90) | ### log Directory: `tests/intrinsic/log` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90) | ### sqrt Directory: `tests/intrinsic/sqrt` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ❌ | ❌ | ❌ | ❌ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90) | ### sin Directory: `tests/intrinsic/sin` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ❌ | ❌ | ❌ | ❌ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90) | ### cos Directory: `tests/intrinsic/cos` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90) | ### tan Directory: `tests/intrinsic/tan` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90) | ### sinh Directory: `tests/intrinsic/sinh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90) | ### cosh Directory: `tests/intrinsic/cosh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90) | ### tanh Directory: `tests/intrinsic/tanh` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90) | ### asin Directory: `tests/intrinsic/asin` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90) | ### acos Directory: `tests/intrinsic/acos` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90) | ### atan Directory: `tests/intrinsic/atan` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90) | | `scalar single/double complex` | ✅ | ✅ | ✅ | ✅ | ✅ | [t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90) | ### modulo Directory: `tests/intrinsic/modulo` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90) | | `array 1D single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90) | ### mod Directory: `tests/intrinsic/mod` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90) | | `array 1D single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90) | ### min Directory: `tests/intrinsic/min` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90) | ### max Directory: `tests/intrinsic/max` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90) | ### int Directory: `tests/intrinsic/int` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90) | ### real Directory: `tests/intrinsic/real` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ✅ | ✅ | ✅ | ✅ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90) | ### floor Directory: `tests/intrinsic/floor` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90) | ### nint Directory: `tests/intrinsic/nint` | Description | AST | ASR | LLVM | BIN | RUN | Filename | | ----------- | --- | --- | ---- | --- | --- | -------- | | `scalar single/double real` | ✅ | ❌ | ❌ | ❌ | ❌ | [t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90) | lfortran-lfortran-2f73434/doc/man/0000775000175000017500000000000015141516316017153 5ustar alastairalastairlfortran-lfortran-2f73434/doc/man/CMakeLists.txt0000664000175000017500000000150015141516316021707 0ustar alastairalastair# in tarball if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.1) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # in git repo elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md) find_program(PANDOC_EXECUTABLE NAMES pandoc) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PANDOC REQUIRED_VARS PANDOC_EXECUTABLE) if(PANDOC_FOUND) add_custom_command(OUTPUT lfortran.1 COMMAND ${PANDOC_EXECUTABLE} --standalone --to man ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md -o lfortran.1 COMMENT "Building lfortran manpage" DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lfortran.md) add_custom_target(manpage ALL DEPENDS lfortran.1) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lfortran.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() endif() lfortran-lfortran-2f73434/doc/man/lfortran.md0000664000175000017500000001163215141516316021327 0ustar alastairalastair# NAME LFortran - modern interactive LLVM-based Fortran compiler # SYNOPSIS lfortran [OPTIONS] [files...] [SUBCOMMAND] # DESCRIPTION LFortran is a modern interactive Fortran compiler based on LLVM. # OPTIONS - `-h, --help`: Print this help message and exit - `-S`: Emit assembly, do not assemble or link - `-c`: Compile and assemble, do not link - `-o TEXT`: Specify the file to place the compiler's output into - `-v`: Be more verbose - `-E`: Preprocess only; do not compile, assemble, or link - `-l TEXT ...`: Link library option - `-L TEXT ...`: Library path option - `-I TEXT ...`: Include path - `-J TEXT`: Where to save mod files - `-g`: Compile with debugging information - `-D TEXT ...`: Define `=` (or 1 if `` omitted) - `--version`: Display compiler version information - `-W TEXT ...`: Linker flags - `-f TEXT ...`: All `-f*` flags (only -fPIC supported for now) - `--cpp`: Enable C preprocessing - `--fixed-form`: Use fixed form Fortran source parsing - `--fixed-form-infer`: Use heuristics to infer if a file is in fixed form - `--no-prescan`: Turn off prescan - `--show-prescan`: Show tokens for the given file and exit - `--show-tokens`: Show tokens for the given file and exit - `--show-ast`: Show AST for the given file and exit - `--show-asr`: Show ASR for the given file and exit - `--with-intrinsic-mods`: Show intrinsic modules in ASR - `--show-ast-f90`: Show Fortran from AST for the given file and exit - `--no-color`: Turn off colored AST/ASR - `--no-indent`: Turn off Indented print ASR/AST - `--tree`: Tree structure print ASR/AST - `--json`: Print ASR/AST Json format - `--clojure`: Print ASR in clojure format - `--no-loc`: Skip location information in ASR/AST Json format - `--visualize`: Print ASR/AST Visualization - `--pass TEXT`: Apply the ASR pass and show ASR (implies --show-asr) - `--skip-pass TEXT`: Skip an ASR pass in the default pipeline - `--show-llvm`: Show LLVM IR for the given file and exit - `--show-cpp`: Show C++ translation source for the given file and exit - `--show-c`: Show C translation source for the given file and exit - `--show-asm`: Show assembly for the given file and exit - `--show-wat`: Show WAT (WebAssembly Text Format) and exit - `--show-julia`: Show Julia translation source for the given file and exit - `--show-fortran`: Show Fortran translation source for the given file and exit - `--show-stacktrace`: Show internal stacktrace on compiler errors - `--symtab-only`: Only create symbol tables in ASR (skip executable stmt) - `--time-report`: Show compilation time report - `--static`: Create a static executable - `--no-warnings`: Turn off all warnings - `--no-error-banner`: Turn off error banner - `--continue-compilation`: Collect error messages and continue compilation after encountering semantic errors - `--error-format TEXT=human`: Control how errors are produced (human, short) - `--backend TEXT=llvm`: Select a backend (llvm, cpp, x86, wasm, fortran) - `--openmp`: Enable OpenMP - `--separate-compilation`: Generate object code into .o files - `--rtlib`: Include the full runtime library in the LLVM output - `--use-loop-variable-after-loop`: Allow using loop variable after the loop - `--fast`: Best performance (disable strict standard compliance) - `--link-with-gcc`: Calls GCC for linking instead of clang - `--target TEXT`: Generate code for the given target - `--print-targets`: Print the registered targets - `--implicit-typing`: Allow implicit typing - `--implicit-interface`: Allow implicit interface - `--implicit-argument-casting`: Allow implicit argument casting - `--print-leading-space`: Print leading white space if format is unspecified - `--interactive-parse`: Use interactive parse - `--verbose`: Print debugging statements - `--dump-all-passes`: Apply all the passes and dump the ASR into a file - `--dump-all-passes-fortran`: Apply all passes and dump the ASR after each pass into a Fortran file - `--cumulative`: Apply all the passes cumulatively till the given pass - `--realloc-lhs-arrays`: Reallocate left hand side automatically for arrays - `--disable-realloc-lhs-arrays`: Disables reallocating left hand side automatically for arrays - `--module-mangling`: Mangles the module name - `--global-mangling`: Mangles all the global symbols - `--intrinsic-mangling`: Mangles all the intrinsic symbols - `--all-mangling`: Mangles all possible symbols - `--bindc-mangling`: Mangles functions with ABI bind(c) - `--apply-fortran-mangling`: Mangle symbols with Fortran supported syntax - `--mangle-underscore`: Mangles with underscore - `--legacy-array-sections`: Enables passing array items as sections if required - `--ignore-pragma`: Ignores all the pragmas - `--stack-arrays`: Allocate memory for arrays on stack # SUBCOMMANDS - `fmt`: Format Fortran source files. - `kernel`: Run in Jupyter kernel mode. - `mod`: Fortran mod file utilities. - `pywrap`: Python wrapper generator # SEE ALSO For more information, visit the official LFortran documentation at https://docs.lfortran.org/. lfortran-lfortran-2f73434/doc/.gitignore0000664000175000017500000000002715141516316020367 0ustar alastairalastair*.mo /site/ /_gettext/ lfortran-lfortran-2f73434/doc/build.py0000664000175000017500000001143615141516316020056 0ustar alastairalastair""" Script for conveniently building the documentation in all supported languages. Run this script with: .. code:: python3 build.py You can also pass the language as an argument: .. code:: python3 build.py en de The first language will be handled as the default language. """ import json import sys import subprocess from pathlib import Path from typing import List, Dict root = Path(__file__).parent """ Make sure to run this script from the root of the documentation repository. """ template = """ Page Redirection If you are not redirected automatically, follow the link. """ all_redirects = { "index.html": "{0}/", **{ f"{name}/index.html": f"../{{0}}/{name}/" for name in ( "installation", "language", "progress", "design", "developer_tutorial", "ast_and_asr", "contributing", ) }, **{ f"intrinsics/{name}/index.html": f"../../../{{0}}/intrinsics/{name}/" for name in ( "array/allocated", "array/cshift", "array/size", "bit/bge", "bit/bgt", "bit/bit_size", "bit/ble", "bit/blt", "bit/btest", "bit/shiftl", "bit/shiftr", "bit/rshift", "character/achar", "character/adjustl", "character/adjustr", "character/char", "character/lge", "character/len_trim", "kind-type/kind", "mathematical/acos", "mathematical/acosh", "mathematical/asin", "mathematical/asinh", "mathematical/atan", "mathematical/atan2", "mathematical/atanh", "mathematical/fraction", "misc/command_argument_count", "misc/cpu_time", "misc/date_and_time", "misc/new_line", "numeric/abs", "numeric/aimag", "numeric/aint", "numeric/anint", "numeric/ceiling", "numeric/cmplx", "numeric/conjg", "numeric/digits", "numeric/dim", "numeric/epsilon", "numeric/erf", "numeric/erfc", "numeric/exp", "numeric/floor", "numeric/gamma", "numeric/mod", ) }, } """ All redirects from the original site without language component. """ all_languages: List[str] """ List of currently supported languages, taken from ``doc/src/_static/languages.json``. To support a new language add its `language code`_ to the list. .. _language code: https://www.sphinx-doc.org/en/master/usage/configuration.html#intl-options """ with open(root / "src" / "_static" / "languages.json") as fd: all_languages = list(json.load(fd).values()) def build_docs(language: str) -> None: """ Build the documentation for a single language. Parameters ---------- language : str The language to build the documentation for. """ subprocess.run( [ "sphinx-build", "-b", "dirhtml", str(root / "src"), str(root / "site" / language), f"-Dlanguage={language}", ], cwd=root, ) def build_redirects(redirects: Dict[str, str], language: str) -> None: """ Build the redirects for a single language. Parameters ---------- redirects : Dict[str, str] Page redirects to build. language : str The language to build the redirects for. """ for source, target in redirects.items(): source_path = root / "site" / source redirect = template.format(target.format(language)) if not source_path.parent.exists(): source_path.parent.mkdir(parents=True) with open(source_path, "w", encoding="utf-8") as fd: fd.write(redirect) def build_all(redirects: Dict[str, str], languages: List[str]) -> None: """ Build the documentation for all languages. Parameters ---------- redirects : Dict[str, str] Page redirects to build. languages : List[str] List of languages to build the documentation for. """ for language in languages: build_docs(language) build_redirects(redirects, languages[0]) if __name__ == "__main__": languages = sys.argv[1:] if len(sys.argv) > 1 else all_languages build_all(all_redirects, languages) print() print("Preview the documentation using") print() print(f" python3 -m http.server -d \"{root / 'site'}\"") print() lfortran-lfortran-2f73434/doc/environment.yml0000664000175000017500000000046015141516316021467 0ustar alastairalastairname: lfortran_docs channels: - conda-forge dependencies: - lfortran=0.18.0 - myst-parser=0.18.1 - nbsphinx=0.8.10 - sphinx=5.3.0 - sphinx-intl=2.0.1 - sphinx-copybutton=0.5.0 - pip=22.3.1 - lxml=4.9.1 - unidecode=1.3.6 - python-slugify=7.0.0 - pip: - sphinx-material==0.0.35 lfortran-lfortran-2f73434/pixi.toml0000664000175000017500000000731615141516316017510 0ustar alastairalastair[project] name = "lfortran" version = "0.42.0" description = "Modern interactive LLVM-based Fortran compiler" authors = ["LFortran Maintainers "] channels = ["conda-forge"] platforms = ["osx-arm64", "win-64", "linux-64"] # feature.default.tasks [tasks] start = "src/bin/lfortran" clean = "git clean -dfx -e '.pixi'" [feature.test.tasks] ctest = "cmake --build . --parallel --target test" tests = "./run_tests.py" integration_tests = "cd integration_tests && ./run_tests.py -j16" [feature.llvm7.target.linux-64.host-dependencies] llvmdev = "==7.0.1" [feature.llvm7.target.win-64.host-dependencies] llvmdev = "==7.0.1" [feature.llvm8.target.linux-64.host-dependencies] llvmdev = "==8.0.1" [feature.llvm8.target.win-64.host-dependencies] llvmdev = "==8.0.1" [feature.llvm9.host-dependencies] llvmdev = "==9.0.1" [feature.llvm10.host-dependencies] llvmdev = "==10.0.1" [feature.llvm11.host-dependencies] llvmdev = "==11.1.0" [feature.llvm12.host-dependencies] llvmdev = "==12.0.1" [feature.llvm13.host-dependencies] llvmdev = "==13.0.1" [feature.llvm14.host-dependencies] llvmdev = "==14.0.6" [feature.llvm15.host-dependencies] llvmdev = "==15.0.7" [feature.llvm16.host-dependencies] llvmdev = "==16.0.6" [feature.llvm17.host-dependencies] llvmdev = "==17.0.6" [feature.llvm18.host-dependencies] llvmdev = "==18.1.8" [feature.llvm19.host-dependencies] llvmdev = "==19.1.4" [feature.llvm20.host-dependencies] llvmdev = "==20.1.8" [feature.llvm21.host-dependencies] llvmdev = "==21.1.2" [feature.llvm12.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm13.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm14.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm15.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm16.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm17.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm18.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm19.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm20.target.linux.host-dependencies] libunwind = "==1.7.2" [feature.llvm21.target.linux.host-dependencies] libunwind = "==1.7.2" # Dependencies to build the project to be installed for the target architecture. # host == target [feature.build.host-dependencies] pytest = "==8.1.1" jupyter = "==1.0.0" xeus = "==5.1.0" xeus-zmq = "==3.0.0" nlohmann_json = "==3.11.3" jupyter_kernel_test = "==0.7.0" numpy = "==1.26.4" rapidjson = "==1.1.0" zlib = "*" zstd-static = ">=1.5.6,<2" # Dependencies to build the project to be installed on the build machine. # feature.default.build-dependencies [build-dependencies] python = "==3.12" [feature.build.build-dependencies] python = "==3.12" cmake = "==3.29.1" ninja = "==1.11.1" #cxx-compiler = "*" re2c = "==3.1" [feature.test.build-dependencies] python = "==3.12" toml = "==0.10.2" cmake = "==3.29.1" ninja = "==1.11.1" [feature.build.target.unix.build-dependencies] bison = "==3.4" [feature.build.target.win.build-dependencies] m2-bison = "==3.0.4" [feature.build.tasks] build = "bash ./build1.sh" [environments] llvm7 = {features = ["llvm7", "build"]} llvm8 = {features = ["llvm8", "build"]} llvm9 = {features = ["llvm9", "build"]} llvm10 = {features = ["llvm10", "build"]} llvm11 = {features = ["llvm11", "build"]} llvm12 = {features = ["llvm12", "build"]} llvm13 = {features = ["llvm13", "build"]} llvm14 = {features = ["llvm14", "build"]} llvm15 = {features = ["llvm15", "build"]} llvm16 = {features = ["llvm16", "build"]} llvm17 = {features = ["llvm17", "build"]} llvm18 = {features = ["llvm18", "build"]} llvm19 = {features = ["llvm19", "build"]} llvm20 = {features = ["llvm20", "build"]} llvm21 = {features = ["llvm21", "build"]} test = {features = ["test"]} lfortran-lfortran-2f73434/build_to_wasm.sh0000775000175000017500000000164515141516316021030 0ustar alastairalastair#!/usr/bin/env bash set -ex cmake \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_LLVM=yes \ -DLFORTRAN_BUILD_ALL=yes \ -DWITH_STACKTRACE=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ . cmake --build . -j16 --target install mkdir -p src/bin/asset_dir cp src/runtime/*.mod src/bin/asset_dir git clean -dfx -e src/bin/asset_dir emcmake cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS_DEBUG="-Wall -Wextra -fexceptions" \ -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -fexceptions" \ -DWITH_LLVM=no \ -DLFORTRAN_BUILD_ALL=yes \ -DLFORTRAN_BUILD_TO_WASM=yes \ -DWITH_STACKTRACE=no \ -DWITH_LSP=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ -DCMAKE_EXPORT_COMPILE_COMMANDS=yes \ . cmake --build . -j16 lfortran-lfortran-2f73434/.gitignore0000664000175000017500000001047015141516316017625 0ustar alastairalastair# LFortran src/bin/lfortran src/bin/parse src/bin/parse2 src/bin/parse3 src/lfortran/parser/parser.output tests/output src/lfortran/tests/test_asm src/lfortran/tests/test_ast src/lfortran/tests/test_asr src/lfortran/tests/test_llvm src/lfortran/tests/test_parse src/lfortran/tests/test_pickle src/lfortran/tests/test_stacktrace* src/lfortran/tests/test_serialization* src/lfortran/tests/test_cwrapper src/lfortran/tests/test_serialization src/lfortran/tests/test_lfortran src/lfortran/tests/write32 src/lfortran/tests/write32.asm src/lfortran/tests/subroutines32 src/lfortran/tests/subroutines_args32 src/lfortran/tests/print32 src/lfortran/tests/print_integer src/lfortran/tests/cmp32 src/lfortran/tests/x src/lfortran/tests/ref_pickle.txt.new src/server/lsp_language_server.cpp src/server/lsp_language_server.h src/server/lsp_specification.cpp src/server/lsp_specification.h src/server/lsp_transformer.cpp src/server/lsp_transformer.h **/*.log .#* *.sw? expr2 lfortran-*-dirty/ # fortran_parser build-gfortran build-lfort ## CMake CMakeCache.txt CMakeFiles/ Makefile CTestTestfile.cmake cmake_install.cmake install_manifest.txt Testing/Temporary CPackConfig.cmake CPackSourceConfig.cmake _CPack_Packages /CMakeSettings.json .cmake ## Pixi .pixi/ ## libraries *.a *.a.* *.so *.so.* *.s *.ll *.dylib *.dSYM ## Generated files version lfortran/ast/ast.py lfortran/asr/asr.py lfortran/parser/fortran.tokens lfortran/parser/fortran.interp lfortran/parser/fortranLexer.py lfortran/parser/fortranLexer.tokens lfortran/parser/fortranLexer.interp lfortran/parser/fortranParser.py lfortran/parser/fortranVisitor.py src/lfortran/parser/parser.tab.cc src/lfortran/parser/parser.tab.hh src/lfortran/parser/tokenizer.cpp src/lfortran/parser/preprocessor.cpp src/lfortran/ast.h src/lfortran/asr.h src/libasr/asr.h src/libasr/ast.h src/libasr/asr_base_visitor.h src/libasr/asr_deserialization_visitor.h src/libasr/asr_expr_base_replacer_visitor.h src/libasr/asr_expr_call_replacer_visitor.h src/libasr/asr_expr_stmt_duplicator_visitor.h src/libasr/asr_expr_type_visitor.h src/libasr/asr_expr_value_visitor.h src/libasr/asr_json_visitor.h src/libasr/asr_lookup_name_visitor.h src/libasr/asr_pass_walk_visitor.h src/libasr/asr_pickle_visitor.h src/libasr/asr_serialization_visitor.h src/libasr/asr_stmt_base_replacer_visitor.h src/libasr/asr_tree_visitor.h src/libasr/asr_walk_visitor.h src/libasr/wasm_visitor.h src/libasr/pass/intrinsic_function_registry_util.h src/lfortran/config.h src/libasr/config.h share/jupyter/kernels/fortran/kernel.json share/jupyter/kernels/fortran/logo-svg.svg src/runtime/*.o.empty.c src/runtime/tests/test_abs src/runtime/tests/test_bit src/runtime/tests/test_cos src/runtime/tests/test_hyperbolics src/runtime/tests/test_iso_c_binding src/runtime/tests/test_iso_fortran_env src/runtime/tests/test_kind src/runtime/tests/test_sin src/runtime/tests/test_sin2 src/runtime/tests/test_strings src/runtime/tests/test_tan integration_tests/test-* src/runtime/*.stamp input.txt input inst/ src/libasr/libasr.a.* *.html *.o.tmp.c *.o.tmp.cpp *.tmp.f90 *.clj pass_*.f90 pass_json_*.json pass_tree_*.txt *_lines.txt *_ldd.txt *_lines.dat.txt ### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # Python ## Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class ## C extensions *.so ## Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg *.dat *.mod MANIFEST ## PyTest .pytest_cache/ ## Jupyter *-checkpoint.ipynb ## Editor Files .vscode/ .vs/ *~ ## Build Files */bin/lfortran output *.o *.out *.mod *.smod *.js *.wasm *.data /.ccls-cache/ .cache/ ext/ extsrc/ tmp/ tmpdebug/ gentests/ *.tlog *.filters *.obj *.exe *.exp *.lib *.vcxproj *.recipe *.sln *.dll ## Ninja build.ninja .ninja_deps .ninja_log /compile_commands.json ## Docs doc/man/lfortran.1 !doc/src/javascripts/*.js !pass_array_by_data_*.f90 lfortran-lfortran-2f73434/check_binary_file_in_git_history.py0000664000175000017500000000644015141516316024743 0ustar alastairalastairimport subprocess # Open file_path, Read it with mode 'r' which expects a utf-8 encode. # If the file is binary it'd conflict with # text mode 'r', leading to raised error `UnicodeDecodeError`. def is_file_binary(file_path: str) -> bool: try: with open(file_path, 'r') as fp: fp.read(16) return False except UnicodeDecodeError: return True # Get all commit hashes difference between `origin/main` and current `HEAD` def get_commit_hash_differences() -> list : # Run command `git rev-list origin/main..HEAD` # Use `subporcess.PIPE` as the output buffer to fetch the list of commit hashes completedProcess_object = subprocess.run(["git" ,"rev-list" ,"origin/main..HEAD"], stdout=subprocess.PIPE , text=True) # Create list out of the resulting commit hases. commit_hashes_listed : list = completedProcess_object.stdout.split("\n") if(commit_hashes_listed[-1] == ""): commit_hashes_listed.remove("") # Remove trailing empty string. print("number of commits from current PR branch against origin/main is :", len(commit_hashes_listed)) print (completedProcess_object.stdout) # print the whole string of commit hashes. return commit_hashes_listed # Fetch all files pathes that has beend changed from current `HEAD` against `origin/main`. def get_changed_files() -> list : # Run command `git diff --name-only origin/main --diff-filter=d` # Notice we filter out the deleted files. completedProcess_object = subprocess.run(["git","diff","--name-only","origin/main", "--diff-filter=d"], stdout=subprocess.PIPE, text=True) file_paths : list = completedProcess_object.stdout.split("\n") if(file_paths[-1] == ""): file_paths.remove("") # Remove trailing empty string. return file_paths def run_test() : commit_hashes_list = get_commit_hash_differences() # Run git `checkout` to each commit_hash between `origin/main` --> `HEAD` for commit_hash in commit_hashes_list: subprocess.run(["git","checkout",commit_hash], stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True) print("checked out to commit --> ",commit_hash) file_paths : list = get_changed_files() # fetch changed files from current-checkout-to commit. for file_path in file_paths: if (is_file_binary(file_path)): print("FAIL --- binary file detected") print(f"Binary File Name : ({file_path}) In Commit : ({commit_hash})") raise SystemExit(1) print("OK --- no binary file found") print("\n--------------------------------------------------\n") print("CLEAN : No binary file found in any commit in this PR") print("\n--------------------------------------------------\n") if(len(commit_hashes_list) > 0): print("==> Checking out to latest commit in the PR branch") print("==> Commit hash :", commit_hashes_list[0]) subprocess.run(["git","checkout",commit_hashes_list[0]], stdout=subprocess.PIPE, stderr=subprocess.PIPE,text=True) print("\n--------------------------------------------------\n") print("DONE") run_test() lfortran-lfortran-2f73434/test_lfortran_cmdline0000775000175000017500000000362015141516316022143 0ustar alastairalastair#!/usr/bin/env bash set -e set -x CC=clang if [[ $1 == "" ]]; then echo "Test local lfortran" PATH="$(pwd):$PATH" FC=lfortran elif [[ $1 == "gfortran" ]]; then echo "Test installed gfortran" FC=gfortran elif [[ $1 == "lfortran" ]]; then echo "Test installed lfortran" FC=lfortran else echo "Invalid option" exit 1 fi f=`pwd`/examples/expr2.f90 f1=`pwd`/tests/unordered_linking.f90 add_c=`pwd`/tests/add.c if [[ "$(uname)" == "Linux" ]]; then ASM_PATTERN="movq\|movl\|retq" else ASM_PATTERN="mov\|sp" fi cd $(mktemp -d) $FC $f -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out cd $(mktemp -d) $FC -c $f [ -f "expr2.o" ] [ ! -x "expr2.o" ] $FC -o expr2 expr2.o [ -f "expr2" ] [ -x "expr2" ] ./expr2 cd $(mktemp -d) $FC -o xx1 -c $f [ -f "xx1" ] [ ! -x "xx1" ] $FC -o expr2 xx1 [ -f "expr2" ] [ -x "expr2" ] ./expr2 cd $(mktemp -d) $FC -o xx1 $f [ -f "xx1" ] [ -x "xx1" ] ./xx1 cd $(mktemp -d) $FC -S $f [ -f "expr2.s" ] grep $ASM_PATTERN expr2.s cd $(mktemp -d) $FC -S -c $f [ -f "expr2.s" ] grep $ASM_PATTERN expr2.s cd $(mktemp -d) $FC -S -o xx1 $f [ -f "xx1" ] grep $ASM_PATTERN xx1 cd $(mktemp -d) $FC -S -o xx1 -c $f [ -f "xx1" ] grep $ASM_PATTERN xx1 cd $(mktemp -d) echo "Testing multiple file orders" $CC -c $add_c -o add.o $FC $f1 add.o -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out echo "Reverse the order of f1 and add.o" $CC -c $add_c -o add.o $FC add.o $f1 -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out echo "Compile and run f1 and add_c together" $FC $f1 $add_c -o a.out [ -f "a.out" ] [ -x "a.out" ] ./a.out cd $(mktemp -d) cd $(mktemp -d) echo "Testing incorrect usage" ! $FC nonexistentfile.f90 # ensure this fails cd $(mktemp -d) $FC -c $f1 [ -f "unordered_linking.o" ] [ ! -x "unordered_linking.o" ] cd $(mktemp -d) echo "Testing invalid command-line usage" ! $FC -invalidflag $f1 2>&1 | grep "unrecognized command line option" echo "All tests succeeded" lfortran-lfortran-2f73434/share/0000775000175000017500000000000015141516316016735 5ustar alastairalastairlfortran-lfortran-2f73434/share/lfortran/0000775000175000017500000000000015141516316020564 5ustar alastairalastairlfortran-lfortran-2f73434/share/lfortran/nb/0000775000175000017500000000000015141516316021163 5ustar alastairalastairlfortran-lfortran-2f73434/share/lfortran/nb/Hello World.ipynb0000664000175000017500000000632715141516316024351 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "id": "120bd921", "metadata": {}, "source": [ "In this part of the tutorial, we will write our first Fortran program:\n", "the ubiquitous [\"Hello, World!\"](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) example.\n", "\n", "However, before we can write our program, we need to ensure that we have\n", "a Fortran compiler set up.\n", "\n", "{% include note.html content=\"Fortran is a *compiled language*, which means that, once written, the source code must be passed through a\n", "compiler to produce a machine executable that can be run.\" %}\n", "\n", "## Compiler setup\n", "\n", "In this tutorial, we'll work with the free and open source \n", "[GNU Fortran compiler (gfortran)](https://gcc.gnu.org/fortran/), \n", "which is part of the \n", "[GNU Compiler Collection (GCC)](https://gcc.gnu.org/).\n", "\n", "To install gfortran on Linux, use your system package manager.\n", "On macOS, you can install gfortran using [Homebrew](https://brew.sh/) or [MacPorts](https://www.macports.org/).\n", "On Windows, you can get native binaries [here](http://www.equation.com/servlet/equation.cmd?fa=fortran).\n", "\n", "To check if you have _gfortran_ setup correctly, open a terminal and run the following command:\n", "\n", "```shell\n", "$> gfortran --version\n", "```\n", "\n", "this should output something like:\n", "\n", "```\n", "GNU Fortran 7.5.0\n", "Copyright (C) 2017 Free Software Foundation, Inc.\n", "This is free software; see the source for copying conditions. There is NO\n", "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", "```\n", "\n", "## Hello world\n", "\n", "Once you have set up your compiler, open a new file in your favourite code editor and enter the following:" ] }, { "cell_type": "code", "execution_count": null, "id": "b86b1c01", "metadata": {}, "outputs": [], "source": [ "program hello\n", " ! This is a comment line; it is ignored by the compiler\n", " print *, 'Hello, World!'\n", "end program hello" ] }, { "cell_type": "markdown", "id": "931034bb", "metadata": {}, "source": [ "Having saved your program to `hello.f90`, compile at the command line with:\n", "```shell\n", "$> gfortran hello.f90 -o hello\n", "```\n", "\n", "{% include note.html content=\"`.f90` is the standard file extension for modern Fortran source files.\n", "The 90 refers to the first modern Fortran standard in 1990.\" %}\n", "\n", "To run your compiled program:\n", "```shell\n", "$> ./hello\n", "Hello, World!\n", "```\n", "\n", "Congratulations, you've written, compiled and run your first Fortran program!\n", "In the next part of this tutorial, we will introduce variables for storing data." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 5 } lfortran-lfortran-2f73434/share/lfortran/nb/Operators Control Flow.ipynb0000664000175000017500000002672215141516316026506 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "id": "ef49cdd6", "metadata": {}, "source": [ "One of the powerful advantages of computer algorithms, compared to simple mathematical formulae,\n", "comes in the form of program _branching_ whereby the program can decide which instructions to\n", "execute next based on a logical condition.\n", "\n", "There are two main forms of controlling program flow:\n", "\n", "- _Conditional_ (if): choose program path based on a boolean (true or false) value\n", "\n", "- _Loop_: repeat a portion of code multiple times\n", "\n", "\n", "\n", "## Logical operators\n", "Before we use a conditional branching operator, we need to be able to form\n", "a logical expression.\n", "\n", "To form a logical expression, the following set of relational operators are available:\n", "\n", "| Operator   | Alternative   | Description |\n", "|:----------------:|:---------------------:|-----------------------------------------------------------------|\n", "| `==` | `.eq.` | Tests for equality of two operands |\n", "| `/=` | `.ne.` | Test for inequality of two operands |\n", "| `> ` | `.gt.` | Tests if left operand is strictly greater than right operand |\n", "| `< ` | `.lt.` | Tests if left operand is strictly less than right operand |\n", "| `>=` | `.ge.` | Tests if left operand is greater than or equal to right operand |\n", "| `<=` | `.le.` | Tests if left operand is less than or equal to right operand |\n", "\n", "
\n", "\n", "as well as the following logical operators:\n", "\n", "| Operator   | Description |\n", "|:---------------------:|----------------------------------------------------------------------|\n", "| `.and.` | TRUE if both left and right operands are TRUE |\n", "| `.or.` | TRUE if either left or right or both operands are TRUE |\n", "| `.not.` | TRUE if right operand is FALSE |\n", "| `.eqv.` | TRUE if left operand has same logical value as right operand |\n", "| `.neqv.` | TRUE if left operand has the opposite logical value as right operand |\n", "\n", "
\n", "\n", "\n", "## Conditional construct (`if`)\n", "\n", "In the following examples, a conditional `if` construct is used to print out a\n", "message to describe the nature of the `angle` variable:\n", "\n", "__Example:__ single branch `if`" ] }, { "cell_type": "code", "execution_count": null, "id": "f7093e7b", "metadata": {}, "outputs": [], "source": [ "real :: angle\n", "angle = 40.0\n", "if (angle < 90.0) then\n", " print *, 'Angle is acute'\n", "end if" ] }, { "cell_type": "markdown", "id": "9bc220a8", "metadata": {}, "source": [ "In this first example, the code within the `if` construct is _only executed if_ the\n", "test expression (`angle < 90.0`) is true.\n", "\n", "{% include tip.html content=\"It is good practice to indent code within constructs such as `if` and `do`\n", "to make code more readable.\" %}\n", "\n", "We can add an alternative branch to the construct using the `else` keyword:\n", "\n", "__Example:__ two-branch `if`-`else`" ] }, { "cell_type": "markdown", "id": "f32369ae", "metadata": {}, "source": [ "if (angle < 90.0) then\n", " print *, 'Angle is acute'\n", "else\n", " print *, 'Angle is obtuse'\n", "end if" ] }, { "cell_type": "markdown", "id": "5f77dd83", "metadata": {}, "source": [ "Now there are two _branches_ in the `if` construct, but _only one branch is executed_ depending\n", "on the logical expression following the `if` keyword.\n", "\n", "We can actually add any number of branches using `else if` to specify more conditions:\n", "\n", "__Example:__ multi-branch `if`-`else if`-`else`" ] }, { "cell_type": "markdown", "id": "d64e82ac", "metadata": {}, "source": [ "if (angle < 90.0) then\n", " print *, 'Angle is acute'\n", "else if (angle < 180.0) then\n", " print *, 'Angle is obtuse'\n", "else\n", " print *, 'Angle is reflex'\n", "end if" ] }, { "cell_type": "markdown", "id": "0098c026", "metadata": {}, "source": [ "When multiple conditional expressions are used, each conditional expression is tested only if none of the previous\n", "expressions have evaluated to true.\n", "\n", "## Loop constructs (`do`)\n", "\n", "In the following example, a `do` loop construct is used to print out the numbers in\n", "a sequence.\n", "The `do` loop has an integer _counter_ variable which is used to track which iteration of the loop\n", "is currently executing. In this example we use a common name for this counter variable: `i`.\n", "\n", "When we define the start of the `do` loop, we use our counter variable name followed by an equals (`=`) sign\n", "to specify the start value and final value of our counting variable.\n", "\n", "__Example:__ `do` loop" ] }, { "cell_type": "markdown", "id": "58ec6fd7", "metadata": {}, "source": [ "integer :: i\n", "\n", "do i = 1, 10\n", " print *, i\n", "end do" ] }, { "cell_type": "markdown", "id": "6fbbfa95", "metadata": {}, "source": [ "__Example:__ `do` loop with skip" ] }, { "cell_type": "markdown", "id": "2bdeb053", "metadata": {}, "source": [ "!integer :: i\n", "\n", "do i = 1, 10, 2\n", " print *, i ! Print odd numbers\n", "end do" ] }, { "cell_type": "markdown", "id": "bfe4f4f9", "metadata": {}, "source": [ "### Conditional loop (`do while`)\n", "\n", "A condition may be added to a `do` loop with the `while` keyword. The loop will be executed while the condition given\n", "in `while()` evaluates to `.true.`.\n", "\n", "__Example:__ `do while()` loop" ] }, { "cell_type": "markdown", "id": "b5e483a7", "metadata": {}, "source": [ "!integer :: i\n", "\n", "i = 1\n", "do while (i < 11)\n", " print *, i\n", " i = i + 1\n", "end do\n", "! Here i = 11" ] }, { "cell_type": "markdown", "id": "16b0bf17", "metadata": {}, "source": [ "### Loop control statements (`exit` and `cycle`)\n", "\n", "Most often than not, loops need to be stopped if a condition is met. Fortran provides two executable statements to deal\n", "with such cases.\n", "\n", "`exit` is used to quit the loop prematurely. It is usually enclosed inside an `if`.\n", "\n", "__Example:__ loop with `exit`\n" ] }, { "cell_type": "markdown", "id": "ef39c385", "metadata": {}, "source": [ "!integer :: i\n", "\n", "do i = 1, 100\n", " if (i > 10) then\n", " exit ! Stop printing numbers\n", " end if\n", " print *, i\n", "end do\n", "! Here i = 11" ] }, { "cell_type": "markdown", "id": "a8fc8739", "metadata": {}, "source": [ "On the other hand, `cycle` skips whatever is left of the loop and goes into the next cycle.\n", "\n", "__Example:__ loop with `cycle`\n" ] }, { "cell_type": "markdown", "id": "081a2e77", "metadata": {}, "source": [ "!integer :: i\n", "\n", "do i = 1, 10\n", " if (modulo(i, 2) == 0) then\n", " cycle ! Don't print even numbers\n", " end if\n", " print *, i\n", "end do" ] }, { "cell_type": "markdown", "id": "ae2cc954", "metadata": {}, "source": [ "{% include note.html content=\"When used within nested loops, the `cycle` and `exit` statements operate on the innermost loop.\" %}\n", "\n", "### Nested loop control: tags\n", "\n", "A recurring case in any programming language is the use of nested loops. Nested loops refer to loops that exist within another loop. Fortran allows the programmer to _tag_ or _name_ each loop. If loops are tagged, there are two potential benefits:\n", "1. The readability of the code may be improved (when the naming is meaningful).\n", "2. `exit` and `cycle` may be used with tags, which allows for very fine-grained control of the loops.\n", "\n", "__Example:__ tagged nested loops\n" ] }, { "cell_type": "markdown", "id": "c1194491", "metadata": {}, "source": [ "integer :: i, j\n", "\n", "outer_loop: do i = 1, 10\n", " inner_loop: do j = 1, 10\n", " if ((j + i) > 10) then ! Print only pairs of i and j that add up to 10\n", " cycle outer_loop ! Go to the next iteration of the outer loop\n", " end if\n", " print *, 'I=', i, ' J=', j, ' Sum=', j + i\n", " end do inner_loop\n", "end do outer_loop" ] }, { "cell_type": "markdown", "id": "7791eebf", "metadata": {}, "source": [ "### Parallelizable loop (`do concurrent`)\n", "\n", "The `do concurrent` loop is used to explicitly specify that the _inside of the loop has no interdependencies_; this informs the compiler that it may use parallelization/_SIMD_ to speed up execution of the loop and conveys programmer intention more clearly. More specifically, this means\n", "that any given loop iteration does not depend on the prior execution of other loop iterations. It is also necessary that any state changes that may occur must only happen within each `do concurrent` loop.\n", "These requirements place restrictions on what can be placed within the loop body.\n", "\n", "\n", "{% capture note %}\n", "Simply replacing a `do` loop with a `do concurrent` does not guarantee parallel execution.\n", "The explanation given above does not detail all the requirements that need to be met in order to write a correct `do concurrent` loop.\n", "Compilers are also free to do as they see fit, meaning they may not optimize the loop (e.g., a small number of iterations doing a simple calculation, like the below example).\n", "In general, compiler flags are required to activate possible parallelization for `do concurrent` loops.\n", "{% endcapture %}\n", "{% include important.html content=note %}\n", "\n", "__Example:__ `do concurrent()` loop\n" ] }, { "cell_type": "markdown", "id": "0a8cba44", "metadata": {}, "source": [ "real, parameter :: pi = 3.14159265\n", "integer, parameter :: n = 10\n", "real :: result_sin(n)\n", "integer :: i\n", "\n", "!do concurrent (i = 1:n) ! Careful, the syntax is slightly different\n", "! result_sin(i) = sin(i * pi/4.)\n", "!end do\n", "\n", "!print *, result_sin" ] }, { "cell_type": "markdown", "id": "00950235", "metadata": {}, "source": [] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 5 } lfortran-lfortran-2f73434/share/lfortran/nb/Demo1.ipynb0000664000175000017500000001234215141516316023175 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# LFortran: Interactive Fortran Compiler\n", "\n", "This is a Demo notebook that was [originally used](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c) with the Python prototype of LFortran. The new C++ production implementation can now execute all the cells in the original notebook (and more).\n", "\n", "\n", "## Calculator" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "1+3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(2+3)*3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Global Variables" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer :: i" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer :: j" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "i = 5\n", "j = 6" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "i" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(i+j)*3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Functions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can declare a function and use it in expressions:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer function fn(a, b)\n", "integer, intent(in) :: a, b\n", "fn = a + b\n", "end function" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fn(2, 3)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fn(2, 3)*3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can redeclare a function and it will shadow the old `fn` function. Now `fn(2, 3)` returns a different value:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer function fn2(a, b)\n", "integer, intent(in) :: a, b\n", "fn2 = a - b\n", "end function\n", "\n", "fn2(2, 3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Control Flow, Printing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can use loops, if statements or the `print` function." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer :: k\n", "do k = 1, 4\n", " if (k == 3) cycle\n", " print *, \"variable i =\", k\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plotting" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We are designing how plotting should work in [#209](https://gitlab.com/lfortran/lfortran/-/issues/209). So this prototype code is now commented out:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!integer :: i, tmp\n", "!do i = 1, 4\n", "! tmp = plot(1, i+1, 1)\n", "!end do\n", "!show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Magic Commands" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Compiler" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer :: n\n", "n = 5\n", "j = 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show Abstract Syntax Tree (AST) after parsing (based on syntax only, no semantics):" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showast\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show LLVM code:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showllvm\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show assembly code:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasm\n", "do i = 1, n\n", " j = j + i\n", "end do" ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-lfortran-2f73434/share/lfortran/nb/Variables.ipynb0000664000175000017500000002043015141516316024135 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "id": "fb1c2af4", "metadata": {}, "source": [ "Variables store information that can be manipulated by the program.\n", "Fortran is a _strongly typed_ language, which means that each variable\n", "must have a type.\n", "\n", "There are 5 built-in data types in Fortran:\n", "\n", "* `integer` -- for data that represent whole numbers, positive or negative\n", "* `real` -- for floating-point data (not a whole number)\n", "* `complex` -- pair consisting of a real part and an imaginary part\n", "* `character` -- for text data\n", "* `logical` -- for data that represent boolean (true or false) values\n", "\n", "Before we can use a variable, we must _declare_ it; this tells the compiler\n", "the variable type and any other variable attributes.\n", "\n", "{% include note.html content=\"Fortran is a _statically typed_ language, which means the type of each\n", "variable is fixed when the program is compiled---variable types cannot change while the program is running.\" %}\n", "\n", "## Declaring variables\n", "\n", "The syntax for declaring variables is:\n", "\n", "```\n", " :: \n", "```\n", "\n", "where `` is one of the built-in variable types listed above and\n", "`` is the name that you would like to call your variable.\n", "\n", "Variable names must start with a letter and can consist of letters, numbers and underscores.\n", "In the following example we declare a variable for each of the built-in types.\n", "\n", "__Example:__ variable declaration" ] }, { "cell_type": "code", "execution_count": null, "id": "d0122ca6", "metadata": {}, "outputs": [], "source": [ "integer :: amount\n", "real :: pi\n", "! complex :: frequency\n", "! character :: initial\n", "logical :: isOkay" ] }, { "cell_type": "markdown", "id": "ff8357ec", "metadata": {}, "source": [ "{% include note.html content=\"Fortran code is __case-insensitive__; you don't have to worry about the\n", "capitalisation of your variable names, but it's good practice to keep it consistent.\" %}\n", "\n", "Note the additional statement at the beginning of the program: `implicit none`.\n", "This statement tells the compiler that all variables will be explicitly declared; without \n", "this statement variables will be implicitly typed according to the letter they begin with.\n", "\n", "{% include important.html content=\"Always use the `implicit none` statement at\n", "the beginning of each program and procedure. Implicit typing is considered bad practice in \n", "modern programming since it hides information leading to more program errors.\" %}\n", "\n", "\n", "Once we have declared a variable, we can assign and reassign values to it using the assignment operator `=`.\n", "\n", "__Example:__ variable assignment" ] }, { "cell_type": "code", "execution_count": null, "id": "2f235bec", "metadata": {}, "outputs": [], "source": [ "amount = 10\n", "pi = 3.1415927\n", "! frequency = (1.0, -0.5)\n", "! initial = 'A'\n", "isOkay = .false." ] }, { "cell_type": "markdown", "id": "d125bf4e", "metadata": {}, "source": [ "Characters are surrounded by either single (`'`) or double quotes (`\"`).\n", "\n", "Logical or boolean values can be either `.true.` or `.false.`.\n", "\n", "{% include important.html title=\"Watch out\" content=\"for assignment at declaration: `integer :: amount = 1`. \n", "__This is NOT a normal initialisation;__ it implies the `save` attribute which means that the variable retains\n", "its value between procedure calls. Good practice is to initialise your variables separately to their declaration.\" %}\n", "\n", "\n", "## Standard input / output\n", "\n", "In our _Hello World_ example, we printed text to the command window.\n", "This is commonly referred to as writing to `standard output` or `stdout`.\n", "\n", "We can use the `print` statement introduced earlier to print variable values to `stdout`:" ] }, { "cell_type": "code", "execution_count": null, "id": "be177117", "metadata": {}, "outputs": [], "source": [ "print *, 'The value of amount (integer) is: ', amount\n", "print *, 'The value of pi (real) is: ', pi\n", "! print *, 'The value of frequency (complex) is: ', frequency\n", "! print *, 'The value of initial (character) is: ', initial\n", "print *, 'The value of isOkay (logical) is: ', isOkay" ] }, { "cell_type": "markdown", "id": "f83f2020", "metadata": {}, "source": [ "In a similar way, we can read values from the command window\n", "using the `read` statement:" ] }, { "cell_type": "code", "execution_count": null, "id": "8bb2ed6b", "metadata": {}, "outputs": [], "source": [ "integer :: age\n", "\n", "print *, 'Please enter your age: 5'\n", "! read(*,*) age\n", "age = 5\n", "print *, 'Your age is: ', age" ] }, { "cell_type": "markdown", "id": "3dc90013", "metadata": {}, "source": [ "This input source is commonly referred to as `standard input` or `stdin`.\n", "\n", "\n", "## Expressions\n", "The usual set of arithmetic operators are available, listed in order or precedence:\n", "\n", "| Operator   | Description |\n", "|:----------------:|----------------|\n", "| `**` | Exponent |\n", "| `*` | Multiplication |\n", "| `/ ` | Division |\n", "| `+` | Addition |\n", "| `-` | Subtraction |\n", "\n", "
\n", "\n", "__Example:__" ] }, { "cell_type": "markdown", "id": "1bc66f8e", "metadata": {}, "source": [ "real :: pi\n", "real :: radius\n", "real :: height\n", "real :: area\n", "real :: volume\n", "\n", "pi = 3.1415927\n", "\n", "print *, 'Enter cylinder base radius:'\n", "! read(*,*) radius\n", "radius = 20\n", "\n", "print *, 'Enter cylinder height:'\n", "!read(*,*) height\n", "height = 14\n", "\n", "area = pi * radius**2.0\n", "volume = area * height\n", "\n", "print *, 'Cylinder radius is: ', radius\n", "print *, 'Cylinder height is: ', height\n", "print *, 'Cylinder base area is: ', area\n", "print *, 'Cylinder volume is: ', volume" ] }, { "cell_type": "markdown", "id": "31793287", "metadata": {}, "source": [ "## Floating-point precision\n", "\n", "The desired floating-point precision can be explicitly declared using a `kind` parameter.\n", "The `iso_fortran_env` intrinsic module provides `kind` parameters for the common 32-bit and 64-bit floating-point types.\n", "\n", "__Example:__ explicit real `kind`" ] }, { "cell_type": "markdown", "id": "eae85181", "metadata": {}, "source": [ "! use, intrinsic :: iso_fortran_env, only: sp=>real32, dp=>real64\n", "! real(sp) :: float32\n", "! real(dp) :: float64\n", "\n", "! float32 = 1.0_sp ! Explicit suffix for literal constants\n", "! float64 = 1.0_dp" ] }, { "cell_type": "markdown", "id": "14f447ac", "metadata": {}, "source": [ "{% include important.html content=\"Always use a `kind` suffix for floating-point literal constants.\" %}\n", "\n", "__Example:__ C-interoperable `kind`s" ] }, { "cell_type": "markdown", "id": "2104ad17", "metadata": {}, "source": [ "!use, intrinsic :: iso_c_binding, only: sp=>c_float, dp=>c_double\n", "!real(sp) :: float32\n", "!real(dp) :: float64" ] }, { "cell_type": "markdown", "id": "48bf4d32", "metadata": {}, "source": [ "In the next part we will learn how to use arrays for storing more than one\n", "value in a variable." ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 5 } lfortran-lfortran-2f73434/share/lfortran/nb/Demo2.ipynb0000664000175000017500000001046315141516316023200 0ustar alastairalastair{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# LFortran: Interactive Fortran Compiler\n", "\n", "This Demo notebook shows available magic commands in LFortran and how to use them." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Magic Commands" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Initialize some variables" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "integer :: i, j, n\n", "n = 5\n", "j = 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## AST" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show the Abstract Syntax Tree (AST) after parsing (based on syntax only, no semantics):" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showast\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ASR\n", "\n", "Show the Abstract Semantic Representation (ASR), which contains all the semantics." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasr\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## LLVM\n", "\n", "Show LLVM code:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showllvm\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ASM\n", "\n", "Show assembly code:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showasm\n", "do i = 1, n\n", " j = j + i\n", "end do" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## C++\n", "\n", "Transform Fortran code to C++" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showcpp\n", "subroutine triad(a, b, scalar, c)\n", "real, intent(in) :: a(:), b(:), scalar\n", "real, intent(out) :: c(:)\n", "integer :: N, i\n", "N = size(a)\n", "do concurrent (i = 1:N)\n", " c(i) = a(i) + scalar * b(i)\n", "end do\n", "end subroutine" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showcpp\n", "program doconcurrentloop_01\n", "implicit none\n", "real, dimension(10000) :: a, b, c\n", "real :: scalar\n", "integer :: i, nsize\n", "scalar = 10\n", "nsize = size(a)\n", "do concurrent (i = 1:nsize)\n", " a(i) = 5\n", " b(i) = 5\n", "end do\n", "call triad(a, b, scalar, c)\n", "print *, \"End Stream Triad\"\n", "\n", "contains\n", "\n", " subroutine triad(a, b, scalar, c)\n", " real, intent(in) :: a(:), b(:), scalar\n", " real, intent(out) :: c(:)\n", " integer :: N, i\n", " N = size(a)\n", " do concurrent (i = 1:N)\n", " c(i) = a(i) + scalar * b(i)\n", " end do\n", " end subroutine\n", "\n", "end program" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Format Fortran code\n", "\n", "You can use `lfortran fmt` to format Fortran code, or the `%%showfmt` command." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%showfmt\n", "subroutine triad(a, b, scalar, c); real, intent(in) :: a(:), b(:), scalar; real, intent(out) :: c(:); integer :: N, i; N = size(a); do concurrent (i = 1:N); c(i) = a(i) + scalar * b(i); end do; end subroutine" ] } ], "metadata": { "kernelspec": { "display_name": "Fortran", "language": "fortran", "name": "fortran" }, "language_info": { "file_extension": ".f90", "mimetype": "text/x-fortran", "name": "fortran", "version": "2018" } }, "nbformat": 4, "nbformat_minor": 2 } lfortran-lfortran-2f73434/share/lfortran/lfortran-completion.bash0000664000175000017500000000053215141516316025421 0ustar alastairalastair#/usr/bin/env bash complete \ -W "-h --help -S -c -o -v -E -I --version --cpp --fixed-form --show-prescan --show-tokens --show-ast --show-asr --clojure --with-intrinsic-modules --show-ast-f90 --no-color --pass --show-llvm --show-cpp --show-stacktrace --time-report --static --backend --openmp fmt kernel mod pywrap" \ -df \ lfortran lfortran-lfortran-2f73434/share/jupyter/0000775000175000017500000000000015141516316020437 5ustar alastairalastairlfortran-lfortran-2f73434/share/jupyter/kernels/0000775000175000017500000000000015141516316022102 5ustar alastairalastairlfortran-lfortran-2f73434/share/jupyter/kernels/fortran/0000775000175000017500000000000015141516316023555 5ustar alastairalastairlfortran-lfortran-2f73434/share/jupyter/kernels/fortran/lfortran-logo.svg0000664000175000017500000001155515141516316027072 0ustar alastairalastair lfortran-lfortran-2f73434/share/jupyter/kernels/fortran/kernel.json.in0000664000175000017500000000032015141516316026330 0ustar alastairalastair{ "display_name": "Fortran", "argv": [ "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/lfortran", "kernel", "-f", "{connection_file}" ], "language": "fortran" } lfortran-lfortran-2f73434/.vscode/0000775000175000017500000000000015141516316017174 5ustar alastairalastairlfortran-lfortran-2f73434/.vscode/launch.json0000664000175000017500000000170715141516316021346 0ustar alastairalastair{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // use gdb in linux and lldb in mac "version": "0.2.0", "configurations": [ { "name": "(lldb) Launch", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/src/bin/lfortran", "args": ["examples/expr2.f90"], "cwd": "${workspaceFolder}" }, { "name": "(lldb-mi) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/src/bin/lfortran", "args": ["examples/expr2.f90"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb" }, ] } lfortran-lfortran-2f73434/environment_win.yml0000664000175000017500000000042315141516316021576 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml - pytest - jupyter - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test - xonsh=0.16.0 - re2c - numpy - ninja - m2-bison=3.0.4 - git - cmake - zlib lfortran-lfortran-2f73434/cmake/0000775000175000017500000000000015141516316016713 5ustar alastairalastairlfortran-lfortran-2f73434/cmake/FindBFD.cmake0000664000175000017500000000074615141516316021120 0ustar alastairalastairfind_path(BFD_INCLUDE_DIR bfd.h) find_library(BFD_LIBRARY bfd) #find_library(IBERTY_LIBRARY iberty) #find_library(Z_LIBRARY z) #find_library(DL_LIBRARY dl) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(BFD DEFAULT_MSG BFD_INCLUDE_DIR BFD_LIBRARY) add_library(p::bfd INTERFACE IMPORTED) set_property(TARGET p::bfd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${BFD_INCLUDE_DIR}) set_property(TARGET p::bfd PROPERTY INTERFACE_LINK_LIBRARIES ${BFD_LIBRARY}) lfortran-lfortran-2f73434/cmake/postinstall/0000775000175000017500000000000015141516316021267 5ustar alastairalastairlfortran-lfortran-2f73434/cmake/postinstall/CMakeLists.txt0000664000175000017500000000011315141516316024022 0ustar alastairalastairinstall(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/postinstall/BuildRuntime.cmake") lfortran-lfortran-2f73434/cmake/postinstall/BuildRuntime.cmake0000664000175000017500000000054215141516316024675 0ustar alastairalastairexecute_process( COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}/src/runtime" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/runtime" RESULT_VARIABLE STATUS_BUILD COMMAND_ECHO STDOUT) if (STATUS_BUILD AND NOT STATUS_BUILD EQUAL 0) message(FATAL_ERROR "cmake failed with status: ${STATUS_BUILD}") else() message(STATUS "Done.") endif() lfortran-lfortran-2f73434/cmake/UserOverride.cmake0000664000175000017500000000222315141516316022332 0ustar alastairalastair# This overrides the default CMake Debug and Release compiler options. # The user can still specify different options by setting the # CMAKE_CXX_FLAGS_[RELEASE,DEBUG] variables (on the command line or in the # CMakeList.txt). This files serves as better CMake defaults and should only be # modified if the default values are to be changed. Project specific compiler # flags should be set in the CMakeList.txt by setting the CMAKE_CXX_FLAGS_* # variables. if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # g++ set(common "-Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # icpc set(common "-Wall") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -xHOST -O3") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -O0") elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) # clang set(common "-Wall -Wextra") set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -funroll-loops -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") # pgcpp endif () lfortran-lfortran-2f73434/cmake/FindRapidJSON.cmake0000664000175000017500000000046315141516316022252 0ustar alastairalastairfind_path(RAPIDJSON_HEADER rapidjson/rapidjson.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(RapidJSON DEFAULT_MSG RAPIDJSON_HEADER) add_library(p::rapidjson INTERFACE IMPORTED) set_property(TARGET p::rapidjson PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${RAPIDJSON_HEADER}) lfortran-lfortran-2f73434/cmake/FindMACHO.cmake0000664000175000017500000000044215141516316021345 0ustar alastairalastairfind_path(MACHO_INCLUDE_DIR mach-o/dyld.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MACHO DEFAULT_MSG MACHO_INCLUDE_DIR) add_library(p::macho INTERFACE IMPORTED) set_property(TARGET p::macho PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MACHO_INCLUDE_DIR}) lfortran-lfortran-2f73434/cmake/FindLIBUNWIND.cmake0000664000175000017500000000071515141516316022054 0ustar alastairalastairfind_path(LIBUNWIND_INCLUDE_DIR libunwind.h) find_library(LIBUNWIND_LIBRARY unwind) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBUNWIND DEFAULT_MSG LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARY) add_library(p::libunwind INTERFACE IMPORTED) set_property(TARGET p::libunwind PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIR}) set_property(TARGET p::libunwind PROPERTY INTERFACE_LINK_LIBRARIES ${LIBUNWIND_LIBRARY})lfortran-lfortran-2f73434/cmake/FindLFortranZLIB.cmake0000664000175000017500000000261415141516316022731 0ustar alastairalastair# FindLFortranZLIB.cmake # Finds the ZLIB compression library for LFortran # # Respects the USE_DYNAMIC_ZLIB variable: # OFF (default): Search for static libraries first (.a, .lib) # ON: Search for dynamic libraries first (.so, .dylib, .dll), then static # # If USE_DYNAMIC_ZLIB is OFF but no static library is available, fall back to # a default search so builds work on systems that do not ship static zlib. # Backup the original value of the requested library suffixes set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if (USE_DYNAMIC_ZLIB) if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib .a) elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a .lib) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .so .a .lib) endif() else() # Prefer static libraries first set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib) endif() find_package(ZLIB QUIET) # Reset the library suffixes to the original value set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CMAKE_FIND_LIBRARY_SUFFIXES}) # Unset the temporary to not pollute the global namespace unset(_CMAKE_FIND_LIBRARY_SUFFIXES) if (NOT ZLIB_FOUND OR NOT ZLIB_LIBRARY) unset(ZLIB_FOUND) unset(ZLIB_LIBRARY CACHE) unset(ZLIB_LIBRARIES CACHE) find_package(ZLIB REQUIRED) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LFortranZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIRS) lfortran-lfortran-2f73434/cmake/FindLFortranZSTD.cmake0000664000175000017500000000374315141516316022761 0ustar alastairalastair# FindLFortranZSTD.cmake # Finds the ZSTD compression library for LFortran # # Respects the USE_DYNAMIC_ZSTD variable: # OFF (default): Search for static libraries only (.a, .lib) # ON: Search for dynamic libraries first (.so, .dylib, .dll), then static # Backup the original value of the requested library suffixes set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if (USE_DYNAMIC_ZSTD) # Search dynamic library first, then static one if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib .a) elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a .lib) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .so .a .lib) endif() else() # Static libraries end with .a on Unix and .lib on Windows set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib) endif() find_path(zstd_INCLUDE_DIR zstd.h) find_library(zstd_LIBRARY zstd) # Reset the library suffixes to the original value set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CMAKE_FIND_LIBRARY_SUFFIXES}) # Unset the temporary to not pollute the global namespace unset(_CMAKE_FIND_LIBRARY_SUFFIXES) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LFortranZSTD DEFAULT_MSG zstd_LIBRARY zstd_INCLUDE_DIR) # We found the static or dynamic ZSTD library and then we set this target which # LLVM CMake uses to find the "shared" library. Then ZSTD gets linked # statically or dynamically with LFortran and everything works. This is # dependent on LLVM's CMake. If it changes, we also have to change the handling # here. add_library(zstd::libzstd_shared INTERFACE IMPORTED) set_property(TARGET zstd::libzstd_shared PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) set_property(TARGET zstd::libzstd_shared PROPERTY INTERFACE_LINK_LIBRARIES ${zstd_LIBRARY}) add_library(zstd::libzstd INTERFACE IMPORTED) set_property(TARGET zstd::libzstd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) set_property(TARGET zstd::libzstd PROPERTY INTERFACE_LINK_LIBRARIES ${zstd_LIBRARY}) lfortran-lfortran-2f73434/cmake/FindLINKH.cmake0000664000175000017500000000042615141516316021365 0ustar alastairalastairfind_path(LINK_INCLUDE_DIR link.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LINKH DEFAULT_MSG LINK_INCLUDE_DIR) add_library(p::link INTERFACE IMPORTED) set_property(TARGET p::link PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LINK_INCLUDE_DIR}) lfortran-lfortran-2f73434/examples/0000775000175000017500000000000015141516316017451 5ustar alastairalastairlfortran-lfortran-2f73434/examples/project3/0000775000175000017500000000000015141516316021202 5ustar alastairalastairlfortran-lfortran-2f73434/examples/project3/a.f900000664000175000017500000000021115141516316021734 0ustar alastairalastairprogram main implicit none interface subroutine sub end subroutine sub end interface CALL sub end program main lfortran-lfortran-2f73434/examples/project3/README.md0000664000175000017500000000030715141516316022461 0ustar alastairalastairTo generate build files: FC=lfortran cmake . To choose a backend: FC=lfortran FFLAGS="--backend=cpp" cmake . FC=lfortran FFLAGS="--backend=llvm" cmake . To build: cmake --build .lfortran-lfortran-2f73434/examples/project3/b.f900000664000175000017500000000006415141516316021743 0ustar alastairalastairsubroutine sub print *, "success" end subroutine lfortran-lfortran-2f73434/examples/project3/CMakeLists.txt0000664000175000017500000000057715141516316023753 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project1 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(project3 a.f90 b.f90 ) lfortran-lfortran-2f73434/examples/asr.f900000664000175000017500000000012615141516316020555 0ustar alastairalastairinteger function f(a, b) result(r) integer, intent(in) :: a, b r = a + b end function lfortran-lfortran-2f73434/examples/project2/0000775000175000017500000000000015141516316021201 5ustar alastairalastairlfortran-lfortran-2f73434/examples/project2/README.md0000664000175000017500000000010515141516316022454 0ustar alastairalastairTo compile with C++: FC=lfortran FFLAGS="--backend=cpp" cmake . lfortran-lfortran-2f73434/examples/project2/CMakeLists.txt0000664000175000017500000000060415141516316023741 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project2 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(doconcurrent doconcurrent.f90 ) lfortran-lfortran-2f73434/examples/project2/doconcurrent.f900000664000175000017500000000100215141516316024217 0ustar alastairalastairprogram doconcurrent implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-lfortran-2f73434/examples/expr2.f900000664000175000017500000000011715141516316021030 0ustar alastairalastairprogram expr2 implicit none integer :: x x = (2+3)*5 print *, x end program lfortran-lfortran-2f73434/examples/project1/0000775000175000017500000000000015141516316021200 5ustar alastairalastairlfortran-lfortran-2f73434/examples/project1/a.f900000664000175000017500000000047315141516316021744 0ustar alastairalastairmodule a use b, only: g implicit none private public f, fib contains integer function f() f = 3 + g() end function subroutine fib(n) integer, intent(in) :: n integer :: i, a, b, c a = 1 b = 1 do i = 1, n-2 c = a+b print *, "Fibonacci: ", i, " ", c a = b; b = c; end do end subroutine end module lfortran-lfortran-2f73434/examples/project1/README.md0000664000175000017500000000025115141516316022455 0ustar alastairalastairTo compile with LFortran: FC=lfortran cmake . To choose a backend: FC=lfortran FFLAGS="--backend=cpp" cmake . FC=lfortran FFLAGS="--backend=llvm" cmake . lfortran-lfortran-2f73434/examples/project1/b.f900000664000175000017500000000014715141516316021743 0ustar alastairalastairmodule b implicit none private public g contains integer function g() g = 5 end function end module lfortran-lfortran-2f73434/examples/project1/CMakeLists.txt0000664000175000017500000000062015141516316023736 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(project1 C Fortran) if(CMAKE_VERSION VERSION_LESS 3.31.4) # CMake 3.31.0 through 3.31.3 hard-coded this flag. # It does not work with modules, so remove it. string(REPLACE "--generate-object-code" "" CMAKE_Fortran_COMPILE_OBJECT "${CMAKE_Fortran_COMPILE_OBJECT}") endif() add_executable(project1 project1.f90 a.f90 b.f90 ) lfortran-lfortran-2f73434/examples/project1/project1.f900000664000175000017500000000015715141516316023252 0ustar alastairalastairprogram project1 use a, only: f, fib implicit none if (f() /= 8) error stop call fib(10) print *, "OK" end lfortran-lfortran-2f73434/examples/cmdline.f900000664000175000017500000000114215141516316021402 0ustar alastairalastairprogram cmdline integer, parameter :: dp = kind(0.d0) integer :: x character(len=32) :: arg real :: err if (command_argument_count() /= 1) error stop "Must provide exactly 1 argument" call get_command_argument(1, arg) print *, "Got argument:", arg read(arg,*) x print *, "Converted value:", x print *, "sin(x) = ", sin(real(x, dp)) print *, "sin(1) = ", sin(1._dp) err = abs(sin(real(x, dp)) - 8.41470984807896505e-01_dp) print *, "err =", err if (err > 1e-12) then print *, "Make sure you call cmdline with the argument: 1" error stop "The sin(x) does not agree with the reference" end if end program lfortran-lfortran-2f73434/examples/chat_01.f900000664000175000017500000000174715141516316021221 0ustar alastairalastairprogram chat_01 implicit none integer :: choice character(len = 10) :: name print *, "Please enter your name:" read(*, *) name print *, "---------WELCOME TO CHAT_01---------" do while (.true.) print *, "Please pick an option:" print *, "1) Say Hi" print *, "2) Say Hello" print *, "3) Say Good Morning" print *, "4) Say Happy Birthday" print *, "5) Exit the chat" print *, "" print *, "Enter your choice:" read(*, *) choice if (choice == 1) then print *, "Hi "//name else if (choice == 2) then print *, "Hello "//name else if (choice == 3) then print *, "Good Morning "//name else if (choice == 4) then print *, "Happy Birthday "//name//"!" else if (choice == 5) then exit else print *, "Wrong choice. Try again..." end if print *, "" end do end program lfortran-lfortran-2f73434/ci/0000775000175000017500000000000015141516316016226 5ustar alastairalastairlfortran-lfortran-2f73434/ci/azure_status.sh0000775000175000017500000000151215141516316021315 0ustar alastairalastair#!/usr/bin/env bash set -ex if [[ "$1" == "running" ]]; then status="running" else if [[ "${AGENT_JOBSTATUS}" == "Succeeded" ]]; then status="success" else status="failed" fi fi project_id=4494718 # lfortran/lfortran curl --request POST --header "PRIVATE-TOKEN: ${TOKEN_STATUS}" "https://gitlab.com/api/v4/projects/${project_id}/statuses/${COMMIT_ID}?state=${status}&name=AzurePipelines&target_url=https%3A%2F%2Fdev.azure.com%2Flfortran%2Flfortran%2F_build%2Fresults%3FbuildId%3D${BUILD_ID}" project_id=8213176 # certik/lfortran curl --request POST --header "PRIVATE-TOKEN: ${TOKEN_STATUS}" "https://gitlab.com/api/v4/projects/${project_id}/statuses/${COMMIT_ID}?state=${status}&name=AzurePipelines&target_url=https%3A%2F%2Fdev.azure.com%2Flfortran%2Flfortran%2F_build%2Fresults%3FbuildId%3D${BUILD_ID}" lfortran-lfortran-2f73434/ci/wasm_builds_update_json.py0000664000175000017500000000346215141516316023511 0ustar alastairalastairimport datetime from json import load, dump import os import shutil import sys dest_dir = sys.argv[1] version = sys.argv[2] lfortran_commit_sha = sys.argv[3] # Retention policy MAX_DEV_BUILDS = 10 # Keep only the latest 10 debug builds # Release builds have no limit (keep all) filename = "data.json" if os.path.exists(filename): d = load(open(filename)) else: d = {"dev": [], "release": []} # Add new entry entry = { "url": "https://lfortran.github.io/wasm_builds/%s/%s" % \ (dest_dir, lfortran_commit_sha), "version": version, "lfortran_commit_sha": lfortran_commit_sha, "created": str(datetime.datetime.now()) } d[dest_dir].insert(0, entry) # Apply retention policy for dev builds if dest_dir == "dev" and len(d[dest_dir]) > MAX_DEV_BUILDS: print(f"Applying retention policy: keeping only {MAX_DEV_BUILDS} latest dev builds") # Get builds to remove (everything after the first MAX_DEV_BUILDS entries) builds_to_remove = d[dest_dir][MAX_DEV_BUILDS:] # Remove old build directories for build in builds_to_remove: build_sha = build["lfortran_commit_sha"] build_path = os.path.join(dest_dir, build_sha) if os.path.exists(build_path): print(f"Removing old build directory: {build_path}") shutil.rmtree(build_path) else: print(f"Build directory not found (already removed?): {build_path}") # Keep only the latest MAX_DEV_BUILDS entries in JSON d[dest_dir] = d[dest_dir][:MAX_DEV_BUILDS] print(f"Kept {len(d[dest_dir])} dev builds in data.json") elif dest_dir == "release": print(f"Release build: no retention limit (keeping all {len(d[dest_dir])} builds)") print("Saving to %s." % filename) with open(filename, "w") as f: dump(d, f, indent=4, ensure_ascii=False, sort_keys=True) lfortran-lfortran-2f73434/ci/environment_linux.yml0000664000175000017500000000061315141516316022534 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - pandoc=3.1.13 - kokkos=4.4.01 - cmake=3.29.1 - zlib=1.3.1 - zstd-static=1.5.6 - shell=0.2.0 lfortran-lfortran-2f73434/ci/version.sh0000775000175000017500000000070515141516316020254 0ustar alastairalastair#!/usr/bin/env bash # This script extracts the project's current version from git using # `git describe`, which determines the version based on the latest tag, such as: # # $ git describe --tags --dirty # v0.6.0-37-g3878937f-dirty # # Each tag starts with "v", so we strip the "v", and the final version becomes: # # 0.6.0-37-g3878937f-dirty # set -ex version=$(git describe --tags --dirty) version="${version:1}" echo $version > version lfortran-lfortran-2f73434/ci/test_third_party_codes.sh0000775000175000017500000010451615141516316023341 0ustar alastairalastair#!/bin/bash set -ex # Exit immediately on any error # Default to gfortran if FC is not set : "${FC:=gfortran}" # Color definitions for pretty output GREEN='\033[0;32m' BLUE='\033[1;34m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Helper functions for logging print_section() { echo -e "\n${BLUE}===============================" echo -e "$1" echo -e "===============================${NC}\n" } print_subsection() { echo -e "${YELLOW}→ $1${NC}" } print_success() { echo -e "${GREEN}✔ $1${NC}" } run_test() { print_subsection "Running: $1" ./$1 print_success "Success: $1" } time_section() { local LABEL="$1" local BLOCK="$2" local START=$(date +%s) print_section "$LABEL" eval "$BLOCK" local END=$(date +%s) print_subsection "⏱ Duration: $((END - START)) seconds" } # Setup a temporary workspace TMP_DIR=$(mktemp -d) cd "$TMP_DIR" time_section "🧪 Testing assert" ' git clone https://github.com/pranavchiku/assert.git cd assert export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm # To debug https://github.com/lfortran/lfortran/issues/7732: which fpm realpath $(which fpm) ls -l $(dirname $(realpath $(which fpm)))/../lib ls -l $CONDA_PREFIX/lib fpm --version git checkout -t origin/fix-test git checkout 535434d2f44508aa06231c6c2fe95f9e11292769 git clean -dfx fpm build --compiler=$FC --flag "--cpp" --verbose fpm test --compiler=$FC --flag "--cpp" git clean -dfx print_subsection "Testing with assertions enabled" fpm test --compiler=$FC --verbose --flag '--cpp -DASSERTIONS -DASSERT_PARALLEL_CALLBACKS' cd ../ rm -rf assert ' time_section "🧪 Testing splpak" ' git clone https://github.com/Pranavchiku/splpak.git cd splpak export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm # To debug https://github.com/lfortran/lfortran/issues/7732: which fpm realpath $(which fpm) ls -l $(dirname $(realpath $(which fpm)))/../lib ls -l $CONDA_PREFIX/lib fpm --version git checkout lf-2 git checkout 460bd22f4ac716e5266412e8ed35ce07aa664f08 git clean -dfx fpm build --compiler=$FC --profile release --flag "--cpp -DREAL32" --verbose fpm test --compiler=$FC --profile release --flag "--cpp -DREAL32" cd ../ rm -rf splpak ' time_section "🧪 Testing fortran-regex" ' git clone https://github.com/perazz/fortran-regex.git cd fortran-regex export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 96ab33fe003862a28cec91ddd170ac0e86c26c87 fpm --compiler=$FC build fpm --compiler=$FC test print_success "Done with fortran-regex" cd .. ' time_section "🧪 Testing fortran-shlex" ' git clone https://github.com/perazz/fortran-shlex.git cd fortran-shlex export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout e20b6f86c82e33fae78b54b074bab5369efde6a3 fpm --compiler=$FC build --flag "--realloc-lhs-arrays" fpm --compiler=$FC test --flag "--realloc-lhs-arrays" print_success "Done with fortran-shlex" cd .. ' time_section "🧪 Testing toml-f" ' git clone https://github.com/toml-f/toml-f.git cd toml-f export PATH="$(pwd)/../src/bin:$PATH" micromamba install -c conda-forge fpm git checkout 27abd768e79c7c790ffa58fe5ccfb105ba00883d fpm --compiler=$FC build --flag "--cpp --realloc-lhs-arrays" fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays" print_success "Done with toml-f" cd .. ' time_section "🧪 Testing jonquil" ' git clone https://github.com/jinangshah21/jonquil.git cd jonquil export PATH="$(pwd)/../src/bin:$PATH" git checkout lf-7 micromamba install -c conda-forge fpm git checkout 8aad5a901810bd669e851eead633c0df2bb7b423 fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" print_success "Done with jonquil" cd .. ' time_section "🧪 Testing M_CLI2" ' git clone https://github.com/jinangshah21/M_CLI2.git cd M_CLI2 export PATH="$(pwd)/../src/bin:$PATH" git checkout lf-9 micromamba install -c conda-forge fpm git checkout 108f0b5598df2bd8ec7a2dffe56017d58520fdfc fpm --compiler=$FC build --flag "--realloc-lhs-arrays" fpm --compiler=$FC test --flag "--realloc-lhs-arrays" print_success "Done with M_CLI2" cd .. ' time_section "🧪 Testing fortran_mpi" ' git clone https://github.com/lfortran/fortran_mpi.git cd fortran_mpi export PATH="$(pwd)/../src/bin:$PATH" export OMPI_MCA_btl_tcp_if_include=lo0 git checkout 31033d3c8af32c4c99fac803c161e6731bc39a78 git clean -fdx cd tests/ FC="$FC --cpp" ./run_tests.sh print_success "Done with fortran_mpi" cd ../ git clean -fdx print_subsection "Building fortran_mpi with separate compilation" cd tests/ FC="$FC --cpp --separate-compilation" ./run_tests.sh print_success "Done with fortran_mpi" cd ../../ rm -rf fortran_mpi ' time_section "🧪 Testing POT3D with fortran_mpi" ' git clone https://github.com/parth121101/pot3d.git cd pot3d git checkout -t origin/lf_hdf5_fortranMPI_namelist_global_workarounds git checkout 380669edd3a5947985674a51e0d65482d6fe68b3 git clone https://github.com/lfortran/fortran_mpi cd fortran_mpi git checkout 31033d3c8af32c4c99fac803c161e6731bc39a78 cp src/mpi.f90 ../src/ cp src/mpi_c_bindings.f90 ../src/ cp src/mpi_constants.c ../src/ cd .. print_subsection "Building with default flags" FC="$FC --cpp -DOPEN_MPI=yes" ./build_and_run_lfortran.sh print_subsection "Building with optimization flags" FC="$FC --cpp --fast --skip-pass=dead_code_removal -DOPEN_MPI=yes" ./build_and_run_lfortran.sh print_subsection "Building POT3D in separate compilation mode" FC="$FC --cpp --separate-compilation -DOPEN_MPI=yes" ./build_and_run_lfortran.sh print_success "Done with POT3D" cd .. rm -rf pot3d ' ########################## # Section 1: stdlib (Less Workarounds) ########################## time_section "🧪 Testing stdlib (Less Workarounds)" ' git clone https://github.com/Pranavchiku/stdlib-fortran-lang.git cd stdlib-fortran-lang export PATH="$(pwd)/../src/bin:$PATH" git checkout n-lf-22 git checkout ae4c42431b31f8ad8f6fdd40bcc9e08a88f8b373 micromamba install -c conda-forge fypp git clean -fdx FC=$FC cmake . \ -DTEST_DRIVE_BUILD_TESTING=OFF \ -DBUILD_EXAMPLE=ON -DCMAKE_Fortran_COMPILER_WORKS=TRUE \ -DCMAKE_Fortran_FLAGS="--cpp --realloc-lhs-arrays --no-warnings --use-loop-variable-after-loop -I$(pwd)/src -I$(pwd)/subprojects/test-drive/" make -j8 ctest git clean -dfx git restore . git checkout sc-lf-12 git checkout 4d832ce2f4c6629d5273651af20736e121d7abe0 FC=$FC cmake . \ -DTEST_DRIVE_BUILD_TESTING=OFF \ -DBUILD_EXAMPLE=ON -DCMAKE_Fortran_COMPILER_WORKS=TRUE \ -DCMAKE_Fortran_FLAGS="--cpp --separate-compilation --realloc-lhs-arrays --no-warnings --use-loop-variable-after-loop -I$(pwd)/src -I$(pwd)/subprojects/test-drive/" make -j8 ctest print_success "Done with stdlib (Less Workarounds)" cd .. rm -rf stdlib ' ########################## # Section 2: FPM ########################## time_section "🧪 Testing FPM" ' git clone https://github.com/fortran-lang/fpm.git cd fpm export PATH="$(pwd)/../src/bin:$PATH" git checkout main micromamba install -c conda-forge fpm git checkout d0f89957541bdcc354da8e11422f5efcf9fedd0e fpm --compiler=$FC build --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop" git clean -dfx rm -rf build fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop --separate-compilation" git clean -dfx rm -rf build fpm --compiler=$FC test --flag "--cpp --realloc-lhs-arrays --use-loop-variable-after-loop --fast" print_success "Done with FPM" cd .. ' ########################## # Section 3: Fortran-Primes ########################## time_section "🧪 Testing Fortran-Primes" ' git clone https://github.com/jinangshah21/fortran-primes.git cd fortran-primes git checkout -t origin/lf-3 git checkout 923b468f79eee1ff07b77d9def67249f4d2efa21 print_subsection "Building and running Fortran-Primes" FC=$FC ./build_and_run.sh print_subsection "Building Fortran-Primes with separate compilation" git clean -dfx FC="$FC --separate-compilation" ./build_and_run.sh print_success "Done with Fortran-Primes" cd .. rm -rf fortran-primes ' ######################################## # Section 4: Numerical Methods Fortran # ######################################## time_section "🧪 Testing Numerical Methods Fortran" ' git clone https://github.com/Pranavchiku/numerical-methods-fortran.git cd numerical-methods-fortran git checkout -t origin/lf6 git checkout a252989e64b3f8d5d2f930dca18411c104ea85f8 print_subsection "Building project" FC="$FC --no-array-bounds-checking --realloc-lhs-arrays" make run_test test_fix_point.exe run_test test_integrate_one.exe run_test test_linear.exe run_test test_newton.exe run_test test_ode.exe run_test test_probability_distribution.exe run_test test_sde.exe run_test plot_bogdanov_takens.exe run_test plot_bruinsma.exe run_test plot_fun1.exe run_test plot_lorenz.exe run_test plot_lotka_volterra1.exe run_test plot_lotka_volterra2.exe run_test plot_pendulum.exe run_test plot_transes_iso.exe git clean -dfx print_subsection "Building Numerical Methods Fortran with f23 standard" FC="$FC --std=f23 --no-array-bounds-checking" make run_test test_fix_point.exe run_test test_integrate_one.exe run_test test_linear.exe run_test test_newton.exe run_test test_ode.exe run_test test_probability_distribution.exe run_test test_sde.exe run_test plot_bogdanov_takens.exe run_test plot_bruinsma.exe run_test plot_fun1.exe run_test plot_lorenz.exe run_test plot_lotka_volterra1.exe run_test plot_lotka_volterra2.exe run_test plot_pendulum.exe run_test plot_transes_iso.exe git clean -dfx print_subsection "Building Numerical Methods Fortran with separate compilation" FC="$FC --separate-compilation --no-array-bounds-checking --realloc-lhs-arrays" make run_test test_fix_point.exe run_test test_integrate_one.exe run_test test_linear.exe run_test test_newton.exe run_test test_ode.exe run_test test_probability_distribution.exe run_test test_sde.exe run_test plot_bogdanov_takens.exe run_test plot_bruinsma.exe run_test plot_fun1.exe run_test plot_lorenz.exe run_test plot_lotka_volterra1.exe run_test plot_lotka_volterra2.exe run_test plot_pendulum.exe run_test plot_transes_iso.exe git clean -dfx print_subsection "Building Numerical Methods Fortran with separate compilation and f23 standard" FC="$FC --separate-compilation --std=f23 --no-array-bounds-checking" make run_test test_fix_point.exe run_test test_integrate_one.exe run_test test_linear.exe run_test test_newton.exe run_test test_ode.exe run_test test_probability_distribution.exe run_test test_sde.exe run_test plot_bogdanov_takens.exe run_test plot_bruinsma.exe run_test plot_fun1.exe run_test plot_lorenz.exe run_test plot_lotka_volterra1.exe run_test plot_lotka_volterra2.exe run_test plot_pendulum.exe run_test plot_transes_iso.exe print_success "Done with Numerical Methods Fortran" cd .. rm -rf numerical-methods-fortran ' ####################### # Section 5: PRIMA # ####################### time_section "🧪 Testing PRIMA" ' git clone https://github.com/Pranavchiku/prima.git cd prima git checkout -t origin/lf-prima-12 git checkout e681eea9b3f27930c50cffd14dd566b39f01c642 git clean -dfx # OS-specific env if [[ "$RUNNER_OS" == "macos-latest" ]]; then export LFORTRAN_RUNNER_OS="macos" elif [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then export LFORTRAN_RUNNER_OS="linux" fi print_subsection "Building PRIMA" FC="$FC --cpp" cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ -DCMAKE_Fortran_FLAGS="" \ -DCMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS="" \ -DCMAKE_MACOSX_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON cmake --build build --target install run_test ./build/fortran/example_bobyqa_fortran_1_exe run_test ./build/fortran/example_bobyqa_fortran_2_exe run_test ./build/fortran/example_cobyla_fortran_1_exe run_test ./build/fortran/example_cobyla_fortran_2_exe run_test ./build/fortran/example_lincoa_fortran_1_exe run_test ./build/fortran/example_lincoa_fortran_2_exe run_test ./build/fortran/example_newuoa_fortran_1_exe run_test ./build/fortran/example_newuoa_fortran_2_exe run_test ./build/fortran/example_uobyqa_fortran_1_exe run_test ./build/fortran/example_uobyqa_fortran_2_exe if [[ "$RUNNER_OS" == "macos-latest" ]]; then cd fortran test_name=test_bobyqa.f90 FC="$FC" ./script.sh test_name=test_newuoa.f90 FC="$FC" ./script.sh test_name=test_uobyqa.f90 FC="$FC" ./script.sh test_name=test_cobyla.f90 FC="$FC" ./script.sh test_name=test_lincoa.f90 FC="$FC" ./script.sh cd .. fi if [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then cd fortran test_name=test_uobyqa.f90 FC="$FC" ./script.sh cd .. fi print_subsection "Building PRIMA with f23 standard" FC="$FC --cpp --std=f23" cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ -DCMAKE_Fortran_FLAGS="" \ -DCMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS="" \ -DCMAKE_MACOSX_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON cmake --build build --target install run_test ./build/fortran/example_bobyqa_fortran_1_exe run_test ./build/fortran/example_bobyqa_fortran_2_exe run_test ./build/fortran/example_cobyla_fortran_1_exe run_test ./build/fortran/example_cobyla_fortran_2_exe run_test ./build/fortran/example_lincoa_fortran_1_exe run_test ./build/fortran/example_lincoa_fortran_2_exe run_test ./build/fortran/example_newuoa_fortran_1_exe run_test ./build/fortran/example_newuoa_fortran_2_exe run_test ./build/fortran/example_uobyqa_fortran_1_exe run_test ./build/fortran/example_uobyqa_fortran_2_exe if [[ "$RUNNER_OS" == "macos-latest" ]]; then cd fortran test_name=test_bobyqa.f90 FC="$FC --std=f23" ./script.sh test_name=test_newuoa.f90 FC="$FC --std=f23" ./script.sh test_name=test_uobyqa.f90 FC="$FC --std=f23" ./script.sh test_name=test_cobyla.f90 FC="$FC --std=f23" ./script.sh test_name=test_lincoa.f90 FC="$FC --std=f23" ./script.sh cd .. fi if [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then cd fortran test_name=test_uobyqa.f90 FC="$FC --std=f23" ./script.sh cd .. fi print_subsection "Rebuilding PRIMA with optimization" git clean -dfx FC="$FC --cpp --fast" cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ -DCMAKE_Fortran_FLAGS="" \ -DCMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS="" \ -DCMAKE_MACOSX_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON cmake --build build --target install run_test ./build/fortran/example_bobyqa_fortran_1_exe run_test ./build/fortran/example_bobyqa_fortran_2_exe run_test ./build/fortran/example_cobyla_fortran_1_exe run_test ./build/fortran/example_cobyla_fortran_2_exe run_test ./build/fortran/example_lincoa_fortran_1_exe run_test ./build/fortran/example_lincoa_fortran_2_exe run_test ./build/fortran/example_newuoa_fortran_1_exe run_test ./build/fortran/example_newuoa_fortran_2_exe run_test ./build/fortran/example_uobyqa_fortran_1_exe run_test ./build/fortran/example_uobyqa_fortran_2_exe print_subsection "Rebuilding PRIMA in separate compilation mode" git clean -dfx git restore --staged . git restore . git checkout -t origin/lf-prima-sc-1 git checkout 52b863fcd3bb694045e50884fbb689a1ca75298d FC="$FC --separate-compilation --cpp" cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ -DCMAKE_Fortran_FLAGS="" \ -DCMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS="" \ -DCMAKE_MACOSX_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON cmake --build build --target install run_test ./build/fortran/example_bobyqa_fortran_1_exe run_test ./build/fortran/example_bobyqa_fortran_2_exe run_test ./build/fortran/example_cobyla_fortran_1_exe run_test ./build/fortran/example_cobyla_fortran_2_exe run_test ./build/fortran/example_lincoa_fortran_1_exe run_test ./build/fortran/example_lincoa_fortran_2_exe run_test ./build/fortran/example_newuoa_fortran_1_exe run_test ./build/fortran/example_newuoa_fortran_2_exe run_test ./build/fortran/example_uobyqa_fortran_1_exe run_test ./build/fortran/example_uobyqa_fortran_2_exe if [[ "$RUNNER_OS" == "macos-latest" ]]; then cd fortran name=bobyqa test_name=test_bobyqa.f90 FC="$FC --separate-compilation" ./script_sc.sh name=newuoa test_name=test_newuoa.f90 FC="$FC --separate-compilation" ./script_sc.sh name=uobyqa test_name=test_uobyqa.f90 FC="$FC --separate-compilation" ./script_sc.sh name=cobyla test_name=test_cobyla.f90 FC="$FC --separate-compilation" ./script_sc.sh name=lincoa test_name=test_lincoa.f90 FC="$FC --separate-compilation" ./script_sc.sh cd .. fi if [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then cd fortran name=uobyqa test_name=test_uobyqa.f90 FC="$FC --separate-compilation" ./script_sc.sh cd .. fi print_success "Done with PRIMA" cd .. ' ########################## # Section 6: Legacy Minpack ########################## time_section "🧪 Testing Legacy Minpack (SciPy)" ' git clone https://github.com/pranavchiku/minpack.git cd minpack git checkout -t origin/scipy31 git checkout 45801cf882871ea8a668213e8cf90b5817877484 mkdir lf && cd lf FC="$FC --intrinsic-mangling" cmake .. make run_test examples/example_hybrd run_test examples/example_hybrd1 run_test examples/example_lmder1 run_test examples/example_lmdif1 run_test examples/example_primes print_subsection "Running CTest" ctest cd ../ print_subsection "Testing with f23 standard" git clean -dfx mkdir lf && cd lf FC="$FC --intrinsic-mangling --std=f23" cmake .. make run_test examples/example_hybrd run_test examples/example_hybrd1 run_test examples/example_lmder1 run_test examples/example_lmdif1 run_test examples/example_primes print_subsection "Running CTest" ctest cd ../ print_subsection "Testing with separate compilation" git clean -dfx mkdir lf && cd lf FC="$FC --intrinsic-mangling --separate-compilation" cmake .. make run_test examples/example_hybrd run_test examples/example_hybrd1 run_test examples/example_lmder1 run_test examples/example_lmdif1 run_test examples/example_primes print_subsection "Running CTest" ctest cd ../ print_subsection "Testing with separate compilation and f23 standard" git clean -dfx mkdir lf && cd lf FC="$FC --intrinsic-mangling --separate-compilation --std=f23" cmake .. make run_test examples/example_hybrd run_test examples/example_hybrd1 run_test examples/example_lmder1 run_test examples/example_lmdif1 run_test examples/example_primes print_subsection "Running CTest" ctest cd ../ print_success "Done with Legacy Minpack (SciPy)" cd ../ rm -rf minpack ' ########################## # Section 7: Modern Minpack ########################## time_section "🧪 Testing Modern Minpack (Fortran-Lang)" ' git clone https://github.com/fortran-lang/minpack modern_minpack_01 cd modern_minpack_01 git checkout c0b5aea9fcd2b83865af921a7a7e881904f8d3c2 $FC ./src/minpack.f90 -c --legacy-array-sections $FC ./examples/example_hybrd.f90 --legacy-array-sections $FC ./examples/example_hybrd1.f90 --legacy-array-sections $FC ./examples/example_lmdif1.f90 --legacy-array-sections $FC ./examples/example_lmder1.f90 --legacy-array-sections print_subsection "Testing with separate compilation" git clean -dfx $FC ./src/minpack.f90 -c --legacy-array-sections --separate-compilation $FC ./examples/example_hybrd.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_hybrd1.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_lmdif1.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_lmder1.f90 --legacy-array-sections --separate-compilation minpack.o ' time_section "🧪 Testing Modern Minpack (Result Check)" ' git clone https://github.com/Pranavchiku/modern_minpack.git modern_minpack_02 cd modern_minpack_02 git checkout -t origin/w5 git checkout fcde66ca86348eb0c4012dbdf0f4d8dba61261d8 $FC ./src/minpack.f90 -c --legacy-array-sections $FC ./examples/example_hybrd.f90 --legacy-array-sections $FC ./examples/example_hybrd1.f90 --legacy-array-sections $FC ./examples/example_lmdif1.f90 --legacy-array-sections $FC ./examples/example_lmder1.f90 --legacy-array-sections print_subsection "Testing with separate compilation" git clean -dfx $FC ./src/minpack.f90 -c --legacy-array-sections --separate-compilation $FC ./examples/example_hybrd.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_hybrd1.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_lmdif1.f90 --legacy-array-sections --separate-compilation minpack.o $FC ./examples/example_lmder1.f90 --legacy-array-sections --separate-compilation minpack.o ' ########################## # Section 8: dftatom ########################## time_section "🧪 Testing dftatom" ' git clone https://github.com/certik/dftatom.git cd dftatom git checkout 9b678177f67e350b8a32e08cb61f51e6e708e87a make -f Makefile.manual F90=$FC F90FLAGS=-I../../src make -f Makefile.manual quicktest git clean -dfx make -f Makefile.manual F90=$FC F90FLAGS="-I../../src --fast" make -f Makefile.manual quicktest git clean -dfx make -f Makefile.manual F90=$FC F90FLAGS="-I../../src --separate-compilation" make -f Makefile.manual quicktest git clean -dfx make -f Makefile.manual F90=$FC F90FLAGS="-I../../src --separate-compilation --fast" make -f Makefile.manual quicktest ' ########################## # Section 9: fastGPT ########################## time_section "🧪 Testing fastGPT" ' if [[ "$RUNNER_OS" == "macos-latest" ]]; then git clone https://github.com/certik/fastGPT.git cd fastGPT git clean -dfx git checkout -t origin/namelist git checkout d3eef520c1be8e2db98a3c2189740af1ae7c3e06 # NOTE: the release file link below would not necessarily # need to be updated if the commit hash above is updated curl -f -L -o model.dat \ https://github.com/certik/fastGPT/releases/download/v1.0.0/model_fastgpt_124M_v1.dat echo "11f6f018794924986b2fdccfbe8294233bb5e8ba28d40ae971dec3adbdc81ad7 model.dat" | shasum -a 256 --check mkdir lf cd lf FC="$FC --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_basic_input ./test_more_inputs cd .. # TODO: regression as of `struct refactoring` # mkdir lf-goc # cd lf-goc # FC="$FC --separate-compilation --rtlib --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. # make VERBOSE=1 # ln -s ../model.dat . # ./gpt2 # ./test_basic_input # ./test_more_inputs # cd .. elif [[ "$RUNNER_OS" == "ubuntu-latest" ]]; then git clone https://github.com/certik/fastGPT.git cd fastGPT git checkout -t origin/lf6 git checkout bc04dbf476b6173b0bb945ff920119ffaf4a290d echo $CONDA_PREFIX FC="$FC --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS . make ls -l ./gpt2 ./chat ./test_basic_input ./test_chat ./test_more_inputs file ./gpt2 ./chat ./test_basic_input ./test_chat ./test_more_inputs ldd ./gpt2 ldd ./chat ldd ./test_basic_input ldd ./test_chat ldd ./test_more_inputs git clean -dfx git checkout -t origin/lf37run git checkout 12885a08c9a34cd260f29edc68feddccbc624493 # NOTE: the release file link below would not necessarily # need to be updated if the commit hash above is updated curl -f -L -o model.dat \ https://github.com/certik/fastGPT/releases/download/v1.0.0/model_fastgpt_124M_v1.dat echo "11f6f018794924986b2fdccfbe8294233bb5e8ba28d40ae971dec3adbdc81ad7 model.dat" | shasum -a 256 --check mkdir lf cd lf FC="$FC --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_more_inputs ./test_chat ctest -V cd .. mkdir lf-goc cd lf-goc FC="$FC --separate-compilation --rtlib --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_more_inputs ./test_chat ctest -V cd .. mkdir lf-fast cd lf-fast FC="$FC --fast --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Release .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_more_inputs ./test_chat ctest -V cd .. git checkout -t origin/namelist git checkout d3eef520c1be8e2db98a3c2189740af1ae7c3e06 cd lf git clean -dfx FC="$FC --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_basic_input ./test_more_inputs cd .. cd lf-fast git clean -dfx FC="$FC --fast --realloc-lhs-arrays" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Release .. make VERBOSE=1 ln -s ../model.dat . ./gpt2 ./test_basic_input ./test_more_inputs cd .. rm -rf fastGPT/ fi ' ########################## # Section 10: stdlib ########################## time_section "🧪 Testing stdlib" ' git clone https://github.com/czgdp1807/stdlib.git cd stdlib export PATH="$(pwd)/../../src/bin:$PATH" git checkout lf-21 git checkout 176c7a28bbc7a8a9b63441f7dfa980aeafbddd0f micromamba install -c conda-forge fypp git clean -fdx FC=$FC cmake . -DTEST_DRIVE_BUILD_TESTING=OFF -DBUILD_EXAMPLE=ON -DCMAKE_Fortran_COMPILER_WORKS=TRUE -DCMAKE_Fortran_FLAGS="--cpp --realloc-lhs-arrays" make -j8 ctest ' ########################## # Section 11: SNAP ########################## time_section "🧪 Testing SNAP" ' git clone https://github.com/certik/SNAP.git cd SNAP git checkout lf11 git checkout 169a9216f2c922e94065a519efbb0a6c8b55149e cd ./src make -j8 FORTRAN=$FC FFLAGS= MPI=no OPENMP=no ./gsnap ../qasnap/sample/inp out make clean make -j8 FORTRAN=$FC FFLAGS="--separate-compilation" MPI=no OPENMP=no ./gsnap ../qasnap/sample/inp out make clean make -j8 FORTRAN=$FC FFLAGS="--fast" MPI=no OPENMP=no ./gsnap ../qasnap/sample/inp out ' ########################## # Section 13: LAPACK ########################## time_section "🧪 Testing LAPACK" ' micromamba install -y -n lf cmake=3.31.2 # bump-up CMAKE export PATH="$(pwd)/../src/bin:$PATH" git clone https://github.com/gxyd/lapack.git cd lapack git fetch origin lf_07 git checkout lf_07 git checkout 9d9e48987ca109d46b92d515b59cb591fab9859a cd build ./build_lf.sh micromamba install -y -n lf cmake=3.29.1 # Restore CMAKE ' ########################## # Section 14: Reference-LAPACK Full Test Suite (32-bit and 64-bit integers) ########################## time_section "🧪 Testing Reference-LAPACK v3.12.1 Full Test Suite" ' export PATH="$(pwd)/../src/bin:$PATH" git clone --depth 1 --branch v3.12.1 https://github.com/Reference-LAPACK/lapack.git lapack-testing cd lapack-testing # Patch to skip FortranCInterface_VERIFY (requires mixed Fortran/C linking) sed -i "/FortranCInterface_VERIFY/d" LAPACKE/include/CMakeLists.txt # Patch dgd.in to use custom seed that avoids FMA-sensitive ill-conditioned matrix # See: https://github.com/Reference-LAPACK/lapack/issues/1186 sed -i "s/^0 Code to interpret the seed$/2 Code to interpret the seed\n1234 5678 9012 3456/" TESTING/dgd.in # CMake < 3.31 needs CMAKE_Fortran_PREPROCESS_SOURCE for LFortran CMAKE_VERSION=$(cmake --version | head -1 | grep -oE "[0-9]+\.[0-9]+") TOOLCHAIN_OPT="" if [ "$(printf "%s\n3.31" "$CMAKE_VERSION" | sort -V | head -1)" != "3.31" ]; then echo "set(CMAKE_Fortran_PREPROCESS_SOURCE \" -E > \")" > lfortran.cmake TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=lfortran.cmake" fi # Helper function to run a single LAPACK test and check results run_lapack_test() { local TEST_EXE="$1" local INPUT_FILE="$2" local TEST_NAME="$3" print_subsection "Running $TEST_NAME" set +e timeout 300 ./bin/$TEST_EXE < ../TESTING/$INPUT_FILE 2>&1 | tee ${TEST_EXE}_${INPUT_FILE%.in}.out exit_code=$? set -e if [ "$exit_code" -ne 0 ] && [ "$exit_code" -ne 124 ]; then echo "ERROR: $TEST_NAME exited with code $exit_code" exit 1 fi if grep -qE "failed to pass the threshold" ${TEST_EXE}_${INPUT_FILE%.in}.out; then echo "ERROR: threshold failures in $TEST_NAME" grep "failed to pass the threshold" ${TEST_EXE}_${INPUT_FILE%.in}.out | head -20 exit 1 fi if grep -E "[1-9][0-9]* error messages recorded" ${TEST_EXE}_${INPUT_FILE%.in}.out; then echo "ERROR: error messages recorded in $TEST_NAME" exit 1 fi print_success "$TEST_NAME passed" } # Function to run the full LAPACK test suite run_lapack_test_suite() { local MODE="$1" # empty or "(ILP64)" # === LINEAR EQUATION TESTS === print_section "Linear Equation Tests ${MODE}" run_lapack_test xlintsts stest.in "Single Real Linear Equations ${MODE}" run_lapack_test xlintstd dtest.in "Double Real Linear Equations ${MODE}" run_lapack_test xlintstc ctest.in "Single Complex Linear Equations ${MODE}" run_lapack_test xlintstz ztest.in "Double Complex Linear Equations ${MODE}" run_lapack_test xlintstrfs stest_rfp.in "Single Real RFP Linear Equations ${MODE}" run_lapack_test xlintstrfd dtest_rfp.in "Double Real RFP Linear Equations ${MODE}" run_lapack_test xlintstrfc ctest_rfp.in "Single Complex RFP Linear Equations ${MODE}" run_lapack_test xlintstrfz ztest_rfp.in "Double Complex RFP Linear Equations ${MODE}" # === MIXED PRECISION LINEAR EQUATION TESTS === print_section "Mixed Precision Linear Equation Tests ${MODE}" run_lapack_test xlintstds dstest.in "Double-Single Mixed Precision ${MODE}" run_lapack_test xlintstzc zctest.in "Double-Single Complex Mixed Precision ${MODE}" # === EIGENVALUE TESTS === print_section "Eigenvalue Tests ${MODE}" # Single Real Eigenvalue Tests for input in nep sep se2 svd sec sed sgg sgd ssb ssg sbal sbak sgbal sgbak sbb glm gqr gsv csd lse sdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtsts ${input}.in "Single Real Eigenvalue: ${input} ${MODE}" fi done # Double Real Eigenvalue Tests for input in nep sep se2 svd dec ded dgg dgd dsb dsg dbal dbak dgbal dgbak dbb glm gqr gsv csd lse ddmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstd ${input}.in "Double Real Eigenvalue: ${input} ${MODE}" fi done # Single Complex Eigenvalue Tests for input in nep sep se2 svd cec ced cgg cgd csb csg cbal cbak cgbal cgbak cbb glm gqr gsv csd lse cdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstc ${input}.in "Single Complex Eigenvalue: ${input} ${MODE}" fi done # Double Complex Eigenvalue Tests for input in nep sep se2 svd zec zed zgg zgd zsb zsg zbal zbak zgbal zgbak zbb glm gqr gsv csd lse zdmd; do if [ -f "../TESTING/${input}.in" ]; then run_lapack_test xeigtstz ${input}.in "Double Complex Eigenvalue: ${input} ${MODE}" fi done print_success "All LAPACK tests passed ${MODE}" } # ======================================================================= # Build and test with 32-bit integers (standard mode) # ======================================================================= print_section "Building LAPACK with 32-bit integers" cmake -S . -B build -G Ninja \ $TOOLCHAIN_OPT \ -DCMAKE_Fortran_COMPILER=lfortran \ -DCMAKE_Fortran_FLAGS="--fixed-form-infer --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation --use-loop-variable-after-loop" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_INDEX64=OFF \ -DBUILD_INDEX64_EXT_API=OFF \ -DBUILD_COMPLEX=ON \ -DBUILD_COMPLEX16=ON \ -DBUILD_TESTING=ON cmake --build build -j8 cd build run_lapack_test_suite "" cd .. # ======================================================================= # Build and test with 64-bit integers (ILP64 mode) # ======================================================================= print_section "Building LAPACK with 64-bit integers (ILP64)" rm -rf build cmake -S . -B build -G Ninja \ $TOOLCHAIN_OPT \ -DCMAKE_Fortran_COMPILER=lfortran \ -DCMAKE_Fortran_FLAGS="--fixed-form-infer --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation --use-loop-variable-after-loop -fdefault-integer-8" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_INDEX64=ON \ -DBUILD_INDEX64_EXT_API=OFF \ -DBUILD_COMPLEX=ON \ -DBUILD_COMPLEX16=ON \ -DBUILD_TESTING=ON cmake --build build -j8 cd build run_lapack_test_suite "(ILP64)" cd .. cd .. ' ################################## # Final Summary and Cleanup ################################## print_section "✅ All Third Party Code Tests Completed Successfully" # Optional cleanup # cd ../.. # rm -rf "$TMP_DIR" lfortran-lfortran-2f73434/ci/tarball_update_json.py0000664000175000017500000000122015141516316022607 0ustar alastairalastairimport datetime from json import load, dump import os import sys dest_dir = sys.argv[1] version = sys.argv[2] lfortran_commit_sha = sys.argv[3] filename = "data.json" if os.path.exists(filename): d = load(open(filename)) else: d = {"dev": [], "release": []} entry = { "url": "https://lfortran.github.io/tarballs/%s/lfortran-%s.tar.gz" % \ (dest_dir, version), "version": version, "lfortran_commit_sha": lfortran_commit_sha, "created": str(datetime.datetime.now()) } d[dest_dir].append(entry) print("Saving to %s." % filename) with open(filename, "w") as f: dump(d, f, indent=4, ensure_ascii=False, sort_keys=True) lfortran-lfortran-2f73434/ci/upload_tarball_to_release.sh0000775000175000017500000000120515141516316023752 0ustar alastairalastair#!/usr/bin/env bash set -ex lfortran_version=$(> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_AZURE}" == "" ]]; then echo "Error: SSH_PRIVATE_KEY_AZURE is empty." exit 1 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_AZURE environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_AZURE" | base64 -d) set -x pwd bname="branch-$CI_COMMIT_REF_NAME" git branch -D ${bname} || echo ok git checkout $CI_COMMIT_SHA git checkout -b ${bname} git show-ref git remote -v git push git@ssh.dev.azure.com:v3/lfortran/lfortran/lfortran +${bname}:${bname} --tags lfortran-lfortran-2f73434/ci/environment_docs_linux.yml0000664000175000017500000000104215141516316023541 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - llvmdev=11.1.0 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - python=3.10 - nbsphinx=0.8.9 - myst-parser=0.18.0 - sphinx=4.5.0 - sphinx-copybutton=0.5.0 - lxml=4.9.2 - pip=23.0.1 - unidecode=1.3.6 - text-unidecode=1.3 - python-slugify=8.0.1 - cmake=3.29.1 - pip: - sphinx-material==0.0.35 lfortran-lfortran-2f73434/ci/github_mirror.sh0000775000175000017500000000163015141516316021441 0ustar alastairalastair#!/usr/bin/env bash set -e set -x if [[ $CI_COMMIT_REF_NAME != "master" ]]; then echo "Not on master, skipping mirroring" exit 0 else echo "On master, mirroring to GitHub" fi mkdir ~/.ssh chmod 700 ~/.ssh ssh-keyscan github.com >> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_MIRROR}" == "" ]]; then echo "Error: SSH_PRIVATE_KEY_MIRROR is empty." exit 1 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_MIRROR environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_MIRROR" | base64 -d) set -x pwd git show-ref git remote -v git push git@github.com:lfortran/lfortran.git +origin/master:master --tags lfortran-lfortran-2f73434/ci/nix/0000775000175000017500000000000015141516316017024 5ustar alastairalastairlfortran-lfortran-2f73434/ci/nix/flake.nix0000664000175000017500000001074015141516316020630 0ustar alastairalastair{ description = "LFortran devShell"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; outputs = { self, nixpkgs }: let # TODO: add and test more platforms systems = [ "x86_64-linux" ]; forEachSystem = f: builtins.listToAttrs (map (system: { name = system; value = { default = f system false; clangOnly = f system true; }; }) systems); in { devShells = forEachSystem (system: clangOnly: let pkgs = import nixpkgs { inherit system; }; llvmVersion = "20"; pythonVersion = "313"; llvmPkgs = pkgs.buildPackages."llvmPackages_${llvmVersion}"; myStdenv = if clangOnly then llvmPkgs.stdenv else pkgs.gcc15Stdenv; myBinutils = if clangOnly then llvmPkgs.bintools else pkgs.binutils; mkShellNewEnv = pkgs.mkShell.override { stdenv = myStdenv; }; # We need version 3.4 specifically, see: # https://lfortran.zulipchat.com/#narrow/channel/197339-General/topic/Building.20Lfortran/near/479058294 # TODO: get bison building under clang (use myStdenv) (if at all possible) bison_3_4 = pkgs.gcc15Stdenv.mkDerivation rec { pname = "bison"; version = "3.4.2"; src = pkgs.fetchurl { url = "mirror://gnu/bison/${pname}-${version}.tar.xz"; sha256 = "sha256-J9BVNGmXNdxp6GrdW4CNbLNZAK0/1j+oLj62RDNqv6A="; }; nativeBuildInputs = with pkgs; [ m4 flex perl ]; propagatedBuildInputs = with pkgs; [ m4 ]; configureFlags = [ "--disable-dependency-tracking" ]; doCheck = false; doInstallCheck = true; }; # Probably too niche to be in nixpkgs jupyter_kernel_test = pkgs."python${pythonVersion}Packages".buildPythonPackage rec { pname = "jupyter_kernel_test"; version = "0.7.0"; format = "pyproject"; src = pkgs.fetchPypi { inherit pname version; sha256 = "sha256-B4tv5/dw3RZPlUm916NVZjIlo/+bD3V1rVRtJyOexgk="; }; nativeBuildInputs = with pkgs."python${pythonVersion}Packages"; [ hatchling jsonschema jupyter-client ]; }; # nixpkgs version is 1.3.0, i.e. too old for us # this is largely copied from nixpkgs: xeus_zmq_3_0 = llvmPkgs.stdenv.mkDerivation rec { pname = "xeus-zmq"; version = "3.0.0"; src = pkgs.fetchFromGitHub { owner = "jupyter-xeus"; repo = "xeus-zmq"; rev = "${version}"; hash = "sha256-J9an+D1FLw99uJPCuux4YNRFcBMh24N3+GDoS/G/U28="; }; nativeBuildInputs = with pkgs; [ cmake ]; buildInputs = with pkgs; [ cppzmq libuuid openssl xeus xtl zeromq ]; propagatedBuildInputs = with pkgs; [ nlohmann_json ]; }; in mkShellNewEnv ({ buildInputs = with pkgs; [ pkgs."llvm_${llvmVersion}" pkgs."lld_${llvmVersion}" myBinutils (pkgs."python${pythonVersion}".withPackages (python-pkgs: [ python-pkgs.pytest python-pkgs.toml python-pkgs.numpy python-pkgs.jupyter jupyter_kernel_test ])) xonsh cmake ninja ccache kokkos git re2c bison_3_4 pkgs.pkgsStatic.zlib pkgs.pkgsStatic.zstd xz libbfd libunwind rapidjson libxml2 libuuid openssl pandoc xeus xeus_zmq_3_0 nlohmann_json clang # gcc env fails tests without clang available bashInteractive which gfortran valgrind gdb fmt ]; shellHook = '' set -x echo "LFortran devShell ready, software versions:" c++ --version bison --version llvm-config --version re2c --version ${ if clangOnly then "ld.lld --version" else "ld --version" } set +x ''; }) ); }; } lfortran-lfortran-2f73434/ci/nix/flake.lock0000664000175000017500000000106415141516316020761 0ustar alastairalastair{ "nodes": { "nixpkgs": { "locked": { "lastModified": 1762756533, "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", "owner": "NixOS", "repo": "nixpkgs", "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "nixpkgs": "nixpkgs" } } }, "root": "root", "version": 7 } lfortran-lfortran-2f73434/ci/test_fortran_kernel.py0000664000175000017500000000121415141516316022650 0ustar alastairalastairimport unittest import jupyter_kernel_test as jkt class IRKernelTests(jkt.KernelTests): kernel_name = "fortran" language_name = "fortran" file_extension = ".f90" code_hello_world = 'print *, "hello, world"' #code_stderr = "1x" #complete_code_samples = ['1', 'print *, "hello, world"', # "integer :: i"] #incomplete_code_samples = ["subroutine f("] #code_generate_error = "1x" code_execute_result = [ {'code': "1+2+3", 'result': "6"}, {'code': "1+2", 'result': "3"}, {'code': "integer :: x; x = 5; x*2", 'result': "10"}, ] if __name__ == '__main__': unittest.main() lfortran-lfortran-2f73434/ci/build.sh0000775000175000017500000000651615141516316017674 0ustar alastairalastair#!/usr/bin/env shell set -ex echo "Running SHELL" echo "CONDA_PREFIX=$CONDA_PREFIX" llvm-config --components # Generate the `version` file bash ci/version.sh # Generate a Fortran AST from AST.asdl (C++) python src/libasr/asdl_cpp.py grammar/AST.asdl src/lfortran/ast.h # Generate a Fortran ASR from ASR.asdl (C++) python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h # Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++) python src/libasr/wasm_instructions_visitor.py # Generate the intrinsic_function_registry_util.h (C++) python src/libasr/intrinsic_func_registry_util_gen.py # Generate the tokenizer and parser echo $(pwd) cd src/lfortran/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && cd ../../.. cd src/lfortran/parser && re2c -W -b preprocessor.re -o preprocessor.cpp && cd ../../.. cd src/lfortran/parser && bison -Wall -d -r all parser.yy && cd ../../.. # Generate the LSP sources python src/server/generator/generate_lsp_code.py --schema src/server/generator/metaModel.json --target-language c++ --output-dir src/server pandoc --standalone --to man doc/man/lfortran.md -o doc/man/lfortran.1 # using debugging option i.e. `-x` causes a bug with `cat` command here, # and hence we turned off command tracing set +x lfortran_version=$(cat version) # we re-enable command tracing set -x bash ci/create_source_tarball.sh "$lfortran_version" tar xzf dist/lfortran-$lfortran_version.tar.gz cd lfortran-$lfortran_version mkdir test-bld cd test-bld # Note: we have to build in Release mode on Windows, because `llvmdev` is # compiled in Release mode and we get link failures if we mix and match build # modes: if [[ $WIN == "1" ]]; then # Windows BUILD_TYPE="Release" else # Linux or macOS BUILD_TYPE="Debug" fi cmake -G$LFORTRAN_CMAKE_GENERATOR -DCMAKE_VERBOSE_MAKEFILE=ON -DWITH_LSP=yes -DWITH_LLVM=yes -DWITH_XEUS=yes -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_RUNTIME_STACKTRACE=$ENABLE_RUNTIME_STACKTRACE .. cmake --build . --target install ./src/lfortran/tests/test_lfortran ./src/bin/lfortran < ../src/bin/example_input.txt ctest --output-on-failure cpack -V cd ../.. jupyter kernelspec list --json #python ci/test_fortran_kernel.py -v # cd share/lfortran/nb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Demo1_out.ipynb Demo1.ipynb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Demo2_out.ipynb Demo2.ipynb cat Demo1_out.ipynb jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output "Hello World_out.ipynb" "Hello World.ipynb" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output "Operators Control Flow_out.ipynb" "Operators Control Flow.ipynb" jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=120 --output Variables_out.ipynb Variables.ipynb cd ../../.. if [[ $WIN == "1" ]]; then # Windows cp lfortran-$lfortran_version/test-bld/src/bin/lfortran.exe src/bin cp lfortran-$lfortran_version/test-bld/src/runtime/legacy/lfortran_runtime* src/runtime/ else # Linux or macOS cp lfortran-$lfortran_version/test-bld/src/bin/lfortran src/bin cp lfortran-$lfortran_version/test-bld/src/runtime/liblfortran_runtime* src/runtime/ fi cp lfortran-$lfortran_version/test-bld/src/runtime/*.mod src/runtime/ lfortran-lfortran-2f73434/ci/test_lsp.sh0000664000175000017500000000125715141516316020424 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex echo "Running SHELL" src/bin/lfortran --version cmake --version if [[ $WIN != "1" ]]; then pip install src/server/tests tests/server # NOTE: If you want to print all the messages, even on success, then disable # `--capture` as follows: # -------------------------------------------------------------------------- # pytest -vv --showlocals --capture=no --timeout=10 tests/server timeout -k 10 60s pytest -vv --showlocals --timeout=10 --execution-strategy="concurrent" tests/server timeout -k 10 60s pytest -vv --showlocals --timeout=10 --execution-strategy="parallel" tests/server fi lfortran-lfortran-2f73434/ci/create_source_tarball0.sh0000775000175000017500000000111015141516316023162 0ustar alastairalastair#!/usr/bin/env bash set -ex dest="$1" cmake -E make_directory $dest # Remove files we do not want cmake -E rm src/lfortran/parser/parser.output # Copy Directories: cmake -E copy_directory src $dest/src cmake -E copy_directory share $dest/share cmake -E copy_directory cmake $dest/cmake cmake -E copy_directory examples $dest/examples cmake -E copy_directory doc/man $dest/doc/man # Copy Files: cmake -E copy CMakeLists.txt README.md LICENSE version $dest # Create the tarball cmake -E make_directory dist cmake -E tar cfz dist/$dest.tar.gz $dest cmake -E remove_directory $dest lfortran-lfortran-2f73434/ci/parser.yy.patch0000664000175000017500000001701415141516316021206 0ustar alastairalastairdiff --git a/src/lfortran/parser/parser.yy b/src/lfortran/parser/parser.yy index 300dbffdb..79dbf0b14 100644 --- a/src/lfortran/parser/parser.yy +++ b/src/lfortran/parser/parser.yy @@ -2550,177 +2550,4 @@ id_opt id : TK_NAME { $$ = SYMBOL($1, @$); } - | KW_ABSTRACT { $$ = SYMBOL($1, @$); } - | KW_ALL { $$ = SYMBOL($1, @$); } - | KW_ALLOCATABLE { $$ = SYMBOL($1, @$); } - | KW_ALLOCATE { $$ = SYMBOL($1, @$); } - | KW_ASSIGN { $$ = SYMBOL($1, @$); } - | KW_ASSIGNMENT { $$ = SYMBOL($1, @$); } - | KW_ASSOCIATE { $$ = SYMBOL($1, @$); } - | KW_ASYNCHRONOUS { $$ = SYMBOL($1, @$); } - | KW_BACKSPACE { $$ = SYMBOL($1, @$); } - | KW_BIND { $$ = SYMBOL($1, @$); } - | KW_BLOCK { $$ = SYMBOL($1, @$); } - | KW_CALL { $$ = SYMBOL($1, @$); } - | KW_CASE { $$ = SYMBOL($1, @$); } - | KW_CHANGE { $$ = SYMBOL($1, @$); } - | KW_CHARACTER { $$ = SYMBOL($1, @$); } - | KW_CLASS { $$ = SYMBOL($1, @$); } - | KW_CLOSE { $$ = SYMBOL($1, @$); } - | KW_CODIMENSION { $$ = SYMBOL($1, @$); } - | KW_COMMON { $$ = SYMBOL($1, @$); } - | KW_COMPLEX { $$ = SYMBOL($1, @$); } - | KW_CONCURRENT { $$ = SYMBOL($1, @$); } - | KW_CONTAINS { $$ = SYMBOL($1, @$); } - | KW_CONTIGUOUS { $$ = SYMBOL($1, @$); } - | KW_CONTINUE { $$ = SYMBOL($1, @$); } - | KW_CRITICAL { $$ = SYMBOL($1, @$); } - | KW_CYCLE { $$ = SYMBOL($1, @$); } - | KW_DATA { $$ = SYMBOL($1, @$); } - | KW_DEALLOCATE { $$ = SYMBOL($1, @$); } - | KW_DEFAULT { $$ = SYMBOL($1, @$); } - | KW_DEFERRED { $$ = SYMBOL($1, @$); } - | KW_DIMENSION { $$ = SYMBOL($1, @$); } - | KW_DO { $$ = SYMBOL($1, @$); } - | KW_DOWHILE { $$ = SYMBOL($1, @$); } - | KW_DOUBLE { $$ = SYMBOL($1, @$); } - | KW_DOUBLE_PRECISION { $$ = SYMBOL($1, @$); } - | KW_DOUBLE_COMPLEX { $$ = SYMBOL($1, @$); } - | KW_ELEMENTAL { $$ = SYMBOL($1, @$); } - | KW_ELSE { $$ = SYMBOL($1, @$); } - | KW_ELSEIF { $$ = SYMBOL($1, @$); } - | KW_ELSEWHERE { $$ = SYMBOL($1, @$); } - | KW_END { $$ = SYMBOL($1, @$); } - | KW_ENDDO { $$ = SYMBOL($1, @$); } - | KW_ENDIF { $$ = SYMBOL($1, @$); } - | KW_ENDINTERFACE { $$ = SYMBOL($1, @$); } - | KW_ENDTYPE { $$ = SYMBOL($1, @$); } - | KW_ENDPROGRAM { $$ = SYMBOL($1, @$); } - | KW_ENDMODULE { $$ = SYMBOL($1, @$); } - | KW_ENDSUBMODULE { $$ = SYMBOL($1, @$); } - | KW_ENDBLOCK { $$ = SYMBOL($1, @$); } - | KW_ENDBLOCKDATA { $$ = SYMBOL($1, @$); } - | KW_ENDSUBROUTINE { $$ = SYMBOL($1, @$); } - | KW_ENDFUNCTION { $$ = SYMBOL($1, @$); } - | KW_ENDPROCEDURE { $$ = SYMBOL($1, @$); } - | KW_ENDENUM { $$ = SYMBOL($1, @$); } - | KW_ENDSELECT { $$ = SYMBOL($1, @$); } - | KW_ENDASSOCIATE { $$ = SYMBOL($1, @$); } - | KW_ENDFORALL { $$ = SYMBOL($1, @$); } - | KW_ENDWHERE { $$ = SYMBOL($1, @$); } - | KW_ENDCRITICAL { $$ = SYMBOL($1, @$); } - | KW_ENDFILE { $$ = SYMBOL($1, @$); } - | KW_ENTRY { $$ = SYMBOL($1, @$); } - | KW_ENUM { $$ = SYMBOL($1, @$); } - | KW_ENUMERATOR { $$ = SYMBOL($1, @$); } - | KW_EQUIVALENCE { $$ = SYMBOL($1, @$); } - | KW_ERRMSG { $$ = SYMBOL($1, @$); } - | KW_ERROR { $$ = SYMBOL($1, @$); } - | KW_EVENT { $$ = SYMBOL($1, @$); } - | KW_EXIT { $$ = SYMBOL($1, @$); } - | KW_EXTENDS { $$ = SYMBOL($1, @$); } - | KW_EXTERNAL { $$ = SYMBOL($1, @$); } - | KW_FILE { $$ = SYMBOL($1, @$); } - | KW_FINAL { $$ = SYMBOL($1, @$); } - | KW_FLUSH { $$ = SYMBOL($1, @$); } - | KW_FORALL { $$ = SYMBOL($1, @$); } - | KW_FORMATTED { $$ = SYMBOL($1, @$); } - | KW_FORM { $$ = SYMBOL($1, @$); } - | KW_FORM_TEAM { $$ = SYMBOL($1, @$); } - | KW_FUNCTION { $$ = SYMBOL($1, @$); } - | KW_GENERIC { $$ = SYMBOL($1, @$); } - | KW_GO { $$ = SYMBOL($1, @$); } - | KW_GOTO { $$ = SYMBOL($1, @$); } - | KW_IF { $$ = SYMBOL($1, @$); } - | KW_IMAGES { $$ = SYMBOL($1, @$); } - | KW_IMPLICIT { $$ = SYMBOL($1, @$); } - | KW_IMPORT { $$ = SYMBOL($1, @$); } - | KW_IMPURE { $$ = SYMBOL($1, @$); } - | KW_IN { $$ = SYMBOL($1, @$); } - | KW_INCLUDE { $$ = SYMBOL($1, @$); } - | KW_INOUT { $$ = SYMBOL($1, @$); } - | KW_INQUIRE { $$ = SYMBOL($1, @$); } - | KW_INSTANTIATE { $$ = SYMBOL($1, @$); } - | KW_INTEGER { $$ = SYMBOL($1, @$); } - | KW_INTENT { $$ = SYMBOL($1, @$); } - | KW_INTERFACE { $$ = SYMBOL($1, @$); } - | KW_INTRINSIC { $$ = SYMBOL($1, @$); } - | KW_IS { $$ = SYMBOL($1, @$); } - | KW_KIND { $$ = SYMBOL($1, @$); } - | KW_LEN { $$ = SYMBOL($1, @$); } - | KW_LOCAL { $$ = SYMBOL($1, @$); } - | KW_LOCAL_INIT { $$ = SYMBOL($1, @$); } - | KW_LOGICAL { $$ = SYMBOL($1, @$); } - | KW_MEMORY { $$ = SYMBOL($1, @$); } - | KW_MODULE { $$ = SYMBOL($1, @$); } - | KW_MOLD { $$ = SYMBOL($1, @$); } - | KW_NAME { $$ = SYMBOL($1, @$); } - | KW_NAMELIST { $$ = SYMBOL($1, @$); } - | KW_NEW_INDEX { $$ = SYMBOL($1, @$); } - | KW_NOPASS { $$ = SYMBOL($1, @$); } - | KW_NON_INTRINSIC { $$ = SYMBOL($1, @$); } - | KW_NON_OVERRIDABLE { $$ = SYMBOL($1, @$); } - | KW_NON_RECURSIVE { $$ = SYMBOL($1, @$); } - | KW_NONE { $$ = SYMBOL($1, @$); } - | KW_NULLIFY { $$ = SYMBOL($1, @$); } - | KW_ONLY { $$ = SYMBOL($1, @$); } - | KW_OPEN { $$ = SYMBOL($1, @$); } - | KW_OPERATOR { $$ = SYMBOL($1, @$); } - | KW_OPTIONAL { $$ = SYMBOL($1, @$); } - | KW_OUT { $$ = SYMBOL($1, @$); } - | KW_PARAMETER { $$ = SYMBOL($1, @$); } - | KW_PASS { $$ = SYMBOL($1, @$); } - | KW_POINTER { $$ = SYMBOL($1, @$); } - | KW_POST { $$ = SYMBOL($1, @$); } - | KW_PRECISION { $$ = SYMBOL($1, @$); } - | KW_PRINT { $$ = SYMBOL($1, @$); } - | KW_PRIVATE { $$ = SYMBOL($1, @$); } - | KW_PROCEDURE { $$ = SYMBOL($1, @$); } - | KW_PROGRAM { $$ = SYMBOL($1, @$); } - | KW_PROTECTED { $$ = SYMBOL($1, @$); } - | KW_PUBLIC { $$ = SYMBOL($1, @$); } - | KW_PURE { $$ = SYMBOL($1, @$); } - | KW_QUIET { $$ = SYMBOL($1, @$); } - | KW_RANK { $$ = SYMBOL($1, @$); } - | KW_READ { $$ = SYMBOL($1, @$); } - | KW_REAL { $$ = SYMBOL($1, @$); } - | KW_RECURSIVE { $$ = SYMBOL($1, @$); } - | KW_REDUCE { $$ = SYMBOL($1, @$); } - | KW_REQUIREMENT { $$ = SYMBOL($1, @$); } - | KW_REQUIRE { $$ = SYMBOL($1, @$); } - | KW_RESULT { $$ = SYMBOL($1, @$); } - | KW_RETURN { $$ = SYMBOL($1, @$); } - | KW_REWIND { $$ = SYMBOL($1, @$); } - | KW_SAVE { $$ = SYMBOL($1, @$); } - | KW_SELECT { $$ = SYMBOL($1, @$); } - | KW_SELECT_CASE { $$ = SYMBOL($1, @$); } - | KW_SELECT_RANK { $$ = SYMBOL($1, @$); } - | KW_SELECT_TYPE { $$ = SYMBOL($1, @$); } - | KW_SEQUENCE { $$ = SYMBOL($1, @$); } - | KW_SHARED { $$ = SYMBOL($1, @$); } - | KW_SOURCE { $$ = SYMBOL($1, @$); } - | KW_STAT { $$ = SYMBOL($1, @$); } - | KW_STOP { $$ = SYMBOL($1, @$); } - | KW_SUBMODULE { $$ = SYMBOL($1, @$); } - | KW_SUBROUTINE { $$ = SYMBOL($1, @$); } - | KW_SYNC { $$ = SYMBOL($1, @$); } - | KW_TARGET { $$ = SYMBOL($1, @$); } - | KW_TEAM { $$ = SYMBOL($1, @$); } - | KW_TEAM_NUMBER { $$ = SYMBOL($1, @$); } - | KW_TEMPLATE { $$ = SYMBOL($1, @$); } - | KW_THEN { $$ = SYMBOL($1, @$); } - | KW_TO { $$ = SYMBOL($1, @$); } - | KW_TYPE { $$ = SYMBOL($1, @$); } - | KW_UNFORMATTED { $$ = SYMBOL($1, @$); } - | KW_USE { $$ = SYMBOL($1, @$); } - | KW_VALUE { $$ = SYMBOL($1, @$); } - | KW_VOLATILE { $$ = SYMBOL($1, @$); } - | KW_WAIT { $$ = SYMBOL($1, @$); } - | KW_WHERE { $$ = SYMBOL($1, @$); } - | KW_WHILE { $$ = SYMBOL($1, @$); } - | KW_WRITE { $$ = SYMBOL($1, @$); } - | KW_LIST { $$ = SYMBOL($1, @$); } - | KW_SET { $$ = SYMBOL($1, @$); } - | KW_DICT { $$ = SYMBOL($1, @$); } - | KW_TUPLE { $$ = SYMBOL($1, @$); } ; lfortran-lfortran-2f73434/ci/upload_docs.sh0000775000175000017500000000264015141516316021063 0ustar alastairalastair#!/usr/bin/env bash set -e set -x git_ref=${GITHUB_REF} if [[ $git_ref != "refs/heads/main" ]]; then # Development version dest_branch=${git_ref} deploy_repo="git@gitlab.com:lfortran/web/docs.lfortran.org-testing.git" else # Release version dest_branch="master" deploy_repo="git@github.com:lfortran/docs.lfortran.org.git" fi mkdir ~/.ssh chmod 700 ~/.ssh ssh-keyscan gitlab.com >> ~/.ssh/known_hosts ssh-keyscan github.com >> ~/.ssh/known_hosts eval "$(ssh-agent -s)" set +x if [[ "${SSH_PRIVATE_KEY_DOCS}" == "" ]]; then echo "Note: SSH_PRIVATE_KEY_DOCS is empty, skipping..." exit 0 fi # Generate the private/public key pair using: # # ssh-keygen -f deploy_key -N "" # # then set the $SSH_PRIVATE_KEY_DOCS environment variable in the GitLab-CI to # the base64 encoded private key: # # cat deploy_key | base64 -w0 # # and add the public key `deploy_key.pub` into the target git repository (with # write permissions). ssh-add <(echo "$SSH_PRIVATE_KEY_DOCS" | base64 -d) set -x D=`pwd` mkdir $HOME/repos cd $HOME/repos git clone ${deploy_repo} docs-deploy cd docs-deploy rm -rf docs mkdir docs echo "docs.lfortran.org" > docs/CNAME touch docs/.nojekyll cp -r $D/site/* docs/ git config user.name "Deploy" git config user.email "noreply@deploy" COMMIT_MESSAGE="Deploying on $(date "+%Y-%m-%d %H:%M:%S")" git add docs git commit -m "${COMMIT_MESSAGE}" git push origin +master:$dest_branch lfortran-lfortran-2f73434/ci/create_source_tarball.sh0000775000175000017500000000022115141516316023104 0ustar alastairalastair#!/usr/bin/env bash set -ex lfortran_version=$1 export dest=lfortran-$lfortran_version bash -x -o errexit ci/create_source_tarball0.sh "$dest" lfortran-lfortran-2f73434/ci/grammar_conflicts.sh0000775000175000017500000001007515141516316022262 0ustar alastairalastair#!/usr/bin/env bash # # Check for Essential Conflicts in Bison Grammar # # We parse Fortran using a GLR parser that has non-essential conflicts caused # by the keyword/id ambiguity, but no essential conflicts (any other conflict). # # Non-essential conflict: We define a non-essential conflict as one that is # caused by the keywords (`KW_*`) in the `id` rule conflicting with other # rules. A non-essential conflict disappears when we remove those keywords from # the `id` rule. These conflicts cannot actually cause an ambiguity in the # Fortran grammar due to the way it is carefully constructed/defined: one can # always determine from the context if a given name is a user-defined name or a # keyword in some Fortran construct. However to make this determination one has # to understand the context (the grammar is not context free). # # Essential conflict: We define an essential conflict as such conflict that # does not disappear when when we remove the keywords from the `id` rule. The # full Fortran grammar does not have any such conflicts. We thus enforce in our # Bison implementation that we do not have any essential conflicts either. # # Motivation: the keyword/id ambiguity cannot be avoided in Fortran and must be # either handled by a strong tokenizer that parses the source code using # a recursive descent parser to fully disambiguate a keyword and an id and then # the Bison parser can be LALR(1). Or by having a simple tokenizer that # tokenizes names as `KW_*` tokens if they match any kwyword and an `TK_NAME` # otherwise, and then in the Bison grammar we have a rule that `id` is either # `TK_NAME` or any `KW_*`. This broad rule however causes up to 500 conflicts # (total of shift/reduce and reduce/reduce) in the full grammar (we call these # conflicts non-essential), and the grammar is thus not LALR(1) anymore, and we # have to use the GLR parser. However, these non-essential conflicts cannot # make the GLR parser to return "ambiguous syntax" error, since Fortran code # can always be disambiguated from the full context, so the GLR parser always # recovers. On the other hand, any essential conflict will cause true ambiguity # in the grammar that is there even if keywords are disambiguated, and thus can # make the GLR parser to fail on valid code. The other motivation is that # essential conflicts can easily make the GLR grammar to have thousands of # conflicts, making the GLR parser very slow. By ensuring that all our # conflicts are non-essential, the GLR grammar executes quickly, because all # concurrent parsers are short lived due to the nature of these non-essential # conflicts and the Fortran grammar guarantees that all these parser will # merge. An essential conflict could make a concurrent parser to run long, and # it is not guaranteed by the Fortran grammar that they will all merge. The # third motivation is to keep the door open to use LALR(1) grammar and a strong # tokenizer in the future: this script is ensuring that we can always convert # our GLR grammar to an LALR(1) grammar with no conflicts, that would require a # strong tokenizer to disambiguate the `TK_NAME` and `KW_*` tokens. That way we # are maintaining a full conflict-free LALR(1) Fortran grammar as a foundation, # and then we have options how to implement the id/keyword ambiguity resolution # on top, currently we do it using a GLR grammar. # # How we test: To test for essential conflicts, we remove all non-essential # conflicts as follows: this test patches the parser.yy to remove all `KW_*` # keywords from the `id` rule. Then we remove the `%glr-parser` line (which # makes Bison treat the parser as LALR(1)) and change the `%expect` lines to # expect 0 conflicts. We run Bison and ensure it gives no errors. This ensures # there are no essential conflicts in the GLR grammar. set -ex patch -p1 < ci/parser.yy.patch sed -i '/^%expect-rr/d' src/lfortran/parser/parser.yy sed -i 's/^%expect .*/%expect 0/' src/lfortran/parser/parser.yy sed -i '/^%glr-parser/d' src/lfortran/parser/parser.yy (cd src/lfortran/parser && bison -Wall -d -r all parser.yy) echo "Patched grammar is LALR(1), no essential conflicts in GLR." lfortran-lfortran-2f73434/ci/upload_lfortran_wasm.sh0000775000175000017500000000613515141516316023014 0ustar alastairalastair#!/usr/bin/env bash set -e set -x deploy_repo_pull="https://github.com/lfortran/wasm_builds.git" deploy_repo_push="git@github.com:lfortran/wasm_builds.git" git_hash=$(git rev-parse --short "$GITHUB_SHA") git_ref=${GITHUB_REF} # Determine dest_dir based on git ref # - Main branch pushes go to "dev" (debug builds) # - Tags starting with 'v' go to "release" (release builds) if [[ ${git_ref} == "refs/heads/main" ]]; then dest_dir="dev" echo "Main branch detected: using dest_dir=${dest_dir}" elif [[ ${git_ref:0:11} == "refs/tags/v" ]]; then dest_dir="release" echo "Release tag detected: using dest_dir=${dest_dir}" else # We are either on a non-main branch or tagged with a tag that does # not start with v*. We run the script for testing but do not upload. dest_dir="release" echo "Not a main branch, not tagged with v*, using dest_dir=${dest_dir} for testing..." fi lfortran_version=$(> ~/.ssh/known_hosts eval "$(ssh-agent -s)" D=`pwd` mkdir $HOME/repos cd $HOME/repos git clone ${deploy_repo_pull} wasm_builds mkdir -p wasm_builds/docs/${dest_dir}/${git_hash} cd wasm_builds/docs cp $D/src/bin/lfortran.js ${dest_dir}/${git_hash}/lfortran.js cp $D/src/bin/lfortran.wasm ${dest_dir}/${git_hash}/lfortran.wasm cp $D/src/bin/lfortran.data ${dest_dir}/${git_hash}/lfortran.data echo "$git_hash" > ${dest_dir}/latest_commit # overwrite the file instead of appending to it python $D/ci/wasm_builds_update_json.py ${dest_dir} ${lfortran_version} ${git_hash} # Move back to wasm_builds/ directory to perform git operations # This ensures docs/ remains as a subdirectory in the committed structure cd .. # Wipe git history to keep repository size small # This ensures only one commit exists, making old builds unreachable for GitHub GC echo "Wiping git history and creating fresh orphaned commit..." rm -rf .git git init -b main git config user.name "Deploy" git config user.email "noreply@deploylfortran.com" COMMIT_MESSAGE="Deploy ${dest_dir} build ${git_hash} on $(date "+%Y-%m-%d %H:%M:%S")" git add . git commit -m "${COMMIT_MESSAGE}" git show HEAD -p --stat dest_commit=$(git show HEAD -s --format=%H) if [[ ${git_ref} == "refs/heads/main" ]]; then echo "The pipeline was triggered from the main branch" else if [[ ${git_ref:0:11} == "refs/tags/v" ]]; then echo "The pipeline was triggered from a tag 'v*'" else # We are either on a non-main branch, or tagged with a tag that does # not start with v*. We skip the upload. echo "Not a main branch, not tagged with v*, skipping..." exit 0 fi fi set +x if [[ "${SSH_PRIVATE_KEY_WASM_BUILDS}" == "" ]]; then echo "Note: SSH_PRIVATE_KEY_WASM_BUILDS is empty, skipping..." exit 0 fi ssh-add <(echo "$SSH_PRIVATE_KEY_WASM_BUILDS" | base64 -d) set -x # Force push since we're creating a fresh orphaned commit each time # This keeps the repository at exactly one reachable commit git push --force ${deploy_repo_push} main:main echo "New orphaned commit force-pushed at:" echo "https://github.com/lfortran/wasm_builds/commit/${dest_commit}" lfortran-lfortran-2f73434/ci/test.sh0000664000175000017500000000456315141516316017551 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex echo "Running SHELL" # Run some simple compilation tests, works everywhere: src/bin/lfortran --version # Compile and link separately src/bin/lfortran -c examples/expr2.f90 -o expr2.o src/bin/lfortran -o expr2 expr2.o ./expr2 # Compile C and Fortran src/bin/lfortran -c integration_tests/modules_15b.f90 -o modules_15b.o src/bin/lfortran -c integration_tests/modules_15.f90 -o modules_15.o if [[ $WIN == "1" ]]; then # Windows cl /MD /c integration_tests/modules_15c.c /Fomodules_15c.o elif [[ $MACOS == "1" ]]; then # macOS clang -c integration_tests/modules_15c.c -o modules_15c.o else # Linux gcc -c integration_tests/modules_15c.c -o modules_15c.o fi src/bin/lfortran modules_15.o modules_15b.o modules_15c.o -o modules_15 ./modules_15 # Compile and link in one step src/bin/lfortran integration_tests/intrinsics_04s.f90 -o intrinsics_04s ./intrinsics_04s src/bin/lfortran integration_tests/intrinsics_04.f90 -o intrinsics_04 ./intrinsics_04 # Run all tests (does not work on Windows yet): cmake --version if [[ $WIN != "1" ]]; then # using debugging option i.e. `-x` causes incorrect assignment set +x if [[ $MACOS == "1" ]]; then # we can't use $nproc, it overwhelms system resources on macOS NPROC=2 # ideally, we should use something like below, but it raises # error with shell # NPROC=$(( $(NPROC) / 2)) else # this works fine on Linux NPROC=$(nproc) fi # we turn on the debugging again set -x echo "NPROC: ${NPROC}" if [[ $LFORTRAN_LLVM_VERSION == "11" ]]; then ./run_tests.py fi cd integration_tests mkdir build-lfortran-llvm cd build-lfortran-llvm FC="../../src/bin/lfortran" cmake -DLFORTRAN_BACKEND=llvm -DCURRENT_BINARY_DIR=. .. make -j${NPROC} ctest -L llvm -j${NPROC} cd .. ./run_tests.py -b llvm llvm2 llvm_rtlib llvm_nopragma llvm_integer_8 ./run_tests.py -b llvm2 llvm_rtlib llvm_nopragma llvm_integer_8 -f ./run_tests.py -b llvm -f -nf16 cd .. pip install src/server/tests tests/server # NOTE: `--full-trace` tends to print excessively long stack traces. Please # re-enable it if needed: # pytest -vv --showlocals --full-trace --capture=no --timeout=5 tests/server # pytest -vv --showlocals --capture=no --timeout=5 tests/server fi lfortran-lfortran-2f73434/ci/environment.yml0000664000175000017500000000062415141516316021317 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - python=3.10 - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - nbconvert=7.4.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - ninja=1.11.1 - rapidjson=1.1.0 - cmake=3.29.1 - shell=0.2.0 # - m4=1.4.19 [not win] # - bison=3.4 [not win] # - m2-bison=3.4 [win] lfortran-lfortran-2f73434/ci/generate_lalr1_patch.py0000775000175000017500000000302515141516316022647 0ustar alastairalastair#!/usr/bin/env python3 """ This script generates the parser.yy.patch that makes the GLR parser a LALR(1) parser. Usage: ci/generate_lalr1_patch.py """ import subprocess # Check if git diff shows any changes using return code result = subprocess.run(['git', 'diff'], capture_output=True, text=True) if result.returncode != 0: print("Git diff shows changes. Please commit the changes first.") exit(1) # Define file paths file_path = 'src/lfortran/parser/parser.yy' patch_path = 'ci/parser.yy.patch' # Read the file with open(file_path, 'r') as f: lines = f.readlines() # Modify id section for j in range(len(lines) - 1): if lines[j].strip() == 'id' and \ ': TK_NAME { $$ = SYMBOL($1, @$); }' in lines[j+1]: # Delete all subsequent | KW_* lines until ; k = j + 2 while k < len(lines) and lines[k].strip() != ';': stripped_line = lines[k].strip() if not stripped_line.startswith('| KW'): raise ValueError(f"Unexpected line in id section: {stripped_line}") del lines[k] # No k += 1, as del shifts the list break # Write modified lines back to the file with open(file_path, 'w') as f: f.writelines(lines) # Generate the patch using git diff with open(patch_path, 'w') as patch_file: subprocess.run(['git', 'diff', '--', file_path], stdout=patch_file, check=True) # Restore the original file to remove changes subprocess.run(['git', 'restore', file_path], check=True) print(f"Patch generated and saved to {patch_path}") lfortran-lfortran-2f73434/ci/test_cpp_version.sh0000664000175000017500000000132515141516316022151 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex # TODO: this file has been ported from a xonsh file, hence # we need to re-check the below FIXME # FIXME: Using the below flag generates many warnings. # os.environ['CXXFLAGS'] = "-Werror" echo "CONDA_PREFIX=$CONDA_PREFIX" ./build0.sh cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PWD -DCMAKE_BUILD_TYPE=Debug -DWITH_JSON=yes -DWITH_BENCHMARKS=yes . cmake --build . --target install -j16 ctest --output-on-failure ./src/bin/parse echo "Testing libasr - CPP" mkdir build cd build cp -r ../src/libasr . cd libasr cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PWD -DCMAKE_BUILD_TYPE=Debug . cmake --build . -j16 lfortran-lfortran-2f73434/ci/environment_linux_llvm.yml0000664000175000017500000000045015141516316023565 0ustar alastairalastairname: lf channels: - conda-forge dependencies: - toml=0.10.2 - pytest=8.1.1 - jupyter=1.0.0 - xeus=5.1.0 - xeus-zmq=3.0.0 - nlohmann_json=3.11.3 - jupyter_kernel_test=0.7.0 - re2c=3.1 - numpy=1.26.4 - bison=3.4 - rapidjson=1.1.0 - ninja=1.11.1 - zlib - cmake=3.29.1 lfortran-lfortran-2f73434/ci/test_without_llvm_backend.sh0000664000175000017500000000064715141516316024034 0ustar alastairalastair#!/usr/bin/env shell # This is a cross-platform `shell` script. set -ex # TODO: this file has been ported from a xonsh file, hence # we need to re-check the below FIXME # FIXME: Using the below flag generates many warnings. # os.environ['CXXFLAGS'] = "-Werror" ./build0.sh cmake -DWITH_LSP=yes -DWITH_JSON=yes -DCMAKE_BUILD_TYPE=Debug . make -j16 ctest --output-on-failure ./run_tests.py --no-llvm --skip-run-with-dbg lfortran-lfortran-2f73434/.well-known/0000775000175000017500000000000015141516316020006 5ustar alastairalastairlfortran-lfortran-2f73434/.well-known/funding-manifest-urls0000664000175000017500000000004115141516316024145 0ustar alastairalastairhttps://lfortran.org/funding.jsonlfortran-lfortran-2f73434/LICENSE0000664000175000017500000005047215141516316016650 0ustar alastairalastairBSD 3-Clause License Copyright (c) 2019-2020, Triad National Security, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. -------------------------------------------------------------------------------- The file src/libasr/codegen/KaleidoscopeJIT.h is available under the Apache 2.0 License with LLVM exception Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---- LLVM Exceptions to the Apache 2.0 License ---- As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into an Object form of such source code, you may redistribute such embedded portions in such Object form without complying with the conditions of Sections 4(a), 4(b) and 4(d) of the License. In addition, if you combine or link compiled forms of this Software with software that is licensed under the GPLv2 ("Combined Software") and if a court of competent jurisdiction determines that the patent provision (Section 3), the indemnity provision (Section 9) or other Section of the License conflicts with the conditions of the GPLv2, you may retroactively and prospectively choose to deem waived or otherwise exclude such Section(s) of the License, but only in their entirety and only with respect to the Combined Software. ============================================================================== Software from third parties included in the LLVM Project: ============================================================================== The LLVM Project contains third party software which is under different license terms. All such code will be identified clearly using at least one of two mechanisms: 1) It will be in a separate directory tree with its own `LICENSE.txt` or `LICENSE` file at the top containing the specific license and restrictions which apply to that software, or 2) It will contain specific license and restriction terms at the top of every file. ============================================================================== Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): ============================================================================== University of Illinois/NCSA Open Source License Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: LLVM Team University of Illinois at Urbana-Champaign http://llvm.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. * Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. -------------------------------------------------------------------------------- The file src/tests/doctest.h is available under the MIT License The MIT License (MIT) Copyright (c) 2016-2023 Viktor Kirilov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- The files src/bin/tpl/whereami/whereami.cpp and src/bin/tpl/whereami/whereami.h are available under the MIT License or the WTF License Copyright Gregory Pakosz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. 1. Bla bla bla 2. Montesqieu et camembert, vive la France, zut alors! -------------------------------------------------------------------------------- WTFPLv2 is very permissive, see http://www.wtfpl.net/faq/ However, if this WTFPLV2 is REALLY a blocker and is the reason you can't use this project, contact me and I'll dual license it. lfortran-lfortran-2f73434/integration_tests/0000775000175000017500000000000015141516316021400 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/derived_types_19_module.f900000664000175000017500000000203415141516316026443 0ustar alastairalastairmodule derived_types_module_19 implicit none public :: child_value type, abstract :: toml_value character(len=:), allocatable :: key end type toml_value type, extends(toml_value) :: child_value logical :: ok end type child_value interface new module procedure :: check_proc end interface new contains subroutine check_proc() class(toml_value), pointer :: ptr type(child_value), pointer :: array if (associated(ptr)) then select type(ptr) type is(child_value) if (ptr%ok) then array => ptr else call not_ok() return end if class default call default_class() return end select end if end subroutine check_proc subroutine not_ok() print *, "not ok" end subroutine subroutine default_class() print *, "default class" end subroutine end module derived_types_module_19 lfortran-lfortran-2f73434/integration_tests/intrinsics_26.f900000664000175000017500000000110115141516316024405 0ustar alastairalastairmodule stdlib_bitsets_64 implicit none contains logical function all_set(x, num_bits) result(res) integer, intent(in) :: x integer, intent(in) :: num_bits logical, intrinsic :: btest integer :: pos res = .true. do pos = 0, num_bits - 1 if ( .not. btest(x, pos) ) then res = .false. end if end do end function all_set end module program intrinsics_26 use stdlib_bitsets_64, only : all_set implicit none integer :: i = 31 print *, all_set(i, 5) end programlfortran-lfortran-2f73434/integration_tests/modules_36.f900000664000175000017500000000215515141516316023703 0ustar alastairalastairmodule modules_36_fpm_main_01 type :: fpm_build_settings logical :: list=.false. end type type, extends(fpm_build_settings) :: fpm_run_settings ! TODO: Set allocatable attribute after supporting ! allocation of StructInstanceMember character(len=5) :: name(2) character(len=4) :: args character(len=6) :: runner logical :: example end type contains subroutine cmd_run(settings, test) class(fpm_run_settings), intent(in) :: settings logical :: found(size(settings%name)) logical :: toomany logical, intent(in) :: test if ( any(.not.found) & & .or. & & ( (toomany .and. .not.test) .or. (toomany .and. settings%runner /= '') ) & & .and. & & .not.settings%list) then end if end subroutine cmd_run end module modules_36_fpm_main_01 program modules_36 use modules_36_fpm_main_01 implicit none type(fpm_run_settings) :: settings ! TODO: Re-enable after supporting allocation of StructInstanceMember ! allocate(settings%name(2)) ! allocate(character(len=4)::settings%args) ! allocate(character(len=6)::settings%runner) call cmd_run(settings, .true.) end program lfortran-lfortran-2f73434/integration_tests/arrays_03_size.f900000664000175000017500000000105415141516316024555 0ustar alastairalastairprogram arrays_03_size implicit none integer :: i, a(3), b(4) integer :: size_a integer :: size_b integer :: size_fjac real :: x(3), fvec(15), fjac(size(fvec), size(x)) size_a = size(a, kind=4) size_b = size(b, dim=1, kind=4) if (size_a /= 3) error stop if (size_b /= 4) error stop ! issue - 1133 size_fjac = size(fjac, 1) if (size_fjac /= 15) error stop i = 1 size_fjac = size(fjac, i) if (size_fjac /= 15) error stop size_fjac = size(fjac, 2) if (size_fjac /= 3) error stop end lfortran-lfortran-2f73434/integration_tests/class_103.f900000664000175000017500000000143515141516316023413 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/2925 ! Typed allocation of polymorphic arrays with data members ! MRE from issue comment by difference-scheme (the data member variant) module class_103_m type :: Base real :: data = 2.0 end type Base type, extends(Base) :: Extended end type Extended contains subroutine allocator(array) class(Base), allocatable, intent(out) :: array(:) allocate( Extended :: array(1) ) end subroutine allocator end module class_103_m program class_103 use class_103_m implicit none class(Base), allocatable :: arr(:) call allocator(arr) if (.not. allocated(arr)) error stop if (size(arr) /= 1) error stop if (abs(arr(1)%data - 2.0) > 1e-6) error stop print *, "PASS" end program class_103 lfortran-lfortran-2f73434/integration_tests/openmp_50.f900000664000175000017500000000056115141516316023524 0ustar alastairalastair program openmp_50 use omp_lib implicit none integer :: i=0,n=10 call omp_set_num_threads(8) !$OMP PARALLEL !$OMP MASTER do i = 1, n !$OMP TASK private(i) print *, "Task ",i,"done by TID:-",omp_get_thread_num() !$OMP END TASK end do !$OMP END MASTER !$OMP END PARALLEL end program openmp_50 lfortran-lfortran-2f73434/integration_tests/subroutines_14.f900000664000175000017500000000073315141516316024611 0ustar alastairalastairsubroutine check_logical(expression) logical, intent(in) :: expression print *, expression if (.not. expression) error stop end subroutine check_logical subroutine test_trueloc_empty() real, allocatable :: avec(:), bvec(:) allocate(avec(10)) allocate(bvec(10)) avec = 0 bvec = 0 call check_logical(all(bvec == avec)) end subroutine test_trueloc_empty program subroutines_14 call test_trueloc_empty() end program lfortran-lfortran-2f73434/integration_tests/modules_21.f900000664000175000017500000000005715141516316023674 0ustar alastairalastairprogram modules_21 use modules_21b end program lfortran-lfortran-2f73434/integration_tests/string_75.f900000664000175000017500000000052315141516316023541 0ustar alastairalastairmodule string_75_mod implicit none contains character function tolower (c) result (res) character, intent(in) :: c res = merge (achar (iachar (c) + 32), c, c >= 'A' .and. c <= 'Z') end function end module program string_75 use string_75_mod implicit none if (tolower("A") /= "a") error stop end program string_75 lfortran-lfortran-2f73434/integration_tests/intrinsics_335.f900000664000175000017500000000147315141516316024504 0ustar alastairalastair program intrinsics_335 integer(4) :: i1 integer(8) :: i2 real(4) :: r1 real(8) :: r2 complex(4) :: c1 complex(8) :: c2 complex(8) :: arr2(3) = [(5._8, 7._8), (8.2_8, 7.12_8), (1.2_8, 3.4_8)] i1 = 2 i2 = 5 r1 = 2.0 r2 = 5._8 c1 = (1.0, 2.0) c2 = (1._8, 2._8) print *, kind(real(i1)) if (kind(real(i1)) /= 4) error stop print *, kind(real(i2)) if (kind(real(i2)) /= 4) error stop print *, kind(real(r1)) if (kind(real(r1)) /= 4) error stop print *, kind(real(r2)) if (kind(real(r2)) /= 4) error stop print *, kind(real(c1)) if (kind(real(c1)) /= 4) error stop print *, kind(real(c2)) if (kind(real(c2)) /= 8) error stop print *, kind(real(arr2)) if (kind(real(arr2)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_04b.f900000664000175000017500000000025015141516316026733 0ustar alastairalastairsubroutine sub(afb) real afb(3) print *, sum(afb) if ( .not. ( (abs(sum(afb) - 9.0) > 1e-8) .or. (abs(sum(afb) - 3.0) > 1e-8) ) ) error stop end subroutine lfortran-lfortran-2f73434/integration_tests/format_14.f900000664000175000017500000000304415141516316023515 0ustar alastairalastair! test "T"/"TL"/"TR" format specifier program format_14 implicit none character(len=30) wr character(len=20) :: hello_god hello_god = "Hello God!" ! Test "T" format specifier (tab) write(wr, '(I5, T6, F5.2)') 1, sqrt(real(1)) print *, wr if (wr /= " 1 1.00") error stop write(wr, '(I5, T6, F5.2)') 2, sqrt(real(2)) print *, wr if (wr /= " 2 1.41") error stop write(wr, '(I5, T10, F5.2)') 1, sqrt(real(1)) print *, wr if (wr /= " 1 1.00") error stop write(wr, '(I5, T10, F5.2)') 2, sqrt(real(2)) print *, wr if (wr /= " 2 1.41") error stop write(wr, '(I4, T5, I4)') 2, 1 print *, wr if (wr /= " 2 1") error stop write(wr, '(I4, T5, I4, T10, I5)') 2, 1, 1 print *, wr if (wr /= " 2 1 1") error stop ! Test "TL" format specifier (tab left) write(wr, '(I4, T10, TL2, F5.2)') 5, sqrt(real(5)) print *, wr if (wr /= " 5 2.24") error stop write(wr, '(I4, T10, TL3, F5.2)') 6, sqrt(real(6)) print *, wr if (wr /= " 6 2.45") error stop write(wr, "(TR7, TL3, A)") hello_god print *, wr if (wr /= " Hello God!") error stop ! Test "TR" format specifier (tab right) write(wr, '(I4, TR2, F5.2)') 3, sqrt(real(3)) print *, wr if (wr /= " 3 1.73") error stop write(wr, '(I4, TR4, F5.2)') 4, sqrt(real(4)) print *, wr if (wr /= " 4 2.00") error stop write(wr, "(TR5, A)") hello_god print *, wr if (wr /= " Hello God!") error stop end program format_14 lfortran-lfortran-2f73434/integration_tests/file_25.f900000664000175000017500000000070415141516316023146 0ustar alastairalastairprogram file_25 implicit none integer :: io integer :: x_write, x_read character(len=20) :: char_read x_write = 12345 open(newunit=io, status="scratch") write(io, *) x_write rewind(io) read(io, *) x_read close(io) if (x_write /= x_read) error stop open(newunit=io, status="scratch") write(io, *) "Hello" rewind(io) read(io, *) char_read close(io) print *, char_read if (char_read /= "Hello") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_409.f900000664000175000017500000000176615141516316024513 0ustar alastairalastairprogram intrinsics_409 implicit none character(len=100) :: output integer :: iostat, unit_num open(42, file='test_exec_flush.txt', position='rewind') write(42, '(A)') 'Hello from LFortran' call execute_command_line('cat test_exec_flush.txt > test_exec_output.txt') close(42) open(unit=43, file='test_exec_output.txt', status='old', iostat=iostat) if (iostat /= 0) error stop 'Failed to open output file' read(43, '(A)', iostat=iostat) output if (iostat /= 0) error stop 'Failed to read output file' close(43) if (trim(output) /= 'Hello from LFortran') then print *, 'Expected: Hello from LFortran' print *, 'Got: ', trim(output) error stop 'Output mismatch' end if open(unit=44, file='test_exec_flush.txt', status='old') close(44, status='delete') open(unit=45, file='test_exec_output.txt', status='old') close(45, status='delete') print *, 'PASSED' end program intrinsics_409 lfortran-lfortran-2f73434/integration_tests/const_array_02.f900000664000175000017500000000033315141516316024544 0ustar alastairalastairprogram const_array_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp), parameter :: A(5) = [1.1_dp, 3.0_dp, 10.0_dp, 2.1_dp, 5.5_dp] integer, parameter :: B(5) = [1, 3, 10, 2, 5] print *, A print *, B end lfortran-lfortran-2f73434/integration_tests/arrays_intrin_07.f900000664000175000017500000000103415141516316025110 0ustar alastairalastairmodule arrays_intrin_07_mod implicit none contains subroutine take_min(arr) real(8), intent(out) :: arr(:,:) real(8) :: tmp1, tmp2 tmp1 = huge(1.d0) tmp2 = huge(1.d0) arr(:,1) = min( 0.d0,tmp1,tmp2 ) if (arr(1, 1) /= 0.d0) error stop if (size(arr) /= 2) error stop end subroutine take_min end module arrays_intrin_07_mod program arrays_intrin_07 use arrays_intrin_07_mod implicit none real(8) :: arr(1, 2) call take_min(arr) end program arrays_intrin_07 lfortran-lfortran-2f73434/integration_tests/openmp_23.f900000664000175000017500000000172515141516316023527 0ustar alastairalastairsubroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_23 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_type_member_procedure_call_01.f900000664000175000017500000000217015141516316031275 0ustar alastairalastairmodule derived_type_member_procedure_call_01_m implicit none type :: primary integer :: x contains procedure :: get_value => fun_get_value procedure :: set_value => fun_set_value end type primary type :: secondary type(primary) :: t end type secondary contains function fun_get_value(self) result(val) class(primary), intent(in) :: self integer :: val val = self%x end function fun_get_value subroutine fun_set_value(self, new_val) class(primary), intent(inout) :: self integer, intent(in) :: new_val self%x = new_val end subroutine fun_set_value end module derived_type_member_procedure_call_01_m program derived_type_member_procedure_call_01 use derived_type_member_procedure_call_01_m implicit none type(secondary) :: vals integer :: result_val vals%t%x = 5 result_val = vals%t%get_value() print *, result_val if (result_val /= 5) error stop call vals%t%set_value(42) result_val = vals%t%get_value() print *, result_val if (result_val /= 42) error stop end program derived_type_member_procedure_call_01 lfortran-lfortran-2f73434/integration_tests/class_46.f900000664000175000017500000000142515141516316023340 0ustar alastairalastairmodule class_46_mod type :: SomeType contains procedure :: method1 procedure :: method2 end type SomeType contains subroutine method1(self, arr) class(SomeType), intent(in) :: self integer, intent(in) :: arr(:) integer, allocatable :: local(:) local = self%method2(arr) print *, "local: ", local if (.not. all(local == [1, 2, 3])) error stop end subroutine method1 function method2(self, a) result(out) class(SomeType), intent(in) :: self integer, intent(in) :: a(:) integer :: out(size(a)) out = a end function method2 end module class_46_mod program class_46 use class_46_mod type(SomeType) :: obj integer :: arr(3) = [1, 2, 3] call obj%method1(arr) end program class_46 lfortran-lfortran-2f73434/integration_tests/modulo_01.f900000664000175000017500000000031615141516316023517 0ustar alastairalastairprogram modulo_01 real :: x1 integer :: i1 x1 = 3.3 print*, modulo(x1, 3.) print*, modulo(x1, 2.) print*, modulo(x1, 1.) i1 = 4 print*, modulo(i1, 6) print*, modulo(i1, 3) print*, modulo(i1, 1) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_237.f900000664000175000017500000000143215141516316024500 0ustar alastairalastairprogram intrinsics_237 use iso_fortran_env, only: dp => real64, sp => real32 implicit none real(sp) :: i1(2) = [1.0_sp, 2.0_sp] real(sp), parameter :: i2 = sum(sngl([1.0_sp, 2.0_sp])) real(dp) :: i3(2) = [1.0_dp, 2.0_dp] real(dp), parameter :: i4 = sum(sngl([1.0_dp, 2.0_dp])) real(sp), parameter :: i5 = sngl(8.89_8) real(sp), parameter :: ar1(3) = sngl([1.0_dp, 2.0_dp, 3.0_dp]) print *, kind(i5) if (kind(i5) /= 4) error stop print *, ar1 if (any(ar1 /= [1.0_sp, 2.0_sp, 3.0_sp])) error stop print *, sum(sngl(i1)) if (sum(sngl(i1)) /= 3.0) error stop print *, i2 if (i2 /= 3.0) error stop print *, sum(sngl(i3)) if (sum(sngl(i3)) /= 3.0) error stop print *, i4 if (i4 /= 3.0) error stop end programlfortran-lfortran-2f73434/integration_tests/where_03.f900000664000175000017500000000141715141516316023337 0ustar alastairalastairsubroutine where_03 implicit none real a(4) real b(4) a = (/ 1.0, 2.0, 3.0, 4.0/) b = (/ -1.0, -2.0, 5.0, 7.0/) where (a > b) a = 1.0 endwhere where(a == 1.0) a = 2.0 else where(a == 2.0) b = 3.0 else where a = b * 2.0 / a * 3.0 endwhere if (abs(a(1) - 2.0) > 1e-7 ) error stop if (abs(a(2) - 2.0) > 1e-7 ) error stop if (abs(a(3) - 10.0) > 1e-7 ) error stop if (abs(a(4) - 10.5) > 1e-7 ) error stop if (abs(b(1) - (-1.0)) > 1e-7 ) error stop if (abs(b(2) - (-2.0)) > 1e-7 ) error stop if (abs(b(3) - 5.0) > 1e-7 ) error stop if (abs(b(4) - 7.0) > 1e-7 ) error stop print *, a print *, b end subroutine program main call where_03 end program lfortran-lfortran-2f73434/integration_tests/procedure_18.f900000664000175000017500000000203115141516316024214 0ustar alastairalastairmodule mod1_procedure_18 implicit none private public :: f_function contains elemental function f_function(x, y) result(fx) real, intent(in) :: x real, intent(in), optional :: y real :: w_y real :: fx w_y=1.0 if (present(y)) w_y=y fx = w_y end function f_function end module mod1_procedure_18 module mod2_procedure_18 use :: mod1_procedure_18 implicit none private public :: function_interface interface function_interface module procedure f_function end interface end module mod2_procedure_18 program procedure_18 use :: mod1_procedure_18 use :: mod2_procedure_18 implicit none real :: res, eps res = 0.5 eps = 1e-8 print *, "fx is ", f_function(0.8, y=0.5) if (abs(f_function(0.8, y=0.5) - res) > eps) error stop print *, "fx is ", function_interface(0.8, 0.5) if (abs(function_interface(0.8, 0.5) - res) > eps) error stop print *, "fx is ", function_interface(0.8, y=0.5) if (abs(function_interface(0.8, y=0.5) - res) > eps) error stop end program procedure_18 lfortran-lfortran-2f73434/integration_tests/intrinsics_275.f900000664000175000017500000000307615141516316024510 0ustar alastairalastairprogram intrinsics_275 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = and(5, 8) integer, parameter :: i2 = and(-1, 5) integer, parameter :: i3 = and(-4_8, 2_8) integer(8), parameter :: i4 = and(-2_8, 5_8) logical, parameter :: l1 = and(.true., .false.) logical, parameter :: l2 = and(.true., .true.) logical :: true = .true., false = .false. print *, i1 if (i1 /= 0) error stop print *, i2 if (i2 /= 5) error stop print *, i3 if (i3 /= 0) error stop print *, i4 if (i4 /= 4) error stop ! logical argument testing print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, and(true, false) if (and(true, false) .neqv. .false.) error stop print *, and(true, true) if (and(true, true) .neqv. .true.) error stop print*, and(5, 8) if (and(5, 8) /= 0) error stop print*, and(-1, 5) if (and(-1, 5) /= 5) error stop print*, and(8, -4) if (and(8, -4) /= 8) error stop print*, and(-2, -5) if (and(-2, -5) /= -6) error stop print*, and(a1, a2) if (and(a1, a2) /= 0) error stop print*, and(a3, a4) if (and(a3, a4) /= -4) error stop print*, and(a2, a5) if (and(a2, a5) /= 8) error stop print*, and(a5, a6) if (and(a5, a6) /= -6) error stop print *, kind(and(5, 8)) if (kind(and(5, 8)) /= 4) error stop print *, kind(and(-1_8, 5_8)) if (kind(and(-1_8, 5_8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_66.f900000664000175000017500000000146315141516316023540 0ustar alastairalastairprogram arrays_66 real :: Q(8, 8) integer :: i, j do i = 1, 8 do j = 1, 8 Q(i, j) = i*j + i + j + 1 end do end do call qradd_Rdiag(Q, 1) print *, Q(:, 1) if( any(Q(:, 1) /= [4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0]) ) error stop do j = 2, 8 if( any(Q(:, j) /= 1.0) ) error stop end do contains function matprod(Q, G) result(R) real, intent(in) :: Q(:, :), G(:, :) real :: R(size(Q, 1), size(G, 2)) R = 1.0 end function subroutine qradd_Rdiag(Q, n) ! Used in COBYLA ! In-outputs integer(4), intent(in) :: n real(4), intent(inout) :: Q(:, :) ! Q(M, M) integer(4) :: k integer(4) :: m real(4) :: G(2, 2) ! Sizes m = int(size(Q, 2), kind(m)) do k = m - 1_4, n + 1_4, -1 Q(:, [k, k + 1_4]) = matprod(Q(:, [k, k + 1_4]), transpose(G)) end do end subroutine qradd_Rdiag end program lfortran-lfortran-2f73434/integration_tests/file_open_06.f900000664000175000017500000000042215141516316024163 0ustar alastairalastairprogram open_sign_01 implicit none ! Test sign='plus' - should show plus sign for positive numbers open(6, sign='plus') print '(F5.1)', 1.0 ! Don't close unit 6 (stdout) as subsequent prints would have no output print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_373.f900000664000175000017500000000127515141516316024506 0ustar alastairalastairprogram intrinsics_373 integer :: a(2, 3, 4), a1(2), i, j, k, n integer :: b(2, 3, 2, 4) a1(1) = 3 a1(2) = 4 do i = 1, 2 do j = 1, 3 do k = 1, 4 a(i, j, k) = i + j + k end do end do end do print *, a print *, a1 print *, spread(a, 3, 2) print *, spread(a1, 1, 3) b = spread(a, 3, 2) do n = 1, 2 do i = 1, 2 do j = 1, 3 do k = 1, 4 if( b(i, j, n, k) /= i + j + k ) error stop end do end do end do end do if( any(spread(a1, 1, 3) /= reshape([3, 3, 3, 4, 4, 4], [3, 2])) ) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_22.f900000664000175000017500000000115115141516316025067 0ustar alastairalastairmodule derived_types_22_file_common_block_sample type :: sample real :: A, B, E end type type(sample) :: struct_instance_sample end module subroutine pass() use derived_types_22_file_common_block_sample print *, struct_instance_sample%A, struct_instance_sample%B if (abs(struct_instance_sample%A - 10.0) > 1.0e-7) error stop if (abs(struct_instance_sample%B - 20.0) > 1.0e-7) error stop end subroutine program derived_types_22 use derived_types_22_file_common_block_sample struct_instance_sample%A = 10.0 struct_instance_sample%B = 20.0 call pass() end program lfortran-lfortran-2f73434/integration_tests/class_allocate_02.f900000664000175000017500000000102115141516316025164 0ustar alastairalastairprogram class_allocate_02 implicit none type dummy_type integer(1), allocatable :: value(:) end type dummy_type class(*), allocatable :: dummy type(dummy_type) :: dummy_val allocate(dummy_val % value(1)) allocate(dummy, source=dummy_val) print * , allocated(dummy) if (allocated(dummy) .neqv. .true.) error stop !select type(d => dummy) !type is (dummy_type) ! print *, size(d % value) ! if (size(d % value) /= 1) error stop !end select end program lfortran-lfortran-2f73434/integration_tests/doloop_08.f900000664000175000017500000000025715141516316023527 0ustar alastairalastairprogram doloop_08 implicit none integer :: i i = 1 do i = i + 1 if (i == 10) exit end do if (i /= 10) error stop end program doloop_08 lfortran-lfortran-2f73434/integration_tests/functions_50.f900000664000175000017500000000040115141516316024227 0ustar alastairalastairprogram functions_50 integer :: n character(:), ALLOCATABLE :: x n = 5 x = sayHi() if (x /= "Hello") error stop print *, x contains character(n) function sayHi() result (res) res = "Hello" end function end program functions_50 lfortran-lfortran-2f73434/integration_tests/complex_12.f900000664000175000017500000000032715141516316023673 0ustar alastairalastairprogram main implicit none complex(8) :: k real::re,im re=3 im=4 k = cmplx(re, 0) + cmplx(0, im) print *, k if (real(k) /= 3) error stop if (aimag(k) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/file_36.f900000664000175000017500000000054015141516316023146 0ustar alastairalastairprogram file_36 implicit none integer :: unit_num character(len=100) :: result open(file="file_36_test.txt", newunit=unit_num, delim="quote") write(unit_num,*) "hello world" rewind(unit_num) read(unit_num,*) result close(unit_num) print *, result if (result /= "hello world") error stop end program file_36 lfortran-lfortran-2f73434/integration_tests/where_13.f900000664000175000017500000000100615141516316023332 0ustar alastairalastairmodule where_13_module implicit none private public :: is_pos contains pure elemental function is_pos(x) result(y) implicit none real, intent(in) :: x logical :: y y = (x > 0) end function is_pos end module where_13_module program where_13 use, non_intrinsic :: where_13_module real :: V(2) = [-1,2] logical :: W(2) where (is_pos(V)) V = 12.91 elsewhere V = -12.91 end where print *, V print *, sum(V) if ( abs(sum(V)) > 1e-8) error stop end program where_13 lfortran-lfortran-2f73434/integration_tests/associate_18_module.f900000664000175000017500000000064215141516316025552 0ustar alastairalastairmodule associate_18_module_1 implicit none type :: toml_token integer :: chunk = 0 end type toml_token end module module associate_18_module_2 use associate_18_module_1, only : toml_token implicit none contains subroutine extract_datetime(token) type(toml_token), intent(in) :: token associate(token => token) end associate end subroutine extract_datetime end modulelfortran-lfortran-2f73434/integration_tests/datastmt_01.f900000664000175000017500000000061515141516316024043 0ustar alastairalastairprogram datastmt_01 integer :: arr(3) integer :: arr2(3) integer :: arr3(3) integer :: arr4(3) data arr(1:3) /1, 2, 3/ data arr2(1:2) /1, 2/ data arr3(1:3) /3*1/ data arr4(1:2) /2*1/ if (any(arr /= [1,2,3])) error stop if (any(arr2(1:2) /= [1,2])) error stop if (any(arr3 /= [1,1,1])) error stop if (any(arr4(1:2) /= [1,1])) error stop end program lfortran-lfortran-2f73434/integration_tests/bindc_01b.f900000664000175000017500000000124515141516316023443 0ustar alastairalastairmodule bindc_01b use iso_c_binding, only: c_ptr, c_int implicit none interface subroutine ret_ptr(p) bind(c, name="ret_ptr_c") import :: c_ptr type(c_ptr), intent(out) :: p end subroutine ! same as `ret_ptr`, except, the only difference being "unspecified" ! intent of `p` in `ret_ptr_unspecified_intent` subroutine ret_ptr_unspecified_intent(p) bind(c, name="ret_ptr_c") import :: c_ptr type(c_ptr) :: p end subroutine subroutine print_ptr(n, p) bind(c, name="print_ptr_c") import :: c_ptr, c_int integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: p end subroutine end interface end module lfortran-lfortran-2f73434/integration_tests/string_86.f900000664000175000017500000000122515141516316023543 0ustar alastairalastairmodule string_86_mod implicit none contains integer pure function blabla(inp) result(r) integer, intent(in) :: inp r = inp * 2 end function blabla end module string_86_mod program string_86 use string_86_mod implicit none integer :: n(5) character(:), allocatable :: x integer :: str_len n(3) = 5 str_len = n(3) allocate(character(str_len) :: x) x = tolower(str_len) print *, x if (x /= "Hello") error stop if (len(x) /= 5) error stop contains function tolower(len_needed) result(res) integer, intent(in) :: len_needed character(len_needed) :: res res = "Hello" end function tolower end program string_86lfortran-lfortran-2f73434/integration_tests/expr_01.f900000664000175000017500000000013315141516316023173 0ustar alastairalastairprogram expr_01 implicit none integer :: x x = (2+3)*5 if (x == 25) error stop end program lfortran-lfortran-2f73434/integration_tests/string_28.f900000664000175000017500000000046215141516316023541 0ustar alastairalastairprogram string_28 CHARACTER(100), DIMENSION(100) :: calibration_document INTEGER ::len_line, char_value calibration_document(3) = 'abc' len_line = 1 char_value = IACHAR(calibration_document(3)(len_line:len_line)) print *, char_value if (char_value /= 97) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_58.f900000664000175000017500000000056515141516316023543 0ustar alastairalastairprogram arrays_58 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-8) ) error stop contains subroutine trans(A) real, intent(inout) :: A(:, :) A = matprod(transpose(A)) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-lfortran-2f73434/integration_tests/derived_types_62.f900000664000175000017500000000113115141516316025071 0ustar alastairalastairmodule derived_types_62_m implicit none type :: toml_ser_config character(:), allocatable :: indent integer, allocatable :: i end type toml_ser_config type :: toml_serializer type(toml_ser_config) :: config = toml_ser_config() end type toml_serializer end module derived_types_62_m program derived_types_62 use derived_types_62_m type(toml_serializer) :: serializer serializer%config%indent = "test" if (serializer%config%indent /= "test") error stop serializer%config%i = 4 if (serializer%config%i /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/types_19.f900000664000175000017500000000025215141516316023374 0ustar alastairalastairprogram types_19 type(integer) :: a type(real) :: b a = 25 b = 3.14 print *, a, B if (a /= 25) error stop if (abs(b - 3.14) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/sin_04.f900000664000175000017500000000025215141516316023013 0ustar alastairalastairprogram sin_04 use iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: x = sin(1.5_dp) if (abs(x - 0.997494996_dp) > 1e-5_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/string_12.f900000664000175000017500000000205115141516316023526 0ustar alastairalastairprogram string_12 implicit none character(len=*), parameter :: fullhex_digits = "0123456789ABCDEFabcdef" !! 0 .. 9A .. Fa .. f character(len=*), parameter :: hex_digits = fullhex_digits(1:16) !! 0 .. 9A .. F character(len=*), parameter :: lowerhex_digits = "0123456789abcdef" !! 0 .. 9a .. f character(len=*), parameter :: digits = hex_digits(1:10) !! 0 .. 9 character(len=*), parameter :: octal_digits = digits(1:8) !! 0 .. 7 character(len=*), parameter :: letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" !! A .. Za .. z character(len=*), parameter :: uppercase = letters(1:26) !! A .. Z character(len=*), parameter :: lowercase = letters(27:) !! a .. z character(len=*), parameter :: string = char(len(letters)) print *, fullhex_digits print *, hex_digits print *, lowerhex_digits print *, digits print *, octal_digits print *, letters print *, uppercase print *, lowercase print *, "char(", len(letters), ") = ", string if (string /= "4") error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_20_module2.f900000664000175000017500000000035115141516316026515 0ustar alastairalastairmodule M_CLI2_20 implicit none contains elemental impure function specified(key) character(len=*),intent(in) :: key logical :: specified specified=.false. end function specified end module M_CLI2_20 lfortran-lfortran-2f73434/integration_tests/separate_compilation_21b.f900000664000175000017500000000047415141516316026573 0ustar alastairalastairsubmodule (math_separate_compilation_21) log_separate_compilation_21 implicit none contains module procedure func1 real, parameter :: array(2) = [1.0 , 2.0] res = array end procedure module procedure func2 integer, parameter :: array(2) = [1 , 2] res = array end procedure end submodulelfortran-lfortran-2f73434/integration_tests/string_53.f900000664000175000017500000000074115141516316023537 0ustar alastairalastairmodule string_53_mod contains pure function doubler(x) result (ret) integer,intent(in) :: x integer :: ret ret = x * 2 end function subroutine sub() character(len=doubler(10)) :: zz print *, len(zz) ! Make sure character's length is set correctly when it's a call to a function if(len(zz) /= 20) error stop end subroutine end module program string_53 use string_53_mod call sub() end program lfortran-lfortran-2f73434/integration_tests/string_83.f900000664000175000017500000000264715141516316023551 0ustar alastairalastairmodule string_83_mod implicit none public character(len=*), parameter :: char_arr_global(4, 1) = reshape([ character(len=30) :: & "YES",& "\d ",& "5 ",& "1 "], [4,1]) contains subroutine sub(str) character(*), intent(out) :: str character(len(char_arr_global)) :: buffer if(len(buffer) /= 30) error stop if(len(char_arr_global(1, 1)) /= 30) error stop if(trim(char_arr_global(1, 1)) /= "YES") error stop if(trim(char_arr_global(2, 1)) /= "\d") error stop if(trim(char_arr_global(3, 1)) /= "5") error stop if(trim(char_arr_global(4, 1)) /= "1") error stop if(len(str) /= 30) error stop str = char_arr_global(3, 1) end subroutine end module program string_83 use string_83_mod implicit none character(len=30) :: str character(:), allocatable :: write_buffer call sub(str) if(str /= char_arr_global(3, 1)) error stop allocate(character(len=len(char_arr_global)* size(char_arr_global)) :: write_buffer) write(write_buffer, "(4A)") char_arr_global print *, write_buffer if(write_buffer /= "YES & \d & 5 & 1 ") error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_04b.f900000664000175000017500000000030215141516316026562 0ustar alastairalastairmodule separate_compilation_04b_module use separate_compilation_04a_module implicit none contains subroutine temp(A) real, allocatable :: A(:, :) call resol_lu(A) end subroutine end module lfortran-lfortran-2f73434/integration_tests/save_02.f900000664000175000017500000000017215141516316023157 0ustar alastairalastairprogram save_02 implicit none integer :: i, j real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) save end program lfortran-lfortran-2f73434/integration_tests/do_concurrent_07.f900000664000175000017500000000145615141516316025100 0ustar alastairalastair! equivalent to openmp_12.f90 subroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i do concurrent (i=1:n) shared(b) b(i) = 12.91 end do print *, b(1), b(n) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program do_concurrent_07 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/common_10.f900000664000175000017500000000011615141516316023506 0ustar alastairalastairprogram common_10 real :: x common /timing/ x x = 0.0D0 end program lfortran-lfortran-2f73434/integration_tests/file_30.f900000664000175000017500000000117615141516316023146 0ustar alastairalastairsubroutine file_write(iu, i) integer :: i, iu(5) WRITE(IU(I), *) 'xyzzy' end subroutine program file_30 implicit none integer :: iu(5), ios character(len=10) :: line character(len=25) :: fname fname = 'temp_output_file_30.txt' iu(3) = 20 open(unit=iu(3), file=fname, status='replace', action='write') call file_write(iu, 3) close(iu(3)) open(unit=99, file=fname, status='old', action='read', iostat=ios) read(99, '(A)', iostat=ios) line close(99) print *, trim(line) if (trim(adjustl(line)) /= 'xyzzy') error stop open(unit=97, file=fname, status='old') close(97, status='delete') end program lfortran-lfortran-2f73434/integration_tests/intrinsics_351.f900000664000175000017500000000061715141516316024501 0ustar alastairalastairprogram intrinsics_351 real :: xx(3,20) real :: x(20) integer :: j, n integer, allocatable :: i(:) integer :: ii(4,4) allocate(i(4)) i = [1,2,3,4] ii = spread(i, dim = 2, ncopies=4) print *, sum(ii) if ( sum(ii) /= 40 ) error stop do j = 1, 20 xx(:,j) = j x(j) = j end do n = 3 xx = xx / spread(x, dim = 1, ncopies = n) print *, xx if (any(xx /= 1)) error stop end program intrinsics_351 lfortran-lfortran-2f73434/integration_tests/param_pass_01.f900000664000175000017500000000017515141516316024351 0ustar alastairalastairprogram param_pass_01 integer, parameter :: i = 2, j = 2 integer :: p1 p1 = i + 2.0 print *, p1 end programlfortran-lfortran-2f73434/integration_tests/nested_22.f900000664000175000017500000000116615141516316023511 0ustar alastairalastairmodule nested_22_mod type :: tmp_type integer :: a end type tmp_type contains subroutine tmp_sub() type(tmp_type), allocatable :: x(:) allocate(x(1)) call inner_sub() print *, x(2)%a if (size(x) /= 2) error stop if (x(2)%a /= 42) error stop contains subroutine inner_sub() type(tmp_type) :: tmp_var x = [x, tmp_var] x(2)%a = 42 end subroutine inner_sub end subroutine tmp_sub end module nested_22_mod program nested_22 use nested_22_mod implicit none call tmp_sub() end program nested_22 lfortran-lfortran-2f73434/integration_tests/submodule_08.f900000664000175000017500000000044715141516316024233 0ustar alastairalastairmodule Module_08 interface module subroutine hi() end subroutine end interface end module Module_08 submodule(Module_08) Submodule_8 contains module subroutine hi() print *, "Hello world" end subroutine hi end submodule Submodule_8 program main use Module_08 end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_08.f900000664000175000017500000000117415141516316026456 0ustar alastairalastairmodule operator_overloading_08_mod1 type :: custom_int integer :: value end type custom_int interface operator(/) module procedure custom_div end interface contains function custom_div(a, b) result(res) type(custom_int), intent(in) :: a integer, intent(in) :: b type(custom_int) :: res res%value = a%value / (b + 1) end function custom_div end module operator_overloading_08_mod1 program operator_overloading_08 use operator_overloading_08_mod1 type(custom_int) :: a a%value = 1 print *, a / 0 ! Yields 1 end program operator_overloading_08 lfortran-lfortran-2f73434/integration_tests/arrays_reshape_28.f900000664000175000017500000000065615141516316025250 0ustar alastairalastairprogram arrays_reshape_28 implicit none integer, parameter :: n(2) = [2, 2] integer, parameter :: arr(4) = [1,2,3,4] real, parameter :: b(2,2) = reshape(arr, n) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_28 lfortran-lfortran-2f73434/integration_tests/class_97.f900000664000175000017500000000106315141516316023344 0ustar alastairalastairmodule class_97_m implicit none type :: parent_t integer :: x = 0 end type parent_t type, extends(parent_t) :: child_t character(len=:), allocatable :: name end type child_t contains function export_child(self) result(cfg) class(child_t), intent(in) :: self type(child_t) :: cfg cfg = self end function export_child end module program class_97 use class_97_m implicit none type(child_t) :: a, b a%name = 'hello' b = export_child(a) if (len(b%name) /= 5) error stop print *, len(b%name) end program class_97 lfortran-lfortran-2f73434/integration_tests/modules_38.f900000664000175000017500000000243215141516316023703 0ustar alastairalastairmodule fpm_compiler implicit none public :: compiler_t type string_t character(len=:), allocatable :: s end type enum, bind(C) enumerator :: & id_unknown, & id_intel_classic_windows, & id_intel_llvm_windows end enum integer, parameter :: compiler_enum = kind(id_unknown) type :: compiler_t integer(compiler_enum) :: id = id_unknown character(len=:), allocatable :: fc character(len=:), allocatable :: cc character(len=:), allocatable :: cxx logical :: echo = .true. logical :: verbose = .true. contains procedure :: enumerate_libraries end type compiler_t contains function enumerate_libraries(self, prefix, libs) result(r) class(compiler_t), intent(in) :: self character(len=*), intent(in) :: prefix type(string_t), intent(in) :: libs(:) character(len=:), allocatable :: r if (self%id == id_intel_classic_windows .or. & self%id == id_intel_llvm_windows) then end if allocate(character(len=1) :: r) end function enumerate_libraries end module fpm_compiler program modules_38 use fpm_compiler, only : string_t, compiler_t type(compiler_t) :: compiler_arg character(len=3) :: prefix_arg type(string_t) :: libs_arg(4) print *, compiler_arg%enumerate_libraries(prefix_arg, libs_arg) end program lfortran-lfortran-2f73434/integration_tests/procedure_09_b.f900000664000175000017500000000055215141516316024523 0ustar alastairalastairmodule test contains subroutine temp(call_back) use procedure_09_module implicit none procedure(cb) :: call_back logical :: terminate_var real :: x3(2) call call_back(x3, terminate = terminate_var) end subroutine temp end module program procedure_09 use procedure_09_module use test call temp(cb) end program procedure_09lfortran-lfortran-2f73434/integration_tests/file_42.f900000664000175000017500000000134115141516316023143 0ustar alastairalastairprogram bnbz2 implicit none ! Specify blank mode via OPEN statement integer :: iunit integer :: i1, i2 character(8) :: blank_mode open (newunit=iunit, file='bnbz.dat', status='unknown') write (iunit,'(a)') '1 1 ' close (iunit) open (newunit=iunit, file='bnbz.dat', status='old', blank='null') read (iunit, '(2i4)') i1, i2 if (i1 /= 1 .or. i2 /= 1) error stop inquire (unit=iunit, blank=blank_mode) if (blank_mode /= 'NULL') error stop close (iunit) open (newunit=iunit, file='bnbz.dat', status='old', blank='zero') read (iunit, '(2i4)') i1, i2 if (i1 /= 1000 .or. i2 /= 1000) error stop inquire (unit=iunit, blank=blank_mode) if (blank_mode /= 'ZERO') error stop close (iunit) end program lfortran-lfortran-2f73434/integration_tests/array_01_pack.f900000664000175000017500000000030615141516316024333 0ustar alastairalastairprogram array_01_pack integer :: m(6), p(2) integer :: s(1) m = [ 1, 0, 0, 0, 5, 0 ] p = pack(m, m /= 0) s = shape(pack(m, m /= 0)) print *, s(1) if (s(1) /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/file_19_data.txt0000664000175000017500000000002615141516316024360 0ustar alastairalastair Hi this is 1st line! lfortran-lfortran-2f73434/integration_tests/separate_compilation_04.f900000664000175000017500000000025015141516316026422 0ustar alastairalastairprogram separate_compilation_04 use separate_compilation_04b_module implicit none real, allocatable :: A(:,:) allocate(A(3,3)) A = 02315.1235 call temp(A) end program lfortran-lfortran-2f73434/integration_tests/if_06.f900000664000175000017500000000051515141516316022624 0ustar alastairalastairprogram bignumcase use iso_fortran_env implicit none integer(int64) :: val integer :: neg_count val = 98765432101_int64 neg_count = 0 select case (val) case (1:) neg_count = neg_count + 1 end select print *, neg_count IF(neg_count /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_97.f900000664000175000017500000000040215141516316025101 0ustar alastairalastairprogram test_derived_types_97 use derived_types_97_mod2 implicit none type(point_t) :: p call create_point(p) if (p%x /= 10) error stop if (p%y /= 20) error stop print *, "OK" end program test_derived_types_97 lfortran-lfortran-2f73434/integration_tests/doloop_14.f900000664000175000017500000000020515141516316023515 0ustar alastairalastairprogram doloop_14 integer :: i do i = 1, 2, 16 end do print *, i if ( i /= 17 ) error stop end program doloop_14 lfortran-lfortran-2f73434/integration_tests/file_08.f900000664000175000017500000000104315141516316023144 0ustar alastairalastairsubroutine read_array() integer :: j double precision :: a(1, 2, 3) j = 10 open(unit=j, file="file_08.txt") read(j, *) a close(j) print *, a if (abs(a(1, 1, 1) - 1.0D0) > 1e-10) error stop if (abs(a(1, 2, 1) - 2.0D0) > 1e-10) error stop if (abs(a(1, 1, 2) - 3.0D0) > 1e-10) error stop if (abs(a(1, 2, 2) - 4.0D0) > 1e-10) error stop if (abs(a(1, 1, 3) - 5.0D0) > 1e-10) error stop if (abs(a(1, 2, 3) - 6.0D0) > 1e-10) error stop end subroutine program file_08 call read_array() end program lfortran-lfortran-2f73434/integration_tests/modules_16b.f900000664000175000017500000000033115141516316024035 0ustar alastairalastairmodule modules_16b contains integer function sfloor(x) result(r) real, intent(in) :: x r = x end function integer function imodulo(x) result(r) integer, intent(in) :: x r = sfloor(real(x)) end function end module lfortran-lfortran-2f73434/integration_tests/real_dp_01.f900000664000175000017500000000022515141516316023625 0ustar alastairalastairprogram real_dp_01 real(4) :: zero real(8) :: v real :: x zero = 0.0 v = 1.05 x = 1.05 print *, x, v, zero end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_17b.f900000664000175000017500000000016315141516316026223 0ustar alastairalastairinteger function isamax(x, y, z) integer, intent(in) :: x, z real, intent(in) :: y isamax = x + y + z end function lfortran-lfortran-2f73434/integration_tests/intrinsics_309.f900000664000175000017500000000316015141516316024500 0ustar alastairalastairprogram intrinsics_309 implicit none integer :: k integer(1), parameter :: xi1(2) = pack([1_1, 2_1, 3_1], [.true., .false., .true.]) integer(2), parameter :: xi2(3) = pack([1_2, 2_2, 3_2], [.true., .true., .true.]) integer(4), parameter :: xi3(2) = pack([1, 2, 3], [.true., .false., .true.]) integer(8), parameter :: xi4(3) = pack([1_8, 2_8, 3_8], [.true., .true., .true.]) integer(4), parameter :: xi5(*) = pack([(k**2, k = 1,3)], [(.true., k = 1,2), .false.]) real, parameter :: x3(2) = pack([1.0, 2.0, 3.0], [.true., .false., .true.]) real(8), parameter :: x4(3) = pack([1.0_8, 2.0_8, 3.0_8], [.true., .true., .true.]) complex, parameter :: x5(2) = pack([(1.0, 1.0), (2.0, 2.0), (3.0, 3.0)], [.true., .false., .true.]) complex(8), parameter :: x6(3) = pack([(1.0_8, 1.0_8), (2.0_8, 2.0_8), (3.0_8, 3.0_8)], [.true., .true., .true.]) logical, parameter :: x7(2) = pack([.true., .false., .true.], [.true., .false., .true.]) print *, xi1 if (any(xi1 /= [1, 3])) error stop print *, xi2 if (any(xi2 /= [1, 2, 3])) error stop print *, xi3 if (any(xi3 /= [1, 3])) error stop print *, xi4 if (any(xi4 /= [1, 2, 3])) error stop print *, xi5 if (any(xi5 /= [1, 4])) error stop print *, x3 if (any(x3 - [1.0, 3.0] > 1e-6)) error stop print *, x4 if (any(x4 - [1.0_8, 2.0_8, 3.0_8] > 1e-12)) error stop print *, x5 if (any(x5 /= [(1.0, 1.0), (3.0, 3.0)])) error stop print *, x6 if (any(x6 /= [(1.0_8, 1.0_8), (2.0_8, 2.0_8), (3.0_8, 3.0_8)])) error stop print *, x7 if (any(x7 .neqv. [.true., .true.])) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_284.f900000664000175000017500000001151515141516316024505 0ustar alastairalastairprogram intrinsics_284 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 1.5178181202_dp real(sp) :: b = 1.072816_sp real(dp) :: c = 1.5178181202_dp real(sp) :: d = 1.072816_sp real(dp), parameter :: res_dp(10) = acosh([1.62818828_dp, 1.51725372_dp, 1.29257208_dp, & 1.62818828_dp, 1.51725372_dp, 1.29257208_dp, 1.00_dp, 1.829362821_dp, 1.952716192_dp, 1.241626228_dp]) real(sp), parameter :: res_sp(10) = acosh([1.62818828_sp, 1.51725372_sp, 1.29257208_sp, & 1.62818828_sp, 1.51725372_sp, 1.29257208_sp, 1.00_sp, 1.829362821_sp, 1.952716192_sp, 1.241626228_sp]) expected_x = [1.0692176655903725_dp, 0.97769872817826375_dp, 0.74742740658933504_dp, & 1.0692176655903725_dp, 0.97769872817826375_dp, 0.74742740658933504_dp, 0.00_dp, & 1.2123022470110765_dp, 1.2892178294282344_dp, 0.68187653246421109_dp] arg_x = [1.67922251126_dp, 1.54363892699177885_dp, 1.29691551032790681_dp, & 1.67922251126401767_dp, 1.54363892699177885_dp, 1.29691551032790681_dp, 1.5707963267948966_dp, & 1.07796627122261770_dp, 1.2620530499450677_dp, 1.24404138779115148_dp, 1.7281628262782_dp, & 1.5707963267948966_dp, 1.07796627122261770_dp, 1.2620530499450677_dp, 1.24404138779115148_dp] arg_y = [1.679222465_sp, 1.543638885_sp, 1.296915501_sp, & 1.679222465_sp, 1.543638885_sp, 1.296915501_sp, 1.57079637_sp, & 1.077966249_sp, 1.262053013_sp, 1.244041398_sp, 1.7281628262782_sp, & 1.57079637_sp, 1.077966249_sp, 1.262053013_sp, 1.244041398_sp] expected_y = [1.06921768_sp, 0.977698743_sp, 0.747427344_sp, & 1.06921768_sp, 0.977698743_sp, 0.747427344_sp, 0.00_sp, & 1.21230233_sp, 1.28921783_sp, 0.681876600_sp] res_x = acosh(arg_x) res_y = acosh(arg_y) expected_res_x = [1.1079742559357899_dp, 1.0004749128435737_dp, 0.75270877751131104_dp, & 1.1079742559387682_dp, 1.0004749128435737_dp, 0.75270877751131104_dp, 1.0232274785475506_dp, & 0.39236130842345907_dp, 0.70900761659991784_dp, 0.68514914208529898_dp, 1.1434619762512719_dp, & 1.0232274785475506_dp, 0.39236130842345907_dp, 0.70900761659991784_dp, 0.68514914208529898_dp] expected_res_y = [1.10797417_sp, 1.00047481_sp, 0.752708793_sp, & 1.10797417_sp, 1.00047481_sp, 0.752708793_sp, 1.02322757_sp, & 0.392361164_sp, 0.709007561_sp, 0.685149193_sp, 1.14346206_sp, & 1.02322757_sp, 0.392361164_sp, 0.709007561_sp, 0.685149193_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, acosh(a) if (abs(acosh(a)) - 0.97819318581773873_dp > 1e-12) error stop print *, acosh(1.5178181202_dp) if (abs(acosh(1.5178181202_dp) - 0.97819318581773873_dp) > 1e-12) error stop print *, acosh(b) if (acosh(b) - (0.379339129_sp) > 1e-5) error stop print *, acosh(1.072816_sp) if (acosh(1.072816_sp) - (0.379339129_sp) > 1e-5) error stop print *, acosh(c) if (acosh(c) - (0.97819318581773873_dp) > 1e-12) error stop print *, acosh(1.5178181202_dp) if (acosh(1.5178181202_dp) - (0.97819318581773873_dp) > 1e-12) error stop print *, acosh(d) if (acosh(d) - (0.379339129_sp) > 1e-5) error stop print *, acosh(1.072816_sp) if (acosh(1.072816_sp) - (0.379339129_sp) > 1e-5) error stop a = 1.271927291_dp b = 1.6382728_sp c = 1.271927291_dp d = 1.6382728_sp print *, acosh(a) if (abs(acosh(a) - (0.72170024457681714_dp)) > 1e-12) error stop print *, acosh(1.271927291_dp) if (abs(acosh(1.271927291_dp) - (0.72170024457681714_dp)) > 1e-12) error stop print *, acosh(b) if (acosh(b) - (1.07702732_sp) > 1e-5) error stop print *, acosh(1.6382728_sp) if (acosh(1.6382728_sp) - (1.07702732_sp) > 1e-5) error stop print *, acosh(c) if (acosh(c) - (0.72170024457681714_dp) > 1e-12) error stop print *, acosh(1.271927291_dp) if (acosh(1.271927291_dp) - (0.72170024457681714_dp) > 1e-12) error stop print *, acosh(d) if (acosh(d) - (1.07702732_sp) > 1e-5) error stop print *, acosh(1.6382728_sp) if (acosh(1.6382728_sp) - (1.07702732_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/cpp_pre_06.f900000664000175000017500000000110015141516316023645 0ustar alastairalastair#ifdef __GFORTRAN__ # define STRINGIFY_START(X) "& # define STRINGIFY_END(X) &X" #else /* default stringification */ # define STRINGIFY_(X) #X # define STRINGIFY_START(X) & # define STRINGIFY_END(X) STRINGIFY_(X) #endif #define MYMACRO 0.12.0 program test implicit none character (len=:), allocatable :: astring astring = STRINGIFY_START(MYTEXT) STRINGIFY_END(MYTEXT) if (astring /= "MYTEXT") error stop "stringify failed for text" astring = STRINGIFY_START(MYMACRO) STRINGIFY_END(MYMACRO) if (astring /= "0.12.0") error stop "stringify failed for macro" end program test lfortran-lfortran-2f73434/integration_tests/modules_59.f900000664000175000017500000000132415141516316023705 0ustar alastairalastairmodule module_mod_59 implicit none private public :: is_finite interface is_finite module procedure is_finite_1 end interface is_finite contains subroutine is_finite_1(x) integer , intent(in) :: x print *, x if(x /= 1111) error stop end subroutine is_finite_1 end module module_mod_59 module mod_middle use, non_intrinsic :: module_mod_59, only : is_finite end module mod_middle program module_59 real :: x(2) call calfun(x) contains subroutine calfun(x) use, non_intrinsic :: mod_middle, only : is_finite real, intent(in) :: x(:) call is_finite(1111) end subroutine calfun end program module_59lfortran-lfortran-2f73434/integration_tests/enum_01.f900000664000175000017500000000070115141516316023162 0ustar alastairalastairprogram enum_01 implicit none enum, bind(c) enumerator :: red, blue = 3 enumerator yellow end enum enum, bind(c) enumerator :: green = 10 enumerator purple end enum integer, parameter :: compiler_enum = kind(red) if (red /= 0) error stop if (blue /= 3) error stop if (yellow /= 4) error stop if (green /= 10) error stop if (purple /= 11) error stop end program enum_01 lfortran-lfortran-2f73434/integration_tests/modules_62_parser.f900000664000175000017500000000126415141516316025256 0ustar alastairalastairmodule modules_62_parser use modules_62_terminal, only: toml_terminal implicit none private public :: parser_config, parse ! Type with toml_terminal as component WITH DEFAULT INITIALIZATION ! This triggers the bug: the default toml_terminal() constructor contains ! references to ansi_code type which isn't explicitly imported type :: parser_config type(toml_terminal) :: color = toml_terminal() integer :: level = 0 end type parser_config contains subroutine parse(config, val) type(parser_config), intent(in) :: config integer, intent(out) :: val val = config%level + config%color%reset%style end subroutine parse end module modules_62_parser lfortran-lfortran-2f73434/integration_tests/array_section_07.f900000664000175000017500000000043515141516316025072 0ustar alastairalastairprogram array_section_07 implicit none integer :: i0 integer, dimension(:), allocatable :: subpass integer :: temp(2) i0 = 1 subpass = [2,3] subpass = temp(i0:i0) print *, size(subpass) if (size(subpass) /= 1) error stop end program array_section_07lfortran-lfortran-2f73434/integration_tests/implicit_interface_27b.f900000664000175000017500000000011515141516316026221 0ustar alastairalastaircomplex function test_complex() test_complex = (21.0, -3.0) end function lfortran-lfortran-2f73434/integration_tests/intrinsics_70.f900000664000175000017500000000374015141516316024417 0ustar alastairalastairprogram intrinsics_70 implicit none real :: x real, parameter :: epsilon = 1e-10 real :: res_real(4) real, parameter :: r1 = aint(11.21) real(4), parameter :: r2 = aint(11.21_8, 4) real(8), parameter :: r3 = aint(231.3, 8) real, parameter :: ar1(4) = aint([1.2, 3.5, 3.4, 2.1]) real(8), parameter :: ar3(4) = aint([1.2_4, 3.5_4, 3.4_4, 2.1_4], 8) real :: arr1(4) = [1.2, 3.5, 3.4, 2.1] real(4) :: arr2(4) = [1.2_4, 3.5_4, 3.4_4, 2.1_4] real(8) :: arr3(4) = [1.2_8, 3.5_8, 3.4_8, 2.1_8] print *, aint(arr1) if (any(abs(aint(arr1) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, aint(arr2, 4) if (any(abs(aint(arr2, 4) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, aint(arr3, 8) if (any(abs(aint(arr3, 8) - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, r1 if (abs(r1 - 11.0) > epsilon) error stop print *, r2 if (abs(r2 - 11.0) > epsilon) error stop print *, r3 if (abs(r3 - 231.0) > epsilon) error stop print *, ar1 if (any(abs(ar1 - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop print *, ar3 if (any(abs(ar3 - [1.0, 3.0, 3.0, 2.0]) > epsilon)) error stop x = 4.23 print *, aint(x) if (abs(aint(x) - 4.0) > epsilon) error stop x = -4.23 print *, aint(x) if (abs(aint(x) - (-4.0)) > epsilon) error stop print *, aint(0.0) if (abs(aint(0.0) - 0.0) > epsilon) error stop print *, aint(4.23) if (abs(aint(4.23) - 4.0) > epsilon) error stop print *, aint(-4.23, 4) if (abs(aint(-4.23, 4) - (-4.0)) > epsilon) error stop ! Compile time broadcasting res_real = aint([real :: 1.2, 3.5, 3.4, 2.1]) print *, res_real if (abs(res_real(1) - 1.0) > epsilon) error stop print *, res_real(2) if (abs(res_real(2) - 3.0) > epsilon) error stop print *, res_real(3) if (abs(res_real(3) - 3.0) > epsilon) error stop print *, res_real(4) if (abs(res_real(4) - 2.0) > epsilon) error stop end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_06.f900000664000175000017500000000047615141516316026063 0ustar alastairalastairprogram example_lmdif1 implicit none real :: x(3), err x = 4.0 err = abs(sum2(x) - 12.0) print *, err if (err > 1e-6) error stop contains real function sum2(x) result(r) real, intent(in) :: x(:) integer :: i r = 0 do i = 1, size(x) r = r + x(i) end do end function end program lfortran-lfortran-2f73434/integration_tests/nested_17.f900000664000175000017500000000102115141516316023503 0ustar alastairalastairmodule nested_17_mod type t integer :: i = 1 end type type(t), parameter :: t_param = t() contains subroutine ss() type(t), parameter :: t_param2 = t() call ss_in contains subroutine ss_in() print *, t_param%i if(t_param%i /= 1) error stop print *, t_param2%i if(t_param2%i /= 1) error stop end subroutine end subroutine end module program nested_17 use nested_17_mod call ss() end programlfortran-lfortran-2f73434/integration_tests/string_87.f900000664000175000017500000000355015141516316023547 0ustar alastairalastair! Test StringToArray casting program string_87 character(10) :: str character(10) :: str2 str = "HelloWorld" call ff1(str) print *, str if(str /= "HelloWTrld") error stop 3 str = "HelloWorld" call ff2(str) print *, str if(str /= "HelloWTrld") error stop 6 str = "HelloWorld" call ff3(str) print *, str if(str /= "HelloWTrld") error stop 9 str = "HelloWorld" call ff4(str) print *, str if(str /= "HelloWTrld") error stop 12 ! TODO :: SUPPORT CASE BELOW ! str = "HelloWorld" ! call ff5(str, 2) ! print *, str ! if(str /= "HelloWTrld") error stop 15 str = "Hello" call ff1_1(trim(str)//"World") contains subroutine ff1(s) character(5) :: s(2) if(s(1) /= "Hello") error stop 1 if(s(2) /= "World") error stop 2 s(2)(2:2) = "T" end subroutine subroutine ff2(s) character(5) :: s(*) if(s(1) /= "Hello") error stop 4 if(s(2) /= "World") error stop 5 s(2)(2:2) = "T" end subroutine subroutine ff3(s) character(*) :: s(1) if(len(s(1)) /= 10) error stop 7 if(s(1) /= "HelloWorld") error stop 8 s(1)(7:7) = "T" end subroutine subroutine ff4(s) character(*) :: s(*) if(len(s(1)) /= 10) error stop 10 if(s(1) /= "HelloWorld") error stop 11 s(1)(7:7) = "T" end subroutine subroutine ff5(s, n) integer :: n character(*) :: s(n) if(len(s(1)) /= 10) error stop 13 if(s(1) /= "HelloWorld") error stop 14 s(1)(7:7) = "T" end subroutine subroutine ff1_1(s) character(2) :: s(5) if(s(1) /= "He") error stop 16 if(s(2) /= "ll") error stop 17 if(s(3) /= "oW") error stop 18 if(s(4) /= "or") error stop 19 if(s(5) /= "ld") error stop 20 end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_01_real.f900000664000175000017500000000136615141516316024532 0ustar alastairalastairprogram arrays_01_real implicit none integer :: i, j real(8) :: a(3), b(4), c(2, 2) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop do i = 1, 2 do j = 1, 2 c(i, j) = i + j + 10 end do end do if (c(1, 1) /= 12) error stop if (c(1, 2) /= 13) error stop if (c(2, 1) /= 13) error stop if (c(2, 2) /= 14) error stop end lfortran-lfortran-2f73434/integration_tests/template_sort_01.f900000664000175000017500000000575215141516316025113 0ustar alastairalastairmodule template_sort_01_type implicit none public :: my_type, my_type_lt, test_template type my_type real :: d end type contains pure elemental function lt_my_type(lhs, rhs) result(res) type(my_type), intent(in) :: lhs, rhs logical :: res res = lhs%d < rhs%d end function end module module template_sort_01_m use template_sort_01_type implicit none private public :: sort_t requirement op_r(T, U, V, op_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function op_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(T), intent(in) :: rhs type(V) :: res end function end requirement template qsort_t(T, lt) require :: op_r(T, T, logical, lt) private public :: qsort contains subroutine swp(lhs, rhs) type(T), intent(inout) :: lhs type(T), intent(inout) :: rhs type(T) :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine recursive subroutine qs(arr, low, high) type(T), intent(inout) :: arr(:) integer, intent(in) :: low, high integer :: i, last type(T) :: pivot if (low < high) then pivot = arr(high) last = low - 1 do i = low, high - 1 if (lt(arr(i), pivot)) then last = last + 1 call swp(arr(last), arr(i)) end if end do call swp(arr(last + 1), arr(high)) call qs(arr, low, last) call qs(arr, last + 2, high) end if end subroutine end template contains pure elemental function lt_real(lhs, rhs) result(res) real, intent(in) :: lhs real, intent(in) :: rhs logical :: res res = lhs < rhs end function pure elemental function lt_integer(lhs, rhs) result(res) integer, intent(in) :: lhs integer, intent(in) :: rhs logical :: res res = lhs < rhs end function subroutine test_template() integer :: xi(10), i real :: xr(10) type(my_type) :: xm(10) instantiate qsort_t(integer, lt_integer), only: qsort_integer => qs instantiate qsort_t(real, lt_real), only: qsort_real => qs instantiate qsort_t(my_type, lt_my_type), only: qsort_my_type => qs xi = [2,4,1,5,6,24,51,3,42,2] xr = [2,4,1,5,6,24,51,3,42,2] do i = 1, 10 xm(i) = my_type(xr(i)) end do call qsort_integer(xi, 1, 10) call qsort_real(xr, 1, 10) call qsort_my_type(xm, 1, 10) print *, xi print *, xr print *, xm end subroutine end module program template_sort_01 use template_sort_01_m call test_template() end programlfortran-lfortran-2f73434/integration_tests/intrinsics_407.f900000664000175000017500000000524215141516316024502 0ustar alastairalastair! Test complex abs() with extreme values (overflow and underflow protection) ! This tests the numerically stable algorithm for complex abs program intrinsics_407 implicit none complex :: c1, c2, c3, c4, c5, c6 complex(8) :: z1, z2, z3, z4 real :: r1, r2, r3, r4, r5, r6 real(8) :: d1, d2, d3, d4 ! Normal case - basic sanity check c1 = (3.0, 4.0) r1 = abs(c1) if (abs(r1 - 5.0) > 1e-5) error stop "Test 1 failed" ! Large values (near overflow for single precision) ! sqrt(5.07e30^2 + 2.54e30^2) would overflow naively ! but the correct result ~5.67e30 is representable c2 = (5.07e30, 2.54e30) r2 = abs(c2) if (r2 < 5.0e30 .or. r2 > 6.0e30) error stop "Test 2 failed: overflow in abs()" ! Negative large values c3 = (-5.07e30, -2.54e30) r3 = abs(c3) if (abs(r3 - r2) > 1e25) error stop "Test 3 failed" ! Asymmetric large values (|im| > |re|) c4 = (2.54e30, 5.07e30) r4 = abs(c4) if (abs(r4 - r2) > 1e25) error stop "Test 4 failed" ! Double precision large values z1 = (1.0d150, 2.0d150) d1 = abs(z1) if (d1 < 2.0d150 .or. d1 > 3.0d150) error stop "Test 5 failed: overflow in double complex abs()" ! Double precision with |im| > |re| z2 = (2.0d150, 1.0d150) d2 = abs(z2) if (abs(d2 - d1) > 1d145) error stop "Test 6 failed" ! ===== UNDERFLOW TESTS ===== ! Small values that would underflow naively: x^2 + y^2 -> 0 ! but the correct result is representable ! Single precision underflow test ! 1e-30^2 = 1e-60 underflows, but sqrt(2)*1e-30 ~ 1.41e-30 is representable c5 = (1.0e-30, 1.0e-30) r5 = abs(c5) ! Expected: sqrt(2) * 1e-30 ~ 1.414e-30 if (r5 < 1.0e-30 .or. r5 > 2.0e-30) error stop "Test 7 failed: underflow in single complex abs()" ! Single precision underflow with asymmetric values c6 = (1.0e-30, 2.0e-30) r6 = abs(c6) ! Expected: sqrt(1 + 4) * 1e-30 ~ 2.236e-30 if (r6 < 2.0e-30 .or. r6 > 3.0e-30) error stop "Test 8 failed: underflow in single complex abs()" ! Double precision underflow test ! 1d-200^2 = 1d-400 underflows, but sqrt(2)*1d-200 ~ 1.414d-200 is representable z3 = (1.0d-200, 1.0d-200) d3 = abs(z3) ! Expected: sqrt(2) * 1d-200 ~ 1.414d-200 if (d3 < 1.0d-200 .or. d3 > 2.0d-200) error stop "Test 9 failed: underflow in double complex abs()" ! Double precision underflow with asymmetric values z4 = (1.0d-200, 2.0d-200) d4 = abs(z4) ! Expected: sqrt(1 + 4) * 1d-200 ~ 2.236d-200 if (d4 < 2.0d-200 .or. d4 > 3.0d-200) error stop "Test 10 failed: underflow in double complex abs()" print *, "All complex abs() overflow and underflow tests passed!" end program lfortran-lfortran-2f73434/integration_tests/arrays_op_23.f900000664000175000017500000000124115141516316024221 0ustar alastairalastairprogram arrays_op_23 implicit none real :: array(10, 10), output(10, 10) array = 3.0 output = attention(10, 10, 10, array) print *, output if( any(abs(output - 8.52982235) > 1e-6) ) error stop contains function attention(l, n, m, mask) result(y) integer, intent(in) :: l, n, m real, intent(in) :: mask(n, m) real :: y(l, m) real :: tmp(n, m) tmp = 4.0 call copy_array(twice(tmp / sqrt(real(l, 4)) + mask), y) end function function twice(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) y = 2*x end function subroutine copy_array(src, dest) real, intent(in) :: src(:, :) real, intent(out) :: dest(:, :) dest = src end subroutine end program lfortran-lfortran-2f73434/integration_tests/union_test_01.f900000664000175000017500000000173015141516316024410 0ustar alastairalastairmodule lp_union_test_01_mod implicit none _lfortran_union_type :: test_type4 integer :: x real :: i end _lfortran_union_type end module program lp_union_test_01 use lp_union_test_01_mod implicit none type:: test_type integer :: x real :: y end type _lfortran_union_type :: test_type1 ! this is a test comment integer :: x real :: i type(test_type) :: y end _lfortran_union_type _lfortran_union_type :: test_type2 integer :: x real :: i type(test_type1) :: y end _lfortran_union_type type :: test_type3 integer :: x real :: i type(test_type) :: y type(test_type1) :: z type(test_type2) :: w end type type(test_type) :: t_ty type(test_type1) :: t_ty1 type(test_type2) :: t_ty2 type(test_type3) :: t_ty3 type(test_type4) :: t_ty4 end program lfortran-lfortran-2f73434/integration_tests/array_section_10.f900000664000175000017500000000141215141516316025060 0ustar alastairalastairprogram array_section_10 ! Test valid array section assignments with matching shapes implicit none integer :: a(1), b(2), c(3) integer :: temp(5) integer :: i ! Valid: single element section to size-1 array i = 2 a = temp(i:i) if (size(a) /= 1) error stop ! Valid: expression section (i+1:i+1) to size-1 array i = 1 a = temp(i+1:i+1) if (size(a) /= 1) error stop ! Valid: expression section (2*i:2*i) to size-1 array i = 2 a = temp(2*i:2*i) if (size(a) /= 1) error stop ! Valid: two element section to size-2 array b = temp(1:2) if (size(b) /= 2) error stop ! Valid: three element section to size-3 array c = temp(2:4) if (size(c) /= 3) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_363.f900000664000175000017500000000020315141516316024473 0ustar alastairalastairprogram intrinsics_363 real :: a(2) = cshift([1.0,2.0], 1) print *, a if (any(a /= [2.0, 1.0])) error stop end program lfortran-lfortran-2f73434/integration_tests/cpu_time_01.f900000664000175000017500000000030615141516316024024 0ustar alastairalastairprogram cpu_time_01 use iso_fortran_env, only: dp=>real64 implicit none real(dp) :: t1, t2 call cpu_time(t1) print *, "Some computation" call cpu_time(t2) print *, "Total time: ", t2-t1 end program lfortran-lfortran-2f73434/integration_tests/format_18.f900000664000175000017500000000175015141516316023523 0ustar alastairalastairmodule format_18_mod implicit none contains character(100) function logical_to_string(value, format) logical :: value character(len=*) :: format ! character(len=100), allocatable :: string character(len=100) :: buffer integer :: stat ! If format isn't equal to `l`, it should raise a runtime error ! but instead it would just set stat to not 0 (which indicates an error) write(buffer, "(" // format // ")", iostat=stat) value ! Note : if iostat isn't passed a runtime error would be raised. if (stat == 0) then logical_to_string = trim(buffer) else logical_to_string = "[*]" end if end function logical_to_string end module format_18_mod program name use format_18_mod implicit none logical :: logi character(100) :: str logi = .true. str = logical_to_string(logi, "(I5)") print *, str if(str /= "[*]") error stop end program name lfortran-lfortran-2f73434/integration_tests/intrinsics_93.f900000664000175000017500000000233615141516316024424 0ustar alastairalastairprogram intrinsics_93 use iso_fortran_env, only: dp => real64, sp => real32 implicit none integer, parameter :: i1 = digits(31) integer(8), parameter :: i2 = digits(63) integer, parameter :: i3 = digits(24.5_sp) integer(8), parameter :: i4 = digits(53.5_dp) integer, parameter :: ar1 = digits([1, 33, 56]) integer, parameter :: ar2 = digits([1.0_sp, 33.0_sp, 56.0_sp]) integer :: i integer(8) :: j real :: x real(8) :: y integer :: arr1(3) = [1, 33, 56] real(8) :: arr2(3) = [1.0_dp, 33.0_dp, 56.0_dp] print *, i1 if (i1 /= 31) error stop print *, i2 if (i2 /= 31) error stop print *, i3 if (i3 /= 24) error stop print *, i4 if (i4 /= 53) error stop print *, ar1 if (ar1 /= 31) error stop print *, ar2 if (ar2 /= 24) error stop print *, digits(i) if (digits(i) /= 31) error stop print *, digits(j) if (digits(j) /= 63) error stop print *, digits(x) if (digits(x) /= 24) error stop print *, digits(y) if (digits(y) /= 53) error stop print *, digits(arr1) ! if (digits(arr1) /= 31) error stop ! Does not work #4367 print *, digits(arr2) ! if (digits(arr2) /= 53) error stop end programlfortran-lfortran-2f73434/integration_tests/format_11.f900000664000175000017500000000037015141516316023511 0ustar alastairalastairprogram format_11 implicit none logical :: b print *, 'test writing a logical' print * b = .false. print *, 'formatted write' write (*, 700) .true. write (*, 700) b print *, 'using print' print *, .true. print *, b stop 700 format (l7) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_162.f900000664000175000017500000000232215141516316024474 0ustar alastairalastairprogram intrinsics_162 implicit none integer :: a1 = 1 integer(8) :: a2 = -5 integer :: a3 = 0 integer, parameter :: i1 = not(1) integer(8), parameter :: i2 = not(-5) integer, parameter :: ar1(3) = not([-1, 43, -8]) integer(8), parameter :: ar2(3) = not([-1_8, 43_8, -8_8]) integer(4) :: arr1(3) = [11, -13, 0] integer(8) :: arr2(3) = [11_8, -13_8, 0_8] print *, i1 if (i1 /= -2) error stop print *, i2 if (i2 /= 4) error stop print *, ar1 if (any(ar1 /= [0, -44, 7])) error stop print *, ar2 if (any(ar2 /= [0_8, -44_8, 7_8])) error stop print*, not(a1) if (not(a1) /= -2) error stop print*, not(a2) if (not(a2) /= 4) error stop print*, not(a3) if (not(a3) /= -1) error stop print*, not(1) if (not(1) /= -2) error stop print*, not(-5) if (not(-5) /= 4) error stop print*, not(0) if (not(0) /= -1) error stop print*, not(arr1) if (any(not(arr1) /= [-12, 12, -1])) error stop print*, not(arr2) if (any(not(arr2) /= [-12_8, 12_8, -1_8])) error stop print *, kind(not(1)) if (kind(not(1)) /= 4) error stop print *, kind(not(5_8)) if (kind(not(5_8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/format_19.f900000664000175000017500000000103315141516316023516 0ustar alastairalastairprogram format_19 implicit none real(4) :: x4 character(len=32) :: buffer x4 = 9.33264777E-43 write(buffer, "(ES0.8)") x4 print *, buffer if (buffer /= "9.33264777E-43") error stop "Incorrect formatting of x4" write(buffer, "(ES0.8)") tiny(0.0) print *, buffer if (buffer /= "1.17549435E-38") error stop "Incorrect formatting of tiny(0.0)" write(buffer, "(ES0.8)") huge(0.0) print *, buffer if (buffer /= "3.40282347E+38") error stop "Incorrect formatting of huge(0.0)" end program lfortran-lfortran-2f73434/integration_tests/functions_07.f900000664000175000017500000000121615141516316024236 0ustar alastairalastairmodule functions_07_a implicit none contains real function f_a(u) result(v) real, intent(in) :: u v = u + 1.0 end function end module module functions_07_b use functions_07_a implicit none contains real function f_b(x) result(y) real, intent(in) :: x y = f_a(x) + 1.0 end function end module module functions_07_c use functions_07_b implicit none contains real function f_c(w) result(z) real, intent(in) :: w z = f_b(w) + 1.0 end function end module program functions_07 use functions_07_c implicit none real :: p = 5, q q = f_c(p) print *, q end program lfortran-lfortran-2f73434/integration_tests/intrinsics_238.f900000664000175000017500000000033015141516316024475 0ustar alastairalastairprogram intrinsics_238 implicit none integer :: i integer, parameter :: res(5) = [ (maskl(i), i=1, 5) ] do i = 1, 5 print*, res(i), maskl(i) if (maskl(i) /= res(i) ) error stop end do print *, maskl(1, 8) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_166.f900000664000175000017500000000310615141516316024501 0ustar alastairalastairprogram intrinsics_166 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ibset(5, 8) integer, parameter :: i2 = ibset(-1_8, 5) integer, parameter :: i3 = ibset(-4, 2_8) integer(8), parameter :: i4 = ibset(-2_8, 5_8) integer, parameter :: ar1(3) = ibset([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ibset([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 261) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -4) error stop print *, i4 if (i4 /= -2) error stop print*, ibset(5, 8) if (ibset(5, 8) /= 261) error stop print*, ibset(-1, 5) if (ibset(-1, 5) /= -1) error stop print*, ibset(a1, a2) if (ibset(a1, a2) /= 261) error stop print*, ibset(a3, a1) if (ibset(a3, a1) /= -1) error stop print*, ibset(a2, a4) if (ibset(a2, a4) /= 268435464) error stop print*, ibset(a5, a6) if (ibset(a5, a6) /= -2) error stop print *, ar1 if (any(ar1 /= [261, 40, 13])) error stop print *, ar2 if (any(ar2 /= [-1, -5, -10])) error stop print *, ibset(arr1, arr1) if (any(ibset(arr1, arr1) /= [37, 264, 521])) error stop print *, ibset(arr2, arr1) if (any(ibset(arr2, arr1) /= [-1, -5, -10])) error stop res = ibset(arr1, arr3) print *, res if (any(res /= [261, 40, 13])) error stop end program lfortran-lfortran-2f73434/integration_tests/print_arr_08.f900000664000175000017500000000724315141516316024235 0ustar alastairalastair! Non-Unit Stride Access in Print Statements ! Testing various array section prints for 2D and 3D arrays, ! Including multi-dimensional slices and complete array prints. ! Test using write statements with string comparison. program print_arr_08 implicit none integer :: list_2d(2,3) integer :: list_3d(3,3,3) character(len=100) :: str1 !Test 2D Array Section !Assign Row Values list_2d(1,:) = [2,2,2] list_2d(2,:) = [3,3,3] !Row-Access: concatenate arrays to print on one line write(str1, "(6(1X,I0))") [list_2d(1,:), list_2d(2,:)] print "(6(1X,I0))", [list_2d(1,:), list_2d(2,:)] if (trim(str1) /= " 2 2 2 3 3 3") error stop !Column-Access: concatenate arrays to print on one line write(str1, "(6(1X,I0))") [list_2d(:,1), list_2d(:,2), list_2d(:,3)] print "(6(1X,I0))", [list_2d(:,1), list_2d(:,2), list_2d(:,3)] if (trim(str1) /= " 2 3 2 3 2 3") error stop !Test 3D Array Section list_3d(1,:,1) = [4,4,4] list_3d(1,:,2) = [5,5,5] list_3d(1,:,3) = [6,6,6] list_3d(2,:,1) = [7,7,7] list_3d(2,:,2) = [8,8,8] list_3d(2,:,3) = [9,9,9] list_3d(3,:,1) = [10,10,10] list_3d(3,:,2) = [11,11,11] list_3d(3,:,3) = [12,12,12] !Dim1-Access write(str1, "(9(1X,I0))") [list_3d(:,1,1), list_3d(:,1,2), list_3d(:,1,3)] print "(9(1X,I0))", [list_3d(:,1,1), list_3d(:,1,2), list_3d(:,1,3)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12") error stop write(str1, "(9(1X,I0))") [list_3d(:,2,1), list_3d(:,2,2), list_3d(:,2,3)] print "(9(1X,I0))", [list_3d(:,2,1), list_3d(:,2,2), list_3d(:,2,3)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12") error stop !Dim2-Access write(str1, "(9(1X,I0))") [list_3d(1,:,1), list_3d(1,:,2), list_3d(1,:,3)] print "(9(1X,I0))", [list_3d(1,:,1), list_3d(1,:,2), list_3d(1,:,3)] if (trim(str1) /= " 4 4 4 5 5 5 6 6 6") error stop write(str1, "(9(1X,I0))") [list_3d(2,:,1), list_3d(2,:,2), list_3d(2,:,3)] print "(9(1X,I0))", [list_3d(2,:,1), list_3d(2,:,2), list_3d(2,:,3)] if (trim(str1) /= " 7 7 7 8 8 8 9 9 9") error stop !Dim3-Access write(str1, "(9(1X,I0))") [list_3d(1,1,:), list_3d(1,2,:), list_3d(1,3,:)] print "(9(1X,I0))", [list_3d(1,1,:), list_3d(1,2,:), list_3d(1,3,:)] if (trim(str1) /= " 4 5 6 4 5 6 4 5 6") error stop write(str1, "(9(1X,I0))") [list_3d(2,1,:), list_3d(2,2,:), list_3d(2,3,:)] print "(9(1X,I0))", [list_3d(2,1,:), list_3d(2,2,:), list_3d(2,3,:)] if (trim(str1) /= " 7 8 9 7 8 9 7 8 9") error stop !2D Access write(str1, "(27(1X,I0))") [list_3d(:,:,1), list_3d(:,:,2), list_3d(:,:,3)] print "(27(1X,I0))", [list_3d(:,:,1), list_3d(:,:,2), list_3d(:,:,3)] if (trim(str1) /= " 4 7 10 4 7 10 4 7 10 5 8 11 5 8 11 5 8 11 6 9 12 6 9 12 6 9 12") error stop write(str1, "(27(1X,I0))") [list_3d(:,1,:), list_3d(:,2,:), list_3d(:,3,:)] print "(27(1X,I0))", [list_3d(:,1,:), list_3d(:,2,:), list_3d(:,3,:)] if (trim(str1) /= " 4 7 10 5 8 11 6 9 12 4 7 10 5 8 11 6 9 12 4 7 10 5 8 11 6 9 12") error stop write(str1, "(27(1X,I0))") [list_3d(1,:,:), list_3d(2,:,:), list_3d(3,:,:)] print "(27(1X,I0))", [list_3d(1,:,:), list_3d(2,:,:), list_3d(3,:,:)] if (trim(str1) /= " 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12") error stop !Access a continuous subset of values write(str1, "(8(1X,I0))") [list_3d(1:2,1:2,1:2)] print "(8(1X,I0))", [list_3d(1:2,1:2,1:2)] if (trim(str1) /= " 4 7 4 7 5 8 5 8") error stop write(str1, "(12(1X,I0))") [list_3d(2:3,2:3,:)] print "(12(1X,I0))", [list_3d(2:3,2:3,:)] if (trim(str1) /= " 7 10 7 10 8 11 8 11 9 12 9 12") error stop write(str1, "(12(1X,I0))") [list_3d(2:3,1:2,2:3)] print "(12(1X,I0))", [list_3d(2:3,1:2,2:3)] if (trim(str1) /= " 8 11 8 11 9 12 9 12") error stop print *, "All tests passed!" end program print_arr_08lfortran-lfortran-2f73434/integration_tests/derived_types_10.f900000664000175000017500000000103515141516316025065 0ustar alastairalastairprogram debug implicit none type :: char_struct !> Newline character character(len=1) :: f = achar(70) !> Tabulators are allowed as whitespace and in strings character(len=1) :: g = achar(71) end type char_struct type(char_struct) :: alphabets if( alphabets%f /= 'F' ) error stop if( alphabets%g /= 'G' ) error stop print *, alphabets%f, alphabets%g alphabets%f = achar(80) alphabets%g = achar(81) if( alphabets%f /= 'P' ) error stop if( alphabets%g /= 'Q' ) error stop print *, alphabets%f, alphabets%g end program debug lfortran-lfortran-2f73434/integration_tests/string_35.f900000664000175000017500000000020715141516316023534 0ustar alastairalastairprogram string_35 implicit none print *, index("pat", "patter") if (index("pat", "patter") /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_34_module3.f900000664000175000017500000000063115141516316025326 0ustar alastairalastairmodule fpm_modules_34 use fpm_manifest_modules_34, only : package_config_t implicit none contains subroutine build_model(package) type(package_config_t), intent(in) :: package character(len=:), allocatable :: version integer :: i associate(ii => i) print *, ii call package%version%to_string(version) end associate end subroutine build_model end module fpm_modules_34 lfortran-lfortran-2f73434/integration_tests/derived_types_77.f900000664000175000017500000000212415141516316025102 0ustar alastairalastairmodule m_toml_array type :: toml_array integer :: key contains procedure :: get end type toml_array contains subroutine get(this, n) class(toml_array), intent(inout) :: this integer, intent(in) :: n this%key = n end subroutine get end module m_toml_array module derived_types_77_mod type :: toml_table character(len=:), allocatable :: key contains procedure :: get end type toml_table contains subroutine get(this, key) class(toml_table), intent(inout) :: this character(len=*), intent(in) :: key this%key = key end subroutine get end module derived_types_77_mod program derived_types_77 use m_toml_array use derived_types_77_mod implicit none type(toml_table) :: tbl type(toml_array) :: arr arr%key = 10 tbl%key = "Hello" if (arr%key /= 10) error stop if (tbl%key /= "Hello") error stop call arr%get(5) call tbl%get("World") if (arr%key /= 5) error stop if (tbl%key /= "World") error stop end program derived_types_77lfortran-lfortran-2f73434/integration_tests/intrinsics_318.f900000664000175000017500000000032315141516316024476 0ustar alastairalastairprogram test_cpu_time real :: start, finish call cpu_time(start) ! put code to test here call cpu_time(finish) print '("Time = ",f6.3," seconds.")',finish-start end program test_cpu_time lfortran-lfortran-2f73434/integration_tests/string_44.f900000664000175000017500000000024715141516316023540 0ustar alastairalastairprogram string_44 character(len=:),allocatable :: color color = "red" select case (color) case('red') print *, "red" end select end programlfortran-lfortran-2f73434/integration_tests/file 24 data.txt0000664000175000017500000000001715141516316024156 0ustar alastairalastairHello LFortran!lfortran-lfortran-2f73434/integration_tests/openmp_02.f900000664000175000017500000000025115141516316023515 0ustar alastairalastairprogram openmp_02 use omp_lib call omp_set_num_threads(4) print *, "Number of threads: ", omp_get_max_threads() if (omp_get_max_threads() /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/external_08.f900000664000175000017500000000101315141516316024044 0ustar alastairalastairsubroutine b(f,g) ! f, g are functions call f(1.39) call g(-9.16) end subroutine subroutine f(x) real :: x print *, x if (abs(x - 1.39) > 1e-8) error stop end subroutine subroutine g(x) real :: x print *, x if (abs(x - (-9.16)) > 1e-8) error stop end subroutine subroutine a() interface subroutine f(x) real :: x end subroutine subroutine g(x) real :: x end subroutine end interface call b(f,g) end subroutine program external_08 call a() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_188.f900000664000175000017500000000727615141516316024521 0ustar alastairalastairprogram intrinsics_188 character(5) :: hello = "hello" character(5) :: world = "world" character(8) :: lfortran = "lfortran" character(7) :: fortran = "fortran" character(5) :: sym = "#s@ym" character(4) :: sym2 = "s_y!" print*, lgt("hello", "world") if (lgt("hello", "world") .neqv. .false.) error stop print*, lgt("hello", "hello") if (lgt("hello", "hello") .neqv. .false.) error stop print*, lgt("lfortran", "fortran") if (lgt("lfortran", "fortran") .neqv. .true.) error stop print*, lgt("#s@ym", "s_y!") if (lgt("#s@ym", "s_y!") .neqv. .false.) error stop print*, lgt("hello", "s_y!") if (lgt("hello", "s_y!") .neqv. .false.) error stop print*, lge("hello", "world") if (lge("hello", "world") .neqv. .false.) error stop print*, lge("hello", "hello") if (lge("hello", "hello") .neqv. .true.) error stop print*, lge("lfortran", "fortran") if (lge("lfortran", "fortran") .neqv. .true.) error stop print*, lge("#s@ym", "s_y!") if (lge("#s@ym", "s_y!") .neqv. .false.) error stop print*, lge("hello", "s_y!") if (lge("hello", "s_y!") .neqv. .false.) error stop print*, llt("hello", "world") if (llt("hello", "world") .neqv. .true.) error stop print*, llt("hello", "hello") if (llt("hello", "hello") .neqv. .false.) error stop print*, llt("lfortran", "fortran") if (llt("lfortran", "fortran") .neqv. .false.) error stop print*, llt("#s@ym", "s_y!") if (llt("#s@ym", "s_y!") .neqv. .true.) error stop print*, llt("hello", "s_y!") if (llt("hello", "s_y!") .neqv. .true.) error stop print*, lle("hello", "world") if (lle("hello", "world") .neqv. .true.) error stop print*, lle("hello", "hello") if (lle("hello", "hello") .neqv. .true.) error stop print*, lle("lfortran", "fortran") if (lle("lfortran", "fortran") .neqv. .false.) error stop print*, lle("#s@ym", "s_y!") if (lle("#s@ym", "s_y!") .neqv. .true.) error stop print*, lle("hello", "s_y!") if (lle("hello", "s_y!") .neqv. .true.) error stop print*, lgt(hello, world) if (lgt(hello, world) .neqv. .false.) error stop print*, lgt(hello, hello) if (lgt(hello, hello) .neqv. .false.) error stop print*, lgt(lfortran, fortran) if (lgt(lfortran, fortran) .neqv. .true.) error stop print*, lgt(sym, sym2) if (lgt(sym, sym2) .neqv. .false.) error stop print*, lgt(hello, sym2) if (lgt(hello, sym2) .neqv. .false.) error stop print*, lge(hello, world) if (lge(hello, world) .neqv. .false.) error stop print*, lge(hello, hello) if (lge(hello, hello) .neqv. .true.) error stop print*, lge(lfortran, fortran) if (lge(lfortran, fortran) .neqv. .true.) error stop print*, lge(sym, sym2) if (lge(sym, sym2) .neqv. .false.) error stop print*, lge(hello, sym2) if (lge(hello, sym2) .neqv. .false.) error stop print*, llt(hello, world) if (llt(hello, world) .neqv. .true.) error stop print*, llt(hello, hello) if (llt(hello, hello) .neqv. .false.) error stop print*, llt(lfortran, fortran) if (llt(lfortran, fortran) .neqv. .false.) error stop print*, llt(sym, sym2) if (llt(sym, sym2) .neqv. .true.) error stop print*, llt(hello, sym2) if (llt(hello, sym2) .neqv. .true.) error stop print*, lle(hello, world) if (lle(hello, world) .neqv. .true.) error stop print*, lle(hello, hello) if (lle(hello, hello) .neqv. .true.) error stop print*, lle(lfortran, fortran) if (lle(lfortran, fortran) .neqv. .false.) error stop print*, lle(sym, sym2) if (lle(sym, sym2) .neqv. .true.) error stop print*, lle(hello, sym2) if (lle(hello, sym2) .neqv. .true.) error stop end programlfortran-lfortran-2f73434/integration_tests/inquire_07.f900000664000175000017500000000042515141516316023703 0ustar alastairalastairprogram inquire_07 implicit none integer :: i, iolen logical :: l character(4) :: s real :: r inquire (iolength=iolen) l, s, i, r if (iolen /= 16) then error stop "inquire(iolength=...) produced wrong result" end if end program inquire_07lfortran-lfortran-2f73434/integration_tests/intrinsics_119.f900000664000175000017500000000045715141516316024505 0ustar alastairalastairprogram intrinsics_119 integer :: x(5) = [ 1, 2, 3, 4 ,5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] if ( .not. sum( array = x, mask = mask ) == 9 ) error stop if ( .not. sum( x, mask = mask ) == 9 ) error stop if ( .not. sum( x, mask ) == 9 ) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_297.f900000664000175000017500000000255215141516316024512 0ustar alastairalastairprogram intrinsics_297 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c integer, parameter :: x1 = poppar(44) integer(8), parameter :: y1 = poppar(5468272828_8) integer, parameter :: z1 = poppar(-501) integer(8), parameter :: w1 = poppar(-3526282829_8) integer, parameter :: ar1(3) = poppar([83983, 5468272, -3526282]) integer(8), parameter :: ar2(3) = poppar([83983_8, 5468272828_8, -3526282829_8]) integer :: arr1(3) = [83983, 5468272, -3526282] integer(8) :: arr2(3) = [83983_8, 5468272828_8, -3526282829_8] print *, x1 if(x1 /= 1) error stop print *, y1 if(y1 /= 1) error stop print *, z1 if(z1 /= 0) error stop print *, w1 if(w1 /= 0) error stop print *, ar1 if(any(ar1 /= [1, 0, 0])) error stop print *, ar2 if(any(ar2 /= [1, 1, 0])) error stop print *, poppar(arr1) if (any(poppar(arr1) /= [1, 0, 0])) error stop print *, poppar(arr2) if (any(poppar(arr2) /= [1, 1, 0])) error stop x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop end programlfortran-lfortran-2f73434/integration_tests/struct_type_05.f900000664000175000017500000000031315141516316024606 0ustar alastairalastairprogram test type :: para integer :: a real :: b end type type(para), parameter :: temp(3) = [para(8, 5.0E0), para(5, 1.0E0), para(10, 12.0E0)] print *, temp end program lfortran-lfortran-2f73434/integration_tests/string_02.f900000664000175000017500000000047015141516316023530 0ustar alastairalastairprogram string_02 implicit none character(len = 15) :: surname, firstname character(len = 6) :: title character(len = 25)::greetings title = 'Mr. ' firstname = 'Rowan ' surname = 'Atkinson' greetings = 'A big hello from Mr. Bean' print *, 'Here is ', title, firstname, surname print *, greetings end program lfortran-lfortran-2f73434/integration_tests/procedure_09_a.f900000664000175000017500000000062115141516316024517 0ustar alastairalastairmodule procedure_09_module contains subroutine cb(x, a, b, terminate) implicit none real, intent(in) :: x(:) integer, intent(in), optional :: a integer, intent(in), optional :: b logical, intent(out), optional :: terminate if(present(a) .or. present(b) .and. .not. present(terminate)) error stop end subroutine cb end module procedure_09_module lfortran-lfortran-2f73434/integration_tests/functions_28.f900000664000175000017500000000111015141516316024232 0ustar alastairalastairprogram test implicit none real(8) :: y(2,2) real(8) :: x(2) = [1,2] real(8) :: z(size(y,2)) integer :: j = 1 z = matprod12(x, y) print *, z contains function matprod12(x, y) result(z) implicit none real(8), intent(in) :: x(:) real(8), intent(in) :: y(:, :) real(8) :: z(size(y, 2)) integer :: j j = size(y,2) z(j) = inprod(x, y(:, j)) end function matprod12 function inprod(x, y) result(z) implicit none real(8), intent(in) :: x(:) real(8), intent(in) :: y(:) real(8) :: z end function inprod end program lfortran-lfortran-2f73434/integration_tests/expr_12.f900000664000175000017500000000027415141516316023203 0ustar alastairalastairprogram expr_12 implicit none if ('1'//char(38)//char(35)//'1' /= '1') error stop if ('1'//char(38)//char(35)//'1'//char(0) /= '1'//char(0)) error stop end program expr_12 lfortran-lfortran-2f73434/integration_tests/test_ieee_support.f900000664000175000017500000000546015141516316025467 0ustar alastairalastair! Test ieee_support_* inquiry functions program test_ieee_support use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_support_* functions..." ! Test ieee_support_denormal result = ieee_support_denormal(x_sp) print *, "ieee_support_denormal(real32) = ", result if (.not. result) error stop "Should support denormals" result = ieee_support_denormal(x_dp) print *, "ieee_support_denormal(real64) = ", result if (.not. result) error stop "Should support denormals" ! Test ieee_support_divide result = ieee_support_divide(x_sp) print *, "ieee_support_divide(real32) = ", result if (.not. result) error stop "Should support divide" result = ieee_support_divide(x_dp) print *, "ieee_support_divide(real64) = ", result if (.not. result) error stop "Should support divide" ! Test ieee_support_sqrt result = ieee_support_sqrt(x_sp) print *, "ieee_support_sqrt(real32) = ", result if (.not. result) error stop "Should support sqrt" result = ieee_support_sqrt(x_dp) print *, "ieee_support_sqrt(real64) = ", result if (.not. result) error stop "Should support sqrt" ! Test ieee_support_standard result = ieee_support_standard(x_sp) print *, "ieee_support_standard(real32) = ", result if (.not. result) error stop "Should support standard" result = ieee_support_standard(x_dp) print *, "ieee_support_standard(real64) = ", result if (.not. result) error stop "Should support standard" ! Test ieee_support_io result = ieee_support_io(x_sp) print *, "ieee_support_io(real32) = ", result if (.not. result) error stop "Should support I/O" result = ieee_support_io(x_dp) print *, "ieee_support_io(real64) = ", result if (.not. result) error stop "Should support I/O" ! Test ieee_support_rounding result = ieee_support_rounding(ieee_nearest, x_sp) print *, "ieee_support_rounding(ieee_nearest, real32) = ", result if (.not. result) error stop "Should support rounding" result = ieee_support_rounding(ieee_to_zero, x_dp) print *, "ieee_support_rounding(ieee_to_zero, real64) = ", result if (.not. result) error stop "Should support rounding" ! Test ieee_support_datatype result = ieee_support_datatype(x_sp) print *, "ieee_support_datatype(real32) = ", result if (.not. result) error stop "Should support datatype" result = ieee_support_datatype(x_dp) print *, "ieee_support_datatype(real64) = ", result if (.not. result) error stop "Should support datatype" print *, "All ieee_support_* tests passed!" end program test_ieee_support lfortran-lfortran-2f73434/integration_tests/equivalence_10.f900000664000175000017500000000036015141516316024520 0ustar alastairalastairprogram equivalence_10 REAL A, A1 DIMENSION A(26,4), A1(26,4) EQUIVALENCE (A(1,1),A1(1,1)) DATA A1(1,1) /42.0/ if (any(shape(A1) /= [26,4])) error stop if (A(1,1) /= 42.0 .or. A1(1,1) /= 42.0) error stop end program lfortran-lfortran-2f73434/integration_tests/array_indices_array_item_assignment_1.f900000664000175000017500000000055215141516316031422 0ustar alastairalastairprogram array_indices_array_item_assignment integer :: A(3, 2) = reshape([1, 2, 3, 4, 5, 6], [3, 2]), Acorrect(6) integer :: B(3, 2) integer :: X(2) = [1,2] integer, allocatable :: Y(:) ! integer :: i, j, k allocate(Y(2)) Y = 2 B = 2 A(X, X) = B(X, Y) Acorrect = reshape(A, [6]) print *, Acorrect if( any(Acorrect /= [2, 2, 3, 2, 2, 6]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/where_10.f900000664000175000017500000000502315141516316023332 0ustar alastairalastairprogram where_10 implicit none real, parameter :: zero = 0.0 integer :: i real :: first_array(1, 4) integer :: second_array(2, 4) logical :: third_array(2, 4) real :: first_output(1, 4) integer :: second_output(2, 4) logical :: third_output(2, 4) first_array = reshape([0.0, 1.0, 0.0, 1.0], [1, 4]) second_array = reshape([1, 2, 0, 4, 5, 0, 7, 0], [2, 4]) third_array = reshape([.false., .true., .true., .true., .false., .true., .false., .true.], [2, 4]) where (first_array(1, :) == zero) first_array(1, :) = 2.0 end where print *, first_array first_output = reshape([2.0, 1.0, 2.0, 1.0], [1, 4]) if (all(first_array /= first_output)) error stop where (second_array(:, 4) /= 0) second_array(:, 4) = 22 end where print *, second_array second_output = reshape([1, 2, 0, 4, 5, 0, 22, 0], [2, 4]) if (all(second_array /= second_output)) error stop i = 1 where (first_array(i, :) > 1.0) first_array(i, :) = 22.0 end where print *, first_array first_output = reshape([22.0, 1.0, 22.0, 1.0], [1, 4]) if (all(first_array /= first_output)) error stop where (third_array(2, :)) second_array(2, :) = 1 end where print *, second_array second_output = reshape([1, 1, 0, 1, 5, 1, 22, 1], [2, 4]) if (all(second_array /= second_output)) error stop where (third_array(2, :) .neqv. .false.) third_array(2, :) = .false. end where print *, third_array third_output = reshape([.false., .false., .true., .false., .false., .false., .false., .false.], [2, 4]) if (all(third_array .neqv. third_output)) error stop ! Assignment like: ! first_array(1, :) = first_array(1, :) + 1 ! is currently not supported inside the `WHERE` clause. ! ! Uncomment after supporting the above: ! ! where (first_array(1, :) > 1.0) ! first_array(1, :) = first_array(1, :) + 1 ! end where ! ! print *, first_array ! first_output = reshape([3.0, 1.0, 3.0, 1.0], [1, 4]) ! if (all(first_array /= first_output)) error stop ! ! ========================================================= ! ! Array section expressions like second_array(:, :) ! is currently not supported inside `WHERE` clause. ! ! Uncomment after supporting the above: ! ! where (second_array(:, :) /= 0) ! second_array(:, :) = 10 ! end where ! ! print *, second_array ! second_output = reshape([10, 10, 0, 10, 10, 0, 10, 0], [2, 4]) ! if (all(second_array /= second_output)) error stop end program where_10lfortran-lfortran-2f73434/integration_tests/no_explicit_return_type_01.f900000664000175000017500000000241315141516316027175 0ustar alastairalastairprogram no_explicit_return_type real, dimension(3) :: arr, squared_arr real :: val arr = [1.0, 2.0, 3.0] print *, "f_elemental_real(1.0): ", f_elemental_real(1.0) if (abs(f_elemental_real(1.0) - 43.0) > 1e-12) error stop print *, "f_pure_real(1.0): ", f_pure_real(1.0) if (abs(f_pure_real(1.0) - 24.0) > 1e-12) error stop squared_arr = square(arr) print *, "squared_arr: ", squared_arr if (any(squared_arr /= [1.0, 4.0, 9.0])) error stop val = impure_log(10.0) print *, "val: ", val if ( abs(val - 2.0) > 1e-12 ) error stop contains ! elemental function without explicit type elemental function f_elemental_real(x) real, intent(in) :: x f_elemental_real = x + 42.0 end function ! pure function without explicit type pure function f_pure_real(x) real, intent(in) :: x f_pure_real = x + 23.0 end function ! pure elemental function without explicit type pure elemental function square(x) real, intent(in) :: x square = x * x end function square ! impure function without explicit type impure function impure_log(a) real, intent(in) :: a impure_log = log(a) end function impure_log end program no_explicit_return_type lfortran-lfortran-2f73434/integration_tests/derived_types_31.f900000664000175000017500000000476515141516316025105 0ustar alastairalastairmodule testdrive_derived_types_31 use, intrinsic :: iso_fortran_env, only : error_unit implicit none private public :: new_testsuite public :: unittest_type, testsuite_type, error_type public :: test_interface, collect_interface integer, parameter :: success = 0 type :: error_type integer :: stat = success character(len=:), allocatable :: message contains final :: escalate_error end type error_type abstract interface subroutine test_interface(error) import :: error_type type(error_type), allocatable, intent(out) :: error end subroutine test_interface end interface type :: unittest_type character(len=:), allocatable :: name procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type abstract interface subroutine collect_interface(testsuite) import :: unittest_type type(unittest_type), allocatable, intent(out) :: testsuite(:) end subroutine collect_interface end interface type :: testsuite_type character(len=:), allocatable :: name procedure(collect_interface), pointer, nopass :: collect => null() end type testsuite_type contains function new_testsuite(name, collect) result(self) character(len=*), intent(in) :: name procedure(collect_interface) :: collect type(testsuite_type) :: self self%name = name self%collect => collect end function new_testsuite subroutine escalate_error(error) type(error_type), intent(inout) :: error if (error%stat /= success) then write(error_unit, '(a)') "[Fatal] Uncaught error" if (allocated(error%message)) then write(error_unit, '(a, 1x, i0, *(1x, a))') & "Code:", error%stat, "Message:", error%message end if error stop end if end subroutine escalate_error end module testdrive_derived_types_31 program main use testdrive_derived_types_31 implicit none type(testsuite_type) :: suite type(unittest_type), allocatable :: array_suite(:) suite = new_testsuite("name", collect_impl) call suite%collect(array_suite) print *, size(array_suite) if( size(array_suite) /= 10 ) error stop contains subroutine collect_impl(testsuite) type(unittest_type), allocatable, intent(out) :: testsuite(:) allocate(testsuite(10)) end subroutine collect_impl end program lfortran-lfortran-2f73434/integration_tests/intrinsics_107.f900000664000175000017500000000053015141516316024472 0ustar alastairalastairPROGRAM intrinsics_107 integer(4) :: x = 5 integer(8) :: y = 5 WRITE (*,*) trailz(0_4) if ( trailz(0_4) /= 32 ) error stop WRITE (*,*) trailz(0_8) if ( trailz(0_8) /= 64 ) error stop WRITE (*,*) trailz(x) if ( trailz(x) /= 0 ) error stop WRITE (*,*) trailz(y) if ( trailz(y) /= 0 ) error stop END PROGRAMlfortran-lfortran-2f73434/integration_tests/arrays_54.f900000664000175000017500000000043215141516316023530 0ustar alastairalastairprogram arrays_54 implicit none integer :: res(4) real :: x(1, 4), center, order integer, parameter :: dim = 1 order = 2 x = 1 center = 0 res = 1 + sum((x - center), dim) / size(x, dim) if( any(res /= 2) ) error stop print *, res end program lfortran-lfortran-2f73434/integration_tests/intrinsics_98.f900000664000175000017500000000132315141516316024424 0ustar alastairalastairprogram intrinsics_98 integer :: a(3) real, parameter :: sum_ = sum([1, 2, 3]) real, parameter :: size_ = size([1, 2, 3]) real, parameter :: maxval_ = maxval([1, 2, 3]) real, parameter :: minval_ = minval([1, 2, 3]) a = [1, 2, 3] print *, shape(a) print *, size(a) if (size(a) /= 3) error stop print *, maxval(a) if (maxval(a) /= 3) error stop print *, minval(a) if (minval(a) /= 1) error stop print *, sum(a) if (sum(a) /= 6) error stop print*, sum_ if (sum_ /= 6) error stop print*, size_ if (size_ /= 3) error stop print*, maxval_ if (maxval_ /= 3) error stop print*, minval_ if (minval_ /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/const_kind_01.f900000664000175000017500000000031415141516316024351 0ustar alastairalastairprogram const_kind_01 integer, parameter :: sp = 4, dp = 8 real(sp), parameter :: r1 = 1.0_sp real(dp), parameter :: r2 = 1.0_dp real :: r3 r3 = 1.0_sp r3 = 1.0_dp print *, sp, dp, r1, r2, r3 end program lfortran-lfortran-2f73434/integration_tests/save_03.f900000664000175000017500000000277515141516316023173 0ustar alastairalastairsubroutine save_sub() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine subroutine save_nested_sub() integer :: i, j contains subroutine save_sub() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine real function save_func() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function end subroutine real function save_func() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function real function save_nested_func() integer :: i, j contains real function save_func() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function subroutine save_sub() save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine end function module save_module_03 integer :: i, j save real :: k, l contains subroutine save_sub_mod() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end subroutine real function save_func_mod() integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end function end module program save_03 integer :: i, j save real :: k, l double precision :: m(5), n(5, 5), o(5, 6, 7) end program lfortran-lfortran-2f73434/integration_tests/block_01.f900000664000175000017500000000033115141516316023307 0ustar alastairalastairprogram block_01 implicit none integer :: a, b, d a = 1 b = 2 associate (n => a) block real :: b, c b = 3 c = -3 d = cos(b + c) end block end associate if (b /= 2) error stop if (d /= 1) error stop endlfortran-lfortran-2f73434/integration_tests/operator_overloading_05_module2.f900000664000175000017500000000021215141516316030072 0ustar alastairalastairmodule operator_overloading_05_module2 use operator_overloading_05_module1, only: string_type, operator(>=), assignment(=) end modulelfortran-lfortran-2f73434/integration_tests/bits_03.f900000664000175000017500000000177615141516316023176 0ustar alastairalastairprogram bits_03 implicit none integer(4) :: from, to integer(8) :: from8, to8 from = 10 to = 4 from8 = 10_8 to8 = 4_8 call mvbits(from, 2, 2, to, 0) if (from /= 10) error stop if (to /= 6) error stop call mvbits(from8, 2, 2, to8, 0) if (from8 /= 10) error stop if (to8 /= 6_8) error stop call mvbits(from, 0, 2, to, 2) if (from /= 10) error stop if (to /= 10) error stop call mvbits(from8, 0, 2, to8, 2) if (from8 /= 10) error stop if (to8 /= 10_8) error stop from = -20 to = 4 from8 = -20_8 to8 = 4_8 call mvbits(from, 29, 2, to, 2) if (from /= -20) error stop if (to /= 12) error stop call mvbits(from8, 29, 2, to8, 2) if (from8 /= -20) error stop if (to8 /= 12_8) error stop call mvbits(from, 2, 2, to, 29) if (from /= -20) error stop if (to /= 1610612748) error stop call mvbits(from8, 2, 2, to8, 29) if (from8 /= -20) error stop if (to8 /= 1610612748_8) error stop end programlfortran-lfortran-2f73434/integration_tests/parameter_11.f900000664000175000017500000000073615141516316024207 0ustar alastairalastairprogram parameter_11 integer, parameter :: n = 3 real:: v(n), a(n,n), b(n,n) integer :: i,j v = [(i,i=1,n)] a = diag_rsp(v) b = reshape([((merge(i,0,i==j), i=1,n), j=1,n)], [n,n]) print *, b print *, "all(a==b)", all(a==b) if (.not. all(a==b)) error stop contains function diag_rsp(v) result(res) real, intent(in) :: v(:) real :: res(size(v),size(v)) integer :: i res = 0 do i = 1, size(v) res(i,i) = v(i) end do end function diag_rsp end program lfortran-lfortran-2f73434/integration_tests/arrays_01_complex.f900000664000175000017500000000137415141516316025255 0ustar alastairalastairprogram arrays_01_complex implicit none integer :: i, j complex(4) :: a(3), b(4), c(2, 2) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop do i = 1, 2 do j = 1, 2 c(i, j) = i + j + 10 end do end do if (c(1, 1) /= 12) error stop if (c(1, 2) /= 13) error stop if (c(2, 1) /= 13) error stop if (c(2, 2) /= 14) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_open_close_read_write.f900000664000175000017500000000126415141516316030523 0ustar alastairalastairprogram open_close_read_write implicit none character(len=20) :: msg = 'Some error occured' real, dimension(100) :: x, y real, dimension(100) :: p, q integer, target :: i, u = 1 integer, pointer :: u_ptr; u_ptr => u do i = 1, 100 x(i) = i * 0.1 y(i) = sin(x(i)) * (1 - cos(x(i)/3.0)) end do open(unit=u_ptr, file='open_close_read_write_data.dat', status='replace') do i = 1, 100 write(u, '(10F8.2)') x(i), y(i) end do close(1, err=999, iomsg=msg, iostat=u) 999 open (2, file='open_close_read_write_data.dat', status='old') do i = 1, 100 read(2, *) p(i), q(i) end do close(2) do i = 1, 100 write(*, *) p(i), q(i) end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_358.f900000664000175000017500000000073515141516316024511 0ustar alastairalastairmodule rand_mod_intrinsic_358 implicit none contains subroutine getseed(seed) integer, intent(out) :: seed(:) call random_seed(get=seed) end subroutine getseed function rand0() result(x) use iso_fortran_env, only: RP => REAL64 real(RP) :: x call random_number(harvest=x) end function rand0 end module rand_mod_intrinsic_358 program main use rand_mod_intrinsic_358 implicit none integer :: seed(8) call getseed(seed) call random_seed(put=seed) print *, rand0() end program lfortran-lfortran-2f73434/integration_tests/write_02.f900000664000175000017500000000215015141516316023351 0ustar alastairalastairprogram main implicit none write (*, *), [4, 9] write (*, *), [[2, -2, 5, 7, [8, -9, [10]]], [3, 3], [-11]] call f() contains subroutine f() integer, allocatable :: a(:, :) real :: b(2, 2) integer :: i, j allocate(a(5, 10)) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = i + j end do end do b(1, 1) = 1.1 b(1, 2) = -1.2 b(2, 1) = 2.1 b(2, 2) = -2.2 write (*, *), [[1, a, 2, 3], a, 5, [abs(-2)]] write (*, *), "hello", ["hey", ["xyz", ["abc"]]], [[1, a, 2, 3], a, 5, [abs(-2)]], "bye" write (*, *), [2.1, [3.14, [-5.11, [abs(-21.22), [abs(21.22)]]]]] write (*, *), "Integer(2x2) ArrayConst", [[1, 2], [3, 4]], "Array End" write (*, *), "Real(2x2) ArrayVar", b, "Array End" write (*, *), "Real(2x2) ArrayConst", [[1.1, -1.2], [2.1, -2.2]], "Array End" write (*, *), "Integer(2x2), Real(2x2), ArrayConst", [[1, 2], [3, 4]], [[1.1, -1.2], [2.1, -2.2]], "ArrayEnd" end subroutine end program lfortran-lfortran-2f73434/integration_tests/print_02.f900000664000175000017500000000036115141516316023355 0ustar alastairalastairprogram print_02 implicit none integer :: x character(len=5) :: f = "(5i3)" x = (2+3)*5 print "(5i3)", x, 1, 3, x, (2+3)*5+x write(*,"(5i3)") x, 1, 3, x, (2+3)*5+x print f, x, 1, 3, x, (2+3)*5+x write(*,f) x, 1, 3, x, (2+3)*5+x end program lfortran-lfortran-2f73434/integration_tests/format_03.f0000664000175000017500000000051115141516316023336 0ustar alastairalastair program format_03 1000 FORMAT + (/' --- PROBLEM SIZE:'/ + ' N = ',I5, + ' (NUMBER WITH NONZERO WEIGHT = ',I5,')'/ + ' NQ = ',I5/ + ' M = ',I5/ + ' NP = ',I5, + ' (NUMBER UNFIXED = ',I5,')') end program lfortran-lfortran-2f73434/integration_tests/nullify_03.f900000664000175000017500000000114215141516316023702 0ustar alastairalastairmodule module_nullify_03 implicit none integer, parameter, private :: mxdim = 3 type :: rp1d real(8), dimension(:), pointer :: f end type type :: sds integer :: ndim integer, dimension(mxdim) :: dims logical :: hdf32 type(rp1d), dimension(mxdim) :: scales real(8), dimension(:,:,:), pointer :: f end type end module program nullify_03 use module_nullify_03 implicit none type(sds) :: s ! allocate(s%scales(1)%f(2)) ! s%scales(1)%f=[1,2] ! print *, 'Scale 0:', s%scales(1)%f nullify(s%scales(1)%f) end programlfortran-lfortran-2f73434/integration_tests/implied_do_loops1.f900000664000175000017500000000032215141516316025317 0ustar alastairalastairprogram implied_do_loop1 integer :: j integer :: a(10)=(/(j,j=1,10)/) call s() print*, (a(j),j=1,10) contains subroutine s() print *, (j, j = 1, 3) end subroutine s end program lfortran-lfortran-2f73434/integration_tests/class_01.f900000664000175000017500000000220315141516316023322 0ustar alastairalastairmodule class_circle1 implicit none private real :: pi = 3.1415926535897931d0 ! Class-wide private constant type, public :: Circle real :: radius contains procedure :: area => circle_area ! Can you point to implementation in diff module? procedure :: print => circle_print end type Circle contains function circle_area(this) result(area) ! F2003 standard 4.5.3.3 passed object dummy argument class(Circle), intent(in) :: this real :: area area = pi * this%radius**2 end function circle_area subroutine circle_print(this) class(Circle), intent(in) :: this real :: area area = this%area() ! Call the type-bound function print *, 'Circle: r = ', this%radius, ' area = ', area end subroutine circle_print end module class_circle1 program circle_test use class_circle1, only: Circle implicit none type(Circle) :: c ! Declare a variable of type Circle. c = Circle(1.5) ! Use the implicit constructor, radius = 1.5. call c%print ! Call the type-bound subroutine c%radius = 2.0 call c%print ! Call the type-bound subroutine end program circle_test lfortran-lfortran-2f73434/integration_tests/procedure_07.f900000664000175000017500000000140315141516316024214 0ustar alastairalastairmodule procedure_07_module contains subroutine cb(x) implicit none integer, intent(in), optional :: x(:) logical :: y y = present(x) if(y .neqv. .false.) error stop end subroutine cb end module procedure_07_module program procedure_07 use procedure_07_module call temp(cb) call temp() !! Optional cb not passed call temp2(cb) contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back logical :: terminate_var if(present(call_back)) call call_back() end subroutine temp subroutine temp2(call_back) implicit none procedure(cb) :: call_back logical :: terminate_var end subroutine end program procedure_07lfortran-lfortran-2f73434/integration_tests/template_simple_04.f900000664000175000017500000000310515141516316025406 0ustar alastairalastairmodule template_simple_04_m requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure function generic_sum{T, add, cast}(A) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) interface operator(+) procedure add end interface type(T), intent(in) :: A(:) type(T) :: res integer :: n, i res = cast(0) do i = 1, size(A) res = res + A(i) end do end function pure elemental integer function cast_integer(arg) result(r) integer, intent(in) :: arg r = arg end function pure elemental real function cast_real(arg) result(r) integer, intent(in) :: arg r = arg end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum{integer, operator(+), cast_integer}(a_i) s_r = generic_sum{real, operator(+), cast_real}(a_r) print *, s_i print *, s_r if (s_i /= 55) error stop if (abs(s_r - 55) > 1e-5) error stop end subroutine end module program template_simple_04 use template_simple_04_m call test_template() end lfortran-lfortran-2f73434/integration_tests/separate_compilation_17a.f900000664000175000017500000000065015141516316026573 0ustar alastairalastairmodule mod_separate_compilation_17 implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type interface fnv_1_hash module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code end function int8_fnv_1 end interface fnv_1_hash end module mod_separate_compilation_17lfortran-lfortran-2f73434/integration_tests/types_20.f900000664000175000017500000000012515141516316023363 0ustar alastairalastairprogram types_20 integer :: a integer(8) :: b a = 4 b = 4 end programlfortran-lfortran-2f73434/integration_tests/arrays_63.f900000664000175000017500000000031015141516316023523 0ustar alastairalastairprogram arrays_63 integer :: X(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer, allocatable :: Y(:) allocate(Y(size(X,1))) Y = [1,2,3] print *, X(Y,:) if (sum(X(Y,:)) /= 45) error stop end program lfortran-lfortran-2f73434/integration_tests/string_71.f900000664000175000017500000000056515141516316023543 0ustar alastairalastair! Check that substrings are passed by reference. module string_71_mod contains subroutine s(str) character(1) :: str str = "M" end subroutine end module program string_71 use string_71_mod character(5) :: str integer :: i i = 1 str = "Hello" call s(str(i:i)) print *, str if(str /= "Mello") error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_53.f900000664000175000017500000000212315141516316025073 0ustar alastairalastairmodule derived_types_53_m implicit none public :: & bitset_type, & bitset_64 type, abstract :: bitset_type integer(4) :: num_bits end type bitset_type type, extends(bitset_type) :: bitset_64 end type bitset_64 type, extends(bitset_64) :: bitset_128 contains procedure, pass(self) :: write_bitset_string => write_bitset_string_128 end type bitset_128 contains elemental function bits(self) integer(4) :: bits class(bitset_type), intent(in) :: self bits = self%num_bits return end function bits module subroutine write_bitset_string_128(self) class(bitset_128), intent(in) :: self integer(4) :: bit_count bit_count = bits(self) if (bit_count /= 4) error stop end subroutine write_bitset_string_128 end module derived_types_53_m program derived_types_53 use derived_types_53_m implicit none type(bitset_128) :: t t = bitset_128(num_bits=4) call t%write_bitset_string() end program derived_types_53 lfortran-lfortran-2f73434/integration_tests/struct_type_01.f900000664000175000017500000000126315141516316024607 0ustar alastairalastairMODULE struct_type_01_module TYPE diag_type INTEGER :: len END TYPE diag_type TYPE(diag_type), DIMENSION(1) :: diag END MODULE struct_type_01_module subroutine set_diag_len(len) USE struct_type_01_module, ONLY: diag INTEGER, INTENT(IN) :: len print *, diag(1)%len if (diag(1)%len /= 10) error stop diag(1)%len = len end subroutine set_diag_len PROGRAM struct_type_01 USE struct_type_01_module, ONLY: diag diag(1)%len = 10 call set_diag_len(20) print *, get_diag_len() if (get_diag_len() /= 20) error stop contains function get_diag_len() result(len) USE struct_type_01_module, ONLY: diag INTEGER :: len len = diag(1)%len end function get_diag_len END PROGRAM struct_type_01 lfortran-lfortran-2f73434/integration_tests/compiler_version_03.f900000664000175000017500000000141315141516316025600 0ustar alastairalastairmodule string_mod public contains !> Fixed-length string function string() character(len=6) :: string string = "abcdef" end function end module program compiler_version_03 use string_mod, only: string ! semantic error: The symbol 'compiler_version' not found in the module 'iso_fortran_env' use, intrinsic :: iso_fortran_env, only: compiler_version character(len=len(compiler_version())) :: a character(len=len(string())) :: b character(len=:), allocatable :: c a = compiler_version() print *, len(a), a b = string() print *, len(b), b if ( len(b) /= 6 ) error stop c = compiler_version() print *, len(c), c if(len(c) /= len(a)) error stop if(c /= a) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_40.f900000664000175000017500000000125015141516316023522 0ustar alastairalastairprogram arrays_40 implicit none real(4), dimension(2) :: z z = foo_sp_arr() print *, z if( any(z /= [2.0_4, -2.0_4]) ) error stop contains function foo_sp_arr(x) result(z) real(4), dimension(2), intent(in), optional :: x real(4), dimension(2) :: z z = optval_rsp(x, [2.0_4, -2.0_4]) end function foo_sp_arr pure elemental function optval_rsp(x, default) result(y) real(4), intent(in), optional :: x real(4), intent(in) :: default real(4) :: y if (present(x)) then y = x else y = default end if end function optval_rsp end program arrays_40 lfortran-lfortran-2f73434/integration_tests/file_33.f900000664000175000017500000000110415141516316023140 0ustar alastairalastairprogram file_33 implicit none integer :: unit_no, iostat character(len=100) :: filename, form, status, iomsg filename = 'file_33_data.txt' form = 'formatted ' status = 'replace' open(newunit=unit_no, file=filename, form=form, status=status, iostat=iostat, iomsg=iomsg) if (iostat /= 0) error stop iomsg close(unit_no) form = 'formatted' status = 'replace ' open(newunit=unit_no, file=filename, form=form, status=status, iostat=iostat, iomsg=iomsg) if (iostat /= 0) error stop iomsg close(unit_no) end program file_33lfortran-lfortran-2f73434/integration_tests/intrinsics_365.f900000664000175000017500000000027715141516316024510 0ustar alastairalastairprogram intrinsics_365 implicit none real, allocatable :: array(:, :) allocate(array(2:5, 5:10)) print *, is_contiguous(array) if ( .not. is_contiguous(array) ) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_04_func_pass_arr_dims.f900000664000175000017500000000105015141516316027441 0ustar alastairalastairprogram arrays_04_func implicit none real :: a(3), b a(1) = 3 a(2) = 2 a(3) = 1 b = sum(size(a, dim=1), a) print *, b if (abs(b-6) > 1e-5) error stop contains real function sum(na1, a) result(r) integer, intent(in) :: na1 real, intent(in) :: a(na1) integer :: i print *, "sum" r = 0 do i = 1, size(a) r = r + a(i) end do end function real function abs(a) result(r) real, intent(in) :: a print *, "abs" if (a > 0) then r = a else r = -a end if end function end lfortran-lfortran-2f73434/integration_tests/equivalence_04.f900000664000175000017500000000141115141516316024521 0ustar alastairalastairprogram equivalence_04 use iso_c_binding, only: c_loc, c_f_pointer implicit none DOUBLE PRECISION, target :: DMACH(5) INTEGER*4, pointer :: SMALL(:) INTEGER*4, pointer :: LARGE(:) INTEGER*4, pointer :: RIGHT(:) INTEGER*4, pointer :: DIVER(:) INTEGER*4, pointer :: LOG10(:) call c_f_pointer(c_loc(dmach(1)), small, [2]) call c_f_pointer(c_loc(dmach(2)), large, [2]) call c_f_pointer(c_loc(dmach(3)), right, [2]) call c_f_pointer(c_loc(dmach(4)), diver, [2]) call c_f_pointer(c_loc(dmach(5)), log10, [2]) dmach(2) = 5.6_8 if(large(1) /= 1717986918) error stop if(large(2) /= 1075209830) error stop dmach(2) = 5.7_8 if(large(1) /= -858993459) error stop if(large(2) /= 1075236044) error stop end program lfortran-lfortran-2f73434/integration_tests/while_03.f900000664000175000017500000000057715141516316023343 0ustar alastairalastair program while_03 implicit none integer :: n, i, j i = 0 n = 2 do while ( n >= 2 ) if( n >= i ) then if( n >= i ) then do j= i+1,n i = j + i end do endif n = n - 1 else i = j + i endif end do return end lfortran-lfortran-2f73434/integration_tests/data_08.f900000664000175000017500000000037715141516316023147 0ustar alastairalastairsubroutine gamo() implicit double precision (A-H,O-Z) dimension g(2) data g/1.5D0,2.5D0/ if (abs(g(1)-1.5D0) > 1e-12) error stop if (abs(g(2)-2.5D0) > 1e-12) error stop print *, g end subroutine program main call gamo() end program lfortran-lfortran-2f73434/integration_tests/openmp_48.f900000664000175000017500000000064615141516316023537 0ustar alastairalastairprogram openmp_48 use omp_lib implicit none integer :: i=0 call omp_set_num_threads(8) !$omp parallel reduction(+:i) !$omp single i=i+1 !This will be done by one thread only hence 1 will be added to i !$omp end single i=i+1 !This will be done by all threads hence eventually 8 will be added to i !$omp end parallel if(i/=9) error stop end program openmp_48lfortran-lfortran-2f73434/integration_tests/modules_33_module1.f900000664000175000017500000000405015141516316025322 0ustar alastairalastairmodule fpm_dependency_modules_33 implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency generic :: add => add_project, add_project_dependencies procedure, private :: add_project procedure, private :: add_project_dependencies end type dependency_tree_t type :: package_config_t character(len=:), allocatable :: name end type package_config_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency subroutine add_project(self, package, error) class(dependency_tree_t), intent(inout) :: self type(package_config_t), intent(in) :: package type(error_t), allocatable, intent(out) :: error end subroutine add_project recursive subroutine add_project_dependencies(self, root, main, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: root logical, intent(in) :: main type(error_t), allocatable, intent(out) :: error end subroutine add_project_dependencies end module fpm_dependency_modules_33 lfortran-lfortran-2f73434/integration_tests/operator_overloading_05_module3.f900000664000175000017500000000105215141516316030076 0ustar alastairalastairmodule operator_overloading_05_module3 use operator_overloading_05_module2, only: string_type, operator(>=), assignment(=) contains pure subroutine insert_head( array ) type(string_type), intent(inout) :: array(0:) type(string_type) :: tmp integer(4) :: i tmp = array(0) find_hole: do i=1, size(array, kind=4)-1 if ( array(i) >= tmp ) exit find_hole array(i-1) = array(i) end do find_hole array(i-1) = tmp end subroutine insert_head end module program main end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_01b.f900000664000175000017500000000065015141516316026565 0ustar alastairalastairmodule separate_compilation_01_module implicit none real :: val contains subroutine set_val(x) real :: x val = x print *, "value of val is set to ", val end subroutine set_val subroutine get_val(x) real, intent(out) :: x x = val end subroutine get_val subroutine test_val(x) real :: x print *, "testing val" print *, "val = ", val print *, "x = ", x if (abs(val - x) > 1e-8) error stop end subroutine test_val end module lfortran-lfortran-2f73434/integration_tests/openmp_30.f900000664000175000017500000000135015141516316023517 0ustar alastairalastairsubroutine matrix_multiplication(l, m, n) use omp_lib integer :: l, m, n, i, j, k integer :: seed double precision :: a(l, n), b(l, m), c(m, n) double precision :: start_time, end_time seed = 123456789 b = 121.124D0 c = 29124.012D0 start_time = omp_get_wtime() !$omp parallel do shared(a, b, c, l, m, n) private(i, j, k) do j = 1, n do i = 1, l a(i,j) = 0.0D+00 do k = 1, m a(i,j) = a(i,j) + b(i,k) * c(k,j) end do end do end do !$omp end parallel do end_time = omp_get_wtime() print *, "Time: ", end_time - start_time print *, "sum(a): ", sum(a) if (abs(sum(a) - (440952103687207.56D0)) > 1D-12) error stop end subroutine program openmp_30 call matrix_multiplication(500, 500, 500) end program lfortran-lfortran-2f73434/integration_tests/character_11.f900000664000175000017500000001043015141516316024153 0ustar alastairalastairmodule character_11_mod use iso_c_binding interface function f_string01_c(s) result(r) bind(c, name="f_string01_c") import c_char character(len=1, kind=c_char), intent(in) :: s character(len=1, kind=c_char) :: r end function function f_string02_c(s) result(r) bind(c, name="f_string02_c") import c_char character(len=1,kind=c_char), value, intent(in) :: s character(len=1, kind=c_char) :: r end function function f_string03_c(s, n) result(r) bind(c, name="f_string03_c") ! eqivalent to f_string01_c import :: c_int, c_char integer(c_int), intent(in) :: n character(len=1, kind=c_char),intent(in) :: s(n) character(len=1, kind=c_char) :: r end function function f_string04_c(s) result(r) bind(c, name="f_string04_c") ! eqivalent to f_string01_c import :: c_char character(len=1, kind=c_char),intent(in) :: s(*) character(len=1, kind=c_char) :: r end function function f_string05_c(s) result(r) bind(c, name="f_string05_c") ! eqivalent to f_string01_c (but argument is an ISO descriptor) import :: c_char character(len=1, kind=c_char),intent(in) :: s(:) character(len=1, kind=c_char) :: r end function end interface contains ! Expected Behavior : ! C Implementation printing the passed message (Whole message, Although the interface says len = 1. It's due to being passed by reference `char*`) + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified subroutine f_string01_test() character(len=3) :: s character(len=2) :: r s = "Hi" // c_null_char r = f_string01_c(s) print "( '[', a, ']' )", r if(r /= "H ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "H") error stop if(s(2:2) /= "X") error stop end subroutine ! Expected Behavior : ! C Implementation printing only first character (due to passing by value) + ! The return should be the first character of the passed string subroutine f_string02_test() character(len=3) :: s character(len=2) :: r s = "Hi" // c_null_char r = f_string02_c(s) print "( '[', a, ']' )", r if(r /= "H ") error stop print "( '[', a, ']' )", s end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string03_test() character(len=4) :: s character(len=2) :: r s = "Bye" // c_null_char r = f_string03_c(s, 100000) ! Array's size is irrelevant print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "B") error stop if(s(2:2) /= "X") error stop if(s(3:3) /= "e") error stop end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string04_test() character(len=4) :: s character(len=2) :: r s = "Bye" // c_null_char r = f_string04_c(s) print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1:1) /= "B") error stop if(s(2:2) /= "X") error stop if(s(3:3) /= "e") error stop end subroutine ! Expected Behavior : ! C Implementation printing the passed message + ! The return should be the first character of the passed string + ! Second char in passed argument should be modified By C's implementation subroutine f_string05_test() character(len=4) :: s(1) character(len=2) :: r s(1) = "Bye" // c_null_char r = f_string05_c(s) print "( '[', a, ']' )", r if(r /= "B ") error stop print "( '[', a, ']' )", s if(s(1)(1:1) /= "B") error stop if(s(1)(2:2) /= "X") error stop if(s(1)(3:3) /= "e") error stop end subroutine end module program character_11 use character_11_mod call f_string01_test() call f_string02_test() call f_string03_test() call f_string04_test() call f_string05_test() end programlfortran-lfortran-2f73434/integration_tests/openmp_57.f900000664000175000017500000000073415141516316023535 0ustar alastairalastairprogram openmp_57 use omp_lib implicit none integer, parameter :: N = 5 integer :: A(N) integer :: i, index,total A = 1 total=0 index=1 !$omp parallel !$omp single do i = 1, N !$omp task shared(A) !$omp atomic total = total + A(index) * 2 index=index+1 !$omp end task end do !$omp end single !$omp taskwait !$omp end parallel print *, "Total = ", total, index if(total/=10) error stop end program openmp_57 lfortran-lfortran-2f73434/integration_tests/bindc_02.f900000664000175000017500000000025015141516316023275 0ustar alastairalastair! Tests c_ptr passing and calling as an argument program bindc_02 use bindc_02b, only: driver implicit none print *, "Main program: calling driver()" call driver() end lfortran-lfortran-2f73434/integration_tests/arrays_41.f900000664000175000017500000000101315141516316023520 0ustar alastairalastairprogram arrays_41 use iso_fortran_env, only: dp => real64 integer, parameter :: n = 1000 integer, parameter :: m = 1000 integer :: i, j integer, dimension(n,m) :: x real(dp) :: res x = 18 res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 18000000.000000000) > 1e-16) error stop contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(real(x, dp), dim)) end function var_2_iint8_dp end program lfortran-lfortran-2f73434/integration_tests/nested_vars_01.f900000664000175000017500000000203715141516316024537 0ustar alastairalastairmodule cobylb_mod_nested_vars_01 contains subroutine cobylb(amat) real, intent(in) :: amat(:, :) call evaluate(calcfc_internal) contains subroutine evaluate(calcfc) implicit none interface subroutine calcfc() implicit none end subroutine calcfc end interface call calcfc() end subroutine evaluate subroutine calcfc_internal() implicit none real :: out(5, 5) print *, matprod(amat) out = matprod(amat) if (any(abs(out - 833.340454) > 1e-8)) error stop end subroutine calcfc_internal end subroutine function matprod(y) result(z) implicit none real, intent(in) :: y(:, :) real :: z(size(y,1), size(y, 2)) z = matmul(y, y) end function matprod end module program nested_vars_01 use cobylb_mod_nested_vars_01 real :: amat(5, 5) amat = 12.91 call cobylb(amat) end program lfortran-lfortran-2f73434/integration_tests/namelist_19.f900000664000175000017500000000064215141516316024047 0ustar alastairalastairprogram test_namelist_internal_derived implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot character(len=:), allocatable :: record namelist /nml_dot/ dot record = '&nml_dot dot%x=1, dot%y=2 /' read(record, nml=nml_dot) if (dot%x /= 1) error stop if (dot%y /= 2) error stop end program test_namelist_internal_derived lfortran-lfortran-2f73434/integration_tests/intrinsics_383.f900000664000175000017500000000065715141516316024512 0ustar alastairalastairprogram intrinsics_383 implicit none integer, allocatable :: arr1(:) integer, allocatable :: arr2(:, :) allocate(arr1(3)) arr1 = [1, 2, 3] print *, pack(arr1, .true.) if (any(pack(arr1, .true.) /= [1, 2, 3])) error stop allocate(arr2(2, 3)) arr2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) print *, pack(arr2, .true.) if (any(pack(arr2, .true.) /= [1, 2, 3, 4, 5, 6])) error stop end programlfortran-lfortran-2f73434/integration_tests/procedure_14.f900000664000175000017500000000134715141516316024221 0ustar alastairalastairmodule cobylb_mod_procedure_14 contains subroutine cobylb(calcfc) implicit none interface subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end interface procedure(OBJCON) :: calcfc call calcfc_internal([1.0, 2.0]) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal(:) call calcfc(x_internal) end subroutine calcfc_internal end subroutine cobylb end module program procedure_14 use cobylb_mod_procedure_14 implicit none call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if ( abs(sum(x) - 3.0) > 1e-8 ) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/modules_30_module4.f900000664000175000017500000000052115141516316025321 0ustar alastairalastairmodule fpm_manifest_package_modules_30 use fpm_manifest_executable_modules_30, only: executable_config implicit none type :: package_config_t character(len=:), allocatable :: name type(executable_config), allocatable :: executable(:) end type package_config_t end module fpm_manifest_package_modules_30 lfortran-lfortran-2f73434/integration_tests/intrinsics_311.f900000664000175000017500000000231615141516316024473 0ustar alastairalastairprogram intrinsics_311 implicit none integer, dimension(5) :: array = [3, 1, 4, 1, 5] logical, dimension(5) :: mask = [.true., .false., .true., .false., .true.] integer, dimension(:), allocatable :: loc ! Find the location of the minimum value considering only elements where mask is true loc = minloc(array, mask = mask) print *, "Minloc with MASK:", loc if (any(loc /= 1)) error stop ! Find the location of the minimum value searching backwards loc = minloc(array, back = .true.) print *, "Minloc with BACK:", loc if (any(loc /= 4)) error stop loc = minloc(array) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, mask = mask) print *, loc if (any(loc /= 1)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop loc = minloc(array, back = .false.) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop loc = minloc(array, back = .false.) print *, loc if (any(loc /= 2)) error stop loc = minloc(array, back = .true.) print *, loc if (any(loc /= 4)) error stop end program lfortran-lfortran-2f73434/integration_tests/cpp_pre_05.f900000664000175000017500000000037515141516316023661 0ustar alastairalastairprogram test_stringify implicit none #ifndef X /* ABC-comment */ #ifdef __GFORTRAN__ /* ABC-comment */ #define X 4 #else /* XYZ-comment */ #define X 5 #endif #endif print *, X end program test_stringify lfortran-lfortran-2f73434/integration_tests/allocate_29.f900000664000175000017500000000272115141516316024020 0ustar alastairalastairprogram allocate_29 implicit none character(len=:), allocatable :: names(:) call list_examples(names) if (.not. allocated(names)) then error stop "ERROR: names is not allocated" end if if (size(names) /= 0) then error stop "ERROR: size(names) is not 0" end if if (len(names) /= 1) then error stop "ERROR: len(names) is not 1" end if print *, size(names) contains subroutine list_examples(names) character(len=:), allocatable, intent(out) :: names(:) integer, parameter :: entry_len = 256 integer, parameter :: initial_capacity = 64 character(len=entry_len), allocatable :: entries(:) integer :: capacity capacity = initial_capacity call ensure_entry_capacity(entries, entry_len, capacity) allocate(character(len=1) :: names(0)) end subroutine list_examples subroutine ensure_entry_capacity(buffer, string_len, new_capacity) integer, intent(in) :: string_len integer, intent(in) :: new_capacity character(len=string_len), allocatable, intent(inout) :: buffer(:) character(len=string_len), allocatable :: tmp(:) if (new_capacity <= 0) then allocate(character(len=string_len) :: tmp(1)) else allocate(character(len=string_len) :: tmp(new_capacity)) end if call move_alloc(tmp, buffer) end subroutine ensure_entry_capacity end program allocate_29 lfortran-lfortran-2f73434/integration_tests/cmd_02.f900000664000175000017500000000030515141516316022762 0ustar alastairalastairprogram test_exec character(len=255) :: homedir call get_environment_variable("HOME", homedir) print *, trim(homedir) call execute_command_line("printenv") end program test_exec lfortran-lfortran-2f73434/integration_tests/arrays_reshape_26.f900000664000175000017500000000063715141516316025245 0ustar alastairalastairprogram arrays_reshape_26 implicit none integer, parameter :: n = 2 integer, parameter :: arr(4) = [1,2,3,4] real :: b(2,2) = reshape(arr, [n,n]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_26 lfortran-lfortran-2f73434/integration_tests/character_07.f900000664000175000017500000000041715141516316024164 0ustar alastairalastairprogram test_char_len implicit none character(len=10) :: str1 character(10) :: str2 str1 = "Hello" str2 = "World" print *, "str1 = ", str1, ", length = ", len(str1) print *, "str2 = ", str2, ", length = ", len(str2) end program test_char_len lfortran-lfortran-2f73434/integration_tests/arrays_01_logical.f900000664000175000017500000000161315141516316025214 0ustar alastairalastairprogram arrays_01_logical implicit none integer :: i, j logical :: a(3), b(4), c(2, 2) a(1) = .true. do i = 2, 3 a(i) = .not. a(i - 1) end do if (.not. a(1)) error stop if (a(2)) error stop if (.not. a(3)) error stop b(1) = .false. do i = 12, 14 b(i-10) = .not. b(i - 10 - 1) end do if (b(1)) error stop if (.not. b(2)) error stop if (b(3)) error stop if (.not. b(4)) error stop do i = 1, 3 b(i) = a(i) .and. .false. end do if (b(1)) error stop if (b(2)) error stop if (b(3)) error stop b(4) = b(1) .or. b(2) .or. b(3) .or. a(1) if (.not. b(4)) error stop b(4) = a(1) if (.not. b(4)) error stop do i = 1, 2 do j = 1, 2 if (((i + j) - 2*((i + j)/2)) == 1) then c(i, j) = .true. else c(i, j) = .false. end if end do end do if (c(1, 1)) error stop if (.not. c(1, 2)) error stop if (.not. c(2, 1)) error stop if (c(2, 2)) error stop end lfortran-lfortran-2f73434/integration_tests/minpack_03.f900000664000175000017500000000074215141516316023647 0ustar alastairalastairprogram minpack_03 implicit none integer,dimension(2),parameter :: info_original = [1,1] integer :: ic ic = 1 call compare_solutions(ic) contains subroutine compare_solutions(ic) implicit none integer :: ic if ( info_original(1) /= 1 ) error stop if ( info_original(2) /= 1 ) error stop if ( size(info_original) /= 2 ) error stop print *, info_original(ic) end subroutine compare_solutions end program minpack_03 lfortran-lfortran-2f73434/integration_tests/array_init.f900000664000175000017500000000071715141516316024066 0ustar alastairalastairMODULE array_init_module TYPE tp INTEGER(4) i END TYPE tp END MODULE array_init_module PROGRAM t USE array_init_module TYPE (tp) v1,v2,v3 v1%i = 1 v2%i = 2 v3%i = 3 CALL s([tp :: v1,v2,v3], 3) CALL s([tp ::], 0) CONTAINS SUBROUTINE s(va, sz) USE array_init_module TYPE(tp) va(:) INTEGER sz print *, size(va) if (size(va) /= sz) error stop END SUBROUTINE s END PROGRAM tlfortran-lfortran-2f73434/integration_tests/intrinsics_300.f900000664000175000017500000000020415141516316024463 0ustar alastairalastairprogram intrinsics_300 integer, parameter :: ar1 = kind([1.0, 1.0]) print *, ar1 if ( ar1 /= 4 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_49.f900000664000175000017500000000163415141516316024425 0ustar alastairalastairprogram intrinsics_49 ! A test of complex and real kinds 4 and 8 sin intrinsic implicit none block real(kind=4) :: x, y complex :: z, r x = 1.0 y = 2.0 z = cmplx(x, y) r = sin(z) if (abs(real(r) - 3.16577864) > 1e-6) error stop if (abs(imag(r) - 1.95960093) > 1e-6) error stop end block block real(kind=8) :: x, y complex :: z, r x = 1.0 y = 2.0 z = cmplx(x, y) r = sin(z) if (abs(real(r) - 3.16577864) > 1e-6) error stop if (abs(imag(r) - 1.95960093) > 1e-6) error stop end block block real(kind=4) :: x, r x = 1.0 r = sin(x) if (abs(r - 0.841470957) > 1e-6) error stop end block block real(kind=8) :: x, r x = 1.0 r = sin(x) if (abs(r - 0.841470957) > 1e-6) error stop end block end programlfortran-lfortran-2f73434/integration_tests/transfer_01.f900000664000175000017500000000225115141516316024044 0ustar alastairalastairprogram transfer_01 implicit none integer :: i, integer_result, y(3, 2) real :: r, result, x2, x(5, 4) real, parameter :: x1 = transfer(666,1.0) character(len=*), parameter :: chr = 'A' character(len=*), parameter :: chr2 = transfer(65, 'A') character(len=2), parameter :: chr3 = transfer(16961, 'AB') r = 2.987654 i = 123456 x = 3.19 y = 4 result = transfer(i, r) print *, result if (abs(result - 1.72998703e-40) > 1e-6) error stop integer_result = transfer(r, i) print *, integer_result if (integer_result /= 1077884345) error stop integer_result = transfer(x(5,2), i) print *, integer_result if (integer_result /= 1078733046) error stop result = transfer(y(1,1), x(5,2)) print *, result if (abs(result - 5.60519386E-45) > 1e-6) error stop if (transfer(x1, 1) /= 666) error stop x2 = transfer(666,1.0) if (transfer(x2, 1) /= 666) error stop print *, transfer(65, chr) if (transfer(65, chr) /= 'A') error stop print *, transfer(90, 'A') if (transfer(90, 'A') /= 'Z') error stop if (chr2 /= 'A') error stop if (chr3 /= 'AB') error stop end program transfer_01 lfortran-lfortran-2f73434/integration_tests/format_before_read_01.f900000664000175000017500000000107515141516316026030 0ustar alastairalastairprogram format_before_read_01 implicit none integer :: i, j, k character(len=7) :: input_string ! Test case: FORMAT statement precedes the READ statement ! This tests that the compiler correctly handles forward references ! to FORMAT statements input_string = "123 45 " 100 format (I3, I2, I2) read(input_string, 100) i, j, k if (i /= 123) error stop "Expected i = 123" if (j /= 4) error stop "Expected j = 4" if (k /= 5) error stop "Expected k = 5" print *, "Test passed: FORMAT before READ works correctly" end program format_before_read_01 lfortran-lfortran-2f73434/integration_tests/array_section_05.f900000664000175000017500000000070715141516316025072 0ustar alastairalastairprogram array_section_05 integer, allocatable :: A(:,:) logical, allocatable :: B(:) allocate(A(2,0)) allocate(B(size(A,2))) B = is_prime(A(2,:)) if (any(shape(B) /= [0])) error stop if (all(B) .neqv. .true.) error stop if (all(is_prime(A(1:1,:))) .neqv. .true.) error stop contains elemental logical function is_prime(n) integer, intent(in) :: n is_prime = .false. end function is_prime end program lfortran-lfortran-2f73434/integration_tests/format_40.f900000664000175000017500000000052215141516316023512 0ustar alastairalastairprogram testes0 implicit none write(*,"(ES0.0)") 3.14159 write(*,"(ES0.0)") 0.0 write(*,"(ES0.0)") 10.0 write(*,"(ES0.0)") 3.14E+03 write(*,"(ES0.0)") 30.14159 write(*,"(ES0.0)") 391.14 write(*,"(ES0.0)") 3.14E+04 write(*,"(ES0.0)") -5.0 write(*,"(ES0.0)") 1.23456E-5 write(*,"(ES0.0)") 9.99E+10 end program testes0 lfortran-lfortran-2f73434/integration_tests/derived_types_81.f900000664000175000017500000000214015141516316025073 0ustar alastairalastairmodule hashmap_wrappers_derived_types_81 implicit none type :: key_type integer(4) :: value end type key_type abstract interface pure function hasher_fun( key ) result(hash_value) import key_type type(key_type), intent(in) :: key integer(4) :: hash_value end function hasher_fun end interface contains pure function fnv_1_hasher( key ) type(key_type), intent(in) :: key integer(4) :: fnv_1_hasher fnv_1_hasher = key % value + 1 end function fnv_1_hasher end module module hashmaps_derived_types_81 use hashmap_wrappers_derived_types_81 implicit none type :: hashmap_type procedure(hasher_fun), pointer, nopass :: hasher => fnv_1_hasher end type hashmap_type end module program derived_types_81 use hashmaps_derived_types_81 implicit none type(hashmap_type) :: hmap type(key_type) :: key integer(4) :: result key % value = 1 result = hmap % hasher(key) print *, result if (result /= 2) error stop end programlfortran-lfortran-2f73434/integration_tests/end_name_match.f900000664000175000017500000000034215141516316024641 0ustar alastairalastairsubroutine add(x, y) integer x, y x = 4 y = 5 end subroutine Add program main integer x, y call add(x, y) if(x /= 4) error stop if(y /= 5) error stop if(x + y /= 9) error stop end program Main lfortran-lfortran-2f73434/integration_tests/format_12.f900000664000175000017500000000072415141516316023515 0ustar alastairalastairprogram format_12 implicit none print *, 'testing output using formatting' write (*, 700) 1, 1.23, (7., 8.), 'Hello', .true. write (*, 701) write (*, 702) 700 format (i5, e12.4e3, 2f8.2, 1x, a3, l7) 701 format ('12345678901234567890123456789012345678901234567890') 702 format (' 1 2 3 4 5') write(*, '(i5, e12.4e3, 2f8.2, 1x, a3, l7)') 1, 1.23, (7.,8.), 'Hello', .true. print *, 'end output formatting test' print * end program lfortran-lfortran-2f73434/integration_tests/arrays_intrin_08.f900000664000175000017500000000111415141516316025110 0ustar alastairalastairprogram arrays_intrin_08 real :: zmat(4, 4), hdiag(4) integer :: i, j do i = 1, 4 do j = 1, 4 zmat(i, j) = i + j end do end do hdiag = calden(zmat) print *, hdiag if( any(hdiag /= [28.0, 36.0, 44.0, 52.0]) ) error stop contains function calden(zmat) result(hdiag) implicit none real(4), intent(in) :: zmat(:, :) ! ZMAT(NPT, NPT - N - 1) ! Outputs real(4) :: hdiag(size(zmat, 1)) ! Local variables integer(4) :: idz_loc idz_loc = 3 hdiag = -sum(zmat(:, 1:idz_loc - 1)**2, dim=2) + sum(zmat(:, idz_loc:size(zmat, 2))**2, dim=2) end function calden end program lfortran-lfortran-2f73434/integration_tests/doloop_06.f900000664000175000017500000000042015141516316023515 0ustar alastairalastairprogram doloop_06 implicit none integer :: i, j, k, cnt cnt = 0 do i = 1, 10 do j = 11, 20 do k = 101, 110 cnt = cnt + 1 end do end do end do print *, cnt if (cnt /= 1000) error stop end lfortran-lfortran-2f73434/integration_tests/format_08s.f900000664000175000017500000000072115141516316023702 0ustar alastairalastair! copy of integration_tests/format_08.f90 but splits edit ! descriptor by separating it with commas i.e. changes ! "(aai6)" to "(a,a,i6)", which is exactly how GFortran ! also expects it as well, see: ! https://gcc.gnu.org/onlinedocs/gfortran/Commas-in-FORMAT-specifications.html program format_08s implicit none character(:), allocatable :: a integer :: b(10) a = "xx" b = 1 print "(a,a,i6)", a,"hi",15 print "(1000(i6))", b end programlfortran-lfortran-2f73434/integration_tests/polymorphic_arguments_02.f900000664000175000017500000000211115141516316026646 0ustar alastairalastair program polymorphic_argument_02 implicit none integer :: i_value = 1 real :: r_value = 1 character(len=1) :: c_value = "c" logical :: l_value = .true. interface str procedure str_scalar end interface str ! Calling generic procedure with any argument print *, str(i_value) if (str(i_value) /= 0) error stop print *, str(r_value) if (str(r_value) /= 0) error stop print *, str(c_value) if (str(c_value) /= 0) error stop print *, str(l_value) if (str(l_value) /= 0) error stop ! Calling subroutine with polymorphic parameter, with any argument print *, str_scalar(i_value) if (str_scalar(i_value) /= 0) error stop print *, str_scalar(r_value) if (str_scalar(r_value) /= 0) error stop print *, str_scalar(c_value) if (str_scalar(c_value) /= 0) error stop print *, str_scalar(l_value) if (str_scalar(l_value) /= 0) error stop CONTAINS function str_scalar(g1) class(*), intent(in) :: g1 integer :: str_scalar str_scalar = 0 end function str_scalar end program polymorphic_argument_02 lfortran-lfortran-2f73434/integration_tests/intrinsics_289.f900000664000175000017500000001036115141516316024510 0ustar alastairalastairprogram intrinsics_289 implicit none integer(4), parameter :: i1 = ishftc(1, 3) integer(8), parameter :: i2 = ishftc(5_8, -1_8) integer(4), parameter :: ar1(3) = ishftc([11, 2, 23], 1) integer(8), parameter :: ar2(3) = ishftc([1_8, 21_8, 3_8], -2_8) integer(kind=1) :: res_1 integer(kind=2) :: res_2 integer(kind=4) :: res_4 integer(kind=8) :: res_8 integer(4) :: i3 = 7 integer(8) :: i4 = 12 integer(4) :: ar3(3) = [22, 4, 46] integer(8) :: ar4(3) = [4611686018427387904_8, 4611686018427387909_8, -4611686018427387904_8] integer :: shift = 3 print *, i1 if (i1 /= 8) error stop print *, i2 if (i2 /= -9223372036854775806_8) error stop print *, ar1 if (any(ar1 /= [22, 4, 46])) error stop print *, ar2 if (any(ar2 /= [4611686018427387904_8, 4611686018427387909_8, -4611686018427387904_8])) error stop ! Does not work with LFortran yet ! print *, ishftc(i3, shift) ! if (ishftc(i3, shift) /= 56) error stop ! print *, ishftc(i4, -shift) ! if (ishftc(i4, -shift) /= -9223372036854775807_8) error stop ! print *, ishftc(ar3, shift) ! if (any(ishftc(ar3, shift) /= [176, 32, 368])) error stop ! print *, ishftc(ar4, -shift) ! if (any(ishftc(ar4, -shift) /= [576460752303423488_8, -6341068275337658368_8, 1729382256910270464_8])) error stop res_1 = ishftc(10_1, 2_1) print *, res_1 if (res_1 /= 40) error stop res_1 = ishftc(10_1, -2_1) print *, res_1 if (res_1 /= -126) error stop res_1 = ishftc(-10_1, 2_1) print *, res_1 if (res_1 /= -37) error stop res_1 = ishftc(-10_1, -2_1) print *, res_1 if (res_1 /= -67) error stop res_2 = ishftc(10_2, 2_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2) print *, res_2 if (res_2 /= -32766) error stop res_2 = ishftc(-10_2, 2_2) print *, res_2 if (res_2 /= -37) error stop res_2 = ishftc(-10_2, -2_2) print *, res_2 if (res_2 /= -16387) error stop res_4 = ishftc(10_4, 2_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4) print *, res_4 if (res_4 /= -2147483646) error stop res_4 = ishftc(-10_4, 2_4) print *, res_4 if (res_4 /= -37) error stop res_4 = ishftc(-10_4, -2_4) print *, res_4 if (res_4 /= -1073741827) error stop res_8 = ishftc(10_8, 2_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8) print *, res_8 if (res_8 /= -9223372036854775806_8) error stop res_8 = ishftc(-10_8, 2_8) print *, res_8 if (res_8 /= -37_8) error stop res_8 = ishftc(-10_8, -2_8) print *, res_8 if (res_8 /= -4611686018427387907_8) error stop res_1 = ishftc(127_1, 7_1) print *, res_1 if (res_1 /= -65) error stop res_1 = ishftc(127_1, -7_1) print *, res_1 if (res_1 /= -2) error stop res_1 = ishftc(-127_1, 7_1) print *, res_1 if (res_1 /= -64) error stop res_1 = ishftc(-127_1, -7_1) print *, res_1 if (res_1 /= 3) error stop res_2 = ishftc(32767_2, 15_2) print *, res_2 if (res_2 /= -16385) error stop res_2 = ishftc(32767_2, -15_2) print *, res_2 if (res_2 /= -2) error stop res_2 = ishftc(-32767_2, 15_2) print *, res_2 if (res_2 /= -16384) error stop res_2 = ishftc(-32767_2, -15_2) print *, res_2 if (res_2 /= 3) error stop res_4 = ishftc(2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741825) error stop res_4 = ishftc(2147483647_4, -31_4) print *, res_4 if (res_4 /= -2) error stop res_4 = ishftc(-2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741824) error stop res_4 = ishftc(-2147483647_4, -31_4) print *, res_4 if (res_4 /= 3) error stop res_8 = ishftc(9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387905_8) error stop res_8 = ishftc(9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= -2) error stop res_8 = ishftc(-9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387904_8) error stop res_8 = ishftc(-9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= 3) error stop end program lfortran-lfortran-2f73434/integration_tests/automatic_allocation_02.f900000664000175000017500000000071115141516316026413 0ustar alastairalastairprogram automatic_allocation_02 implicit none integer, allocatable :: i real, allocatable :: r complex, allocatable :: c logical, allocatable :: l i = 10 r = 4.4 c = (1, 2) l = .true. if (i /= 10) error stop if (r /= 4.4) error stop if (c /= (1, 2)) error stop if (l .neqv. .true.) error stop deallocate(i) deallocate(r) deallocate(c) deallocate(l) end program automatic_allocation_02 lfortran-lfortran-2f73434/integration_tests/intrinsics_118.f900000664000175000017500000000026015141516316024474 0ustar alastairalastairprogram intrinsics_118 print *, hypot( x = 1.e0_4, y = 0.5e0_4 ) print *, hypot( 1.e0_4, y = 0.5e0_4 ) print *, hypot( 1.e0_4, 0.5e0_4 ) end program intrinsics_118 lfortran-lfortran-2f73434/integration_tests/string_14.f900000664000175000017500000000214515141516316023534 0ustar alastairalastairmodule string_14_stdlib_string_type type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface write(formatted) module procedure :: write_formatted end interface interface read(formatted) module procedure :: read_formatted end interface contains subroutine write_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(in) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg end subroutine write_formatted subroutine read_formatted(string, unit, iotype, v_list, iostat, iomsg) type(string_type), intent(inout) :: string integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg character(len=:), allocatable :: line end subroutine read_formatted end module program string_14 end program lfortran-lfortran-2f73434/integration_tests/multiple_objects_args.f900000664000175000017500000000067515141516316026310 0ustar alastairalastairprogram main implicit none type :: Circle real :: radius = 1.0 end type Circle logical :: was_called = .false. call print_radius(Circle(1.5), Circle()) if (.not. was_called) then error stop end if contains subroutine print_radius(m, n) type(Circle), intent(in) :: m, n print *, m%radius, n%radius was_called = .true. end subroutine end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_282.f900000664000175000017500000000340215141516316024477 0ustar alastairalastairprogram intrinsics_282 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 implicit none real(sp), parameter :: r1 = hypot(4.0_sp, 3.0_sp) real(dp), parameter :: r2 = hypot(4.0_dp, 3.0_dp) real(sp), parameter :: ar1(3) = hypot([4.0_sp, 3.0_sp, 0.0_sp], [3.0_sp, 4.0_sp, 0.0_sp]) real(dp), parameter :: ar2(3) = hypot([2.0_dp, 1.0_dp, 9.0_dp], [6.0_dp, 4.0_dp, 0.0_dp]) real(sp) :: x = 4.0_sp, y = 3.5_sp real(dp) :: z = 1.12_dp, w = 0.43_dp real(sp) :: arr1(3) = [4.0_sp, 3.0_sp, 0.0_sp], arr2(3) = [3.0_sp, 4.0_sp, 11.0_sp] real(dp) :: arr3(3) = [2.0_dp, 1.0_dp, 9.0_dp], arr4(3) = [6.0_dp, 4.0_dp, 0.0_dp] print *, r1 if (abs(r1 - 5.0_sp) > 1e-6) error stop print *, r2 if (abs(r2 - 5.0_dp) > 1e-12) error stop print *, ar1 if (any(abs(ar1 - [5.0_sp, 5.0_sp, 0.0_sp]) > 1e-6)) error stop print *, ar2 if (any(abs(ar2 - [6.32455532033676_dp, 4.12310562561766_dp, 9.0_dp]) > 1e-12)) error stop print *, hypot( x = 1.e0_4, y = 0.5e0_4 ) if (abs(hypot( x = 1.e0_4, y = 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot( 1.e0_4, y = 0.5e0_4 ) if (abs(hypot( 1.e0_4, y = 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot( 1.e0_4, 0.5e0_4 ) if (abs(hypot( 1.e0_4, 0.5e0_4 ) - 1.11803401_sp) > 1e-6) error stop print *, hypot(x, y) if (abs(hypot(x, y) - 5.31507290636733_sp) > 1e-6) error stop print *, hypot(z, w) if (abs(hypot(z, w) - 1.1997082978791138_dp) > 1e-12) error stop print *, hypot(arr1, arr2) if (any(abs(hypot(arr1, arr2) - [5.0_sp, 5.0_sp, 11.0_sp]) > 1e-6)) error stop print *, hypot(arr3, arr4) if (any(abs(hypot(arr3, arr4) - [6.32455532033676_dp, 4.12310562561766_dp, 9.0_dp]) > 1e-12)) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_85.f900000664000175000017500000000166515141516316023545 0ustar alastairalastairprogram arrays_85 use iso_fortran_env, only: int8 integer(int8), target :: full_key(1:4, 1:3) integer(int8), pointer :: full_key_ptr(:, :) full_key = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3]) if( lbound(full_key, 1) /= 1 ) error stop if( any(full_key /= reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3])) ) error stop full_key_ptr => full_key call process_key(full_key_ptr) print *, full_key if( any(full_key /= reshape([1, 2, 2, 4, 5, 6, 99, 8, 9, 10, 11, 12], [4, 3]) ) ) error stop call process_key(full_key(2:4, 1:2)) print *, full_key if( any(full_key /= reshape([1, 2, 2, 2, 5, 6, 99, 99, 9, 10, 11, 12], [4, 3]) ) ) error stop contains subroutine process_key(key) integer(int8), intent(inout) :: key(0:, :) if( lbound(key, 1) /= 0 ) error stop key(2, 1) = 2 key(2, 2) = 99 end subroutine process_key end program arrays_85 lfortran-lfortran-2f73434/integration_tests/operator_overloading_10.f900000664000175000017500000000151615141516316026447 0ustar alastairalastairmodule operator_overloading_10_module implicit none type :: first_type integer :: x end type type :: second_type integer :: x end type interface operator(/=) module procedure ne end interface interface operator(/=) module procedure une end interface contains logical function ne(x, y) type(first_type), intent(in) :: x, y print *, "first_type::ne" ne = .false. end function logical function une(s, z) type(second_type), intent(in) :: s, z print *, "second_type::une" une = .false. end function end module operator_overloading_10_module program main use operator_overloading_10_module implicit none type(first_type) :: a1, a2 type(second_type) :: b1, b2 if (a1 /= a2) error stop if (b1 /= b2) error stop end program main lfortran-lfortran-2f73434/integration_tests/derived_types_75.f900000664000175000017500000000220415141516316025077 0ustar alastairalastairmodule installer_mod_derived_types_75 implicit none type :: installer_t integer :: install_version contains procedure :: install_header procedure :: install end type installer_t type :: error_t end type contains subroutine install_header(self, error) class(installer_t), intent(inout) :: self type(error_t), allocatable, intent(out) :: error if (.true.) then call self%install() end if call self%install() end subroutine install_header subroutine install(self) class(installer_t), intent(inout) :: self self%install_version = self%install_version + 927 end subroutine install end module installer_mod_derived_types_75 program derived_types_75 use installer_mod_derived_types_75 implicit none type(installer_t) :: installer type(error_t), allocatable :: error installer%install_version = 1 call installer%install_header(error) print *, "Installer version after installation: ", installer%install_version if (installer%install_version /= 1855) error stop end program derived_types_75lfortran-lfortran-2f73434/integration_tests/separate_compilation_08a.f900000664000175000017500000000025115141516316026570 0ustar alastairalastairmodule module_using_all_1_separate_compilation_08a contains subroutine test_all(x) real :: x(5) if ( all(abs(x - 9.2134) < 1e-8 ) ) error stop end subroutine end module lfortran-lfortran-2f73434/integration_tests/intrinsics_410.f900000664000175000017500000000114015141516316024465 0ustar alastairalastair! Test maxloc/minloc/shape return correct kind with -fdefault-integer-8 program intrinsics_410 implicit none integer :: arr(5) = [1, 3, 2, 5, 4] integer :: loc(1) integer :: shp(1) ! maxloc should return integer of default kind loc = maxloc(arr) if (loc(1) /= 4) error stop "maxloc failed" ! minloc should return integer of default kind loc = minloc(arr) if (loc(1) /= 1) error stop "minloc failed" ! shape should return integer of default kind shp = shape(arr) if (shp(1) /= 5) error stop "shape failed" print *, "PASS" end program intrinsics_410 lfortran-lfortran-2f73434/integration_tests/derived_types_90.f900000664000175000017500000000071715141516316025103 0ustar alastairalastairprogram derived_types_90 implicit none type int_t integer :: i end type type(int_t) :: T_ONE, T_TWO, T_THREE type(int_t) :: T_ALL(3) T_ONE = int_t(1) T_TWO = int_t(2) T_THREE = int_t(3) T_ALL = (/ T_ONE, T_TWO, T_THREE /) if (T_ALL(1)%i /= 1) error stop "T_ALL(1)%i should be 1" if (T_ALL(2)%i /= 2) error stop "T_ALL(2)%i should be 2" if (T_ALL(3)%i /= 3) error stop "T_ALL(3)%i should be 3" end program derived_types_90 lfortran-lfortran-2f73434/integration_tests/matrix_02_matmul.f900000664000175000017500000000076115141516316025110 0ustar alastairalastairprogram matrix_02_matmul implicit none integer :: i, j, k, a(3, 4) real :: b(4, 3), cmat(3, 3), centry a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], shape(a)) b = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0], shape(b)) cmat = matmul(a, b) do i = 1, 3 do j = 1, 3 centry = 0 do k = 1, 4 centry = centry + a(i, k) * b(k, j) end do if( cmat(i, j) /= centry ) error stop end do end do end program matrix_02_matmullfortran-lfortran-2f73434/integration_tests/list_test_08_.f900000664000175000017500000000511715141516316024404 0ustar alastairalastairmodule list_test_08_mod implicit none real :: eps = 1e-6 contains function l1norm(v) result(res) type(_lfortran_list(integer)), intent(in) :: v real :: res integer :: i res = 0.0 do i = 0, _lfortran_len(v) - 1 res = res + real(_lfortran_get_item(v, i)) end do end function function sort(l) result(res) type(_lfortran_list(integer)), intent(inout) :: l type(_lfortran_list(integer)) :: res integer :: i, j integer :: a, b res = l do i = 0, _lfortran_len(res) - 1 do j = i + 1, _lfortran_len(res) - 1 a = _lfortran_get_item(res, i) b = _lfortran_get_item(res, j) if (a > b) then call _lfortran_set_item(res, i, b) call _lfortran_set_item(res, j, a) end if end do end do end function subroutine sort_list() type(_lfortran_list(integer)) :: x integer :: size, i size = 50 do i = 0, size - 1 call _lfortran_list_append(x, size - i) end do x = sort(x) do i = 0, size - 2 if (_lfortran_get_item(x, i) > _lfortran_get_item(x, i + 1)) error stop end do if (_lfortran_len(x) /= size) error stop end subroutine subroutine sort_by_l1_norm() type(_lfortran_list(_lfortran_list(integer))) :: mat type(_lfortran_list(integer)) :: vec, temp integer :: i, j, k, rows, cols real :: norm1, norm2 rows = 10 cols = 7 k = rows * cols do i = 0, rows - 1 do j = 0, cols - 1 call _lfortran_list_append(vec, k) k = k - 1 end do call _lfortran_list_append(mat, vec) call _lfortran_clear(vec) end do do i = 0, rows - 1 do j = i + 1, rows - 1 norm1 = l1norm(_lfortran_get_item(mat, i)) norm2 = l1norm(_lfortran_get_item(mat, j)) if (norm1 > norm2) then temp = sort(_lfortran_get_item(mat, j)) call _lfortran_set_item(mat, j, sort(_lfortran_get_item(mat, i))) call _lfortran_set_item(mat, i, temp) end if end do end do k = 1 do i = 0, rows - 1 do j = 0, cols - 1 if (_lfortran_get_item(_lfortran_get_item(mat, i), j) /= k) error stop k = k + 1 end do end do end subroutine subroutine tests() call sort_list() call sort_by_l1_norm() end subroutine end module program test_sort_lists use list_test_08_mod implicit none call tests end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_21.f900000664000175000017500000000156715141516316026457 0ustar alastairalastairmodule operator_overloading_21_mod implicit none type :: temp integer :: v = 0 contains procedure, pass :: not_equal generic :: operator(/=) => not_equal end type temp contains elemental logical function not_equal(lhs, rhs) class(temp), intent(in) :: lhs, rhs not_equal = lhs%v /= rhs%v end function not_equal end module operator_overloading_21_mod program operator_overloading_21 use operator_overloading_21_mod implicit none type(temp), allocatable :: a(:), b(:) allocate(a(3)) allocate(b(3)) a%v = [1, 2, 3] b%v = [1, 0, 3] print *, "any(a /= b) =", any(a /= b) if (.not. any(a /= b)) then error stop end if b%v = [1, 2, 3] print *, "any(a /= b) =", any(a /= b) if (any(a /= b)) then error stop end if end program operator_overloading_21 lfortran-lfortran-2f73434/integration_tests/bindc_11.f900000664000175000017500000000177315141516316023310 0ustar alastairalastairmodule bindc_11_mod use, intrinsic :: iso_c_binding, only: c_float implicit none contains complex(c_float) function twice(z) result(r) bind(c) complex(c_float), value, intent(in) :: z r = z + z end function twice end module bindc_11_mod program bindc_11 use, intrinsic :: iso_c_binding, only: c_float use bindc_11_mod, only: twice implicit none complex(c_float) :: z, r real(c_float) :: re, im integer :: i z = cmplx(5.0_c_float, 7.0_c_float, kind=c_float) r = twice(z) re = real(r, kind=c_float) im = aimag(r) if (abs(re - 10.0_c_float) > 1.0e-6_c_float) error stop if (abs(im - 14.0_c_float) > 1.0e-6_c_float) error stop r = cmplx(0.0_c_float, 0.0_c_float, kind=c_float) do i = 1, 700000 r = r + twice(z) end do re = real(r, kind=c_float) im = aimag(r) if (abs(re - 7000000.0_c_float) > 1.0_c_float) error stop if (abs(im - 9800000.0_c_float) > 1.0_c_float) error stop print *, "PASSED" end program bindc_11 lfortran-lfortran-2f73434/integration_tests/global_array_pointer_01.f900000664000175000017500000000132415141516316026416 0ustar alastairalastairmodule global_array_pointer_01_mod implicit none integer, dimension(:), pointer :: ptr_in integer, target :: i(1) contains subroutine sub_arr_pointer1 ptr_in => i i = [343] print *, ptr_in(1) print *, i(1) if(ptr_in(1) /= 343) error stop end subroutine sub_arr_pointer1 subroutine sub_arr_pointer2 ptr_in(1) = 0 print *, ptr_in(1) print *, i(1) if(i(1) /= 0) error stop end subroutine sub_arr_pointer2 end module global_array_pointer_01_mod program global_array_pointer_01 use global_array_pointer_01_mod implicit none call sub_arr_pointer1 call sub_arr_pointer2 end program global_array_pointer_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_393.f900000664000175000017500000000055115141516316024504 0ustar alastairalastairprogram intrinsics_393 integer, parameter :: n = 10 real(8) :: x(n) complex(8) :: z(n) complex(8) :: A(n,n) x(:) = 1.0d0 A(:,:) = cmplx(1.0d0,0.0d0) z = matmul (A, cmplx(x,0.0,8)) print *, z(1) if (abs(z(1) - (10.000000000000000,0.0000000000000000)) > 1e-12) error stop end program intrinsics_393lfortran-lfortran-2f73434/integration_tests/nested_04.f900000664000175000017500000000062515141516316023510 0ustar alastairalastairmodule nested_04_a implicit none contains integer function b(x) integer, intent(in) :: x integer y real :: yy yy = 6.6 y = x print *, "b()" b = c(6) contains integer function c(z) integer, intent(in) :: z print *, z print *, y print *, yy c = z end function c end function b end module program nested_04 use nested_04_a, only: b implicit none integer test test = b(5) end lfortran-lfortran-2f73434/integration_tests/optional_06.f900000664000175000017500000000125615141516316024056 0ustar alastairalastairmodule optional_06_mod interface get_val module procedure :: get_val_float module procedure :: get_val_int end interface contains subroutine get_val_float(val, stat) real, intent(in) :: val integer, intent(out), optional :: stat end subroutine subroutine get_val_int(val, default, stat) integer, intent(in) :: val integer, intent(in), optional :: default integer, intent(out), optional :: stat print *, present(default), present(stat) if (present(stat)) stat = 10 end subroutine end module program optional_06 use optional_06_mod integer :: stat = 0 call get_val(3, stat=stat) if (stat /= 10) error stop end program optional_06lfortran-lfortran-2f73434/integration_tests/string_13.f900000664000175000017500000000046615141516316023537 0ustar alastairalastairprogram string_13 implicit none integer, parameter :: ia0 = iachar('0') integer, parameter :: ia5 = iachar('5') integer, parameter :: ia9 = iachar('9') if (ia0 /= 48) error stop if (ia5 /= 53) error stop if (ia9 /= 57) error stop print *, ia0, ia5, ia9 end programlfortran-lfortran-2f73434/integration_tests/functions_19.f900000664000175000017500000000066515141516316024250 0ustar alastairalastairpure function diag_rsp_mat(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) res = 123.71_4 end function diag_rsp_mat program funtions_19 real :: A(3,3) real :: res(3) interface pure function diag_rsp_mat(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) end function diag_rsp_mat end interface res = diag_rsp_mat(A) print *, res if (any(abs(res - 123.71_4) > 1e-8)) error stop end program lfortran-lfortran-2f73434/integration_tests/string_17.f900000664000175000017500000000163715141516316023544 0ustar alastairalastairmodule string_17_string_module implicit none type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface len module procedure :: len_string end interface contains elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length if (allocated(string%raw)) then length = len(string%raw) else length = 0 end if end function len_string pure function maybe(string) result(maybe_string) type(string_type), intent(in) :: string character(len=len(string)) :: maybe_string if (allocated(string%raw)) then maybe_string = string%raw else maybe_string = '' end if end function maybe end modulelfortran-lfortran-2f73434/integration_tests/arrays_62.f900000664000175000017500000000046515141516316023535 0ustar alastairalastairprogram arrays_62 real :: xpt(1, 1) xpt = 25.0 call rescue(xpt) print *, xpt if (any(abs(xpt - 625.0) > 1e-7)) error stop contains subroutine rescue(xpt) real, intent(inout) :: xpt(1, 1) print *, sum(xpt**2) xpt = sum(xpt**2) end subroutine end program lfortran-lfortran-2f73434/integration_tests/if_05.f900000664000175000017500000000164715141516316022632 0ustar alastairalastairprogram wasm_if implicit none logical :: x, y x = .true. y = .false. if ( x ) print *, "x: Single Line If" if ( y ) print *, "y: Single Line If" if ( x ) then print *, "x: Multi Line If-Else: x is True" else print *, "x: Multi Line If-Else: x is False" end if if ( y ) then print *, "y: Multi Line If-Else: y is True" else print *, "y: Multi Line If-Else: y is False" end if ! if else-if else ladder if ( x ) then print *, "x: If part" else if(x) then print *, "x: Else-If part" end if if ( y ) then print *, "y: If part" else if(x) then print *, "x: Else-If part" else print *, "Else part" end if if(y) then print *, "y: If part" else if(y) then print *, "y: Else-If part" else print *, "Else part" end if end program lfortran-lfortran-2f73434/integration_tests/read_22.f900000664000175000017500000000264115141516316023141 0ustar alastairalastair! Test complex number input parsing with whitespace inside parentheses. ! Fortran list-directed format allows: ( 0.1000E+01, 0.2000E+01) program read_22 implicit none complex :: c1, c2 complex(8) :: c3 complex :: arr(2) ! Test single-precision complex with spaces inside parentheses open(10, file='read_22_data.txt', status='replace') write(10, '(A)') '( 0.1000E+01, 0.2000E+01)' write(10, '(A)') '(3.0, 4.0)' write(10, '(A)') '( 0.5000D+01, 0.6000D+01)' write(10, '(A)') '( 0.7000E+01, 0.8000E+01) ( 0.9000E+01, 0.1000E+02)' close(10) open(10, file='read_22_data.txt', status='old') read(10, *) c1 read(10, *) c2 read(10, *) c3 read(10, *) arr close(10, status='delete') ! Verify single-precision with spaces if (abs(real(c1) - 1.0) > 1e-5) error stop 1 if (abs(aimag(c1) - 2.0) > 1e-5) error stop 2 ! Verify without spaces if (abs(real(c2) - 3.0) > 1e-5) error stop 3 if (abs(aimag(c2) - 4.0) > 1e-5) error stop 4 ! Verify double-precision with D exponent if (abs(real(c3) - 5.0d0) > 1d-10) error stop 5 if (abs(aimag(c3) - 6.0d0) > 1d-10) error stop 6 ! Verify array reading if (abs(real(arr(1)) - 7.0) > 1e-5) error stop 7 if (abs(aimag(arr(1)) - 8.0) > 1e-5) error stop 8 if (abs(real(arr(2)) - 9.0) > 1e-5) error stop 9 if (abs(aimag(arr(2)) - 10.0) > 1e-5) error stop 10 print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_371.f900000664000175000017500000000047415141516316024504 0ustar alastairalastairprogram intrinsics_371 implicit none type :: stone integer :: value = 0 end type stone type(stone),dimension(:),allocatable :: s integer :: val , iloc allocate(s(0)) val = 1 iloc = findloc(s%value, val, dim=1) print * , iloc if (iloc /= 0) error stop end programlfortran-lfortran-2f73434/integration_tests/external_04.f900000664000175000017500000000041015141516316024040 0ustar alastairalastairsubroutine sub() external f double precision f, y y = f(1.0d0) if (abs(y-1.0d0) >= 1e-8) error stop print *, y end subroutine double precision function f(x) double precision x f = x end function program external_05 call sub() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_276.f900000664000175000017500000000302415141516316024502 0ustar alastairalastairprogram intrinsics_276 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = or(5, 8) integer, parameter :: i2 = or(-1, 5) integer, parameter :: i3 = or(-4_8, 2_8) integer(8), parameter :: i4 = or(-2_8, 5_8) logical, parameter :: l1 = or(.true., .false.) logical, parameter :: l2 = or(.false., .false.) logical :: true = .true., false = .false. integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -1) error stop print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, or(true, false) if (or(true, false) .neqv. .true.) error stop print *, or(false, false) if (or(false, false) .neqv. .false.) error stop print*, or(5, 8) if (or(5, 8) /= 13) error stop print*, or(-1, 5) if (or(-1, 5) /= -1) error stop print*, or(8, -4) if (or(8, -4) /= -4) error stop print*, or(-2, -5) if (or(-2, -5) /= -1) error stop print*, or(a1, a2) if (or(a1, a2) /= 13) error stop print*, or(a3, a4) if (or(a3, a4) /= -1) error stop print*, or(a2, a5) if (or(a2, a5) /= -2) error stop print*, or(a5, a6) if (or(a5, a6) /= -1) error stop end program lfortran-lfortran-2f73434/integration_tests/dfloat_01.f900000664000175000017500000000016715141516316023475 0ustar alastairalastairprogram dfloat_01 integer :: a a = -2 print *, DFLOAT(a) if (abs(DFLOAT(a) - (-2.0D0)) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_33_module2.f900000664000175000017500000000103115141516316025317 0ustar alastairalastairmodule fpm_model_modules_33 use fpm_dependency_modules_33, only: dependency_tree_t implicit none type :: fpm_model_t character(:), allocatable :: package_name character(:), allocatable :: fortran_compile_flags character(:), allocatable :: c_compile_flags character(:), allocatable :: cxx_compile_flags character(:), allocatable :: link_flags character(:), allocatable :: build_prefix type(dependency_tree_t) :: deps logical :: include_tests = .true. end type fpm_model_t end module fpm_model_modules_33 lfortran-lfortran-2f73434/integration_tests/format_32.f900000664000175000017500000000124215141516316023513 0ustar alastairalastairprogram format_32 implicit none print "(E0.5)", 1/3.0d99 print "(E9.5)", 1/3.0d99 print "(E10.5)", 1/3.0d99 print "(E11.5)", 1/3.0d99 print "(E12.5)", 1/3.0d99 print "(E13.5)", 1/3.0d99 print "(E0.5)", 3.0d200 print "(E9.5)", 3.0d200 print "(E10.5)", 3.0d200 print "(E11.5)", 3.0d200 print "(E12.5)", 3.0d200 print "(E13.5)", 3.0d200 print "(E0.5)", 1/3.0d200 print "(E9.5)", 1/3.0d200 print "(E10.5)", 1/3.0d200 print "(E11.5)", 1/3.0d200 print "(E12.5)", 1/3.0d200 print "(E13.5)", 1/3.0d200 print "(ES6.2E1)", 3e20 print "(ES9.2)", 3e20 print "(ES9.2E1)", 3e20 end program format_32 lfortran-lfortran-2f73434/integration_tests/arrays_18_func.f900000664000175000017500000000055615141516316024552 0ustar alastairalastairprogram arrays_18_func real :: y(20) real :: a(20) integer :: i call f(a, 20, y, 1) do i = 1, 20 if (2 * y(i) /= a(i)) error stop end do contains recursive subroutine f(a, n, x, i) integer :: n, i real :: a(:) real :: x(n) x(i) = i a(i) = 2 * i if (i < n) then call f(a, n, x, i + 1) end if end subroutine end program lfortran-lfortran-2f73434/integration_tests/multi_file_member_access_02.f900000664000175000017500000000061115141516316027220 0ustar alastairalastairmodule jstringbuffer implicit none type :: StringBuffer integer, private :: size = 0 contains procedure :: number_of_elems end type StringBuffer contains function number_of_elems(self) result(result) class(StringBuffer), intent(in) :: self integer :: result result = self%size end function end module jstringbuffer program main print *, "OK" end program lfortran-lfortran-2f73434/integration_tests/arrays_39.f900000664000175000017500000000067315141516316023542 0ustar alastairalastairprogram arrays_39 implicit none real, allocatable :: array(:) integer :: ndim ndim = 10 allocate(array(-(ndim/2):ndim)) print *, lbound(array > 0, 1) call f(array > 0) contains subroutine f(array1) logical, intent(in) :: array1(:) print *, lbound(array1, 1), ubound(array1, 1) if( lbound(array1, 1) /= 1 ) error stop if( ubound(array1, 1) /= 16 ) error stop end subroutine end program arrays_39 lfortran-lfortran-2f73434/integration_tests/doloop_10.f900000664000175000017500000000025415141516316023515 0ustar alastairalastairprogram doloop_10 integer(4) :: i, j = 0 integer(8) :: n = 10 do i = 1, n j = j + i end do print *, j if (j /= 55) error stop end program lfortran-lfortran-2f73434/integration_tests/while_02.f900000664000175000017500000000066115141516316023334 0ustar alastairalastairprogram while_02 implicit none integer :: i, j i = 0 j = 0 do while (i < 10) i = i + 1 j = j + i end do if (j /= 55) error stop if (i /= 10) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) exit j = j + i end do if (j /= 1) error stop if (i /= 2) error stop i = 0 j = 0 do while (i < 10) i = i + 1 if (i == 2) cycle j = j + i end do if (j /= 53) error stop if (i /= 10) error stop end lfortran-lfortran-2f73434/integration_tests/external_10.f900000664000175000017500000000072215141516316024043 0ustar alastairalastairmodule external_10_module implicit none integer :: g = 2 end module subroutine sub1_external_10 use external_10_module implicit none call sub2_external_10 (g) print *, g if (g /= 10) error stop end subroutine subroutine sub2_external_10 (x) implicit none integer, intent(inout) :: x print *, x if (x /= 2) error stop x = 10 end subroutine program external_10 implicit none call sub1_external_10 end program lfortran-lfortran-2f73434/integration_tests/select_type_16.f900000664000175000017500000000071515141516316024551 0ustar alastairalastairprogram select_type_16 class(*), allocatable :: s call ss("hello") contains subroutine ss(x) class(*) :: x character(:),allocatable :: buffer allocate(character(len=100) :: buffer) select type(x) type is (character(len=*)) write(buffer, "(A,A)") "string:", x class default error stop "unknown type" end select print *, buffer if(trim(buffer) /= "string:hello") error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/arrays_08_func_pass_arr_dims.f900000664000175000017500000000137115141516316027453 0ustar alastairalastairprogram arrays_08_func implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(size(x, dim=1), x, size(y, dim=1), y) r = verify(size(x, dim=1), x, size(y, dim=1), y) print *, r if (.not. r) error stop contains subroutine copy_from_to(na1, a, nb1, b) integer, intent(in) :: na1, nb1 integer, intent(in) :: a(na1) integer, intent(out) :: b(nb1) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(na1, a, nb1, b) result(r) integer, intent(in) :: na1, nb1 integer, intent(in) :: a(na1), b(nb1) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-lfortran-2f73434/integration_tests/intrinsics_266.f900000664000175000017500000000613715141516316024511 0ustar alastairalastairprogram intrinsics_266 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = tan(1.0_sp) real(dp), parameter :: a2 = tan(1.0_dp) complex(sp), parameter :: a3 = tan((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = tan((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = tan([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = tan([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = tan([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = tan([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 1.55740772e+00_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 1.55740772465490223_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (9.421291947E-02_sp, 1.03795874_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (9.42129201295443947E-002_dp, 1.0379587828579324_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [1.55740772_sp, 14.1014194_sp, -2.18503976_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [1.55740772465490223_dp, 14.101419947171719_dp, -2.185039863261519_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(9.421291947E-02_sp, 1.03795874_sp), (-1.028875075E-02_sp, 1.00879467_sp), & (-5.086967140E-04_sp, 0.998250306_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(9.42129201295443947E-002_dp, 1.0379587828579324_dp), (-1.02887508595820281E-002_dp, & 1.0087947005319189_dp), (-5.08696693455815119E-004_dp, 0.99825027844029535_dp)]) > 1e-12_dp)) error stop print *, tan(b1) if (abs(tan(b1) - 0.546302497_sp) > 1e-6_sp) error stop print *, tan(b2) if (abs(tan(b2) - 0.84228838046307941_dp) > 1e-12_dp) error stop print *, tan(b3) if (abs(tan(b3) - (0.312674940_sp, 0.707602859_sp)) > 1e-6_sp) error stop print *, tan(b4) if (abs(tan(b4) - (0.31267491960977922_dp, 0.70760291160255895_dp)) > 1e-12_dp) error stop print *, tan(br1) if (any(abs(tan(br1) - [0.546302497_sp, 0.842288375_sp, 1.26015818_sp]) > 1e-6_sp)) error stop print *, tan(br2) if (any(abs(tan(br2) - [0.54630248984379048_dp, 0.84228838046307941_dp, 1.2601582175503392_dp]) > 1e-12_dp)) error stop print *, tan(bc1) if (any(abs(tan(bc1) - [(0.312674940_sp, 0.707602859_sp), (0.224352330_sp, 1.02681565_sp), & (5.596723780E-02_sp, 1.08762586_sp)]) > 1e-6_sp)) error stop print *, tan(bc2) if (any(abs(tan(bc2) - [(0.31267491960977922_dp, 0.70760291160255895_dp), (0.22435234690709807_dp, 1.0268156677854674_dp), & (5.59672199341484863E-002_dp, 1.0876258337665916_dp)]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/functions_17.f900000664000175000017500000000040015141516316024231 0ustar alastairalastairfunction func() result(y) real :: y(1) y(1) = 1.0 end function func program main real :: x(1) interface function func() result(y) real :: y(1) end function func end interface x = func() if (abs(x(1) - 1.0) > 1e-6) error stop print *, x end program main lfortran-lfortran-2f73434/integration_tests/entry_13.f900000664000175000017500000000056315141516316023370 0ustar alastairalastairsubroutine sub() integer :: x x = 12 go to 50 go to 60 return 50 print *, "here at 50, x = ", x if (x /= 12) error stop x = 13 go to 60 60 print *, "here at 60, x = ", x if (x /= 13) error stop x = 19 go to 70 return entry entry_sub1() return 70 print *, "here at 70, x = ", x if (x /= 19) error stop return end subroutine program entry_13 call sub() end program lfortran-lfortran-2f73434/integration_tests/pointer_03.f900000664000175000017500000000070415141516316023703 0ustar alastairalastairmodule test_pointer_association implicit none integer, target :: i contains function mergei32() result(r) integer, pointer :: r i=5 r=>i end function end module program pointer_03 use test_pointer_association implicit none integer, pointer :: r r=>mergei32() if (r /= 5) then print *, "Test failed: r does not point to the expected value" error stop end if end programlfortran-lfortran-2f73434/integration_tests/string_11.f900000664000175000017500000000057115141516316023532 0ustar alastairalastairprogram string_11 implicit none character(len=30) :: myString character(len=10) :: testString myString = 'This is a test' testString = 'test' if(index(myString, testString) == 0)then print *, 'test is not found' else print *, 'test is found at index: ', index(myString, testString) end if end programlfortran-lfortran-2f73434/integration_tests/intrinsics_340.f900000664000175000017500000000040215141516316024467 0ustar alastairalastairprogram intrinsics_340 print *, leadz(0_8) if (leadz(0_8) /= 64) error stop if (kind(leadz(0_8)) /= 4) error stop print *, leadz(5_8) if (leadz(5_8) /= 61) error stop if (kind(leadz(5_8)) /= 4) error stop end program intrinsics_340lfortran-lfortran-2f73434/integration_tests/intrinsics_304.f900000664000175000017500000000472015141516316024476 0ustar alastairalastairprogram intrinsics_304 implicit none integer, parameter :: a1 = sign(1, 1) integer(8), parameter :: a2 = sign(1, -1) integer, parameter :: a3 = sign(-13, 0) integer(8), parameter :: a4 = sign(0, 42) real, parameter :: a5 = sign(1.425, 3.0) real(8), parameter :: a6 = sign(1.425, -3.0) real, parameter :: a7 = sign(1.425, 0.0) real(8), parameter :: a8 = sign(0.0, -3.0) integer, parameter :: ar1(3) = sign([1, 2, 3], [1, 2, 3]) integer(8), parameter :: ar2(3) = sign([1, -2, 3], -3) real, parameter :: ar3(3) = sign([1.425, -2.425, 3.425], 3.0) real(8), parameter :: ar4(3) = sign([1.425, -2.425, 3.425], 3.0) integer :: x1 = 123, x2 = -90 integer(8) :: x3 = 123, x4 = 423 real :: x5 = 123.0, x6 = -47981 real(8) :: x7 = 123.0, x8 = 123.0 integer :: arr1(3) = [-311, -241, 331], arr2(3) = [1, 2, 3] real :: arr3(3) = [1.425, -2.425, 3.425], arr4(3) = [1.425, -2.425, 3.425] print *, a1 if (a1 /= 1) error stop print *, a2 if (a2 /= -1) error stop print *, a3 if (a3 /= 13) error stop print *, a4 if (a4 /= 0) error stop print *, a5 if (abs(a5 - 1.425) > 1e-7) error stop print *, a6 if (abs(a6 - (-1.425)) > 1e-7) error stop print *, a7 if (abs(a7 - 1.425) > 1e-7) error stop print *, a8 if (abs(a8 - (-0.0)) > 1e-7) error stop print *, ar1 if (any(ar1 /= [1, 2, 3])) error stop print *, ar2 if (any(ar2 /= [-1, -2, -3])) error stop print *, ar3 if (any(abs(ar3 - [1.42499995e+00, 2.42499995e+00, 3.42499995e+00]) > 1e-7)) error stop print *, ar4 if (any(abs(ar4 - [1.42499995231628418e+00, 2.42499995231628418e+00, 3.42499995231628418e+00]) >1e-7)) error stop print *, sign(x1, x2) if (sign(x1, x2) /= -123) error stop print *, sign(x3, x4) if (sign(x3, x4) /= 123) error stop print *, sign(x5, x6) if (abs(sign(x5, x6) - (-123.0)) > 1e-7) error stop print *, sign(x7, x8) if (abs(sign(x7, x8) - 123.0) > 1e-7) error stop print *, sign(arr1, arr2) if (any(sign(arr1, arr2) /= [311, 241, 331])) error stop print *, sign(arr3, arr4) if (any(abs(sign(arr3, arr4) - [1.425, -2.425, 3.425]) > 1e-7)) error stop print *, sign(a=-12.,b=0.) print *, sign(a=-12.,b=1.) print *, sign(a=-12.,b=-1.) if ( .not. sign( a = -12, b = 1 ) == 12 ) error stop if ( .not. sign( -12, b = 0 ) == 12 ) error stop if ( .not. sign( -12, -1 ) == -12 ) error stop end program lfortran-lfortran-2f73434/integration_tests/string_27.f900000664000175000017500000000047315141516316023542 0ustar alastairalastairprogram string_27 CHARACTER(100), DIMENSION(100) :: calibration_document INTEGER ::len_line, char_value calibration_document(3) = 'abcdefg' len_line = 1 print *, calibration_document(3)(len_line:len_line+4) if (calibration_document(3)(len_line:len_line+4) /= 'abcde') error stop end program lfortran-lfortran-2f73434/integration_tests/pointer_05.f900000664000175000017500000000152415141516316023706 0ustar alastairalastair! Handle Pointers Association from polymorphic variables ! to explicit-typed pointers in Select Type Statements program pointer_05 implicit none ! Declare an unlimited polymorphic pointer class(*), pointer :: ptr integer, target :: i = 42 real, target :: r = 5.5 ptr => i select type (p => ptr) type is (integer) print *, "Integer=", p if (p /= 42) error stop type is (real) print *, "Real=", p if (abs(p - 5.5) > 1e-6) error stop class default print *, "Unknown" error stop end select ptr => r select type (p => ptr) type is (integer) print *, "Integer=", p if (p /= 42) error stop type is (real) print *, "Real=", p if (abs(p - 5.5) > 1e-6) error stop class default print *, "Unknown" error stop end select end program pointer_05lfortran-lfortran-2f73434/integration_tests/expr_19.f900000664000175000017500000000017715141516316023214 0ustar alastairalastairprogram expr_19 complex(8), parameter :: x = (5, 6) print *, x if (abs(x - (5, 6)) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_deallocate_01.f900000664000175000017500000000034015141516316026204 0ustar alastairalastairprogram test_hybrd implicit none contains subroutine compare_solutions(x) real, dimension(:), intent(in) :: x real, dimension(:), allocatable :: temp end subroutine compare_solutions end program lfortran-lfortran-2f73434/integration_tests/functions_03.f900000664000175000017500000000077515141516316024243 0ustar alastairalastairprogram functions_03 implicit none integer, parameter :: sp = 4 complex(4) :: i, j i = 1 j = 1 print *, j j = f(i) print *, i print *, j j = 1 print *, j j = f((3.0, 0.0)) print *, j j = 1 print *, j j = g((2.0, 0.0)) print *, j j = 1 print *, j j = g((2.0, 3.0)) print *, j contains complex(4) function f(a) result(b) complex(4), intent(in) :: a b = a + 5 end function complex(sp) function g(a) result(b) complex(sp), intent(in) :: a b = a + 5 end function end program lfortran-lfortran-2f73434/integration_tests/modules_53.f900000664000175000017500000000055315141516316023702 0ustar alastairalastairmodule module_modules_53 real :: x(5) end module subroutine check_x() use module_modules_53, only: x print *, x if (any(abs(x - 1.39) > 1e-9)) error stop x = -2.91 end subroutine program modules_53 use module_modules_53, only: x x = 1.39 call check_x() print *, x if (any(abs(x - (-2.91)) > 1e-9)) error stop end program lfortran-lfortran-2f73434/integration_tests/array_02_transfer.f900000664000175000017500000000016515141516316025245 0ustar alastairalastairprogram array_02_transfer integer :: m(7) m = [ 1, 0, 0, 0, 5, 0, 0 ] print *, transfer(m, [ 1.0 ]) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_135.f900000664000175000017500000000526515141516316024505 0ustar alastairalastairprogram intrinsics_133 real :: w = -5.1 real :: x = 5.8 real :: y = 6.0 real :: z = -5.8 double precision :: v = 1e12_8 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer, parameter :: x1 = nint(1.0) integer, parameter :: x2 = nint(1.21_8) integer, parameter :: ar1(3) = nint([91.0, 21.20, 33.10]) integer, parameter :: ar2(3) = nint([91.0, 21.20, 33.10], 8) real(4) :: arr1(3) = [91.0, 21.20, 33.10] real(8) :: arr2(3) = [91.0, 21.20, 33.10] print *, x1 if (x1 /= 1) error stop print *, x2 if (x2 /= 1) error stop print *, ar1 if (any(ar1 /= [91, 21, 33])) error stop print *, ar2 if (any(ar2 /= [91, 21, 33])) error stop print *, nint(arr1) if (any(nint(arr1) /= [91, 21, 33])) error stop print *, nint(arr2, 8) if (any(nint(arr2, 8) /= [91, 21, 33])) error stop res_4 = nint(w) print *, res_4 if (res_4 /= -5) error stop res_8 = nint(w, 8) print *, res_8 if (res_8 /= -5) error stop res_4 = nint(w, 4) print *, res_4 if (res_4 /= -5) error stop res_4 = nint(x) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(x, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(x, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = nint(y) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(y, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(y, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = nint(z) print *, res_4 if (res_4 /= -6) error stop res_8 = nint(z, 8) print *, res_8 if (res_8 /= -6) error stop res_4 = nint(z, 4) print *, res_4 if (res_4 /= -6) error stop res_4 = nint(5.8) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(5.8, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(6.00, 8) print *, res_4 if (res_4 /= 6) error stop res_8 = nint(6.00, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = nint(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = nint(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = nint(-412.124) print *, res_4 if (res_4 /= -412) error stop res_8 = nint(-412.124, 8) print *, res_8 if (res_8 /= -412) error stop res_4 = nint(-412.00) print *, res_4 if (res_4 /= -412) error stop res_8 = nint(-412.00, 8) print *, res_8 if (res_8 /= -412) error stop res_8 = nint(1e12_8, 8) print *, res_8 if (res_8 /= 1000000000000_8) error stop res_8 = nint(v, 8) print *, res_8 if (res_8 /= 1000000000000_8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_151.f900000664000175000017500000000476115141516316024503 0ustar alastairalastairprogram intrinsics_151 integer :: a,b integer(8) :: c, d integer(8) :: result integer :: i integer(4) :: arg_x(5) = [12, 11, 18, 20, 30] integer(8) :: arg_x2(5) = [33, 48, 58, 55, 54] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = maskl([12, 11, 18, 20, 30]) integer(8), parameter :: res2(5) = maskl([33, 48, 58, 55, 54],8) integer(4) :: expected_res(5) = [-1048576, -2097152, -16384, -4096, -4] integer(8) :: expected_res2(5) = [-2147483648_8, -65536_8, -64_8, & -512_8, -1024_8] integer(4), parameter :: comp1 = maskl(12) integer(8), parameter :: comp2 = maskl(43, 8) print *, comp1 if (comp1 /= -1048576) error stop print *, comp2 if (comp2 /= -2097152_8) error stop res_x = maskl(arg_x) res_x2 = maskl(arg_x2, 8) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do a = 10 b = 31 c = 63 d = 54 result = maskl(10, 8) print *, result if (result /= -18014398509481984_8) error stop result = maskl(31, 8) print *, result if (result /= -8589934592_8) error stop result = maskl(63, 8) print *, result if (result /= -2) error stop result = maskl(54, 8) print *, result if (result /= -1024) error stop result = maskl(a, 8) print *, result if (result /= -18014398509481984_8) error stop result = maskl(b, 8) print *, result if (result /= -8589934592_8) error stop result = maskl(c) print *, result if (result /= -2) error stop result = maskl(d) print *, result if (result /= -1024) error stop result = maskl(10,8) print *, kind(result) if (kind(result) /= 8) error stop print*, maskl(55, kind = kind(0.0d0)) if (maskl(55, kind = kind(0.0d0)) /= -512) error stop print *, kind(maskl(10,8)) if (kind(maskl(10,8)) /= 8) error stop print *, kind(maskl(10)) if (kind(maskl(10)) /= 4) error stop print *, kind(maskl(a,4)) if (kind(maskl(a,4)) /= 4) error stop print *, kind(maskl(a,8)) if (kind(maskl(a,8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/allocated_02.f900000664000175000017500000000026415141516316024153 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) allocate(x(5)) x = [1.0, 2.0, 3.0, 4.0, 5.0] if (.not.allocated(x)) error stop end program main lfortran-lfortran-2f73434/integration_tests/modules_49.f900000664000175000017500000000232515141516316023706 0ustar alastairalastairmodule modules_49_fpm_strings implicit none contains pure function replace(string, charset, target_char) result(res) character(*), intent(in) :: string character(len=1), intent(in) :: charset(:), target_char character(len(string)) :: res integer :: n, m, one one = 1 res = string do n = 1, len(string) ! TODO: To be fixed, after making any work for character types ! if (any(string(n:n) == charset)) then ! res(n:n) = target_char ! end if do m = lbound(charset, 1), ubound(charset, 1) if(string(n:n) == charset(m)) then res(n:n) = target_char(one:one) exit end if end do end do end function replace pure function to_fortran_name(string) result(res) character(*), intent(in) :: string character(len(string)) :: res character, parameter :: SPECIAL_CHARACTERS(*) = ['-'] res = replace(string, SPECIAL_CHARACTERS, '_') end function to_fortran_name end module program modules_49 use modules_49_fpm_strings implicit none character(len=40) :: name = "--gnu-gfortran-11" print *, name, to_fortran_name(name) if( to_fortran_name(name) /= "__gnu_gfortran_11" ) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_15b.f900000664000175000017500000002650715141516316024051 0ustar alastairalastairmodule modules_15b use iso_c_binding, only: c_int, c_long_long, c_float, c_double, c_char, & c_null_char, c_float_complex, c_double_complex, c_int32_t, c_int64_t implicit none interface ! int f_int_float(int *a, float *b) integer(c_int) function f_int_float(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a real(c_float), intent(in) :: b end function ! int f_int_double(int *a, double *b) integer(c_int) function f_int_double(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a real(c_double), intent(in) :: b end function ! int f_int_float_complex(int *a, float_complex_t *b) integer(c_int) function f_int_float_complex(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a complex(c_float), intent(in) :: b end function ! int f_int_double_complex(int *a, double_complex_t *b) integer(c_int) function f_int_double_complex(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a complex(c_double), intent(in) :: b end function integer(c_int) function f_int_float_complex2(a, b) result(r) & bind(c, name="f_int_float_complex") import :: c_int, c_float_complex integer(c_int), intent(in) :: a complex(c_float_complex), intent(in) :: b end function ! int f_int_double_complex(int *a, double_complex_t *b) integer(c_int) function f_int_double_complex2(a, b) result(r) & bind(c, name="f_int_double_complex") import :: c_int, c_double_complex integer(c_int), intent(in) :: a complex(c_double_complex), intent(in) :: b end function ! int f_int_float_complex_value(int a, float_complex_t b) integer(c_int) function f_int_float_complex_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a complex(c_float), value, intent(in) :: b end function ! int f_int_double_complex_value(int a, double_complex_t b) integer(c_int) function f_int_double_complex_value(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a complex(c_double), value, intent(in) :: b end function ! float_complex_t f_float_complex_value_return(float_complex_t b) complex(c_float) function f_float_complex_value_return(b) result(r) bind(c) import :: c_float complex(c_float), value, intent(in) :: b end function ! double_complex_t f_double_complex_value_return(double_complex_t b) complex(c_double) function f_double_complex_value_return(b) result(r)bind(c) import :: c_double complex(c_double), value, intent(in) :: b end function ! int f_int_float_value(int a, float b) integer(c_int) function f_int_float_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b end function ! int f_int_double_value(int a, double b) integer(c_int) function f_int_double_value(a, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function ! int f_int_intarray(int n, int *b) integer(c_int) function f_int_intarray(n, b) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(n) end function ! float f_int_floatarray(int n, float *b) real(c_float) function f_int_floatarray(n, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(n) end function ! double f_int_doublearray(int n, double *b) real(c_double) function f_int_doublearray(n, b) result(r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(n) end function ! int f_int_intarray(int n, int *b) integer(c_int) function f_int_intarray_star(n, b) result(r) & bind(c, name="f_int_intarray") import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(*) end function ! float f_int_floatarray_star(int n, float *b) real(c_float) function f_int_floatarray_star(n, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(*) end function ! double f_int_doublearray(int n, double *b) real(c_double) function f_int_doublearray_star(n, b) result(r) & bind(c, name="f_int_doublearray") import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(*) end function ! int f_int_double_value(int a, double b) integer(c_int) function f_int_double_value_name(a, b) result(r) & bind(c, name="f_int_double_value") import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function !---------------------------------------------------------------------------- ! void sub_int_float(int *a, float *b, int *r) subroutine sub_int_float(a, b, r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a real(c_float), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double(int *a, double *b, int *r) subroutine sub_int_double(a, b, r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a real(c_double), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_complex(int *a, float_complex_t *b, int *r) subroutine sub_int_float_complex(a, b, r) bind(c) import :: c_int, c_float integer(c_int), intent(in) :: a complex(c_float), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_complex(int *a, double_complex_t *b, int *r) subroutine sub_int_double_complex(a, b, r) bind(c) import :: c_int, c_double integer(c_int), intent(in) :: a complex(c_double), intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_value(int a, float b, int *r) subroutine sub_int_float_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_value(int a, double b, int *r) subroutine sub_int_double_value(a, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_float_complex_value(int a, float_complex_t b, int *r) subroutine sub_int_float_complex_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a complex(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_double_complex_value(int a, double_complex_t b, int *r) subroutine sub_int_double_complex_value(a, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: a complex(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! void sub_int_intarray(int n, int *b, int *r) subroutine sub_int_intarray(n, b, r) bind(c) import :: c_int integer(c_int), value, intent(in) :: n integer(c_int), intent(in) :: b(n) integer(c_int), intent(out) :: r end subroutine ! void sub_int_floatarray(int n, float *b, float *r) subroutine sub_int_floatarray(n, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: n real(c_float), intent(in) :: b(n) real(c_float), intent(out) :: r end subroutine ! void sub_int_doublearray(int n, double *b, double *r) subroutine sub_int_doublearray(n, b, r) bind(c) import :: c_int, c_double integer(c_int), value, intent(in) :: n real(c_double), intent(in) :: b(n) real(c_double), intent(out) :: r end subroutine ! void sub_int_double_value(int a, double b, int *r) subroutine sub_int_double_value_name(a, b, r) & bind(c, name="sub_int_double_value") import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine ! int f_string(char *s) integer(c_int) function f_string0(s) result(r) bind(c, name="f_string") import :: c_int, c_char character(len=1, kind=c_char), intent(in) :: s end function integer(c_int) function call_fortran_i32(i) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: i end function integer(c_int) function call_fortran_i32_value(i) result(r) bind(c) import :: c_int integer(c_int), value, intent(in) :: i end function integer(c_int32_t) function call_fortran_i32_value2(i) result(r) & bind(c, name="call_fortran_i32_value") import :: c_int32_t integer(c_int32_t), value, intent(in) :: i end function integer(c_long_long) function call_fortran_i64(i) result(r) bind(c) import :: c_long_long integer(c_long_long), value, intent(in) :: i end function integer(c_long_long) function call_fortran_i64_value(i) result(r) bind(c) import :: c_long_long integer(c_long_long), value, intent(in) :: i end function integer(c_int64_t) function call_fortran_i64_value2(i) result(r) & bind(c, name="call_fortran_i64_value") import :: c_int64_t integer(c_int64_t), value, intent(in) :: i end function real(c_float) function call_fortran_f32(i) result(r) bind(c) import :: c_float real(c_float), value, intent(in) :: i end function real(c_float) function call_fortran_f32_value(i) result(r) bind(c) import :: c_float real(c_float), value, intent(in) :: i end function real(c_double) function call_fortran_f64(i) result(r) bind(c) import :: c_double real(c_double), value, intent(in) :: i end function real(c_double) function call_fortran_f64_value(i) result(r) bind(c) import :: c_double real(c_double), value, intent(in) :: i end function end interface contains integer function f_string(s) result(r) character(*), intent(in) :: s r = f_string0(s // c_null_char) end function integer(c_int) function fortran_i32(i) result(r) bind(c) integer(c_int), intent(in) :: i r = i + 2 end function integer(c_int) function fortran_i32_value(i) result(r) bind(c) integer(c_int), value, intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64(i) result(r) bind(c) integer(c_long_long), intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64_value(i) result(r) bind(c) integer(c_long_long), value, intent(in) :: i r = i + 2 end function real(c_float) function fortran_f32(i) result(r) bind(c) real(c_float), intent(in) :: i r = i + 2.3_c_float end function real(c_float) function fortran_f32_value(i) result(r) bind(c) real(c_float), value, intent(in) :: i r = i + 2.3_c_float end function real(c_double) function fortran_f64(i) result(r) bind(c) real(c_double), intent(in) :: i r = i + 2.3_c_double end function real(c_double) function fortran_f64_value(i) result(r) bind(c) real(c_double), value, intent(in) :: i r = i + 2.3_c_double end function end module lfortran-lfortran-2f73434/integration_tests/modules_14.f900000664000175000017500000000033015141516316023670 0ustar alastairalastairprogram modules_14 use modules_14_a, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) error stop r = 6 call a(r) if (r /= 7) error stop i = 7 call a(i) if (i /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_10.f900000664000175000017500000000027515141516316026426 0ustar alastairalastairprogram separate_compilation_10 use history_mod_separate_compilation_10a real :: xhist(5,5) call rangehist(xhist) print *, xhist if (any(abs(xhist - 99.124) > 1e-8)) error stop end program lfortran-lfortran-2f73434/integration_tests/statement1.f900000664000175000017500000000060415141516316024005 0ustar alastairalastairprogram statement1 integer :: i,j integer, parameter :: dp = kind(0.d0) real(dp) :: dfloat real :: sfloat, ti, sum integer :: ifloat sfloat(i,j) = i*j dfloat(i,j) = i+j ifloat(i,j) = i+j ti = sfloat(1,8) if (abs(ti-8) > 1e-5) error stop sum = sfloat(12,9)+12.42 if (abs(sum-120.42) > 1e-5) error stop if (abs(dfloat(5,4)-9) > 1e-10) error stop if (ifloat(5,4) /= 9) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_44.f900000664000175000017500000000155515141516316023533 0ustar alastairalastairmodule openmp_44_parallel_sections implicit none contains subroutine compute_a() print *, "Computing A" end subroutine compute_a subroutine compute_b() print *, "Computing B" end subroutine compute_b subroutine compute_c() print *, "Computing C" end subroutine compute_c end module openmp_44_parallel_sections program openmp_44 use omp_lib use openmp_44_parallel_sections implicit none integer :: tid=0 !$omp parallel sections reduction(+:tid) !$omp section call compute_a() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp section call compute_b() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp section call compute_c() tid = tid + omp_get_thread_num() print *, "Thread ID:", tid !$omp end parallel sections print *, "Final Thread ID:", tid end program openmp_44lfortran-lfortran-2f73434/integration_tests/system_clock_01.f900000664000175000017500000000024715141516316024722 0ustar alastairalastairprogram system_clock_01 implicit none integer :: arg = 0 call system_clock(arg) print *, arg if (arg == 0) error stop end program system_clock_01 lfortran-lfortran-2f73434/integration_tests/dealloc_04.f900000664000175000017500000000135015141516316023625 0ustar alastairalastairmodule dealloc_04 type, abstract :: toml_value integer, allocatable :: key end type type, extends(toml_value) :: toml_table logical :: implicit = .false. end type toml_table contains subroutine new_table(self) class(toml_value), allocatable, intent(out) :: self allocate(self, source=toml_table()) allocate(self%key) self%key = 5678 end subroutine new_table end module program test use dealloc_04 class(toml_value), allocatable :: tmp allocate(tmp, source=toml_table()) allocate(tmp%key) tmp%key = 1234 print *, "Key in tmp: ", tmp%key call new_table(tmp) print *, "Key in tmp after new_table call: ", tmp%key if (tmp%key /= 5678) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_20.f900000664000175000017500000000106715141516316025235 0ustar alastairalastairprogram arrays_reshape_20 integer, dimension(2, 3) :: x1 = reshape([1, 4, 2, 5, 3, 6], [2, 3]) integer, dimension(2, 3) :: x2 = reshape([1, 2, 3, 4, 0, 0], [2, 3]) integer, dimension(2, 3) :: x3 =reshape([1, 4, 2, 0, 3, 0], [2, 3]) print *, x1 print *, x2 print *, x3 if (any(x1 /= reshape([1, 2, 3, 4, 5, 6], [2, 3], order = [2, 1]))) error stop if (any(x2 /= reshape([1, 2, 3, 4], [2, 3], pad = [0]))) error stop if (any(x3 /= reshape([1, 2, 3, 4], [2, 3], order = [2, 1], pad = [0]))) error stop end program arrays_reshape_20 lfortran-lfortran-2f73434/integration_tests/entry_04.f900000664000175000017500000000134415141516316023366 0ustar alastairalastairdouble precision function mvndfn(dummy) double precision :: dummy double precision :: mvndnt if (abs(dummy - 10.0) > 1.0e-7) error stop mvndfn = -12.05 return entry mvndnt(dummy) mvndnt = 12.05 if (abs(dummy - 5.0) > 1.0e-7) error stop return end function program main interface double precision function mvndfn(dummy) double precision :: dummy end function double precision function mvndnt(dummy) double precision :: dummy end function end interface double precision :: dummy dummy = 10.0 if (abs(mvndfn(dummy) - (-12.05)) > 1.0e-7) error stop dummy = 5.0 if (abs(mvndnt(dummy) - 12.05) > 1.0e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_346.f900000664000175000017500000000273215141516316024505 0ustar alastairalastairmodule asciimod ! f95-compliant file asciiB.f90: [] only in character strings implicit none public iascii,ascii interface ascii module procedure asciiarray,asciiscalar end interface ascii contains pure function iascii( string) character,intent(in):: string*(*) integer iascii(len(string)), i do i = 1, len(string) iascii(i) = iachar(string(i:i)) end do end function iascii pure function asciiarray( codes) integer,intent(in):: codes(:) character(len = size(codes)) :: asciiarray integer i do i = 1, size(codes) asciiarray(i:i) = achar(codes(i)) end do end function asciiarray pure function asciiscalar(codes) integer,intent(in):: codes character asciiscalar*1 asciiscalar = asciiarray((/codes/)) end function asciiscalar end module asciimod program intrinsics_346 use asciimod implicit none ! Variables character(len=5) :: inputString integer, allocatable :: asciiCodes(:) character(len=:), allocatable :: outputString inputString = "Hi!" allocate(asciiCodes(len(inputString))) asciiCodes = iascii(inputString) print *, "ASCII codes for '", inputString, "':", asciiCodes if (any(asciiCodes /= [72, 105, 33, 32, 32])) error stop outputString = ascii(asciiCodes) print *, "Converted back to string:", outputString if (outputString /= "Hi!") error stop end programlfortran-lfortran-2f73434/integration_tests/character_09.f900000664000175000017500000000031315141516316024161 0ustar alastairalastairprogram character_09 implicit none integer, parameter :: SCK = selected_char_kind("ascii") character(kind=SCK) :: one_len one_len = "hello" if (one_len /= "h") error stop end program lfortran-lfortran-2f73434/integration_tests/nested_23.f900000664000175000017500000000466615141516316023522 0ustar alastairalastairmodule nested_23_mod implicit none type :: build_target character(len=:), allocatable :: name character(len=:), allocatable :: names(:) end type build_target contains subroutine prune_build_targets(targets) type(build_target), allocatable, intent(inout) :: targets(:) integer :: i ! ---- Basic sanity checks ---- if (.not. allocated(targets)) error stop "targets not allocated" if (size(targets) == 0) error stop "targets is empty" do i = 1, size(targets) associate(target => targets(i)) if (.not. allocated(target%name)) then error stop "target name not allocated" end if if (temp_call(targets)) then call collect_used_modules(target) end if end associate end do contains subroutine collect_used_modules(target) type(build_target), intent(inout) :: target ! ---- Validate access to host-associated variable ---- if (.not. allocated(targets)) then error stop "host variable 'targets' unexpectedly unallocated" end if if (.not. allocated(target%name)) then error stop "collect_used_modules: target%name not allocated" end if ! Dummy logic: attach a single "used module" allocate(character(len=len_trim(target%name)) :: target%names(1)) target%names(1) = target%name end subroutine collect_used_modules end subroutine prune_build_targets logical function temp_call(targets) type(build_target), allocatable, intent(in) :: targets(:) if (.not. allocated(targets)) error stop "temp_call: targets not allocated" ! Simple logic: trigger processing only if >1 target exists temp_call = size(targets) > 1 end function temp_call end module nested_23_mod program nested_23 use nested_23_mod implicit none type(build_target), allocatable :: targets(:) allocate(targets(2)) targets(1)%name = "core_lib" targets(2)%name = "util_lib" call prune_build_targets(targets) ! ---- Post-condition check ---- if (.not. allocated(targets(1)%names)) error stop "names not populated" if (targets(1)%names(1) /= "core_lib") error stop "unexpected module name" print *, "MRE completed successfully" end program nested_23 lfortran-lfortran-2f73434/integration_tests/class_65.f900000664000175000017500000000203315141516316023335 0ustar alastairalastairmodule class_65_mod implicit none type :: base_t end type type, extends(base_t) :: extended_t integer :: key end type type :: temp_t type(extended_t) :: child(2) end type contains subroutine call_describe(obj, check) class(base_t), intent(in) :: obj integer, intent(inout) :: check class(base_t), allocatable :: obj_tmp allocate(obj_tmp) obj_tmp = obj select type (obj_tmp) type is (base_t) check = check + 3 type is (extended_t) check = check + 2 if (obj_tmp%key /= 10) error stop class default error stop end select end subroutine end module class_65_mod program class_65 use class_65_mod interface describe module procedure :: call_describe end interface type(temp_t) :: x type(base_t) :: y integer :: count count = 0 x%child(1) = extended_t(10) x%child(2) = extended_t(20) call describe(x%child(1), count) if (count /= 2) error stop call describe(y, count) if (count /= 5) error stop end program class_65lfortran-lfortran-2f73434/integration_tests/character_13.f900000664000175000017500000000205215141516316024156 0ustar alastairalastairmodule character_13_mod integer, parameter :: tfc = selected_char_kind('DEFAULT') character(kind=tfc, len=1) :: backslash = tfc_'\' character(kind=tfc, len=5) :: hello = tfc_"Hello" end module program character_13 use character_13_mod ! Test character kind parameter with string literals type :: toml_char character(1, tfc) :: hash = tfc_"#" character(1, tfc) :: lbracket = tfc_"[" character(1, tfc) :: rbracket = tfc_"]" end type type(toml_char) :: char_kind ! Test default initialization if (char_kind%hash /= "#") error stop if (char_kind%lbracket /= "[") error stop if (char_kind%rbracket /= "]") error stop ! Test explicit initialization char_kind = toml_char(tfc_"@", tfc_"(", tfc_")") if (char_kind%hash /= "@") error stop if (char_kind%lbracket /= "(") error stop if (char_kind%rbracket /= ")") error stop ! Test module level character variables if (backslash /= "\") error stop if (hello /= "Hello") error stop end program character_13 lfortran-lfortran-2f73434/integration_tests/array_op_02.f900000664000175000017500000000027115141516316024035 0ustar alastairalastairprogram main implicit none real :: x(2) x = -1.0 if (abs(x(1) - (-1)) > 1e-8) error stop if (abs(x(2) - (-1)) > 1e-8) error stop print *, x end program main lfortran-lfortran-2f73434/integration_tests/save_04.f900000664000175000017500000000047215141516316023164 0ustar alastairalastairsubroutine sub(a, b, i) real(8) :: a, b real(8), save :: c integer :: i if (i == 1) then print *, c if (abs(c-2.4D0) > 1.0D-12) error stop return end if c = a - b end subroutine program save_04 call sub(3.4D0, 1.0D0, 0) call sub(3.4D0, 1.0D0, 1) end programlfortran-lfortran-2f73434/integration_tests/expr_14.f900000664000175000017500000000033015141516316023176 0ustar alastairalastairmodule expr_14_utils private integer, parameter :: a = 10 public :: a end module program expr_14 use expr_14_utils, only: a implicit none print *, a if (a /= 10) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_242.f900000664000175000017500000000046515141516316024501 0ustar alastairalastairprogram intrinsics_242 integer, parameter :: dp = kind(0.d0) print*, nint(1e12_dp, dp) if (nint(1e12_dp, dp) /= 1000000000000_dp) error stop print*, nint(1000000000000.0000000000000000_dp, dp) if (nint(1000000000000.0000000000000000_dp, dp) /= 1000000000000_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/ilp64_logical_read_01.f900000664000175000017500000000113015141516316025636 0ustar alastairalastair! Test: logical I/O with -fdefault-integer-8 (ILP64 mode) ! Fixes #9770 program ilp64_logical_read_01 implicit none logical :: flag1, flag2 ! Write logical values to temp file open(10, file="/tmp/test_ilp64_logical.txt", status="replace") write(10, *) .true. write(10, *) .false. close(10) ! Read them back open(10, file="/tmp/test_ilp64_logical.txt", status="old") read(10, *) flag1 read(10, *) flag2 close(10) if (.not. flag1) error stop "flag1 should be true" if (flag2) error stop "flag2 should be false" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_177.f900000664000175000017500000000121115141516316024476 0ustar alastairalastairprogram intrinsics_177 character(4), parameter :: y = adjustr("okay") character(len=5) :: x character(len=20) :: str = 'gfortran ' str = adjustr(str) print *, str if (str /= ' gfortran') error stop str = adjustr('gfortran ') print *, str if (str /= ' gfortran') error stop print *, "|"//adjustr("abc ")//"|" if ("|"//adjustr("abc ")//"|" /= '| abc|') error stop x = " " print *, adjustr(x) print *, adjustr(" ") if (adjustr(" ") /= " ") error stop if (adjustr(x) /= " ") error stop if (y /= "okay") error stop end program lfortran-lfortran-2f73434/integration_tests/optional_01.f900000664000175000017500000000144215141516316024046 0ustar alastairalastairprogram optional_01 implicit none character(len=1) :: response = "Y" if (lower(response) /= 'y') error stop print *, lower(response) contains elemental pure function lower(str, begin, end) result (string) character(*), intent(in) :: str character(len(str)) :: string integer, intent(in), optional :: begin, end integer :: i integer :: ibegin, iend string = str ibegin = 1 if (present(begin)) then ibegin = max(ibegin, begin) end if iend = len_trim(str) if (present(end)) then iend = min(iend,end) end if do i = ibegin, iend select case (str(i:i)) case ('A':'Z') string(i:i) = char(iachar(str(i:i)) + 32) case default end select end do end function lower end program lfortran-lfortran-2f73434/integration_tests/class_35.f900000664000175000017500000000065715141516316023344 0ustar alastairalastairprogram class_35 implicit none type :: toml_value integer :: key end type toml_value class(toml_value), pointer :: ptr class(toml_value), allocatable :: tmp2 allocate(ptr, tmp2) ptr%key = 1 tmp2 = ptr print *, "tmp2%key: ", tmp2%key select type(tmp2) type is(toml_value) if (tmp2%key /= 1) error stop class default error stop "Unexpected type" end select end program lfortran-lfortran-2f73434/integration_tests/where_11.f900000664000175000017500000000176415141516316023343 0ustar alastairalastairMODULE where_11_mod IMPLICIT NONE INTEGER :: a(3) integer :: b(3) CONTAINS SUBROUTINE test_01 where(abs(a) == 1) b = 555 print *, b if (any(b /= [555, 555 , 0])) error stop b = 0 END SUBROUTINE test_01 SUBROUTINE test_02 where(abs(a)*1 == 1) b = 556 print *, b if (any(b /= [556, 556 , 0])) error stop b = 0 END SUBROUTINE test_02 SUBROUTINE test_03 where(abs(a)*1 + 1 == 2) b = 557 print *, b if (any(b /= [557, 557 , 0])) error stop b = -1 END SUBROUTINE test_03 SUBROUTINE test_04 where(min(a, b) == -1 ) b = 558 print *, b if (any(b /= [558, 558 , 558])) error stop b = 0 END SUBROUTINE test_04 END MODULE where_11_mod PROGRAM where_11 USE where_11_mod implicit none a = [1,-1,2] b = 0 CALL test_01 CALL test_02 CALL test_03 CALL test_04 END PROGRAM where_11 lfortran-lfortran-2f73434/integration_tests/derived_types_03.f900000664000175000017500000000050715141516316025072 0ustar alastairalastairprogram derived_types_03 implicit none type :: X integer :: i end type type(X) :: b contains subroutine Y() type :: A integer :: i end type type(A) :: b end subroutine integer function Z() type :: A integer :: i end type type(A) :: b Z = 5 end function end lfortran-lfortran-2f73434/integration_tests/ip_01.f900000664000175000017500000000025415141516316022631 0ustar alastairalastairprogram ip_01 use iso_fortran_env implicit none integer, parameter :: IP = int32 integer(IP) :: n_small = 2_IP print *, n_small if (n_small /= 2_IP) error stop end program lfortran-lfortran-2f73434/integration_tests/class_91.f900000664000175000017500000000226715141516316023345 0ustar alastairalastairmodule class_91_mod implicit none ! Base abstract type type, abstract :: toml_value end type toml_value ! Concrete extended type type, extends(toml_value) :: toml_integer integer :: value end type toml_integer end module class_91_mod program class_91 use class_91_mod implicit none type(toml_integer), target :: i class(toml_value), pointer :: src class(toml_value), allocatable :: tmp ! Initialize concrete object i%value = 42 ! Pointer must associate with extended type src => i if (.not. associated(src)) then error stop "ERROR: src pointer not associated" end if ! Allocate polymorphic allocatable from pointer source allocate(tmp, source=src) if (.not. allocated(tmp)) then error stop "ERROR: tmp not allocated" end if ! Validate dynamic type and value select type (tmp) type is (toml_integer) if (tmp%value /= 42) then error stop "ERROR: value mismatch after allocate(source=)" end if print *, "Copied value:", tmp%value class default error stop "ERROR: wrong dynamic type in tmp" end select end program class_91 lfortran-lfortran-2f73434/integration_tests/recursion_02.f900000664000175000017500000000143715141516316024237 0ustar alastairalastairmodule recursion_02 implicit none contains integer function solver(f, iter) interface integer function f() end function end interface !procedure(f_type) :: f integer, intent(in) :: iter integer f_val f_val = f() print *, "before:", f_val solver = sub1(2, iter-1) !solver = sub1(2, iter-1) + f() f_val = f() print *, "after:", f_val end function integer function sub1(y, iter) integer, intent(in):: y, iter integer x integer tmp x = y print *, "in sub1" if (iter == 1) then sub1 = 1 return end if tmp = getx() sub1 = solver(getx, iter) contains integer function getx() print *, "x in getx", x getx = x end function end function end module recursion_02 program main use recursion_02 implicit none integer :: r r = sub1(3, 3) print *, "r =", r end program main lfortran-lfortran-2f73434/integration_tests/fortran_02.f900000664000175000017500000000023415141516316023673 0ustar alastairalastairprogram openmp_40 integer :: i, j, res=0 do concurrent ( i =1:5, j = 1:10 ) res=res+2 end do print *,"res =",res if (res /= 100) error stop end programlfortran-lfortran-2f73434/integration_tests/multi_file_member_access_01.f900000664000175000017500000000032215141516316027216 0ustar alastairalastairprogram multi_file_member_access_01 use member_access_mod implicit none type(string_buffer) :: buf if (buf%number_of_elems() /= 0) error stop 1 print *, "OK" end program multi_file_member_access_01 lfortran-lfortran-2f73434/integration_tests/tuple_test_04_.f900000664000175000017500000000134415141516316024554 0ustar alastairalastairmodule tuple_test_04_mod implicit none real :: eps = 1e-12 contains subroutine tests() _lfortran_tuple(_lfortran_list(integer), character(len=:)) :: ttype _lfortran_tuple(_lfortran_list(integer), character(len=:)) :: contents ttype = _lfortran_tuple_constant(_lfortran_list_constant(-1), "dimensions") contents = _lfortran_tuple_constant(_lfortran_list_constant(1, 2), "") ! TODO: Add List cmp if (_lfortran_len(_lfortran_get_item(ttype, 0)) /= 1) error stop if (len(_lfortran_get_item(contents, 1)) /= 0) error stop if (_lfortran_get_item(ttype, 1) /= "dimensions") error stop end subroutine end module program run_tuples use tuple_test_04_mod call tests() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_405.f900000664000175000017500000000250015141516316024472 0ustar alastairalastairprogram intrinsics_405 implicit none call print_any(" Hello World ") contains subroutine print_any(generic) class(*), intent(in) :: generic character(len = 15) :: a, b, c integer :: d,e select type (generic) type is (character(len=*)) a = trim(generic) print *, trim(generic) if (trim(generic) /= " Hello World ") error stop b = adjustl(generic) print *, adjustl(generic) if (adjustl(generic) /= "Hello World ") error stop c = adjustr(generic) print *, adjustr(generic) if (adjustr(generic) /= " Hello World") error stop d = len_trim(generic) print *, len_trim(generic) if (len_trim(generic) /= 13) error stop e = len(generic) print *, len(generic) if (len(generic) /= 15) error stop end select print *, a if (a /= " Hello World ") error stop print *, b if (b /= "Hello World ") error stop print *, c if (c /= " Hello World") error stop print *, d if (d /= 13) error stop print *, e if (e /= 15) error stop end subroutine print_any end program intrinsics_405lfortran-lfortran-2f73434/integration_tests/functions_10.f900000664000175000017500000000151015141516316024225 0ustar alastairalastairmodule kwarg_gp interface mergegp procedure :: mergei32, merger32, merger64 end interface contains function mergei32(a, b, m) result(r) integer :: a(:), b(:) integer, optional :: m(:) integer :: r end function function merger32(a, b, m) result(r) real :: a(:), b(:) real, optional :: m(:) real :: r end function function merger64(a, b, m) result(r) real(8) :: a(:), b(:) real(8), optional :: m(:) real(8) :: r end function end module program kwarg_use use kwarg_gp implicit none integer :: a1(4), b1(4), m1(4) real :: a2(5), b2(5), m2(5) print *, mergegp(a1, b1) print *, mergegp(a1, b1, m=m1) print *, mergegp(a1, b1, m1) print *, mergegp(a2, b2) print *, mergegp(a2, b2, m=m2) print *, mergegp(a2, b2, m2) end programlfortran-lfortran-2f73434/integration_tests/functions_30.f900000664000175000017500000000462515141516316024241 0ustar alastairalastairprogram functions_30 real :: x(4) = [1.0, 2.0, -3.0, 4.0] integer :: y(4) = [1, 2, -3, 4] print *, maxval([1.0,x]) if(maxval([1.0,x]) /= 4.0) error stop print *, max_func([1.0,x]) if(max_func([1.0,x]) /= 4.0) error stop print *, maxval([1.0, -x]) if(maxval([1.0, -x]) /= 3.0) error stop print *, max_func([1.0, -x]) if(max_func([1.0, -x]) /= 3.0) error stop print *, maxval([1.0, x + x([2,1,3,4])]) if(maxval([1.0, x + x([2,1,3,4])]) /= 8.0) error stop print *, maxval([1, -y]) if(maxval([1, -y]) /= 3) error stop print *, maxval([1, y + y([2,1,3,4])]) if(maxval([1, y + y([2,1,3,4])]) /= 8) error stop call check_for_args(x, y) !! Assignment with function on rhs having lhs var in its arg x = x / norm(x) print *, x if(any(abs(x - [0.182574183, 0.365148365, -0.547722518, 0.730296731]) > 10e-12)) error stop x = x / norm(x(1:3)) print *, x if(any(abs(x - [0.267261237, 0.534522474, -0.801783681, 1.06904495]) > 10e-12)) error stop contains real function max_func(x) result(y) real, intent(in) :: x(:) y = maxval(x) end function real function norm(vec) result(res) real, intent(in) :: vec(:) integer :: i res = 0.0 do i = 1, size(vec) res = res + vec(i)**2 end do res = sqrt(res) end function norm subroutine check_for_args(x, y) real, intent(in) :: x(:) integer, intent(in) :: y(:) real :: x2(size(x)) print *, maxval([1.0,x]) if(maxval([1.0,x]) /= 4.0) error stop print *, max_func([1.0,x]) if(max_func([1.0,x]) /= 4.0) error stop print *, maxval([1.0, -x]) if(maxval([1.0, -x]) /= 3.0) error stop print *, max_func([1.0, -x]) if(max_func([1.0, -x]) /= 3.0) error stop print *, maxval([1.0, x + x([2,1,3,4])]) if(maxval([1.0, x + x([2,1,3,4])]) /= 8.0) error stop print *, maxval([1, -y]) if(maxval([1, -y]) /= 3) error stop print *, maxval([1, y + y([2,1,3,4])]) if(maxval([1, y + y([2,1,3,4])]) /= 8) error stop x2 = x x2 = x / norm(x2) print *, x2 if(any(abs(x2 - [0.182574183, 0.365148365, -0.547722518, 0.730296731]) > 10e-12)) error stop x2 = x2 / norm(x2(1:3)) print *, x2 if(any(abs(x2 - [0.267261237, 0.534522474, -0.801783681, 1.06904495]) > 10e-12)) error stop end subroutine check_for_args end program lfortran-lfortran-2f73434/integration_tests/do_loop_02.f900000664000175000017500000000075215141516316023660 0ustar alastairalastairprogram main implicit none integer :: i, j i = 0 outer : do i = i + 1 j = 0 inner : do j = j + 1 if (j == 5) then print *, j exit inner end if end do inner print *, "out of inner loop" if ( i == 2 ) then exit outer end if end do outer if (i /= 2) error stop if (j /= 5) error stop print *, "out of outer loop" end program lfortran-lfortran-2f73434/integration_tests/case_06.f900000664000175000017500000000332015141516316023136 0ustar alastairalastairprogram cond_03 implicit none integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 integer :: marks integer, parameter :: marks_fixed = 94 ! local variable declaration character, parameter :: grade_fixed = 'B' select case (grade_fixed) case ('A') print*, "Excellent!" case ('B') if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if case ('C') print*, "Well done" case ('D') print*, "You passed" case ('F') print*, "Better try again" case default print*, "Invalid grade" end select print*, "Your grade is ", grade_fixed marks = 94 select case (marks) case ((40 + bp):) print *, "Pass!" case (:(39 - ap)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks select case (marks_fixed) case ((40 + bp):) print *, "Pass!" case (0:(39 - ap)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks end lfortran-lfortran-2f73434/integration_tests/read_31_data.txt0000664000175000017500000000002615141516316024346 0ustar alastairalastair100 1 7 1 50 2 3 99 lfortran-lfortran-2f73434/integration_tests/min_02.f900000664000175000017500000000012615141516316023003 0ustar alastairalastairprogram min_02 integer(8) :: y integer :: z print *, min(y, z) end programlfortran-lfortran-2f73434/integration_tests/openmp_59.f900000664000175000017500000000033415141516316023533 0ustar alastairalastairprogram openmp_59 use omp_lib integer :: sum=0 !$omp teams num_teams(3) reduction(+:sum) print*, omp_get_team_num() sum=sum+omp_get_team_num() !$omp end teams if(sum/=3) error stop end program openmp_59lfortran-lfortran-2f73434/integration_tests/format_57.f900000664000175000017500000000200615141516316023521 0ustar alastairalastair program format_57 implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0),& sep = selected_real_kind(precision(1.0_dp)+1),& ep = merge(sep,dp,sep>0) real(sp),parameter:: xsp = 1 real(dp),parameter:: xdp = 1 real(ep),parameter:: xep = 1 write(*,"(A)") 'kind sp dp ep' write(*,"(A,3(E12.3E4))")'epsilon:',epsilon(xsp),epsilon(xdp),epsilon(xep) write(*,"(A,3(E12.3E4))")'tiny :', tiny(xsp), tiny(xdp), tiny(xep) write(*,"(A,3(E12.3E4))")'huge :', huge(xsp), huge(xdp), huge(xep) write(*,"(A,3(ES11.2E4))")'epsilon:',epsilon(xsp),epsilon(xdp),epsilon(xep) write(*,"(A,3(ES11.2E4))")'tiny :', tiny(xsp), tiny(xdp), tiny(xep) write(*,"(A,3(ES11.2E4))")'huge :', huge(xsp), huge(xdp), huge(xep) print "(A,E 0.5,A)", '"',2/9.0d200,'"' print "(A,E12.5,A)", '"',2/9.0d200,'"' print "(A,ES 0.5,A)", '"',2/9.0d200,'"' print "(A,ES12.5,A)", '"',2/9.0d200,'"' end program format_57 lfortran-lfortran-2f73434/integration_tests/elemental_06.f900000664000175000017500000000074615141516316024202 0ustar alastairalastairprogram elemental_06 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(0:n-1) end type type(vector) :: a, b, c do i = 0, n-1 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 0, n-1 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-lfortran-2f73434/integration_tests/where_06.f900000664000175000017500000000075515141516316023346 0ustar alastairalastairprogram where_06 implicit none integer :: x(10) x = [38, 79, -54, 13, -66, 77, -62, 39, 6, -3] if (get_positive_sum(x) /= 252) error stop contains integer function get_positive_sum(input_1, input_2) result(output) integer, intent(in) :: input_1(:) integer, intent(in), optional :: input_2 integer :: x(size(input_1)) x = input_1 where(input_1 < 0) x = 0 output = sum(x) end function get_positive_sum end program where_06 lfortran-lfortran-2f73434/integration_tests/external_14.f900000664000175000017500000000127415141516316024052 0ustar alastairalastairmodule external_14_mod_2 use iso_c_binding use external_14_mod_1, only : f_string implicit none contains function get_ptr() result(r) type(c_ptr) :: r character(kind=c_char), target, save :: buf(6) buf = [ 'h','e','l','l','o', c_null_char ] r = c_loc(buf) end function get_ptr subroutine test() character(:), allocatable :: s s = f_string(get_ptr()) print *, s if (s /= "hello") then error stop "Wrong string returned" end if end subroutine test end module external_14_mod_2 program external_14 use external_14_mod_2 implicit none call test() end program external_14 lfortran-lfortran-2f73434/integration_tests/intrinsics_278.f900000664000175000017500000000206515141516316024510 0ustar alastairalastairprogram intrinsics_278 use iso_fortran_env, only: dp => real64, sp => real32 implicit none real, parameter :: x = tiny(1.0) real (kind = dp) :: b real (kind = dp), parameter :: y = tiny(b) real, parameter :: z = tiny([1.0_sp, 2.0_sp]) real(sp) :: r1 = 2.3_sp real(dp) :: r2 = 4.5_dp real(sp) :: ar1(3) = [1.0_sp, 2.0_sp, 3.0_sp] real(dp) :: ar2(3) = [4.0_dp, 5.0_dp, 6.0_dp] print*, x if (abs(x - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, y if (abs(y - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print*, z if (abs(z - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(r1) if (abs(tiny(r1) - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(r2) if (abs(tiny(r2) - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print*, tiny(ar1) if (abs(tiny(ar1) - 1.17549435e-38_sp) > 1e-6_sp) error stop print*, tiny(ar2) if (abs(tiny(ar2) - 2.2250738585072014e-308_dp) > 1e-6_dp) error stop print *, kind(tiny(1.0)) print *, kind(tiny(1.0_dp)) end program lfortran-lfortran-2f73434/integration_tests/template_array_03.f900000664000175000017500000000561215141516316025237 0ustar alastairalastairmodule template_array_03_math implicit none private public :: add_integer, zero_integer, add_real, zero_real, mult_integer, mult_real contains pure function add_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x + y end function pure function zero_integer(x) result(r) integer, intent(in) :: x integer :: r r = 0 end function pure function mult_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x * y end function pure function add_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y end function pure function zero_real(x) result(r) real, intent(in) :: x real :: r r = 0 end function pure function mult_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x * y end function end module module template_array_03_m use template_array_03_math implicit none private public :: test_template requirement operations(t, plus_t, zero_t, mult_t) type, deferred :: t pure function plus_t(l, r) result(result) type(t), intent(in) :: l, r type(t) :: result end function pure function zero_t(x) result(result) type(t), intent(in) :: x type(t) :: result end function pure function mult_t(l, r) result(result) type(t), intent(in) :: l, r type(t) :: result end function end requirement ! template array_tmpl(t, plus_t, zero_t, mult_t) require :: operations(t, plus_t, zero_t, mult_t) private public :: mymatmul_t contains subroutine mymatmul_t(i, j, k, a, b, r) integer, parameter, intent(in) :: i, j, k type(t), intent(in) :: a(i,j), b(j,k) type(t) :: r(i,k) integer :: x = 1, y = 1, z = 1 type(t) :: elem do x = 1, i do z = 1, k elem = zero_t(a(1,1)) do y = 1, j elem = plus_t(elem, mult_t(a(x,y), b(y,z))) end do r(x,z) = elem end do end do end subroutine end template contains subroutine test_template() integer :: arr(2,2) integer :: r(2,2) arr(1,1) = 1 arr(1,2) = 1 arr(2,1) = 0 arr(2,2) = 1 instantiate array_tmpl(integer, add_integer, zero_integer, mult_integer), & only: mymatmul_int => mymatmul_t call mymatmul_int(2, 2, 2, arr, arr, r) print *, r(1,1) print *, r(1,2) print *, r(2,1) print *, r(2,2) end subroutine end module program template_array_03 use template_array_03_m implicit none call test_template() end lfortran-lfortran-2f73434/integration_tests/array_03_transfer.f900000664000175000017500000000013015141516316025236 0ustar alastairalastairprogram array_03_transfer integer :: x = 21432 print *, transfer(x, 1.0) end programlfortran-lfortran-2f73434/integration_tests/string_92.f900000664000175000017500000000066515141516316023547 0ustar alastairalastairprogram string_92 implicit none call test_concat('Upper', 'Diag') print *, "PASS" contains subroutine test_concat(a, b) character, intent(in) :: a, b character(2) :: result result = a // b if (len(a) /= 1) error stop "len(a) should be 1" if (len(b) /= 1) error stop "len(b) should be 1" if (result /= 'UD') error stop "result should be 'UD'" end subroutine end program lfortran-lfortran-2f73434/integration_tests/class_51.f900000664000175000017500000000272415141516316023337 0ustar alastairalastairmodule class_51_mod type :: MyType integer :: value end type MyType contains function my_class_func() result(obj) class(MyType), allocatable :: obj allocate(obj) obj % value = 42 end function function my_type_func() result(obj) type(MyType), allocatable :: obj allocate(obj) obj % value = 37 end function function my_class_func_ptr() result(obj) class(MyType), pointer :: obj allocate(obj) obj % value = 42 end function function my_type_func_ptr() result(obj) type(MyType), pointer :: obj allocate(obj) obj % value = 37 end function end module class_51_mod program class_51 use class_51_mod implicit none class(MyType), allocatable :: my_class_var class(MyType), pointer :: my_class_var_ptr type(MyType), allocatable :: my_type_var type(MyType), pointer :: my_type_var_ptr my_class_var = my_class_func() print *, "my_class_var%value: ", my_class_var%value if (my_class_var%value /= 42) error stop my_type_var = my_type_func() print *, "my_type_var%value: ", my_type_var%value if (my_type_var%value /= 37) error stop my_class_var_ptr => my_class_func_ptr() print *, "my_class_var_ptr%value: ", my_class_var_ptr%value if (my_class_var_ptr%value /= 42) error stop my_type_var_ptr => my_type_func_ptr() print *, "my_type_var_ptr%value: ", my_type_var_ptr%value if (my_type_var_ptr%value /= 37) error stop end programlfortran-lfortran-2f73434/integration_tests/operator_overloading_17.f900000664000175000017500000000451215141516316026455 0ustar alastairalastairmodule operator_overloading_17_mod type, abstract :: base contains procedure(if_equal), deferred :: is_equal generic :: operator(==) => is_equal end type base abstract interface logical function if_equal(lhs, rhs) import base class(base), intent(in) :: lhs, rhs end function if_equal end interface type, extends(base) :: container integer :: x contains procedure :: is_equal => container_equal end type container type, public :: string_t character(len=:), allocatable :: str end type string_t interface operator(==) module procedure string_equal module procedure string_array_equal end interface operator(==) ! type :: derived_1 ! type(string_t), allocatable :: link(:) ! end type derived_1 contains logical function container_equal(lhs, rhs) class(base), intent(in) :: rhs class(container), intent(in) :: lhs container_equal = .false. select type(rhs) type is(container) container_equal = rhs%x == lhs%x end select end function container_equal logical function string_equal(a, b) type(string_t), allocatable, intent(in) :: a, b if (.not. allocated(a) .or. .not. allocated(b)) then string_equal = .false. return end if string_equal = (a%str == b%str) end function string_equal logical function string_array_equal(a, b) type(string_t), intent(in) :: a(:), b(:) integer :: i if (size(a) /= size(b)) then string_array_equal = .false. return end if string_array_equal = .true. do i = 1, size(a) if (a(i)%str /= b(i)%str) then string_array_equal = .false. return end if end do end function end module operator_overloading_17_mod program operator_overloading_17 use operator_overloading_17_mod type(string_t), allocatable :: a(:), other(:) type(string_t), allocatable :: x, y type(container) :: c1, c2 allocate(a(2), other(2)) a(1)%str = "hello" a(2)%str = "world" other(1)%str = "hello" other(2)%str = "world" if (.not. other == a) error stop allocate(x, y) x%str = "hello" y%str = "HelloWorld" if (x == y) error stop c1%x = 5 c2%x = 5 if (.not. c1 == c2) error stop c2%x = 6 if (c1 == c2) error stop associate(temp => a) if (.not. temp == other) error stop end associate end program operator_overloading_17 lfortran-lfortran-2f73434/integration_tests/expr_15.f900000664000175000017500000000051015141516316023177 0ustar alastairalastairprogram expr_15 implicit none integer :: x x = 25 print *, x if (x /= 25) error stop call abc(x) print *, x if (x /= 26) error stop contains subroutine abc(p) integer, intent(inout) :: p print *, p p = p + 1 print *, p end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_277.f900000664000175000017500000000305515141516316024507 0ustar alastairalastairprogram intrinsics_277 implicit none integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = xor(5, 8) integer, parameter :: i2 = xor(-1, 5) integer, parameter :: i3 = xor(-4_8, 2_8) integer(8), parameter :: i4 = xor(-2_8, 5_8) logical, parameter :: l1 = xor(.true., .false.) logical, parameter :: l2 = xor(.false., .false.) logical :: true = .true., false = .false. integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -6) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -5) error stop print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, xor(true, false) if (xor(true, false) .neqv. .true.) error stop print *, xor(false, false) if (xor(false, false) .neqv. .false.) error stop print*, xor(5, 8) if (xor(5, 8) /= 13) error stop print*, xor(-1, 5) if (xor(-1, 5) /= -6) error stop print*, xor(8, -4) if (xor(8, -4) /= -12) error stop print*, xor(-2, -5) if (xor(-2, -5) /= 5) error stop print*, xor(a1, a2) if (xor(a1, a2) /= 13) error stop print*, xor(a3, a4) if (xor(a3, a4) /= 3) error stop print*, xor(a2, a5) if (xor(a2, a5) /= -10) error stop print*, xor(a5, a6) if (xor(a5, a6) /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_60.f900000664000175000017500000000133515141516316023525 0ustar alastairalastairprogram openmp_60 use omp_lib implicit none integer :: sum , team_sums(4) = 0, local_sum=0 sum=0 !$omp teams num_teams(4) thread_limit(3) shared(team_sums) private(local_sum) reduction(+:sum) !$omp parallel shared(team_sums) private(local_sum) reduction(+:sum) local_sum = omp_get_thread_num() * 10 + omp_get_team_num() sum = sum + local_sum !$omp critical team_sums(omp_get_team_num() + 1) = team_sums(omp_get_team_num() + 1) + local_sum !$omp end critical !$omp end parallel !$omp end teams print*, team_sums print*,sum if(sum/=138) error stop if(team_sums(1) /= 30) error stop if(team_sums(2) /= 33) error stop if(team_sums(3) /= 36) error stop if(team_sums(4) /= 39) error stop end program openmp_60lfortran-lfortran-2f73434/integration_tests/enum_06_module.f900000664000175000017500000000026515141516316024541 0ustar alastairalastairmodule enum_06_mod_main implicit none enum, bind(C) enumerator :: red = 100 end enum end module module enum_06_mod_middle use enum_06_mod_main end module lfortran-lfortran-2f73434/integration_tests/intrinsics_337.f900000664000175000017500000000563015141516316024505 0ustar alastairalastairMODULE intrinsics_337_mod implicit none ! interface with same name as intrinsic 'dble' interface dble module procedure interface_dble_fun end interface ! interface with same name as intrinsic 'float' interface float module procedure interface_float_fun end interface ! interface with same name as intrinsic 'dfloat' interface dfloat module procedure interface_dfloat_fun end interface ! interface with same name as intrinsic 'shifta' interface shifta module procedure interface_shifta_fun end interface CONTAINS subroutine sub1() integer :: intg intg = 1 print *, dble(intg) if (abs(dble(intg) - 1.D0) > epsilon(1.D0)) error stop end subroutine sub1 subroutine sub2() integer :: intg intg = 1 print *, float(intg) if (abs(float(intg) - 1.0) > epsilon(1.0)) error stop end subroutine sub2 subroutine sub3() integer :: intg intg = 1 print *, dfloat(intg) if (abs(dfloat(intg) - 1.D0) > epsilon(1.D0)) error stop end subroutine sub3 subroutine sub4() integer :: intg intg = 1 print *, shifta(intg, intg) if (shifta(intg, intg) /= 0) error stop end subroutine sub4 doubleprecision function interface_dble_fun() interface_dble_fun = 5.0D0 end function interface_dble_fun double precision function interface_float_fun() interface_float_fun = 5.0D0 end function interface_float_fun double precision function interface_dfloat_fun() interface_dfloat_fun = 5.0D0 end function interface_dfloat_fun double precision function interface_shifta_fun() interface_shifta_fun = 5.0D0 end function interface_shifta_fun end module intrinsics_337_mod program intrinsics_337 use intrinsics_337_mod implicit none ! this call matches with intrinsic 'dble' print *, dble(1) if (abs(dble(1) - 1.D0) > epsilon(1.D0)) error stop ! this call matches with intrinsic 'float' print *, float(1) if (abs(float(1) - 1.0) > epsilon(1.0)) error stop ! this call matches with intrinsic 'dfloat' print *, dfloat(1) if (abs(dfloat(1) - 1.D0) > epsilon(1.D0)) error stop ! this call matches with intrinsic 'shifta' print *, shifta(1, 1) if (shifta(1, 1) /= 0) error stop ! this call matches with interface defined in module print *, dble() if (abs(dble() - 5.D0) > epsilon(1.D0)) error stop ! this call matches with interface defined in module print *, float() if (abs(float() - 5.0) > epsilon(1.0)) error stop ! this call matches with interface defined in module print *, dfloat() if (abs(dfloat() - 5.D0) > epsilon(1.D0)) error stop ! this call matches with interface defined in module print *, shifta() if (abs(shifta() - 5.D0) > epsilon(1.D0)) error stop call sub1() call sub2() call sub3() call sub4() end program intrinsics_337 lfortran-lfortran-2f73434/integration_tests/format_48.f900000664000175000017500000000042315141516316023522 0ustar alastairalastairprogram mre_read_string_fmt implicit none character(len=3) :: local_chars integer :: basevalue local_chars = "1 0" read(local_chars, "(bn,g3.0)") basevalue if (basevalue /= 10) error stop "wrong value" print *, "test passed" end program mre_read_string_fmt lfortran-lfortran-2f73434/integration_tests/file_overwrite.f900000664000175000017500000000063215141516316024746 0ustar alastairalastairprogram overwrite_with_rec use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y ,z x = 654321 z = 456465 open(10, file="file_overwrite.bin", access="direct", recl=4) write(10, rec=1) x write(10,rec=1) z close(10) open(10, file="file_overwrite.bin", access="direct", recl=4) read(10, rec=1) y close(10) if (y /= z) error stop end program lfortran-lfortran-2f73434/integration_tests/arrayitem_01.f900000664000175000017500000000045115141516316024215 0ustar alastairalastairmodule arrayitem_module_01 type :: block_1 integer :: a, c(5) end type type(block_1) :: struct_instance_block_1 end module program arrayitem_01 use arrayitem_module_01 struct_instance_block_1%c(1) = 19 if (struct_instance_block_1%c(1) /= 19) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_15.f900000664000175000017500000001334315141516316023701 0ustar alastairalastairprogram modules_15 use iso_fortran_env, only: sp=>real32, dp=>real64, int32, int64 use modules_15b, only: & f_int_float, f_int_double, & sub_int_float, sub_int_double, & f_int_float_value, f_int_double_value, & sub_int_float_value, sub_int_double_value, & f_int_intarray, f_int_floatarray, f_int_doublearray, & f_int_intarray_star, f_int_floatarray_star, f_int_doublearray_star, & sub_int_intarray, sub_int_floatarray, sub_int_doublearray, & f_int_float_complex, f_int_double_complex, & f_int_float_complex2, f_int_double_complex2, & sub_int_float_complex, sub_int_double_complex, & f_int_float_complex_value, f_int_double_complex_value, & sub_int_float_complex_value, sub_int_double_complex_value, & f_float_complex_value_return, f_double_complex_value_return, & f_int_double_value_name, & sub_int_double_value_name, & f_string, & call_fortran_i32, call_fortran_i64, & call_fortran_f32, call_fortran_f64, & call_fortran_i32_value, call_fortran_i64_value, & call_fortran_i32_value2, call_fortran_i64_value2, & call_fortran_f32_value, call_fortran_f64_value implicit none integer :: i, a, n, I32(3) integer(int32) :: in32 integer(int64) :: in64 real(sp) :: r32, X32(3) real(dp) :: r64, X64(3) complex(sp) :: c32 complex(dp) :: c64 a = 3 r32 = 5 i = f_int_float(a, r32) print *, i if (i /= 8) error stop a = 3 r32 = 5 call sub_int_float(a, r32, i) print *, i if (i /= 8) error stop a = 3 r64 = 5 i = f_int_double(a, r64) print *, i if (i /= 8) error stop a = 3 r64 = 5 call sub_int_double(a, r64, i) print *, i if (i /= 8) error stop a = 3 c32 = (5._sp, 7._sp) i = f_int_float_complex(a, c32) print *, i if (i /= 15) error stop i = f_int_float_complex2(a, c32) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) call sub_int_float_complex(a, c32, i) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) i = f_int_float_complex_value(a, c32) print *, i if (i /= 15) error stop c32 = (5._sp, 7._sp) i = f_int_float_complex_value(3, c32) print *, i if (i /= 15) error stop a = 3 c32 = (5._sp, 7._sp) call sub_int_float_complex_value(a, c32, i) print *, i if (i /= 15) error stop c32 = (5._sp, 7._sp) c32 = f_float_complex_value_return(c32) print *, c32 if (abs(real(c32,sp) - 10) > 1e-5_sp) error stop !if (abs(aimag(c32) - 14) > 1e-5_sp) error stop c64 = (5._dp, 7._dp) c64 = f_double_complex_value_return(c64) print *, c64 if (abs(real(c64,dp) - 10) > 1e-10_dp) error stop !if (abs(aimag(c64) - 14) > 1e-10_dp) error stop a = 3 c64 = (5._dp, 7._dp) i = f_int_double_complex(a, c64) print *, i if (i /= 15) error stop i = f_int_double_complex2(a, c64) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) call sub_int_double_complex(a, c64, i) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) i = f_int_double_complex_value(a, c64) print *, i if (i /= 15) error stop a = 3 c64 = (5._dp, 7._dp) call sub_int_double_complex_value(a, c64, i) print *, i if (i /= 15) error stop a = 3 r32 = 5 i = f_int_float_value(a, r32) print *, i if (i /= 8) error stop a = 3 r32 = 5 call sub_int_float_value(a, r32, i) print *, i if (i /= 8) error stop a = 3 r64 = 5 i = f_int_double_value(a, r64) print *, i if (i /= 8) error stop i = f_int_double_value_name(a, r64) print *, i if (i /= 8) error stop a = 3 r64 = 5 call sub_int_double_value(a, r64, i) print *, i if (i /= 8) error stop call sub_int_double_value_name(a, r64, i) print *, i if (i /= 8) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 i = f_int_intarray(n, I32) print *, i if (i /= 6) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 call sub_int_intarray(n, I32, i) print *, i if (i /= 6) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp r32 = f_int_floatarray(n, X32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp call sub_int_floatarray(n, X32, r32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp r64 = f_int_doublearray(n, X64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop n = 3 I32(1) = 1 I32(2) = 2 I32(3) = 3 i = f_int_intarray_star(n, I32) print *, i if (i /= 6) error stop n = 3 X32(1) = 1.1_dp X32(2) = 2.2_dp X32(3) = 3.3_dp r32 = f_int_floatarray_star(n, X32) print *, r32 if (abs(r32 - 6.6_sp) > 1e-5_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp r64 = f_int_doublearray_star(n, X64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop n = 3 X64(1) = 1.1_dp X64(2) = 2.2_dp X64(3) = 3.3_dp call sub_int_doublearray(n, X64, r64) print *, r64 if (abs(r64 - 6.6_dp) > 1e-10_dp) error stop print *, f_string("123") if (f_string("123") /= 3) error stop print *, f_string("abcde") if (f_string("abcde") /= 5) error stop print *, f_string(" ") if (f_string(" ") /= 1) error stop print *, f_string("") if (f_string("") /= 0) error stop ! Calling Fortran code from C in32 = 5 in32 = call_fortran_i32(in32) print *, in32 if (in32 /= 7) error stop in32 = 5 in32 = call_fortran_i32_value(in32) print *, in32 if (in32 /= 7) error stop in32 = 5 in32 = call_fortran_i32_value2(in32) print *, in32 if (in32 /= 7) error stop in64 = 5 in64 = call_fortran_i64(in64) print *, in64 if (in64 /= 7) error stop in64 = 5 in64 = call_fortran_i64_value(in64) print *, in64 if (in64 /= 7) error stop in64 = 5 in64 = call_fortran_i64_value2(in64) print *, in64 if (in64 /= 7) error stop r32 = 5 r32 = call_fortran_f32(r32) print *, r32 if (abs(r32 - 7.3_sp) > 1e-5_dp) error stop r32 = 5 r32 = call_fortran_f32_value(r32) print *, r32 if (abs(r32 - 7.3_sp) > 1e-5_dp) error stop r64 = 5 r64 = call_fortran_f64(r64) print *, r64 if (abs(r64 - 7.3_dp) > 1e-10_dp) error stop r64 = 5 r64 = call_fortran_f64_value(r64) print *, r64 if (abs(r64 - 7.3_dp) > 1e-10_dp) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_65.f900000664000175000017500000000207715141516316024425 0ustar alastairalastairprogram intrinsics_65 implicit none integer :: arr_01(20) = [995, -697, 90, -514, 0, -777, 664, -15, 401, -348, & 269, -94, 534, 806, -23, 844, 0, -114, 673, -445] integer :: a_01(4, 3), a_02(3) integer, allocatable :: a_03(:) integer :: b_01(3, 4), b_02(3), res_01(4) real :: c_01(3, 5), res_02(4, 5) allocate(a_03(3)) a_01 = reshape(arr_01, shape(a_01)) b_01 = reshape(arr_01, shape(b_01)) c_01 = reshape(real(arr_01), shape(c_01)) a_02 = a_01(1, :) a_03 = a_01(2, :) b_02 = b_01(:, 3) print *, sum(matmul(a_01, b_01)) if (sum(matmul(a_01, b_01)) /= -130358) error stop res_01 = matmul(a_01, b_02) + 2 * matmul(a_02, b_01) print *, size(res_01), res_01 if (size(res_01) /= 4) error stop res_02 = matmul(a_01, c_01) if (res_01(1) /= 2873711) error stop if (res_02(1, 1) /= a_01(1, 1) * c_01(1, 1) & + a_01(1, 2) * c_01(2, 1) & + a_01(1, 3) * c_01(3, 1) ) error stop res_01 = matmul(a_02, b_01) if (res_01(1) /= res_02(1, 1)) error stop end program intrinsics_65 lfortran-lfortran-2f73434/integration_tests/intrinsics_69.f900000664000175000017500000000147515141516316024432 0ustar alastairalastairprogram intrinsics_69 implicit none integer, parameter :: a1 = radix(3) integer, parameter :: a2 = radix(1.12) integer, parameter :: a3 = radix([1, 2, 3]) integer, parameter :: a4 = radix([1.5, 21.12, 3.53]) integer :: x1 = 1 real :: x2 = 22.13 integer :: y1(2) = [1, 2] real :: y2(2) = [2., 4.] print *, a1 if (a1 /= 2) error stop print *, a2 if (a2 /= 2) error stop print *, a3 if (a3 /= 2) error stop print *, a4 if (a4 /= 2) error stop print *, radix(3) if (radix(3) /= 2) error stop print *, radix(x1) if (radix(x1) /= 2) error stop print *, radix(y1) if (radix(y1) /= 2) error stop print *, radix(x2) if (radix(x2) /= 2) error stop print *, radix(y2) if (radix(y2) /= 2) error stop end program intrinsics_69 lfortran-lfortran-2f73434/integration_tests/elemental_14.f900000664000175000017500000000174615141516316024202 0ustar alastairalastairmodule elemental_14_mod implicit none type :: number_t real :: val contains procedure :: is_positive end type number_t type :: dec type(number_t), allocatable :: nums(:) end type contains elemental logical function is_positive(self) class(number_t), intent(in) :: self is_positive = self%val > 0.0 end function is_positive end module elemental_14_mod program elemental_14 use elemental_14_mod implicit none type(number_t), dimension(5) :: nums type(dec) :: ele logical :: result integer :: i nums(1)%val = -1.0 nums(2)%val = -2.0 nums(3)%val = -3.0 nums(4)%val = -5.0 nums(5)%val = -6.0 result = any(nums%is_positive()) if (result .neqv. .false.) error stop nums(1)%val = 1.0 result = any(nums%is_positive()) if (result .neqv. .true.) error stop allocate(ele%nums(2)) ele%nums(2)%val = -1.0 ele%nums(1)%val = -1.0 result = any(ele%nums%is_positive()) if (result .neqv. .false.) error stop end program elemental_14lfortran-lfortran-2f73434/integration_tests/block_07.f900000664000175000017500000000127615141516316023326 0ustar alastairalastairprogram main implicit none integer :: i, j i = 0 j = 0 test: block outer : do i = i + 1 inner : do j = j + 1 if ( j == 3 ) then exit test end if if (j == 5) then print *, j exit inner end if end do inner print *, "out of inner loop" if ( i == 2 ) then exit outer end if end do outer print *, "out of outer loop" end block test if (i /= 1) error stop if (j /= 3) error stop print *, "out of test block" end program lfortran-lfortran-2f73434/integration_tests/data_13.f900000664000175000017500000000074015141516316023135 0ustar alastairalastairprogram data_13 implicit none integer, parameter :: k = 3 integer :: i, iarx(k), iary(2*k) data(iarx(i), i=1, k) / 1, 2, 3 / print *, iarx(1) if (iarx(1) /= 1) error stop print *, iarx(2) if (iarx(2) /= 2) error stop print *, iarx(3) if (iarx(3) /= 3) error stop data(iary(i), i=1, 2*k, 2) / 1, 3, 5 / data(iary(i), i=2, 2*k, 2) / 2, 4, 6 / print *, iary if (any(iary /= [1, 2, 3, 4, 5, 6])) error stop end program data_13 lfortran-lfortran-2f73434/integration_tests/intrinsics_205.f900000664000175000017500000001143115141516316024473 0ustar alastairalastairprogram intrinsics_205 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(sp) :: x,y,z real(dp) :: k,l,m real(dp) :: w(19) real(dp) :: res_w(19) real(dp) :: expected_w(19) real(sp) :: expected_u(19) real(dp), parameter :: res(19) = acosd([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_1(19) = acosd([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004_sp, -0.999000_sp, & -0.998501_sp, -0.998001_sp, -0.997_sp, & -0.997002_sp, -0.99650_sp, -0.99600_sp, & -0.9955_sp, -0.99500_sp, -0.99450_sp, & -0.99400_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] expected_w = [71.276588577307763_dp, 58.264412814183842_dp, 43.281012002417114_dp, & 108.72341142269225_dp, 121.73558718581616_dp, 136.718987997582900_dp, & 180.0_dp, 178.18897822198568_dp, 177.43872179938884_dp, & 176.86295702294953_dp, 176.377503905344_dp, 175.94975751498464_dp, & 175.5629967823349_dp, 175.20728904760477_dp, 174.87616290603896_dp, & 174.5651234927047_dp, 174.27089826020691_dp, 173.99101680223387_dp, & 173.72355993833804_dp] expected_u = [71.2765884_sp, 58.2644081_sp, 43.2810135_sp, & 108.723404_sp, 121.735596_sp, 1.36718994e+02_sp, & 180.0_sp, 178.188782_sp, 177.437454_sp, & 1.76862442e+02_sp, 176.376556_sp, 175.560760_sp, & 175.562256_sp, 175.204895_sp, 174.873581_sp, & 174.562424_sp, 174.268036_sp, 173.987991_sp, & 173.720413_sp] res_w = acosd(w) do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, res_w(i) if (abs(res_w(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_1) print *, res_1(i) if (abs(res_1(i) - expected_u(i)) > 1e-4_sp) error stop end do x = 0.123 y = 0.876 z = 0.542 k = 0.1237382_dp l = 0.8767382_dp m = 0.5427382_dp print *, acosd(x) if (acosd(x) - 8.29347229e+01 > 1e-5) error stop print *, acosd(y) if (acosd(y) - 2.88364525e+01 > 1e-5) error stop print *, acosd(z) if (acosd(z) - 5.71801071e+01 > 1e-5) error stop print *, acosd(0.123_sp) if (acosd(0.123_sp) - 8.29347229e+01 > 1e-5) error stop print *, acosd(0.876_sp) if (acosd(0.876_sp) - 2.88364525e+01 > 1e-5) error stop print *, acosd(0.542_sp) if (acosd(0.542_sp) - 5.71801071e+01 > 1e-5) error stop print *, acosd(k) if (acosd(k) - 8.29347229e+01 > 1e-12) error stop print *, acosd(l) if (acosd(l) - 2.88364525e+01 > 1e-12) error stop print *, acosd(m) if (acosd(m) - 5.71801071e+01 > 1e-12) error stop print *, acosd(0.1237382_dp) if (acosd(0.1237382_dp) - 8.29347229e+01 > 1e-12) error stop print *, acosd(0.8767382_dp) if (acosd(0.8767382_dp) - 2.88364525e+01 > 1e-12) error stop print *, acosd(0.5427382_dp) if (acosd(0.5427382_dp) - 5.71801071e+01 > 1e-12) error stop x = -0.123 y = -0.876 z = -0.542 k = -0.1237382_dp l = -0.8767382_dp m = -0.5427382_dp print *, acosd(x) if (acosd(x) - 9.70652695e+01 > 1e-5) error stop print *, acosd(y) if (acosd(y) - 1.51163544e+02 > 1e-5) error stop print *, acosd(z) if (acosd(z) - 1.22819893e+02 > 1e-5) error stop print *, acosd(-0.123_sp) if (acosd(-0.123_sp) - 9.70652695e+01 > 1e-5) error stop print *, acosd(-0.876_sp) if (acosd(-0.876_sp) - 1.51163544e+02 > 1e-5) error stop print *, acosd(-0.542_sp) if (acosd(-0.542_sp) - 1.22819893e+02 > 1e-5) error stop print *, acosd(k) if (acosd(k) - 9.71078942667026581e+01_dp > 1e-12) error stop print *, acosd(l) if (acosd(l) - 1.51251363283139312e+02_dp > 1e-12) error stop print *, acosd(m) if (acosd(m) - 1.22870235241297351e+02_dp > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/namelist_20.f900000664000175000017500000000063415141516316024040 0ustar alastairalastairprogram test_namelist_internal_derived_list implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot character(len=:), allocatable :: line namelist /nml_dot/ dot line = '&nml_dot dot=1,2 /' read(line, nml=nml_dot) if (dot%x /= 1) error stop if (dot%y /= 2) error stop end program test_namelist_internal_derived_list lfortran-lfortran-2f73434/integration_tests/int_01.f900000664000175000017500000000015715141516316023015 0ustar alastairalastairprogram int_01 real, parameter :: x = 3.3 integer, parameter :: y = 7 print*, int(x), int(y) end program lfortran-lfortran-2f73434/integration_tests/reserved_01.f900000664000175000017500000000045415141516316024042 0ustar alastairalastairprogram reserved_01 implicit none if (end(1, 2) /= 2) error stop if (end(2, 1) /= 2) error stop contains integer function end(return,& integer)result(function);;;;& integer integer,return;;;;;;& ;;function=return;if(return>& integer)return;;;;;function=& integer;;end function end;;;; end program lfortran-lfortran-2f73434/integration_tests/character_01.f900000664000175000017500000000040215141516316024150 0ustar alastairalastairprogram character_01 CHARACTER A*4, B*4, C(2)*3 CHARACTER, parameter :: D*3 = "ape" CHARACTER(len=3) :: E(2) = "apel" A = 'ABCD' B = 'EFGH' C(1) = 'IJK' C(2) = 'LMN' print *, A, B, C(1), C(2) print *, D print *, E end program lfortran-lfortran-2f73434/integration_tests/intrinsics_286.f900000664000175000017500000001170415141516316024507 0ustar alastairalastairprogram intrinsics_286 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = atanh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 0.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = atanh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 0.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.73841779693335385_dp, -0.57258300054508338_dp, -0.30137681412533290_dp, & 0.73841779693335385_dp, 0.57258300054508338_dp, 0.30137681412533290_dp, 0.00_dp, & 1.1860917289062738_dp, 1.8604043450053602_dp, -0.24650045327602343_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.738417745_sp, -0.572582960_sp, -0.301376820_sp, & 0.738417745_sp, 0.572582960_sp, 0.301376820_sp, 0.00_sp, 1.18609166_sp, 1.86040413_sp, & -0.246500462_sp] res_x = atanh(arg_x) res_y = atanh(arg_y) expected_res_x = [-0.82766923654327862_dp, -0.60930676235179848_dp, -0.30613348538306767_dp, & 0.82766923655073721_dp, 0.60930676235179848_dp, 0.30613348538306767_dp, 0.64870320764593825_dp, & 7.8124828806607219E-002_dp, 0.26831157000093397_dp, -0.24906695687441660_dp, -0.92480545603497655_dp, & 0.64870320764593825_dp, 7.8124828806607219E-002_dp, 0.26831157000093397_dp, -0.24906695687441660_dp] expected_res_y = [-0.827669144_sp, -0.609306693_sp, -0.306133479_sp, & 0.827669144_sp, 0.609306693_sp, 0.306133479_sp, 0.648703277_sp, & 7.81248063E-02_sp, 0.268311530_sp, -0.249066964_sp, -0.924805462_sp, & 0.648703277_sp, 7.81248063E-02_sp, 0.268311530_sp, -0.249066964_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, atanh(a) if (abs(atanh(a)) - 0.57335387425222428_dp > 1e-12) error stop print *, atanh(0.5178181202_dp) if (abs(atanh(0.5178181202_dp) - 0.57335387425222428_dp) > 1e-12) error stop print *, atanh(b) if (atanh(b) - (-7.29451030E-02_sp) > 1e-5) error stop print *, atanh(-0.072816_sp) if (atanh(-0.072816_sp) - (-7.29451030E-02_sp) > 1e-5) error stop print *, atanh(c) if (atanh(c) - (-0.57335387425222428_dp) > 1e-12) error stop print *, atanh(-0.5178181202_dp) if (atanh(-0.5178181202_dp) - (-0.57335387425222428_dp) > 1e-12) error stop print *, atanh(d) if (atanh(d) - (7.29451030E-02_sp) > 1e-5) error stop print *, atanh(0.072816_sp) if (atanh(0.072816_sp) - (7.29451030E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, atanh(a) if (abs(atanh(a) - (-0.27894383144663687_dp)) > 1e-12) error stop print *, atanh(-0.271927291_dp) if (abs(atanh(-0.271927291_dp) - (-0.27894383144663687_dp)) > 1e-12) error stop print *, atanh(b) if (atanh(b) - (0.755253792_sp) > 1e-5) error stop print *, atanh(-0.6382728_sp) if (atanh(-0.6382728_sp) - (0.755253792_sp) > 1e-5) error stop print *, atanh(c) if (atanh(c) - (0.27894383144663687_dp) > 1e-12) error stop print *, atanh(0.271927291_dp) if (atanh(0.271927291_dp) - (0.27894383144663687_dp) > 1e-12) error stop print *, atanh(d) if (atanh(d) - (0.755253792_sp) > 1e-5) error stop print *, atanh(0.6382728_sp) if (atanh(0.6382728_sp) - (0.755253792_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_27.f900000664000175000017500000000225015141516316023525 0ustar alastairalastairprogram openmp_27 use omp_lib implicit none real ( kind = 8 ) :: factor integer ( kind = 4 ) :: n, i real ( kind = 8 ) wtime real ( kind = 8 ), allocatable, dimension ( : ) :: x real ( kind = 8 ) :: xdoty real ( kind = 8 ), allocatable, dimension ( : ) :: y n = 100 do while ( n < 1000000 ) n = n * 10 allocate ( x(1:n) ) allocate ( y(1:n) ) factor = real ( n, kind = 8 ) factor = 1.0D+00 / sqrt ( 2.0D+00 * factor * factor + 3 * factor + 1.0D+00 ) do i = 1, n x(i) = i * factor end do do i = 1, n y(i) = i * 6 * factor end do call test02( n, x, y, xdoty ) deallocate ( x ) deallocate ( y ) end do end program subroutine test02 ( n, x, y, xdoty ) use omp_lib implicit none integer n integer ( kind = 4 ) i real ( kind = 8 ) xdoty real ( kind = 8 ) x(n) real ( kind = 8 ) y(n) real ( kind = 8 ) wtime xdoty = 0.0D+00 wtime = omp_get_wtime() !$omp parallel shared(x, y) private(i) reduction(+:xdoty) !$omp do do i = 1, n xdoty = xdoty + x(i) * y(i) end do !$omp end do !$omp end parallel wtime = omp_get_wtime() - wtime print *, 'Parallel ', n, xdoty, wtime if (abs(xdoty - n) > 1e-8) error stop return end lfortran-lfortran-2f73434/integration_tests/derived_types_67.f900000664000175000017500000000222115141516316025077 0ustar alastairalastairmodule derived_types_67_type_mod implicit none private public :: my_type, my_val type :: my_val end type type, extends(my_val) :: my_type integer :: x end type end module derived_types_67_type_mod module derived_types_67_cast_utils use derived_types_67_type_mod, only: my_type, my_val implicit none private public :: cast_to_my_type, my_type, my_val contains function cast_to_my_type(obj) result(p) class(my_val), intent(in), target :: obj type(my_type), pointer :: p select type(obj) class is(my_type) p => obj end select end function cast_to_my_type end module derived_types_67_cast_utils program derived_types_67 use derived_types_67_cast_utils, only: temp_my_type => my_type, my_val, cast_to_my_type implicit none class(my_val), allocatable :: j_value type(temp_my_type), pointer :: ptr allocate(temp_my_type :: j_value) select type(j_value) class is(temp_my_type) j_value%x = 42 end select ptr => cast_to_my_type(j_value) if (ptr%x /= 42) error stop end program derived_types_67 lfortran-lfortran-2f73434/integration_tests/custom_operator_09.f900000664000175000017500000000157715141516316025467 0ustar alastairalastairmodule custom_operator_09_mod implicit none type string_t character(:), allocatable :: value contains procedure, private, pass(rhs) :: character_cat_string_t generic :: operator(//) => character_cat_string_t end type string_t contains elemental function character_cat_string_t(lhs, rhs) result(lhs_cat_rhs) character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs type(string_t) :: lhs_cat_rhs lhs_cat_rhs % value = lhs // rhs % value end function character_cat_string_t end module custom_operator_09_mod program custom_operator_09 use custom_operator_09_mod implicit none type(string_t) :: name_obj, greeting_obj character(len=10) :: prefix name_obj%value = "world!" prefix = "hello, " greeting_obj = prefix // name_obj if (greeting_obj%value /= "hello, world!") error stop end program custom_operator_09 lfortran-lfortran-2f73434/integration_tests/openmp_69.f900000664000175000017500000000072715141516316023542 0ustar alastairalastairprogram openmp_69 use omp_lib implicit none integer :: flags(4) integer :: i flags = 0 !$omp parallel num_threads(4) private(i) i = omp_get_thread_num() !$omp critical flags(i+1) = 1 !$omp end critical !$omp end parallel do i = 1, 4 if (flags(i) /= 1) then print *, 'Error: Thread ', i-1, ' did not execute!' error stop end if end do print *, 'Test passed: num_threads(', 4, ') used correctly.' end program openmp_69 lfortran-lfortran-2f73434/integration_tests/intrinsics_400.f900000664000175000017500000000101415141516316024464 0ustar alastairalastairprogram intrinsics_400 use, intrinsic :: iso_fortran_env, only : compiler_version, compiler_options implicit none character(len=:), allocatable :: cv, co cv = compiler_version() co = compiler_options() print *, "Fortran Compiler Version: ", cv print *, "Fortran Compiler Options: ", co if (len(cv) == 0) error stop ! if (len(co) == 0) error stop ! The output of compiler options can be empty (gfortran outputs platform dependent options) end program intrinsics_400lfortran-lfortran-2f73434/integration_tests/select_rank_11.f900000664000175000017500000000101015141516316024503 0ustar alastairalastairprogram select_rank_11 implicit none call check_scalar(5, 0) print *, "All tests passed" contains subroutine check_scalar(x, expected) integer, intent(in) :: x(..) integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop "Expected rank 0 for scalar" rank default error stop "Unexpected rank for scalar input" end select end subroutine check_scalar end program select_rank_11 lfortran-lfortran-2f73434/integration_tests/expr_08.f900000664000175000017500000000037315141516316023210 0ustar alastairalastairprogram expr_08 implicit none integer, parameter :: dp = kind(0.d0) real :: x4, y4 real(dp) :: x, y y4 = 3 x4 = y4 ** 2 print *, y4, x4 if (abs(x4 - 9) > 1e-6) error stop y = 3 x = y**2 print *, y, x if (abs(x - 9) > 1e-12_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/select_rank_03.f900000664000175000017500000000113615141516316024515 0ustar alastairalastairprogram select_rank_03 implicit none integer :: a(2) = [4, 2] integer :: b(2, 2) = reshape([1, 2, 3, 4], [2, 2]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) select rank(x) rank (1) l1 = minloc(x) print *, l1 if (l1(1) /= 2) error stop rank (2) l2 = minloc(x) print *, l2 if (any(l2 /= [1, 1])) error stop end select end subroutine check end program select_rank_03 lfortran-lfortran-2f73434/integration_tests/format_47.f900000664000175000017500000000036615141516316023527 0ustar alastairalastairprogram format_47 implicit none integer :: i1, i2 character(8) :: cdata cdata = '1 1 ' read (cdata, 100) i1, i2 if (i1 /= 1) error stop if (i2 /= 1000) error stop 100 format (bn, i4, bz, i4) end program format_47lfortran-lfortran-2f73434/integration_tests/openmp_40.f900000664000175000017500000000027015141516316023520 0ustar alastairalastairprogram openmp_40 integer :: i, j, res=0 do concurrent ( i =1:4, j = 1:3 ) reduce(+:res) print *,i res=res+1 end do print *,"res =",res if ( res /= 12 ) error stop end programlfortran-lfortran-2f73434/integration_tests/read_24.f900000664000175000017500000000041115141516316023134 0ustar alastairalastairprogram read_nan_string implicit none character(len=3) :: nan_string character(len=6) :: frmt real :: valu nan_string = 'NaN' frmt = '(f3.3)' read(nan_string, frmt) valu if (valu == valu) error stop print *, 'PASS' end program read_nan_string lfortran-lfortran-2f73434/integration_tests/intrinsics_260.f900000664000175000017500000000511015141516316024471 0ustar alastairalastairprogram intrinsics_260 implicit none integer(4), parameter :: i1 = sum([1, 2, 3]) real(4), parameter :: i2 = sum([1.0, 2.0, 3.0]) complex(4), parameter :: i3 = sum([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) integer(8), parameter :: i4 = sum([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i5 = sum([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) complex(8), parameter :: i6 = sum([(1.5_8, 2.2_8), (22.9_8, 1.4_8), (3.0_8, 1.1_8)], mask = [.true., .false., .true.]) integer(4), parameter :: i7 = sum([11, 2, 5], 1, [.true., .false., .true.]) real(4), parameter :: i8 = sum([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) complex(4), parameter :: i9 = sum([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], dim = 1, mask = [.true., .false., .true.]) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] complex(4) :: ar3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 6) error stop print *, i2 if (abs(i2 - 6.0) > 1e-6) error stop print *, i3 if (abs(i3 - (9.0, 12.0)) > 1e-6) error stop print *, i4 if (i4 /= 6) error stop print *, i5 if (abs(i5 - 4.5_8) > 1e-12) error stop print *, i6 if (abs(i6 - (4.5000000000000000, 3.3000000000000003)) > 1e-6) error stop print *, i7 if (i7 /= 16) error stop print *, i8 if (abs(i8 - 5.69000015e+01) > 1e-6) error stop print *, i9 if (abs(i9 - (6.0, 8.0)) > 1e-6) error stop print *, sum(ar1) if (sum(ar1) /= 19) error stop print *, sum(ar2) if (abs(sum(ar2) - 20.3) >1e-6 ) error stop print *, sum(ar3) if (abs(sum(ar3) - (16.0, 20.0)) > 1e-6) error stop print *, sum(ar1, mask = mask) if (sum(ar1, mask = mask) /= 17) error stop print *, sum(ar2, mask) if (abs(sum(ar2, mask) - 17.2) > 1e-6) error stop print *, sum(ar3, mask = mask) if (abs(sum(ar3, mask = mask) - (13.0, 16.0)) > 1e-6) error stop print *, sum(ar1, dim) if (sum(ar1, dim) /= 19) error stop print *, sum(ar2, dim = dim) if (abs(sum(ar2, dim = dim) - 20.3) > 1e-6) error stop print *, sum(ar3, dim) if (abs(sum(ar3, dim) - (16.0, 20.0)) > 1e-6) error stop print *, sum(ar1, mask = mask, dim = dim) if (sum(ar1, mask = mask, dim = dim) /= 17) error stop print *, sum(ar2, dim, mask) if (abs(sum(ar2, dim, mask) - 17.2) > 1e-6) error stop print *, sum(ar3, mask = mask, dim = dim) if (abs(sum(ar3, mask = mask, dim = dim) - (13.0, 16.0)) > 1e-6) error stop end programlfortran-lfortran-2f73434/integration_tests/nested_08.f900000664000175000017500000000115115141516316023507 0ustar alastairalastairmodule nested_08_testmod_der1 private public fcn contains subroutine fcn(x, fvec) real, intent(in) :: x(3) real, intent(out) :: fvec(15) integer :: i do i = 1, 3 fvec(i) = x(1) /( x(2) + x(3) ) end do do i = 1, 3 if (fvec(i) /= 0.5) error stop end do end subroutine end module program example_lmder1 use nested_08_testmod_der1, only: fcn real :: x(3), fvec(15) ! The following starting values provide a rough fit. x = [1.0, 1.0, 1.0] call check_deriv(x, fvec) contains subroutine check_deriv(x, fvec) real, intent(in) :: x(3) real, intent(out) :: fvec(15) call fcn(x, fvec) end subroutine end program lfortran-lfortran-2f73434/integration_tests/string_16.f900000664000175000017500000000707515141516316023545 0ustar alastairalastairprogram string_16 implicit none character, parameter :: exclamation_1 = achar(33) character, parameter :: dollar_1 = achar(36) character, parameter :: left_parenthesis_1 = achar(40) character, parameter :: plus_1 = achar(43) character, parameter :: zero_1 = achar(48) character, parameter :: nine_1 = achar(57) character, parameter :: semicolon_1 = achar(59) character, parameter :: capital_a_1 = achar(65) character, parameter :: capital_z_1 = achar(90) character, parameter :: right_bracket_1 = achar(93) character, parameter :: small_a_1 = achar(97) character, parameter :: small_z_1 = achar(122) character, parameter :: right_brace_1 = achar(125) character, parameter :: str_i8 = achar(125_8) character, parameter :: ar1(5) = achar([33, 36, 40, 43, 48]) character, parameter :: ar2(5) = achar([57, 59, 65, 90, 93], 1) character :: exclamation character :: dollar character :: left_parenthesis character :: plus character :: zero character :: nine character :: semicolon character :: capital_a character :: capital_z character :: right_bracket character :: small_a character :: small_z character :: right_brace integer :: a1 = 35 integer(8) :: a3 = 12872_8 integer :: a2(3) = [39, 63, 66] exclamation = achar(33) dollar = achar(36) left_parenthesis = achar(40) plus = achar(43) zero = achar(48) nine = achar(57) semicolon = achar(59) capital_a = achar(65) capital_z = achar(90) right_bracket = achar(93) small_a = achar(97) small_z = achar(122) right_brace = achar(125) print *, exclamation_1 if (exclamation_1 /= '!') error stop print *, dollar_1 if (dollar_1 /= '$') error stop print *, left_parenthesis_1 if (left_parenthesis_1 /= '(') error stop print *, plus_1 if (plus_1 /= '+') error stop print *, zero_1 if (zero_1 /= '0') error stop print *, nine_1 if (nine_1 /= '9') error stop print *, semicolon_1 if (semicolon_1 /= ';') error stop print *, capital_a_1 if (capital_a_1 /= 'A') error stop print *, capital_z_1 if (capital_z_1 /= 'Z') error stop print *, right_bracket_1 if (right_bracket_1 /= ']') error stop print *, small_a_1 if (small_a_1 /= 'a') error stop print *, small_z_1 if (small_z_1 /= 'z') error stop print *, right_brace_1 if (right_brace_1 /= '}') error stop print *, str_i8 if (str_i8 /= '}') error stop print *, ar1 if (any(ar1 /= ['!', '$', '(', '+', '0'])) error stop print *, ar2 if (any(ar2 /= ['9', ';', 'A', 'Z', ']'])) error stop print*, achar(65) if (achar(65) /= 'A') error stop print*, achar(a1) if (achar(a1) /= '#') error stop print*, achar(a2) if (achar(a2(1)) /= "'") error stop if (achar(a2(2)) /= '?') error stop if (achar(a2(3)) /= 'B') error stop print *, achar(a3) if (achar(a3) /= 'H') error stop if(exclamation /= '!') error stop if(dollar /= '$') error stop if(left_parenthesis /= '(') error stop if(plus /= '+') error stop if(zero /= '0') error stop if(nine /= '9') error stop if(semicolon /= ';') error stop if(capital_a /= 'A') error stop if(capital_z /= 'Z') error stop if(right_bracket /= ']') error stop if(small_a /= 'a') error stop if(small_z /= 'z') error stop if(right_brace /= '}') error stop print *, exclamation, dollar, left_parenthesis, plus, zero, nine, semicolon print *, capital_a, capital_z, right_bracket, small_a, small_z, right_brace end program lfortran-lfortran-2f73434/integration_tests/minpack_01_module.f900000664000175000017500000000030515141516316025205 0ustar alastairalastairmodule minpack_01 implicit none public interface double precision function enorm1(n) result(y) double precision n end function end interface end module lfortran-lfortran-2f73434/integration_tests/arrays_op_13.f900000664000175000017500000000177315141516316024232 0ustar alastairalastairmodule arrays_op_13 use, intrinsic :: iso_c_binding, only : c_char, c_null_char use iso_fortran_env, only: int64 private public :: fpm_model_t, package_t, srcfile_t !> Source type unknown integer, parameter :: FPM_UNIT_UNKNOWN = -1 type srcfile_t !> Type of source unit integer :: unit_type = FPM_UNIT_UNKNOWN end type srcfile_t type package_t !> Array of sources type(srcfile_t), allocatable :: sources(:) end type package_t type :: fpm_model_t !> Array of packages (including the root package) type(package_t), allocatable :: packages(:) end type fpm_model_t contains subroutine build_target_list(model) type(fpm_model_t), intent(inout), target :: model associate(sources=>model%packages(0)%sources) end associate end subroutine build_target_list end module arrays_op_13 program arrays_op_13_main implicit none print *, "working ok" end program arrays_op_13_main lfortran-lfortran-2f73434/integration_tests/associate_11.f900000664000175000017500000000036615141516316024201 0ustar alastairalastairprogram associate_11 implicit none integer :: x(2) integer :: i, j x = 123 associate(a => x(:)) a(1) = 124 end associate print *, x if( x(1) /= 124 ) error stop if( x(2) /= 123 ) error stop end program lfortran-lfortran-2f73434/integration_tests/associate_09.f900000664000175000017500000000145015141516316024203 0ustar alastairalastairprogram associate_09 implicit none print *, "working ok" contains subroutine add_sources_from_dir(sources,directory,scope,with_executables,recurse,error) integer, intent(inout) :: sources character(*), intent(in) :: directory integer, intent(in) :: scope logical, intent(in), optional :: with_executables logical, intent(in), optional :: recurse integer, intent(out) :: error end subroutine subroutine check() integer :: i, j, k, l i = 10 j = 120 k = 429 l = 23 do i=1,3 associate(s=>i) call add_sources_from_dir(l, "lib_dir", k, & error=j) end associate end do end subroutine end program associate_09 lfortran-lfortran-2f73434/integration_tests/intent_out_allocatable_struct_with_components.f900000664000175000017500000000172615141516316033345 0ustar alastairalastairprogram test_allocatable_struct_with_allocatable_components implicit none type :: container_t integer, allocatable :: data(:) end type type(container_t), allocatable :: arg ! Initial allocation allocate(arg) allocate(arg%data(5)) arg%data = [1, 2, 3, 4, 5] ! Call with intent(out) - must deallocate arg on entry call process(arg) ! Verify re-allocation worked if (.not. allocated(arg)) error stop "arg should be allocated after call" if (size(arg%data) /= 3) error stop "wrong size" if (any(arg%data /= [10, 20, 30])) error stop "wrong data" print *, "PASS" contains subroutine process(x) type(container_t), allocatable, intent(out) :: x ! Intent(out) must deallocate on entry if (allocated(x)) error stop "intent(out) must deallocate on entry" ! Allocate fresh allocate(x) allocate(x%data(3)) x%data = [10, 20, 30] end subroutine end program lfortran-lfortran-2f73434/integration_tests/present_02.f900000664000175000017500000000136315141516316023704 0ustar alastairalastairprogram present_02 implicit none type X integer :: stat = 77 end type type(X), allocatable :: objx print *, allocated(objx) if( allocated(objx) ) error stop call f(objx) contains subroutine f(obj) type(X), allocatable, optional, intent(in) :: obj print *, present(obj) if( .not. present(obj) ) error stop call g(obj) end subroutine subroutine g(obj1) type(X), optional, intent(in), allocatable :: obj1 print *, present(obj1) if( .not. present(obj1) ) error stop call h(obj1) end subroutine subroutine h(obj2) type(X), intent(in), optional :: obj2 print *, present(obj2) if( present(obj2) ) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_148.f900000664000175000017500000000224515141516316024504 0ustar alastairalastairprogram intrinsics_148 integer :: array(3, 4) logical :: mask(3, 4) integer :: vector(13) integer :: res(13) integer :: out real :: output(2) real :: array_3(3, 4, 5) logical :: mask_3(3, 4, 5) real :: vector_3(60) real :: res_3(60) array = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4]) mask = .false. mask(1, 1) = .true. vector = [114, 2414, 3142, 4626, 575, 633, 71, 89, 9123, 1011, 1112, 1213, 1314] print *, pack(array, .true., vector) print *, sum(pack(array, .true., vector)) out = sum(pack(array, .true., vector)) if (out /= 1392) error stop print *, pack(array, mask, vector) print *, sum(pack(array, mask, vector)) out = sum(pack(array, mask, vector)) if (out /= 25324) error stop print *, pack(array, mask) print *, sum(pack(array, mask)) out = sum(pack(array, mask)) if (out /= 1) error stop array_3 = 12.141 mask_3 = .false. mask_3(1, 1, 1) = .true. vector_3 = -12.141 print *, pack(array_3, mask_3, vector_3) print *, sum(pack(array_3, mask_3, vector_3)) if (abs(sum(pack(array_3, mask_3, vector_3)) + 704.177734) > 1e-6) error stop output = pack([1, 2], .true.) print*, output if (any(abs(output - [1.00000000, 2.00000000]) > 1e-7)) error stop end program lfortran-lfortran-2f73434/integration_tests/lapack_03.f900000664000175000017500000000017715141516316023462 0ustar alastairalastair PROGRAM LAPACK_03 C Crash with --cpp-infer --fixed-form when file ends with whitespace PRINT *, 'PASS' END lfortran-lfortran-2f73434/integration_tests/case_04.f900000664000175000017500000000025315141516316023136 0ustar alastairalastairprogram case_04 implicit none integer :: i i = 4 select case(i) case (1) print *, "1" case (2,3:5,6,8:10) print *, "2,3:5,6,8:10" end select end lfortran-lfortran-2f73434/integration_tests/operator_overloading_22.f900000664000175000017500000000240515141516316026450 0ustar alastairalastair! Regression test for unary defined operator with elemental function ! Covers: ! - OPERATOR(.rw.) defined via MODULE PROCEDURE ! - ELEMENTAL function used in expression context ! - Use inside another elemental function ! - Use from main program module operator_overloading_22_mod implicit none private public :: myt, afunc, operator(.rw.) type myt sequence integer :: x integer :: y integer :: z end type myt interface operator(.rw.) module procedure rw end interface contains integer elemental function rw(t) implicit none type(myt), intent(in) :: t rw = 1 end function rw logical elemental function afunc(t) implicit none type(myt), intent(in) :: t if (.rw. t <= 5) then afunc = .true. else afunc = .false. end if end function afunc end module operator_overloading_22_mod program operator_overloading_22 use operator_overloading_22_mod implicit none type(myt) :: t logical :: z integer :: x t = myt(1, 2, 3) x = .rw. t z = afunc(t) print *, x print *, z end program operator_overloading_22 lfortran-lfortran-2f73434/integration_tests/read_18.f900000664000175000017500000000130215141516316023137 0ustar alastairalastairprogram read_18 ! Test IOSTAT with END= label interaction implicit none integer :: x, u, ios open(newunit=u, status='scratch') write(u, '(I5)') 123 rewind(u) ! First read should succeed read(u, *, iostat=ios, end=10) x if (ios /= 0) error stop "iostat should be 0 on success" if (x /= 123) error stop "Value should be 123" ! Second read should hit EOF and jump to label read(u, *, iostat=ios, end=10) x error stop "Should have jumped to END label" 10 continue close(u) ! iostat should be negative at EOF if (ios >= 0) error stop "iostat should be negative at EOF" print *, "PASS: IOSTAT + END= interaction works" end program read_18 lfortran-lfortran-2f73434/integration_tests/list_test_04_.f900000664000175000017500000000270015141516316024373 0ustar alastairalastairmodule list_test_04_mod implicit none contains subroutine test_list_01() type(_lfortran_list(integer)) :: x, y integer :: i, j real :: f do i = 0, 4 j = i**2 + 10 call _lfortran_list_insert(x, _lfortran_len(x), j) end do do i = 0, _lfortran_len(x)-1 f = sqrt(real(_lfortran_get_item(x, i))-10.0) call _lfortran_list_append(y, int(f)) end do do i = 0, _lfortran_len(x)-1 call _lfortran_list_remove(x, i**2 + 10) call _lfortran_list_append(x, i) end do ! Final assertion do i = 0, _lfortran_len(y)-1 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(character(len=:))) :: x character(len=32) :: buffer character(len=:), allocatable :: s integer :: i do i = 1, 50 write(buffer, '(I0)') i s = trim(buffer) // "_str" call _lfortran_list_append(x, s) end do do i = 1, 50 write(buffer, '(I0)') i s = trim(buffer) // "_str" call _lfortran_list_remove(x, s) end do if (_lfortran_len(x) /= 0) error stop end subroutine subroutine tests() call test_list_01() call test_list_02() end subroutine end module program test_list_remove_main use list_test_04_mod implicit none call tests() end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops6.f900000664000175000017500000000110415141516316025323 0ustar alastairalastairprogram implied_do_loops6 real, allocatable :: Q(:) real :: R(5) integer :: rank allocate(Q(4)) Q = 5.0 Q([1, 3]) = -4.0 print *, Q R = [abs(Q), 0.0_4] print *, R if( any(R /= [4.0, 5.0, 4.0, 5.0, 0.0]) ) error stop rank = maxval([0_4, trueloc(Q > 0)]) print *, rank if( rank /= 4 ) error stop contains function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-lfortran-2f73434/integration_tests/intrinsics_32.f900000664000175000017500000000067115141516316024415 0ustar alastairalastairprogram intrinsics_32 implicit none real, dimension(6) :: tsource, fsource, result logical, dimension(6) :: mask integer :: i do i = 1, 6 tsource(i) = i*2 fsource(i) = -i*2 end do mask(1) = .true. mask(2) = .false. mask(3) = .false. mask(4) = .true. mask(5) = .true. mask(6) = .false. result = merge(tsource, fsource, mask) print *, result end program intrinsics_32 lfortran-lfortran-2f73434/integration_tests/arrays_intrin_09.f900000664000175000017500000000034015141516316025111 0ustar alastairalastairprogram arrays_intrin_09 implicit none real :: x(10, 10) x = 6.0 if (count(abs(x - 6.0) > 1e-6) /= 0) error stop if (any(abs(x - 6.0) > 1e-6)) error stop print *, "ok" end program arrays_intrin_09 lfortran-lfortran-2f73434/integration_tests/arrays_reshape_21.f900000664000175000017500000000042515141516316025233 0ustar alastairalastairprogram arrays_reshape_21 implicit none integer, parameter :: arr1(*, *) = reshape( [1, 2, 3, 4], [2, 2] ) integer, parameter :: arr2(*) = reshape(arr1, [4]) print *, arr1 print *, arr2 if( any(arr2 /= [1, 2, 3, 4]) ) error stop end program arrays_reshape_21 lfortran-lfortran-2f73434/integration_tests/derived_types_27.f900000664000175000017500000000053015141516316025074 0ustar alastairalastairprogram derived_types_27 type :: int_container integer, dimension(2) :: my_int end type integer :: my_int, i type(int_container) :: t my_int = 12 t%my_int(:) = 39 print *, t%my_int(:), my_int do i = 1, 2 if (t%my_int(i) /= 39) error stop end do if (my_int /= 12) error stop end program lfortran-lfortran-2f73434/integration_tests/flush_01.f900000664000175000017500000000015515141516316023342 0ustar alastairalastairprogram flush_01 integer :: ret open(10, file="file_01_data.txt") flush(10) end program flush_01 lfortran-lfortran-2f73434/integration_tests/nested_07.f900000664000175000017500000000076015141516316023513 0ustar alastairalastairmodule nested_07_testmod_der1 private public fcn contains subroutine fcn(x, fvec) real, intent(in) :: x real, intent(out) :: fvec integer :: i do i = 1, 3 print *, "x(1) = ", x fvec = x+1 print *, "fvec(i) = ", fvec end do end subroutine end module program main use nested_07_testmod_der1, only: fcn real :: x, fvec ! The following starting values provide a rough fit. x = 1.0 call check_deriv() contains subroutine check_deriv() call fcn(x, fvec) end subroutine end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_02.f900000664000175000017500000000053515141516316026426 0ustar alastairalastairprogram separate_compilation_02 use separate_compilation_02_module implicit none integer :: i interface subroutine sub end subroutine sub integer function fn() end function fn end interface call sub call m_sub i = fn() print *, i if ( i /= 19 ) error stop end program separate_compilation_02 lfortran-lfortran-2f73434/integration_tests/derived_types_47.f900000664000175000017500000000054115141516316025100 0ustar alastairalastairmodule derived_types_47_m implicit none type t integer :: x = 1 integer :: y = 1 end type type(t), parameter :: ins = t(2, 3) end module derived_types_47_m program derived_types_47 use derived_types_47_m implicit none if (ins%x /= 2) error stop if (ins%y /= 3) error stop end program derived_types_47 lfortran-lfortran-2f73434/integration_tests/intrinsics_84.f900000664000175000017500000000224415141516316024422 0ustar alastairalastairprogram intrinsics_84 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = minexponent(0.131_sp) integer, parameter :: i2 = minexponent(0.12819_dp) integer, parameter :: ar1 = minexponent([0.131_sp, 0.12819_sp, 0.0_sp]) integer, parameter :: ar2 = minexponent([1.24_dp, 1.119_dp, 0.0_dp]) real(kind=4) :: x real(kind=8) :: y real(sp) :: arr1(3) = [0.131_sp, 0.12819_sp, 0.0_sp] real(dp) :: arr2(3) = [1.24_dp, 1.239_dp, 0.0_dp] integer :: result print *, i1 if (i1 /= -125) error stop print *, i2 if (i2 /= -1021) error stop print *, ar1 if (ar1 /= -125) error stop print *, ar2 if (ar2 /= -1021) error stop result = minexponent(x) print *, result if (result /= -125) error stop result = minexponent(y) print *, result if (result /= -1021) error stop result = minexponent(4.235) print *, result if (result /= -125) error stop result = minexponent(4.235d0) print *, result if (result /= -1021) error stop print *, minexponent(arr1) if (minexponent(arr1) /= -125) error stop print *, minexponent(arr2) if (minexponent(arr2) /= -1021) error stop end program intrinsics_84 lfortran-lfortran-2f73434/integration_tests/derived_types_91.f900000664000175000017500000000266415141516316025107 0ustar alastairalastairmodule derived_types_91_mod implicit none private public :: ansi_code, toml_terminal type :: ansi_code integer :: style = -1 contains procedure :: is_valid end type ansi_code type :: toml_terminal type(ansi_code) :: reset = ansi_code() contains procedure :: check end type toml_terminal contains logical function is_valid(self) class(ansi_code), intent(in) :: self is_valid = (self%style == -1) end function is_valid subroutine check(self) class(toml_terminal), intent(in) :: self if (.not. self%reset%is_valid()) then error stop "ERROR: toml_terminal.reset is invalid" end if end subroutine check end module derived_types_91_mod module derived_types_91_mod_2 use derived_types_91_mod, only: toml_terminal implicit none private public :: toml_parser_config type :: toml_parser_config type(toml_terminal) :: color = toml_terminal() contains procedure :: check end type toml_parser_config contains subroutine check(self) class(toml_parser_config), intent(in) :: self call self%color%check() end subroutine check end module derived_types_91_mod_2 program derived_types_91 use derived_types_91_mod_2, only: toml_parser_config implicit none type(toml_parser_config) :: config call config%check() end program derived_types_91 lfortran-lfortran-2f73434/integration_tests/separate_compilation_26b.f900000664000175000017500000000117515141516316026577 0ustar alastairalastairsubmodule (quadrature_separate_compilation_26) quadrature_gauss_separate_compilation_26 use specialfunctions_separate_compilation_26, only: legendre implicit none contains pure module subroutine gauss_legendre_fp64 (i) integer, intent(inout) :: i i = legendre(i) end subroutine end submodule submodule (specialfunctions_separate_compilation_26) specialfunctions_legendre_separate_compilation_26 implicit none contains pure elemental module function legendre_fp64(n) result(leg) integer, intent(in) :: n integer :: leg leg = n + 1 end function end submodulelfortran-lfortran-2f73434/integration_tests/nested_15.f900000664000175000017500000000110015141516316023477 0ustar alastairalastairmodule nested_15_mod type :: child character(:), allocatable :: value logical :: par = .true. end type child contains subroutine temp_sub(model) type(child), intent(inout) :: model call nested_sub() contains subroutine nested_sub() if (.not. model%par) error stop if (model%value /= "Hello") error stop end subroutine end subroutine end module program nested_15 use nested_15_mod type(child) :: model model%value = "Hello" call temp_sub(model) end program nested_15lfortran-lfortran-2f73434/integration_tests/openmp_16.f900000664000175000017500000000163415141516316023530 0ustar alastairalastairsubroutine initialize_array(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) integer :: i !$omp parallel shared(b, n) private(i) !$omp do do i = 1, n b(i, :) = 12.9d0 end do !$omp end do !$omp end parallel end subroutine subroutine parallel_sum(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) double precision :: res integer :: i res = 0.0d0 !$omp parallel shared(b, n) private(i) reduction(+:res) !$omp do do i = 1, n res = res + sum(b(i, :)) end do !$omp end do !$omp end parallel print *, 'Sum = ', res if (abs(res - 7455168.0000000438d0) > 1e-12) error stop end subroutine program openmp_16 use omp_lib integer, parameter :: n = 1920, m = 301 double precision, dimension(n, m) :: a print *, a(2, 3) call omp_set_num_threads(8) call initialize_array(n, m, a) print *, a(2, 3) call parallel_sum(n, m, a) end program lfortran-lfortran-2f73434/integration_tests/tsunami.f900000664000175000017500000000301415141516316023376 0ustar alastairalastairprogram tsunami ! This version solves the linearized 1-d advection equation: ! ! du/dt + c du/dx = 0 implicit none integer :: i, n integer, parameter :: grid_size = 100 ! grid size in x integer, parameter :: num_time_steps = 100 ! number of time steps real, parameter :: dt = 1 ! time step [s] real, parameter :: dx = 1 ! grid spacing [m] real, parameter :: c = 1 ! background flow speed [m/s] real :: h(grid_size), dh(grid_size) integer, parameter :: icenter = 25 real, parameter :: decay = 0.02 character(*), parameter :: fmt = '(i0,*(1x,es15.8e2))' ! check input parameter values if (grid_size <= 0) stop 'grid_size must be > 0' if (dt <= 0) stop 'time step dt must be > 0' if (dx <= 0) stop 'grid spacing dx must be > 0' if (c <= 0) stop 'background flow speed c must be > 0' ! initialize water height to a Gaussian shape do concurrent(i = 1:grid_size) h(i) = exp(-decay * (i - icenter)**2) end do ! write initial state to screen print fmt, 0, h time_loop: do n = 1, num_time_steps ! apply the periodic boundary condition dh(1) = h(1) - h(grid_size) ! calculate the difference of u in space do concurrent (i = 2:grid_size) dh(i) = h(i) - h(i-1) end do ! compute u at next time step do concurrent (i = 1:grid_size) h(i) = h(i) - c * dh(i) / dx * dt end do ! write current state to screen print fmt, n, h end do time_loop print *, "sum(h): ", sum(h) if (abs(sum(h) - 12.5331345) > 1e-7) error stop end program tsunamilfortran-lfortran-2f73434/integration_tests/logical1.f900000664000175000017500000000032115141516316023407 0ustar alastairalastairprogram logical1 ! this program checks logical operators implicit none ! variable declaration logical :: a, b ! assigning values a = .true. b = .false. print *, a, b end program logical1 lfortran-lfortran-2f73434/integration_tests/modules_15c.h0000664000175000017500000000421315141516316023671 0ustar alastairalastair#ifndef MODULES_15C #define MODULES_15C #include #include #if _WIN32 typedef _Fcomplex float_complex_t; typedef _Dcomplex double_complex_t; #else typedef float _Complex float_complex_t; typedef double _Complex double_complex_t; #endif int f_int_float(int *a, float *b); int f_int_double(int *a, double *b); int f_int_float_complex(int *a, float_complex_t *b); int f_int_double_complex(int *a, double_complex_t *b); int f_int_float_complex_value(int a, float_complex_t b); int f_int_double_complex_value(int a, double_complex_t b); float_complex_t f_float_complex_value_return(float_complex_t b); double_complex_t f_double_complex_value_return(double_complex_t b); int f_int_float_value(int a, float b); int f_int_double_value(int a, double b); int f_int_intarray(int n, int *b); float f_int_floatarray(int n, float *b); double f_int_doublearray(int n, double *b); float f_int_floatarray_star(int n, float *b); void sub_int_float(int *a, float *b, int *r); void sub_int_double(int *a, double *b, int *r); void sub_int_float_complex(int *a, float_complex_t *b, int *r); void sub_int_double_complex(int *a, double_complex_t *b, int *r); void sub_int_float_value(int a, float b, int *r); void sub_int_double_value(int a, double b, int *r); void sub_int_float_complex_value(int a, float_complex_t b, int *r); void sub_int_double_complex_value(int a, double_complex_t b, int *r); void sub_int_intarray(int n, int *b, int *r); void sub_int_floatarray(int n, float *b, float *r); void sub_int_doublearray(int n, double *b, double *r); int f_string(char *s); int32_t call_fortran_i32(int32_t i); int32_t call_fortran_i32_value(int32_t i); int64_t call_fortran_i64(int64_t i); int64_t call_fortran_i64_value(int64_t i); float call_fortran_f32(float i); float call_fortran_f32_value(float i); double call_fortran_f64(double i); double call_fortran_f64_value(double i); int32_t fortran_i32(int32_t *i); int32_t fortran_i32_value(int32_t i); int64_t fortran_i64(int64_t *i); int64_t fortran_i64_value(int64_t i); float fortran_f32(float *i); float fortran_f32_value(float i); double fortran_f64(double *i); double fortran_f64_value(double i); #endif // MODULES_15C lfortran-lfortran-2f73434/integration_tests/where_07.f900000664000175000017500000000214315141516316023340 0ustar alastairalastairprogram where_07 implicit none integer :: call_num logical(4), dimension(4) :: l l = [.true., .false., .true., .false.] call_num = 1 ! neqv operator where (l .neqv. .true.) l = .true. end where print *, l IF (all(l .neqv. [.true., .true., .true., .true.])) ERROR STOP ! or operator where (l .or. .false.) l = get_boolean_false() end where print *, l IF (all(l .neqv. [.false., .true., .false., .true.])) ERROR STOP ! and operator where (l .and. get_boolean_true()) l = .false. end where print *, l IF (all(l .neqv. [.false., .false., .false., .false.])) ERROR STOP ! eqv operator where (l .eqv. get_boolean_false()) l = .true. end where print *, l IF (all(l .neqv. [.true., .false., .true., .true.])) ERROR STOP contains pure logical function get_boolean_true() result(value) implicit none value = .true. end function get_boolean_true pure logical function get_boolean_false() result(value) implicit none value = .false. end function get_boolean_false end program where_07 lfortran-lfortran-2f73434/integration_tests/derived_types_74.f900000664000175000017500000000166715141516316025112 0ustar alastairalastairmodule derived_types_74_mod implicit none type :: string_t character(len=:), allocatable :: value end type type, abstract :: base end type type :: source_t type(string_t), allocatable :: modules_provided(:) end type type, extends(base) :: package_t type(source_t), allocatable :: sources(:) end type type :: model_t type(package_t), allocatable :: packages(:) end type end module program derived_types_74 use derived_types_74_mod implicit none type(string_t) :: module_name type(package_t), allocatable :: packages(:) integer :: i allocate(packages(1)) allocate(packages(1)%sources(1)) allocate(packages(1)%sources(1)%modules_provided(1)) packages(1)%sources(1)%modules_provided(1)%value = "module_abc" module_name = packages(1)%sources(1)%modules_provided(1) if (module_name%value /= "module_abc") error stop end program lfortran-lfortran-2f73434/integration_tests/class_13.f900000664000175000017500000000125715141516316023335 0ustar alastairalastairmodule class_13_mod type :: abstract_type contains procedure, nopass :: integer_method, integer_method_function end type abstract_type contains subroutine integer_method(n) integer, intent(out) :: n n = 10 end subroutine integer_method function integer_method_function() result(r) integer :: r r = 12 end function integer_method_function end module class_13_mod program class_13 use class_13_mod implicit none type(abstract_type) :: obj integer :: n n = 11 call obj%integer_method(n) print *, n if (n /= 10) error stop n = obj%integer_method_function() print *, n if (n /= 12) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_08.f900000664000175000017500000000134215141516316024013 0ustar alastairalastairprogram allocate_08 implicit none call allocate_08_split1() contains subroutine allocate_08_split1() implicit none character(len=:), allocatable :: array(:) integer :: ireturn, imax, i ireturn = 5 imax = 5 allocate(character(len=imax) :: array(ireturn)) do i = 1, 3 array(i) = 'hello' end do do i = 4, 5 array(i) = 'hi' end do do i = 1, 3 print *, array(i) if( array(i) /= 'hello' ) error stop end do do i = 4, 5 print *, array(i) if( array(i) /= 'hi' ) error stop end do end subroutine allocate_08_split1 end program allocate_08 lfortran-lfortran-2f73434/integration_tests/cond_02.f900000664000175000017500000000142415141516316023145 0ustar alastairalastairprogram cond_02 implicit none integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if end lfortran-lfortran-2f73434/integration_tests/procedure_11.f900000664000175000017500000000075115141516316024214 0ustar alastairalastairmodule procedure_11_mod contains subroutine say_something(message) character(len=*),intent(in) :: message print *, message if (message /= "Hello from proc!") error stop end subroutine end module program procedure_11 use procedure_11_mod procedure(say_something), pointer :: proc procedure(say_something), pointer :: proc2 => say_something proc => say_something call proc("Hello from proc!") call proc2("Hello from proc!") end program procedure_11lfortran-lfortran-2f73434/integration_tests/format_16.f900000664000175000017500000000020015141516316023506 0ustar alastairalastairprogram format_16 integer ::i write(*,201) ('*',i=1,10) 201 FORMAT( 10X, 'whatever', /, 10A ) end program format_16lfortran-lfortran-2f73434/integration_tests/arrays_03_func.f900000664000175000017500000000051315141516316024535 0ustar alastairalastairprogram arrays_03_func implicit none integer :: x(10), s, i do i = 1, size(x) x(i) = i end do s = mysum(x) print *, s if (s /= 55) error stop contains integer function mysum(a) result(r) integer, intent(in) :: a(:) integer :: i r = 0 do i = 1, size(a) r = r + a(i) end do end function end lfortran-lfortran-2f73434/integration_tests/intrinsics_171.f900000664000175000017500000000041715141516316024477 0ustar alastairalastairprogram intrinsics_171 character(5):: name = "hELLo" print*, _lfortran_tolowercase("HeLo#") if (_lfortran_tolowercase(name) /= "hello") error stop print*, _lfortran_tolowercase(name) if (_lfortran_tolowercase("HeLo#") /= "helo#") error stop end lfortran-lfortran-2f73434/integration_tests/elemental_function_overloaded_compare.f900000664000175000017500000000353015141516316031506 0ustar alastairalastair! program extracted as MRE from https://github.com/fortran-lang/stdlib ! there is missing implementation of functions/subroutines like ! check_logical, eq_string_char, new_string_from_integer_int32 etc. ! but as that's not need to be able to compile and run the MRE, ! that's being skipped for now, actually we tried having their implementation ! as well, but the program failed to run (take that as a TODO) module mod_elemental_function_overloaded_compare use iso_fortran_env, only: int32 implicit none !> String type holding an arbitrary sequence of characters. interface operator(==) module procedure :: eq_string_char end interface operator(==) type :: string_type sequence private character(len=:), allocatable :: raw end type string_type contains subroutine check_logical(expression) logical, intent(in) :: expression if (.not. expression) then print *, "Condition not fulfilled" end if end subroutine check_logical elemental function eq_string_char(lhs, rhs) result(is_eq) type(string_type), intent(in) :: lhs character(len=*), intent(in) :: rhs logical :: is_eq end function eq_string_char elemental module function new_string_from_integer_int32(val) result(new) integer(int32), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 subroutine test_constructor() character(len=128) :: flc write(flc, '(i0)') -1026191 call check_logical(new_string_from_integer_int32(-1026191) == trim(flc)) end subroutine test_constructor end module mod_elemental_function_overloaded_compare program test_elemental_function_overloaded_compare use mod_elemental_function_overloaded_compare implicit none call test_constructor() end program lfortran-lfortran-2f73434/integration_tests/string_69.f900000664000175000017500000000061715141516316023550 0ustar alastairalastairprogram string_69 implicit none character(len=7) :: value character(len=:), allocatable :: keywords(:) integer :: ii ii = 7 value = "version" keywords = [character(len=ii) :: value] if (len(keywords) /= 7) error stop if (keywords(1) /= "version") error stop value = "usage" keywords = [character(len=ii) :: keywords, value] if (keywords(2) /= "usage") error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_308.f900000664000175000017500000000161515141516316024502 0ustar alastairalastairprogram intrinsics_238 use iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: x1 = dgamma(1.0_dp) real(dp), parameter :: x2 = dgamma(3.14_dp) real(dp), parameter :: x3(2) = dgamma([1.0_dp, 3.14_dp]) real(dp) :: x = 1.0_dp real(dp) :: y = 3.14_dp real(dp) :: z(2) = [1.0_dp, 3.14_dp] print *, x1 if (abs(x1 - 1.0000000000000000_dp) > 1e-12) error stop print *, x2 if (abs(x2 - 2.2844806338178012_dp) > 1e-12) error stop print *, x3 if (any(abs(x3 - [1.0000000000000000_dp, 2.2844806338178012_dp]) > 1e-12)) error stop print *, dgamma(x) if (abs(dgamma(x) - 1.0000000000000000_dp) > 1e-12) error stop print *, dgamma(y) if (abs(dgamma(y) - 2.2844806338178012_dp) > 1e-12) error stop print *, dgamma(z) if (any(abs(dgamma(z) - [1.0000000000000000_dp, 2.2844806338178012_dp]) > 1e-12)) error stop end programlfortran-lfortran-2f73434/integration_tests/implicit_interface_11.f900000664000175000017500000000040415141516316026051 0ustar alastairalastairmodule implicit_interface_11_module implicit integer (f) contains function f() f = 1 end function f end program main use implicit_interface_11_module integer :: i i = f() if (i /= 1) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/select_type_04.f900000664000175000017500000000036015141516316024542 0ustar alastairalastairmodule class_default_select_type_user1 use class_default_select_type_user implicit none end module class_default_select_type_user1 program select_type4 implicit none print *, "running select_type4 main program" end program select_type4 lfortran-lfortran-2f73434/integration_tests/derived_types_09c.f900000664000175000017500000000012315141516316025235 0ustar alastairalastairmodule derived_types_09c type data_t real, pointer :: A(:) end type end module lfortran-lfortran-2f73434/integration_tests/associate_16.f900000664000175000017500000000166515141516316024211 0ustar alastairalastairmodule stdlib_hashmaps_associate_16 implicit none type :: open_map_entry_type integer(4) :: hash_val end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_associate_16 program associate_16 use stdlib_hashmaps_associate_16 implicit none type(open_hashmap_type) :: map integer(4) :: inv_index = 1 integer(4) :: test = 1 allocate(map % inverse(1)) allocate(map % inverse(1) % target) associate(inverse => map % inverse(inv_index)) if (associated(inverse % target)) then test = 2 end if end associate print *, test if (test /= 2) error stop end programlfortran-lfortran-2f73434/integration_tests/procedure_03.f900000664000175000017500000000156015141516316024214 0ustar alastairalastairmodule procedure_03_mod implicit none interface subroutine func(x, y, n) implicit none integer, intent(in) :: n real, intent(in) :: x(n) real, intent(out) :: y(n) end subroutine end interface contains subroutine hybrd(fcn) procedure(func) :: fcn integer, parameter :: m = 3 real, parameter :: eps = 1e-5 real :: a(m), b(m) a = [1, 2, 3] print *, lbound(a, 1), ubound(a, 1) call fcn(a, b, m) print *, a print *, b if ((b(1) - 3) > eps) error stop if ((b(2) - 6) > eps) error stop if ((b(3) - 9) > eps) error stop end subroutine end module program procedure_03 use procedure_03_mod, only: hybrd implicit none call hybrd(fn) contains subroutine fn(x, y, k) integer, intent(in) :: k real, intent(in) :: x(k) real, intent(out) :: y(k) y = x * 3 end subroutine end program lfortran-lfortran-2f73434/integration_tests/class_27.f900000664000175000017500000000113015141516316023330 0ustar alastairalastairmodule class_27_mod implicit none type :: toml_value integer :: key end type toml_value type, extends(toml_value) :: toml_table logical :: implicit = .false. end type toml_table end module class_27_mod program class_27 use class_27_mod implicit none class(toml_value), allocatable, target :: val type(toml_table), pointer :: tmp allocate(toml_table :: val) select type(val) type is(toml_table) val%key = 2 tmp => val end select print *, "Key value: ", tmp%key if (tmp%key /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/format_58.f900000664000175000017500000000450715141516316023532 0ustar alastairalastairprogram format_58 implicit none integer,parameter:: sp = kind(1e0), dp = kind(1d0),& sep = selected_real_kind(precision(1.0_dp)+1),& ep = (sep+dp+sign(1,sep)*(sep-dp))/2 character(11) values(3) real(sp),parameter:: xsp = 1 real(dp),parameter:: xdp = 1 real(ep),parameter:: xep = 1 write(*,"(A9,3A12)") 'kind name','sp','dp','ep' write(*,"(A9,3I12)") 'kind:',sp, dp, ep values = (/ es(real(epsilon(xsp),ep),11,2,4), & es(real(epsilon(xdp),ep),11,2,4),es(real(epsilon(xep),ep),11,2,4) /) write(*,"(4(1X,A))") 'epsilon:',values values = (/ es(real( tiny(xsp),ep),11,2,4), & es(real( tiny(xdp),ep),11,2,4),es(real( tiny(xep),ep),11,2,4) /) write(*,"(4(1X,A))") ' tiny:',values values = (/ es(real( huge(xsp),ep),11,2,4), & es(real( huge(xdp),ep),11,2,4),es(real( huge(xep),ep),11,2,4) /) write(*,"(4(1X,A))") ' huge:',values contains function cn(n) integer,intent(in)::n character(range(n)+2) cn write(cn,"(I0)") n cn = adjustl(cn) end function cn function es(x,w,d,e) real(ep),intent(in):: x integer,intent(in) :: w,d,e character(w) es, ce, c_aftere, ctenpower, csigfigs character(1) cfirstdigit, cesign, csignx, claterdigits*(d+1) real(ep) signx, absx, scaledx integer pointplace,eplace,digitsaftere,tenpower,k signx = sign(1.0_ep,x) csignx = merge(' ','-',signx>0.0_ep) if(x==0.0_ep)then es = adjustr(csignx//'0.'//repeat('0',d)//'E+'//repeat('0',e)) return end if absx = abs(x) k = int(log10(absx)) scaledx = x/10.0_ep**k write(ce,"(E"//trim(cn(w))//"."//trim(cn(d+1))//")") scaledx eplace = index(ce,'E') pointplace = index(ce,'.') csigfigs = adjustl(ce(pointplace+1:eplace-1)) c_aftere = adjustl(trim(ce(eplace+1:))) read(c_aftere,*) digitsaftere tenpower = digitsaftere + k - 1 cesign = merge('+','-',tenpower>=0) ctenpower = adjustl(trim(cn(abs(tenpower)))) cfirstdigit = csigfigs(1:1) claterdigits = csigfigs(2:) es = csignx//cfirstdigit//'.'//trim(claterdigits)//'E'//cesign// & repeat('0',e-len_trim(ctenpower))//trim(ctenpower) end function es end program format_58 lfortran-lfortran-2f73434/integration_tests/intrinsics_217.f900000664000175000017500000000141015141516316024472 0ustar alastairalastairprogram intrinsics_217 implicit none logical :: l logical :: a(3) = [.true., .true., .false.] logical :: x(2, 2) print *, all(a) if (all(a)) error stop a = [.true., .true., .true.] print *, all(a) if (.not. all(a)) error stop x(1, 1) = .true. x(1, 2) = .true. x(2, 1) = .true. x(2, 2) = .false. print *, all(x) if (all(x)) error stop l = all([.true., .true., .true.]) print *, l call section contains subroutine section integer a(2,3), b(2,3) a = 1 b = 1 b(2,2) = 2 print *, all(a == b, 1) if (all(all(a == b, 1))) error stop print *, all(a == b, 2) if (.not. any(all(a == b, 2))) error stop end subroutine section end program lfortran-lfortran-2f73434/integration_tests/functions_01.f900000664000175000017500000000070315141516316024230 0ustar alastairalastairprogram functions_01 implicit none integer :: i, j i = 1 j = 1 if (j /= 1) error stop j = f(i) if (i /= 1) error stop if (j /= 2) error stop j = 1 if (j /= 1) error stop j = f(3) if (j /= 4) error stop j = 1 if (j /= 1) error stop j = f(1+2) if (j /= 4) error stop j = 1 if (j /= 1) error stop j = f(i+2) if (j /= 4) error stop contains integer function f(a) result(b) integer, intent(in) :: a b = a + 1 end function end program lfortran-lfortran-2f73434/integration_tests/format_33.f900000664000175000017500000000041315141516316023513 0ustar alastairalastairprogram format_33 implicit none ! file backspace.f90 character(20):: string open(42,status='scratch') write(42,"(A)") 'Hello world' backspace 42 read(42,"(A)") string print "(A)", string if (string /= 'Hello world') error stop end program format_33 lfortran-lfortran-2f73434/integration_tests/intent_out_allocatable_component_dealloc.f900000664000175000017500000000140715141516316032202 0ustar alastairalastairmodule intent_out_allocatable_component_dealloc_m implicit none type :: container_t integer, allocatable :: a(:) end type container_t contains subroutine set_zero_len(x) integer, allocatable, intent(out) :: x(:) if (allocated(x)) error stop 1 allocate(x(0)) end subroutine set_zero_len end module intent_out_allocatable_component_dealloc_m program intent_out_allocatable_component_dealloc use intent_out_allocatable_component_dealloc_m, only: container_t, set_zero_len implicit none type(container_t) :: c allocate(c%a(2)) c%a = [1, 2] call set_zero_len(c%a) if (.not. allocated(c%a)) error stop 2 if (size(c%a) /= 0) error stop 3 end program intent_out_allocatable_component_dealloc lfortran-lfortran-2f73434/integration_tests/openmp_62.f900000664000175000017500000000105515141516316023526 0ustar alastairalastairprogram openmp_62 use omp_lib implicit none integer :: array(1000), i, j, sum=0 array(1)=3 !$omp teams num_teams(2) thread_limit(5) !$omp distribute do i = 1, 1000, 100 print*,omp_get_num_threads(), omp_get_max_threads() !$omp parallel do do j = i, min(i+99, 1000) array(j) = j * 3 end do !$omp end parallel do end do !$omp end distribute !$omp end teams ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print*, sum if(sum/=1501500) error stop end program openmp_62lfortran-lfortran-2f73434/integration_tests/modules_22_module.f900000664000175000017500000000045115141516316025240 0ustar alastairalastairmodule modules_22_module type :: bitset_type integer(8) :: num_bits end type contains function bits(self) integer(8) :: bits type(bitset_type), intent(in) :: self bits = self % num_bits return end function bits end modulelfortran-lfortran-2f73434/integration_tests/print_01.f900000664000175000017500000000020415141516316023350 0ustar alastairalastairprogram print_01 implicit none integer :: x x = (2+3)*5 print *, x, 1, 3, x, (2+3)*5+x write(*,*) x, 1, 3, x, (2+3)*5+x end program lfortran-lfortran-2f73434/integration_tests/file_04_data.dat0000664000175000017500000000002015141516316024275 0ustar alastairalastairDףSBiףSlfortran-lfortran-2f73434/integration_tests/string_54.f900000664000175000017500000000127215141516316023540 0ustar alastairalastairmodule string_54_mod interface double procedure :: double_ end interface contains pure function double_(x) result(ret) integer, intent(in) :: x integer :: ret ret = x*2 end function ! Test correct FunctionType + FunctionParam subroutine foo_sub(x, char) integer , intent(in) :: x character(double(x)) :: char ! if(len(char) /= 20) error stop ! >>>>>>>>>>>>>>>>>>>>>>>>>>> Uncomment after string is refactored(char should be of physicalType `DescriptorString`). end subroutine end module program string_54 use string_54_mod integer :: x character(10) :: char x = 10 call foo_sub(x, char) end program lfortran-lfortran-2f73434/integration_tests/template_struct_01.f900000664000175000017500000000261515141516316025443 0ustar alastairalastairmodule template_struct_01_m implicit none private public :: struct_t, test_template requirement r(t) type, deferred :: t end requirement template struct_t(t) require :: r(t) private public :: tuple type :: tuple type(t) :: fst type(t) :: snd end type contains function get_fst(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%fst end function function get_snd(p) result(r) type(tuple), intent(in) :: p type(t) :: r r = p%snd end function end template contains subroutine test_template() instantiate struct_t(integer), & only: int_tuple => tuple, get_int_fst => get_fst, & get_int_snd => get_snd instantiate struct_t(real), & only: real_tuple => tuple, get_real_fst => get_fst, & get_real_snd => get_snd type(int_tuple) :: ti ti%fst = 1 print *, "First element: ", get_int_fst(ti) ti%snd = 2 print *, "Second element: ", get_int_snd(ti) type(real_tuple) :: tr tr%fst = 1. print *, "First element: ", get_real_fst(tr) tr%snd = 2. print *, "Second element: ", get_real_snd(tr) end subroutine end module program template_struct_01 use template_struct_01_m implicit none call test_template() end program template_struct_01lfortran-lfortran-2f73434/integration_tests/openmp_67.f900000664000175000017500000000676315141516316023546 0ustar alastairalastairprogram openmp_67 use omp_lib implicit none integer, parameter :: n = 10000 integer :: i, j real :: static_time, dynamic_time, guided_time double precision :: start_time real :: a(n), b(n), c(n) call omp_set_num_threads(4) print *, "=== Schedule Comparison Test ===" print *, "Comparing performance of different schedules" print *, "Array size:", n, "Threads:", omp_get_max_threads() ! Initialize arrays ! Alternative: Initialize arrays with deterministic values do i = 1, n b(i) = real(i) c(i) = real(n - i + 1) end do ! Test STATIC start_time = omp_get_wtime() !$omp parallel do schedule(static) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do static_time = omp_get_wtime() - start_time ! Test DYNAMIC start_time = omp_get_wtime() !$omp parallel do schedule(dynamic) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do dynamic_time = omp_get_wtime() - start_time ! Test GUIDED start_time = omp_get_wtime() !$omp parallel do schedule(guided) do i = 1, n a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end do !$omp end parallel do guided_time = omp_get_wtime() - start_time ! Print results print '(A,F8.6,A)', "STATIC time: ", static_time, " seconds" print '(A,F8.6,A)', "DYNAMIC time: ", dynamic_time, " seconds" print '(A,F8.6,A)', "GUIDED time: ", guided_time, " seconds" ! Analysis print *, "" print *, "Analysis:" ! For uniform workload, static should be fastest if (static_time < dynamic_time * 0.9 .and. static_time < guided_time * 0.9) then print *, "✓ STATIC is fastest for uniform workload" else if (dynamic_time < static_time * 0.9) then print *, "! DYNAMIC is fastest" else if (guided_time < static_time * 0.9) then print *, "! GUIDED is fastest" else print *, "- All schedules perform similarly" end if ! Test with non-uniform workload print *, "" print *, "Testing with non-uniform workload..." ! Make some iterations heavier do i = 1, n if (mod(i, 10) == 0) then b(i) = b(i) * 1000.0 ! Make every 10th iteration heavier end if end do ! Test STATIC with non-uniform start_time = omp_get_wtime() !$omp parallel do schedule(static) do i = 1, n if (mod(i, 10) == 0) then ! Heavy computation a(i) = 0.0 do j = 1, 100 a(i) = a(i) + sqrt(b(i)) + log(abs(c(i)) + 1.0) end do else a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end if end do !$omp end parallel do static_time = omp_get_wtime() - start_time ! Test DYNAMIC with non-uniform start_time = omp_get_wtime() !$omp parallel do schedule(dynamic) do i = 1, n if (mod(i, 10) == 0) then a(i) = 0.0 do j = 1, 100 a(i) = a(i) + sqrt(b(i)) + log(abs(c(i)) + 1.0) end do else a(i) = sqrt(b(i)) + log(abs(c(i)) + 1.0) end if end do !$omp end parallel do dynamic_time = omp_get_wtime() - start_time print *, "" print *, "Non-uniform workload results:" print '(A,F8.6,A)', "STATIC time: ", static_time, " seconds" print '(A,F8.6,A)', "DYNAMIC time: ", dynamic_time, " seconds" end program openmp_67lfortran-lfortran-2f73434/integration_tests/file_01.f900000664000175000017500000000070315141516316023137 0ustar alastairalastairprogram fileops implicit none integer :: j, i character(len=1) :: c integer(8) :: d real :: z j = 11 open(j, file="file_01_data.txt") read(j, *) i read(j, *) c read(j, *) z read(j, *) d rewind(j) close(j) print *, i, c, z, d if (i /= 10130) error stop if (c /= "c") error stop if (abs(z - 4.20) > 1e-6) error stop if (d /= 9223372036854775804_8) error stop end program fileops lfortran-lfortran-2f73434/integration_tests/intrinsics_294.f900000664000175000017500000000420215141516316024501 0ustar alastairalastairprogram intrinsics_294 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_gamma_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(sp) :: log_gamma_runtime_sp(3) = [0.875, 3.367, 2.140] real(dp) :: log_gamma_res_dp(3) real(sp) :: log_gamma_res_sp(3) real(dp) :: expected_dp(3) = [8.5858707225334327E-002_dp, 1.0572189866765507_dp, 6.5332875743268432E-002_dp] real(sp) :: expected_sp(3) = [8.58587101E-02_sp, 1.05721915_sp, 6.53329268E-02] real(dp), parameter :: res(3) = log_gamma([0.875_dp, 3.367_dp, 2.140_dp]) real(sp), parameter :: res_sp(3) = log_gamma([0.875, 3.367, 2.140]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_gamma_res_dp = log_gamma(log_gamma_runtime_dp) log_gamma_res_sp = log_gamma(log_gamma_runtime_sp) do i = 1, 3 print *, log_gamma_res_dp(i) if (abs(log_gamma_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_gamma_res_sp(i) if (abs(log_gamma_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = log_gamma(10.92839272_dp) d = log_gamma(10.92839272) print *, a if (a - 14.936254510214283_dp > 1e-12_dp) error stop print *,log_gamma(10.92839272_dp) if (log_gamma(10.92839272_dp) - 14.936254510214283_dp > 1e-12_dp) error stop print *, d if (d - 14.9362535_sp > 1e-5) error stop print *, log_gamma(10.92839272) if (log_gamma(10.92839272) - 14.9362535_sp > 1e-5) error stop a = log_gamma(83.728927_dp) d = log_gamma(31.738222) print *, a if (a - 285.69411569953820_dp > 1e-12_dp) error stop print *,log_gamma(83.728927_dp) if (log_gamma(83.728927_dp) - 285.69411569953820_dp > 1e-12_dp) error stop print *, d if (d - 77.1901703_sp > 1e-5) error stop print *, log_gamma(31.738222) if (log_gamma(31.738222) - 77.1901703_sp > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_19b.f900000664000175000017500000000065715141516316024053 0ustar alastairalastairmodule modules_19b implicit none contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function function trim(x) result(r) character(len=*),intent(in) :: x character(len=len_trim(x)) :: r integer :: i do i = 1, len(r) r(i:i) = x(i:i) end do end function end module lfortran-lfortran-2f73434/integration_tests/openmp_52.f900000664000175000017500000000103615141516316023524 0ustar alastairalastairprogram openmp_52 use omp_lib implicit none integer, parameter :: N = 100, init=0 integer :: a(N), i, total a = 1 ! Initialize all elements to 1 !$omp parallel shared(a, total) private(i) total = init ! Initialize total to 0 !$omp barrier !$omp do do i = 1, N !$omp critical total = total + a(i) !$omp end critical end do !$omp end do !$omp end parallel print *, "Total sum:", total if (total /= N) error stop "Incorrect sum" end program openmp_52lfortran-lfortran-2f73434/integration_tests/types_01.f900000664000175000017500000000014515141516316023364 0ustar alastairalastairprogram types_01 implicit none real :: r r = 1.0 r = 1.5 r = 1. r = float(2) r = dble(3) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_389.f900000664000175000017500000000055615141516316024516 0ustar alastairalastairprogram intrinsics_389 implicit none integer :: i integer, save :: j print*, "main not saved", loc(i) print*, "main saved", loc(j) call sub() contains subroutine sub() integer :: i integer, save :: j print*, "sub not saved", loc(i) print*, "sub saved", loc(j) end end program intrinsics_389lfortran-lfortran-2f73434/integration_tests/return_01.f900000664000175000017500000000056615141516316023546 0ustar alastairalastairprogram main integer main_out main_out = main1() print *, "main1 called" contains integer function main1() integer :: i i = 10 if (i .GT. 5) then main1 = i print *, "early return" return end if print *, "normal return" main1 = i end function main1 end program lfortran-lfortran-2f73434/integration_tests/openmp_34.f900000664000175000017500000000070115141516316023522 0ustar alastairalastairsubroutine omp_func(n) use omp_lib implicit none integer, intent(in) :: n integer :: i call omp_set_num_threads(5) !$omp parallel private(i) shared(n) !$omp do do i = 1, n !omp critical print *,omp_get_thread_num() print *, "xyz" end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 10) error stop end subroutine program openmp_34 integer, parameter :: n = 10 call omp_func(n) print *, "Done for n = ", n end programlfortran-lfortran-2f73434/integration_tests/string_68.f900000664000175000017500000000043315141516316023543 0ustar alastairalastairprogram string_68 character(len=5) :: string = "hello" integer :: x = 1 character(1) :: arr(3) print *, ["aa", string(x+1:x+2), "baa"] arr = ["aa", string(x+1:x+2), "baa"] print *,arr if(any(arr /= ["a", "e", "b"])) error stop end program string_68lfortran-lfortran-2f73434/integration_tests/modules_13.f900000664000175000017500000000037415141516316023677 0ustar alastairalastairmodule module_13 implicit none contains integer function f1() f1 = f2() end function integer function f2() f2 = 5 end function end module module_13 program main use module_13 implicit none integer :: f f = f1() print *, f end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_249.f900000664000175000017500000000106715141516316024507 0ustar alastairalastairprogram intrinsics_249 use iso_fortran_env, only: dp => real64 integer, parameter :: n = 1000 integer, parameter :: m = 1000 integer, dimension(n,m) :: x real(dp) :: res x = 18 res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 18000000.0_dp) > 1e-12) error stop contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(abs(x), dim)) end function var_2_iint8_dp end programlfortran-lfortran-2f73434/integration_tests/common_01.f900000664000175000017500000000116015141516316023506 0ustar alastairalastairmodule common_01_mod implicit none contains subroutine f() common / c1 / a, b, c integer :: a, b, c a = b b = 4 end subroutine subroutine g() common / c1 / x, y, z integer :: x, y, z x = y y = 4 end subroutine end module program common_01 use common_01_mod, only: f, g implicit none common / c1 / a, b, c integer :: a, b, c a = 1 b = 2 print *, a, b if (a /= 1) error stop if (b /= 2) error stop call f() print *, a, b if (a /= 2) error stop if (b /= 4) error stop a = 1 b = 2 print *, a, b if (a /= 1) error stop if (b /= 2) error stop call g() print *, a, b if (a /= 2) error stop if (b /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_296.f900000664000175000017500000001053515141516316024511 0ustar alastairalastairprogram intrinsic_296 implicit none integer(1), parameter :: x1 = storage_size(3_1, 1) integer(2), parameter :: x2 = storage_size(11_2, 2) integer(4), parameter :: x3 = storage_size(17_4, 4) integer(8), parameter :: x4 = storage_size(19_8, 8) integer, parameter :: x5 = storage_size(3.0) integer(8), parameter :: x6 = storage_size(3.0_8, 8) integer, parameter :: x7 = storage_size((3.0, 13.0)) integer(8), parameter :: x8 = storage_size((3.0_8, 13.0_8), 8) integer, parameter :: x9 = storage_size(.true.) integer(1), parameter :: x10 = storage_size("hello") integer(2), parameter :: x11 = storage_size("hello", 8) integer(4), parameter :: ar1 = storage_size([0, 112, 17], 4) integer(8), parameter :: ar2 = storage_size([1, 11, 17], 8) integer, parameter :: ar3 = storage_size([1.0, 11.0, 17.0]) integer(8), parameter :: ar4 = storage_size([1.0_8, 11.0_8, 17.0_8], 8) integer, parameter :: ar5 = storage_size([.true., .false., .true.]) integer(1), parameter :: ar6 = storage_size(["hello", "world", "hello"]) integer(2), parameter :: ar7 = storage_size(["hello", "world", "hello"], 2) integer, parameter :: ar8 = storage_size([(3.0, 13.0), (3.0, 13.0), (3.0, 13.0)]) integer(8), parameter :: ar9 = storage_size([(3.0_8, 13.0_8), (3.0_8, 13.0_8), (3.0_8, 13.0_8)], 8) integer(1) :: i1 = 3 integer(2) :: i2 = 3 integer(4) :: i3 = 3 integer(8) :: i4 = 3 real :: r1 = 313.0 real(8) :: r2 = 313.0_8 complex :: c1 = (3.0, 13.0) complex(8) :: c2 = (3.0_8, 13.0_8) logical :: l1 = .true. character(1) :: s1 = 'hello' integer :: arr1(3) = [0, 112, 17] integer(8) :: arr2(3) = [1_8, 11_8, 17_8] real :: arr3(3) = [1.0, 11.0, 17.0] real(8) :: arr4(3) = [1.0_8, 11.0_8, 17.0_8] logical :: arr5(3) = [.true., .false., .true.] complex :: arr6(3) = [(3.0, 13.0), (3.0, 13.0), (3.0, 13.0)] complex(8) :: arr7(3) = [(3.0_8, 13.0_8), (3.0_8, 13.0_8), (3.0_8, 13.0_8)] character(5) :: arr8(3) = ["hello", "world", "hello"] print *, x1 if (x1 /= 8) error stop print *, x2 if (x2 /= 16) error stop print *, x3 if (x3 /= 32) error stop print *, x4 if (x4 /= 64) error stop print *, x5 if (x5 /= 32) error stop print *, x6 if (x6 /= 64) error stop print *, x7 if (x7 /= 64) error stop print *, x8 if (x8 /= 128) error stop print *, x9 if (x9 /= 32) error stop print *, x10 if (x10 /= 40) error stop print *, x11 if (x11 /= 40) error stop print *, ar1 if (ar1 /= 32) error stop print *, ar2 if (ar2 /= 32) error stop print *, ar3 if (ar3 /= 32) error stop print *, ar4 if (ar4 /= 64) error stop print *, ar5 if (ar5 /= 32) error stop print *, ar6 if (ar6 /= 40) error stop print *, ar7 if (ar7 /= 40) error stop print *, ar8 if (ar8 /= 64) error stop print *, ar9 if (ar9 /= 128) error stop print *, storage_size(i1) if (storage_size(i1) /= 8) error stop print *, storage_size(i2) if (storage_size(i2) /= 16) error stop print *, storage_size(i3) if (storage_size(i3) /= 32) error stop print *, storage_size(i4) if (storage_size(i4) /= 64) error stop print *, storage_size(r1) if (storage_size(r1) /= 32) error stop print *, storage_size(r2) if (storage_size(r2) /= 64) error stop print *, storage_size(c1) if (storage_size(c1) /= 64) error stop print *, storage_size(c2) if (storage_size(c2) /= 128) error stop print *, storage_size(l1) if (storage_size(l1) /= 32) error stop print *, storage_size(s1) if (storage_size(s1) /= 8) error stop print *, storage_size(arr1) if (storage_size(arr1) /= 32) error stop print *, storage_size(arr2) if (storage_size(arr2) /= 64) error stop print *, storage_size(arr3) if (storage_size(arr3) /= 32) error stop print *, storage_size(arr4) if (storage_size(arr4) /= 64) error stop print *, storage_size(arr5) if (storage_size(arr5) /= 32) error stop print *, storage_size(arr6) if (storage_size(arr6) /= 64) error stop print *, storage_size(arr7) if (storage_size(arr7) /= 128) error stop print *, storage_size(arr8) if (storage_size(arr8) /= 40) error stop print*, kind(storage_size(arr8, 8)) if (kind(storage_size(arr8, 8)) /= 8) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_61.f900000664000175000017500000000144515141516316025100 0ustar alastairalastairmodule stdlib_hashmaps_derived_types_61 implicit none type :: open_map_entry_type integer :: slot = 0 end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_derived_types_61 program derived_types_61 use stdlib_hashmaps_derived_types_61 implicit none type(open_hashmap_type) :: map integer(4) :: inmap = 1 allocate(map % inverse(1)) allocate(map % inverse(1) % target) print *, map % inverse(inmap) % target % slot if (map % inverse(inmap) % target % slot /= 0) error stop end programlfortran-lfortran-2f73434/integration_tests/string_51.f900000664000175000017500000000031415141516316023531 0ustar alastairalastairprogram string_51 implicit none character(len=4) :: array(2) print*, len(array) if (len(array) /= 4) error stop print*, len(array(1)) if (len(array(1)) /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/operator_overloading_09.f900000664000175000017500000000322415141516316026455 0ustar alastairalastairmodule stdlib_bitsets_operator_overloading_9_m implicit none public :: bitset_type, bitset_large, bitset_64 public :: operator(==) type, abstract :: bitset_type private integer(4) :: num_bits contains end type bitset_type type, extends(bitset_type) :: bitset_large end type bitset_large type, extends(bitset_type) :: bitset_64 end type bitset_64 interface operator(==) elemental module function eqv_large(set1, set2) result(eqv) logical :: eqv type(bitset_large), intent(in) :: set1, set2 end function eqv_large elemental module function eqv_64(set1, set2) result(eqv) logical :: eqv type(bitset_64), intent(in) :: set1, set2 end function eqv_64 end interface operator(==) contains elemental module function eqv_large(set1, set2) result(eqv) logical :: eqv type(bitset_large), intent(in) :: set1, set2 eqv = .false. ! dummy implementation end function eqv_large elemental module function eqv_64(set1, set2) result(eqv) logical :: eqv type(bitset_64), intent(in) :: set1, set2 eqv = .true. ! dummy implementation end function eqv_64 end module stdlib_bitsets_operator_overloading_9_m program operator_overloading_09 use stdlib_bitsets_operator_overloading_9_m implicit none type(bitset_large) :: set0, set1 type(bitset_64) :: set2, set3 if ((set1 == set0) .neqv. .false.) error stop if ((set2 == set3) .neqv. .true.) error stop end program operator_overloading_09 lfortran-lfortran-2f73434/integration_tests/string_57.f900000664000175000017500000000201215141516316023534 0ustar alastairalastairmodule module_string_57 type :: MyType character(:), allocatable :: string contains procedure :: method end type MyType contains subroutine method(self, v) class(MyType), intent(in) :: self character(len=*), intent(inout) :: v select case (self%string) case ('String1') print *, 'Method called with String1' v = 'String1 processed' case ('String2') print *, 'Method called with String2' v = 'String2 processed' case default print *, 'Method called with unknown string' v = 'Unknown string processed' end select end subroutine method end module module_string_57 program string_57 use module_string_57 implicit none type(MyType) :: obj character(len=20) :: result obj%string = 'String1' call obj%method(result) print *, 'Result after String1:', result if (trim(result) /= 'String1 processed') error stop obj%string = 'String2' call obj%method(result) print *, 'Result after String2:', result if (trim(result) /= 'String2 processed') error stop print *, 'Program completed successfully.' end program lfortran-lfortran-2f73434/integration_tests/complex_22.f900000664000175000017500000000063315141516316023674 0ustar alastairalastairprogram complex_22 implicit none complex, pointer :: ptr_complex4 complex(8), pointer :: ptr_complex8 complex, target :: complex4_1 complex(8), target :: complex8_1 complex8_1 = (1, 2) complex4_1 = (1, 2) ptr_complex8 => complex8_1 ptr_complex4 => complex4_1 print *, cmplx(ptr_complex4, kind=8) if (ptr_complex8 /= cmplx(ptr_complex4, kind=8)) error stop end program complex_22lfortran-lfortran-2f73434/integration_tests/print_arr_05.f900000664000175000017500000000006315141516316024223 0ustar alastairalastairprogram print_arr_05 print* ,[4,9] end program lfortran-lfortran-2f73434/integration_tests/modules_04.f900000664000175000017500000000057015141516316023675 0ustar alastairalastairmodule modules_04_a implicit none contains subroutine b() print *, "b()" end subroutine end module program modules_04 use, intrinsic :: iso_fortran_env implicit none call f() contains subroutine f() use modules_04_a, only: b call b() end subroutine integer function g() use :: modules_04_a, only: b call b() g = 5 end function end lfortran-lfortran-2f73434/integration_tests/associate_20.f900000664000175000017500000000227115141516316024176 0ustar alastairalastairmodule assert_m_module_associate_20 public :: assert_this_image_interface, assert_this_image abstract interface pure function assert_this_image_interface() result(this_image_id) integer :: this_image_id end function end interface procedure(assert_this_image_interface), pointer :: assert_this_image contains subroutine assert_always(is_two) logical, intent(in) :: is_two print *, assert_this_image() if (is_two) then if ( assert_this_image() /= 112352 ) error stop else if ( assert_this_image() /= 112351 ) error stop end if end subroutine end module assert_m_module_associate_20 program associate_20 use assert_m_module_associate_20 implicit none assert_this_image => assert_callback_this_image call assert_always(.false.) assert_this_image => assert_callback_this_image_two call assert_always(.true.) contains pure function assert_callback_this_image() result(this_image_id) implicit none integer :: this_image_id this_image_id = 112351 end function pure function assert_callback_this_image_two() result(this_image_id) implicit none integer :: this_image_id this_image_id = 112352 end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_198.f900000664000175000017500000000053615141516316024512 0ustar alastairalastairprogram intrinsics_198 real, dimension(2,3) :: x real :: res x = 12.9 res = var_2_rsp_rsp(x, 1) print *, res if (abs(res - 77.3999939) > 1e-8) error stop contains function var_2_rsp_rsp(x, dim) result(res) real, intent(in) :: x(:,:) integer, intent(in) :: dim real :: res res = sum(sum(x, dim)) end function var_2_rsp_rsp end program lfortran-lfortran-2f73434/integration_tests/read_16.f900000664000175000017500000000063415141516316023144 0ustar alastairalastairprogram read_16 ! Test ERR= label for read errors implicit none integer :: x, u character(len=20) :: invalid_data invalid_data = "not_an_integer" open(newunit=u, status='scratch') write(u, '(A)') invalid_data rewind(u) read(u, *, err=20) x error stop "Should have jumped to label 20" 20 continue close(u) print *, "PASS: ERR= label works" end program read_16 lfortran-lfortran-2f73434/integration_tests/template_03b.f900000664000175000017500000000352215141516316024201 0ustar alastairalastairprogram template_03 requirement op(T, U, V, op) type, deferred :: T type, deferred :: U type, deferred :: V elemental function op(a, b) result(op) type(T), intent(in) :: a type(U), intent(in) :: b type(V) :: op end function end requirement template axpy_tmpl(T, U, V, W, plus, times) public :: axpy require :: op(V, W, V, plus) require :: op(T, U, W, times) contains subroutine axpy(a, x, y) type(T), intent(in) :: a type(U), intent(in) :: x(:) type(V), intent(inout) :: y(:) y = plus(y, times(a, x)) end subroutine end template call f() contains elemental function my_mul(a, b) result(op) integer, parameter :: sp = kind(1.0) real(sp), intent(in) :: a integer, intent(in) :: b real(sp) :: op op = a * b end function elemental function my_add(a, b) result(op) integer, parameter :: sp = kind(1.0), dp = kind(1.d0) real(dp), intent(in) :: a real(sp), intent(in) :: b real(dp) :: op op = a + b end function subroutine my_axpy(a, x, y) integer, parameter :: sp = kind(1.0), dp = kind(1.d0) real(sp), intent(in) :: a integer, intent(in) :: x(:) real(dp), intent(inout) :: y(:) y = my_add(y, my_mul(a, x)) end subroutine subroutine f() integer, parameter :: sp = kind(1.0), dp = kind(1.d0) instantiate axpy_tmpl(real(sp), integer, real(dp), real(sp), operator(+), operator(*)) real(sp) :: a integer :: x(3) real(dp) :: y(3) a = 0.5 x = 2 y = 2 call axpy(a, x, y) ! call my_axpy(a, x, y) ! non-generic does not work too end subroutine end programlfortran-lfortran-2f73434/integration_tests/interface_04.f900000664000175000017500000000061015141516316024160 0ustar alastairalastairmodule interface_04_mod1 implicit none interface a module procedure a1 end interface contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine end module module interface_04_mod2 use interface_04_mod1 end module program interface_04 use interface_04_mod2, only: a implicit none integer :: i i = 5 call a(i) if (i /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_63.f900000664000175000017500000000025315141516316024415 0ustar alastairalastairprogram intrinsics_63 implicit none complex, allocatable :: a5(:, :) allocate(a5(5, 10)) a5 = (5.0, 6.0) print *, a5 if( any(a5 /= (5.0, 6.0)) ) error stop end program lfortran-lfortran-2f73434/integration_tests/string_29.f900000664000175000017500000000134315141516316023541 0ustar alastairalastairfunction c2s(n, x) result(y) integer, intent(in) :: n character, intent(in) :: x(:) character(:), allocatable :: y integer :: i allocate(character(n) :: y) do i = 1, n y(i:i) = x(i) end do end function program string_29 character(len=1) :: s(3) integer :: i s(1) = "a" s(2) = "b" s(3) = "c" i = fortran_string(3, s) print *, i if (i /= 3) error stop contains integer function fortran_string(n,s) result(r) bind(c) integer :: n character(len=1), intent(in) :: s(:) interface function c2s(n, x) result(y) integer, intent(in) :: n character, intent(in) :: x(:) character(:), allocatable :: y end function end interface print *, c2s(n,s) if (c2s(n,s) /= "abc") error stop r = len(c2s(n,s)) end function end program lfortran-lfortran-2f73434/integration_tests/arrays_op_22.f900000664000175000017500000000111615141516316024221 0ustar alastairalastairprogram arrays_op_22 implicit none real :: array(10, 10), output(10, 10) array = 3.0 output = prg(array) print *, output if( any(abs(output - 6.0) > 1e-8) ) error stop contains function prg(arr) result(otpt) real, intent(in) :: arr(:, :) real :: otpt(size(arr, 1), size(arr, 2)) otpt = copy_array(twice(copy_array(arr))) end function elemental real function twice(x) result(y) real, intent(in) :: x y = 2.0*x end function function copy_array(input) result(output) real, intent(in) :: input(:, :) real :: output(size(input, 1), size(input, 2)) output = input end function end program lfortran-lfortran-2f73434/integration_tests/char_array_01.f900000664000175000017500000000066415141516316024341 0ustar alastairalastairprogram char_array_01 character char_arr1(4) character char_arr2(2) char_arr1(:) = "A" char_arr2(:) = " " print *, char_arr1 if (char_arr1(1) /= "A") error stop if (char_arr1(2) /= "A") error stop if (char_arr1(3) /= "A") error stop if (char_arr1(4) /= "A") error stop print *, char_arr2 if (char_arr2(1) /= " ") error stop if (char_arr2(2) /= " ") error stop end program char_array_01 lfortran-lfortran-2f73434/integration_tests/bindc1.f900000664000175000017500000000016515141516316023062 0ustar alastairalastairprogram bindc1 use iso_c_binding, only: c_loc, c_ptr integer, pointer :: x type(c_ptr) :: p p = c_loc(x) end program lfortran-lfortran-2f73434/integration_tests/string_31.f900000664000175000017500000000077115141516316023536 0ustar alastairalastairprogram string_31 implicit none character(len=8) :: s = "lfortran" character(len=5) :: n print*, "Length of s:", len(s) print*, "Whole string:", s(1:len(s)) if ( s(1:len(s)) /= "lfortran" ) error stop print*, "Slice of string (2:5):", s(1:-1) if ( s(1:-1) /= "" ) error stop print*, "Slice of string (2:5):", s(2:5) if ( s(2:5) /= "fort" ) error stop n = "12345" print *, any(n(2:2) == ["3", "2"]) if ( .not. any(n(2:2) == ["3", "2"]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_16b.f900000664000175000017500000000046515141516316026577 0ustar alastairalastairsubmodule(mod_separate_compilation_16) submod_separate_compilation_16 implicit none contains module subroutine map_open_entry(key) integer, intent(inout) :: key integer, parameter :: i = 1 key = i end subroutine map_open_entry end submodule submod_separate_compilation_16lfortran-lfortran-2f73434/integration_tests/arrays_reshape_19.f900000664000175000017500000000101315141516316025234 0ustar alastairalastairmodule arrays_reshape_19_mod contains subroutine another_func(q) integer, intent(in) :: q(:,:) integer :: anew(18) anew = reshape([0,q,17], [18]) print *, anew if(any(anew /= [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])) error stop end subroutine another_func end module program arrays_reshape_19 use arrays_reshape_19_mod integer :: q(4,4) q = reshape([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], [4,4]) call another_func(q) end program arrays_reshape_19lfortran-lfortran-2f73434/integration_tests/openmp_26.f900000664000175000017500000000244415141516316023531 0ustar alastairalastairsubroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a interface subroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface call intiailise_array_kernel(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_26 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_379.f900000664000175000017500000000125515141516316024512 0ustar alastairalastairmodule testdrive_intrinsics_379 contains subroutine get_argument(idx, arg) integer, intent(in) :: idx !> Command line argument character(len=:), allocatable, intent(out) :: arg integer :: length, stat call get_command_argument(idx, length=length, status=stat) call get_command_argument(idx, arg, status=stat) end subroutine get_argument end module testdrive_intrinsics_379 program intrinsics_379 use testdrive_intrinsics_379 implicit none character(len=:), allocatable :: arg1, arg2 ! Get the first command line argument call get_argument(1, arg1) ! Get the second command line argument call get_argument(2, arg2) end program lfortran-lfortran-2f73434/integration_tests/binop_01.f900000664000175000017500000000036715141516316023335 0ustar alastairalastairprogram binop_01 use iso_fortran_env, only: int8 integer(int8) :: result(5), start_, end_ result = 24_int8 start_ = 1_int8 end_ = 3_int8 print *, result(end_ - start_) if (any(result /= 24_int8)) error stop end program lfortran-lfortran-2f73434/integration_tests/elemental_02.f900000664000175000017500000000060615141516316024171 0ustar alastairalastairprogram elemental_02 real :: x(2) = [1, 2], y(2) = [1.0, 2.1] logical :: close(2) close = is_close(x, y) print *, close if (.not. close(1)) error stop if (close(2)) error stop contains elemental logical function is_close(a, b, rel_tol) result(close) real, intent(in) :: a, b real, intent(in), optional :: rel_tol close = abs(a - b) <= 1e-9 end function is_close end program elemental_02 lfortran-lfortran-2f73434/integration_tests/intrinsics_191.f900000664000175000017500000000042415141516316024477 0ustar alastairalastairprogram intrinsics_191 implicit none complex :: a complex(kind=8) :: b integer :: res a = cmplx(1) res = kind(a) print *, res if (res /= 4) error stop b = cmplx(1) res = kind(b) print *, res if (res /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_21.f900000664000175000017500000000164515141516316025076 0ustar alastairalastair module derived_types_21 implicit none type build_target_ptr type(build_target_t), pointer :: ptr end type build_target_ptr !> Type describing a generated build target type build_target_t !> File path of build target object relative to cwd character(:), allocatable :: output_file !> Resolved build dependencies type(build_target_ptr), allocatable :: dependencies(:) !> Target type integer :: target_type = 0 end type build_target_t contains integer function check1() implicit none type(build_target_t) :: package type(build_target_ptr), allocatable :: targets(:) check1 = 10 end function end module derived_types_21 program derived_types_21_program use derived_types_21 implicit none integer :: z z = check1() if (z /= 10) error stop end program derived_types_21_program lfortran-lfortran-2f73434/integration_tests/derived_types_28.f900000664000175000017500000000055115141516316025100 0ustar alastairalastairprogram derived_types_28 implicit none type t real, dimension(:), pointer :: x, y, z end type t type(t) :: type real, target :: r(1) real :: ans r = 34 type%x => r type%y => r type%z => r type%x = type%y + type%z ans = type%x(1) print *, ans if (abs(ans - 68.0) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_21.f900000664000175000017500000000165415141516316024240 0ustar alastairalastairpure integer function my_merge(val1, val2, mask) result(merged_value) integer, intent(in) :: val1, val2 logical, intent(in) :: mask if (mask) then merged_value = val1 else merged_value = val2 end if end function my_merge program functions_21 complex, dimension(3, 3) :: y complex :: res(3) res = mean_2_cdp_cdp(y, 1, mask=.true.) print *, res print *, abs(sum(res)) if (abs(abs(sum(res)) - 526.008179) > 1e-8) error stop contains function mean_2_cdp_cdp(x, dim, mask) result(res) complex, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in), optional :: mask complex :: res(my_merge(size(x, 1), size(x, 2), mask=1 1e-6) error stop if (abs(list(2) - 42.0) > 1e-6) error stop if (abs(list(3) + 42.0) > 1e-6) error stop end subroutine subroutine test_f64() implicit none real(8) :: list(3) character(len=15) :: clist clist = "1.5 2.5 -3.5" read(clist, *) list if (abs(list(1) - 1.5_8) > 1d-12) error stop if (abs(list(2) - 2.5_8) > 1d-12) error stop if (abs(list(3) + 3.5_8) > 1d-12) error stop end subroutine subroutine test_i32() implicit none integer :: list(3) character(len=15) :: clist clist = "10 -20 30" read(clist, *) list if (list(1) /= 10) error stop if (list(2) /= -20) error stop if (list(3) /= 30) error stop end subroutine subroutine test_i64() implicit none integer(8) :: list(3) character(len=33) :: clist clist = "1000000000 -2000000000 2000000000" read(clist, *) list if (list(1) /= 1000000000_8) error stop if (list(2) /= -2000000000_8) error stop if (list(3) /= 2000000000_8) error stop end subroutine end program test_string_read_arrayslfortran-lfortran-2f73434/integration_tests/nullify_01.f900000664000175000017500000000025215141516316023701 0ustar alastairalastairprogram nullify_01 implicit none integer, pointer :: p1, p2 integer, target :: t1 p1=>t1 p2=>t1 p1 = 1 nullify(p1, p2) end program nullify_01 lfortran-lfortran-2f73434/integration_tests/declaration_02.f900000664000175000017500000000074015141516316024507 0ustar alastairalastairMODULE declaration_02_mod1 integer (kind=4), parameter :: m = 3 integer (kind=4), parameter :: n = 1000 END MODULE declaration_02_mod1 MODULE declaration_02_mod2 use declaration_02_mod1 integer (kind=4), dimension(m) :: arr1 integer (kind=4), dimension(n) :: arr2 END MODULE declaration_02_mod2 program declaration_02 use declaration_02_mod1 use declaration_02_mod2 if (size(arr1) /= 3) error stop if ((size(arr2) /= 1000)) error stop end programlfortran-lfortran-2f73434/integration_tests/read_14.f900000664000175000017500000000063615141516316023144 0ustar alastairalastairprogram read_14 implicit none real :: arr(5) integer :: i, j open(10, file="read_14_data.txt", status="replace") write(10, *) 1.0, 2.0, 3.0, 4.0, 5.0 close(10) open(10, file="read_14_data.txt", status="old") read(10, *) (arr(j), j=1,5) close(10, status="delete") do i = 1, 5 if (abs(arr(i) - real(i)) > 1e-6) error stop end do print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/test_ieee_logb.f900000664000175000017500000000502315141516316024671 0ustar alastairalastair! Test ieee_logb function (IEEE unbiased exponent) program ieee_logb_01 use, intrinsic :: ieee_arithmetic, only: ieee_logb, ieee_is_finite implicit none real(4) :: x_sp, logb_sp real(8) :: x_dp, logb_dp print *, "Testing ieee_logb..." ! Test 1: logb(1.0) should be 0 x_sp = 1.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1.0) =", logb_sp if (abs(logb_sp) > 1e-6) error stop "logb(1.0) should be 0" ! Test 2: logb(2.0) should be 1 x_sp = 2.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(2.0) =", logb_sp if (abs(logb_sp - 1.0) > 1e-6) error stop "logb(2.0) should be 1" ! Test 3: logb(4.0) should be 2 x_sp = 4.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(4.0) =", logb_sp if (abs(logb_sp - 2.0) > 1e-6) error stop "logb(4.0) should be 2" ! Test 4: logb(0.5) should be -1 x_sp = 0.5 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(0.5) =", logb_sp if (abs(logb_sp + 1.0) > 1e-6) error stop "logb(0.5) should be -1" ! Test 5: logb should be independent of sign x_sp = -8.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(-8.0) =", logb_sp if (abs(logb_sp - 3.0) > 1e-6) error stop "logb(-8.0) should be 3" ! Test 6: For any normal number, logb relates to exponent x_sp = 3.0 ! 3.0 = 1.5 * 2^1 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(3.0) =", logb_sp if (abs(logb_sp - 1.0) > 1e-6) error stop "logb(3.0) should be 1" ! Test 7: Double precision x_dp = 16.0d0 logb_dp = ieee_logb(x_dp) print *, "ieee_logb(16.0d0) =", logb_dp if (abs(logb_dp - 4.0d0) > 1e-10) error stop "logb(16.0) should be 4" ! Test 8: Large number x_sp = 1024.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1024.0) =", logb_sp if (abs(logb_sp - 10.0) > 1e-6) error stop "logb(1024.0) should be 10" ! Test 9: Relationship with exponent intrinsic x_sp = 100.0 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(100.0) =", logb_sp print *, "exponent(100.0) =", exponent(x_sp) ! logb(x) should equal exponent(x) - 1 for normal numbers if (abs(logb_sp - real(exponent(x_sp) - 1)) > 1e-6) then error stop "logb should match exponent - 1" end if ! Test 10: For values between 1 and 2, logb should be 0 x_sp = 1.5 logb_sp = ieee_logb(x_sp) print *, "ieee_logb(1.5) =", logb_sp if (abs(logb_sp) > 1e-6) error stop "logb(1.5) should be 0" print *, "All ieee_logb tests passed!" end program ieee_logb_01 lfortran-lfortran-2f73434/integration_tests/save_07.f900000664000175000017500000000116215141516316023164 0ustar alastairalastairsubroutine sub(i) real :: x(5) integer :: i, itr save if (i == 1) then x = 3.49213401 x(4) = -2134.1 else if (i == 2) then print *, x do itr = 1, 5 if (itr == 4) then if (abs(x(itr) + 2134.1) > 1e-6) error stop else if (abs(x(itr) - 3.49213401) > 1e-6) error stop end if end do x(3) = -991.324 else do itr = 1, 5 if (itr == 3) then if (abs(x(itr) + 991.324) > 1e-6) error stop else if (itr == 4) then if (abs(x(itr) + 2134.1) > 1e-6) error stop else if (abs(x(itr) - 3.49213401) > 1e-6) error stop end if end do print *, x end if end subroutine program save_07 call sub(1) call sub(2) call sub(3) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_254.f900000664000175000017500000000363615141516316024507 0ustar alastairalastairprogram intrinsics_251 use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 real(sp), parameter :: r1 = erfc(1.1_sp) real(dp), parameter :: r2 = erfc(4.12_dp) real(sp), parameter :: ar1(3) = erfc([0.5_sp, -1.5_sp, 2.2_sp]) real(dp), parameter :: ar2(2) = erfc([-0.2_dp, 0.0_dp]) real(sp) :: x real(dp) :: y, z real(sp) :: arr1(3) real(dp) :: arr2(3), res(3) x = 6.738377383_sp y = 3.1473863781_dp z = 7389.83936383_dp print *, erfc(x) if (abs(erfc(x) - 1.58035037e-21_sp) > 1e-6_sp) error stop print *, erfc(y) if (abs(erfc(y) - 8.54408946394494113e-06_dp) > 1e-12) error stop print *, erfc(z) if (abs(erfc(z) - 0.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_sp y = -3.1473863781_dp z = -7389.83936383_dp print *, erfc(x) if (abs(erfc(x) - 2.00000000e+00_sp) > 1e-6_sp) error stop print *, erfc(y) if (abs(erfc(y) - 1.99999145591053606e+00_dp) > 1e-12_dp) error stop print *, erfc(z) if (abs(erfc(z) - 2.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, r1 if (abs(r1 - 1.19794928e-01_sp) > 1e-6_sp) error stop print *, r2 if (abs(r2 - 5.65815721936131674e-09_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [4.79500115e-01_sp, 1.96610510e+00_sp, 1.86284585e-03_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [1.22270258921047859e+00_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_sp, -3.1473863781_sp, -7389.83936383_sp] print *, erfc(arr1) if (any(abs(erfc(arr1) - [2.00000000e+00_sp, 1.99999142e+00_sp, 2.00000000e+00_sp]) > 1e-6_sp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = erfc(arr2) print *, res if (any(abs(res - [1.58035442023170862e-21_dp, 8.54408946394494113e-06_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/inquire_08.f900000664000175000017500000000122015141516316023676 0ustar alastairalastairprogram inquire_08 implicit none integer :: ioerr, nxtrec, recl, unit_no inquire (iolength=recl) 42, 42.0, 'xyzzy' if (recl /= 13) error stop "iolength wrong" ioerr = -42 open (newunit=unit_no, file='test_inquire.dat', status='replace', & access='direct', recl=recl, form='unformatted', iostat=ioerr) if (ioerr /= 0) error stop "open failed" ioerr = -42 nxtrec = -43 inquire (unit_no, iostat=ioerr, nextrec=nxtrec) if (ioerr /= 0) error stop "iostat should be 0" if (nxtrec /= 1) error stop "nextrec should be 1" close (unit_no, status='delete') print *, "All tests passed" end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops7.f900000664000175000017500000000247615141516316025341 0ustar alastairalastairprogram implied_do_loops7 implicit none integer, parameter :: max_ij = 13, max_sum = 2 * max_ij ** 3 integer :: i, j integer, parameter :: x1(*) = [((i**3+j**3, i = 1,j), j = 1,max_ij)] real, parameter :: x2(*) = [((i*3.5 + j**2.5, i = 1,j), j = 1,max_ij)] logical, parameter :: x3(*) = [(((i + 2) > j, i = 1,j), j = 1,max_ij)] logical, parameter :: x4(*) = [(((i*2.5) > (j*1.5), i = 1,j), j = 1,max_ij)] !Character Implied Do Loop Test with Parameter Array character(len=2),parameter :: char_array(2) = (/(('AB'), i=1,2) /) !Check variable length character array assignment character(len=10),parameter :: char_array2(2) = (/(('ABCDEFGH'), i=1,2) /) character(len=2),parameter :: char_array3(2) = (/(('ABCDEFGH'), i=1,2) /) print *, sum(x1) print *, sum(x2) print *, count(x3) print *, count(x4) print *, char_array print *, char_array2, char_array3 if (sum(x1) /= 115934) error stop if (abs(sum(x2) - 28614.8848) > 10e-12) error stop if (count(x3) /= 25) error stop if (count(x4) /= 42) error stop if (char_array(1) /= 'AB' .or. char_array(2) /= 'AB') error stop if (char_array2(1) /= 'ABCDEFGH' .or. char_array2(2) /= 'ABCDEFGH') error stop if (char_array3(1) /= 'AB' .or. char_array3(2) /= 'AB') error stop end program implied_do_loops7lfortran-lfortran-2f73434/integration_tests/intrinsics_350.f900000664000175000017500000000124015141516316024471 0ustar alastairalastairprogram intrinsics_350 real(8) :: v(2,3) real(8), allocatable :: v_(:) real(8) :: v_2(2) allocate(v_(size(v,1))) v = 2 v_ = v(:,2) v_2 = v(:,2) ! output should be the exact same print *, sum(1 - spread(v(:,2),dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v(:,2),dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop print *, sum(1 - spread(v_,dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v_,dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop print *, sum(1 - spread(v_2,dim = 2 , ncopies =23)) if ( abs(sum(1 - spread(v_2,dim = 2 , ncopies =23)) - (-46.0)) > 1e-6 ) error stop end program intrinsics_350 lfortran-lfortran-2f73434/integration_tests/template_array_04b.f900000664000175000017500000000120715141516316025376 0ustar alastairalastairmodule template_array_04b_m implicit none private public :: test_reverse requirement default_behavior(t) type, deferred :: t end requirement contains subroutine swap{T}(x, y) require :: default_behavior(T) type(T), intent(inout) :: x, y type(T) :: tmp tmp = x x = y y = tmp end subroutine subroutine test_reverse() integer :: a(2) a = [1,2] print *, a call swap{integer}(a(1),a(2)) print *, a end subroutine end module program template_array_04b use template_array_04b_m call test_reverse() end program lfortran-lfortran-2f73434/integration_tests/equivalence_05.f900000664000175000017500000000047515141516316024533 0ustar alastairalastairprogram equivalence_05 implicit none INTEGER IMACH(16), OUTPUT, SMALL(2) REAL RMACH EQUIVALENCE (IMACH(4),OUTPUT), (RMACH,SMALL(1)) imach(4) = 6 if(output /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_77.f900000664000175000017500000000100115141516316023526 0ustar alastairalastairmodule a_arrays_77 contains function f2() result(res) integer(8), allocatable :: res(:) allocate(res(10)) res = [1,2,3,4,5,6,7,8,9,10] end function f2 end module a_arrays_77 program arrays_77 use a_arrays_77 integer :: i integer :: arr(10) integer,allocatable :: arr_res(:) do i = 1 , 10 arr(i) = i + 100 end do allocate(arr_res(11)) arr_res = [arr(f2()),111] ! Error here print *, arr_res do i = 1 , 11 if (arr_res(i) /= i + 100) error stop end do end programlfortran-lfortran-2f73434/integration_tests/associate_06_module.f900000664000175000017500000000060415141516316025545 0ustar alastairalastairmodule associate_06_stdlib_string_type contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument subroutine read_formatted(v_list) integer, intent(in) :: v_list(:) call unused_dummy_argument(v_list) end subroutine end module lfortran-lfortran-2f73434/integration_tests/nullify_04.f900000664000175000017500000000063115141516316023705 0ustar alastairalastairmodule module_nullify_04 implicit none type :: scaled_data_structure real, dimension(:), pointer :: one_d_real_pointer end type end module program nullify_04 use module_nullify_04, only : scaled_data_structure implicit none type(scaled_data_structure) :: s type(scaled_data_structure) :: s2 nullify(s%one_d_real_pointer) nullify(s2%one_d_real_pointer) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_324.f900000664000175000017500000000030215141516316024470 0ustar alastairalastairprogram intrinsics_324 integer, allocatable :: A(:) integer :: B(2) = [2,2] allocate(A(2)) A = [1,2] A = max(A, B) print *, A if (any(A /= 2)) error stop end programlfortran-lfortran-2f73434/integration_tests/complex_06.f900000664000175000017500000000040215141516316023670 0ustar alastairalastairprogram complex_06 implicit none real, parameter :: a = 3.0, b = 4.0 complex, parameter :: i_ = (0, 1) complex, parameter :: z = a + i_*b real, parameter :: x = z real, parameter :: y = real(z) real, parameter :: w = aimag(z) print *, x, y, w end program lfortran-lfortran-2f73434/integration_tests/nullify_05.f900000664000175000017500000000121615141516316023706 0ustar alastairalastairmodule nullify_05_type contains subroutine OBJ() end subroutine end module module nullify_05_mod use nullify_05_type type PROB_T procedure(OBJ), nopass, pointer :: calfun_struct => null() end type PROB_T procedure(OBJ), pointer :: calfun_ext end module program nullify_05 use nullify_05_mod use nullify_05_type procedure(OBJ), pointer :: calfun type(PROB_T) :: calfun_2 calfun_2 % calfun_struct => OBJ nullify(calfun_2 % calfun_struct) calfun => OBJ nullify(calfun) calfun_ext => OBJ nullify(calfun_ext) if (associated(calfun)) error stop if (associated(calfun_ext)) error stop end program lfortran-lfortran-2f73434/integration_tests/read_23.f900000664000175000017500000000157615141516316023150 0ustar alastairalastairprogram read_23 ! Test READ with implied-do loop into assumed-size array dummy argument ! Reproduces LAPACK sdrgvx.f pattern: READ(NIN,*) (STRU(I), I=1,N) implicit none real :: work(100) integer :: i open(10, file='_read_23_test.dat', status='replace') write(10, *) 1.5, 2.5, 3.5, 4.5 close(10) call read_into_assumed(work, 4) close(10, status='delete') if (abs(work(1) - 1.5) > 1e-5) error stop if (abs(work(2) - 2.5) > 1e-5) error stop if (abs(work(3) - 3.5) > 1e-5) error stop if (abs(work(4) - 4.5) > 1e-5) error stop print *, "PASSED" contains subroutine read_into_assumed(arr, n) integer, intent(in) :: n real, intent(out) :: arr(*) integer :: i open(10, file='_read_23_test.dat', status='old') read(10, *) (arr(i), i = 1, n) close(10) end subroutine end program lfortran-lfortran-2f73434/integration_tests/class_93.f900000664000175000017500000000213115141516316023335 0ustar alastairalastair! Test copy-in/copy-out for class member passed to type-bound procedure module class_93_mod implicit none type :: token_t integer :: val = 0 end type type :: lexer_t integer :: pos = 0 type(token_t) :: tokens(3) contains procedure :: next => lexer_next end type type :: parser_t type(token_t) :: token end type contains subroutine lexer_next(lexer, token) class(lexer_t), intent(inout) :: lexer type(token_t), intent(inout) :: token lexer%pos = lexer%pos + 1 token = lexer%tokens(lexer%pos) end subroutine subroutine parse(parser, lexer) class(parser_t), intent(inout) :: parser class(lexer_t), intent(inout) :: lexer call lexer%next(parser%token) end subroutine end module program class_93 use class_93_mod implicit none type(parser_t) :: parser type(lexer_t) :: lexer lexer%tokens(1)%val = 10 lexer%tokens(2)%val = 20 lexer%tokens(3)%val = 30 call parse(parser, lexer) if (parser%token%val /= 10) error stop call parse(parser, lexer) if (parser%token%val /= 20) error stop print *, "PASSED" end program lfortran-lfortran-2f73434/integration_tests/types_22.f900000664000175000017500000000055615141516316023375 0ustar alastairalastairprogram types_22 real(8) :: A(3) = [1, 2, 3] integer(8) :: B(3) = [1.0, 2.0, 3.0] print*, A print*, B if ( abs(A(1) - 1.00) > 10e-5 ) error stop if ( abs(A(2) - 2.00) > 10e-5 ) error stop if ( abs(A(3) - 3.00) > 10e-5 ) error stop if ( B(1) /= 1 ) error stop if ( B(2) /= 2 ) error stop if ( B(3) /= 3 ) error stop endlfortran-lfortran-2f73434/integration_tests/do_concurrent_12.f900000664000175000017500000000127215141516316025070 0ustar alastairalastair! equivalent to openmp_30.f90 subroutine matrix_multiplication(l, m, n) use omp_lib integer, parameter :: dp = kind(0.d0) integer :: l, m, n, i, j, k integer :: seed real(dp) :: a(l, n), b(l, m), c(m, n) real(dp) :: start_time, end_time seed = 123456789 b = 121.124D0 c = 29124.012D0 do concurrent (j = 1:n) shared(a, b, c, l, m, n) local(i, k) do concurrent (i = 1:l) a(i,j) = 0 do concurrent (k = 1:m) a(i,j) = a(i,j) + b(i,k) * c(k,j) end do end do end do print *, "sum(a): ", sum(a) if (abs(sum(a) - (4.40952103686020386e+11_dp)) > 1e-12_dp) error stop end subroutine program do_concurrent_12 call matrix_multiplication(50, 50, 50) end program lfortran-lfortran-2f73434/integration_tests/modules_08_a.f900000664000175000017500000000016215141516316024176 0ustar alastairalastairmodule modules_08_a implicit none private public a contains integer function a() a = 3 end function end module lfortran-lfortran-2f73434/integration_tests/character_11c.c0000664000175000017500000000151415141516316024145 0ustar alastairalastair#include #include char f_string01_c( char *str ){ printf("C Side : f_string01_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string02_c( char str ){ printf("C Side : f_string02_c called with input argument [ %C ]\n", str); return str; } char f_string03_c( char *str ){ printf("C Side : f_string03_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string04_c( char *str ){ printf("C Side : f_string04_c called with input argument [ %s ]\n", str); str[1] = 'X'; return str[0]; } char f_string05_c( CFI_cdesc_t *str ){ printf("C Side : f_string05_c called with input argument [ %s ]\n", (char*)str->base_addr); ((char*)str->base_addr)[1] = 'X'; return ((char*)str->base_addr)[0]; } lfortran-lfortran-2f73434/integration_tests/dict_test_01_.f900000664000175000017500000000207515141516316024345 0ustar alastairalastairmodule dict_test_01_mod implicit none real :: eps = 1e-6 contains subroutine test_dict() _lfortran_dict(integer, real) :: rollnumber2cpi integer :: i integer :: size size = 1000 call _lfortran_set_item(rollnumber2cpi, 0, 1.1) do i=1000, 1000+size-1 call _lfortran_set_item(rollnumber2cpi, i, real(i)/100.0 + 5.0) end do do i=1000, 1000+size-1 if ( abs(_lfortran_get_item(rollnumber2cpi, i) - real(i)/100.0 - 5.0) > eps ) error stop end do if ( abs(_lfortran_get_item(rollnumber2cpi, 0) - 1.1) > eps ) error stop if ( _lfortran_len(rollnumber2cpi) /= 1001 ) error stop end subroutine subroutine test_issue_1348() if ( _lfortran_len(_lfortran_dict_constant(1, 2, 1, 3, 4, 5)) /= 2 ) error stop if ( _lfortran_len(_lfortran_dict_constant(1, 2, 1, 3, 1, 5)) /= 1 ) error stop end subroutine subroutine tests() call test_dict() call test_issue_1348() end subroutine end module program run_tuples use dict_test_01_mod call tests() end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_07a.f900000664000175000017500000000053015141516316026567 0ustar alastairalastairmodule separate_compilation_07a_mpi_c_bindings implicit none interface subroutine c_mpi_init(ierr) bind(C, name="mpi_init_wrapper") use iso_c_binding, only: c_int integer(c_int), intent(out) :: ierr end subroutine c_mpi_init end interface end module separate_compilation_07a_mpi_c_bindings lfortran-lfortran-2f73434/integration_tests/c_ptr_07.f900000664000175000017500000000355615141516316023346 0ustar alastairalastairmodule cptr_07_mod use iso_c_binding implicit none contains function f_string(cstr) result(fstr) character(len=1), pointer :: cstr(:) character(:), allocatable :: fstr integer :: i, n n = 0 do i = 1, size(cstr) if (cstr(i) == c_null_char) exit n = n + 1 end do allocate(character(len=n) :: fstr) do i = 1, n fstr(i:i) = cstr(i) end do end function f_string end module cptr_07_mod module cptr_07_mod_2 use iso_c_binding use cptr_07_mod implicit none contains function get_temp_filename() result(tempfile) integer, parameter :: MAX_FILENAME_LENGTH = 32768 character(:), allocatable :: tempfile type(c_ptr) :: c_tempfile_ptr character(len=1), pointer :: c_tempfile(:) interface function c_tempnam(dir, pfx) bind(C, name="tempnam") import :: c_ptr type(c_ptr), value :: dir type(c_ptr), value :: pfx type(c_ptr) :: c_tempnam end function c_tempnam subroutine c_free(ptr) bind(C, name="free") import :: c_ptr type(c_ptr), value :: ptr end subroutine c_free end interface c_tempfile_ptr = c_tempnam(C_NULL_PTR, C_NULL_PTR) if (.not. c_associated(c_tempfile_ptr)) then error stop "tempnam returned NULL" end if call c_f_pointer(c_tempfile_ptr, c_tempfile, [MAX_FILENAME_LENGTH]) tempfile = f_string(c_tempfile) call c_free(c_tempfile_ptr) end function get_temp_filename end module cptr_07_mod_2 program cptr_07 use cptr_07_mod_2 implicit none character(:), allocatable :: name allocate(name, source=get_temp_filename()) print *, "Temp filename =", trim(name) end program cptr_07 lfortran-lfortran-2f73434/integration_tests/arrays_04_func.f900000664000175000017500000000074715141516316024547 0ustar alastairalastairprogram arrays_04_func implicit none real :: a(3), b a(1) = 3 a(2) = 2 a(3) = 1 b = sum(a) if (abs(b-6) > 1e-5) error stop contains real function sum(a) result(r) real, intent(in) :: a(:) integer :: i print *, "sum" r = 0 do i = 1, size(a) r = r + a(i) end do end function real function abs(a) result(r) real, intent(in) :: a print *, "abs" if (a > 0) then r = a else r = -a end if end function end lfortran-lfortran-2f73434/integration_tests/array_02.f900000664000175000017500000000017015141516316023335 0ustar alastairalastairprogram array_02 implicit none real, dimension(3) :: a, b a = [1, 2, 3] b = (/ 1, 2, 3 /) print *, a, b end program lfortran-lfortran-2f73434/integration_tests/modules_28_module1.f900000664000175000017500000000073715141516316025336 0ustar alastairalastairmodule fpm_git implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git lfortran-lfortran-2f73434/integration_tests/string_76.f900000664000175000017500000000054415141516316023545 0ustar alastairalastairmodule string_76_mod implicit none contains character(5) function tolower (c) result (res) character, intent(in) :: c res = merge (achar (iachar (c) + 32), c, c >= 'A' .and. c <= 'Z') // "...." end function end module program string_76 use string_76_mod implicit none if (tolower("A") /= "a....") error stop end program string_76 lfortran-lfortran-2f73434/integration_tests/arrays_elemental_15.f900000664000175000017500000000513515141516316025560 0ustar alastairalastairprogram arrays_elemental_15 call elemental_sin() call elemental_cos() call elemental_trig_identity() contains subroutine verify1d(array, result, size) real(8), intent(in) :: array(:), result(:) integer, intent(in) :: size integer :: i real(8) :: eps eps = 1e-12 do i = 1, size if (abs(sin(sin(array(i))) - result(i)) > eps) error stop end do end subroutine subroutine verifynd(array, result, size1, size2, size3) real(8), intent(in) :: array(:, :, :), result(:, :, :) integer, intent(in) :: size1, size2, size3 integer :: i, j, k real(8) :: eps eps = 1e-12 do i = 1, size1 do j = 1, size2 do k = 1, size3 if (abs(sin(array(i, j, k))**2 - result(i, j, k)) > eps) error stop end do end do end do end subroutine subroutine verify2d(array, result, size1, size2) real(8), intent(in) :: array(:, :), result(:, :) integer, intent(in) :: size1, size2 integer :: i, j real(8) :: eps eps = 1e-12 do i = 1, size1 do j = 1, size2 if (abs(cos(array(i, j))**2 - result(i, j)) > eps) error stop end do end do end subroutine subroutine elemental_sin() integer :: i, j, k real(8) :: array1d(256), sin1d(256) real(8) :: arraynd(256, 64, 16), sinnd(256, 64, 16) do i = 1, 256 array1d(i) = i end do sin1d = sin(sin(array1d)) call verify1d(array1d, sin1d, 256) do i = 1, 256 do j = 1, 64 do k = 1, 16 arraynd(i, j, k) = i + j + k end do end do end do sinnd = sin(arraynd)**2 call verifynd(arraynd, sinnd, 256, 64, 16) end subroutine subroutine elemental_cos() integer :: i, j real(8) :: array2d(256, 64), cos2d(256, 64) do i = 1, 256 do j = 1, 64 array2d(i, j) = i + j end do end do cos2d = cos(array2d)**2 call verify2d(array2d, cos2d, 256, 64) end subroutine subroutine elemental_trig_identity() integer :: i, j, k, l real(8) :: eps real(8) :: arraynd(64, 32, 8, 4), observed(64, 32, 8, 4), observed1d(65536) integer :: newshape(1) eps = 1e-12 do i = 1, 64 do j = 1, 32 do k = 1, 8 do l = 1, 4 arraynd(i, j, k, l) = i + j + k + l end do end do end do end do observed = sin(arraynd)**2 + cos(arraynd)**2 newshape(1) = 65536 observed1d = reshape(observed, newshape) do i = 1, 65536 if( abs(observed1d(i) - 1.0) > eps ) error stop end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/pointer_02.f900000664000175000017500000000124315141516316023701 0ustar alastairalastairMODULE solvar_module REAL, DIMENSION(:,:), POINTER :: ptr_out CONTAINS SUBROUTINE solvar_allocate NULLIFY(ptr_out) ALLOCATE(ptr_out(5,1)) END SUBROUTINE solvar_allocate SUBROUTINE dim3_sweep(ptr_out) REAL, DIMENSION(5), INTENT(OUT) :: ptr_out PRINT *, ptr_out STOP END SUBROUTINE dim3_sweep SUBROUTINE octsweep !REAL, DIMENSION(5), pointer :: x !x = ptr_out(:,1) CALL dim3_sweep( ptr_out(:,1) ) END SUBROUTINE octsweep END MODULE solvar_module PROGRAM snap_main USE solvar_module, ONLY: solvar_allocate, octsweep CALL solvar_allocate CALL octsweep END PROGRAM snap_mainlfortran-lfortran-2f73434/integration_tests/logical_not_01.f900000664000175000017500000000047615141516316024521 0ustar alastairalastairsubroutine test_falseloc_pack() real, allocatable :: bvec(:) logical :: lvec(10) allocate(bvec(10)) bvec = 0 print *, .not. (bvec > 0) lvec = .not. (bvec > 0) print *, lvec if (any(.not. lvec)) error stop end subroutine program logical_not_01 call test_falseloc_pack() end program lfortran-lfortran-2f73434/integration_tests/derived_types_68.f900000664000175000017500000000121115141516316025076 0ustar alastairalastairmodule derived_types_68_mod type :: version_t integer :: major contains generic :: operator(==) => equals procedure, private :: equals end type version_t contains logical function equals(a, b) class(version_t), intent(in) :: a, b equals = a%major == b%major end function equals end module derived_types_68_mod program derived_types_68 use derived_types_68_mod, only: version_t type :: new_type type(version_t) :: version end type new_type type(new_type) :: obj1, obj2 obj1%version%major = 1 obj2%version%major = 5 if (obj1%version == obj2%version) error stop end programlfortran-lfortran-2f73434/integration_tests/template_array_05.f900000664000175000017500000000357115141516316025243 0ustar alastairalastairmodule template_array_05_m implicit none private public :: vector_t, matrix_t requirement op(t, plus_t) type, deferred :: t pure elemental function plus_t(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function end requirement template vector_t(t, plus_t, n) require :: op(t, plus_t) integer :: n private public :: add_array type :: vector type(t) :: elements(n) end type contains pure function add_vector(a, b) result(r) type(vector), intent(in) :: a, b type(vector) :: r r%elements = plus_t(a%elements, b%elements) end function end template template matrix_t(t, plus_t, n) require :: op(t, plus_t) integer :: n private public :: add_matrix type :: matrix type(t) :: elements(n, n) end type contains pure function add_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r r%elements = plus_t(a%elements, b%elements) end function end template end module program template_array_05 use template_array_05_m integer, parameter :: n = 10 instantiate vector_t(integer, operator(+), n), & only: int_vector => vector, & int_add_vector => add_vector type(int_vector) :: a, b, c integer :: i, j do i = 1, n a%elements(i) = i b%elements(i) = i end do c = int_add_vector(a, b) print *, c%elements instantiate matrix_t(integer, operator(+), n), & only: int_matrix => matrix, & int_add_matrix => add_matrix type(int_matrix) :: am, bm, cm do i = 1, n do j = 1, n am%elements(i,j) = i + j bm%elements(i,j) = i + j end do end do cm = int_add_matrix(am, bm) print *, cm%elements endlfortran-lfortran-2f73434/integration_tests/print_06.f900000664000175000017500000000207515141516316023365 0ustar alastairalastairprogram print_06 ! Type declaration type even_more_nested character(10) :: s end type even_more_nested type another_type integer :: ll type(even_more_nested) :: inn end type another_type type tt type(another_type) :: another_inst integer :: internal_integer integer :: arr(5) end type tt ! Variable declaration type(tt) :: inst(2) character(100) :: output inst(1)%internal_integer = 100 inst(1)%arr = 33 inst(1)%another_inst%ll = 99 inst(1)%another_inst%inn%s = "1234567890" inst(2)%internal_integer = 101 inst(2)%arr = 33 inst(2)%another_inst%ll = 99 inst(2)%another_inst%inn%s = "1234567890" print "(I0,2X,A,10X,I0,11X,5I0)", inst write(output, "(I0,2X,A,10X,I0,11X,5I0)") inst(1) print *, output if (output /= "99 1234567890 100 3333333333") error stop write(output, "(I0,2X,A,10X,I0,11X,5I0)") inst(2) print *, output if (output /= "99 1234567890 101 3333333333") error stop end programlfortran-lfortran-2f73434/integration_tests/common_substring_01.f900000664000175000017500000000130115141516316025603 0ustar alastairalastair! Reproducer: COMMON block CHARACTER substring must use COMMON struct member ! (reduced from LAPACK TESTING/LIN/xerbla.f) program common_substring_01 implicit none character(len=32) :: srnamt integer :: nout common /srname/ srnamt common /iounit/ nout nout = 6 srnamt = "XERBLA" call sub_use() print *, "PASS: common_substring_01" end program subroutine sub_use() implicit none character(len=32) :: srnamt integer :: nout common /srname/ srnamt common /iounit/ nout ! Substring read triggers StringSection on COMMON-backed character if (srnamt(1:1) /= "X") error stop "substring mismatch" write(nout, *) srnamt(1:6) end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_126.f900000664000175000017500000000050515141516316024475 0ustar alastairalastairprogram intrinsic_126 implicit none integer :: arg = 0 real :: num1, num2 call system_clock(arg) call srand(arg) call random_number(num1) call random_number(num2) print *, arg, num1, num2 ! Ensure num1 and num2 are different if (abs(num1 - num2) <= 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_31.f900000664000175000017500000000117215141516316024411 0ustar alastairalastairprogram intrinsics_31 real :: x = 63.29 real :: y = -63.59 integer, parameter :: dp = kind(0.d0) real(dp) :: z = 0.000001_dp real(dp) :: w = -1.000001_dp real :: x_ceil, y_ceil integer :: z_ceil, w_ceil x_ceil = ceiling(x) y_ceil = ceiling(y) z_ceil = ceiling(z) w_ceil = ceiling(w) if (abs(x_ceil - 64) > 1e-5) error stop if (abs(y_ceil - (-63)) > 1e-5) error stop if(z_ceil /= 1) error stop if(w_ceil /= -1) error stop print *, x_ceil, ceiling(x_ceil) print *, y_ceil, ceiling(y_ceil) print *, z_ceil print *, w_ceil end program intrinsics_31 lfortran-lfortran-2f73434/integration_tests/intrinsics_106.f900000664000175000017500000000025515141516316024475 0ustar alastairalastairprogram intrinsics_106 integer :: x(2, 3) print *, merge(size(x, 1), size(x, 2), mask = 1<0) if ( merge(size(x, 1), size(x, 2), mask = 1<0) /= 3 ) error stop endlfortran-lfortran-2f73434/integration_tests/separate_compilation_08.f900000664000175000017500000000036315141516316026433 0ustar alastairalastairprogram separate_compilation_08 use module_using_all_1_separate_compilation_08a use module_using_all_2_separate_compilation_08b real :: x(5) x = 9.2314 call test_all(x) x = 19.2314 call test_all_2(x) end program lfortran-lfortran-2f73434/integration_tests/if_01.f900000664000175000017500000000007015141516316022613 0ustar alastairalastairprogram if_01 implicit none if (.false.) error stop end lfortran-lfortran-2f73434/integration_tests/character_10c.c0000664000175000017500000000413215141516316024143 0ustar alastairalastair #include #include #include #include char f_string00_fortran(char *s); char f_string01_fortran(char s); char f_string02_fortran(char* s, int n); char f_string03_fortran(char* s); char f_string04_fortran(char* s); char f_string05_fortran(CFI_cdesc_t* s); int f_string00_c_caller(){ char s = 'H'; char r = f_string00_fortran(&s); printf("C Side : return of `f_string00_fortran` is [%c]\n", r); printf("%C\n", s); if(s != 'X'){ printf("C Terminating process\n"); exit(1); } } int f_string01_c_caller(){ char s = 'H'; char r = f_string01_fortran(s); printf("C Side : return of `f_string01_fortran` is [%c]\n", r); printf("%c\n", s); if(s == 'X'){ printf("C Terminating process\n"); exit(1); } } int f_string02_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "ABC",4); char r = f_string02_fortran(s, 3); printf("C Side : return of `f_string02_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '2'){ printf("C Terminating process\n"); exit(1); } } int f_string03_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "BCD",4); char r = f_string03_fortran(s); printf("C Side : return of `f_string03_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '3'){ printf("C Terminating process\n"); exit(1); } } int f_string04_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "CDE",4); char r = f_string04_fortran(s); printf("C Side : return of `f_string04_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '4'){ printf("C Terminating process\n"); exit(1); } } int f_string05_c_caller(){ char *s = (char*)malloc(4 * sizeof(char)); memcpy(s, "DEF",4); CFI_cdesc_t desc = {s, sizeof(char)}; char r = f_string05_fortran(&desc); printf("C Side : return of `f_string05_fortran` is [%c]\n", r); printf("%s\n", s); if(s[0] != '5'){ printf("C Terminating process\n"); exit(1); } } lfortran-lfortran-2f73434/integration_tests/intrinsics_255.f900000664000175000017500000000234115141516316024500 0ustar alastairalastairprogram intrinsics_255 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 print*, dbesjn(0, 2.0_dp) if (abs(dbesjn(0, 2.0_dp) - 0.22389077914123567_dp) > 10e-5_dp) error stop print *, dbesjn(1, 1.0_dp) if (abs(dbesjn(1, 1.0_dp) - 0.440050585744933_dp) > 10e-5_dp) error stop print *, dbesjn(2, 7.0_dp) if (abs(dbesjn(2, 7.0_dp) - (-0.30141722008594013_dp)) > 10e-5_dp) error stop print *, dbesjn(3, 0.5_dp) if (abs(dbesjn(3, 0.5_dp) - 2.5637299945872440E-003_dp) > 10e-5_dp) error stop print *, dbesjn(4, -13.6_dp) if (abs(dbesjn(4, -13.6_dp) - 0.14930687731069392_dp) > 10e-5_dp) error stop print *, dbesyn(0, 2.0_dp) if (abs(dbesyn(0, 2.0_dp) - 0.510375672649745_dp) > 10e-5_dp) error stop print *, dbesyn(1, 1.0_dp) if (abs(dbesyn(1, 1.0_dp) - (-0.7812128213002889_dp)) > 10e-5_dp) error stop print *, dbesyn(2, 7.0_dp) if (abs(dbesyn(2, 7.0_dp) - (-6.0526609468272125E-002_dp)) > 10e-5_dp) error stop print *, dbesyn(3, 0.5_dp) if (abs(dbesyn(3, 0.5_dp) - (-42.0594943047238914_dp)) > 10e-5_dp) error stop print *, dbesyn(4, 10.0_dp) if (abs(dbesyn(4, 10.0_dp) - (-1.44949511868093739e-01_dp)) > 10e-5_dp) error stop end programlfortran-lfortran-2f73434/integration_tests/class_90.f900000664000175000017500000000150015141516316023331 0ustar alastairalastairprogram class_90 implicit none integer :: x(3) x = [1, 2, 3] call print_any(x) contains subroutine print_any(val) class(*) :: val(:) select type(val) type is (integer) call print_any2(val) print *, "After modification in print_any2:", val(1), val(2), val(3) if (val(1) /= 10 .or. val(2) /= 20 .or. val(3) /= 30) error stop "Modification not reflected" end select end subroutine print_any subroutine print_any2(val) integer :: val(:) print *, "Integer array:", val if (size(val) /= 3) error stop "Size mismatch" if (val(1) /= 1 .or. val(2) /= 2 .or. val(3) /= 3) error stop "Value mismatch" val(1) = 10 val(2) = 20 val(3) = 30 end subroutine print_any2 end program class_90lfortran-lfortran-2f73434/integration_tests/list_of_tuples_test.f900000664000175000017500000000076315141516316026020 0ustar alastairalastairprogram list_of_tuples_test implicit none _lfortran_list(_lfortran_tuple(character(len=:), integer, real)) :: students call _lfortran_list_append(students, _lfortran_tuple_constant("Alice", 10, 99.3)) call _lfortran_list_append(students, _lfortran_tuple_constant("Bob", 7, 95.3)) call _lfortran_list_append(students, _lfortran_tuple_constant("Charlie", 9, 96.3)) if ( _lfortran_get_item(_lfortran_get_item(students, 1), 0) /= "Bob" ) error stop end program list_of_tuples_test lfortran-lfortran-2f73434/integration_tests/arrays_16_func.f900000664000175000017500000000065315141516316024546 0ustar alastairalastairprogram arrays_16_func real :: arr(17) integer :: i real :: sum2 do i = 1, 17 arr(i) = i end do call imply(arr, 17, sum2) print *, sum2 if( sum2 /= 153 ) error stop contains subroutine imply(f1, l1out, sum2) integer, intent(in) :: l1out real :: f1(l1out) real, intent(out) :: sum2 integer :: i1 sum2 = 0.0 do i1 = 1, l1out sum2 = sum2 + f1(i1) end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/array_bound_1.f900000664000175000017500000000104215141516316024442 0ustar alastairalastairprogram array_bound_1 integer :: a(2:5, 3:9, 7) integer :: b(1:2, 2:4, 3:6, 4:7) integer :: c(6:10, 7) integer :: d(4) print *, lbound(a, 1), lbound(a, 2), lbound(a, 3) print *, ubound(a, 1), ubound(a, 2), ubound(a, 3) print *, lbound(b, 1), lbound(b, 2), lbound(b, 3), lbound(b, 4) print *, ubound(b, 1), ubound(b, 2), ubound(b, 3), ubound(b, 4) print *, lbound(c, 1), lbound(c, 2) print *, ubound(c, 1), ubound(c, 2) print *, lbound(d, 1) print *, ubound(d, 1) end program array_bound_1lfortran-lfortran-2f73434/integration_tests/namelist_10.f900000664000175000017500000000462115141516316024037 0ustar alastairalastairprogram test_indexing implicit none ! Test array indexing syntax: arr(i,j) = value integer :: grid(3,3) real :: vec(5) integer :: i, j namelist /indexed/ grid, vec ! Initialize to zeros grid = 0 vec = 0.0 ! Create input file with array indexing open(unit=10, file='namelist_indexed.dat', status='replace', form='formatted') write(10, '(A)') ' &INDEXED' write(10, '(A)') ' grid(2,2) = 99' write(10, '(A)') ' grid(1,3) = 42' write(10, '(A)') ' grid(3,1) = 17' write(10, '(A)') ' vec(2) = 2.5' write(10, '(A)') ' vec(4) = 4.5' write(10, '(A)') ' /' close(10) ! Read namelist with array indexing open(unit=10, file='namelist_indexed.dat', status='old', form='formatted') read(10, nml=indexed) close(10) ! Verify grid(2,2) = 99 if (grid(2,2) /= 99) then print *, "Error: grid(2,2) =", grid(2,2), "expected 99" error stop "Array indexing test failed for grid(2,2)" end if ! Verify grid(1,3) = 42 if (grid(1,3) /= 42) then print *, "Error: grid(1,3) =", grid(1,3), "expected 42" error stop "Array indexing test failed for grid(1,3)" end if ! Verify grid(3,1) = 17 if (grid(3,1) /= 17) then print *, "Error: grid(3,1) =", grid(3,1), "expected 17" error stop "Array indexing test failed for grid(3,1)" end if ! Verify vec(2) = 2.5 if (abs(vec(2) - 2.5) > 1.0e-5) then print *, "Error: vec(2) =", vec(2), "expected 2.5" error stop "Array indexing test failed for vec(2)" end if ! Verify vec(4) = 4.5 if (abs(vec(4) - 4.5) > 1.0e-5) then print *, "Error: vec(4) =", vec(4), "expected 4.5" error stop "Array indexing test failed for vec(4)" end if ! Verify other elements remain zero do j = 1, 3 do i = 1, 3 if ((i /= 2 .or. j /= 2) .and. (i /= 1 .or. j /= 3) .and. (i /= 3 .or. j /= 1)) then if (grid(i,j) /= 0) then print *, "Error: grid(", i, ",", j, ") =", grid(i,j), "expected 0" error stop "Unmodified grid element changed" end if end if end do end do if (abs(vec(1)) > 1.0e-5 .or. abs(vec(3)) > 1.0e-5 .or. abs(vec(5)) > 1.0e-5) then error stop "Unmodified vec element changed" end if print *, "Array indexing namelist test passed!" end program test_indexing lfortran-lfortran-2f73434/integration_tests/assign_allocatable_array_of_struct_instances.f900000664000175000017500000000165415141516316033072 0ustar alastairalastairprogram assign_allocatable_array_of_struct_instances implicit none integer :: i type :: string character(:), allocatable :: s end type type(string), allocatable :: tokens(:) allocate(tokens(5)) do i = 1, 5 tokens(i)%s = "a" end do tokens = merge_pair(tokens, 1) contains function merge_pair(intokens, idx) result(tkns) ! Merge the pair `idx` type(string), intent(in) :: intokens(:) integer, intent(in) :: idx type(string), allocatable :: tkns(:) type(string) :: merged_token merged_token%s = intokens(idx)%s // intokens(idx+1)%s ! The segmentation fault occurs at the below line, when used with ! `--experimental-simplifier` flag (i.e. simplifier pass enabled) and ! no `--realloc-lhs` flag is enabled for it tkns = [intokens(:idx-1), merged_token, intokens(idx+2:)] end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_43.f900000664000175000017500000000053715141516316024420 0ustar alastairalastairprogram intrinsics_43 implicit none integer :: x = dim(4, 15) integer :: y = dim(15, 4) real(8) :: p = dim(4.345_8, 2.111_8) real(8) :: q = dim(2.111_8, 4.345_8) if (x /= 0) error stop if (y /= 11) error stop if (p /= (4.345_8 - 2.111_8)) error stop if (q /= 0) error stop print *, x, y, p, q end program lfortran-lfortran-2f73434/integration_tests/class_54.f900000664000175000017500000000304015141516316023332 0ustar alastairalastairmodule class_54_m implicit none type :: hashmap_type integer(4) :: num_entries = 3 end type hashmap_type end module class_54_m program test_open_maps use class_54_m implicit none type(hashmap_type) :: map, map2 ! intent(out) print *, map%num_entries if (map%num_entries /= 3) error stop call init_open_map(map) print *, map%num_entries if (map%num_entries /= 3) error stop map%num_entries = map%num_entries + 1 print *, map%num_entries if (map%num_entries /= 4) error stop call init_open_map(map) print *, map%num_entries if (map%num_entries /= 3) error stop ! intent(inout) print *, map2%num_entries if (map2%num_entries /= 3) error stop call init_open_map_inout(map2, 3) print *, map2%num_entries if (map2%num_entries /= 3) error stop map2%num_entries = map2%num_entries + 1 print *, map2%num_entries if (map2%num_entries /= 4) error stop call init_open_map_inout(map2, 4) print *, map2%num_entries if (map2%num_entries /= 4) error stop contains subroutine init_open_map( map ) class(hashmap_type), intent(out) :: map print *, map%num_entries if (map%num_entries /= 3) error stop end subroutine init_open_map subroutine init_open_map_inout( map, i ) class(hashmap_type), intent(inout) :: map integer, intent(in) :: i print *, i, map%num_entries if (map%num_entries /= i) error stop end subroutine init_open_map_inout end program test_open_maps lfortran-lfortran-2f73434/integration_tests/file_18_data.txt0000664000175000017500000000001315141516316024353 0ustar alastairalastair 10001 lfortran-lfortran-2f73434/integration_tests/minpack_01_func.f900000664000175000017500000000022515141516316024654 0ustar alastairalastair double precision function enorm1(n) result(y) double precision n y = dabs(n) return end function lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_04.f900000664000175000017500000000140515141516316026052 0ustar alastairalastairmodule pass_array_by_data_04_find_fit_module contains subroutine find_fit(data_x) real, intent(in) :: data_x(:) real :: y y = 0 call fcn(data_x, y) print *, y if (abs(y - 6.0) > 1e-6) error stop contains subroutine fcn(data_x, y) real, intent(in) :: data_x(:) real, intent(out) :: y integer :: i do i = 1, size(data_x) y = y + data_x(i) end do end subroutine fcn end subroutine find_fit end module program main use pass_array_by_data_04_find_fit_module, only: find_fit implicit none real :: data_x(3) integer :: i do i = 1, 3 data_x(i) = i end do call find_fit(data_x) end program main lfortran-lfortran-2f73434/integration_tests/custom_operator_06.f900000664000175000017500000000213315141516316025451 0ustar alastairalastairmodule custom_operator_06_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_06_a module custom_operator_06_b use custom_operator_06_a implicit none contains subroutine test_concat type(string_t) :: str str = string_t("a") // string_t("b") end subroutine test_concat end module custom_operator_06_b program custom_operator_06 use custom_operator_06_b implicit none call test_concat() end program custom_operator_06 lfortran-lfortran-2f73434/integration_tests/allocate_18.f900000664000175000017500000000076215141516316024021 0ustar alastairalastairprogram allocate_18 implicit none integer, allocatable :: i real, allocatable :: r complex, allocatable :: c logical, allocatable :: l allocate(i) allocate(r) allocate(c) allocate(l) i = 10 r = 4.4 c = (1, 2) l = .true. if (i /= 10) error stop if (r /= 4.4) error stop if (c /= (1, 2)) error stop if (l .neqv. .true.) error stop deallocate(i) deallocate(r) deallocate(c) deallocate(l) end program allocate_18 lfortran-lfortran-2f73434/integration_tests/derived_types_01.f900000664000175000017500000000132515141516316025067 0ustar alastairalastairmodule derived_types_01_m_01 implicit none type :: X real :: r integer :: i end type type :: Y complex :: c type(X) :: d end type contains subroutine set(a) type(X), intent(out) :: a a%i = 1 a%r = 1.5 end subroutine end module module derived_types_01_m_02 use derived_types_01_m_01, only: Y implicit none type :: Z complex :: k type(Y) :: l end type end module program derived_types_01 use derived_types_01_m_02, only: Z use derived_types_01_m_01, only: X, set implicit none type(X) :: b type(Z) :: c b%i = 5 b%r = 3.5 print *, b%i, b%r call set(b) print *, b%i, b%r c%l%d%r = 2.0 c%l%d%i = 2 c%k = (2.0, 2.0) print *, c%l%d%r, c%l%d%i, c%k call set(c%l%d) print *, c%l%d%r, c%l%d%i, c%k end lfortran-lfortran-2f73434/integration_tests/intrinsics_product_nodes_01.f900000664000175000017500000000047015141516316027336 0ustar alastairalastairprogram intrinsics_product_nodes use, intrinsic :: iso_fortran_env, only: int32 implicit none integer, parameter :: ndim = 1 integer(int32), dimension(ndim), parameter :: nodes = [10_int32] integer(int32), parameter :: ncol = product(nodes) if (ncol /= 10_int32) error stop end program lfortran-lfortran-2f73434/integration_tests/read_17.f900000664000175000017500000000123515141516316023143 0ustar alastairalastairprogram read_17 ! Test combined END= and ERR= labels implicit none integer :: x, u, count open(newunit=u, status='scratch') write(u, '(I5)') 42 write(u, '(I5)') 99 rewind(u) count = 0 10 continue read(u, *, end=30, err=20) x count = count + 1 if (count == 1 .and. x /= 42) error stop "First value should be 42" if (count == 2 .and. x /= 99) error stop "Second value should be 99" goto 10 20 continue error stop "Should not reach ERR label with valid data" 30 continue close(u) if (count /= 2) error stop "Should have read 2 values" print *, "PASS: combined END=/ERR= works" end program read_17 lfortran-lfortran-2f73434/integration_tests/intrinsics_343.f900000664000175000017500000000145615141516316024504 0ustar alastairalastairprogram intrinsics_343 integer, allocatable :: b(:) integer, dimension(3, 4) :: a integer, dimension(3, 3, 2) :: c a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], shape=[3, 4]) c = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], shape=[3, 3, 2]) allocate(b(3)) b = reshape([1, 2, 3], shape=[3]) print *, cshift(b, 2) b = cshift(b, 2) print *, b print *, cshift(a, 2) a = cshift(a, 2) print *, a print *, cshift(c, 2) c = cshift(c, 2) print *, c if( any(b /= [3, 1, 2] ) ) error stop if( any(a /= reshape([3, 1, 2, 6, 4, 5, 9, 7, 8, 12 ,10, 11], shape=[3, 4]) )) error stop if ( any(c /= reshape([3, 1, 2, 6, 4, 5, 9, 7, 8, 12 ,10, 11, 15, 13, 14, 18, 16, 17], shape=[3, 3, 2]) ) ) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_43.f900000664000175000017500000000155715141516316023706 0ustar alastairalastairmodule modules_43_fpm_sources implicit none type srcfile_t character(:), allocatable :: file_name character(:), allocatable :: exe_name integer(8) :: digest end type srcfile_t contains subroutine add_sources_from_dir(sources) type(srcfile_t), allocatable, intent(inout), target :: sources(:) logical :: exclude_source(10) type(srcfile_t), allocatable :: dir_sources(:) allocate(dir_sources(1)) if (.not. allocated(sources)) then sources = pack(dir_sources, .not. exclude_source) else sources = [sources, pack(dir_sources, .not. exclude_source)] end if end subroutine add_sources_from_dir end module modules_43_fpm_sources program modules_43 use modules_43_fpm_sources implicit none type(srcfile_t), allocatable, target :: sources(:) allocate(sources(1)) call add_sources_from_dir(sources) end program modules_43 lfortran-lfortran-2f73434/integration_tests/bindc2.f900000664000175000017500000000157215141516316023066 0ustar alastairalastairprogram bindc2 use iso_c_binding, only: c_loc, c_ptr, c_f_pointer type(c_ptr) :: queries integer :: idx = 1 integer(2), target :: xv(3, 4) integer :: newshape(2) integer(2), pointer :: x(:, :) newshape(1) = 2 newshape(2) = 3 x => xv if( lbound(xv, 1) /= 1) error stop if( ubound(xv, 1) /= 3) error stop if( lbound(xv, 2) /= 1) error stop if( ubound(xv, 2) /= 4) error stop if( size(xv) /= 12 ) error stop call c_f_pointer(queries, x, newshape) if( lbound(xv, 1) /= 1) error stop if( ubound(xv, 1) /= 3) error stop if( lbound(xv, 2) /= 1) error stop if( ubound(xv, 2) /= 4) error stop if( size(xv) /= 12 ) error stop print *, lbound(x, 1), ubound(x, 1) print *, lbound(x, 2), ubound(x, 2) print *, size(x) if( lbound(x, 1) /= 1) error stop if( ubound(x, 1) /= 2) error stop if( lbound(x, 2) /= 1) error stop if( ubound(x, 2) /= 3) error stop if( size(x) /= 6 ) error stop end program lfortran-lfortran-2f73434/integration_tests/string_58.f900000664000175000017500000000052615141516316023545 0ustar alastairalastair! Note : gfortran fails for this, most of the other compiler don't program string_58 character(:), pointer :: str character(10), target :: str2 print *, associated(str) if(associated(str) .neqv. .false.) error stop str=> str2 print *, associated(str) if(associated(str) .neqv. .true.) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_211.f900000664000175000017500000001122115141516316024465 0ustar alastairalastairprogram intrinsics_211 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer(4) :: n(32) real(dp) :: x(32) real(dp) :: expected(32) real(dp) :: expected_res(22) integer :: i real :: y(15) real :: expected_y(15) real(dp), parameter :: res(22) = bessel_yn( [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21], [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 9.98600559790084e307_dp, 9.98600559790084e307_dp]) expected_res = [7.9836428649154907E-155_dp, -3.6987410577069679E-155_dp, -4.4632457212022061E-155_dp, & 7.9441122443324676E-155_dp, -2.1380390500553400E-002_dp, -19.681876164160990_dp, 0.26769853787891268_dp, & -6602481872.7862654_dp, 6.2260410422729083E-002_dp, 2.3302194134673972E-002_dp, -11087103.624584278_dp, & -185141909.80786872_dp, 9.9380926537565341E-003_dp, -9.5332917725880678E-002_dp, 5.6103040905370369E-002_dp, & -0.16533163717923532_dp, -0.31944510718813779_dp, -271.27888890185812_dp, -971.72716878320409_dp, & -3751.3930153366728_dp, 7.98364286491549068e-155_dp, 7.9836428649154907E-155_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_res(i)) > 1e-5_dp) error stop end do n = [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31, & 32, 37, 38, 39] x = [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, 9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [7.9836428649154907E-155_dp, -3.6987410577069675E-155_dp, -4.4632457212022053E-155_dp, & 7.9441122443324676E-155_dp, -2.1380390500553400E-002_dp, -19.681876164160990_dp, 0.26769853787891268_dp, & -6602481872.7862644_dp, 6.2260410422729083E-002_dp, 2.3302194134673972E-002_dp, -11087103.624584274_dp, & -185141909.80786863_dp, 9.9380926537565445E-003_dp, -8.4582551546166423E-002_dp, 0.11571053986948637_dp, & 0.19158786386926477_dp, -1.6795286872077928_dp, -64130.286072844458_dp, -293361.46715134638_dp, & -1425639.5600599083_dp, -2.6148750349709140E+033_dp, -1.9070269429225925E+035_dp, -1.4497388677441211E+037_dp, & -1.1469745997353528E+039_dp, -1.9768410955067933E+044_dp, -2.2022757572664989E+046_dp, -2.5416271515658601E+048_dp, & -3.0455075866672117E+050_dp, 2.9475297628969036E-003_dp, 3.3552491139733728E-002_dp, 1.7701295549281584E-002_dp, & -2.5556786290672439E-002_dp] do i = 1, size(x) print *, bessel_yn(n(i), x(i)), "i = ", i if (abs((bessel_yn(n(i), x(i)) - expected(i))/expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 1036.462826483388272_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 036.462826483388272_sp] expected_y = [ -2.14771368E-02_sp, -0.272538334_sp, 5.23242168E-02_sp, 1.24606974E-02_sp, & 5.87534383E-02_sp, 2.42299046E-02_sp, -623.942322_sp, -5497.98242_sp, & -0.143518567_sp, 6.74885958E-02_sp, -6.34354725E-02_sp, 3.99038307E-02_sp, & 0.209239334_sp, -271.279022_sp, -8.33194777E-02_sp] do i = 1, size(y) print *, bessel_yn(n(i), y(i)), "i = ", i if (abs((bessel_yn(n(i), y(i)) - expected_y(i))/expected_y(i)) > 1e-5) error stop end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_406.f900000664000175000017500000000110515141516316024473 0ustar alastairalastairprogram intrinsics_iachar ! Test iachar intrinsic with array arguments (issue #9495) implicit none integer, parameter:: ch(2) = iachar(['A','a']) integer :: ch2(3) ! Test compile-time evaluation if (ch(1) /= 65) error stop if (ch(2) /= 97) error stop ! Test runtime evaluation ch2 = iachar(['X', 'y', 'Z']) if (ch2(1) /= 88) error stop ! 'X' if (ch2(2) /= 121) error stop ! 'y' if (ch2(3) /= 90) error stop ! 'Z' ! Test with scalar if (iachar('B') /= 66) error stop print *, "All iachar tests passed" end program lfortran-lfortran-2f73434/integration_tests/functions_02.f900000664000175000017500000000065615141516316024240 0ustar alastairalastairprogram functions_02 implicit none integer :: i real :: f, g i = 1 f = 3.5 g = mysum(i, f) if (myabs(g-4.5) > 1e-5) error stop contains real function mysum(a, b) result(c) integer, intent(in) :: a real, intent(in) :: b c = a + b end function real function myabs(a) result(c) real, intent(in) :: a if (a >= 0) then c = a else c = -a end if end function end program lfortran-lfortran-2f73434/integration_tests/derived_types_20.f900000664000175000017500000000033515141516316025070 0ustar alastairalastairprogram main use fpm_command_line_20, only: fpm_cmd_settings, get_command_line_settings implicit none class(fpm_cmd_settings), allocatable :: cmd_settings call get_command_line_settings(cmd_settings) end program main lfortran-lfortran-2f73434/integration_tests/transfer_07.f900000664000175000017500000000050415141516316024051 0ustar alastairalastairprogram transfer_07 integer(4), parameter :: scalar = 4 integer(2), parameter :: mold = 0 integer(2) :: array(2) array = transfer( scalar, mold, 2 ) print *, array(1) if (array(1) /= 4) error stop ! TODO : Add test for complete array with error stop after fixing transfer completely end programlfortran-lfortran-2f73434/integration_tests/derived_types_37.f900000664000175000017500000000274415141516316025106 0ustar alastairalastairprogram derived_types_37 implicit none TYPE test_type2 integer :: num END TYPE test_type2 TYPE test_type1 integer :: num integer :: arr_1(3) type(test_type2):: arr_2(3) END TYPE test_type1 integer :: i TYPE(test_type1), DIMENSION(5) :: main_arr TYPE(test_type1), allocatable :: main_arr_alloc(:) main_arr%num = 44 do i =1, 5 print *, main_arr(i)%num if(main_arr(i)%num /= 44) error stop end do main_arr(1)%arr_1 = 33 do i =1, 3 print *,main_arr(1)%arr_1(i) if(main_arr(1)%arr_1(i) /= 33) error stop end do main_arr(1)%arr_2%num = 22 do i =1, 3 print *,main_arr(1)%arr_2(i)%num if(main_arr(1)%arr_2(i)%num /= 22) error stop end do ! Duplicate test with allocatable array ! to check that implied array assignment in structInstanceMember isn't dependent on known compile time size. allocate(main_arr_alloc(5)) main_arr_alloc%num = 44 do i =1, 5 print *, main_arr_alloc(i)%num if(main_arr_alloc(i)%num /= 44) error stop end do main_arr_alloc(1)%arr_1 = 33 do i =1, 3 print *,main_arr_alloc(1)%arr_1(i) if(main_arr_alloc(1)%arr_1(i) /= 33) error stop end do main_arr_alloc(1)%arr_2%num = 22 do i =1, 3 print *,main_arr_alloc(1)%arr_2(i)%num if(main_arr_alloc(1)%arr_2(i)%num /= 22) error stop end do end program derived_types_37 lfortran-lfortran-2f73434/integration_tests/namelist_28.f900000664000175000017500000000335415141516316024052 0ustar alastairalastairprogram namelist_28 ! Test for handling null values with comma separators implicit none character(len=15), allocatable :: name(:) integer :: count namelist /expected/ name, count character(len=256) :: readme(4) integer :: i ! Test null value for array with comma separator before next variable allocate(name(10)) name = [(repeat(' ', len(name)), i=1, size(name))] count = 0 readme(1) = '&EXPECTED' readme(2) = ' NAME=,' readme(3) = ' COUNT=42' readme(4) = ' /' read(readme, nml=expected) print *, 'Test 1: NAME should remain blank, COUNT should be 42' if (trim(name(1)) /= '') then error stop 'NAME should be blank (null value)' end if if (count /= 42) then error stop 'COUNT should be 42' end if ! Test null value at end with comma count = 0 readme(1) = '&EXPECTED' readme(2) = ' COUNT=99,' readme(3) = ' NAME=,' readme(4) = ' /' read(readme, nml=expected) print *, 'Test 2: COUNT should be 99, NAME should remain blank' if (count /= 99) then error stop 'COUNT should be 99' end if if (trim(name(1)) /= '') then error stop 'NAME should be blank (null value) in test 2' end if ! Test multiple values with commas count = 0 readme(1) = '&EXPECTED' readme(2) = ' COUNT=123, NAME="test"' readme(3) = ' /' readme(4) = ' ' read(readme, nml=expected) print *, 'Test 3: COUNT should be 123, NAME(1) should be "test"' if (count /= 123) then error stop 'COUNT should be 123 in test 3' end if if (trim(name(1)) /= 'test') then error stop 'NAME(1) should be "test" in test 3' end if print *, 'OK: All tests passed' end program namelist_28 lfortran-lfortran-2f73434/integration_tests/procedure_10.f900000664000175000017500000000063315141516316024212 0ustar alastairalastairmodule procedure_10_mod contains subroutine sub_type(int) integer,intent(in) :: int end subroutine subroutine sub(int) integer,intent(in) :: int print *, int if (int /= 6) error stop end subroutine sub end module procedure_10_mod program procedure_10 use procedure_10_mod procedure(sub_type), pointer :: p_sub p_sub => sub call p_sub(6) end program procedure_10lfortran-lfortran-2f73434/integration_tests/implicit_typing_06.f900000664000175000017500000000037015141516316025431 0ustar alastairalastairmodule mod_implicit_typing_06 implicit none private public a integer, parameter :: a = 1 end module mod_implicit_typing_06 program implicit_typing_06 use mod_implicit_typing_06 print *, a if (a /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_272.f900000664000175000017500000000212115141516316024473 0ustar alastairalastairprogram intrinsics_272 implicit none integer(4), parameter :: i1 = trailz(1050) integer(8), parameter :: i2 = trailz(000) integer, parameter :: ar1(3) = trailz([0000821095, 829012001, 039024800]) integer(4) :: i3 = 283200001 integer(8) :: i4 = 289000001 integer(4) :: arr1(3) = [02471095, 820012001, 039024800] integer(8) :: arr2(3) = [13471095, 8290000, 0392414800] print *, i1 if (i1 /= 1) error stop print *, i2 if (i2 /= 32) error stop print *, ar1 if (any(ar1 /= [0, 0, 5])) error stop print *, trailz(i3) if (trailz(i3) /= 0) error stop print *, trailz(i4) if (trailz(i4) /= 0) error stop print *, trailz(arr1) ! if (any(trailz(arr1) /= [0, 0, 5])) error stop ! Does not work #4363 print *, trailz(arr2) ! if (any(trailz(arr2) /= [0, 4, 4])) error stop print *, kind(trailz(0)) if (kind(trailz(0)) /= 4) error stop print *, kind(trailz(0_4)) if (kind(trailz(0_4)) /= 4) error stop print *, kind(trailz(0_8)) ! if (kind(trailz(0_8)) /= 4) error stop ! Gives wrong output end program lfortran-lfortran-2f73434/integration_tests/intrinsics_202.f900000664000175000017500000000071315141516316024471 0ustar alastairalastairprogram intrinsics_202 integer, parameter :: dp = kind(0.d0) real(dp), parameter :: A(*) = [1._dp, 2._dp, 3._dp] real(dp), parameter :: B(*) = A real(dp), parameter :: C(*) = sin(A) print *, B if (any(A /= B)) error stop print *, C if (abs(C(1) - 8.41470984807896505e-01) > 1e-5) error stop if (abs(C(2) - 9.09297426825681727e-01) > 1e-5) error stop if (abs(C(3) - 0.14112000805986721) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/transfer_04.f900000664000175000017500000000157715141516316024061 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_04 use iso_fortran_env, only: int16, int8, int32, int64 contains pure module function int8_water_hash( key ) result(hash_code) integer(int32) :: hash_code integer(int8), intent(in) :: key(:) hash_code = sum(key) end function int8_water_hash subroutine int16_water_hash( key ) integer(int16), intent(in) :: key(:) print *, transfer( key, 0_int8, size(key, kind=int64) ) print *, int8_water_hash( transfer( key, 0_int8, size(key, kind=int64) ) ) ! TODO: values diverge with GFortran, PR intends to fix code generation error end subroutine int16_water_hash end module stdlib_hash_32bit_water_transfer_04 program transfer_04 use stdlib_hash_32bit_water_transfer_04 integer(int16) :: key(10) key = 9 call int16_water_hash(key) end program lfortran-lfortran-2f73434/integration_tests/do_loop_07.f900000664000175000017500000000104215141516316023656 0ustar alastairalastairprogram do_loop_07 integer :: i, s do i = 1, 3 if (i == 1) then ! There should be an ImplicitDeallocate for __libasr_created_string_format here cycle end if print *, new_array(i) ! There should be an ImplicitDeallocate for __libasr_created_string_format here end do contains function new_array(i) result(t) integer, intent(in) :: i integer, allocatable :: t(:) allocate(t(i)) t = 1 end function end program lfortran-lfortran-2f73434/integration_tests/interface_01.f900000664000175000017500000000102215141516316024153 0ustar alastairalastairmodule interface_01_mod implicit none interface a module procedure a1 module procedure a2 end interface contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine subroutine a2(a) real, intent(in out) :: a a = a + 1 end subroutine end module program interface_01 use interface_01_mod, only: a implicit none integer :: i real :: r i = 5 call a(i) if (i /= 6) error stop r = 6 call a(r) if (r /= 7) error stop i = 7 call a(i) if (i /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/nested_callback_arrays.f900000664000175000017500000000363715141516316026410 0ustar alastairalastairmodule linalg_mod use iso_fortran_env, only: real64 implicit none private public :: inprod, matprod12 contains function inprod(x, y) result(z) real(real64), intent(in) :: x(:) real(real64), intent(in) :: y(:) real(real64) :: z integer :: i z = 0.0_real64 do i = 1, int(size(x), kind(i)) z = z + x(i) * y(i) end do end function inprod function matprod12(x, y) result(z) real(real64), intent(in) :: x(:) real(real64), intent(in) :: y(:, :) real(real64) :: z(size(y, 2)) integer :: j do j = 1, int(size(y, 2), kind(j)) z(j) = inprod(x, y(:, j)) end do end function matprod12 end module linalg_mod module caller_mod use iso_fortran_env, only: real64 implicit none private public :: call_calcfc abstract interface subroutine objcon(x, constr) import real64 real(real64), intent(in) :: x(:) real(real64), intent(out) :: constr(:) end subroutine objcon end interface contains subroutine call_calcfc(calcfc, x, constr) procedure(objcon) :: calcfc real(real64), intent(in) :: x(:) real(real64), intent(out) :: constr(:) call calcfc(x, constr) end subroutine call_calcfc end module caller_mod program nested_callback_arrays use iso_fortran_env, only: real64 use linalg_mod, only: matprod12 use caller_mod, only: call_calcfc implicit none real(real64) :: amat(2, 1) real(real64) :: bvec(1) real(real64) :: x(2) real(real64) :: constr(1) amat = 1.0_real64 bvec = 0.0_real64 x = [1.0_real64, 2.0_real64] call call_calcfc(calcfc_internal, x, constr) if (constr(1) /= 3.0_real64) error stop contains subroutine calcfc_internal(x_internal, constr_internal) real(real64), intent(in) :: x_internal(:) real(real64), intent(out) :: constr_internal(:) constr_internal = matprod12(x_internal, amat) - bvec end subroutine calcfc_internal end program nested_callback_arrays lfortran-lfortran-2f73434/integration_tests/intrinsics_256.f900000664000175000017500000000336115141516316024504 0ustar alastairalastairprogram intrinsics_256 implicit none integer(4), parameter :: i1 = minval([1, 2, 3]) real(4), parameter :: i2 = minval([1.0, 2.0, 3.0]) integer(8), parameter :: i3 = minval([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i4 = minval([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) integer(4), parameter :: i5 = minval([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i6 = minval([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 1) error stop print *, i2 if (abs(i2 - 1.00000000e+00) > 1e-6) error stop print *, i3 if (i3 /= 1) error stop print *, i4 if (abs(i4 - 1.50000000000000000e+00) > 1e-12) error stop print *, i5 if (i5 /= 5) error stop print *, i6 if (abs(i6 - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1) if (minval(ar1) /= 1) error stop print *, minval(ar2) if (abs(minval(ar2) - 1.00000000e+00) >1e-6 ) error stop print *, minval(ar1, mask) if (minval(ar1, mask) /= 1) error stop print *, minval(ar2, mask = mask) if (abs(minval(ar2, mask = mask) - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1, dim) if (minval(ar1, dim) /= 1) error stop print *, minval(ar2, dim = dim) if (abs(minval(ar2, dim = dim) - 1.00000000e+00) > 1e-6) error stop print *, minval(ar1, mask = mask, dim = dim) if (minval(ar1, mask = mask, dim = dim) /= 1) error stop print *, minval(ar2, dim, mask) if (abs(minval(ar2, dim, mask) - 1.00000000e+00) > 1e-6) error stop end programlfortran-lfortran-2f73434/integration_tests/binop_03.f900000664000175000017500000000041115141516316023325 0ustar alastairalastairprogram binop_03 integer(8) :: x real(8) :: y x = 665663010 x = x**2 print *, x if(x /= 443107242882260100_8) error stop y = 665663010 y = y**2 print *, y if(abs(y - 443107242882260100_8) > 10e-20) error stop end programlfortran-lfortran-2f73434/integration_tests/callback_01.f900000664000175000017500000000071015141516316023752 0ustar alastairalastairmodule callback_01 contains real function cb(f, a, b) real, intent(in) :: a, b interface real function f(x) implicit none real, intent(in) :: x end function end interface cb = (b-a) + f(a) + f(b) end function subroutine foo(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = 2*x end function f end subroutine foo end module program main use callback_01 call foo(1.5, 2.0) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_134.f900000664000175000017500000000117615141516316024501 0ustar alastairalastairprogram intrinsics_134 character(4), parameter :: y = adjustl("okay") character(len=5) :: x character(len=20) :: str = ' gfortran' str = adjustl(str) print *, str if (str /= 'gfortran') error stop str = adjustl(' gfortran') print *, str if (str /= 'gfortran') error stop print *, "|"//adjustl(" abc")//"|" if ("|"//adjustl(" abc")//"|" /= '|abc |') error stop x = " " print *, adjustl(x) print *, adjustl(" ") if (adjustl(" ") /= " ") error stop if (adjustl(x) /= " ") error stop if (y /= "okay") error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_25.f900000664000175000017500000000023515141516316024012 0ustar alastairalastairprogram allocate_25 implicit none integer, allocatable :: x allocate(x, source = 5) print *, x if (x /= 5) error stop end program allocate_25 lfortran-lfortran-2f73434/integration_tests/array_01_transfer.f900000664000175000017500000000017615141516316025246 0ustar alastairalastairprogram array_01_transfer integer :: m(6), size = 2 m = [ 1, 0, 0, 0, 5, 0 ] print *, transfer(m, 1.0, size) end programlfortran-lfortran-2f73434/integration_tests/string_19.f900000664000175000017500000000536315141516316023546 0ustar alastairalastairmodule string_19_stdlib_string_type implicit none type :: string_type sequence character(len=:), allocatable :: raw end type string_type interface len module procedure :: len_string end interface len interface char module procedure :: char_string end interface char contains elemental function len_string(string) result(length) type(string_type), intent(in) :: string integer :: length end function len_string pure function char_string(string) result(character_string) type(string_type), intent(in) :: string character(len=len(string)) :: character_string end function char_string end module module string_19_stdlib_strings use string_19_stdlib_string_type implicit none interface padl module procedure :: padl_char_default module procedure :: padl_char_pad_with end interface padl contains pure function compute_lps(string) result(lps_array) character(len=*), intent(in) :: string integer :: lps_array(len(string)) end function compute_lps function compute_lps_use(string) result(l) character(len=*), intent(in) :: string integer :: l print *, compute_lps(string) end function compute_lps_use function compute_lps_use1(string) result(l) type(string_type), intent(in) :: string integer :: l print *, char(string) end function compute_lps_use1 pure function padl_string_default(string, output_length) result(res) type(string_type), intent(in) :: string integer, intent(in) :: output_length type(string_type) :: res res = string_type(padl(char(string), output_length, " ")) end function padl_string_default pure function padl_string_pad_with(string, output_length, pad_with) result(res) type(string_type), intent(in) :: string integer, intent(in) :: output_length character(len=1), intent(in) :: pad_with type(string_type) :: res res = string_type(padl(char(string), output_length, pad_with)) end function padl_string_pad_with pure function padl_char_default(string, output_length) result(res) character(len=*), intent(in) :: string integer, intent(in) :: output_length character(len=len(string)) :: res res = padl(string, output_length, " ") end function padl_char_default pure function padl_char_pad_with(string, output_length, pad_with) result(res) character(len=*), intent(in) :: string integer, intent(in) :: output_length character(len=1), intent(in) :: pad_with character(len=max(len(string), output_length)) :: res integer :: string_length end function padl_char_pad_with end module program stdlib_strings_use use string_19_stdlib_strings implicit none end program lfortran-lfortran-2f73434/integration_tests/type_parameter_inquiry_01.f900000664000175000017500000000133715141516316027025 0ustar alastairalastairprogram type_parameter_inquiry_01 real(kind=8) :: real8 complex :: c character(len=10) :: s integer(kind=1) :: iarr(5) character(len=1) :: carr(5) iarr = [1, 2, 3, 4, 5] carr = [character(len=1) :: "a", "b", "c", "d", "e"] if (s%len /= 10 .or. s%len /= len(s)) error stop if (carr%len /= 1 .or. carr%len /= len(carr)) error stop if (carr(2)%len /= 1 .or. carr(2)%len /= len(carr(2))) error stop if (real8%kind /= 8 .or. real8%kind /= kind(real8)) error stop if (c%kind /= 4 .or. c%kind /= kind(c)) error stop if (iarr%kind /= 1 .or. iarr%kind /= kind(iarr)) error stop if (iarr(3)%kind /= 1 .or. iarr(3)%kind /= kind(iarr(3))) error stop end program type_parameter_inquiry_01 lfortran-lfortran-2f73434/integration_tests/implicit_typing_02.f900000664000175000017500000000046215141516316025427 0ustar alastairalastairmodule implicit_typing_02_mod implicit none public bisect contains integer function bisect() result(c) c = 10 end function end module program implicit_typing_02 use implicit_typing_02_mod, only: bisect print *, bisect() if (bisect() /= 10) error stop end program lfortran-lfortran-2f73434/integration_tests/write_06.f900000664000175000017500000000100415141516316023352 0ustar alastairalastairprogram main implicit none character(len=27) :: warn1 character(len=7) :: warn2 integer :: i write(warn1, '(a,1x,a,1x,a,1x,a)') 'KEYWORD', 'SHORT', 'PRESENT', 'VALUE' print*, "!", warn1, "!" if ( .not. (warn1 /= ' KEYWORD SHORT PRESENT VALUE' .or. warn1 /= 'KEYWORD SHORT PRESENT VALUE' ) ) error stop write(warn2, '(i1,1x,a)') 7, 'SHORT' print*, "!", warn2, "!" if ( warn2 /= '7 SHORT' ) error stop read(warn2, *) i print *, i if (i /= 7) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_364.f900000664000175000017500000000103115141516316024474 0ustar alastairalastairprogram intrinsics_364 real :: y(3, 10) real :: sum_tmp sum_tmp = 0.0 y = reshape([1.0, 1.0, 1.0, 1.11111116, 0.777777791, 1.0, 1.27160501, 0.561728418, & & 1.01234567, 1.46502066, 0.354938269, 1.01851845, 1.69410157, 0.157921821, & & 1.01406026, 1.96296299, -0.0290066153, 0.993426979, 2.2762537, -0.204880133,& & 0.949864626, 2.6391685, -0.368057907, 0.875255466, 3.05750966, -0.516141057,& & 0.759896517, 3.53775811, -0.645873308, 0.592240095], [3, 10]) print *, sum(y) if ( abs(sum(y) - 30.3195057) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_84.f900000664000175000017500000000020515141516316023531 0ustar alastairalastairprogram arrays_84 implicit none integer :: arr(-5) print *, size(arr) if ( size(arr) /= 0 ) error stop end program arrays_84 lfortran-lfortran-2f73434/integration_tests/functions_25.f900000664000175000017500000000173415141516316024243 0ustar alastairalastairmodule f implicit none integer, parameter :: sp = selected_real_kind(6) contains module function diag_rsp_k(v, k) result(res) real(sp), intent(in) :: v(:) integer, intent(in) :: k real(sp) :: res(size(v) + abs(k), size(v) + abs(k)) integer :: i, sz sz = size(v) res = 0 if (k > 0) then do i = 1, sz res(i, k + i) = v(i) end do else if (k < 0) then do i = 1, sz res(i + abs(k), i) = v(i) end do else do i = 1, sz res(i, i) = v(i) end do end if end function diag_rsp_k end module f program functions_25 use f implicit none integer :: i integer, parameter :: n = 4 real(sp) :: a(n, n), c(n, n) c = diag_rsp_k([(1._sp, i=1, n - 1)], 1) c = transpose(c) a = diag_rsp_k([(1._sp, i = 1, n - 1)], -1) print *, all(a == c) if (.not. all(a == c)) error stop end program lfortran-lfortran-2f73434/integration_tests/string_89.f900000664000175000017500000000130115141516316023541 0ustar alastairalastair! This test checks that assignment to a slice of an array ! Inside Subroutine works correctly for assumed-length strings. program string_89 implicit none character(len=5) :: strings(3) = ['-----','-----','-----'] character(len=:), allocatable :: str(:) str = ['ABC','BEE','SEE'] call assign_slice(strings, str) print *,strings if (strings(1) /= 'ABC') error stop if (strings(2) /= 'BEE') error stop if (strings(3) /= 'SEE') error stop contains subroutine assign_slice(strings,str) implicit none character(len=*), intent(inout) :: strings(:) character(len=:), allocatable, intent(in) :: str(:) strings(:) = str end subroutine end program string_89lfortran-lfortran-2f73434/integration_tests/string_10.f900000664000175000017500000000075015141516316023530 0ustar alastairalastairprogram string_10 character(len=2) :: c = "BC" character(len=3) :: num logical :: is_alpha is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha c = "@a" is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha c = "a@" is_alpha = (c >= 'A' .and. c <= 'Z') .or. (c >= 'a' .and. c <= 'z') print *, is_alpha num(1:3) = 'sbs' if (num /= "sbs") error stop end program string_10 lfortran-lfortran-2f73434/integration_tests/precision_02.f900000664000175000017500000000032215141516316024211 0ustar alastairalastairprogram precision_02 integer, parameter :: dp = kind(0.d0) real(dp) :: x, x1 x1 = 1.1_dp x = 1.1 - x1 print *, x if (abs(x - 2.3841857821338408E-008) > 1D-10) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_05b.f900000664000175000017500000000030115141516316026562 0ustar alastairalastairmodule separate_compilation_05b_module use separate_compilation_05a_module implicit none contains subroutine temp(A) real, allocatable :: A(:, :) call resol_lu(A) end subroutine end module lfortran-lfortran-2f73434/integration_tests/functions_09.f900000664000175000017500000000115715141516316024244 0ustar alastairalastairmodule stdlib_quadrature_simps interface simps38_weights module procedure simps38_weights_dp end interface simps38_weights contains function simps38_weights_dp(x) result(w) real(8), intent(in) :: x(4) real(8) :: w(size(x)) end function simps38_weights_dp subroutine simps38_weights_dp_use(x1) real(8), intent(in) :: x1(4) print *, simps38_weights(x1) end subroutine simps38_weights_dp_use end module program stdlib_quadrature use stdlib_quadrature_simps, only: simps38_weights_dp implicit none real(8) :: x1(4) print *, simps38_weights_dp(x1) end program lfortran-lfortran-2f73434/integration_tests/test_ieee_scalb.f900000664000175000017500000000352415141516316025036 0ustar alastairalastair! Test ieee_scalb function - Scale by power of 2 program test_ieee_scalb use, intrinsic :: ieee_arithmetic, only: ieee_scalb implicit none real :: x_sp, result_sp real(8) :: x_dp, result_dp print *, "Testing ieee_scalb..." ! Test 1: Scale 1.5 by 2^3 = 12.0 (single precision) x_sp = 1.5 result_sp = ieee_scalb(x_sp, 3) print *, "ieee_scalb(1.5, 3) =", result_sp if (abs(result_sp - 12.0) > 1e-6) error stop "Expected 12.0" ! Test 2: Scale 1.0 by 2^4 = 16.0 (single precision) x_sp = 1.0 result_sp = ieee_scalb(x_sp, 4) print *, "ieee_scalb(1.0, 4) =", result_sp if (abs(result_sp - 16.0) > 1e-6) error stop "Expected 16.0" ! Test 3: Scale 2.0 by 2^-1 = 1.0 (single precision) x_sp = 2.0 result_sp = ieee_scalb(x_sp, -1) print *, "ieee_scalb(2.0, -1) =", result_sp if (abs(result_sp - 1.0) > 1e-6) error stop "Expected 1.0" ! Test 4: Scale by 0 should return same value x_sp = 5.0 result_sp = ieee_scalb(x_sp, 0) print *, "ieee_scalb(5.0, 0) =", result_sp if (abs(result_sp - 5.0) > 1e-6) error stop "Expected 5.0" ! Test 5: Double precision - scale 1.5 by 2^10 = 1536.0 x_dp = 1.5d0 result_dp = ieee_scalb(x_dp, 10) print *, "ieee_scalb(1.5d0, 10) =", result_dp if (abs(result_dp - 1536.0d0) > 1e-12) error stop "Expected 1536.0" ! Test 6: Large negative scale x_dp = 1024.0d0 result_dp = ieee_scalb(x_dp, -10) print *, "ieee_scalb(1024.0d0, -10) =", result_dp if (abs(result_dp - 1.0d0) > 1e-12) error stop "Expected 1.0" ! Test 7: Zero should stay zero x_sp = 0.0 result_sp = ieee_scalb(x_sp, 5) print *, "ieee_scalb(0.0, 5) =", result_sp if (result_sp /= 0.0) error stop "Expected 0.0" print *, "All ieee_scalb tests passed!" end program test_ieee_scalb lfortran-lfortran-2f73434/integration_tests/intrinsics_42.f900000664000175000017500000000060215141516316024410 0ustar alastairalastairprogram intrinsics_42 implicit none real :: x = 3.0, y = 4.0, z = 5.0 real :: a = -6, b = 8, c = 10 real :: p = 1.2, q = 0.5, r = 1.3 if (abs(hypot(x, y) - (z * z)) > 1e5) error stop if (abs(hypot(a, b) - (c * c)) > 1e5) error stop if (abs(hypot(p, q) - (r * r)) > 1e5) error stop print *, x, y, z print *, a, b, c print *, p, q, r end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_03.f900000664000175000017500000000070615141516316026576 0ustar alastairalastairDOUBLE PRECISION FUNCTION ddot_sl(dx) DOUBLE PRECISION dx(*) integer :: i do i = 1, 4 if (abs(dx(i) - 12.41d0) > 1e-10) error stop end do ddot_sl = dx(1) END SUBROUTINE slsqpb (n, a) INTEGER n external ddot_sl DOUBLE PRECISION a(n+1), ddot_sl, res print *, a res = ddot_sl(a(1)) print *, res if (abs(res - 12.41d0) > 1e-10) error stop END program legacy_array_sections_03 double precision a(5) a = 12.41d0 call slsqpb(4, a) end program lfortran-lfortran-2f73434/integration_tests/do_concurrent_06.f900000664000175000017500000000146115141516316025073 0ustar alastairalastair! equivalent to openmp_09.f90 subroutine parallel_factorial(n, ctr) use omp_lib use iso_fortran_env implicit none integer, intent(in) :: n integer(kind =int64), intent(inout) :: ctr integer(kind =int64) :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * i end do ctr = ctr + local_ctr end subroutine program do_concurrent_06 use omp_lib use iso_fortran_env integer, parameter :: n = 20 integer(kind =int64) :: ctr integer(kind =int64) :: res res = 2432902008176640000_int64 ! Factorial of 20 call omp_set_num_threads(8) ctr = 0 call parallel_factorial(n, ctr) print *, ctr if(ctr /= res) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_125.f900000664000175000017500000000145015141516316024474 0ustar alastairalastairprogram intrinsic_125 implicit none real, allocatable :: array(:) integer :: freq(100), i, rand_nums_gen_limit, rand_num, min_rand_num, max_rand_num real :: expected_freq, accuracy_min, accuracy_max rand_nums_gen_limit = 5000000 expected_freq = float(rand_nums_gen_limit) / 100 freq = 0 allocate (array(rand_nums_gen_limit)) call random_number(array) do i = 1, rand_nums_gen_limit rand_num = 1 + mod(int(array(i) * 100), 100) freq(rand_num) = freq(rand_num) + 1 end do min_rand_num = minval(freq) max_rand_num = maxval(freq) accuracy_min = min_rand_num / expected_freq accuracy_max = max_rand_num / expected_freq print *, accuracy_min, accuracy_max if ((accuracy_max - accuracy_min) > 0.05) error stop end program lfortran-lfortran-2f73434/integration_tests/class_101.f900000664000175000017500000000314215141516316023406 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/7640 ! Deferred function on polymorphic member returned wrong results (all zeros) ! MRE from issue comment by kmr-srbh module class_101_mod type, abstract :: AbsType contains procedure(method2), deferred :: method2 end type AbsType abstract interface function method2(self,arr) result(a) import class(AbsType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) end function method2 end interface type :: SomeType integer, allocatable :: arr(:) class(AbsType), allocatable :: obj contains procedure :: method1 end type SomeType type, extends(AbsType) :: MyType contains procedure :: method2 => my_method2 end type MyType contains subroutine method1(self) class(SomeType), intent(inout) :: self self%arr = self%obj%method2(self%arr) end subroutine method1 function my_method2(self, arr) result(a) class(MyType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) integer :: i do i = 1, size(arr) a(i) = arr(i) * 2 end do end function my_method2 end module class_101_mod program class_101 use class_101_mod implicit none class(SomeType), allocatable :: s allocate(s) allocate(s%arr(3)) allocate(MyType :: s%obj) s%arr = [1, 2, 3] call s%method1() if (s%arr(1) /= 2) error stop if (s%arr(2) /= 4) error stop if (s%arr(3) /= 6) error stop print *, "PASS" end program class_101 lfortran-lfortran-2f73434/integration_tests/type_bound_generic_member_access_01.f900000664000175000017500000000473015141516316030740 0ustar alastairalastairmodule err_mod implicit none type :: error_t integer :: code = 0 end type error_t end module err_mod module toml_mod implicit none type :: toml_table integer :: x = 0 end type toml_table end module toml_mod module base_mod use err_mod, only: error_t use toml_mod, only: toml_table implicit none type, abstract :: serializable_t contains procedure(load_toml), deferred :: load_from_toml procedure, private :: load_from_unit generic :: load => load_from_toml, load_from_unit end type serializable_t abstract interface subroutine load_toml(self, table, error) import :: serializable_t, toml_table, error_t class(serializable_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error end subroutine load_toml end interface contains subroutine load_from_unit(self, unit, error) class(serializable_t), intent(inout) :: self integer, intent(in) :: unit type(error_t), allocatable, intent(out) :: error end subroutine load_from_unit end module base_mod module derived_mod use base_mod use err_mod, only: error_t use toml_mod, only: toml_table implicit none type, extends(serializable_t) :: cmd_t contains procedure :: load_from_toml => cmd_load end type cmd_t type, extends(serializable_t) :: table_t type(cmd_t), allocatable :: command(:) contains procedure :: load_from_toml => table_load end type table_t contains subroutine cmd_load(self, table, error) class(cmd_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error table%x = table%x + 1 end subroutine cmd_load subroutine table_load(self, table, error) class(table_t), intent(inout) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error type(toml_table), target :: elem type(toml_table), pointer :: p integer :: i allocate(self%command(1)) p => elem do i = 1, 1 call self%command(i)%load(p, error) end do end subroutine table_load end module derived_mod program type_bound_generic_member_access_01 use derived_mod use toml_mod, only: toml_table use err_mod, only: error_t implicit none type(table_t) :: t type(toml_table) :: tab type(error_t), allocatable :: err call t%load(tab, err) if (allocated(err)) error stop 1 print *, "OK" end program type_bound_generic_member_access_01 lfortran-lfortran-2f73434/integration_tests/do_concurrent_13.f900000664000175000017500000000203315141516316025065 0ustar alastairalastairprogram do_concurrent_13 integer, parameter :: Nx = 40, Ny = 30, n_max = 255, dp=kind(0.d0) real(dp), parameter :: xcenter = -0.5_dp, ycenter = 0.0_dp, & width = 4, height = 3, dx_di = width/Nx, dy_dj = -height/Ny, & x_offset = xcenter - (Nx+1)*dx_di/2, y_offset = ycenter - (Ny+1)*dy_dj/2 real(dp) :: x, y, x_0, y_0, x_sqr, y_sqr, wtime integer :: i, j, n, image(Nx, Ny) do concurrent (j = 1:Ny) shared(image) local(i, x, y, x_0, y_0, x_sqr, y_sqr, n) y_0 = y_offset + dy_dj * j do i = 1, Nx x_0 = x_offset + dx_di * i x = 0; y = 0; n = 0 do x_sqr = x ** 2; y_sqr = y ** 2 if (x_sqr + y_sqr > 4 .or. n == n_max) then image(i,j) = 255-n exit end if y = y_0 + 2 * x * y x = x_0 + x_sqr - y_sqr n = n + 1 end do end do end do print *, sum(image) if ( sum(image) /= 263354 ) error stop end program lfortran-lfortran-2f73434/integration_tests/file_close_01.f900000664000175000017500000000146715141516316024334 0ustar alastairalastairprogram file_close_01 implicit none character(:),allocatable:: file_name character(len=16) :: str character(len=6) :: st = "delete" integer :: newu = 10 logical :: ex file_name = "file_close_1.txt" open(newunit=newu,file=file_name) write(newu, *) file_name ! file_name now has content = its own name rewind(newu) read(newu, *) str print *, "contents: ", str close(newu,status='delete') inquire(file=file_name,exist=ex) print "(3A,L2)",'Was ',file_name,' deleted?', .not. ex if (ex .neqv. .false.) error stop open(newunit=newu,file=file_name) close(newu,status=st) ! status specified through variable inquire(file=file_name,exist=ex) print "(3A,L2)",'Was ',file_name,' deleted?', .not. ex if (ex .neqv. .false.) error stop end program file_close_01 lfortran-lfortran-2f73434/integration_tests/write_03.f900000664000175000017500000000041715141516316023356 0ustar alastairalastairsubroutine dvout() implicit none character(80) line integer ifmt, lll ifmt = 10 lll = 15 line = "1234567890123456789001234567890" write( *, fmt = 9999 ) ifmt, line( 1: lll ) 9999 format( i0, / a ) end subroutine program write_03 implicit none call dvout() end program lfortran-lfortran-2f73434/integration_tests/select_rank_12.f900000664000175000017500000000123415141516316024514 0ustar alastairalastairmodule select_rank_12_mod implicit none contains subroutine check_arg(arg) class(*), dimension(..), intent(in) :: arg select rank (assoc => arg) rank (1) print *, "Received an array of rank 1" rank (2) print *, "Received an array of rank 2" rank default print *, "Received an array of unexpected rank" error stop end select end subroutine check_arg end module select_rank_12_mod program select_rank_12 use select_rank_12_mod implicit none integer :: int_array1(3) = [1, 2, 3] integer :: int_array2(2, 3) call check_arg(int_array1) call check_arg(int_array2) end program select_rank_12 lfortran-lfortran-2f73434/integration_tests/submodule_06.f900000664000175000017500000000301415141516316024222 0ustar alastairalastairmodule mod_submodule_06 implicit none type :: key_type integer(1), allocatable :: value(:) end type key_type interface fnv_1_hash module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code end function int8_fnv_1 end interface fnv_1_hash end module mod_submodule_06 submodule(mod_submodule_06) submod_submodule_06 implicit none contains module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code integer(1), parameter :: array(4) = [1, 2, 3, 4] integer(4), parameter :: result = 5 hash_code = result key = array end function int8_fnv_1 end submodule submod_submodule_06 program submodule_06 use mod_submodule_06 implicit none integer(4) :: fnv_1_hasher = 1 type(key_type) :: key integer(1) :: test_object(4) allocate(key % value(4)) fnv_1_hasher = fnv_1_hash( key % value ) print *, fnv_1_hasher print *, key % value if (fnv_1_hasher /= 5) error stop if (.not. all(key % value == [1, 2, 3, 4])) error stop call test_fnv_1() contains subroutine test_fnv_1() integer(4) :: hash hash = fnv_1_hash( test_object ) print *, hash print *, test_object if (hash /= 5) error stop if (.not. all(test_object == [1, 2, 3, 4])) error stop end subroutine test_fnv_1 end programlfortran-lfortran-2f73434/integration_tests/array_indices_array_item_assignment.f900000664000175000017500000000026415141516316031202 0ustar alastairalastairprogram array_indices_array_item_assignment integer :: A(3) = [1,2,3] integer :: X(2) = [1,2] integer :: Y = 2 A(X) = Y print *, A if( any(A /= [2, 2, 3]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/string_95.f900000664000175000017500000000064315141516316023546 0ustar alastairalastairprogram string_95 character(2), allocatable :: str str = f1(5) print *, len(str), str if (len(str) /= 2) error stop if (str /= "ab") error stop contains function f1(n) result(res) integer :: n character(n), allocatable :: res allocate(res) res = "abcde" print *, len(res), res if (len(res) /= 5) error stop if (res /= "abcde") error stop end function end program string_95lfortran-lfortran-2f73434/integration_tests/present_05.f900000664000175000017500000000260715141516316023711 0ustar alastairalastair! MRE: External procedure called multiple times in same subroutine ! This tests that interface creation for external procedures does not ! create duplicate symbols when the procedure is called multiple times. subroutine test_select(select_fn, n, wr, wi, result) implicit none logical, external :: select_fn integer, intent(in) :: n real, intent(in) :: wr(*), wi(*) real, intent(out) :: result(*) integer :: i logical :: flag ! First call to select_fn do i = 1, n result(i) = 0.0 if (select_fn(wr(i), wi(i))) then result(i) = 1.0 end if end do ! Second call to select_fn (same scope - must not create duplicate interface) do i = 1, n flag = select_fn(wr(i), wi(i)) if (flag) result(i) = result(i) + 1.0 end do end subroutine logical function my_select(x, y) implicit none real, intent(in) :: x, y my_select = x > 0.0 end function program test_present_05 implicit none real :: wr(3), wi(3), r(3) logical, external :: my_select wr = [1.0, -1.0, 2.0] wi = [0.0, 0.0, 0.0] call test_select(my_select, 3, wr, wi, r) ! Expected: r(1)=2.0 (selected twice), r(2)=0.0 (never selected), r(3)=2.0 (selected twice) if (abs(r(1) - 2.0) > 1e-6) error stop if (abs(r(2) - 0.0) > 1e-6) error stop if (abs(r(3) - 2.0) > 1e-6) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_08b.f900000664000175000017500000000025315141516316026573 0ustar alastairalastairmodule module_using_all_2_separate_compilation_08b contains subroutine test_all_2(x) real :: x(5) if ( all(abs(x - 19.2134) < 1e-8 )) error stop end subroutine end module lfortran-lfortran-2f73434/integration_tests/forallloop_01.f900000664000175000017500000000074615141516316024400 0ustar alastairalastairprogram forallloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) forall (i = 1:nsize) a(i) = 5 b(i) = 5 end forall call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) forall (i = 1:N) c(i) = a(i) + scalar * b(i) end subroutine end program lfortran-lfortran-2f73434/integration_tests/init_values.f900000664000175000017500000000075115141516316024245 0ustar alastairalastairprogram init_values integer, parameter :: i = 1.0, j = 2.0 real, parameter :: r = 4.0 complex, parameter :: c = (3.0, 4.0) integer, parameter :: a = i + j logical, parameter :: l = a == 3 logical, parameter :: b = l .or. .true. real, parameter :: r_minus = -r character(len = 1), parameter :: s1 = "l" character(len = 3), parameter :: s2 = "eft" character(len = 4), parameter :: s = s1//s2 print *, i, j, r, c, a, l, b, r_minus, s end program lfortran-lfortran-2f73434/integration_tests/test_dshiftr.f900000664000175000017500000000033315141516316024421 0ustar alastairalastairprogram test_dshiftr integer, parameter:: ik1 = selected_int_kind(1) integer(ik1), parameter:: i0 = 0, i1 = 1 integer(ik1):: expected = 64 if (dshiftr(i1, i0, 2) /= expected) error stop end program test_dshiftr lfortran-lfortran-2f73434/integration_tests/string_34.f900000664000175000017500000000037015141516316023534 0ustar alastairalastairprogram string_34 implicit none character(len=20) :: a a = "hi hello" print *, a(int(1, 8):int(2, 8)) print *, a(1_8:2_8) if (a(1_8:2_8) /= "hi") error stop if (a(int(1, 8):int(2, 8)) /= "hi") error stop end program lfortran-lfortran-2f73434/integration_tests/submodule_05.f900000664000175000017500000000126315141516316024225 0ustar alastairalastairmodule mod_submodule_05 implicit none interface module subroutine map_open_entry(key) integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_submodule_05 submodule(mod_submodule_05) submod_submodule_05 implicit none contains module subroutine map_open_entry(key) integer, intent(inout) :: key integer, parameter :: i = 1 key = i end subroutine map_open_entry end submodule submod_submodule_05 program submodule_05 use mod_submodule_05 implicit none integer :: key = 5 call map_open_entry( key ) print *, key if (key /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/interface_17.f900000664000175000017500000000157015141516316024172 0ustar alastairalastairmodule module_interface_17 interface precv module procedure precv_d_3d module procedure precv_d_2d end interface precv contains subroutine precv_d_2d ( val, nx ) real, dimension(nx, nx), intent(in) :: val integer, intent(in) :: nx print *, sum(val) if (abs(sum(val) - 318.560028) > 1e-8) error stop end subroutine precv_d_2d subroutine precv_d_3d ( val, nx ) real, dimension(nx, nx, nx), intent(in) :: val integer, intent(in) :: nx print *, sum(val) if (abs(sum(val) - 1274.23975) > 1e-8) error stop end subroutine precv_d_3d subroutine sweep_recv_bdry ( nz ) real, dimension(nz, nz, nz):: jb_in real, dimension(nz, nz):: jb_in_2 integer, intent(in) :: nz jb_in = 19.91 call precv ( jb_in, nz ) jb_in_2 = 19.91 call precv ( jb_in_2, nz ) end subroutine sweep_recv_bdry end module module_interface_17 program interface_17 use module_interface_17 call sweep_recv_bdry(4) end program lfortran-lfortran-2f73434/integration_tests/string_concat_deferred_len.f900000664000175000017500000000047015141516316027254 0ustar alastairalastairprogram string_concat_deferred_len implicit none character(len=:), allocatable :: p, c p = '././src/fpm_meta.f90' c = '' if (p(1:1) /= '.') c = c // p(1:1) // '/' c = c // p(5:len(p)) // '/' if (len(c) > 1 .and. c(len(c):) == '/') c = c(:len(c)-1) if (trim(c) /= 'src/fpm_meta.f90') error stop 1 end program lfortran-lfortran-2f73434/integration_tests/recursion_03.f900000664000175000017500000000173115141516316024235 0ustar alastairalastairmodule recursion_03 implicit none contains integer function solver_caller(f, iter) interface integer function f() end function end interface integer, intent(in) :: iter solver_caller = solver(f, iter) end function integer function solver(f, iter) interface integer function f() end function end interface !procedure(f_type) :: f integer, intent(in) :: iter integer f_val f_val = f() print *, "before:", f_val solver = sub1(2, iter-1) !solver = sub1(2, iter-1) + f() f_val = f() print *, "after:", f_val end function integer function sub1(y, iter) integer, intent(in):: y, iter integer x integer tmp x = y print *, "in sub1" if (iter == 1) then sub1 = 1 return end if tmp = getx() sub1 = solver_caller(getx, iter) contains integer function getx() print *, "x in getx", x getx = x end function end function end module recursion_03 program main use recursion_03 implicit none integer :: r r = sub1(3, 3) print *, "r =", r end program main lfortran-lfortran-2f73434/integration_tests/return_02.f900000664000175000017500000000115315141516316023540 0ustar alastairalastairmodule many_returns implicit none contains integer function b(a) integer :: a, e print *, "calling b" b = d(a) contains integer function d(i) integer :: i if (i .EQ. 1) then d = 1 return end if if (i .EQ. 2) then d = 2 return end if if (i .EQ. 3) then d = 3 return end if d = 999 end function d end function b end module program returns use many_returns implicit none integer c c = b(1) print *, c c = b(2) print *, c c = b(3) print *, c c = b(4) print *, c end program lfortran-lfortran-2f73434/integration_tests/string_61.f900000664000175000017500000000104315141516316023532 0ustar alastairalastair! Test Optional array of strings program string_61 character(10):: ss character(10) :: arr(2) ss = ff() print *, ss if(ss /= "Hello") error stop arr(1) = "world" ss = ff(arr) print *, ss if(ss /= "world") error stop contains function ff(string) result(ret) character(10), optional, dimension(:) :: string character(10) :: ret if(.not.present(string)) then ret = "Hello" else ret = string(1) end if end function end programlfortran-lfortran-2f73434/integration_tests/string_72.f900000664000175000017500000000047015141516316023537 0ustar alastairalastair! Test passing substring to subroutine program string_72 character(10):: str str = "123456789 " call ss(str(3:6)) print *, str if(str /= "12abcd789 ") error stop contains subroutine ss(str) character(*) :: str str = "abcd" end subroutine end program string_72lfortran-lfortran-2f73434/integration_tests/arrays_12_size.f900000664000175000017500000000057615141516316024565 0ustar alastairalastairmodule arrays_12_size_mod contains subroutine sub(xx) real, intent(in) :: xx(:) real :: buggy(int(2.0*count(xx > 0.0))) print * , size(buggy) if (size(buggy) /= 6) error stop end subroutine sub end module arrays_12_size_mod program arrays_12_size use arrays_12_size_mod real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end program arrays_12_size lfortran-lfortran-2f73434/integration_tests/template_travel_01.f900000664000175000017500000000563215141516316025416 0ustar alastairalastairmodule template_travel_01_math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module template_travel_01_travel use template_travel_01_math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template end module module template_travel_01_m use template_travel_01_math use template_travel_01_travel implicit none contains subroutine test_template() instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_T => avg_S_from_T instantiate travel_tmpl(real, real, real, add_real, add_real, slash_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s1, s2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s1=", s1 print *, "s2=", s2 end subroutine end module program template_travel_01 use template_travel_01_m implicit none call test_template() end program template_travel_01 lfortran-lfortran-2f73434/integration_tests/string_36.f900000664000175000017500000000026315141516316023537 0ustar alastairalastairprogram string_36 implicit none character(len=5) :: hello hello = "hello" hello(4:3) = "" print *, hello if (hello /= "hello") error stop end program lfortran-lfortran-2f73434/integration_tests/procedure_25.f900000664000175000017500000000105315141516316024215 0ustar alastairalastairmodule procedure_25_module implicit none contains subroutine run(f) implicit none interface integer function f() end function f end interface procedure(f), pointer :: func_ptr integer :: x func_ptr => f x = func_ptr() print *, x if(x /= 42) error stop end subroutine run end module program procedure_25 use procedure_25_module implicit none call run(test_func) contains integer function test_func() test_func = 42 end function test_func end programlfortran-lfortran-2f73434/integration_tests/entry_02.f900000664000175000017500000000061615141516316023365 0ustar alastairalastairsubroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy if (abs(dummy - 10.0) > 1e-7) error stop dummy = 5.0 entry y(dummy) print *, "Printed using entry statement: ", dummy if (abs(dummy - 5.0) > 1e-7) error stop return end subroutine program entry_02 real :: dummy dummy = 10.0 call x(dummy) dummy = 5.0 call y(dummy) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_301.f900000664000175000017500000001316515141516316024476 0ustar alastairalastairprogram intrinsics_301 implicit none integer(4), parameter :: i1(1) = findloc([1, 2, 3], 2) integer(4), parameter :: i2(1) = findloc([1.0, 2.0, 3.0], 2.0) integer(4), parameter :: i3(1) = findloc(["aa", "db", "ca"], "aa") integer(4), parameter :: i4(1) = findloc([1,2,3], 3, mask = [.true., .true., .true.]) integer(8), parameter :: i5(1) = findloc([1,2,3], 1, mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = findloc([1,2,3], 2, mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = findloc(["aa", "db", "ca"], "aa", mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = findloc(["aa", "db", "ca"], "db", mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = findloc([1, 3, 2, 3], 3, mask = [.true., .true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = findloc([3, 2, 1, 3], 3, back = .true.) integer(4), parameter :: i11(1) = findloc([3.0, 2.0, 1.0, 3.0], 2.0, back = .true., dim=1) integer(4), parameter :: i12(1) = findloc(["aa", "db", "ca"], "aa", mask = [.false., .false., .false.], kind = 4) integer(4), parameter :: i13 = findloc([1, 3, 2, 3], 3, 1, mask = [.true., .true., .false., .true.], back = .true., kind = 4) complex, dimension(2) :: dc = [(1.4, 1.1), (2.3, 2.2)] complex, dimension(2) :: dc2 = [(1.0, 2.0), (3.0, 4.0)] integer :: x1(5) = [1, 3, 2, 4, 2], y1 = 2 integer, parameter :: x1_param(5) = [1, 3, 2, 4, 2] integer, parameter :: y1_param = 2 integer, parameter :: i14(1) = findloc(x1_param, y1_param) ! complex argument complex-time search integer, parameter :: i15(1) = findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) integer, parameter :: i16(1) = findloc([(1, 2), (3, 4)], (3, 4)) ! complex argument search with no-find of "value" integer, parameter :: i17(1) = findloc([(1.0, 2.0), (3.0, 4.0), (4.0, 2.0)], (3.0, 2.0)) integer, parameter :: i18(1) = findloc(["aa", "bb", "cc"], "bb") real :: x2(5) = [1.0, 3.0, 2.0, 4.0, 2.0], y2 = 2.0 character(len=2) :: x3(3) = ["aa", "db", "ca"], y3 = "aa" logical :: mask1(5) = [.true., .true., .false., .true., .true.] logical :: mask2(3) = [.true., .false., .true.] logical :: back1 = .false. logical :: back2 = .true. complex :: x = (1.4, 1.1) complex :: x5 = (3.0, 4.0) integer, dimension(1) :: result integer, dimension(1) :: result2 ! findloc(Array, value, mask) logical :: x4(3) = [.true., .false., .true.], y4 = .true., mask3 = .true. print *, findloc(x1, y1) if (any(findloc(x1, y1) /= 3)) error stop print *, findloc(x2, y2) if (any(findloc(x2, y2) /= 3)) error stop print *, findloc(x3, y3) if (any(findloc(x3, y3) /= 1)) error stop print *, findloc(x1, y1, mask = mask1) if (any(findloc(x1, y1, mask = mask1) /= 5)) error stop print *, findloc(x2, y2, mask = mask1) if (any(findloc(x2, y2, mask = mask1) /= 5)) error stop print *, findloc(x3, y3, mask = mask2) if (any(findloc(x3, y3, mask = mask2) /= 1)) error stop print *, findloc(x1, y1, mask = mask1, back = back1) if (any(findloc(x1, y1, mask = mask1, back = back1) /= 5)) error stop print *, findloc(x1, y1, mask = mask1, back = back2) if (any(findloc(x1, y1, mask = mask1, back = back2) /= 5)) error stop print *, findloc(x2, y2, mask = mask1, back = back2) if (any(findloc(x2, y2, mask = mask1, back = back2) /= 5)) error stop print *, findloc(x1, y1, mask = mask1, back = back2, kind = 8) if (any(findloc(x1, y1, mask = mask1, back = back2, kind = 8) /= 5)) error stop print *, findloc(x4, y4, mask3) if (any(findloc(x4, y4, mask3) /= 1)) error stop print *, i1 if (i1(1) /= 2) error stop print *, i2 if (i2(1) /= 2) error stop print *, i3 if (i3(1) /= 1) error stop print *, i4 if (i4(1) /= 3) error stop print *, i5 if (i5(1) /= 1) error stop print *, i6 if (i6(1) /= 0) error stop print *, i7 if (i7(1) /= 1) error stop print *, i8 if (i8(1) /= 0) error stop print *, i9 if (i9(1) /= 4) error stop print *, i10 if (i10(1) /= 4) error stop print *, i11 if (i11(1) /= 2) error stop print *, i12 if (i12(1) /= 0) error stop print *, i13 if (i13 /= 4) error stop print *, kind(findloc(["aa", "db", "ca"], "aa", 1, mask = [.false., .false., .false.], kind = 8)) if (kind(findloc(["aa", "db", "ca"], "db", 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop print *, findloc(dc, x) if (any(findloc(dc, x) /= 1)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0)) /= 2)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (1.0, 2.0), mask = [.true., .true.]) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (1.0, 2.0), mask = [.true., .true.]) /= 1)) error stop print*, findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0), mask=[.true., .true.], kind = 8) if (any(findloc([(1.0, 2.0), (3.0, 4.0)], (3.0, 4.0), mask = [.true., .true.], kind = 8) /= 2)) error stop result = findloc(dc2, x5) result2 = findloc(dc2, x5, mask = [.true., .true.]) print *, result if (any(result /= 2)) error stop print*, result2 if (any(result2 /= 2)) error stop print *, i14 if (any(i14 /= 3)) error stop print *, i15 if (any(i15 /= 2)) error stop print *, i16 if (any(i16 /= 2)) error stop print *, i17 if (any(i17 /= 0)) error stop print *, i18 if (any(i18 /= 2)) error stop print *, findloc(x1_param, y1) if (any(findloc(x1_param, y1) /= 3)) error stop end program intrinsics_301 lfortran-lfortran-2f73434/integration_tests/string_59.f900000664000175000017500000000112115141516316023536 0ustar alastairalastairmodule string_59_mod contains subroutine ss(i) integer :: i character(len=3), save:: nan_string='NaN' print *, nan_string ! Checks if(i == 1) then if( nan_string /= "123") error stop else if ( i == 2 ) then if( nan_string /= "456") error stop end if ! Set if(i == 3) then nan_string = "123" else if (i == 4) then nan_string = "456" end if end subroutine end module program string_59 use string_59_mod call ss(3) call ss(1) call ss(4) call ss(2) end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_15.f900000664000175000017500000000022215141516316026423 0ustar alastairalastairprogram separate_compilation_15a use, non_intrinsic :: separate_compilation_15a_module call test_solver() end program separate_compilation_15a lfortran-lfortran-2f73434/integration_tests/intrinsics_81.f900000664000175000017500000000040215141516316024411 0ustar alastairalastairprogram intrinsics_81 real, allocatable :: C(:,:), C2(:,:) integer :: n n = 960 allocate(C(n,n), C2(n,n)) C = 932.0 C2 = 320.0 print *, "Error: ", maxval(abs(C-C2)) if( maxval(abs(C - C2)) /= 612.00 ) error stop end program lfortran-lfortran-2f73434/integration_tests/interface_08.f900000664000175000017500000000030415141516316024164 0ustar alastairalastairmodule interface_08 abstract interface subroutine sub(x,y) integer, intent(in) :: x integer, intent(in) :: y end subroutine end interface end modulelfortran-lfortran-2f73434/integration_tests/separate_compilation_29.f900000664000175000017500000000045415141516316026437 0ustar alastairalastairprogram separate_compilation_29 use separate_compilation_29a_module, only: sa, get_a use separate_compilation_29b_module, only: sb, get_b implicit none call sa() call sb() if (get_a() /= 1) error stop 1 if (get_b() /= 2) error stop 2 end program separate_compilation_29 lfortran-lfortran-2f73434/integration_tests/common_02.f900000664000175000017500000000026315141516316023512 0ustar alastairalastairprogram main integer :: a, b, c, d, e, g, h, i, j, k common / block_1 / a, b, h, / block_2 / c, d, / block_3 / e, g common / block_4 / i, / block_5 / j, k end program lfortran-lfortran-2f73434/integration_tests/intrinsics_401.f900000664000175000017500000000123315141516316024470 0ustar alastairalastairprogram intrinsics_401 implicit none integer :: arr(3) integer :: result arr = [5, 10, 15] result = minloc(array=arr, dim=1, mask=[.false., .false., .false.]) print*, result if (result /= 0) error stop "minloc with all-false mask should return 0" arr = [5, 10, 15] if (any(minloc(array=arr, mask=[.false., .false., .false.]) /= 0)) then error stop "minloc with all-false mask (array result) should return 0" end if print *, minloc(arr, .true.) if(any(minloc(arr, .true.) /= 1)) error stop print *, minloc(arr, .false.) if(any(minloc(arr, .false.) /= 0)) error stop end program intrinsics_401 lfortran-lfortran-2f73434/integration_tests/string_90.f900000664000175000017500000000042315141516316023535 0ustar alastairalastairprogram string_test implicit none character(len=2) :: c(6) = 'a' ! c(1) should be 'a ' not 'a' if (len(c(1)) /= 2) error stop if ((c(1)(1:1) /= "a")) error stop if ((c(1)(2:2) /= " ")) error stop print *, c end program string_test lfortran-lfortran-2f73434/integration_tests/format_07.f900000664000175000017500000000067115141516316023522 0ustar alastairalastairprogram format_07 implicit none integer, parameter :: dp=kind(0d0) real(dp) :: x(3) real :: z(3) integer :: y(4) x = [1._dp,1._dp,1._dp] y = [117,123,124,126] z = [1.0,2.0,3.0] 10 format(3d12.5) 20 format(4i10) 30 format(3d12.5) print 10, x print 20, y print 30, z write (*,40) x write (*,50) y write (*,60) z 40 format(3d12.5) 50 format(4i10) 60 format(3d12.5) end programlfortran-lfortran-2f73434/integration_tests/complex_11.f900000664000175000017500000000033115141516316023665 0ustar alastairalastairSUBROUTINE CPDSA() COMPLEX :: C1 C1 = DCMPLX(1.0D0, 6.0D0) print *, C1 IF (REAL(C1) /= 1.0D0) ERROR STOP IF (AIMAG(C1) /= 6.0D0) ERROR STOP ENDSUBROUTINE program main call CPDSA() end program lfortran-lfortran-2f73434/integration_tests/string_06.f900000664000175000017500000000073715141516316023542 0ustar alastairalastairprogram string_06 character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_12a.f900000664000175000017500000000063615141516316026572 0ustar alastairalastairmodule separate_compilation_12a_module contains subroutine parent_of_nested_subroutine(a, b) integer, intent(inout) :: a, b call nested_subroutine(a, b) contains subroutine nested_subroutine(c, d) integer, intent(inout) :: c, d a = a + c b = b + d end subroutine nested_subroutine end subroutine parent_of_nested_subroutine end module separate_compilation_12a_module lfortran-lfortran-2f73434/integration_tests/binop_02.f900000664000175000017500000000145515141516316023335 0ustar alastairalastairprogram binop_02 use iso_fortran_env real(8) :: v integer(2), parameter :: exp_2 = 2 integer(4), parameter :: exp_3 = 3 integer(8), parameter :: exp_4 = 4 logical :: fast = .false. if (index(compiler_options(), '--fast') /= 0) then print *, '--fast is specified, disabling some tests' fast = .true. end if v = 3.733689483637092187962025491287931799888610839_8 print "(es23.16)", v*v print "(es23.16)", v**exp_2 if(v*v /= v**exp_2) error stop print "(es23.16)", v*v*v print "(es23.16)", v**exp_3 if (.not. fast) then if(v*v*v /= v**exp_3) error stop end if print "(es23.16)", v*v*v*v print "(es23.16)", v**exp_4 if (.not. fast) then if(v*v*v*v /= v**exp_4) error stop end if end program binop_02 lfortran-lfortran-2f73434/integration_tests/equivalence_07.f900000664000175000017500000000070215141516316024526 0ustar alastairalastairprogram equivalence_07 use iso_c_binding, only: c_loc, c_f_pointer implicit none INTEGER, target :: IMACH(16), SMALL(2) INTEGER, pointer :: OUTPUT REAL, pointer :: RMACH call c_f_pointer(c_loc(imach(4)), output) call c_f_pointer(c_loc(small(1)), rmach) imach(4) = 6 if(output /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_17.f900000664000175000017500000000104515141516316023530 0ustar alastairalastairprogram arrays_17 integer, parameter :: real_kinds(2) = [4, 8] integer :: real_kinds2(2) = [4, 8] print *, size(real_kinds) print *, real_kinds if (real_kinds(1) /= 4) error stop if (real_kinds(2) /= 8) error stop print *, size(real_kinds2) print *, real_kinds2 if (real_kinds2(1) /= 4) error stop if (real_kinds2(2) /= 8) error stop real_kinds2 = [1, 2] print *, size(real_kinds2) print *, real_kinds2 if (real_kinds2(1) /= 1) error stop if (real_kinds2(2) /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/c_ptr_01.f900000664000175000017500000000134715141516316023334 0ustar alastairalastairsubroutine idz_realcomp(n,a) integer n real*8 a(n) a = 12.5d0 return end subroutine idzp_svd(ls, w) use iso_c_binding, only: c_f_pointer, c_loc real*8 eps complex*16, target :: w(*) integer :: ls, isi, i real(8), pointer :: w_cast(:) isi = 1 call c_f_pointer(c_loc(w(isi)), w_cast, [ls]) call idz_realcomp(ls,w_cast) do i = 1, ls if (abs(w_cast(i) - 12.5d0) > 1e-12) error stop end do print *, w_cast return end program main complex*16, target :: w(5) interface subroutine idzp_svd(ls, w) use iso_c_binding, only: c_f_pointer, c_loc complex*16, target :: w(*) integer :: ls end subroutine end interface call idzp_svd(5, w) end program lfortran-lfortran-2f73434/integration_tests/file_06.f900000664000175000017500000000135015141516316023143 0ustar alastairalastairprogram file_06 implicit none integer :: u = 11, i, j real :: arr(2, 3) real, allocatable :: alloc_arr(:, :) open(u, file="file_06_data.dat", form="unformatted", access="stream", status="old") read(u) arr close(u) do i = 1, 2 do j = 1, 3 print *, arr(i, j) end do end do print *, sum(arr) if (abs(sum(arr) - 17.4599991) > 1e-6) error stop open(u, file="file_06_data.dat", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 3)) read(u) alloc_arr close(u) do i = 1, 2 do j = 1, 3 print *, alloc_arr(i, j) end do end do if (abs(sum(alloc_arr) - 17.4599991) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/equivalence_01.f900000664000175000017500000000071015141516316024517 0ustar alastairalastairprogram equivalence_01 implicit none integer mcheps(4) integer minmag(4) integer maxmag(4) double precision dmach(3) equivalence (dmach(1),mcheps(1)) equivalence (dmach(2),minmag(1)) equivalence (dmach(3),maxmag(1)) minmag = 2 mcheps = 1 if(minmag(1) /= 1 ) error stop if(minmag(2) /= 1 ) error stop if(minmag(3) /= 2 ) error stop if(minmag(4) /= 2 ) error stop if(mcheps(1) /= 1 ) error stop endlfortran-lfortran-2f73434/integration_tests/intrinsics_179.f900000664000175000017500000004314715141516316024516 0ustar alastairalastairprogram intrinsics_179 use iso_fortran_env, only: sp => real32 real :: aa(4, 5) real :: aaa(4, 5, 6) real :: aaaa(4, 5, 6, 7) logical :: mask(4, 5, 6, 7) integer :: dim, i, j, k, l integer :: s_aa(1) integer :: s_aaa(2) integer :: s_aaaa(3) real :: res_aa_1(5) real :: res_aa_2(4) real :: res_aaa_1(5, 6) real :: res_aaa_2(4, 6) real :: res_aaa_3(4, 5) real :: res_aaaa_1(5, 6, 7) real :: res_aaaa_2(4, 6, 7) real :: res_aaaa_3(4, 5, 7) real :: res_aaaa_4(4, 5, 6) real :: exp_res_aa_1(5) real :: exp_res_aa_2(4) real :: exp_res_aaa_1(5, 6) real :: exp_res_aaa_2(4, 6) real :: exp_res_aaa_3(4, 5) real :: exp_res_aaaa_1(5, 6, 7) real :: exp_res_aaaa_2(4, 6, 7) real :: exp_res_aaaa_3(4, 5, 7) real :: exp_res_aaaa_4(4, 5, 6) aa = 1.0 ! TODO: Uncomment after https://github.com/lfortran/lfortran/issues/7412 is fixed. ! mask = .true. do i = lbound(mask, 1), ubound(mask, 1) do j = lbound(mask, 2), ubound(mask, 2) do k = lbound(mask, 3), ubound(mask, 3) do l = lbound(mask, 4), ubound(mask, 4) mask(i, j, k, l) = .true. end do end do end do end do do i = 1, 4 do j = 1, 5 do k = 1, 6 aaa(i, j, k) = modulo(i * j - k, 12) end do end do end do do i = 1, 4 do j = 1, 5 do k = 1, 6 do l = 1, 7 aaaa(i, j, k, l) = (i + j / k * l + 21.04) * 1e-6 end do end do end do end do exp_res_aa_1 = 4.0 exp_res_aa_2 = 5.0 exp_res_aaa_1 = reshape([6.00000000, 16.0000000, 26.0000000, 24.0000000, & 22.0000000, 14.0000000, 12.0000000, 22.0000000, 20.0000000, 18.0000000, & 22.0000000, 20.0000000, 18.0000000, 16.0000000, 14.0000000, 30.0000000, & 16.0000000, 26.0000000, 12.0000000, 22.0000000, 38.0000000, 24.0000000, & 22.0000000, 32.0000000, 18.0000000, 34.0000000, 20.0000000, 18.0000000, & 28.0000000, 26.0000000], shape(exp_res_aaa_1)) exp_res_aaaa_1 = reshape([9.81600024E-05, 1.02160004E-04, 1.06160005E-04, & 1.10159999E-04, 1.14160001E-04, 9.41600010E-05, 9.81600024E-05, 9.81600024E-05, & 1.02160004E-04, 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.81600024E-05, 9.81600024E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.81600024E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.81600024E-05, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.10159999E-04, 1.18160002E-04, 1.26159997E-04, 1.34160000E-04, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 1.10159999E-04, 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 1.02160004E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.02160004E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.18160002E-04, 1.30159999E-04, 1.42160003E-04, 1.54160007E-04, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 1.18160002E-04, 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 1.06160005E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 1.06160005E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.06160005E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.26159997E-04, 1.42160003E-04, 1.58160008E-04, 1.74159999E-04, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 1.26159997E-04, 1.26159997E-04, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 1.10159999E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.10159999E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.34160000E-04, 1.54160007E-04, 1.74159999E-04, 1.94160006E-04, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 1.34160000E-04, 1.34160000E-04, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 1.14160001E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 1.14160001E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.14160001E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.42160003E-04, 1.66159996E-04, 1.90160004E-04, 2.14159998E-04, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 1.42160003E-04, 1.42160003E-04, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 1.18160002E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.18160002E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.50160005E-04, 1.78160000E-04, 2.06159995E-04, 2.34160019E-04, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 1.50160005E-04, 1.50160005E-04, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 1.22159996E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 1.22159996E-04, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 1.22159996E-04, & 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05, 9.41600010E-05], shape(exp_res_aaaa_1)) exp_res_aaa_2 = reshape([10.0000000, 25.0000000, 28.0000000, 31.0000000, 17.0000000, 20.0000000, & 23.0000000, 26.0000000, 24.0000000, 27.0000000, 18.0000000, 21.0000000, 31.0000000, 22.0000000, & 37.0000000, 16.0000000, 38.0000000, 29.0000000, 32.0000000, 35.0000000, 45.0000000, 24.0000000, & 27.0000000, 30.0000000], shape(exp_res_aaa_2)) exp_res_aaaa_2 = reshape([1.25200007E-04, 1.30200002E-04, 1.35200011E-04, 1.40200005E-04, 1.16199997E-04, & 1.21200006E-04, 1.26200001E-04, 1.31200009E-04, 1.13200003E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, & 1.12200010E-04, 1.17199990E-04, 1.22200014E-04, 1.27199994E-04, 1.11200003E-04, 1.16199997E-04, 1.21200006E-04, & 1.26200001E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.40199991E-04, 1.45200000E-04, & 1.50200009E-04, 1.55200003E-04, 1.22199999E-04, 1.27200008E-04, 1.32200003E-04, 1.37199997E-04, 1.16199997E-04, & 1.21200006E-04, 1.26200001E-04, 1.31200009E-04, 1.14199996E-04, 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, & 1.12200010E-04, 1.17200005E-04, 1.22199999E-04, 1.27200008E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, & 1.25200007E-04, 1.55200003E-04, 1.60200012E-04, 1.65200006E-04, 1.70200001E-04, 1.28200001E-04, 1.33199996E-04, & 1.38200005E-04, 1.43199999E-04, 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, 1.34200003E-04, 1.16200012E-04, & 1.21199992E-04, 1.26200015E-04, 1.31199995E-04, 1.13200003E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, & 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.70200001E-04, 1.75199995E-04, 1.80200004E-04, & 1.85199999E-04, 1.34200003E-04, 1.39199998E-04, 1.44199992E-04, 1.49200001E-04, 1.22199999E-04, 1.27200008E-04, & 1.32200003E-04, 1.37199997E-04, 1.18199998E-04, 1.23200007E-04, 1.28200001E-04, 1.33199996E-04, 1.14200011E-04, & 1.19200005E-04, 1.24200000E-04, 1.29200009E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, & 1.85199999E-04, 1.90200008E-04, 1.95200002E-04, 2.00200011E-04, 1.40200005E-04, 1.45200000E-04, 1.50200009E-04, & 1.55200003E-04, 1.25200007E-04, 1.30200002E-04, 1.35199996E-04, 1.40200005E-04, 1.20200013E-04, 1.25199993E-04, & 1.30200002E-04, 1.35199996E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 1.30200002E-04, 1.10200010E-04, & 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 2.00200011E-04, 2.05200005E-04, 2.10200000E-04, 2.15199994E-04, & 1.46200007E-04, 1.51200002E-04, 1.56199996E-04, 1.61200005E-04, 1.28200001E-04, 1.33199996E-04, 1.38200005E-04, & 1.43199999E-04, 1.22199999E-04, 1.27199994E-04, 1.32200003E-04, 1.37199997E-04, 1.16200004E-04, 1.21199999E-04, & 1.26200001E-04, 1.31200009E-04, 1.10200010E-04, 1.15200004E-04, 1.20199998E-04, 1.25200007E-04, 2.15200009E-04, & 2.20199989E-04, 2.25199998E-04, 2.30200007E-04, 1.52199995E-04, 1.57200004E-04, 1.62199998E-04, 1.67199993E-04, & 1.31200009E-04, 1.36200004E-04, 1.41199998E-04, 1.46200007E-04, 1.24200000E-04, 1.29199994E-04, 1.34200003E-04, & 1.39199998E-04, 1.17200005E-04, 1.22199999E-04, 1.27200008E-04, 1.32200003E-04, 1.10200010E-04, 1.15200004E-04, & 1.20199998E-04, 1.25200007E-04], shape(exp_res_aaaa_2)) exp_res_aaa_3 = reshape([45.0000000, 39.0000000, 33.0000000, 27.0000000, 39.0000000, 27.0000000, 15.0000000, & 27.0000000, 33.0000000, 15.0000000, 33.0000000, 51.0000000, 27.0000000, 27.0000000, 51.0000000, 27.0000000, & 21.0000000, 39.0000000, 33.0000000, 27.0000000], shape(exp_res_aaa_3)) exp_res_aaaa_3 = reshape([1.33240013E-04, 1.39240015E-04, 1.45239988E-04, 1.51240019E-04, 1.35240014E-04, & 1.41240016E-04, 1.47239989E-04, 1.53240020E-04, 1.37240000E-04, 1.43240017E-04, 1.49239990E-04, 1.55240021E-04, & 1.40240008E-04, 1.46240011E-04, 1.52239998E-04, 1.58240015E-04, 1.42240009E-04, 1.48239997E-04, 1.54240013E-04, & 1.60240001E-04, 1.34240006E-04, 1.40240008E-04, 1.46239996E-04, 1.52240013E-04, 1.38240008E-04, 1.44240010E-04, & 1.50239997E-04, 1.56240014E-04, 1.42240009E-04, 1.48240011E-04, 1.54239999E-04, 1.60240015E-04, 1.48239997E-04, & 1.54240013E-04, 1.60239986E-04, 1.66240017E-04, 1.52239998E-04, 1.58240015E-04, 1.64239987E-04, 1.70240019E-04, & 1.35240014E-04, 1.41240016E-04, 1.47239989E-04, 1.53240020E-04, 1.41240016E-04, 1.47240018E-04, 1.53239991E-04, & 1.59240008E-04, 1.47240004E-04, 1.53240006E-04, 1.59239993E-04, 1.65240010E-04, 1.56239999E-04, 1.62240001E-04, & 1.68240003E-04, 1.74240005E-04, 1.62240001E-04, 1.68240003E-04, 1.74240005E-04, 1.80240007E-04, 1.36240007E-04, & 1.42240009E-04, 1.48239997E-04, 1.54240013E-04, 1.44240010E-04, 1.50240012E-04, 1.56239985E-04, 1.62240016E-04, & 1.52239998E-04, 1.58240015E-04, 1.64239987E-04, 1.70240004E-04, 1.64239987E-04, 1.70240019E-04, 1.76239992E-04, & 1.82240008E-04, 1.72239990E-04, 1.78240021E-04, 1.84239994E-04, 1.90240011E-04, 1.37240015E-04, 1.43240017E-04, & 1.49239990E-04, 1.55240021E-04, 1.47240004E-04, 1.53240006E-04, 1.59239993E-04, 1.65240010E-04, 1.57240007E-04, & 1.63240009E-04, 1.69239996E-04, 1.75240013E-04, 1.72240005E-04, 1.78240007E-04, 1.84239994E-04, 1.90240011E-04, & 1.82240008E-04, 1.88239996E-04, 1.94239998E-04, 2.00240000E-04, 1.38240008E-04, 1.44240010E-04, 1.50239997E-04, & 1.56240014E-04, 1.50239997E-04, 1.56240014E-04, 1.62239987E-04, 1.68240018E-04, 1.62240001E-04, 1.68240003E-04, & 1.74239991E-04, 1.80240007E-04, 1.80239993E-04, 1.86240009E-04, 1.92239997E-04, 1.98240014E-04, 1.92239997E-04, & 1.98240014E-04, 2.04240001E-04, 2.10239989E-04, 1.39240015E-04, 1.45240017E-04, 1.51239990E-04, 1.57240007E-04, & 1.53240006E-04, 1.59240008E-04, 1.65239995E-04, 1.71240012E-04, 1.67239996E-04, 1.73240012E-04, 1.79240000E-04, & 1.85240016E-04, 1.88239996E-04, 1.94240012E-04, 2.00240000E-04, 2.06240016E-04, 2.02240015E-04, 2.08240002E-04, & 2.14239990E-04, 2.20240006E-04], shape(exp_res_aaaa_3)) exp_res_aaaa_4 = reshape([ 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 2.10279992E-04, & 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, 2.38280001E-04, 2.45280011E-04, 2.52280006E-04, 2.59280001E-04, & 2.66279996E-04, 2.73279991E-04, 2.80280015E-04, 2.87280011E-04, 2.94280006E-04, 3.01280001E-04, 3.08279996E-04, & 3.15280020E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, & 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 2.10279992E-04, & 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, 2.10279992E-04, 2.17280001E-04, 2.24280011E-04, 2.31279992E-04, & 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, & 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, & 1.96280016E-04, 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, & 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, & 2.03280011E-04, 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, 1.61280012E-04, & 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, & 1.82280011E-04, 1.89280006E-04, 1.96280016E-04, 2.03280011E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, & 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, & 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, 1.61280012E-04, 1.68279992E-04, 1.75280016E-04, 1.54280002E-04, & 1.61280012E-04, 1.68279992E-04, 1.75280016E-04], shape(exp_res_aaaa_4)) dim = 1 res_aa_1 = sum(aa, dim) print *, sum(res_aa_1) if (abs(sum(res_aa_1) - 20.0) > 1e-8) error stop s_aa = shape(sum(aa, dim)) print *, s_aa if (s_aa(1) /= 5) error stop do i = 1, 5 if (abs(res_aa_1(i) - exp_res_aa_1(i)) > 1e-8) error stop end do res_aaa_1 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 5 .or. s_aaa(2) /= 6) error stop do i = 1, 5 do j = 1, 6 if (abs(res_aaa_1(i, j) - exp_res_aaa_1(i, j)) > 1e-8) error stop end do end do res_aaaa_1 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976274e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 5 .or. s_aaaa(2) /= 6 .or. s_aaaa(3) /= 7) error stop do i = 1, 5 do j = 1, 6 do k = 1, 7 if (abs(res_aaaa_1(i, j, k) - exp_res_aaaa_1(i, j, k)) > 1e-8) error stop end do end do end do dim = 2 res_aa_2 = sum(aa, dim) if (abs(sum(sum(aa, dim)) - 20.0) > 1e-8) error stop s_aa = shape(sum(aa, dim)) print *, s_aa if (s_aa(1) /= 4) error stop do i = 1, 4 if (abs(res_aa_2(i) - exp_res_aa_2(i)) > 1e-8) error stop end do res_aaa_2 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 4 .or. s_aaa(2) /= 6) error stop do i = 1, 4 do j = 1, 6 if (abs(res_aaa_2(i, j) - exp_res_aaa_2(i, j)) > 1e-8) error stop end do end do res_aaaa_2 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976013e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 6 .or. s_aaaa(3) /= 7) error stop do i = 1, 4 do j = 1, 6 do k = 1, 7 if (abs(res_aaaa_2(i, j, k) - exp_res_aaaa_2(i, j, k)) > 1e-8) error stop end do end do end do dim = 3 res_aaa_3 = sum(aaa, dim) print *, sum(sum(aaa, dim)) if (abs(sum(sum(aaa, dim)) - 636.0) > 1e-8) error stop s_aaa = shape(sum(aaa, dim)) print *, s_aaa if (s_aaa(1) /= 4 .or. s_aaa(2) /= 5) error stop do i = 1, 4 do j = 1, 5 if (abs(res_aaa_3(i, j) - exp_res_aaa_3(i, j)) > 1e-8) error stop end do end do res_aaaa_3 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976032e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 5 .or. s_aaaa(3) /= 7) error stop do i = 1, 4 do j = 1, 5 do k = 1, 7 if (abs(res_aaaa_3(i, j, k) - exp_res_aaaa_3(i, j, k)) > 1e-8) error stop end do end do end do dim = 4 res_aaaa_4 = sum(aaaa, dim) print *, sum(sum(aaaa, dim)) if (abs(sum(sum(aaaa, dim)) - 2.27976087e-02) > 1e-8) error stop s_aaaa = shape(sum(aaaa, dim)) print *, s_aaaa if (s_aaaa(1) /= 4 .or. s_aaaa(2) /= 5 .or. s_aaaa(3) /= 6) error stop do i = 1, 4 do j = 1, 5 do k = 1, 6 if (abs(res_aaaa_4(i, j, k) - exp_res_aaaa_4(i, j, k)) > 1e-8) error stop end do end do end do print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 2.27976032e-02) > 1e-8) error stop ! TODO: Uncomment after https://github.com/lfortran/lfortran/issues/7412 is fixed. ! mask = .false. do i = lbound(mask, 1), ubound(mask, 1) do j = lbound(mask, 2), ubound(mask, 2) do k = lbound(mask, 3), ubound(mask, 3) do l = lbound(mask, 4), ubound(mask, 4) mask(i, j, k, l) = .false. end do end do end do end do print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 0.0) > 1e-8) error stop mask(1, 1, :, :) = .true. print *, sum(sum(aaaa, dim, mask)) if (abs(sum(sum(aaaa, dim, mask)) - 9.53679963e-04) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/while_01.f900000664000175000017500000000060615141516316023332 0ustar alastairalastairprogram while_01 implicit none integer :: i, j i = 1 j = 0 do while (i < 11) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop i = 1 j = 0 do while (i <= 10) j = j + i i = i + 1 end do if (j /= 55) error stop if (i /= 11) error stop i = 1 j = 0 do while (i < 1) j = j + i i = i + 1 end do if (j /= 0) error stop if (i /= 1) error stop end lfortran-lfortran-2f73434/integration_tests/implicit_interface_19.f900000664000175000017500000000055115141516316026064 0ustar alastairalastairsubroutine xyzzy (i) integer :: i i = max (i, ifunc (42)) print *, ifunc (42) end subroutine subroutine xyyzzy (i) integer :: i i = dim (i, ifunc (42)) print *, ifunc (42) end subroutine program implicit_interface_19 integer :: i i = 1245 call xyzzy (i) print *, i if ( i /= 38304 ) error stop call xyyzzy (i) print *, i if ( i /= 0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_bindc_04.f900000664000175000017500000000657215141516316024672 0ustar alastairalastairmodule bindc_04_thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n, m type(c_ptr) :: a end type thread_data end module bindc_04_thread_data_module module module_openmp_bindc_04 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module subroutine lcompilers_initialise_array(data) bind(C) use bindc_04_thread_data_module use iso_c_binding use module_openmp_bindc_04 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:,:) integer(c_int) :: i, j, n, m, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n m = tdata%m call c_f_pointer(tdata%a, a, [n, m]) num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if do i = start + 1, end do j = 1, m a(i, j) = 12.91 end do end do call GOMP_barrier() end subroutine subroutine initialize_array(n, m, a) use bindc_04_thread_data_module use module_openmp_bindc_04 use iso_c_binding implicit none interface subroutine lcompilers_initialise_array(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface integer(c_int), intent(in) :: n, m real(c_float), dimension(:, :), intent(inout), pointer :: a type(thread_data), target :: data type(c_ptr) :: tdata data%n = n data%m = m data%a = c_loc(a) tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_initialise_array), tdata, 0, 0) end subroutine program openmp_bindc_04 use omp_lib use module_openmp_bindc_04 use bindc_04_thread_data_module use iso_c_binding implicit none interface subroutine initialize_array(n, m, a) use iso_c_binding integer(c_int), intent(in) :: n, m real(c_float), intent(inout), dimension(:, :), pointer :: a end subroutine end interface integer(c_int) :: n = 1902, m = 300 real(c_float), dimension(:, :), pointer :: a allocate(a(n, m)) call omp_set_num_threads(4) call initialize_array(n, m, a) print *, "Done" print *, a(1,2) if (abs(a(1,2) - 12.91) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_24.f900000664000175000017500000000107015141516316025233 0ustar alastairalastair! Testing for correct handling of compile-time value (if present) during `Var` node ! replacement with `m_value` for a module variable by `array_struct_temporary` pass. module arrays_reshape_24_mod implicit none character(len=*,kind=1), parameter :: test1data(2,2) = reshape([character(len=2) :: "ab", "cd", "ef", "gh"], [2, 2]) end module program arrays_reshape_24 use arrays_reshape_24_mod print *, size(test1data, 1) if (size(test1data, 1) /= 2) error stop print *, size(test1data, 2) if (size(test1data, 2) /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_17b.f900000664000175000017500000000021215141516316024551 0ustar alastairalastairprogram intrinsics_17b implicit none real :: A, B B = 2.0D0 A = log(B) print *, A if (abs(A - 0.693147182) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/class_75.f900000664000175000017500000000142115141516316023336 0ustar alastairalastairmodule class_75_mod implicit none type :: x integer :: i = 66 end type x type, extends(x) :: z integer :: z_a end type z type, extends(x) :: y integer, allocatable :: arr(:) character(len=:), allocatable :: str end type y end module class_75_mod program class_75 use class_75_mod implicit none class(y), allocatable :: c, v type(y) :: yy allocate(c) yy%i = 42 allocate(yy%arr(3)) yy%arr = [1,2,3] yy%str = "hello" v = yy c = v select type(c) type is (y) print *, "i:", c%i print *, "arr:", c%arr print *, "str:", c%str if (c%i /= 42) error stop if (any(c%arr /= [1,2,3])) error stop if (c%str /= "hello") error stop class default error stop end select end program class_75 lfortran-lfortran-2f73434/integration_tests/read_04.f900000664000175000017500000000064315141516316023141 0ustar alastairalastairprogram read_04 integer :: unit, cc, stat character(len=4000) :: buffer open(newunit=unit, status="scratch") write(unit, "(a)") "abc" rewind(unit) read(unit,"(a)", advance='no',iostat=stat, size=cc) buffer print *, cc if(cc /= 3) error stop read(unit,"(a)", advance='no',iostat=stat, size=cc) buffer print *, cc if(cc /= 0) error stop close(unit) end programlfortran-lfortran-2f73434/integration_tests/complex_29.f900000664000175000017500000000053215141516316023701 0ustar alastairalastair! Test: complex*16 parameter with complex(4) literal - kind cast program complex_29 implicit none complex*16 zero, one, z parameter (zero = (0.0E+0, 0.0E+0), one = (1.0E+0, 0.0E+0)) z = one + zero if (dabs(dble(z) - 1.0d0) > 1.0d-12) error stop if (dabs(dimag(z)) > 1.0d-12) error stop print *, 'PASS' end program lfortran-lfortran-2f73434/integration_tests/class_40.f900000664000175000017500000000313115141516316023326 0ustar alastairalastairmodule class_40_mod type :: AbsNestedType contains procedure :: abs_nested_method end type AbsNestedType type, public :: AbsType class(AbsNestedType), allocatable :: nested_obj contains procedure :: abs_method end type AbsType type :: Wrapper class(AbsType), allocatable :: obj type(AbsType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s integer :: i i = self%wrapped%obj%abs_method(42) if (i /= 1) error stop i = 0 i = self%wrapped%obj%nested_obj%abs_nested_method(101) if (i /= 1) error stop i = 0 i = type_s%wrapped%t_obj%abs_method(42) if (i /= 1) error stop end subroutine caller integer function abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop abs_method = 1 end function abs_method integer function abs_nested_method(self, val) class(AbsNestedType), intent(in) :: self integer, intent(in) :: val print *, "abs_nested_method called" if (val /= 101) error stop abs_nested_method = 1 end function abs_nested_method end module class_40_mod program class_40 use class_40_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) allocate(var%wrapped%obj%nested_obj) call var%caller() end program class_40lfortran-lfortran-2f73434/integration_tests/intrinsics_291.f900000664000175000017500000000403415141516316024501 0ustar alastairalastairprogram intrinsics_291 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_runtime_dp(3) = [0.73925_dp, 4.6272183_dp, 82.1483927190_dp] real(sp) :: log_runtime_sp(3) = [0.73925, 4.6272183, 8.14839] real(dp) :: log_res_dp(3) real(sp) :: log_res_sp(3) real(dp) :: expected_dp(3) = [1.2399882923281214_dp, 13.907361652217805_dp, 1.1139704077610786E+121_dp] real(sp) :: expected_sp(3) = [1.23998833, 13.9073610, 6807.07861] real(dp), parameter :: res(3) = gamma([0.73925_dp, 4.6272183_dp, 82.1483927190_dp]) real(sp), parameter :: res_sp(3) = gamma([0.73925, 4.6272183_sp, 8.14839]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_res_dp = gamma(log_runtime_dp) log_res_sp = gamma(log_runtime_sp) do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = gamma(21.7282828_dp) d = gamma(11.63827) print *, a if (a - 2.22349180143608259e+19_dp > 1e-12_dp) error stop print *,gamma(21.7282828_dp) if (gamma(21.7282828_dp) - 2.22349180143608259e+19_dp > 1e-12_dp) error stop print *, d if (d - 16592656.0_sp > 1e-5) error stop print *, gamma(11.63827) if (gamma(11.63827) - 16592656.0_sp > 1e-5) error stop a = gamma(61.72812_dp) d = gamma(7.72818) print *, a if (a - 1.65731626595094650e+83_dp > 1e-12_dp) error stop print *,gamma(61.72812_dp) if (gamma(61.72812_dp) - 1.65731626595094650e+83_dp > 1e-12_dp) error stop print *, d if (d - 2.92850854e+03_sp > 1e-5) error stop print *, gamma(7.72818) if (gamma(7.72818) - 2.92850854e+03_sp > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/string_67.f900000664000175000017500000000102715141516316023542 0ustar alastairalastair! Test out calls to `achar` (Function returing a character) to make sure it doesn't fill the stack program string_67 integer :: j character(4) :: ssss integer :: i j = 1 do i =0, 65536 ssss = achar(97+i) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) ssss = achar(97+j) end do end program lfortran-lfortran-2f73434/integration_tests/bindc_08.f900000664000175000017500000000111615141516316023305 0ustar alastairalastairprogram optional_06 use iso_c_binding, only: c_char, c_int, c_null_char implicit none interface function c_is_dir(path) result(r) bind(c, name="c_is_dir") import c_char, c_int character(kind=c_char), intent(in) :: path(*) integer(kind=c_int) :: r end function c_is_dir end interface character(:), allocatable :: tmp_chars(:) integer :: res tmp_chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] ! res = c_is_dir(tmp_chars) !! TODO: Handle descriptor array passed to bind c end program optional_06lfortran-lfortran-2f73434/integration_tests/character_array_parameter_padding_trimming.f900000664000175000017500000000124215141516316032505 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_array_parameter_padding_trimming character(len=1), parameter :: a_pad(4) = ["ab", "cd", "ef", "gh"] character(len=5), parameter :: b_pad(4) = ["ab", "cd", "ef", "gh"] character(len=1), parameter :: c_pad(4) = [["ab", "cd"], [["ef"], "gh"]] character(len=5), parameter :: d_pad(4) = [["ab", "cd"], [["ef"], "gh"]] if (len(a_pad) /= 1) error stop if (len(b_pad) /= 5) error stop if (len(c_pad) /= 1) error stop if (len(d_pad) /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/class_10.f900000664000175000017500000000302615141516316023326 0ustar alastairalastairmodule class_10_module implicit none private public :: toml_vector, toml_value, toml_node type, abstract :: toml_value character(len=:), allocatable :: key contains procedure :: match_key end type toml_value type :: toml_node !> TOML value payload class(toml_value), allocatable :: val end type toml_node !> Stores TOML values in a list of pointers type :: toml_vector !> Current number of stored TOML values integer :: n = 0 !> List of TOML values type(toml_node), allocatable :: lst(:) contains procedure :: delete end type toml_vector contains !> Compare raw key of TOML value to input key pure function match_key(self, key) result(match) !> TOML value instance. class(toml_value), intent(in) :: self !> TOML raw key to compare to character(len=*), intent(in) :: key logical :: match end function match_key !> Delete TOML value at a given key subroutine delete(self, key) !> Instance of the structure class(toml_vector), intent(inout), target :: self !> Key to the TOML value character(len=*), intent(in) :: key integer :: i if (self%lst(i)%val%match_key(key)) then ! TODO ! Improve this test to print or test something end if end subroutine delete end module class_10_module program class_10_program use class_10_module implicit none print *, "ok" end program class_10_program lfortran-lfortran-2f73434/integration_tests/class_59.f900000664000175000017500000000014115141516316023336 0ustar alastairalastairprogram class_59 class(*), allocatable :: dum allocate(dum , source="sss") end program lfortran-lfortran-2f73434/integration_tests/test_ieee_real.f900000664000175000017500000000350015141516316024667 0ustar alastairalastair! Test ieee_real function program test_ieee_real use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64, int64 implicit none integer :: i32 integer(int64) :: i64 real(real32) :: r_sp, x_sp real(real64) :: r_dp, x_dp print *, "Testing ieee_real..." ! Test 1: Convert integer to single precision i32 = 42 x_sp = 0.0_real32 ! Used for kind r_sp = ieee_real(i32, x_sp) print *, "ieee_real(42, real32) = ", r_sp if (abs(r_sp - 42.0_real32) > 1.0e-6) error stop "42 should convert to 42.0" ! Test 2: Negative integer i32 = -17 r_sp = ieee_real(i32, x_sp) print *, "ieee_real(-17, real32) = ", r_sp if (abs(r_sp - (-17.0_real32)) > 1.0e-6) error stop "-17 should convert to -17.0" ! Test 3: Zero i32 = 0 r_sp = ieee_real(i32, x_sp) print *, "ieee_real(0, real32) = ", r_sp if (r_sp /= 0.0_real32) error stop "0 should convert to 0.0" ! Test 4: Convert integer to double precision i32 = 100 x_dp = 0.0_real64 ! Used for kind r_dp = ieee_real(i32, x_dp) print *, "ieee_real(100, real64) = ", r_dp if (abs(r_dp - 100.0_real64) > 1.0e-10) error stop "100 should convert to 100.0d0" ! Test 5: Large integer (int64) to single precision i64 = 999_int64 r_sp = ieee_real(i64, x_sp) print *, "ieee_real(999_int64, real32) = ", r_sp if (abs(r_sp - 999.0_real32) > 1.0e-6) error stop "999 should convert to 999.0" ! Test 6: Large integer (int64) to double precision i64 = 123456_int64 r_dp = ieee_real(i64, x_dp) print *, "ieee_real(123456_int64, real64) = ", r_dp if (abs(r_dp - 123456.0_real64) > 1.0e-10) error stop "123456 should convert to 123456.0d0" print *, "All ieee_real tests passed!" end program test_ieee_real lfortran-lfortran-2f73434/integration_tests/nested_12.f900000664000175000017500000000125415141516316023506 0ustar alastairalastairmodule struct_var_nested_12 type :: toml_value integer :: key = 0 end type toml_value end module module nested_12_mod use struct_var_nested_12, only: toml_lexer => toml_value contains subroutine char_num() type(toml_lexer) :: lexer lexer%key = 5 call temp() contains subroutine temp() call semantics(lexer) end subroutine end subroutine subroutine semantics(lexer) class(toml_lexer), intent(inout) :: lexer if(lexer%key /= 5) error stop end subroutine semantics end module program nested_12 use struct_var_nested_12 use nested_12_mod call char_num() end programlfortran-lfortran-2f73434/integration_tests/complex_18.f900000664000175000017500000000216015141516316023676 0ustar alastairalastairprogram complex_18 implicit none complex(4), target :: my_complex1(2, 3) complex(8), target :: my_complex2(2, 3) integer :: i, j, k k = 1 do i = 1, 2 do j = 1, 3 my_complex1(i, j) = complex(k, k + 1) my_complex2(i, j) = complex(k, k + 1) k = k + 2 end do end do print *, my_complex1 if (abs(my_complex1(1, 1) - (1, 2)) > 1e-5) error stop if (abs(my_complex1(1, 2) - (3, 4)) > 1e-5) error stop if (abs(my_complex1(1, 3) - (5, 6)) > 1e-5) error stop if (abs(my_complex1(2, 1) - (7, 8)) > 1e-5) error stop if (abs(my_complex1(2, 2) - (9, 10)) > 1e-5) error stop if (abs(my_complex1(2, 3) - (11, 12)) > 1e-5) error stop print *, my_complex2 if (abs(my_complex2(1, 1) - (1, 2)) > 1e-8_8) error stop if (abs(my_complex2(1, 2) - (3, 4)) > 1e-8_8) error stop if (abs(my_complex2(1, 3) - (5, 6)) > 1e-8_8) error stop if (abs(my_complex2(2, 1) - (7, 8)) > 1e-8_8) error stop if (abs(my_complex2(2, 2) - (9, 10)) > 1e-8_8) error stop if (abs(my_complex2(2, 3) - (11, 12)) > 1e-8_8) error stop end program lfortran-lfortran-2f73434/integration_tests/entry_12.f900000664000175000017500000000026315141516316023364 0ustar alastairalastairsubroutine dinvr(x) integer :: x go to 310 return entry dstinv() return 310 continue print *, "x = ", x if (x /= 12) error stop end program entry_09 call dinvr(12) end program lfortran-lfortran-2f73434/integration_tests/optional_04.f900000664000175000017500000000053115141516316024047 0ustar alastairalastairmodule module_optional_04 contains subroutine sub( a ) integer, intent(in), optional :: a(10) call sub2( a(5) ) end subroutine subroutine sub2( a ) integer, intent(in), optional :: a if ( .not. present(a) ) error stop end subroutine end module program optional_04 use module_optional_04 call sub() end lfortran-lfortran-2f73434/integration_tests/nested_19.f900000664000175000017500000000073515141516316023520 0ustar alastairalastairprogram nested_19 type t1 integer, allocatable :: ll end type type t2 type(t1),allocatable :: arr(:) end type t2 type t3 type(t2) ,allocatable :: z(:) end type call ss contains subroutine ss type(t3), allocatable :: t2 allocate(t2) if (.not. allocated(t2)) error stop "t2 not allocated" allocate(t2%z(10)) allocate(t2%z(1)%arr(5)) end subroutine end program nested_19lfortran-lfortran-2f73434/integration_tests/arrays_87.f900000664000175000017500000000136515141516316023544 0ustar alastairalastairmodule memory_arrays_87 implicit none contains subroutine alloc_rvector_dp(x, n) implicit none integer, intent(in) :: n real, allocatable, intent(out) :: x(:) allocate(x(n)) x = 10 end subroutine alloc_rvector_dp end module memory_arrays_87 module test_arrays_87 use memory_arrays_87, only: alloc_rvector_dp implicit none contains subroutine call_allocate(x, n) integer, intent(in) :: n real, allocatable :: x(:) integer :: r call alloc_rvector_dp(x, n) call xuse(r) print *, r if( r /= 100 ) error stop contains subroutine xuse(r) implicit none integer, intent(out) :: r r = sum(x) end subroutine end subroutine end module program arrays_87 use test_arrays_87 implicit none real, allocatable :: a(:) call call_allocate(a, 10) end program lfortran-lfortran-2f73434/integration_tests/intent_03.f900000664000175000017500000000123615141516316023525 0ustar alastairalastairmodule prime_numbers_intent_03_module integer, parameter :: p40001_to_50000(10) = & [ 40009, 40011, 40013, 40027, 40029, 40039, 40051, 40057, 40063, 40069 ] contains ! Return the n-th prime number function prime() result(prime_number) integer :: prime_number prime_number = next_prime(p40001_to_50000(4)) end function prime elemental integer function next_prime(n) integer, intent(in) :: n next_prime = n + 9 end function next_prime end module prime_numbers_intent_03_module program intent_03 use prime_numbers_intent_03_module print *, prime() if ( prime() /= 40036 ) error stop end program lfortran-lfortran-2f73434/integration_tests/common_23.f900000664000175000017500000000153115141516316023514 0ustar alastairalastair! Test: Blank (unnamed) COMMON block (F2018 8.10.3.1) ! The blank common block (declared without a name) is a special case that ! provides global storage shared across all program units. Unlike named ! COMMON blocks, blank common cannot be initialized in BLOCK DATA. program common_23 implicit none integer :: i, j real :: x common i, j, x ! Blank common (no name) i = 42 j = 84 x = 3.14 call sub_blank_access() if (i /= 100) error stop "i should be 100 after subroutine" print *, "PASS: common_23" end program subroutine sub_blank_access() implicit none integer :: a, b real :: c common a, b, c ! Same blank common if (a /= 42) error stop "a should be 42" if (b /= 84) error stop "b should be 84" if (abs(c - 3.14) > 0.001) error stop "c should be 3.14" a = 100 end subroutine lfortran-lfortran-2f73434/integration_tests/global_allocatable_01.f900000664000175000017500000000054015141516316026002 0ustar alastairalastairmodule mod_test_allocatable_01 implicit none integer, allocatable, dimension(:) :: f end module mod_test_allocatable_01 program mm use mod_test_allocatable_01 implicit none logical :: ret allocate(f(4)) f = [1, 2, 3, 4] print *,f ret = all( f == [1,2,3,4]) if(ret .eqv. .false.) error stop end program mm lfortran-lfortran-2f73434/integration_tests/file_09.f900000664000175000017500000000115115141516316023145 0ustar alastairalastairprogram file_09 implicit none integer :: u = 11, i, j character :: arr(2, 2) character, allocatable :: alloc_arr(:, :) print *, "1" open(u, file="file_01_data.txt", form="unformatted", access="stream", status="old") read(u) arr close(u) if (arr(1, 1) /= '1' .or. arr(1, 2) /= '1') error stop print *, arr open(u, file="file_01_data.txt", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 2)) read(u) alloc_arr close(u) if (alloc_arr(2, 1) /= '0' .or. alloc_arr(2, 2) /= '3') error stop print *, alloc_arr end program file_09 lfortran-lfortran-2f73434/integration_tests/stop_02.f900000664000175000017500000000007415141516316023207 0ustar alastairalastairprogram stop_02 implicit none stop 10 end program lfortran-lfortran-2f73434/integration_tests/string_40.f900000664000175000017500000000072415141516316023534 0ustar alastairalastairprogram string_40 print *, integer_i1_to_string(5) if (integer_i1_to_string(5) /= 'ingLFortran') error stop contains pure function integer_i1_to_string(pos) result(string) character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer integer, intent(in) :: pos buffer = 'TestingLFortran' string = buffer(pos:) end function integer_i1_to_string end program lfortran-lfortran-2f73434/integration_tests/procedure_26.f900000664000175000017500000000337315141516316024225 0ustar alastairalastairmodule procedure_26_mod_1 implicit none private public :: error_type type :: error_type integer :: stat = 0 character(len=:), allocatable :: message end type error_type end module procedure_26_mod_1 module procedure_26_mod_2 use procedure_26_mod_1, only: error_type implicit none private public :: check interface check module procedure :: check_stat module procedure :: check_logical end interface check contains subroutine check_stat(error, stat, message) type(error_type), allocatable, intent(out) :: error integer, intent(in) :: stat character(len=*), intent(in), optional :: message if (stat /= 0) then allocate(error) error%stat = stat if (present(message)) error%message = message end if end subroutine check_stat subroutine check_logical(error, expression, message) type(error_type), allocatable, intent(out) :: error logical, intent(in) :: expression character(len=*), intent(in), optional :: message if (.not. expression) then allocate(error) error%stat = 1 if (present(message)) error%message = message end if end subroutine check_logical end module procedure_26_mod_2 program procedure_26 use procedure_26_mod_1, only: error_type use procedure_26_mod_2, only: check implicit none type(error_type), allocatable :: error integer, pointer :: ptr => null() call check(error, .not.associated(ptr), "Pointer should not be associated") if (allocated(error)) then error stop "Test failed: "//trim(error%message) else print *, "Test passed" end if end program procedure_26 lfortran-lfortran-2f73434/integration_tests/iso_c_binding_02.f900000664000175000017500000000055415141516316025013 0ustar alastairalastairprogram iso_c_binding_02 use iso_c_binding implicit none type(c_funptr) :: fptr type(c_ptr) :: ptr fptr = c_null_funptr ptr = c_null_ptr ! check if ptr is null if (c_associated(ptr)) error stop ! check if fptr is null if (c_associated(fptr)) error stop print *, "Null function pointer assigned successfully." end program iso_c_binding_02 lfortran-lfortran-2f73434/integration_tests/data_07.f900000664000175000017500000000050415141516316023136 0ustar alastairalastairprogram data_07 implicit none double precision bands dimension bands(4, 5) common /jac/ bands data bands / 0.00D0, -1.0D0, 0.25D0, 0.10D0, 0.25D0, -5.0D0, 0.25D0, 0.10D0, & 0.25D0, -25.0D0, 0.25D0, 0.10D0, 0.25D0,-125.0D0, 0.25D0, 0.00D0, & 0.25D0, -625.0D0, 0.00D0, 0.00D0 / end program lfortran-lfortran-2f73434/integration_tests/arrays_73.f900000664000175000017500000000305415141516316023534 0ustar alastairalastairprogram arrays_73 implicit none integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A3(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) call temp(A, A1, A2, A3, tmp) contains subroutine temp(A, A1, A2, A3, tmp) integer, intent(inout) :: A(:) integer, intent(inout) :: A1(:,:) integer, intent(inout) :: A3(:,:) integer, intent(inout) :: A2(:,:,:) integer, intent(inout) :: tmp(:,:) integer, save :: X(4) = [2,1,4,3] A1(:,[2,1]) = A3(:,[2,3]) if (A1(1,1) /= 7 .or. A1(2,1) /= 8 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1(:,1:2) = A3([2,1,3],[2,1]) if (A1(1,1) /= 5 .or. A1(2,1) /= 4 .or. A1(3,1) /= 6 .or. & & A1(1,2) /= 2 .or. A1(2,2) /= 1 .or. A1(3,2) /= 3 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1(1:2,2:3) = A3(2:3,1:2) if (A1(1,1) /= 5 .or. A1(2,1) /= 4 .or. A1(3,1) /= 6 .or. & & A1(1,2) /= 2 .or. A1(2,2) /= 3 .or. A1(3,2) /= 3 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 6 .or. A1(3,3) /= 9) error stop !! TODO: Handle cases by creating Temporary for RHS where LHS and RHS has common variable A(X) = A if (any(A /= [2, 1, 4, 3])) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/doloop_15.f900000664000175000017500000000020115141516316023512 0ustar alastairalastairprogram doloop_15 integer :: i do i = 2, 2 end do print *, i if ( i /= 3 ) error stop end program doloop_15 lfortran-lfortran-2f73434/integration_tests/subroutines_11.f900000664000175000017500000000065215141516316024606 0ustar alastairalastairprogram test implicit none real :: x(1, 3) x = 0 call random_init(.true., .true.) call random_number(x(1, 2)) call random_init(.true., .true.) call random_number(x(1, 3)) print *, x if (abs(x(1, 1) - 0.0) > 1e-5) error stop if (abs(x(1, 2) - 0.0) < 1e-8) error stop ! The two values must be the same, due to `random_init()` above if (x(1, 2) /= x(1, 3)) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_27.f900000664000175000017500000000024315141516316024414 0ustar alastairalastairprogram intrinsics_27 integer, dimension(-1:1, -1:2) :: a print *, shape(a) ! (/ 3, 4 /) print *, size(shape(42)) ! (/ /) end program lfortran-lfortran-2f73434/integration_tests/openmp_28.f900000664000175000017500000000236415141516316023534 0ustar alastairalastairsubroutine csr_matvec(Ap, Aj, Ax, x, y) ! Compute y = A*x for CSR matrix A and dense vectors x, y integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) integer :: i, j ! Initialize y to zero y = 0.0 !$omp parallel shared(Ap, Aj, Ax, x, y) private(i, j) !$omp do do i = 1, size(Ap)-1 do j = Ap(i), Ap(i+1)-1 y(i) = y(i) + Ax(j)*x(Aj(j)) end do end do !$omp end do !$omp end parallel print *, sum(y(1:10)) if (abs(sum(y(1:10)) - 950.00) > 1e-8) error stop end subroutine program openmp_28 use omp_lib implicit none interface subroutine csr_matvec(Ap, Aj, Ax, x, y) integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) end subroutine end interface integer, parameter :: n = 100 integer :: i real :: x(n), y(n) integer, allocatable :: Ap(:), Aj(:) real, allocatable :: Ax(:) ! Initialize CSR matrix A allocate(Ap(n+1), Aj(3*n), Ax(3*n)) Ap = [(3*(i-1)+1, i=1,n+1)] Aj = [(mod(i-1, n)+1, i=1,3*n)] Ax = [(1.0, 2.0, 3.0, i=1,n)] ! Initialize vector x x = [(i, i=1,n)] ! Initialize y to zero y = 0.0 ! Compute y = A*x call csr_matvec(Ap, Aj, Ax, x, y) ! Print the result print *, sum(y) if (abs(sum(y) - 30300.00) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_09a.f900000664000175000017500000000025415141516316026574 0ustar alastairalastairmodule mpi_c_bindings_separate_compilation_09a integer(kind=4), bind(C, name="c_MPI_COMM_WORLD") :: c_mpi_comm_world end module mpi_c_bindings_separate_compilation_09a lfortran-lfortran-2f73434/integration_tests/intrinsics_150.f900000664000175000017500000000472715141516316024504 0ustar alastairalastairprogram intrinsic_150 integer :: a,b integer(8) :: c, d integer(8) :: result integer :: i integer(4) :: arg_x(5) = [12, 11, 18, 20, 30] integer(8) :: arg_x2(5) = [33, 48, 58, 55, 54] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = maskr([12, 11, 18, 20, 30]) integer(8), parameter :: res2(5) = maskr([33, 48, 58, 55, 54],8) integer(4) :: expected_res(5) = [4095, 2047, 262143, 1048575, 1073741823] integer(8) :: expected_res2(5) = [8589934591_8, 281474976710655_8, 288230376151711743_8, & 36028797018963967_8, 18014398509481983_8] integer(4), parameter :: comp1 = maskr(12) integer(8), parameter :: comp2 = maskr(43, 8) print *, comp1 if (comp1 /= 4095) error stop print *, comp2 if (comp2 /= 8796093022207_8) error stop res_x = maskr(arg_x) res_x2 = maskr(arg_x2, 8) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) ! if (res_x2(i) /= expected_res2(i)) error stop end do a = 10 b = 31 c = 63 d = 54 result = maskr(10) print *, result if (result /= 1023) error stop result = maskr(31) print *, result if (result /= 2147483647) error stop result = maskr(63, 8) print *, result if (result /= 9223372036854775807_8) error stop result = maskr(54, 8) print *, result if (result /= 18014398509481983_8) error stop result = maskr(a) print *, result if (result /= 1023) error stop result = maskr(b) print *, result if (result /= 2147483647) error stop result = maskr(c, 8) print *, result if (result /= 9223372036854775807_8) error stop result = maskr(d, 8) print *, result if (result /= 18014398509481983_8) error stop result = maskr(10,8) print *, kind(result) if (kind(result) /= 8) error stop print *, kind(maskr(10,8)) if (kind(maskr(10,8)) /= 8) error stop print *, kind(maskr(10)) if (kind(maskr(10)) /= 4) error stop print *, kind(maskr(a,4)) if (kind(maskr(a,4)) /= 4) error stop print *, kind(maskr(a,8)) if (kind(maskr(a,8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/types_02.f900000664000175000017500000000012415141516316023362 0ustar alastairalastairprogram types_02 implicit none real :: r integer :: i i = 1 r = 1 r = i end program lfortran-lfortran-2f73434/integration_tests/openmp_73.f900000664000175000017500000000110715141516316023526 0ustar alastairalastair! TEAMSDISTRIBUTE combined construct test program openmp_73 use omp_lib implicit none integer :: array(1000), i, j, sum=0 array(1)=3 !$omp teams distribute num_teams(2) thread_limit(5) do i = 1, 1000, 100 print*,omp_get_num_threads(), omp_get_max_threads() !$omp parallel do do j = i, min(i+99, 1000) array(j) = j * 3 end do !$omp end parallel do end do !$omp end teams distribute ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print*, sum if(sum/=1501500) error stop end program openmp_73lfortran-lfortran-2f73434/integration_tests/types_13.f900000664000175000017500000000320215141516316023364 0ustar alastairalastairprogram types_13 use iso_c_binding, only: c_int, c_double, c_char implicit none interface subroutine g(d) character*(*) :: d end subroutine subroutine g2(d) character(len=*) :: d end subroutine subroutine g3(d) import :: c_char character(len=*, kind=c_char) :: d end subroutine subroutine g4(d) import :: c_char character(*, kind=c_char) :: d end subroutine subroutine g5(d) import :: c_char character(kind=c_char, len=*) :: d end subroutine subroutine g6(d) character*5 :: d end subroutine integer(c_int) function f1(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function integer(c_int) function f2(a, b, c, d) bind(c) result(r) import :: c_int, c_double integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function function f3(a, b, c, d) result(r) bind(c) import :: c_int, c_double integer(c_int) :: r integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function function f4(a, b, c, d) bind(c) result(r) import c_int, c_double integer(c_int) :: r integer*4, value, intent(in) :: a real*8, value, intent(in) :: b logical*4 :: c end function subroutine f5(a, b, c) bind(C, name="_cf5") import :: c_int import :: c_double integer(c_int) :: r integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b logical :: c end subroutine end interface end program lfortran-lfortran-2f73434/integration_tests/assign_to3.f900000664000175000017500000000010315141516316023763 0ustar alastairalastairprogram main integer :: k 15 assign 15 to k print *, k end program lfortran-lfortran-2f73434/integration_tests/kwargs_02.f900000664000175000017500000000151315141516316023517 0ustar alastairalastairmodule kwargs_02_stdlib_logger type :: logger_type contains private procedure, public, pass(self) :: add_log_file procedure, public, pass(self) :: log_io_error end type logger_type contains subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), intent(in) :: filename integer, intent(out), optional :: unit call self % log_io_error(1, filename=filename, unit=unit) end subroutine add_log_file subroutine log_io_error(self, code, filename, unit) class(logger_type), intent(inout) :: self integer, intent(in) :: code character(*), intent(in), optional :: filename integer, intent(out), optional :: unit end subroutine log_io_error end module kwargs_02_stdlib_logger program kwargs_02 end program lfortran-lfortran-2f73434/integration_tests/string_81.f900000664000175000017500000000055615141516316023544 0ustar alastairalastairmodule string_81_mod implicit none contains subroutine ff() character(10000) :: ss character(10000) :: ss2 ss(1:1) = "a" ! just to use the variable ss2(1:1) = "a" ! just to use the variable end subroutine end module program string_81 use string_81_mod integer :: i do i =0 , 2 call ff() end do end programlfortran-lfortran-2f73434/integration_tests/common_09.f900000664000175000017500000000035415141516316023522 0ustar alastairalastairsubroutine sub1() integer illin, ntrep common illin, ntrep if (illin /= 1) error stop if (ntrep /= 2) error stop print *, illin, ntrep end program common_09 integer illin , ntrep common illin, ntrep illin = 1 ntrep = 2 call sub1() end lfortran-lfortran-2f73434/integration_tests/file_16.f900000664000175000017500000000043315141516316023145 0ustar alastairalastairprogram file_16 implicit none integer :: j = 11 character(len=10) :: str, x str = "LFortran" open(j, file="file_16_test.txt") write(j, *) str str = "" rewind(j) read(j, *) str if (str /= "LFortran") error stop close(j) end program file_16 lfortran-lfortran-2f73434/integration_tests/derived_types_73.f900000664000175000017500000000252415141516316025102 0ustar alastairalastairmodule derived_types_73_mod implicit none type :: parent_t integer :: a = -1 integer :: b = -1 contains procedure, pass :: show => show_parent end type parent_t type, extends(parent_t) :: child_t integer :: y = -2 contains procedure, pass :: show => show_child end type child_t contains subroutine show_parent(self) class(parent_t), intent(inout) :: self self%a = 15 self%b = 30 end subroutine show_parent subroutine show_child(self) class(child_t), intent(inout) :: self self%a = 45 self%b = 60 self%y = 5 end subroutine show_child end module derived_types_73_mod program derived_types_73 use derived_types_73_mod implicit none type(parent_t) :: p type(child_t) :: c p%a = 10 p%b = 20 c%a = 1 c%b = 2 c%y = 2 c%parent_t = p if (c%a /= 10 .or. c%b /= 20) error stop call assign_struct_members(c%parent_t) if (c%a /= 100 .or. c%b /= 200) error stop c%parent_t = parent_t(150, 250) if (c%a /= 150 .or. c%b /= 250) error stop call c%show() if (c%a /= 45 .or. c%b /= 60 .or. c%y /= 5) error stop call c%parent_t%show() if (c%a /= 15 .or. c%b /= 30) error stop contains subroutine assign_struct_members(p) type(parent_t), intent(inout) :: p p%a = 100 p%b = 200 end subroutine assign_struct_members end program derived_types_73 lfortran-lfortran-2f73434/integration_tests/arrays_57.f900000664000175000017500000000107615141516316023540 0ustar alastairalastairprogram arrays_57 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop call trans_2(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop contains subroutine trans(A) real, intent(inout) :: A(2, 2) A = matprod(transpose(A)) end subroutine subroutine trans_2(A) real, intent(inout) :: A(2, 2) integer, parameter :: x = 2 A = matprod(abs(A(1:x,:))) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_261.f900000664000175000017500000000233615141516316024501 0ustar alastairalastairprogram intrinsics_261 real, parameter :: a(4) = [11.012, -21.125, 31.210, -41.0] real, parameter :: b(4) = [33.9, 91.2, 37.4, 19.1] integer, parameter :: c(8) = Ceiling([1.2, 3.3, 5.0, 6.8, -5.7, & -8.9, 0.0, -412.124]) integer, parameter :: array_size = 6 integer :: i integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) integer(kind=4) :: res_4_arr_2(8) integer :: expected(8) = [2, 4, 5, 7, -5, -8, 0, -412] print *, Ceiling(a) if (any(Ceiling(a) /= [12, -21, 32, -41])) error stop print *, Ceiling(b) if (any(Ceiling(b) /= [34, 92, 38, 20])) error stop do i = 1, size(c) print *, c(i) if (c(i) /= expected(i)) error stop end do res_4_arr = Ceiling([real:: 1.2, 3.3, 5, 6.8, -5.7, -8.9]) print *, res_4_arr if (any(res_4_arr /= [2, 4, 5, 7, -5, -8])) error stop res_8_arr = Ceiling([real(8) :: 1.2, 3.3, 5, 101.768, -121.321, 65.4], kind=8) print *, res_8_arr if (any(res_8_arr /= [2, 4, 5, 102, -121, 66])) error stop res_4_arr_2 = Ceiling([1.2, 3.3, 5.0, 6.8, -5.7, -8.9, 0.0, -412.124], kind=4) print *, res_4_arr_2 if (any(res_4_arr_2 /= [2, 4, 5, 7, -5, -8, 0, -412])) error stop end program lfortran-lfortran-2f73434/integration_tests/read_02_data.txt0000664000175000017500000000001715141516316024344 0ustar alastairalastairaa bb cc dd ee lfortran-lfortran-2f73434/integration_tests/select_type_10.f900000664000175000017500000000137415141516316024545 0ustar alastairalastairmodule select_type_10_mod implicit none type, abstract :: base end type base type, extends(base) :: int_val integer :: key end type int_val contains subroutine check(self) class(int_val), intent(inout) :: self self%key = 10 end subroutine check subroutine check2(self) type(int_val), intent(inout) :: self self%key = 20 end subroutine check2 end module select_type_10_mod program select_type_10 use select_type_10_mod implicit none class(base), pointer :: val allocate(int_val :: val) select type(val) type is(int_val) call check(val) if (val%key /= 10) error stop call check2(val) if (val%key /= 20) error stop class default error stop end select end program select_type_10lfortran-lfortran-2f73434/integration_tests/matmul_03.f900000664000175000017500000000051515141516316023522 0ustar alastairalastairprogram matmul_03 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) real :: expected allocate(A(3, 4), B(4, 2), C(3, 2)) A = 1.0 B = 1.0 C = matmul(A, B) expected = 4.0 if (abs(C(1,1) - expected) > 1e-6) error stop if (abs(C(3,2) - expected) > 1e-6) error stop print *, "OK: matmul with pre-allocated result" end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_09b.f900000664000175000017500000000064015141516316026574 0ustar alastairalastairmodule mpi_separate_compilation_09b implicit none integer, parameter :: MPI_COMM_WORLD = -1000 contains integer(kind=4) function handle_mpi_comm_f2c(comm_f) result(c_comm) use mpi_c_bindings_separate_compilation_09a, only: c_mpi_comm_world integer, intent(in) :: comm_f c_comm = c_mpi_comm_world end function handle_mpi_comm_f2c end module mpi_separate_compilation_09b lfortran-lfortran-2f73434/integration_tests/implicit_interface_06.f900000664000175000017500000000047115141516316026061 0ustar alastairalastairmodule implicit_interface_06_module contains function f(a, b) integer :: a real :: b f = 1 end function f end program main use implicit_interface_06_module integer :: a real :: i, b i = f(a, b) if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/specfun_01.f900000664000175000017500000000211015141516316023655 0ustar alastairalastairsubroutine rcty_(n,x) implicit double precision (a-h,o-z) dimension ry(0:n),dy(0:n) nm=n if (x.lt.1.0d-60) then do 10 k=0,n ry(k)=-1.0d+300 10 dy(k)=1.0d+300 ry(0)=-1.0d0 dy(0)=0.0d0 return endif ry(0)=-dcos(x) ry(1)=ry(0)/x-dsin(x) rf0=ry(0) rf1=ry(1) do 15 k=2,n rf2=(2.0d0*k-1.0d0)*rf1/x-rf0 if (dabs(rf2).gt.1.0d+300) go to 20 ry(k)=rf2 rf0=rf1 15 rf1=rf2 20 nm=k-1 dy(0)=dsin(x) do 25 k=1,nm 25 dy(k)=-k*ry(k)/x+ry(k-1) if (abs(ry(0) - (-0.98006657784124163)) > 1e-7) error stop if (abs(ry(1) - (-5.0990022200012692)) > 1e-6) error stop if (abs(ry(2) - (-75.504966722177798)) > 1e-6) error stop if (abs(dy(0) - (0.19866933079506122)) > 1e-8) error stop if (abs(dy(1) - (24.514944522165102)) > 1e-6) error stop if (abs(dy(2) - (749.95066500177666)) > 1e-4) error stop if (nm /= 2) error stop print *, "ry = ", ry print *, "dy = ", dy print *, "nm = ", nm return end program specfun_01 implicit double precision (a-h,o-z) call rcty_(2, 0.2d0) end program lfortran-lfortran-2f73434/integration_tests/minmax_01.f900000664000175000017500000000035715141516316023516 0ustar alastairalastairprogram minmax_01 integer :: x, y, z x = 4 y = 5 ! Runtime z = min0(x, y) if (z /= 4) error stop z = max0(x, y) if (z /= 5) error stop ! Compile time z = min0(4, 5) if (z /= 4) error stop z = max0(4, 5) if (z /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/lapack_02.f900000664000175000017500000000066015141516316023456 0ustar alastairalastairC Segfault in pass_array_by_data: dimension pointer corruption C MRE from LAPACK sgbtrf.f compilation failure SUBROUTINE TEST REAL A( 2, 2 ) REAL W( 2, 2 ) EXTERNAL SUB CALL SUB( W, A( 1, 1 ) ) CALL SUB( A( 1, 1 ), W ) END SUBROUTINE SUB( X, Y ) REAL X( 2, 2 ), Y( 2, 2 ) X(1,1) = Y(1,1) END PROGRAM LAPACK_02 CALL TEST PRINT *, 'PASS' END lfortran-lfortran-2f73434/integration_tests/interface_11.f900000664000175000017500000000573615141516316024174 0ustar alastairalastairmodule interface_11_m use, intrinsic :: iso_fortran_env, only : real64 implicit none public :: get_args interface get_args; module procedure get_scalar_i; end interface interface get_args; module procedure get_scalar_real; end interface interface get_args; module procedure get_scalar_d; end interface interface get_args; module procedure get_scalar_complex; end interface interface get_args; module procedure get_scalar_logical; end interface interface get_args; module procedure many_args; end interface contains !============================================================================ subroutine many_args(n, g) implicit none character(len=*), intent(in) :: n class(*), intent(out) :: g call get_generic(n, g) contains subroutine get_generic(name, generic) character(len=*), intent(in) :: name class(*), intent(out) :: generic select type(generic) type is (integer); call get_args(name, generic) type is (real); call get_args(name, generic) type is (real(kind=real64)); call get_args(name, generic) type is (logical); call get_args(name, generic) type is (complex); call get_args(name, generic) class default stop 'unknown type in *get_generic*' end select end subroutine get_generic end subroutine many_args !============================================================================ subroutine get_scalar_i(keyword, i) character(len=*), intent(in) :: keyword integer, intent(out) :: i end subroutine get_scalar_i !============================================================================ subroutine get_scalar_real(keyword, r) character(len=*), intent(in) :: keyword real, intent(out) :: r end subroutine get_scalar_real !============================================================================ subroutine get_scalar_d(keyword, d) character(len=*), intent(in) :: keyword real(kind=real64) :: d end subroutine get_scalar_d !============================================================================ subroutine get_scalar_complex(keyword, x) character(len=*), intent(in) :: keyword complex, intent(out) :: x end subroutine get_scalar_complex !============================================================================ subroutine get_scalar_logical(keyword, l) character(len=*), intent(in) :: keyword logical :: l end subroutine get_scalar_logical !============================================================================ end module interface_11_m program interface_11 use interface_11_m implicit none end program interface_11 lfortran-lfortran-2f73434/integration_tests/procedure_17.f900000664000175000017500000000122215141516316024214 0ustar alastairalastairmodule proc_type_procedure_17 contains subroutine cb() implicit none end subroutine end module module cobylb_mod_procedure_17 contains subroutine cobylb(call_back) use proc_type_procedure_17 procedure(cb) :: call_back integer, save :: x = 3 call calcfc_internal() contains subroutine calcfc_internal() implicit none integer :: y(x) print *, 'x = ', x if ( x /= 3 ) error stop end subroutine calcfc_internal end subroutine cobylb end module program procedure_17 use cobylb_mod_procedure_17 use proc_type_procedure_17 call cobylb(cb) end program lfortran-lfortran-2f73434/integration_tests/arrays_35.f900000664000175000017500000000025515141516316023532 0ustar alastairalastairprogram arrays_35 real :: x(2) x = [real :: 9, 2.1] print *, x if (abs(x(1) - 9.0) > 1e-7) error stop if (abs(x(2) - 2.1) > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_18b.f900000664000175000017500000000031515141516316026573 0ustar alastairalastairsubmodule (mod_separate_compilation_18) submod_separate_compilation_18 contains module function f(a) result(r) integer, intent(in) :: a integer :: r r = a + 1 end function end submodulelfortran-lfortran-2f73434/integration_tests/arrays_65.f900000664000175000017500000000026215141516316023533 0ustar alastairalastairprogram arrays_65 integer :: A(2) = [1,2] integer :: n = 2 integer :: dim = 1 A = sum(spread(A, dim, n), dim=dim) if (A(1) /= 2) error stop if (A(2) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/select_type_22.f900000664000175000017500000000075115141516316024546 0ustar alastairalastairmodule m implicit none type :: t contains procedure :: init end type contains subroutine init(self) class(t), intent(inout) :: self print *, "init" end subroutine end module program p use m implicit none class(t), allocatable :: x logical :: called called = .false. allocate(t :: x) select type(y => x) class default call y%init() called = .true. end select if (.not. called) error stop end program lfortran-lfortran-2f73434/integration_tests/format_23.f900000664000175000017500000000154315141516316023517 0ustar alastairalastairprogram format_23 implicit none real(4) :: x1, y1, z1 real(8) :: x8, y8, z8 x1 = 3.14 y1 = -2.5 z1 = 0.0 x8 = 3.14_8 y8 = -2.5_8 z8 = 0.0_8 print *, "Binary format for real(4):" print '(a, b0)', "x1 (3.14): ", x1 print '(a, b10)', "x1 (3.14): ", x1 print '(a, b32)', "x1 (3.14): ", x1 print '(a, b0)', "y1 (-2.5): ", y1 print '(a, b10)', "y1 (-2.5): ", y1 print '(a, b32)', "y1 (-2.5): ", y1 print '(a, b0)', "z1 (0.0): ", z1 print '(a, b32)', "z1 (0.0): ", z1 print *, "Binary format for real(8):" print '(a, b0)', "x8 (3.14): ", x8 print '(a, b10)', "x8 (3.14): ", x8 print '(a, b64)', "x8 (3.14): ", x8 print '(a, b0)', "y8 (-2.5): ", y8 print '(a, b10)', "y8 (-2.5): ", y8 print '(a, b64)', "y8 (-2.5): ", y8 print '(a, b0)', "z8 (0.0): ", z8 print '(a, b64)', "z8 (0.0): ", z8 end program format_23 lfortran-lfortran-2f73434/integration_tests/arrays_61.f900000664000175000017500000000054515141516316023533 0ustar alastairalastairprogram arrays_61 real(4) :: xpt(2, 2) xpt = 25.0 call rescue(xpt) print *, sum(xpt) if (abs(sum(xpt) - 120.710678) > 1e-8) error stop contains subroutine rescue(xpt) real(4), intent(inout) :: xpt(:, :) print *, sqrt(sum(xpt**2, dim=1)) xpt(1, :) = sqrt(sum(xpt**2, dim=1)) end subroutine end program lfortran-lfortran-2f73434/integration_tests/do_concurrent_10.f900000664000175000017500000000151515141516316025066 0ustar alastairalastair! equivalent to openmp_16.f90 subroutine initialize_array(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) integer :: i do concurrent (i=1:n) shared(b, n) b(i, :) = 12.9d0 end do end subroutine subroutine parallel_sum(n, m, b) implicit none integer, intent(in) :: n, m double precision, intent(out) :: b(n, m) double precision :: res integer :: i res = 0.0d0 do concurrent (i=1:n) reduce(+:res) shared(b, n) res = res + sum(b(i, :)) end do print *, 'Sum = ', res if (abs(res - 7455168.0000000438d0) > 1e-12) error stop end subroutine program do_concurrent_10 use omp_lib integer, parameter :: n = 1920, m = 301 double precision, dimension(n, m) :: a print *, a(2, 3) call omp_set_num_threads(8) call initialize_array(n, m, a) print *, a(2, 3) call parallel_sum(n, m, a) end program lfortran-lfortran-2f73434/integration_tests/bin_op_real_02.f900000664000175000017500000000117715141516316024500 0ustar alastairalastairprogram readnan2 real:: xnan character:: cni*4 = 'NAN ' read(cni,*) xnan print *, 'NaN > NaN?', xnan > xnan if ((xnan > xnan) .neqv. .false.) error stop print *, 'NaN >= NaN?', xnan >= xnan if ((xnan >= xnan) .neqv. .false.) error stop print *, 'NaN < NaN?', xnan < xnan if ((xnan < xnan) .neqv. .false.) error stop print *, 'NaN <= NaN?', xnan <= xnan if ((xnan <= xnan) .neqv. .false.) error stop print *, 'NaN == NaN?', xnan == xnan if ((xnan == xnan) .neqv. .false.) error stop print *, 'NaN /= NaN?', xnan /= xnan if ((xnan /= xnan) .neqv. .true.) error stop end program readnan2 lfortran-lfortran-2f73434/integration_tests/derived_types_13.f900000664000175000017500000000126215141516316025072 0ustar alastairalastairmodule derived_types_13_module_01 implicit none type t integer :: i integer, allocatable :: xl(:) end type t contains function new_value() result(p) type(t) :: p p%i = 123 end function new_value subroutine alloc(x) integer, allocatable, intent(out) :: x(:) allocate(x(5)) end subroutine alloc end module derived_types_13_module_01 program derived_types_13 use derived_types_13_module_01 implicit none type(t) :: x x = new_value() print *, x % i if (x%i /= 123) error stop call alloc(x % xl) print *, size(x % xl) if (size(x%xl) /= 5) error stop end program derived_types_13 lfortran-lfortran-2f73434/integration_tests/intrinsics_292.f900000664000175000017500000000026415141516316024503 0ustar alastairalastairprogram intrinsics_292 implicit none integer :: narg narg = command_argument_count() print *, "narg: ", narg if ( narg /= 0 ) error stop end program intrinsics_292 lfortran-lfortran-2f73434/integration_tests/statement_02.f900000664000175000017500000000015415141516316024225 0ustar alastairalastairsubroutine gscale() real fpoint fpoint(i) = i end program statement_02 call gscale() end program lfortran-lfortran-2f73434/integration_tests/arrays_intrin_01.f900000664000175000017500000000073215141516316025106 0ustar alastairalastairprogram arrays_intrin_01 implicit none integer, dimension(11) :: nums_int = [5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5] real, dimension(5) :: nums_real = [1.5, -3.2, 4.5, 0.9, 7.2] if (minval(nums_int) /= -5) error stop if (maxval(nums_int) /= 5) error stop if (minval(nums_real) /= -3.2) error stop if (maxval(nums_real) /= 7.2) error stop print *, minval(nums_int), maxval(nums_int) print *, minval(nums_real), maxval(nums_real) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_345.f900000664000175000017500000000436515141516316024510 0ustar alastairalastairprogram intrinsics_345 implicit none integer, dimension(2, 3) :: array1 = reshape([1, 1, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array2 = reshape([2, 1, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array3 = reshape([2, 2, 0, 1, 5, 1], [2, 3]) integer, dimension(2, 3) :: array4 = reshape([1, 1, 1, 1, 1, 1], [2, 3]) integer, dimension(2, 3) :: array5 = reshape([2, 2, 1, 0, 1, 0], [2, 3]) integer, dimension(2, 3) :: array6 = reshape([0, 1, 1, 1, 1, 2], [2, 3]) integer :: value = 1 if (any(findloc(array1, value, dim=1) /= [1, 2, 2])) error stop if (any(findloc(array1, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array1, value, dim=2) /= [1, 1])) error stop if (any(findloc(array1, value, dim=2, back=.true.) /= [1, 3])) error stop if (any(findloc(array2, value, dim=1) /= [2, 2, 2])) error stop if (any(findloc(array2, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array2, value, dim=2) /= [0, 1])) error stop if (any(findloc(array2, value, dim=2, back=.true.) /= [0, 3])) error stop if (any(findloc(array3, value, dim=1) /= [0, 2, 2])) error stop if (any(findloc(array3, value, dim=1, back=.true.) /= [0, 2, 2])) error stop if (any(findloc(array3, value, dim=2) /= [0, 2])) error stop if (any(findloc(array3, value, dim=2, back=.true.) /= [0, 3])) error stop if (any(findloc(array4, value, dim=1) /= [1, 1, 1])) error stop if (any(findloc(array4, value, dim=1, back=.true.) /= [2, 2, 2])) error stop if (any(findloc(array4, value, dim=2) /= [1, 1])) error stop if (any(findloc(array4, value, dim=2, back=.true.) /= [3, 3])) error stop if (any(findloc(array5, value, dim=1) /= [0, 1, 1])) error stop if (any(findloc(array5, value, dim=1, back=.true.) /= [0, 1, 1])) error stop if (any(findloc(array5, value, dim=2) /= [2, 0])) error stop if (any(findloc(array5, value, dim=2, back=.true.) /= [3, 0])) error stop if (any(findloc(array6, value, dim=1) /= [2, 1, 1])) error stop if (any(findloc(array6, value, dim=1, back=.true.) /= [2, 2, 1])) error stop if (any(findloc(array6, value, dim=2) /= [2, 1])) error stop if (any(findloc(array6, value, dim=2, back=.true.) /= [3, 2])) error stop end program lfortran-lfortran-2f73434/integration_tests/where_16.f900000664000175000017500000000136015141516316023340 0ustar alastairalastairmodule update contains subroutine updateres(b, delta, rescon) implicit none real, intent(in) :: b(:) real, intent(in) :: delta real, intent(inout) :: rescon(:) real :: ax(size(b)) integer :: idx(size(b)) ! Comment out to avoid abort logical :: mask(size(b)) ax = 1.0 mask = (abs(rescon) < delta) where (mask) rescon = max(b - ax, 0.0) end where end subroutine updateres end module update program where_16 use update implicit none real :: delta = 2.33 real :: b(2) = [5.4, 3.6] real :: rescon(2) = [2.3, 8.6] call updateres(b, delta, rescon) print *, rescon if( any(abs(rescon - [4.4, 8.6]) > 1e-6) ) error stop end program where_16 lfortran-lfortran-2f73434/integration_tests/openmp_11.f900000664000175000017500000000113615141516316023520 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n complex, intent(inout) :: ctr complex :: local_ctr integer :: i local_ctr = (0,0) !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + i end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000 complex :: ctr complex :: res = (0,0) res = ((n * (n+1))/2) ! Sum from 1 -> 1000 call omp_set_num_threads(8) ctr = (0,0) call increment_ctr(n, ctr) print *, ctr if(ctr /= res) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_09.f900000664000175000017500000000014415141516316024414 0ustar alastairalastairprogram intrinsics_09 real :: z=0.0 if (z < tiny(1.0)) then print*, z end if end program lfortran-lfortran-2f73434/integration_tests/test_ieee_next_up.f900000664000175000017500000000377715141516316025446 0ustar alastairalastair! Test ieee_next_up function (Fortran 2018 standard) program ieee_next_up_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_up, ieee_is_finite implicit none real(4) :: x_sp, next_sp real(8) :: x_dp, next_dp print *, "Testing ieee_next_up..." ! Test 1: Next up from positive value x_sp = 1.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(1.0) =", next_sp if (next_sp <= x_sp) error stop "next_up should be greater than x" ! Test 2: Next up from negative value x_sp = -1.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(-1.0) =", next_sp if (next_sp <= x_sp) error stop "next_up should be greater than x" if (next_sp >= 0.0) error stop "next_up(-1.0) should still be negative" ! Test 3: Next up from zero x_sp = 0.0 next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(0.0) =", next_sp if (next_sp <= 0.0) error stop "next_up(0.0) should be positive" ! Test 4: Relationship with spacing for positive numbers x_sp = 1.0 next_sp = ieee_next_up(x_sp) print *, "Difference: next_up(1.0) - 1.0 =", next_sp - x_sp print *, "spacing(1.0) =", spacing(x_sp) if (abs((next_sp - x_sp) - spacing(x_sp)) > 1e-10) then error stop "next_up - x should equal spacing(x) for positive x" end if ! Test 5: Double precision x_dp = 1.0d0 next_dp = ieee_next_up(x_dp) print *, "ieee_next_up(1.0d0) =", next_dp if (next_dp <= x_dp) error stop "Should be greater" ! Test 6: Large positive value should still give larger value x_sp = huge(x_sp) / 2.0 next_sp = ieee_next_up(x_sp) if (next_sp <= x_sp) error stop "Should be greater even for large x" ! Test 7: From huge(x) should give infinity x_sp = huge(x_sp) next_sp = ieee_next_up(x_sp) print *, "ieee_next_up(huge) =", next_sp if (ieee_is_finite(next_sp)) error stop "next_up(huge) should be infinity" print *, "All ieee_next_up tests passed!" end program ieee_next_up_01 lfortran-lfortran-2f73434/integration_tests/file_45.f900000664000175000017500000002155315141516316023155 0ustar alastairalastairprogram inquiries implicit none ! Test Fortran-77-ish subset of INQUIRE capabilities integer :: unit, unit_no logical :: exists, opened, named character(32) :: name, access, seq, direct, blank character(32) :: form, formatted, unformatted integer :: recl, nextrec integer :: i character(*), parameter :: testfn = 'inqtest.dat' character(*), parameter :: uninitc = '(uninit)' print *, unit ! Sequential formatted by filename print *, 'sequential formatted by filename' open (newunit=unit, file=testfn, form='formatted', status='unknown') write (unit, '(i4)') 42 rewind (unit) call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'FORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'YES') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'NO') print *, 'blank = ', trim (blank), ' :', pf (blank == 'NULL') close (unit, status='keep') ! Sequential formatted by unitno print *; print *, 'sequential formatted by unitno' open (newunit=unit, file=testfn, form='formatted', status='old', blank='zero') write (unit, '(i4)') 42 rewind (unit) call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'FORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'YES') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'NO') print *, 'blank = ', trim (blank), ' :', pf (blank == 'ZERO') close (unit, status='delete') ! Sequential unformatted by filename print *; print *, 'sequential formatted by filename' open (newunit=unit, file=testfn, form='unformatted', status='new') write (unit) 42 rewind (unit) call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'blank = ', trim (blank), ' :', pf (blank == 'UNDEFINED') close (unit, status='keep') ! Sequential unformatted by unitno print *; print *, 'sequential formatted by unitno' open (newunit=unit, file=testfn, form='unformatted', status='old') write (unit) 42 rewind (unit) call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, blank=blank) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'SEQUENTIAL') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'YES') print *, 'direct = ', trim (direct), ' :', pf (direct == 'NO') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'blank = ', trim (blank), ' :', pf (blank == 'UNDEFINED') close (unit, status='delete') ! Record length inquiry inquire (iolength=recl) 42, 42.0, 'xyzzy' print *; print *, 'record length =', recl ! Direct unformatted by filename print *; print *, 'direct formatted by filename' open (newunit=unit, file=testfn, access='direct', recl=recl, form='unformatted', status='new') do, i=1, 5 write (unit, rec=i) 42+i, 42.0+i, 'xyzzy' end do call init_test () inquire (file=testfn, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, & recl=recl, nextrec=nextrec) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'DIRECT') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'NO') print *, 'direct = ', trim (direct), ' :', pf (direct == 'YES') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'recl = ', recl, ' :', pf (recl == 13) ! print *, 'nextrec = ', nextrec, ' :', pf (nextrec == 6) close (unit, status='keep') ! Direct unformatted by unitno print *; print *, 'direct formatted by unitno' open (newunit=unit, file=testfn, access='direct', recl=recl, form='unformatted', status='old') do, i=1, 5 write (unit, rec=i) 42+i, 42.0+i, 'xyzzy' end do call init_test () inquire (unit=unit, exist=exists, opened=opened, number=unit_no, & named=named, name=name, access=access, sequential=seq, direct=direct, & form=form, formatted=formatted, unformatted=unformatted, & recl=recl, nextrec=nextrec) print *, 'exist = ', exists, ' :', pf (exists) print *, 'opened = ', opened, ' :', pf (opened) print *, 'number = ', unit_no, ' :', pf (unit == unit_no) print *, 'named = ', named, ' :', pf (named) print *, 'name = ', trim (name), ' :', pf (name == testfn) print *, 'access = ', trim (access), ' :', pf (access == 'DIRECT') print *, 'sequential = ', trim (seq), ' :', pf (seq == 'NO') print *, 'direct = ', trim (direct), ' :', pf (direct == 'YES') print *, 'form = ', trim (form), ' :', pf (form == 'UNFORMATTED') print *, 'formatted = ', trim (formatted), ' :', pf (formatted == 'NO') print *, 'unformatted =', trim (unformatted), ' :', pf (unformatted == 'YES') print *, 'recl = ', recl, ' :', pf (recl == 13) ! print *, 'nextrec = ', nextrec, ' :', pf (nextrec == 6) close (unit, status='delete') contains subroutine init_test () exists = .false.; opened = .false.; unit_no = -99999 named = .false.; name = uninitc access = uninitc; seq = uninitc; direct = uninitc form = uninitc; formatted = uninitc; unformatted = uninitc blank = uninitc recl = -99999; nextrec = -99999 end subroutine function pf (l) logical, intent(in) :: l character(4) :: pf pf = merge ('pass', 'FAIL', l) if (.not. l) error stop end function end program lfortran-lfortran-2f73434/integration_tests/nested_call_filter_01.f900000664000175000017500000000105215141516316026040 0ustar alastairalastairmodule nested_call_filter_mod contains subroutine modproc(y) integer, intent(inout) :: y y = y + 1 end subroutine modproc end module nested_call_filter_mod program nested_call_filter_01 use nested_call_filter_mod, only: modproc implicit none call outer() contains subroutine outer() integer :: a a = 1 call inner() call modproc(a) contains subroutine inner() a = a + 1 end subroutine inner end subroutine outer end program nested_call_filter_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_361.f900000664000175000017500000000604215141516316024500 0ustar alastairalastairprogram intrinsics_1arg implicit none real :: x1 complex :: z1 integer :: i1 character(len=10) :: str real, parameter :: eps = 1e-8 x1 = abs(a = -4.0) print *, x1 if (abs(x1 - 4.0) > eps) error stop x1 = acos(x = 0.5) print *, x1 if (abs(x1 - 1.04719755) > eps) error stop x1 = acosd(x = 0.5) print *, x1 if (abs(x1 - 60.0) > eps) error stop x1 = acosh(x = 1.5) print *, x1 if (abs(x1 - 0.962423623) > eps) error stop str = adjustl(string = "text") print *, str str = adjustr(string = "text") print *, str x1 = aimag(z = (1.0, 2.0)) print *, x1 if (abs(x1 - 2.0) > eps) error stop x1 = asin(x = -1.0) print *, x1 if (abs(x1 - (-1.57079637e+00)) > eps) error stop x1 = asind(x = 0.5) print *, x1 if (abs(x1 - 30.0) > eps) error stop x1 = asinh(x = 0.5) print *, x1 if (abs(x1 - 0.481211811) > eps) error stop x1 = atan(x = 1.0) print *, x1 if (abs(x1 - 0.78539816) > eps) error stop x1 = atanh(x = 0.5) print *, x1 if (abs(x1 - 0.549306154) > eps) error stop i1 = bit_size(i = 8) print *, i1 if (i1 /= 32) error stop z1 = conjg(z = (3.0, -4.0)) print *, z1 x1 = cos(x = 0.0) print *, x1 if (abs(x1 - 1.0) > eps) error stop x1 = cosd(x = 60.0) print *, x1 if (abs(x1 - 0.5) > eps) error stop x1 = cosh(x = 1.0) print *, x1 if (abs(x1 - 1.54308069) > eps) error stop x1 = erf(x = 1.0) print *, x1 x1 = erfc(x = 1.0) print *, x1 x1 = exp(x = 1.0) print *, x1 if (abs(x1 - 2.71828175) > eps) error stop x1 = gamma(x = 0.5) print *, x1 if (abs(x1 - 1.77245390) > eps) error stop x1 = log(x = 2.0) print *, x1 if (abs(x1 - 0.693147182) > eps) error stop x1 = log10(x = 10.0) print *, x1 if (abs(x1 - 1.0) > eps) error stop x1 = log_gamma(x = 2.0) print *, x1 x1 = sin(x = 1.0) print *, x1 if (abs(x1 - 0.841470957) > eps) error stop x1 = sinh(x = 1.0) print *, x1 if (abs(x1 - 1.17520118) > eps) error stop x1 = sqrt(x = 4.0) print *, x1 if (abs(x1 - 2) > eps) error stop x1 = tan(x = 1.0) print *, x1 if (abs(x1 - 1.55740774) > eps) error stop x1 = tanh(x = 1.0) print *, x1 if (abs(x1 - 0.761594176) > eps) error stop x1 = tand(x = 45.0) print *, x1 if (abs(x1 - 1) > eps) error stop x1 = not(i = 0) print *, x1 i1 = precision(x = 1.0) print *, i1 i1 = range(x = 1.0) print *, i1 x1 = tiny(x = 1.0) print *, x1 if (abs(x1 - 1.17549435e-38) > eps) error stop x1 = huge(x = 1.0) print *, x1 if (abs(x1 - 3.40282347e+38) > eps) error stop x1 = epsilon(x = 1.0) print *, x1 if (abs(x1 - 1.19209290e-07) > eps) error stop i1 = digits(x = 1.0) print *, i1 if (i1 /= 24) error stop i1 = leadz(i = 8) print *, i1 if (i1 /= 28) error stop i1 = trailz(i = 8) print *, i1 if (i1 /= 3) error stop end program intrinsics_1arg lfortran-lfortran-2f73434/integration_tests/modules_29_module1.f900000664000175000017500000000074115141516316025332 0ustar alastairalastairmodule fpm_git1 implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git1 lfortran-lfortran-2f73434/integration_tests/class_62.f900000664000175000017500000000100215141516316023325 0ustar alastairalastairmodule class_62_mod implicit none contains subroutine handle_generic(generic) class(*), intent(inout) :: generic select type(generic) type is (integer) call get_args(generic) end select end subroutine handle_generic subroutine get_args(x) integer, intent(out) :: x x = 3 end subroutine get_args end module class_62_mod program class_62 use class_62_mod implicit none integer :: value call handle_generic(value) if (value /= 3) error stop end program class_62lfortran-lfortran-2f73434/integration_tests/derived_types_100.f900000664000175000017500000000214415141516316025147 0ustar alastairalastairmodule derived_types_100_mod implicit none type :: person character(len=50) :: name integer, allocatable :: scores(:) end type person contains function update_person(original) result(updated) type(person), pointer, intent(in) :: original type(person), pointer :: updated integer :: n allocate(updated) updated%name = "MODIFIED: " // trim(original%name) n = size(original%scores) allocate(updated%scores(n+1)) updated%scores(1:n) = original%scores updated%scores(n+1) = 999 end function update_person end module derived_types_100_mod program derived_types_100 use derived_types_100_mod implicit none type(person), pointer :: x allocate(x) x%name = "John Doe" allocate(x%scores(3)) x%scores = [85, 92, 78] x => update_person(x) print *, x%name print *, x%scores if ( x%name /= "MODIFIED: John Doe") error stop "Test failed: name mismatch" if ( size(x%scores) /= 4 ) error stop "Test failed: scores size mismatch" if ( any(x%scores /= [85, 92, 78, 999]) ) error stop "Test failed: last score mismatch" end program derived_types_100 lfortran-lfortran-2f73434/integration_tests/attr_dim_01.f900000664000175000017500000000026515141516316024026 0ustar alastairalastairsubroutine sub (array) dimension array(3) double precision array end subroutine program attr_dim_01 double precision , dimension(3) :: arr call sub(arr) end programlfortran-lfortran-2f73434/integration_tests/modules_50.f900000664000175000017500000000170715141516316023701 0ustar alastairalastairmodule modules_50_fpm_integer type int_t integer :: i end type int_t end module module modules_50_fpm_targets use modules_50_fpm_integer, only: int_t implicit none contains subroutine prune_build_targets() type(int_t), allocatable :: modules_used(:) allocate(modules_used(1)) modules_used(1)%i = 0 print *, modules_used print *, modules_used(1)%i if( modules_used(1)%i /= 0 ) error stop call collect_used_modules() print *, modules_used print *, modules_used(1)%i if( modules_used(1)%i /= 2 ) error stop contains recursive subroutine collect_used_modules() modules_used(1)%i = 2 modules_used = [modules_used] ! modules_used = [modules_used, modules_used(1)] end subroutine collect_used_modules end subroutine prune_build_targets end module modules_50_fpm_targets program modules_50 use modules_50_fpm_targets implicit none call prune_build_targets() end program modules_50 lfortran-lfortran-2f73434/integration_tests/intrinsics_214.f900000664000175000017500000001077615141516316024506 0ustar alastairalastairprogram intrinsics_214 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(19) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp), parameter :: res(19) = sind([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = sind([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.32100000000000001_dp, 0.52600000000000002_dp, 0.72799999999999998_dp, & -0.32100000000000001_dp, -0.52600000000000002_dp, -0.72799999999999998_dp, -1.0000000000000000_dp, & -0.99950049950049946_dp, -0.99900099900099903_dp, -0.99850149850149850_dp, -0.99800199800199796_dp, & -0.99750249750249753_dp, -0.99700299700299699_dp, -0.99650349650349646_dp, -0.99600399600399603_dp, & -0.99550449550449549_dp, -0.99500499500499495_dp, -0.99450549450549453_dp, -0.99400599400599399_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.305639327, 0.465527594, 0.588556170, -0.305639327, & -0.465527594, -0.588556170, -0.707106769, -0.706752896, -0.706752896, & -0.706398606, -0.706398606, -0.706043661, -0.706043661, -0.705688298, & -0.705688298, -0.705332398, -0.705332398, -0.704975843, -0.704975843] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, sind(w(i)) if (abs(sind(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, sind(x(i)) if (abs(sind(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, sind(a) if (abs(sind(a) - 0.324379712) > 1e-3) error stop print *, sind(b) if (abs(sind(b) - 0.539167702) > 1e-3) error stop print *, sind(c) if (abs(sind(c) - 0.732816100) > 1e-3) error stop print *, sind(18.928_sp) if (abs(sind(18.928_sp) - 0.324379712) > 1e-3) error stop print *, sind(32.627_sp) if (abs(sind(32.627_sp) - 0.539167702) > 1e-3) error stop print *, sind(47.123_sp) if (abs(sind(47.123_sp) - 0.732816100) > 1e-3) error stop print *, sind(d) if (abs(sind(d) - 0.32274913716473685) > 1e-3) error stop print *, sind(e) if (abs(sind(e) - 0.54064067144737327) > 1e-3) error stop print *, sind(f) if (abs(sind(f) - 0.73400566544830548) > 1e-3) error stop print *, sind(18.829262783_dp) if (abs(sind(18.829262783_dp) - 0.32274913716473685) > 1e-3) error stop print *, sind(32.727262783_dp) if (abs(sind(32.727262783_dp) - 0.54064067144737327) > 1e-3) error stop print *, sind(47.223262783_dp) if (abs(sind(47.223262783_dp) - 0.73400566544830548) > 1e-3) error stop end programlfortran-lfortran-2f73434/integration_tests/allocate_21.f900000664000175000017500000000106515141516316024010 0ustar alastairalastairmodule mod_allocate_21 contains subroutine molded_allocation(arr) real(8), intent(in) :: arr(:,:) real(8), allocatable :: local_arr(:,:) allocate(local_arr, mold = arr) if (size(local_arr, 1) /= size(arr, 1) .or. & size(local_arr, 2) /= size(arr, 2)) error stop end subroutine molded_allocation end module mod_allocate_21 program allocate_21 use mod_allocate_21 implicit none real(8), allocatable :: arr(:,:) integer :: i, j allocate(arr(2,3)) call molded_allocation(arr) end program allocate_21lfortran-lfortran-2f73434/integration_tests/selected_int_kind_01.f900000664000175000017500000000310515141516316025666 0ustar alastairalastairsubroutine test_selected_int_kind(R, expected_value) integer :: R, expected_value print *, "selected_int_kind(R) = ", selected_int_kind(R) if (selected_int_kind(R) /= expected_value) error stop end subroutine subroutine test_compile_time_selected_int_kind() print *, selected_int_kind(1) if (selected_int_kind(1) /= 1) error stop print *, selected_int_kind(2) if (selected_int_kind(2) /= 1) error stop print *, selected_int_kind(3) if (selected_int_kind(3) /= 2) error stop print *, selected_int_kind(4) if (selected_int_kind(4) /= 2) error stop print *, selected_int_kind(5) if (selected_int_kind(5) /= 4) error stop print *, selected_int_kind(6) if (selected_int_kind(6) /= 4) error stop print *, selected_int_kind(7) if (selected_int_kind(7) /= 4) error stop print *, selected_int_kind(8) if (selected_int_kind(8) /= 4) error stop print *, selected_int_kind(9) if (selected_int_kind(9) /= 4) error stop print *, selected_int_kind(10) if (selected_int_kind(10) /= 8) error stop print *, selected_int_kind(11) if (selected_int_kind(11) /= 8) error stop end subroutine program selected_int_kind_01 integer :: x x = 1 do while (x < 3) call test_selected_int_kind(x, 1) x = x + 1 end do do while (x < 5) call test_selected_int_kind(x, 2) x = x + 1 end do do while (x < 10) call test_selected_int_kind(x, 4) x = x + 1 end do call test_selected_int_kind(x, 8) call test_compile_time_selected_int_kind() end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_15.f900000664000175000017500000000106115141516316025233 0ustar alastairalastairprogram arrays_reshape_15 implicit none real, dimension(6) :: arr = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] real :: s(2, 3) integer :: i, j real, parameter :: eps = 1e-5 s = reshape(arr, shape(s)) if (abs(s(1, 1) - 1.0) > eps) error stop if (abs(s(2, 1) - 2.0) > eps) error stop if (abs(s(1, 2) - 3.0) > eps) error stop if (abs(s(2, 2) - 4.0) > eps) error stop if (abs(s(1, 3) - 5.0) > eps) error stop if (abs(s(2, 3) - 6.0) > eps) error stop do i = 1, 2 do j = 1, 3 write(*, '(F5.1)', advance='no') s(i, j) end do write(*, *) end do end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_11a.f900000664000175000017500000000063615141516316026571 0ustar alastairalastairmodule separate_compilation_11a_module contains subroutine parent_of_nested_subroutine(a, b) integer, intent(inout) :: a, b call nested_subroutine(a, b) contains subroutine nested_subroutine(c, d) integer, intent(inout) :: c, d c = c + 1 d = d + 2 end subroutine nested_subroutine end subroutine parent_of_nested_subroutine end module separate_compilation_11a_module lfortran-lfortran-2f73434/integration_tests/test_ieee_unordered.f900000664000175000017500000000560315141516316025741 0ustar alastairalastair! Test ieee_unordered function program test_ieee_unordered use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, y_sp, nan_sp, tmp_sp real(real64) :: x_dp, y_dp logical :: result print *, "Testing ieee_unordered..." tmp_sp = 1.0_real32 ! Test 1: Two normal values (ordered) x_sp = 1.0_real32 y_sp = 2.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(1.0, 2.0) = ", result if (result) error stop "1.0 and 2.0 should be ordered" ! Test 2: Same values (ordered) x_sp = 5.0_real32 y_sp = 5.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(5.0, 5.0) = ", result if (result) error stop "5.0 and 5.0 should be ordered" ! Test 3: Zero and non-zero (ordered) x_sp = 0.0_real32 y_sp = 1.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(0.0, 1.0) = ", result if (result) error stop "0.0 and 1.0 should be ordered" ! Test 4: Negative values (ordered) x_sp = -3.0_real32 y_sp = -7.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(-3.0, -7.0) = ", result if (result) error stop "-3.0 and -7.0 should be ordered" ! Test 5: First is NaN (unordered) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) y_sp = 1.0_real32 result = ieee_unordered(nan_sp, y_sp) print *, "ieee_unordered(NaN, 1.0) = ", result if (.not. result) error stop "NaN and 1.0 should be unordered" ! Test 6: Second is NaN (unordered) x_sp = 2.0_real32 result = ieee_unordered(x_sp, nan_sp) print *, "ieee_unordered(2.0, NaN) = ", result if (.not. result) error stop "2.0 and NaN should be unordered" ! Test 7: Both are NaN (unordered) result = ieee_unordered(nan_sp, nan_sp) print *, "ieee_unordered(NaN, NaN) = ", result if (.not. result) error stop "NaN and NaN should be unordered" ! Test 8: Infinity and normal (ordered) x_sp = ieee_value(tmp_sp, ieee_positive_inf) y_sp = 100.0_real32 result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(+inf, 100.0) = ", result if (result) error stop "+inf and 100.0 should be ordered" ! Test 9: Double precision normal values (ordered) x_dp = 1.5_real64 y_dp = 2.5_real64 result = ieee_unordered(x_dp, y_dp) print *, "ieee_unordered(1.5d0, 2.5d0) = ", result if (result) error stop "1.5d0 and 2.5d0 should be ordered" ! Test 10: Infinities (ordered) x_sp = ieee_value(tmp_sp, ieee_positive_inf) y_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_unordered(x_sp, y_sp) print *, "ieee_unordered(+inf, -inf) = ", result if (result) error stop "+inf and -inf should be ordered" print *, "All ieee_unordered tests passed!" end program test_ieee_unordered lfortran-lfortran-2f73434/integration_tests/complex_sub_test.f900000664000175000017500000000022115141516316025272 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x - 4.0 x = 4.0 - x print *, x x = 2 - x print *, x x = (x - (0.0, 3.0)) print *, x end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_27.f900000664000175000017500000000034115141516316026060 0ustar alastairalastairprogram implicit_interface_27 implicit none complex :: c complex, external :: test_complex c = test_complex() if (abs(real(c) - 21.0) > 1e-6) error stop if (abs(aimag(c) - (-3.0)) > 1e-6) error stop print *, "ok" end program lfortran-lfortran-2f73434/integration_tests/read_21.f900000664000175000017500000000030615141516316023134 0ustar alastairalastairprogram test_read implicit none integer :: i1, i2 character(len=8) :: cdata = ' 1 2' read (cdata, '(i4, i4)') i1, i2 if(i1 /= 1 .or. i2 /= 2) error stop print *, "OK" end programlfortran-lfortran-2f73434/integration_tests/string_15.f900000664000175000017500000000060115141516316023530 0ustar alastairalastairprogram string_15 implicit none character(len = 10) :: s1 = 'abcde' character(len = 10) :: s2 = 'xyz' ! lge is >=, lgt is >, lle is <=, llt is < if (lge(s1, s2) .neqv. .false.) error stop if (lgt(s1, s2) .neqv. .false.) error stop if (lle(s1, s2) .neqv. .true.) error stop if (llt(s1, s2) .neqv. .true.) error stop print *, s1, s2 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_398.f900000664000175000017500000000064215141516316024512 0ustar alastairalastairprogram main use, intrinsic :: iso_fortran_env, only: int64 implicit none integer(int64) :: m, arr(10) integer :: i do i = 1, 10 arr(i) = i**5 end do m = findloc(arr(1:5), value=arr(3), dim=1) if (m /= 3) error stop m = findloc(arr(2) + arr(3) + arr(4) + arr(1:5), value=arr(6), dim=1) if (m /= 0) error stop m = findloc(arr(1) + arr(2:6), value=arr(1) + arr(3), dim=1) if (m /= 2) error stop end program main lfortran-lfortran-2f73434/integration_tests/allocate_array_descriptor_01.f900000664000175000017500000000131615141516316027441 0ustar alastairalastairprogram allocate_array_descriptor_01 implicit none integer, allocatable :: arr(:) integer :: i real, allocatable :: matrix(:, :) integer :: j allocate(arr(10)) do i = 1, 10 arr(i) = i end do do i = 1, 10 if (arr(i) /= i) error stop "Array value mismatch" end do deallocate(arr) allocate(matrix(5, 5)) do i = 1, 5 do j = 1, 5 matrix(i, j) = i * 10 + j end do end do do i = 1, 5 do j = 1, 5 if (abs(matrix(i, j) - (i * 10 + j)) > 1e-10) error stop "Matrix value mismatch" end do end do deallocate(matrix) print *, "All tests passed!" end program allocate_array_descriptor_01 lfortran-lfortran-2f73434/integration_tests/while_05.f900000664000175000017500000000151715141516316023340 0ustar alastairalastair! Test while's test statement and how we handle any expression ! inside that needs a temporary program while_05 integer :: x = 2 integer :: hit = 0 ! Predicate with some array operations in it do while(boo(foo(x) == ["Hello","World"])) print *, "Hi" x = 1 hit = hit + 1 end do if(hit /= 1) error stop contains function foo(i) result (r) integer :: I character(5):: r(2) if(i == 1) then r = ["bla","bla"] else r = ["Hello","World"] end if end function function boo(arr) result (r_logical) logical ::r_logical logical :: arr(2) if(all(arr.eqv. [.true.,.true.])) then r_logical = .true. else r_logical = .false. end if end function end programlfortran-lfortran-2f73434/integration_tests/bits_01.f900000664000175000017500000000056315141516316023165 0ustar alastairalastairprogram bits_01 use iso_fortran_env, only: int32, int64 implicit none if (ibclr(3_int32, 0) /= 2_int32) error stop if (ibclr(4_int64, 1) /= 4_int64) error stop if (ibset(1_int32, 2) /= 5_int32) error stop if (ibset(2_int64, 3) /= 10_int64) error stop if (ieor(16_int32, 2_int32) /= 18_int32) error stop if (ieor(31_int64, 3_int64) /= 28_int64) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_07.f900000664000175000017500000000030715141516316024413 0ustar alastairalastairprogram intrinsics_07 ! Tests for kind() integer, parameter :: sp = kind(0.0) integer, parameter :: sp2 = kind(0.e0) integer, parameter :: dp = kind(0.d0) real(sp) :: a real(dp) :: b a = 5 b = a end lfortran-lfortran-2f73434/integration_tests/allocate_03.f900000664000175000017500000000163215141516316024010 0ustar alastairalastairprogram allocate_03 implicit none integer, allocatable :: c(:, :, :) integer :: r integer :: stat stat = 1 allocate(c(3, 3, 3), STAT=stat) if (stat /= 0) error stop c(1, 1, 1) = 3 call h(c) r = g(c) if( c(1, 1, 1) /= 8 ) error stop print *, c(1, 1, 1) contains subroutine f(c) integer, allocatable, intent(out) :: c(:, :, :) allocate(c(3, 3, 3)) c(1, 1, 1) = 99 end subroutine function g(x) result(r) integer, allocatable :: x(:, :, :) integer :: r print *, x(1, 1, 1) if( x(1, 1, 1) /= 8 ) error stop call f(x) print *, x(1, 1, 1) if( x(1, 1, 1) /= 99 ) error stop x(1, 1, 1) = 8 r = 0 end function subroutine h(c) integer, allocatable, intent(out) :: c(:, :, :) if( allocated(c) ) error stop call f(c) print *, c(1, 1, 1) if( c(1, 1, 1) /= 99 ) error stop c(1, 1, 1) = 8 end subroutine end program lfortran-lfortran-2f73434/integration_tests/read_20.f900000664000175000017500000000141615141516316023136 0ustar alastairalastairprogram read_20 ! Test iostat is set correctly on integer overflow implicit none integer :: x, u, ios open(newunit=u, file='_test_overflow.txt', status='replace') write(u, '(A)') "2719" write(u, '(A)') "2147483648" ! INT32_MAX + 1 close(u) open(newunit=u, file='_test_overflow.txt', status='old') ! First read should succeed read(u, *, iostat=ios) x if (ios /= 0) error stop "First read should succeed" if (x /= 2719) error stop "First value should be 2719" ! Second read should fail with overflow, iostat should be non-zero read(u, *, iostat=ios) x if (ios == 0) error stop "Second read should fail (overflow)" close(u, status='delete') print *, "PASS: iostat correctly set on overflow" end program read_20 lfortran-lfortran-2f73434/integration_tests/intrinsics_273.f900000664000175000017500000000361215141516316024502 0ustar alastairalastairprogram intrinsic_273 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp), parameter :: res_1(5) = dprod([5.2, 3.2, -4.1, 9.8, 5.6], [6.12, 39.2, -41.1, 32.1, 4.5]) real(dp), parameter :: res_2(5) = dprod([5.2, 3.2, -4.1, 9.8, 5.6], 5.2) real(dp), parameter :: res_3(5) = dprod(5.2, [6.12, 39.2, -41.1, 32.1, 4.5]) real(sp) :: x(5) = [5.2, 3.2, -4.1, 9.8, 5.6] real(sp) :: y(5) = [6.12, 39.2, -41.1, 32.1, 4.5] real(sp) :: z(5) = [6.12, 39.2, -41.1, 32.1, 4.5] real(sp) :: u = 5.2 real(dp) :: run_x(5) real(dp) :: run_y(5) real(dp) :: run_z(5) real(dp) :: expected_1(5) = [3.18239982376098851e+01, 1.25440004310607947e+02, 1.68509989824295189e+02, & 3.14579991168975539e+02, 2.51999995708465576e+01] real(dp) :: expected_2(5) = [2.70399990081787109e+01, 1.66400002479553244e+01, -2.13199995040893562e+01, & 5.09600009918212891e+01, 2.91199995040893569e+01] real(dp) :: expected_3(5) = [3.18239994049072266e+01, 2.03840003967285156e+02, -2.13719992065429693e+02, & 1.66919982910156250e+02, 2.33999996185302734e+01] do i = 1, 5 print *, res_1(i) if (abs(res_1(i) - expected_1(i)) > 1e-5) error stop end do do i = 1, 5 print *, res_2(i) if (abs(res_2(i) - expected_2(i)) > 1e-5) error stop end do do i = 1, 5 print *, res_3(i) if (abs(res_3(i) - expected_3(i)) > 1e-5) error stop end do run_x = dprod(x, y) run_y = dprod(x, u) run_z = dprod(u, z) do i = 1, 5 print *, run_x(i) if (abs(run_x(i) - expected_1(i)) > 1e-5) error stop end do do i = 1, 5 print *, run_y(i) if (abs(run_y(i) - expected_2(i)) > 1e-5) error stop end do do i = 1, 5 print *, run_z(i) if (abs(run_z(i) - expected_3(i)) > 1e-5) error stop end do end program lfortran-lfortran-2f73434/integration_tests/arrays_09.f900000664000175000017500000000017215141516316023531 0ustar alastairalastairprogram arrays_09 implicit none character(10) :: a(1) a(1) = 'Substring' if(a(1)(4:9) /= 'string') error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_339.f900000664000175000017500000000106715141516316024507 0ustar alastairalastairprogram intrinsics_339 integer :: score(4) = [-1,1,1,2] print *, minloc([-1,1,1,2], 1, [.false., .true., .true., .true.]) if (minloc([-1,1,1,2], 1, [.false., .true., .true., .true.]) /= 2) error stop print *, minloc(score, mask=(score > 0)) if (any(minloc(score, mask=(score > 0)) /= 2)) error stop print *, minloc(score, 1, [.false., .true., .true., .true.]) if (minloc(score, 1, [.false., .true., .true., .true.]) /= 2) error stop print*, minloc([1, 2, 3], 1, .true.) if (minloc([1, 2, 3], 1, .true.) /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/print_arr_06.f900000664000175000017500000000232215141516316024224 0ustar alastairalastairprogram print_arr_06 character(5),allocatable:: arr_str(:) integer(8):: arr_int(3) real(8):: arr_real(4) logical :: arr_logical(3) integer(2) :: w real(4) ::m character(20) ::s character(200) :: FORMAT_STR character(300) ::res character(300) ::lfortran_output character(300) ::gfortran_output allocate(arr_str(5)) ! set format string FORMAT_STR = "(5a,2X,3i1,2X,4f3.1,2X,3l,2X,1i2,2X,1f5.3,2X,1a)" ! set values for scalar variables and arrays arr_str = ["a","b","c","d","e"] arr_int = [1,2,3] arr_real = [1.1,1.2,1.3,1.4] arr_logical = [.true.,.false.,.true.] w = 10 m = 1.4 s = "test" ! write to res with formatting write(res,FORMAT_STR) arr_str,arr_int,arr_real,arr_logical,w,m,s ! print print FORMAT_STR,arr_str,arr_int,arr_real,arr_logical,w,m,s print "(a)",res ! Testing lfortran_output = "abcde 123 1.11.21.31.4 TFT 10 1.400 test" gfortran_output = "a b c d e 123 1.11.21.31.4 TFT 10 1.400 test" ! GFortran and LFortran vary while printing array of characters. if(res /= lfortran_output .and. res /= gfortran_output) error stop end program print_arr_06lfortran-lfortran-2f73434/integration_tests/intrinsics_115.f900000664000175000017500000000220315141516316024470 0ustar alastairalastairprogram intrinsics_115 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(4) x4 real(8) x8 real(4), parameter :: r1 = anint(4.23_4) real(8), parameter :: r2 = anint(4.23_8) real(4), parameter :: ar1(3) = anint([123.41_4, 4.23_4, -31.0_4]) real(8), parameter :: ar2(3) = anint([123.41_8, 4.23_8, -31.0_8]) real(4) :: arr1(3) = [123.41_4, 4.23_4, -31.0_4] real(8) :: arr2(3) = [123.41_8, 4.23_8, -31.0_8] print *, r1 if (r1 /= 4) error stop print *, r2 if (r2 /= 4) error stop print *, ar1 if (any(ar1 /= [123, 4, -31])) error stop print *, ar2 ! if (any(ar2 /= [123_8, 4_8, -31_8])) error stop print *, anint(arr1) if (any(anint(arr1) /= [123, 4, -31])) error stop print *, anint(arr2) if (any(anint(arr2) /= [123, 4, -31])) error stop x4 = 1.234E0_4 x8 = 4.821_8 print *, anint( a = x4, kind = 8 ) print *, anint( a = x8, kind = 4 ) if ( .not. anint( a = x4, kind = 8 ) == 1 ) error stop if ( .not. anint( x4, kind = 8 ) == 1 ) error stop if ( .not. anint( x4, 8 ) == 1 ) error stop end program intrinsics_115 lfortran-lfortran-2f73434/integration_tests/format_17.f900000664000175000017500000000015115141516316023514 0ustar alastairalastairprogram format_17 integer ::i 201 FORMAT( 3I1 ) write(*,201) (1,i=1,3) end program format_17lfortran-lfortran-2f73434/integration_tests/intrinsics_20.f900000664000175000017500000000056515141516316024414 0ustar alastairalastairprogram intrinsics_20 integer, parameter :: dp = kind(0.d0) real, parameter :: pi = acos(-1.) real(dp), parameter :: pi_dp = acos(-1._dp) real, parameter :: x = cos((3+4)*7.) integer :: y integer, parameter :: y2 = 3 print *, pi print *, pi_dp print *, x y = 3 print *, cos((3+4)*7.) print *, cos((y+4)*7.) print *, cos((y2+4)*7.) print *, cos(x+1)**2 + sin(x+1)**2 end lfortran-lfortran-2f73434/integration_tests/associate_13.f900000664000175000017500000000256115141516316024202 0ustar alastairalastairprogram associate_13 implicit none complex(8), target :: my_complex(2, 3) complex(8), pointer :: my_complex_mirror(:, :) real(8), pointer :: my_complex_re(:, :) real(8), pointer :: my_complex_im(:, :) my_complex = reshape([(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12)], [2, 3]) my_complex_re => my_complex%re print *, my_complex_re(1, 1), my_complex_re(1, 2), my_complex_re(1, 3) print *, my_complex_re(2, 1), my_complex_re(2, 2), my_complex_re(2, 3) if (abs(my_complex_re(1, 1) - 1) > 1e-8_8) error stop if (abs(my_complex_re(1, 2) - 5) > 1e-8_8) error stop if (abs(my_complex_re(1, 3) - 9) > 1e-8_8) error stop if (abs(my_complex_re(2, 1) - 3) > 1e-8_8) error stop if (abs(my_complex_re(2, 2) - 7) > 1e-8_8) error stop if (abs(my_complex_re(2, 3) - 11) > 1e-8_8) error stop my_complex_im => my_complex%im print *, my_complex_im(1, 1), my_complex_im(1, 2), my_complex_im(1, 3) print *, my_complex_im(2, 1), my_complex_im(2, 2), my_complex_im(2, 3) if (abs(my_complex_im(1, 1) - 2) > 1e-8_8) error stop if (abs(my_complex_im(1, 2) - 6) > 1e-8_8) error stop if (abs(my_complex_im(1, 3) - 10) > 1e-8_8) error stop if (abs(my_complex_im(2, 1) - 4) > 1e-8_8) error stop if (abs(my_complex_im(2, 2) - 8) > 1e-8_8) error stop if (abs(my_complex_im(2, 3) - 12) > 1e-8_8) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_19.f900000664000175000017500000000142415141516316023701 0ustar alastairalastairprogram complex_19 implicit none integer, parameter :: dp = kind(0.d0) complex(dp), target :: my_complex(2, 3) real(dp) :: k integer :: i, j k = 1.0_dp do i = 1, 2 do j = 1, 3 my_complex(i, j) = complex(k, k + 1.0_dp) k = k + 2.0_dp end do end do print *, my_complex if (abs(my_complex(1, 1) - (1.0_dp, 2.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(1, 2) - (3.0_dp, 4.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(1, 3) - (5.0_dp, 6.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 1) - (7.0_dp, 8.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 2) - (9.0_dp, 10.0_dp)) > 1e-8_dp) error stop if (abs(my_complex(2, 3) - (11.0_dp, 12.0_dp)) > 1e-8_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/format_37.f900000664000175000017500000000152115141516316023520 0ustar alastairalastairprogram format_37 implicit none character(len=100) :: output ! Test case 1: String and integer print "(*(g0,1x))", 'The answer is', 42 write(output, '(*(g0,1x))') 'The answer is', 42 print *, "Test 1: ", trim(output) if (trim(output) /= 'The answer is 42') error stop ! Test case 2: Multiple integers print "(*(g0,1x))", 43, 44, 45 write(output, '(*(g0,1x))') 43, 44, 45 print *, "Test 2: ", trim(output) if (trim(output) /= '43 44 45') error stop ! Test case 3: Mixed strings and integers pattern print "(*(g0,1x))", 'A', 'B', 10, 20, 'C', 'D', 30, 40 write(output, '(*(g0,1x))') 'A', 'B', 10, 20, 'C', 'D', 30, 40 print *, "Test 3: ", trim(output) if (trim(output) /= 'A B 10 20 C D 30 40') error stop print *, "All tests passed!" end program format_37 lfortran-lfortran-2f73434/integration_tests/external_12.f900000664000175000017500000000013215141516316024040 0ustar alastairalastairprogram external_12 use external_12_module2, only: inner call inner() end program lfortran-lfortran-2f73434/integration_tests/character_03.f900000664000175000017500000000016015141516316024153 0ustar alastairalastairprogram character_03 implicit none character(len = 5) :: s s = "12345678" print *, s end programlfortran-lfortran-2f73434/integration_tests/modules_65_base.f900000664000175000017500000000034115141516316024672 0ustar alastairalastairmodule modules_65_base implicit none type :: base_t integer :: width = 0 end type base_t type :: holder_t class(base_t), allocatable :: item end type holder_t end module modules_65_base lfortran-lfortran-2f73434/integration_tests/do_concurrent_11.f900000664000175000017500000000233615141516316025071 0ustar alastairalastair! equivalent to openmp_28.f90 subroutine csr_matvec(Ap, Aj, Ax, x, y) ! Compute y = A*x for CSR matrix A and dense vectors x, y integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) integer :: i, j ! Initialize y to zero y = 0.0 do concurrent (i = 1:size(Ap)-1) shared(Ap, Aj, Ax, x, y) local(j) do j = Ap(i), Ap(i+1)-1 y(i) = y(i) + Ax(j)*x(Aj(j)) end do end do print *, sum(y(1:10)) if (abs(sum(y(1:10)) - 950.00) > 1e-8) error stop end subroutine program do_concurrent_11 implicit none interface subroutine csr_matvec(Ap, Aj, Ax, x, y) integer, intent(in) :: Ap(:), Aj(:) real, intent(in) :: Ax(:), x(:) real, intent(inout) :: y(size(Ap)-1) end subroutine end interface integer, parameter :: n = 100 integer :: i real :: x(n), y(n) integer, allocatable :: Ap(:), Aj(:) real, allocatable :: Ax(:) ! Initialize CSR matrix A allocate(Ap(n+1), Aj(3*n), Ax(3*n)) Ap = [(3*(i-1)+1, i=1,n+1)] Aj = [(mod(i-1, n)+1, i=1,3*n)] Ax = [(1.0, 2.0, 3.0, i=1,n)] ! Initialize vector x x = [(i, i=1,n)] ! Initialize y to zero y = 0.0 ! Compute y = A*x call csr_matvec(Ap, Aj, Ax, x, y) ! Print the result print *, sum(y) if (abs(sum(y) - 30300.00) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_403.f900000664000175000017500000000173315141516316024477 0ustar alastairalastairprogram intrinsics_403 implicit none real :: r1, r2, result integer :: i_result r1 = 42.1 r2 = 43.43 i_result = min1(r1, r2) print *, 'min1 test: ', i_result if (i_result /= 42) error stop i_result = max1(r1, r2) print *, 'max1 test: ', i_result if (i_result /= 43) error stop r1 = -5.7 r2 = -3.2 i_result = min1(r1, r2) print *, 'min1 negative test: ', i_result if (i_result /= -5) error stop i_result = max1(r1, r2) print *, 'max1 negative test: ', i_result if (i_result /= -3) error stop i_result = min1(10.5, 20.3, 5.1, 15.9) print *, 'min1 multiple args: ', i_result if (i_result /= 5) error stop i_result = max1(10.5, 20.3, 5.1, 15.9) print *, 'max1 multiple args: ', i_result if (i_result /= 20) error stop result = min1(r1, r2) print *, 'min1 to real: ', result if (result /= -5.0) error stop result = max1(r1, r2) print *, 'max1 to real: ', result if (result /= -3.0) error stop end program intrinsics_403 lfortran-lfortran-2f73434/integration_tests/allocate_35.f900000664000175000017500000000247415141516316024022 0ustar alastairalastair! Test for realloc-lhs-arrays with empty array constructors ! This tests that assigning an empty array to an allocatable array ! correctly allocates the array with size 0 (still considered allocated) program allocate_35 implicit none logical, allocatable :: subtally(:) integer, allocatable :: arr(:) ! First assignment allocates with size 3 subtally = [.true., .false., .true.] if (size(subtally) /= 3) error stop if (.not. allocated(subtally)) error stop if (subtally(1) .neqv. .true.) error stop if (subtally(2) .neqv. .false.) error stop if (subtally(3) .neqv. .true.) error stop ! Second assignment reallocates to size 0 ! This should still keep the array allocated (Fortran semantics) subtally = [logical::] if (size(subtally) /= 0) error stop if (.not. allocated(subtally)) error stop ! Test with integer array as well arr = [1, 2, 3, 4, 5] if (size(arr) /= 5) error stop if (.not. allocated(arr)) error stop ! Reallocate to empty array arr = [integer::] if (size(arr) /= 0) error stop if (.not. allocated(arr)) error stop ! Reallocate back to non-empty arr = [10, 20] if (size(arr) /= 2) error stop if (arr(1) /= 10) error stop if (arr(2) /= 20) error stop print *, "All tests passed!" end program allocate_35 lfortran-lfortran-2f73434/integration_tests/namelist_17.f900000664000175000017500000000145215141516316024045 0ustar alastairalastairprogram test_namelist_derived_types implicit none integer :: a, b real :: c type :: point integer :: x, y end type type(point) :: p namelist /nml/ a, b, c, p a = 1 b = 2 c = 3.5 p%x = 4 p%y = 5 open(unit=10, file='namelist_dt_17.dat', status='replace', form='formatted') write(10, nml=nml) close(10) a = 0 b = 0 c = 0 p%x = 0 p%y = 0 open(unit=10, file='namelist_dt_17.dat', status='old', form='formatted') read(10, nml=nml) close(10) print *, a if (a /= 1) error stop print *, b if (b /= 2) error stop print *, c if (abs(c-3.5) > 1e-5) error stop print *, p%x if (p%x /= 4) error stop print *, p%y if (p%y /= 5) error stop end program test_namelist_derived_types lfortran-lfortran-2f73434/integration_tests/class_29.f900000664000175000017500000000267715141516316023353 0ustar alastairalastairprogram class_29 type :: toml_val integer :: x character(len=:), allocatable :: y end type type :: toml_table integer :: x character(len=:), allocatable :: y class(toml_val), allocatable :: val end type class(toml_table), pointer :: temp class(toml_table), pointer :: temp2 class(toml_table), allocatable :: temp3 type(toml_table), allocatable :: temp4 type(toml_table), target :: temp_table temp_table%x = 42 temp => temp_table nullify(temp2) if (associated(temp2) .or. .not. associated(temp)) error stop if (allocated(temp3)) error stop allocate(temp3) allocate(temp4) if (.not. allocated(temp3)) error stop temp3%y = "Hello, World!" if (allocated(temp3%val)) error stop call destroy(temp3) if (allocated(temp3%y)) error stop temp3%y = "Hello, World!" temp4%y = "Hello, World!" if (allocated(temp3%y)) then deallocate(temp3%y) end if if (allocated(temp3%y)) error stop if (allocated(temp4%y)) then deallocate(temp4%y) end if if (allocated(temp4%y)) error stop allocate(temp4%val) temp4%val%y = "Hello" if (allocated(temp4%val%y)) then deallocate(temp4%val%y) end if if (allocated(temp4%val%y)) error stop contains subroutine destroy(shlex) class(toml_table), intent(inout) :: shlex deallocate(shlex%y) end subroutine destroy end programlfortran-lfortran-2f73434/integration_tests/procedure_21.f900000664000175000017500000000125115141516316024211 0ustar alastairalastairmodule procedure_21_mod implicit none private public :: is_valid interface is_valid module procedure is_valid_scalar module procedure is_valid_array end interface contains integer function is_valid_array(arr) integer, intent(in) :: arr(:) is_valid_array = count(arr > 0) end function elemental integer function is_valid_scalar(x) integer, intent(in) :: x is_valid_scalar = -1 end function end module procedure_21_mod program procedure_21 use procedure_21_mod implicit none if (is_valid([1, 2, 3]) /= 3) error stop if (is_valid([1, -2, -3]) /= 1) error stop if (is_valid([1, -2, 3]) /= 2) error stop end program procedure_21lfortran-lfortran-2f73434/integration_tests/separate_compilation_06b.f900000664000175000017500000000073015141516316026571 0ustar alastairalastairmodule separate_compilation_06b_module use separate_compilation_06a_module contains function rpoisson_outward_pc(R, Rp, rho) result(V) real, intent(in) :: R(:), Rp(:), rho(:) real :: V(size(R)) integer :: N integer, parameter :: max_it = 2 real :: rho_mid(3), pi = 3.14159265358979323846 N = size(R) rho_mid = get_midpoints(R(:4), rho(:4)) print *, "sum(rho_mid): ", sum(rho_mid) if ( abs(sum(rho_mid) - 3.76053631e-01 ) > 1e-8 ) error stop end function end module lfortran-lfortran-2f73434/integration_tests/select_type_03_module.f900000664000175000017500000000036415141516316026112 0ustar alastairalastairmodule class_default_select_type implicit none type :: enum_stat integer :: success = 0 integer :: fatal = -1 end type enum_stat type(enum_stat), parameter :: toml_stat = enum_stat() end module class_default_select_type lfortran-lfortran-2f73434/integration_tests/modules_52_module3.f900000664000175000017500000000023715141516316025330 0ustar alastairalastairmodule module_52_tomlf_error type :: toml_error integer :: stat character(len=:), allocatable :: message end type toml_error end module lfortran-lfortran-2f73434/integration_tests/expr_09.f900000664000175000017500000000037215141516316023210 0ustar alastairalastairprogram expr_09 implicit none integer :: x4, y4 integer(kind=8) :: x8, y8 y4 = 5 x4 = y4 ** 2 print *, y4, x4 if (x4 /= 25) error stop y8 = 5 x8 = y8**2 print *, y8, x8 if (x8 /= 25) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_55.f900000664000175000017500000000065515141516316024424 0ustar alastairalastairdouble precision function hinit853() result(h) double precision :: h1, hmax h = 0.1d0 h1 = 0.1d0 hmax = 1.d0 h = min(100*abs(h), h1, hmax) end function program intrinsics_55 double precision :: h interface double precision function hinit853() end function hinit853 end interface h = hinit853() if (abs(h-0.10000000000000001) > 1e-8) error stop print *, h end program lfortran-lfortran-2f73434/integration_tests/loop_unroll_small.f900000664000175000017500000000101315141516316025447 0ustar alastairalastairprogram loop_unroll_small implicit none integer :: i, first, last, array(4), x do i = 1, 4 array(i) = i end do first = 1 last = 4 do i = first, last array(i) = array(i) + i end do do i = 1, 4 x = array(i) call print_subrout(x) end do do i = 1, 4 x = array(i) if( x /= 2 * i ) error stop end do contains subroutine print_subrout(x) integer, intent(in) :: x print *, x end subroutine end program lfortran-lfortran-2f73434/integration_tests/external_14_module.f900000664000175000017500000000141415141516316025413 0ustar alastairalastairmodule external_14_mod_1 use iso_c_binding implicit none interface f_string module procedure f_string_cptr end interface contains function f_string_cptr(cptr) result(s) type(c_ptr), intent(in), value :: cptr character(len=:), allocatable :: s character(kind=c_char), pointer :: p(:) integer :: n, i if (.not. c_associated(cptr)) then error stop "f_string: NULL c_ptr" end if call c_f_pointer(cptr, p, [64]) n = 0 do while (p(n+1) /= c_null_char) n = n + 1 end do allocate(character(len=n) :: s) do i = 1, n s(i:i) = achar(iachar(p(i))) end do end function f_string_cptr end module external_14_mod_1lfortran-lfortran-2f73434/integration_tests/read_13.f900000664000175000017500000000063515141516316023142 0ustar alastairalastairprogram read_13 implicit none real :: arr(5) integer :: i, j open(10, file="read_13_data.txt", status="replace") write(10, *) 1.0, 2.0, 3.0, 4.0, 5.0 close(10) open(10, file="read_13_data.txt", status="old") read(10, *) (arr(j), j=1,5) close(10, status="delete") do i = 1, 5 if (abs(arr(i) - real(i)) > 1e-6) error stop end do print *, "PASS" end programlfortran-lfortran-2f73434/integration_tests/allocate_20.f900000664000175000017500000000201415141516316024002 0ustar alastairalastairmodule stdlib_io_npy_load_allocate_12 implicit none integer, parameter :: dp = selected_real_kind(15) contains subroutine load_npy_csp_4() complex, allocatable :: array(:,:,:,:) integer :: stat call allocator(array, stat) if (stat /= 9) error stop if (.not. allocated(array)) error stop contains subroutine allocator(array, stat) complex, allocatable, intent(out) :: array(:,:,:,:) integer, intent(out) :: stat allocate(array(1,2,3,4), stat=stat) if ( .not. allocated(array)) error stop stat = 9 end subroutine allocator end subroutine load_npy_csp_4 subroutine load_npy_cdp_4() contains subroutine allocator(array_cdp, stat) complex(dp), allocatable, intent(out) :: array_cdp(:,:,:,:) integer, intent(out) :: stat end subroutine allocator end subroutine load_npy_cdp_4 end module stdlib_io_npy_load_allocate_12 program allocate_12 use stdlib_io_npy_load_allocate_12 call load_npy_csp_4() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_172.f900000664000175000017500000000574215141516316024506 0ustar alastairalastairprogram intrinsics_172 use iso_fortran_env, only: int32, int64 implicit none logical :: mask(3, 4) logical :: mask_(6, 9) logical :: mask_3(3, 4, 3) logical :: mask_4(4, 5, 3, 1) integer(kind=int32) :: res_4 integer(kind=int64) :: res_8 integer, dimension(2,3) :: a, b logical, dimension(2,3) :: mask2 integer, parameter :: c1 = count([.true., .false., .true., .false.]) integer(8), parameter :: c2 = count([.true., .false., .true., .false., .true., .false.], kind = 8) mask = reshape([ .true., .false., .true., .false., & .true., .false., .true., .false., & .true., .false., .true., .true.], [3, 4]) mask_ = .false. mask_(1, 1) = .true. mask_(1, 2) = .true. mask_(5, 1) = .true. mask_(5, 2) = .true. mask_(6, 7) = .true. mask_(4, 8) = .true. mask_3 = .false. mask_3(1, 1, :) = .true. mask_3(1, 2, :) = .true. mask_3(3, 1, :) = .true. mask_3(2, 2, :) = .true. mask_3(2, 4, :) = .true. mask_3(3, 3, :) = .true. mask_4 = .true. mask_4(1, 1, 1, 1) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 2, 1, :) = .false. mask_4(1, 2, 3, :) = .false. print *, count(mask) if (count(mask) /= 7) error stop print *, count(mask_) if (count(mask_) /= 6) error stop print *, count(mask_3) if (count(mask_3) /= 18) error stop print *, count(mask, 1) if (sum(count(mask, 1)) /= 7) error stop print *, count(mask, 2) if (sum(count(mask, 2)) /= 7) error stop print *, sum(count(mask_, 1)) if (sum(count(mask_, 1)) /= 6) error stop print *, shape(count(mask_, 1)) print *, sum(count(mask_, 2)) if (sum(count(mask_, 2)) /= 6) error stop print *, shape(count(mask_, 2)) print *, sum(count(mask_3, 1)) if (sum(count(mask_3, 1)) /= 18) error stop print *, shape(count(mask_3, 1)) print *, sum(count(mask_3, 2)) if (sum(count(mask_3, 2)) /= 18) error stop print *, shape(count(mask_3, 2)) print *, sum(count(mask_3, 3)) if (sum(count(mask_3, 3)) /= 18) error stop print *, sum(count(mask_4, 1)) if (sum(count(mask_4, 1)) /= 57) error stop print *, shape(count(mask_4, 1)) res_4 = count(mask_4, kind=4) if (res_4 /= 57) error stop res_8 = count(mask_4, kind=8) if (res_8 /= 57) error stop a = reshape( [ 1, 2, 3, 4, 5, 6 ], [ 2, 3 ]) b = reshape( [ 0, 7, 3, 4, 5, 8 ], [ 2, 3 ]) print '(3i3)', a(1,:) print '(3i3)', a(2,:) print * print '(3i3)', b(1,:) print '(3i3)', b(2,:) print * mask2 = a.ne.b print '(3l3)', mask2(1,:) print '(3l3)', mask2(2,:) print * print '(3i3)', count(mask2) if (count(mask2) /= 3) error stop print * print '(3i3)', count(mask2, 1) print * print '(3i3)', count(mask2, 2) print*, c1 if (c1 /= 2) error stop print*, c2 if (c2 /= 3) error stop print*, kind(c2) if (kind(c2) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/read_06.f900000664000175000017500000000065315141516316023144 0ustar alastairalastairprogram read_06 implicit none call check_value("10", 10) call check_value("3 7", 3) contains subroutine check_value(src, expected) character(len=*), intent(in) :: src integer, intent(in) :: expected integer :: value, ios read(src, *, iostat=ios) value if (ios /= 0) error stop if (value /= expected) error stop end subroutine check_value end program read_06 lfortran-lfortran-2f73434/integration_tests/if_04.f900000664000175000017500000000065215141516316022624 0ustar alastairalastairprogram if_04 implicit none integer :: i i = 1 if (i == 1) then print *, "1" else if (i == 2) then print *, "2" elseif (i == 3) then print *, "3" else if (i == 4) then print *, "4" end if name: if (i == 1) then print *, "1" else if (i == 2) then name print *, "2" elseif (i == 3) then name print *, "3" else if (i == 4) then name print *, "4" else name print *, "Invalid!" endif name end lfortran-lfortran-2f73434/integration_tests/optional_02.f900000664000175000017500000000342715141516316024054 0ustar alastairalastairprogram optional_02 implicit none type :: file_scope_flag character(len=:), allocatable :: file_name character(len=:), allocatable :: flags end type file_scope_flag type :: profile_config_t character(len=:), allocatable :: profile_name character(len=:), allocatable :: compiler integer :: os_type character(len=:), allocatable :: flags character(len=:), allocatable :: c_flags character(len=:), allocatable :: cxx_flags character(len=:), allocatable :: link_time_flags type(file_scope_flag), allocatable :: file_scope_flags(:) logical :: is_built_in end type profile_config_t type :: error_t character(len=:), allocatable :: message end type error_t integer, parameter :: OS_ALL = -1 contains function new_profile(profile_name, compiler, os_type, flags, c_flags, cxx_flags, & link_time_flags, file_scope_flags, is_built_in) result(profile) character(len=*), intent(in) :: profile_name character(len=*), intent(in) :: compiler integer, intent(in) :: os_type character(len=*), optional, intent(in) :: flags character(len=*), optional, intent(in) :: c_flags character(len=*), optional, intent(in) :: cxx_flags character(len=*), optional, intent(in) :: link_time_flags type(file_scope_flag), optional, intent(in) :: file_scope_flags(:) logical, optional, intent(in) :: is_built_in type(profile_config_t) :: profile end function new_profile function get_default_profiles(error) result(default_profiles) type(error_t), allocatable, intent(out) :: error type(profile_config_t), allocatable :: default_profiles(:) default_profiles = [new_profile('release', & & 'caf', & & OS_ALL, & & flags=' -O3 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops', & & is_built_in=.true.)] end function get_default_profiles end program lfortran-lfortran-2f73434/integration_tests/arrays_42.f900000664000175000017500000000077315141516316023535 0ustar alastairalastairmodule module_arrays_42 contains function var_2_iint8_dp(x, dim) result(res) use iso_fortran_env, only: dp => real64 integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(dp) :: res res = sum(sum(real(x, dp), dim)) end function var_2_iint8_dp end module program arrays_42 use module_arrays_42 use iso_fortran_env, only: dp => real64 integer :: x(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) real(dp) :: res res = var_2_iint8_dp(x, 1) print *, res if (abs(res - 45.0) > 1e-16) error stop end program lfortran-lfortran-2f73434/integration_tests/goto_04.f900000664000175000017500000000072715141516316023201 0ustar alastairalastairprogram goto_04 implicit none integer :: a, n n = 2 a = 10 ! Jump to the label n - 1 = 1 -> 1 go to (1, 2, 3), n - 1 a = a + 5 1 a = a + 10 2 a = a + 20 3 a = a + 30 if(a /= 70) error stop ! Jump to the label n + 1 = 3 -> 6 go to (4, 5, 6), n + 1 a = a + 5 4 a = a + 40 5 a = a + 50 6 a = a + 60 if(a /= 130) error stop ! Jump to the label n * n = 4 -> noop go to (7, 8, 9), n * n a = a + 5 7 a = a + 70 8 a = a + 80 9 a = a + 90 if(a /= 375) error stop end program lfortran-lfortran-2f73434/integration_tests/list_test_06_.f900000664000175000017500000000606315141516316024403 0ustar alastairalastairmodule list_test_06_mod implicit none real::eps = 1e-6 contains subroutine check_mat_and_vec(mat, vec) type(_lfortran_list(_lfortran_list(real))), intent(in) :: mat type(_lfortran_list(real)), intent(in) :: vec integer::rows, cols, i, j rows = _lfortran_len(mat) cols = _lfortran_len(vec) do i = 0, rows-1 do j = 0, cols-1 if ( abs(_lfortran_get_item(_lfortran_get_item(mat, i), j) - real(i+j)) > eps ) error stop end do end do do i = 0, cols-1 if ( abs(_lfortran_get_item(vec, i) - 2*real(i)) > eps ) error stop end do end subroutine subroutine test_list_of_lists() type(_lfortran_list(_lfortran_list(_lfortran_list(_lfortran_list(real))))) :: arrays type(_lfortran_list(_lfortran_list(_lfortran_list(real)))) :: array type(_lfortran_list(_lfortran_list(real))) :: mat type(_lfortran_list(real)) :: vec integer:: rows, cols, i, j, k, l real:: tmp, tmp1 rows = 10 cols = 5 do i = 0, rows-1 do j = 0, cols-1 call _lfortran_list_append(vec, real(i+j)) end do call _lfortran_list_append(mat, vec) call _lfortran_clear(vec) end do do i = 0, cols-1 call _lfortran_list_append(vec, 2.0*real(i)) end do call check_mat_and_vec(mat, vec) do k = 0, rows-1 call _lfortran_list_append(array, mat) do i = 0, rows-1 do j = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(mat, i), j) call _lfortran_set_item(_lfortran_get_item(mat, i), j, tmp + 1.0) end do end do end do do k = 0, rows-1 do i = 0, rows-1 do j = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(mat, i), j) tmp1 = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, k), i), j) if ( abs(tmp-tmp1-real(rows-k)) > eps ) error stop end do end do end do do l=0, 2*rows-1 call _lfortran_list_append(arrays, array) do i = 0, rows-1 do j = 0, rows-1 do k = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k) call _lfortran_set_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k, tmp+1.0) end do end do end do end do do l=0, 2*rows-1 do i = 0, rows-1 do j = 0, rows-1 do k = 0, cols-1 tmp = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(array, i), j), k) tmp1 = _lfortran_get_item(_lfortran_get_item(_lfortran_get_item(_lfortran_get_item(arrays, l), i), j), k) if ( abs(tmp-tmp1-real(2*rows-l)) > eps ) error stop end do end do end do end do end subroutine end module program test_list_06_ use list_test_06_mod implicit none call test_list_of_lists end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_22a.f900000664000175000017500000000034615141516316026571 0ustar alastairalastairmodule math_separate_compilation_22 implicit none interface logspace module subroutine logspace_sub(n) integer, intent(inout) :: n end subroutine logspace_sub end interface end modulelfortran-lfortran-2f73434/integration_tests/parameter_01.f900000664000175000017500000000017015141516316024176 0ustar alastairalastairprogram parameter_01 implicit none integer :: i, j, k parameter(i = 1) parameter(j=2, k=3) print *, i, j, k end program lfortran-lfortran-2f73434/integration_tests/intrinsics_34.f900000664000175000017500000000102115141516316024405 0ustar alastairalastairprogram intrinsics_34 integer, parameter :: dp=kind(0d0) real :: x = 3.143 real(dp) :: y = 2.33 print *, epsilon(x) print *, epsilon(y) print *, epsilon(1._dp) ** 0.5 !Part of Minpack ! Below numbers are corresponding output of gfortran and not magic numbers. if (abs(epsilon(x) - 1.19209290E-07) > 1e-7) error stop if (abs(epsilon(y) - 2.2204460492503131E-016_dp) > 1e-15_dp) error stop if (abs((epsilon(1._dp) ** 0.5_dp) - 1.4901161193847656E-008_dp) > 1e-15_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/external_03.f900000664000175000017500000000021515141516316024042 0ustar alastairalastair subroutine dfctr() external dmprec double precision dmprec return end subroutine program external_03 call dfctr() end program lfortran-lfortran-2f73434/integration_tests/arrays_44.f900000664000175000017500000000127615141516316023536 0ustar alastairalastairprogram arrays_44 integer, dimension(3, 3) :: x logical, dimension(3, 3) :: mask x = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], shape(x)) mask = reshape([.true., .false., .true., .false., .true., .false., .true., .false., .true.], shape(mask)) print *, median_mask_2_iint8_dp(x, 1, mask) if (abs(median_mask_2_iint8_dp(x, 1, mask) - 12.0) > 1e-8) error stop contains function median_mask_2_iint8_dp(x, dim, mask) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in) :: mask(:,:) real :: res integer :: j1 integer, allocatable :: x_tmp(:) do j1 = 1, size(x, 1) x_tmp = pack(x(j1, :), mask(j1, :)) end do res = sum(x_tmp) end function median_mask_2_iint8_dp end program lfortran-lfortran-2f73434/integration_tests/nullify_06.f900000664000175000017500000000023115141516316023703 0ustar alastairalastairprogram nullify_class type :: toml_table integer :: x end type class(toml_table), pointer :: temp nullify(temp) end program lfortran-lfortran-2f73434/integration_tests/complex_16.f900000664000175000017500000000035615141516316023701 0ustar alastairalastairprogram complex_16 implicit none complex :: x real :: y x % re = 1.2 print *, x x % im = -3.4 print *, x if (abs(x - (1.2, -3.4)) > 1e-6) error stop y = sign(12.38, x % im) print *, y if (abs(y - (-12.38)) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_08.f900000664000175000017500000000047215141516316026064 0ustar alastairalastairmodule implicit_interface_08_module implicit none contains function f() implicit double precision (f) f = 1.00 end function f end program main use implicit_interface_08_module double precision :: i i = f() if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/loop_unroll_large.f900000664000175000017500000000040015141516316025430 0ustar alastairalastairprogram loop_unroll_large implicit none integer :: i, first, last integer, allocatable :: array(:) allocate(array(35)) do i = 1, 35 array(i) = i end do do i = 1, 35 print *, array(i) end do end program lfortran-lfortran-2f73434/integration_tests/functions_40.f900000664000175000017500000000204515141516316024234 0ustar alastairalastairmodule mod1_functions_40_integers integer(4) :: n end module mod1_functions_40_integers module mod2_functions_40_interfaces interface subroutine some_routine(a) use mod1_functions_40_integers ! symbol present in dimension, hence in FunctionType ASR node real(8), dimension(n:,:) :: a end subroutine some_routine end interface end module mod2_functions_40_interfaces program functions_40 use mod2_functions_40_interfaces use mod1_functions_40_integers implicit none real(8), allocatable:: a(:,:) n = 42 allocate(a(n:n+1,2)) call some_routine(a) end program functions_40 subroutine some_routine(a) use mod1_functions_40_integers real(8), dimension(n:,:) :: a print *, "lbound(a, 1): ", lbound(a, 1) if (lbound(a, 1) /= 42) error stop print *, "lbound(a, 2): ", lbound(a, 2) if (lbound(a, 2) /= 1) error stop print *, "ubound(a, 1): ", ubound(a, 1) if (ubound(a, 1) /= 43) error stop print *, "ubound(a, 2): ", ubound(a, 2) if (ubound(a, 2) /= 2) error stop end subroutine some_routine lfortran-lfortran-2f73434/integration_tests/test_iso_c_binding_constants.f900000664000175000017500000000240715141516316027644 0ustar alastairalastairprogram test_iso_c_binding_constants use iso_c_binding print *, c_int8_t if (c_int8_t /= 1) error stop print *, c_int16_t if (c_int16_t /= 2) error stop print *, c_int32_t if (c_int32_t /= 4) error stop print *, c_int64_t if (c_int64_t /= 8) error stop print *, c_int if (c_int /= 4) error stop print *, c_short if (c_short /= 2) error stop print *, c_long if (c_long /= 8) error stop print *, c_long_long if (c_long_long /= 8) error stop print *, c_size_t if (c_size_t /= 8) error stop print *, c_float if (c_float /= 4) error stop print *, c_double if (c_double /= 8) error stop ! Currently unsupported ! print *, c_long_double ! if (c_long_double /= 10) error stop print *, c_float_complex if (c_float_complex /= 4) error stop print *, c_double_complex if (c_double_complex /= 8) error stop ! Currently unsupported ! print *, c_long_double_complex ! if (c_long_double_complex /= 10) error stop print *, c_bool if (c_bool /= 1) error stop print *, c_char if (c_char /= 1) error stop print *, c_null_char if (c_null_char /= char(0)) error stop print *, c_new_line if (c_new_line /= char(10)) error stop end program test_iso_c_binding_constants lfortran-lfortran-2f73434/integration_tests/derived_types_87.f900000664000175000017500000000161115141516316025103 0ustar alastairalastairmodule derived_types_87_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: compile_command_t type(string_t) :: directory type(string_t), allocatable :: str_arr(:) end type compile_command_t interface compile_command_t module procedure cct_new end interface compile_command_t contains type(compile_command_t) function cct_new(directory) result(cct) character(len=*), intent(in) :: directory end function end module derived_types_87_mod program derived_types_87 use derived_types_87_mod type(compile_command_t) :: cc cc = compile_command_t(directory = string_t("abc"), & str_arr = [string_t("def"), string_t("xyz")]) if (cc%str_arr(1)%s /= "def") error stop if (cc%str_arr(2)%s /= "xyz") error stop if (cc%directory%s /= "abc") error stop end programlfortran-lfortran-2f73434/integration_tests/implied_do_loops14.f900000664000175000017500000000115415141516316025407 0ustar alastairalastairprogram implied_do_loops14 implicit none character(:), allocatable :: tmp_line character(len=5) :: values(3) character(len=5) :: padded character(:), allocatable :: trimmed(:) integer :: i tmp_line = "Hello" values = [(tmp_line, i = 1, 3)] do i = 1, 3 if (values(i) /= "Hello") error stop 1 end do padded = "Hell " allocate(character(len=len(trim(padded))) :: trimmed(3)) trimmed = [(trim(padded), i = 1, 3)] do i = 1, 3 if (trimmed(i) /= "Hell") error stop 2 end do print *, (trim(padded), i = 1, 3) end program implied_do_loops14 lfortran-lfortran-2f73434/integration_tests/test_ieee_rem.f900000664000175000017500000000562015141516316024534 0ustar alastairalastair! Test ieee_rem function (IEEE remainder operation) program ieee_rem_01 use, intrinsic :: ieee_arithmetic, only: ieee_rem implicit none real(4) :: x_sp, y_sp, rem_sp real(8) :: x_dp, y_dp, rem_dp print *, "Testing ieee_rem..." ! Test 1: Basic remainder x_sp = 5.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(5.0, 3.0) =", rem_sp ! 5.0 = 2 * 3.0 - 1.0, so remainder is -1.0 (rounds to nearest) if (abs(rem_sp + 1.0) > 1e-6) error stop "ieee_rem(5.0, 3.0) should be -1.0" ! Test 2: Different from modulo ! modulo(5.0, 3.0) = 2.0, but ieee_rem(5.0, 3.0) = -1.0 print *, "modulo(5.0, 3.0) =", modulo(x_sp, y_sp) print *, "ieee_rem(5.0, 3.0) =", rem_sp if (abs(modulo(x_sp, y_sp) - rem_sp) < 1e-6) then error stop "ieee_rem should differ from modulo for this case" end if ! Test 3: When x = n*y exactly, remainder is 0 x_sp = 6.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(6.0, 3.0) =", rem_sp if (abs(rem_sp) > 1e-6) error stop "ieee_rem(6.0, 3.0) should be 0" ! Test 4: Negative dividend x_sp = -5.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(-5.0, 3.0) =", rem_sp ! -5.0 = -2 * 3.0 + 1.0, so remainder is 1.0 if (abs(rem_sp - 1.0) > 1e-6) error stop "ieee_rem(-5.0, 3.0) should be 1.0" ! Test 5: Small values x_sp = 0.5 y_sp = 0.3 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(0.5, 0.3) =", rem_sp ! 0.5 = 2 * 0.3 - 0.1, so remainder is -0.1 if (abs(rem_sp + 0.1) > 1e-5) error stop "ieee_rem(0.5, 0.3) should be approximately -0.1" ! Test 6: Double precision x_dp = 7.0d0 y_dp = 4.0d0 rem_dp = ieee_rem(x_dp, y_dp) print *, "ieee_rem(7.0d0, 4.0d0) =", rem_dp ! 7.0 = 2 * 4.0 - 1.0, so remainder is -1.0 if (abs(rem_dp + 1.0d0) > 1e-10) error stop "ieee_rem(7.0, 4.0) should be -1.0" ! Test 7: Remainder is always less than or equal to |y|/2 x_sp = 10.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(10.0, 3.0) =", rem_sp if (abs(rem_sp) > abs(y_sp) / 2.0 + 1e-6) then error stop "remainder should be <= |y|/2" end if ! Test 8: Symmetry test x_sp = 8.0 y_sp = 3.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(8.0, 3.0) =", rem_sp ! 8.0 = 3 * 3.0 - 1.0, so remainder is -1.0 if (abs(rem_sp + 1.0) > 1e-6) error stop "ieee_rem(8.0, 3.0) should be -1.0" ! Test 9: Compare with mod for exact multiples x_sp = 12.0 y_sp = 4.0 rem_sp = ieee_rem(x_sp, y_sp) print *, "ieee_rem(12.0, 4.0) =", rem_sp if (abs(rem_sp) > 1e-6) error stop "Should be zero for exact multiples" if (abs(rem_sp - mod(x_sp, y_sp)) > 1e-6) then error stop "Should match mod for exact multiples" end if print *, "All ieee_rem tests passed!" end program ieee_rem_01 lfortran-lfortran-2f73434/integration_tests/goto_02.f900000664000175000017500000000107115141516316023170 0ustar alastairalastairprogram goto2 implicit none integer :: A A = 0 1 continue write(*,*) A = A + 1 if (A.GT.2) go to 95 write(*,*) 'A =', A,' Starting' if (A.EQ.1) go to 10 go to 20 10 continue write(*,*) 'A =',A,' Got to 10' goto 30 20 continue write(*,*) 'A =',A,' Got to 20' 30 continue write(*,*) 'A =',A,' Got to 30' if (A.EQ.2) go to 99 goto 1 95 continue write(*,*) 'A =',A,' Got to 95' 99 continue write(*,*) 'A =',A,' Got to 99' stop ' ' end lfortran-lfortran-2f73434/integration_tests/subroutines_17.f900000664000175000017500000000074515141516316024617 0ustar alastairalastairprogram subroutines_17 implicit none call recursive_fun contains subroutine chrosen(x) real, intent(in) :: x(:) print *, "Hello from chrosen!", x end subroutine chrosen subroutine OBJ(x) real, intent(in) :: x(:) end subroutine OBJ subroutine lincoa(calfun) procedure(OBJ) :: calfun call calfun([1.0]) end subroutine lincoa subroutine recursive_fun call lincoa(chrosen) end subroutine recursive_fun end programlfortran-lfortran-2f73434/integration_tests/array_section_06.f900000664000175000017500000000026715141516316025074 0ustar alastairalastairprogram array_section_06 integer, allocatable :: arr(:, :) allocate(arr(2, 2)) arr = reshape([1, 2, 3, 4], [2, 2]) if (size(arr(4:2, 1)) /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_03_func_pass_arr_dims.f900000664000175000017500000000060115141516316027441 0ustar alastairalastairprogram arrays_03_func implicit none integer :: x(10), s, i do i = 1, size(x) x(i) = i end do s = mysum(size(x, dim=1), x) print *, s if (s /= 55) error stop contains integer function mysum(na1, a) result(r) integer, intent(in) :: na1 integer, intent(in) :: a(na1) integer :: i r = 0 do i = 1, size(a) r = r + a(i) end do end function end lfortran-lfortran-2f73434/integration_tests/procedure_22_a.f900000664000175000017500000000133115141516316024511 0ustar alastairalastairmodule procedure_22_mod_a implicit none type :: deps_t character(:), allocatable :: str contains procedure :: find_string => find_by_name generic :: find => find_string end type deps_t contains integer function find_by_name(self, name) class(deps_t), intent(in) :: self character(len=*), intent(in) :: name find_by_name = len_trim(name) end function find_by_name end module procedure_22_mod_a module procedure_22_mod_b use procedure_22_mod_a, only: deps_t contains function func(model) result(id) class(deps_t), intent(in) :: model integer :: id id = model%find(model%str) end function end module procedure_22_mod_blfortran-lfortran-2f73434/integration_tests/allocatable_polymorphic_mold_01.f900000664000175000017500000000250215141516316030122 0ustar alastairalastairmodule m_types implicit none type, abstract :: base_t contains procedure(load_i), deferred :: load end type base_t abstract interface subroutine load_i(self) import :: base_t class(base_t), intent(inout) :: self end subroutine load_i end interface type :: srcfile_t character(:), allocatable :: file_name end type srcfile_t type, extends(base_t) :: package_t type(srcfile_t), allocatable :: sources(:) contains procedure :: load => package_load end type package_t contains subroutine package_load(self) class(package_t), intent(inout) :: self if (allocated(self%sources)) deallocate(self%sources) allocate(self%sources(1)) self%sources(1)%file_name = 'file1.f90' end subroutine package_load end module m_types program allocatable_polymorphic_mold_01 use m_types implicit none type(package_t) :: pkg class(base_t), allocatable :: copy allocate(pkg%sources(1)) pkg%sources(1)%file_name = 'init' allocate(copy, mold=pkg) call copy%load() select type (copy) type is (package_t) if (.not. allocated(copy%sources)) error stop if (.not. allocated(copy%sources(1)%file_name)) error stop if (copy%sources(1)%file_name /= 'file1.f90') error stop class default error stop end select end program allocatable_polymorphic_mold_01 lfortran-lfortran-2f73434/integration_tests/bindc_02c.h0000664000175000017500000000042715141516316023277 0ustar alastairalastair#ifndef BINDC_02C #define BINDC_02C void driver(); void print_ptr1(int n, float *A); void print_ptr2(int *n, float *A); void callback1(int n, float *A); void callback1b(int n, float *A); void callback2(int *n, float *A); void callback2b(int *n, float *A); #endif // BINDC_02C lfortran-lfortran-2f73434/integration_tests/entry_11.f900000664000175000017500000000050315141516316023360 0ustar alastairalastairsubroutine dzror() implicit none double precision zxlo double precision xxlo save print *, 'xxlo = ', xxlo if (abs(xxlo - 1.93D0) > 1d-10) error stop return entry dstzr(zxlo) xxlo = zxlo return end subroutine program entry_11 implicit none double precision :: zxlo zxlo = 1.93D0 call dstzr(zxlo) call dzror() end program lfortran-lfortran-2f73434/integration_tests/modules_34.f900000664000175000017500000000032415141516316023675 0ustar alastairalastairmodule fpm_cmd_install_modules_34 use fpm_modules_34, only : build_model implicit none end module fpm_cmd_install_modules_34 program modules_34 implicit none print *, "running modules_34 program" end program lfortran-lfortran-2f73434/integration_tests/test_rep.f900000664000175000017500000000077415141516316023555 0ustar alastairalastairmodule rep_test_mod implicit none contains subroutine f() character(len=:), allocatable :: x, y, z x = "Hello" z = "Aa1" y = _lfortran_rep(x, 3) if ( y /= "HelloHelloHello" ) error stop y = _lfortran_rep(z, 5) if ( y /= "Aa1Aa1Aa1Aa1Aa1" ) error stop ! TODO: Handle negative numbers ! y = _lfortran_rep(z, -1) end subroutine end module program main use rep_test_mod implicit none call f() end program lfortran-lfortran-2f73434/integration_tests/arrays_50_mod.f900000664000175000017500000000120615141516316024363 0ustar alastairalastairmodule arrays_50_mod_b integer ::j=20 integer ::j2=30 end module arrays_50_mod_b module arrays_50_mod_a contains subroutine fdf() use arrays_50_mod_b integer :: o(j,j2) print *,j,j2 if (j /= 20) error stop if (j2 /= 30) error stop print *, size(o) if (size(o) /= 600) error stop end subroutine fdf end module arrays_50_mod_a lfortran-lfortran-2f73434/integration_tests/intrinsics_189.f900000664000175000017500000000364515141516316024516 0ustar alastairalastairprogram intrinsics_189 character(7) :: fortran = "FORTRAN" character(2) :: ao = "AO" character(3) :: c_plus_plus = "C++" integer, parameter :: i1 = scan("FORTRAN", "AO") integer, parameter :: i2 = scan("FORTRAN", "AO", kind = 4) integer, parameter :: i3 = scan("FORTRAN", "AO", .TRUE., 8) integer, parameter :: i4 = scan("FORTRAN", "C++") integer, parameter :: ar1(2) = scan(["LFORTRAN", "GFORTRAN"], ["AO", "AO"]) integer, parameter :: ar2(2) = scan(["LFORTRAN", "GFORTRAN"], ["LO", "TR"], kind = 4) character(8) :: arr1(2) character(2) :: arr2(2) character(4) :: arr3(3) character(2) :: arr4(3) arr1 = ["LFORTRAN", "GFORTRAN"] arr2 = ["AO", "AO"] arr3 = ["LFOR", "TRAN", "GFOR"] arr4 = ["LO", "TR", "AN"] print*, i1 if (i1 /= 2) error stop print*, i2 if (i2 /= 2) error stop print*, i3 if (i3 /= 6_8) error stop print*, i4 if (i4 /= 0) error stop print*, ar1 if (any(ar1 /= [3, 3])) error stop print*, ar2 if (any(ar2 /= [1, 4])) error stop print*, scan("FORTRAN", "AO", kind = 4) if (scan("fortran", "ao", kind = 4) /= 2) error stop print*, scan("FORTRAN", "AO", .TRUE., 8) if (scan("fortran", "ao", .true., 8) /= 6_8) error stop print*, scan("FORTRAN", "C++") if (scan("fortran", "c_plus_plus") /= 0) error stop print*, scan(fortran, ao, kind = 4) if (scan(fortran, ao, kind = 4) /= 2) error stop print*, scan(fortran, ao, .TRUE., 8) if (scan(fortran, ao, .true., 8) /= 6_8) error stop print*, scan(fortran, c_plus_plus) if (scan(fortran, c_plus_plus) /= 0) error stop print*, scan(arr1, arr2) if (any(scan(arr1, arr2) /= [3, 3])) error stop print*, scan(arr1, arr2, kind = 4) if (any(scan(arr1, arr2, kind = 4) /= [3, 3])) error stop print*, scan(arr3, arr4) if (any(scan(arr3, arr4) /= [1, 1, 0])) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_96.f900000664000175000017500000000360715141516316025112 0ustar alastairalastairmodule derived_types_96_mod implicit none public :: string_t, operator(.in.) type :: string_t character(len=:), allocatable :: s end type string_t interface operator(.in.) module procedure string_in_array end interface contains logical function string_in_array(lhs, rhs) character(len=*), intent(in) :: lhs type(string_t), intent(in) :: rhs(:) integer :: i string_in_array = .false. do i = 1, size(rhs) if (trim(lhs) == trim(rhs(i)%s)) then string_in_array = .true. return end if end do end function string_in_array end module derived_types_96_mod program derived_types_96 use derived_types_96_mod, only: string_t, operator(.in.) implicit none type :: source_t type(string_t), allocatable :: modules_provided(:) type(string_t), allocatable :: modules_used(:) end type source_t type(source_t) :: source integer :: j logical :: check(3) check = .false. allocate(source%modules_provided(1)) source%modules_provided(1)%s = "stdlib" allocate(source%modules_used(2)) source%modules_used(1)%s = "stdlib" source%modules_used(2)%s = "iso_c_binding" do j = 1, size(source%modules_used) if (source%modules_used(j)%s .in. source%modules_provided) check(j) = .true. deallocate(source%modules_provided) allocate(source%modules_provided(0)) end do if (check(1) .neqv. .true. .or. check(2) .neqv. .false. .or. check(3) .neqv. .false.) error stop "Test failed" check = .false. do j = 1, size(source%modules_used) if (source%modules_used(j)%s .in. source%modules_provided) check(j) = .true. end do if (check(1) .neqv. .false. .or. check(2) .neqv. .false. .or. check(3) .neqv. .false.) error stop "Test failed" end program derived_types_96lfortran-lfortran-2f73434/integration_tests/run_tests.py0000775000175000017500000002041615141516316024006 0ustar alastairalastair#!/usr/bin/env python import argparse import subprocess as sp import os # Initialization NO_OF_THREADS = 8 # default no of threads is 8 SUPPORTED_BACKENDS = ['llvm', 'llvm2', 'llvm_rtlib', 'c', 'cpp', 'x86', 'wasm', 'gfortran', 'llvmImplicit', 'llvmStackArray', 'llvm_integer_8', 'fortran', 'c_nopragma', 'llvm_nopragma', 'llvm_wasm', 'llvm_wasm_emcc', 'llvm_omp', 'llvm_submodule', 'mlir', 'mlir_omp', 'mlir_llvm_omp', 'llvm_goc', 'target_offload', 'llvm_single_invocation'] SUPPORTED_STANDARDS = ['lf', 'f23', 'legacy'] BASE_DIR = os.path.dirname(os.path.realpath(__file__)) LFORTRAN_PATH = f"{BASE_DIR}/../src/bin:$PATH" fast_tests = "no" nofast_llvm16 = "no" separate_compilation = "no" use_ninja = False user_specified_threads = False def run_cmd(cmd, cwd=None): print(f"+ {cmd}") process = sp.run(cmd, shell=True, cwd=cwd) if process.returncode != 0: print("Command failed.") exit(1) def run_test(backend, std, test_pattern=None): run_cmd(f"mkdir {BASE_DIR}/test-{backend}") if std == "f23": std_string = "-DSTD_F23=yes" elif std == "legacy": std_string = "-DSTD_LEGACY=yes" elif std == "lf": std_string = "" else: raise Exception("Unsupported standard") cwd=f"{BASE_DIR}/test-{backend}" # Conditionally use Ninja or Make (default) if use_ninja: # Use Ninja generator for faster builds # Add flags to skip Fortran compiler detection issues with CMake 3.29+ # Set CMAKE_Fortran_PREPROCESS_SOURCE which is required by Ninja but missing for lfortran generator_flags = ("-G Ninja -DCMAKE_Fortran_COMPILER_WORKS=1 -DCMAKE_Fortran_COMPILER_FORCED=1 " "-DCMAKE_Fortran_PREPROCESS_SOURCE=\" " "-E -o \"") else: # Use default Make generator generator_flags = "" common=f" {generator_flags} -DCURRENT_BINARY_DIR={BASE_DIR}/test-{backend} -S {BASE_DIR} -B {BASE_DIR}/test-{backend}" if backend == "gfortran": run_cmd(f"FC=gfortran cmake" + common, cwd=cwd) elif backend == "cpp": run_cmd(f"FC=lfortran FFLAGS=\"--openmp\" cmake -DLFORTRAN_BACKEND={backend} -DFAST={fast_tests} " f"-DLLVM_GOC={separate_compilation} -DNOFAST_LLVM16={nofast_llvm16} {std_string}" + common, cwd=cwd) elif backend == "fortran": run_cmd(f"FC=lfortran cmake -DLFORTRAN_BACKEND={backend} " f"-DFAST={fast_tests} -DLLVM_GOC={separate_compilation} -DNOFAST_LLVM16={nofast_llvm16} " f"-DCMAKE_Fortran_FLAGS=\"-fPIC\" {std_string}" + common, cwd=cwd) else: run_cmd(f"FC=lfortran cmake -DLFORTRAN_BACKEND={backend} -DFAST={fast_tests} " f"-DLLVM_GOC={separate_compilation} {std_string} -DNOFAST_LLVM16={nofast_llvm16} " + common, cwd=cwd) # If a test pattern is provided, find matching tests and build only those if test_pattern: # Query ctest to find which tests match the pattern result = sp.run(f"ctest -N -R {test_pattern}", shell=True, cwd=cwd, stdout=sp.PIPE, stderr=sp.PIPE, text=True) if result.returncode != 0: print("Failed to query tests with ctest") exit(1) # Parse the output to extract test names # Output format: " Test #123: test_name" import re test_names = [] for line in result.stdout.split('\n'): match = re.match(r'\s+Test\s+#\d+:\s+(\S+)', line) if match: test_names.append(match.group(1)) if not test_names: print(f"No tests match pattern: {test_pattern}") exit(1) print(f"Building {len(test_names)} test(s): {', '.join(test_names)}") # Build only the matching test targets build_cmd = "ninja" if use_ninja else "make" # Ninja uses all cores by default, so only specify -j if user provided it # Make needs -j specified, so use default or user-provided value if use_ninja and not user_specified_threads: # User didn't specify -j, let ninja use all cores j_flag = "" else: j_flag = f" -j{NO_OF_THREADS}" for test_name in test_names: run_cmd(f"{build_cmd}{j_flag} {test_name}", cwd=cwd) else: # Build all tests build_cmd = "ninja" if use_ninja else "make" if use_ninja and not user_specified_threads: j_flag = "" else: j_flag = f" -j{NO_OF_THREADS}" run_cmd(f"{build_cmd}{j_flag}", cwd=cwd) # Build ctest command with optional test pattern filter ctest_cmd = f"ctest -j{NO_OF_THREADS} --output-on-failure" if test_pattern: ctest_cmd += f" -R {test_pattern}" run_cmd(ctest_cmd, cwd=cwd) def test_backend(backend, std, test_pattern=None): if backend not in SUPPORTED_BACKENDS: raise Exception(f"Unsupported Backend: {backend}\n") if std not in SUPPORTED_STANDARDS: raise Exception(f"Unsupported Backend: {std}\n") run_test(backend, std, test_pattern) def check_module_names(): from glob import glob import re mod = re.compile(r"(module|MODULE)[ ]+(.*)", re.IGNORECASE) files = glob("*.f90") module_names = [] file_names = [] for file in files: f = open(file).read() s = mod.search(f) if s: module_names.append(s.group(2).lower()) file_names.append(file) for i in range(len(module_names)): name = module_names[i] if name in module_names[i+1:]: print("FAIL: Found a duplicate module name") print("Name:", name) print("Filename:", file_names[i]) raise Exception("Duplicate module names") print("OK: All module names are unique") def get_args(): parser = argparse.ArgumentParser(description="LFortran Integration Test Suite") parser.add_argument("-j", "-n", "--no_of_threads", type=int, help="Parallel testing on given number of threads") parser.add_argument("-b", "--backends", nargs="*", default=["llvm"], type=str, help="Test the requested backends (%s)" % \ ", ".join(SUPPORTED_BACKENDS)) parser.add_argument("--std", type=str, default="lf", help="Run tests with the requested Fortran standard: ".join(SUPPORTED_STANDARDS)) parser.add_argument("-f", "--fast", action='store_true', help="Run supported tests with --fast") parser.add_argument("-sc", "--separate_compilation", action='store_true', help="Run tests with --separate-compilation") parser.add_argument("-nf16", "--no_fast_till_llvm16", action='store_true', help="Don't run unsupported tests with --fast when LLVM < 17") parser.add_argument("-t", "--test", type=str, help="Run specific tests matching pattern (regex)") parser.add_argument("--ninja", action='store_true', help="Use Ninja build system instead of Make (faster builds)") parser.add_argument("-m", action='store_true', help="Check that all module names are unique") return parser.parse_args() def main(): args = get_args() if args.m: check_module_names() return # Setup global NO_OF_THREADS, fast_tests, std_f23_tests, nofast_llvm16, separate_compilation, use_ninja, user_specified_threads os.environ["PATH"] += os.pathsep + LFORTRAN_PATH # Set environment variable for testing os.environ["LFORTRAN_TEST_ENV_VAR"] = "STATUS OK!" # delete previously created directories (if any) for backend in SUPPORTED_BACKENDS: run_cmd(f"rm -rf {BASE_DIR}/test-{backend}") if args.no_of_threads: NO_OF_THREADS = args.no_of_threads user_specified_threads = True fast_tests = "yes" if args.fast else "no" nofast_llvm16 = "yes" if args.no_fast_till_llvm16 else "no" separate_compilation = "yes" if args.separate_compilation else "no" use_ninja = args.ninja test_pattern = args.test for backend in args.backends: test_backend(backend, args.std, test_pattern) if __name__ == "__main__": main() lfortran-lfortran-2f73434/integration_tests/data_04.f900000664000175000017500000000061415141516316023135 0ustar alastairalastairprogram data_04 integer, parameter :: dp = kind(0.d0) double precision dmach(3) data dmach(1) /2.22044604926d-16/ data dmach(2) /2.22507385852d-308/ data dmach(3) /1.79769313485d+308/ print *, dmach if (abs(dmach(1) - 2.22044604926d-16) > 1e-15_dp) error stop if (abs(dmach(2) - 2.22507385852d-308) > 1e-15_dp) error stop if (abs(dmach(3) - 1.79769313485d+308) > 1e-15_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/array_07_transfer.f900000664000175000017500000000114315141516316025247 0ustar alastairalastairprogram array_07_transfer use, intrinsic :: iso_fortran_env, only: int32, int64, real32, int8 integer(int8) :: key(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] integer(int64) :: map_to_6 map_to_6 = transfer( [ key(1), 0_int8, 0_int8, 0_int8, & 0_int8, 0_int8, 0_int8, 0_int8 ], & 0_int64 ) print *, map_to_6 if (map_to_6 /= 1) error stop map_to_6 = transfer( [ key(1:4), 0_int8, 0_int8, 0_int8, 0_int8], & 0_int64 ) print *, map_to_6 if (map_to_6 /= 67305985) error stop end program array_07_transferlfortran-lfortran-2f73434/integration_tests/intrinsics_279.f900000664000175000017500000001164315141516316024513 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = sinh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = sinh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.67032718570509986_dp, -0.54062957805332923_dp, -0.29676393202885426_dp, & 0.67032718570509986_dp, 0.54062957805332923_dp, 0.29676393202885426_dp, 1.1752011936438014_dp, & 0.92776536742907800_dp, 1.1035252521116077_dp, -0.24398425438275537_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.670327127_sp, -0.540629566_sp, -0.296763927_sp, & 0.670327127_sp, 0.540629566_sp, 0.296763927_sp, 1.17520118_sp, & 0.927765369_sp, 1.10352528_sp, -0.243984252_sp] res_x = sinh(arg_x) res_y = sinh(arg_y) expected_res_x = [-0.73266631321193876_dp, -0.57081556675017531_dp, -0.30129740109954350_dp, & 0.73266631321691944_dp, 0.57081556675017531_dp, 0.30129740109954350_dp, 0.60230022788767801_dp, & 7.8045284675324761E-002_dp, 0.26506264089844722_dp, -0.24647097427195003_dp, -0.79423833474419503_dp, & 0.60230022788767801_dp, 7.8045284675324761E-002_dp, 0.26506264089844722_dp, -0.24647097427195003_dp] expected_res_y = [-0.732666254_sp, -0.570815504_sp, -0.301297396_sp, & 0.732666254_sp, 0.570815504_sp, 0.301297396_sp, 0.602300286_sp, & 7.80452639E-02_sp, 0.265062600_sp, -0.246470988_sp, -0.794238329_sp, & 0.602300286_sp, 7.80452639E-02_sp, 0.265062600_sp, -0.246470988_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, sinh(a) if (abs(sinh(a)) - 0.54127126592762664_dp > 1e-12) error stop print *, sinh(0.5178181202_dp) if (abs(sinh(0.5178181202_dp) - 0.54127126592762664_dp) > 1e-12) error stop print *, sinh(b) if (sinh(b) - (-7.28803650E-02_sp) > 1e-5) error stop print *, sinh(-0.072816_sp) if (sinh(-0.072816_sp) - (-7.28803650E-02_sp) > 1e-5) error stop print *, sinh(c) if (sinh(c) - (-0.54127126592762664_dp) > 1e-12) error stop print *, sinh(-0.5178181202_dp) if (sinh(-0.5178181202_dp) - (-0.54127126592762664_dp) > 1e-12) error stop print *, sinh(d) if (sinh(d) - (7.28803650E-02_sp) > 1e-5) error stop print *, sinh(0.072816_sp) if (sinh(0.072816_sp) - (7.28803650E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, sinh(a) if (abs(sinh(a) - (-0.27529095556357069_dp)) > 1e-12) error stop print *, sinh(-0.271927291_dp) if (abs(sinh(-0.271927291_dp) - (-0.27529095556357069_dp)) > 1e-12) error stop print *, sinh(b) if (sinh(b) - (-0.682502091_sp) > 1e-5) error stop print *, sinh(-0.6382728_sp) if (sinh(-0.6382728_sp) - (-0.682502091_sp) > 1e-5) error stop print *, sinh(c) if (sinh(c) - (0.27529095556357069_dp) > 1e-12) error stop print *, sinh(0.271927291_dp) if (sinh(0.271927291_dp) - (0.27529095556357069_dp) > 1e-12) error stop print *, sinh(d) if (sinh(d) - (.682502091_sp) > 1e-5) error stop print *, sinh(0.6382728_sp) if (sinh(0.6382728_sp) - (.682502091_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_159.f900000664000175000017500000000410215141516316024500 0ustar alastairalastairprogram intrinsics_159 use iso_fortran_env, only: dp=>real64, sp=>real32 complex(sp) :: x(2, 3) complex(sp) :: y(3, 2) complex(sp) :: res(2, 2) complex(dp) :: x_dp(2, 3) complex(dp) :: y_dp(3, 2) complex(dp) :: res_dp(2, 2) complex(sp) :: x_(5) complex(sp) :: y_(5, 1) complex(sp) :: res_(1) complex(sp) :: a(1, 5) complex(sp) :: b(5, 1) complex(sp) :: c(1, 1) complex(sp) :: e(4, 4) complex(sp) :: f(4, 4) real :: g(2, 3) real :: h(3, 2) integer :: l(2, 3) integer :: m(3, 2) integer :: i complex(sp) :: num num = (1.0, 2.0) x = reshape([num, num, num, num, num, num], [2, 3]) y = transpose(x) res = matmul( x, y) print *, abs(sum(res)) if (abs(abs(sum(res)) - 60.0) > 1e-8) error stop x_dp = reshape([ (i, i = 1, 6) ], [2, 3]) y_dp = transpose(x_dp) res_dp = matmul( x_dp, y_dp ) print *, abs(sum(res_dp)) if (abs(abs(sum(res_dp)) - 179.0_dp) > 1e-12_dp) error stop x_ = [(i, i = 1, 5)] y_ = reshape([ (i, i = 1, 5) ], [5, 1]) res_ = matmul( x_, y_) print *, abs(sum(res_)) if (abs(abs(sum(res_)) - 55.0) > 1e-8) error stop a = reshape([ (i, i = 1, 5) ], [1, 5]) b = reshape([ (i, i = 1, 5) ], [5, 1]) c = matmul( a, b ) print *, abs(sum(c)) if (abs(abs(sum(c)) - 55.0) > 1e-8) error stop e = reshape([ (i, i = 1, 16) ], [4, 4]) f = matmul( e, e ) print *, abs(sum(f)) if (abs(abs(sum(f)) - 4944.0) > 1e-8) error stop g = reshape([ (i, i = 1, 6) ], [2, 3]) print *, abs(sum(matmul( g, y ))) if (abs(abs(sum(matmul( g, y ))) - 93.9148560) > 1e-8) error stop h = reshape([ (i, i = 1, 6) ], [3, 2]) print *, abs(sum(matmul( x, h ))) if (abs(abs(sum(matmul( x, h ))) - 93.9148560) > 1e-8) error stop l = 901 y = (12, -12) print *, abs(sum(matmul( l, y ))) if (abs(abs(sum(matmul( l, y ))) - 183485.719) > 1e-8) error stop m = -158 x = (10, -15) print *, abs(sum(matmul( x, m ))) if (abs(abs(sum(matmul( x, m ))) - 34180.6250) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/template_semiring.f900000664000175000017500000000041315141516316025426 0ustar alastairalastairmodule semiring_m use monoid_m, only: monoid implicit none private public :: semiring requirement semiring(T, plus, zero, mult, one) require :: monoid(T, plus, zero) require :: monoid(T, mult, one) end requirement end module lfortran-lfortran-2f73434/integration_tests/modules_28_module2.f900000664000175000017500000000206715141516316025335 0ustar alastairalastairmodule fpm_manifest_dependency use fpm_git, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency lfortran-lfortran-2f73434/integration_tests/save_08.f900000664000175000017500000000050715141516316023167 0ustar alastairalastairprogram save_08 call sub(1) call sub(2) call sub(3) contains subroutine sub(i) integer :: x(5) integer, intent(in) :: i save if (i == 1) then x = 1 else if ( i == 2) then print *, x if (any(x /= 1)) error stop x = x + 1 else print *, x if (any(x /= 2)) error stop end if end subroutine end program lfortran-lfortran-2f73434/integration_tests/namelist_27.f900000664000175000017500000000160315141516316024044 0ustar alastairalastairprogram namelist_27 ! Test for handling triple-quoted strings (doubled quotes within strings) implicit none character(len=128) :: args namelist /expected/ args character(len=256) :: readme(3) args = '' readme(1) = '&EXPECTED' readme(2) = ' ARGS="""arg1"" ""-x"" ""and a long one"""' readme(3) = ' /' read(readme, nml=expected) print *, 'OK:', trim(args) if (trim(args) /= '"arg1" "-x" "and a long one"') then error stop 'Incorrect ARGS value read' end if ! Test with single quotes args = '' readme(1) = '&EXPECTED' readme(2) = " ARGS='''arg1'' ''-x'' ''and a long one'''" readme(3) = ' /' read(readme, nml=expected) print *, 'OK:', trim(args) if (trim(args) /= "'arg1' '-x' 'and a long one'") then error stop 'Incorrect ARGS value read with single quotes' end if end program namelist_27 lfortran-lfortran-2f73434/integration_tests/arrayprint_01.f900000664000175000017500000000017315141516316024414 0ustar alastairalastairprogram arrayprint_01 real :: x(3) integer :: i = 3 do i=1,3 x(i) = i end do print*, x end programlfortran-lfortran-2f73434/integration_tests/namelist_13.f900000664000175000017500000000175715141516316024051 0ustar alastairalastairprogram test_module_namelist use config_module implicit none ! Write module namelist to file open(10, file='config.dat', status='replace', form='formatted') write(10, nml=config) close(10) ! Modify values param1 = 0 param2 = 0 tolerance = 0.0 ! Read from file open(10, file='config.dat', status='old', form='formatted') read(10, nml=config) close(10) ! Verify if (param1 /= 10) then print *, "Error: param1 =", param1, "expected 10" error stop "Module namelist test failed for param1" end if if (param2 /= 20) then print *, "Error: param2 =", param2, "expected 20" error stop "Module namelist test failed for param2" end if if (abs(tolerance - 1.0e-6) > 1.0e-10) then print *, "Error: tolerance =", tolerance, "expected 1.0e-6" error stop "Module namelist test failed for tolerance" end if print *, "Module namelist test passed!" end program test_module_namelist lfortran-lfortran-2f73434/integration_tests/derived_types_82.f900000664000175000017500000000120015141516316025070 0ustar alastairalastairmodule m_diagnostic implicit none type :: toml_diagnostic integer, allocatable :: label(:) end type toml_diagnostic type :: toml_parser type(toml_diagnostic), allocatable :: diagnostic(:) end type toml_parser end module m_diagnostic program test_diag use m_diagnostic implicit none type(toml_parser), allocatable :: pars, pars2 allocate(pars) allocate(pars2) allocate(pars%diagnostic(1)) pars%diagnostic(1) = toml_diagnostic([1,2,3]) pars2 = pars pars2%diagnostic(1)%label = [4,5,6] if (any(pars%diagnostic(1)%label /= [1,2,3])) error stop end program test_diaglfortran-lfortran-2f73434/integration_tests/separate_compilation_22.f900000664000175000017500000000027015141516316026424 0ustar alastairalastairprogram separate_compilation_22 use math_separate_compilation_22 implicit none integer :: n = 2 call logspace(n) print *, n if (n /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/declaration_01.f900000664000175000017500000000137315141516316024511 0ustar alastairalastairprogram declaration_01 implicit none integer, parameter :: xi = 2 real, parameter :: xr = 2.0 ! real array initialized with integer constant value real, parameter :: x_real_3(3) = xi ! complex array initialized with integer constant value complex, parameter :: x_cmplx_3(3) = xi ! integer array initialized with real constant value integer, parameter :: x_int_3(3) = xr real :: y(2) = real([2, 3]) print *, x_real_3 if (any(x_real_3 /= xi)) error stop print *, x_cmplx_3 if (any(x_cmplx_3 /= (xi, 0))) error stop print *, x_int_3 if (any(x_int_3 /= xr)) error stop print *, y if (abs(y(1) - 2.0) > 1e-7) error stop if (abs(y(2) - 3.0) > 1e-7) error stop end program declaration_01 lfortran-lfortran-2f73434/integration_tests/class_63_module_1.f900000664000175000017500000000012715141516316025122 0ustar alastairalastairmodule class_63_module_1 type, abstract :: AbsType end type AbsType end module lfortran-lfortran-2f73434/integration_tests/arrays_op_24.f900000664000175000017500000000144315141516316024226 0ustar alastairalastairprogram arrays_op_24 implicit none real :: array(10, 10), output(10, 10) array = 3.0 call prg(array, output) print *, output if( any(abs(output - 8.52982235) > 1e-6) ) error stop contains subroutine prg(arr, otpt) real, intent(in) :: arr(:, :) real, intent(out) :: otpt(:, :) otpt(:, :) = attention(10, 10, 10, arr) end subroutine function attention(l, n, m, mask) result(y) integer, intent(in) :: l, n, m real, intent(in) :: mask(n, m) real :: y(l, m) real :: tmp(n, m) tmp = 4.0 call copy_array(twice(tmp / sqrt(real(l, 4)) + mask), y) end function function twice(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) y = 2*x end function subroutine copy_array(src, dest) real, intent(in) :: src(:, :) real, intent(out) :: dest(:, :) dest = src end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_op_26.f900000664000175000017500000000106715141516316024232 0ustar alastairalastairprogram arrays_op_26 implicit none type t real, pointer :: x(:) real, pointer :: y(:) end type t real, target :: X(5), Y(5) type(t) :: t_1 t_1%x => X t_1%y => Y call sub(t_1) print '(f10.2)', X if( any(X /= 2679.00) ) error stop contains subroutine sub(t_1) type(t), intent(inout) :: t_1 real, dimension(size(t_1%x)) :: S integer :: i S = 5 t_1%x = 54 t_1%y = 21 do i = 1, size(t_1%y) t_1%x = t_1%x + t_1%y(i) * S**2 end do end subroutine sub end program arrays_op_26 lfortran-lfortran-2f73434/integration_tests/c_ptr_02.f900000664000175000017500000000071415141516316023332 0ustar alastairalastairprogram test_c_ptr_02 use iso_c_binding implicit none complex, target :: c_arr(2) real, pointer :: r_ptr(:) type :: test_obj type(c_ptr) :: ptr = c_NULL_ptr end type test_obj type(test_obj) :: instance type(c_ptr) :: temp_ptr temp_ptr = instance%ptr c_arr = (1, 2) call c_f_pointer(c_loc(c_arr), r_ptr, shape=[4]) print *, c_arr print *, r_ptr if (c_associated(temp_ptr) .neqv. .false.) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_404.f900000664000175000017500000000027115141516316024474 0ustar alastairalastairprogram intrinsics_401 use iso_fortran_env, only: logical8 implicit none logical(kind=logical8) :: x x = .true. if (.not. x) error stop end program intrinsics_401 lfortran-lfortran-2f73434/integration_tests/interface_15.f900000664000175000017500000000133615141516316024170 0ustar alastairalastairmodule interface_15_mod implicit none type t integer :: x end type t end module interface_15_mod program interface_15 use interface_15_mod implicit none integer :: x(2) x = [5, 4] print *, func(x) if (func(x) /= 9) error stop contains function func(i) result(output) integer, intent(in) :: i(:) real :: output type(t) :: type interface function R(j, s) use interface_15_mod implicit none integer, intent(in) :: j(:) type(t), intent(inout) :: s real :: R end function end interface output = i(1) + i(2) end function func end program lfortran-lfortran-2f73434/integration_tests/array_section_is_non_allocatable.f900000664000175000017500000000116715141516316030457 0ustar alastairalastairPROGRAM array_section_is_non_allocatable IMPLICIT NONE REAL, ALLOCATABLE, DIMENSION(:, :) :: fixup_counter INTEGER, PARAMETER :: x = 1 allocate( fixup_counter(4, 2) ) fixup_counter = 19.45 CALL dim1_sweep ( fixup_counter (:, 1) ) CONTAINS SUBROUTINE dim1_sweep ( fixup_counter ) REAL, DIMENSION(4), INTENT(INOUT) :: fixup_counter PRINT *, SIZE(fixup_counter) if (size(fixup_counter) /= 4) error stop print *, sum(fixup_counter) if (abs(sum(fixup_counter) - 77.8) > 1e-8) error stop END SUBROUTINE dim1_sweep END PROGRAM array_section_is_non_allocatable lfortran-lfortran-2f73434/integration_tests/common_25.f900000664000175000017500000000100315141516316023510 0ustar alastairalastair! Test COMMON block sharing between host and contained procedures program common_25 implicit none integer :: val1, val2 common /testblock/ val1, val2 val1 = 42 val2 = 100 call modify_common() if (val1 /= 99) error stop if (val2 /= 200) error stop contains subroutine modify_common() integer :: v1, v2 common /testblock/ v1, v2 if (v1 /= 42) error stop if (v2 /= 100) error stop v1 = 99 v2 = 200 end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_04_size.f900000664000175000017500000000233615141516316024562 0ustar alastairalastair! This test checks for handling different arrays sizes kind correctly with no runtime errors. PROGRAM arrays_04_size IMPLICIT NONE INTEGER(1) :: nang1 = 127 INTEGER(2) :: nang2 = 32767 INTEGER(4) :: nang4 = 2147483647 INTEGER(8) :: nang8 = 9223372036854775807_8 CALL my_subroutine CONTAINS SUBROUTINE my_subroutine INTEGER, DIMENSION(nang1) :: fxhv1 INTEGER, DIMENSION(nang2) :: fxhv2 INTEGER, DIMENSION(nang4) :: fxhv4 INTEGER, DIMENSION(nang8) :: fxhv8 print *, size(fxhv1, kind = 1) print *, size(fxhv1, kind = 2) print *, size(fxhv1, kind = 4) print *, size(fxhv1, kind = 8) print *, size(fxhv2, kind = 1) print *, size(fxhv2, kind = 2) print *, size(fxhv2, kind = 4) print *, size(fxhv2, kind = 8) print *, size(fxhv4, kind = 1) print *, size(fxhv4, kind = 2) print *, size(fxhv4, kind = 4) print *, size(fxhv4, kind = 8) print *, size(fxhv8, kind = 1) print *, size(fxhv8, kind = 2) print *, size(fxhv8, kind = 4) print *, size(fxhv8, kind = 8) END SUBROUTINE my_subroutine END PROGRAM arrays_04_size lfortran-lfortran-2f73434/integration_tests/intent_02.f900000664000175000017500000000135415141516316023525 0ustar alastairalastairmodule intent_02_mod type tt character(:), allocatable :: ssss end type tt contains subroutine sub1(str_tt) type(tt), intent(out) :: str_tt print *,allocated(str_tt%ssss) if(allocated(str_tt%ssss) .neqv. .false.) error stop end subroutine subroutine sub2(str) character(:), allocatable, intent(out) :: str print *, allocated(str) if(allocated(str) .neqv. .false.) error stop end subroutine end module program intent_02 use intent_02_mod type(tt) :: s1 character(:), allocatable :: allocatable_str allocate(character(10) :: allocatable_str) allocate( character(10) :: s1%ssss) call sub1(s1) call sub2(allocatable_str) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_83.f900000664000175000017500000000030515141516316024415 0ustar alastairalastairprogram intrinsics_83 implicit none complex(kind=kind(1.0D0)) :: val val = (1.0, -3.0) print *, val if (abs(val - (1.0, -3.0)) > 1e-5) error stop end program intrinsics_83 lfortran-lfortran-2f73434/integration_tests/allocate_19.f900000664000175000017500000000065515141516316024023 0ustar alastairalastairprogram allocate_19 integer, allocatable :: a(:), b(:), c(:), d(:) a = [1, 2, 3, 4, 5, 6] allocate(b(6), source = a) print *, b print *, size(b) if( any( b /= [1, 2, 3, 4, 5, 6] ) ) error stop if( size(b) /= 6 ) error stop c = [6, 5, 4] allocate(d(3), source = c) print *, d print *, size(d) if( any( d /= [6, 5, 4] ) ) error stop if( size(d) /= 3 ) error stop end program lfortran-lfortran-2f73434/integration_tests/inquire_09.f900000664000175000017500000000136115141516316023705 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4640 ! Inquire iolength with different type kinds ! Exact MRE from issue body program inquire_09 use iso_fortran_env, only: int8, int16, int32, int64, real32, real64 implicit none integer :: i, len(6) = -huge(1) inquire(iolength=len(1)) 42_int8 inquire(iolength=len(2)) 42_int16 inquire(iolength=len(3)) 42_int32 inquire(iolength=len(4)) 42_int64 inquire(iolength=len(5)) 4.2_real32 inquire(iolength=len(6)) 4.2_real64 print "(6(I0,1X))", len if (len(1) /= 1) error stop if (len(2) /= 2) error stop if (len(3) /= 4) error stop if (len(4) /= 8) error stop if (len(5) /= 4) error stop if (len(6) /= 8) error stop end program inquire_09 lfortran-lfortran-2f73434/integration_tests/openmp_72.f900000664000175000017500000000101515141516316023523 0ustar alastairalastair! Without Teams/Distribute constructs similar to openmp_71 program openmp_72 implicit none real, allocatable, dimension(:) :: a, b integer :: i allocate(a(10000000), b(10000000)) b=5 !$omp target map(tofrom:a, b) !$omp parallel do do i = 1, 10000000 a(i) = i + b(i)*340 end do !$omp end parallel do !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_72lfortran-lfortran-2f73434/integration_tests/passing_array_01.f900000664000175000017500000000465715141516316025076 0ustar alastairalastair! passing array as function arguments (with unknown size at compile time) ! Testing for both interfaces and functions MODULE passing_array_01_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface INTERFACE test_02_interface MODULE PROCEDURE test_02 END INTERFACE test_02_interface INTERFACE test_03_interface MODULE PROCEDURE test_03 END INTERFACE test_03_interface CONTAINS pure FUNCTION func() result (x) integer :: x x = 10 end FUNCTION func ! Array dimension is call to function FUNCTION test_01 (len,value) result(res) implicit none integer ,intent(in):: len INTEGER, DIMENSION(func()),intent(in) :: value integer:: res res = size(value) END FUNCTION test_01 ! Array dimension is Variable FUNCTION test_02 (len,value) result(res) implicit none integer ,intent(inout):: len INTEGER, DIMENSION(len),intent(in) :: value integer:: res res = size(value) END FUNCTION test_02 ! Array dimension is variable + function call + constant FUNCTION test_03 (len,value) result(res) implicit none integer ,intent(in):: len INTEGER, DIMENSION(len + func() + 10),intent(in) :: value integer:: res res = size(value) END FUNCTION test_03 SUBROUTINE test_entry implicit none INTEGER :: len INTEGER, DIMENSION(40) :: arr INTEGER :: i INTEGER :: ret len = 20 arr = [(i, i = 1, 40)] ! All calls would accept the passed array, ! because the passed array's length is greater than or equal to the expected length in the function ret = test_01_interface (len,arr) print * , ret if (ret /= 10) error stop ret = test_01 (len,arr) print * , ret if (ret /= 10) error stop ret = test_02_interface (len,arr) print * , ret if (ret /= 20) error stop ret = test_02 (len,arr) print * , ret if (ret /= 20) error stop ret = test_03_interface (len,arr) print * , ret if (ret /= 40) error stop ret = test_03 (len,arr) print * , ret if (ret /= 40) error stop END SUBROUTINE test_entry END MODULE passing_array_01_mod program passing_array_01 use passing_array_01_mod implicit none call test_entry end program passing_array_01 lfortran-lfortran-2f73434/integration_tests/nested_02.f900000664000175000017500000000037115141516316023504 0ustar alastairalastairmodule nested_02_a implicit none contains subroutine b() print *, "b()" call c() contains subroutine c() print *, 5 end subroutine c end subroutine b end module program nested_02 use nested_02_a, only: b implicit none call b() end lfortran-lfortran-2f73434/integration_tests/cond_04.f900000664000175000017500000000232415141516316023147 0ustar alastairalastairmodule cond_04_mod implicit none type :: Integer32Complex32Pair integer :: first complex :: second contains end type Integer32Complex32Pair interface operator(==) module procedure map_p_equal end interface operator(==) contains logical function map_p_equal(a, b) result(equal) type(Integer32Complex32Pair), target, intent(in) :: a type(Integer32Complex32Pair), target, intent(in) :: b equal = (a%first == b%first) .and. (a%second == b%second) end function map_p_equal end module cond_04_mod program cond_04 use cond_04_mod implicit none type(Integer32Complex32Pair), target :: p1, p2, p3 type(Integer32Complex32Pair), pointer :: ptr_p1 logical :: result ptr_p1 => p1 p1%first = 10 p1%second = (3.0, 4.0) p2%first = 10 p2%second = (3.0, 4.0) p3%first = 20 p3%second = (3.0, 4.0) result = (ptr_p1 == p2) print *, "result: ", result if (.not. result) error stop result = (p2 == ptr_p1) print *, "result: ", result if (.not. result) error stop result = (ptr_p1 == p3) print *, "result: ", result if (result) error stop result = (p3 == ptr_p1) print *, "result: ", result if (result) error stop end program cond_04 lfortran-lfortran-2f73434/integration_tests/dict_test_04_.f900000664000175000017500000000633515141516316024353 0ustar alastairalastairmodule dict_test_04_mod implicit none contains subroutine test_dict() _lfortran_dict(_lfortran_tuple(integer, integer), integer(8)):: terms2poly _lfortran_dict(_lfortran_tuple(integer(8), integer(8)), _lfortran_tuple(real, real)):: rtheta2coords integer:: i, size, size1 integer(8):: n real:: theta, r, eps, pi _lfortran_tuple(real, real):: coords eps = 1e-3 pi = 3.1415 size = 7000 n = int(0, kind=8) do i = 1000, 1000+size-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * sin(theta), r * cos(theta))) n = n + int(1, kind=8) end do size1 = size/7 n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 if (_lfortran_pop(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int(i + i*i, kind=8)) error stop theta = real(n) * pi r = real(i) coords = _lfortran_pop(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n)) if ( abs(_lfortran_get_item(coords, 0) - r*sin(theta)) > eps ) error stop if ( abs(_lfortran_get_item(coords, 1) - r*cos(theta)) > eps ) error stop size1 = size1 - 1 if ( _lfortran_len(terms2poly) /= size1 ) error stop n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(1+ 2*i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * cos(theta), r * sin(theta))) n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size/2-1, 7 if (_lfortran_get_item(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int(1 + 2*i + i*i, kind=8)) error stop theta = real(n) * pi r = real(i) coords = _lfortran_pop(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n)) if ( abs(_lfortran_get_item(coords, 0) - r*cos(theta)) > eps ) error stop if ( abs(_lfortran_get_item(coords, 1) - r*sin(theta)) > eps ) error stop n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size-1, 7 call _lfortran_set_item(terms2poly, _lfortran_tuple_constant(i, i*i), int(1+ 2*i + i*i, kind=8)) theta = real(n) * pi r = real(i) call _lfortran_set_item(rtheta2coords, _lfortran_tuple_constant(int(i, kind=8), n), & _lfortran_tuple_constant(r * cos(theta), r * sin(theta))) n = n + int(1, kind=8) end do n = int(0, kind=8) do i = 1000, 1000+size-1, 7 if (_lfortran_get_item(terms2poly, _lfortran_tuple_constant(i, i*i)) /= int((1 + i)*(1 + i), kind=8)) error stop theta = real(n) * pi r = real(i) n = n + int(1, kind=8) end do end subroutine end module program test_dict_main use dict_test_04_mod call test_dict() end program lfortran-lfortran-2f73434/integration_tests/sign_from_value.f900000664000175000017500000000220515141516316025076 0ustar alastairalastairprogram flip_sign implicit none real :: rxsp = 5.5, epsrsp = 1e-6 real(8) :: rxdp = 5.5, epsrdp = 1e-6 integer :: ixsp = 5, epsisp = 16 integer(8) :: ixdp = 5, epsidp = 16 integer :: a=2, b=-3, c real :: x=-2, y=-3, z, arr(5) rxsp = rxsp * sign(1._4, epsrsp) print *, rxsp if (abs(rxsp - 5.5) > epsrsp) error stop rxsp = rxsp * sign(1._4, -epsrsp) print *, rxsp if (abs(rxsp + 5.5) > epsrsp) error stop rxdp = rxdp * sign(1._8, epsrdp) print *, rxdp if (abs(rxdp - 5.5) > epsrdp) error stop ixsp = ixsp * sign(1_4, epsisp) print *, ixsp if (ixsp /= 5) error stop rxdp = rxdp * sign(1._8, -epsrdp) print *, rxdp if (abs(rxdp + 5.5) > epsrdp) error stop ixdp = ixdp * sign(1_8, epsidp) ! Test that we don't apply sign opt. on integers. print *, ixdp if (ixdp /= 5) error stop c = a*sign(1, b) ! Test that we don't apply sign opt. on integers. print *, c if(c /= -2) error stop arr = [1.0, 2.0, 3.0, 4.0, 5.0] z = arr(int(x*sign(1.0,y), 4)) ! Test nested `sign` expression print *, z if(z /= arr(2)) error stop end program lfortran-lfortran-2f73434/integration_tests/data_18.f900000664000175000017500000000040015141516316023133 0ustar alastairalastairprogram data_18 implicit none real :: array(5) integer, parameter :: nelems = 5 integer :: i DATA (array(i), i=1,5) /nelems*3.1415/ do i = 1, 5 if (abs(array(i) - 3.1415) > 1.0e-5) error stop end do end program data_18 lfortran-lfortran-2f73434/integration_tests/external_11.f900000664000175000017500000000044315141516316024044 0ustar alastairalastairsubroutine exabs() external zabs complex zresult zresult = zabs(1.0, -1.0) print *, abs(zresult) if ( abs(abs(zresult) - 1.41421354) > 1e-8 ) error stop end subroutine real function zabs (x, y) real x, y zabs = (x**2 + y**2)**0.5 end function program external_11 call exabs() end program lfortran-lfortran-2f73434/integration_tests/derived_types_84_module.f900000664000175000017500000000040215141516316026442 0ustar alastairalastairmodule derived_types_84_module implicit none type :: Person integer :: age end type Person contains subroutine get_age(p) type(Person), intent(inout) :: p p%age = 30 end subroutine get_age end module derived_types_84_module lfortran-lfortran-2f73434/integration_tests/select_type_14.f900000664000175000017500000000302015141516316024537 0ustar alastairalastairmodule select_type_14_module implicit none ! === Base and extensions === type :: base_t contains procedure :: describe_base procedure :: value_base end type base_t type, extends(base_t) :: child1_t integer :: a = 10 contains procedure :: describe_child1 procedure :: value_child1 end type child1_t contains ! === Base methods === subroutine describe_base(this) class(base_t), intent(in) :: this print *, "I am a base_t" end subroutine describe_base function value_base(this) result(x) class(base_t), intent(in) :: this integer :: x x = -1 end function value_base ! === Child methods === subroutine describe_child1(this) class(child1_t), intent(inout) :: this this%a = 20 end subroutine describe_child1 function value_child1(this) result(x) class(child1_t), intent(in) :: this integer :: x x = this%a end function value_child1 end module select_type_14_module program select_type_14 use select_type_14_module implicit none class(base_t), allocatable :: ptr type(child1_t) :: c allocate(child1_t :: ptr) select type(ptr) class is (child1_t) if (ptr%value_child1() /= 10) error stop call ptr%describe_child1() call ptr%describe_base() if (ptr%a /= 20) error stop if (ptr%value_base() /= -1) error stop class default error stop end select end program select_type_14 lfortran-lfortran-2f73434/integration_tests/intrinsics_408.f900000664000175000017500000000076615141516316024511 0ustar alastairalastairprogram intrinsics_408 use iso_fortran_env, only: real64 implicit none complex(real64) :: z real(real64) :: r ! This stresses abs(complex) lowering for very small magnitudes: ! naive hypot = sqrt(x*x + y*y) underflows to 0.0 for x=y=1e-200 (real64), ! while a scaled hypot algorithm must return a positive value. z = cmplx(1.0e-200_real64, 1.0e-200_real64, kind=real64) r = abs(z) if (r == 0.0_real64) error stop print *, "ok" end program intrinsics_408 lfortran-lfortran-2f73434/integration_tests/intrinsics_376.f900000664000175000017500000000110115141516316024475 0ustar alastairalastairmodule stdlib_logger_intrinsics_376 implicit none contains subroutine add_log_unit(stat ) integer, intent(out), optional :: stat call validate_unit() contains subroutine validate_unit() if ( present(stat) ) then stat = 5 end if end subroutine validate_unit end subroutine add_log_unit end module program intrinsics_376 use stdlib_logger_intrinsics_376 implicit none integer :: stat call add_log_unit(stat) print *, stat if (stat /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_49.f900000664000175000017500000000076715141516316024256 0ustar alastairalastairmodule functions_49_mod contains function foo (x) result(res) character(*) :: x character(10) :: res end function function ff(line,length) result(strout) character(len=*):: line integer :: length character(len=max(length, len(foo(line)))) :: strout end function end module program functions_49 use functions_49_mod integer :: x x = len(ff("hello",5)) print *, x if(x /= max(5, len(foo("hello")))) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_mul_test.f900000664000175000017500000000020515141516316025300 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x * 4.0 print *, x x = 2 * x print *, x x = (x * (0.0, 3.0)) print *, x end program lfortran-lfortran-2f73434/integration_tests/line_continuation_03.f900000664000175000017500000000241115141516316025741 0ustar alastairalastairprogram line_continuation_03 ! The same as line_continuation_02, but we do use & to split a token implicit none ! Here are the rules for & based on the § 6.3.2.4 ("Free form statement ! continuation") in Fortran 2018 standard. ! The & character in a comment has no effect ! The & character can be used to continue a line like this: integer & :: i ! If it is used between tokens, then one can, but does not have to put another & ! on the next line: integer & &:: k i = 5 print * & , i ! One can continue strings also by treating them as tokens: print *, "some string & &is continued" ! Unless the & is at the end of the line, it can be used as a regular ! character in a string: print *, "some string can contain & as a regular character & &is continued" print *, "Even here: && && <- there will be two &" ! One can put arbitrary comments and empty lines after & that will be skipped: print *, & i print *, & ! comment 1 ! comment 2 ! comment 3 i print *, & ! comment 1 ! comment 2 ! comment 3 &i ! In strings the comment cannot be after the first &, but it can be on ! subsequent lines: print *, "some string & ! comment 2 ! comment 3 &is continued" print *, '*t',& &'' !! call set_args ( \' & !! & \n end program lfortran-lfortran-2f73434/integration_tests/intrinsics_08.f900000664000175000017500000000032015141516316024407 0ustar alastairalastairprogram intrinsics_08 real, parameter :: x=tiny(1.0) real (kind = 8) :: b real (kind = 8), parameter :: y=tiny(b) real, parameter :: z=tiny([1.0, 2.0]) print*, x print*, y print*, z end program lfortran-lfortran-2f73434/integration_tests/arrays_48.f900000664000175000017500000000034115141516316023532 0ustar alastairalastairprogram arrays_48 implicit none integer :: cs(6) integer :: nx = 4 cs = [1, 2, 3, 4, 5, 6] call f(cs) contains subroutine f(x) integer, intent(in) :: x(nx) print *, x if(sum(x) /= 10) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/multi_file_member_access_01_mod.f900000664000175000017500000000067715141516316030072 0ustar alastairalastairmodule member_access_mod implicit none type :: string_buffer integer, private :: size = 0 integer, private :: arr(1) = 0 contains procedure :: number_of_elems end type string_buffer contains function number_of_elems(self) result(result) class(string_buffer), intent(in) :: self integer :: result result = self%size result = result + self%arr(1) end function number_of_elems end module member_access_mod lfortran-lfortran-2f73434/integration_tests/file_11.f900000664000175000017500000000152015141516316023136 0ustar alastairalastairprogram file_11 implicit none integer :: u open(unit = 0, file="file_01_data.txt", status="old") open(unit = 1, file="file_01_data.txt", status="old") open(unit = 2, file="file_01_data.txt", status="old") open(newunit=u, file="file_01_data.txt", status="old") print *, u ! -10 is returned by gfortran, 3 is returned by lfortran ! similarly for other asserts below if (u /= -10 .and. u /= 3) error stop close(unit = 1) open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -11 .and. u /= 1) error stop open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -12 .and. u /= 4) error stop close(unit = 0) open(newunit=u, file="file_01_data.txt", status="old") print *, u if (u /= -13 .and. u /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_array_member_access.f900000664000175000017500000000117615141516316027442 0ustar alastairalastairprogram test complex, parameter :: x(2) = (1.0, 0.3) real :: y_re(2), y_im(2) ! Test extracting real parts y_re = x%re print *, "Real parts:", y_re ! Test extracting imaginary parts y_im = x%im print *, "Imaginary parts:", y_im ! Assert checks if (abs(y_re(1) - 1.0) > 1e-5) error stop "Real part 1 failed" if (abs(y_re(2) - 1.0) > 1e-5) error stop "Real part 2 failed" if (abs(y_im(1) - 0.3) > 1e-5) error stop "Imaginary part 1 failed" if (abs(y_im(2) - 0.3) > 1e-5) error stop "Imaginary part 2 failed" print *, x%re, x%im print *, "All tests passed!" endlfortran-lfortran-2f73434/integration_tests/implicit_interface_13.f900000664000175000017500000000053715141516316026062 0ustar alastairalastairmodule implicit_interface_13_module contains function f() implicit complex(8) (f) f = (1.0, 1.0) end function f end program main use implicit_interface_13_module complex(8) :: i i = f() if (abs(real(i) - 1.0) > 1e-16) error stop if (abs(aimag(i) - 1.0) > 1e-16) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/associate_15.f900000664000175000017500000000073315141516316024203 0ustar alastairalastairmodule list_module type :: list type(list), pointer :: child => null() contains procedure :: method end type list contains subroutine method(self) class(list), intent(inout) :: self if( associated(self%child) ) error stop write(*,*) 'associated: ', associated(self%child) end subroutine method end module list_module program associate_15 use list_module type(list) :: lst call lst%method() end program associate_15 lfortran-lfortran-2f73434/integration_tests/subroutines_04.f900000664000175000017500000000021415141516316024602 0ustar alastairalastairprogram print_it call print_int() contains subroutine print_int integer :: a a = 5 print *, a end subroutine print_int end program print_it lfortran-lfortran-2f73434/integration_tests/expr_02.f900000664000175000017500000000050715141516316023201 0ustar alastairalastairprogram expr_02 implicit none integer :: x x = (2+3)*5 if (x /= 25) error stop x = (2+3)*4 if (x /= 20) error stop x = (2+3)*(2+3) if (x /= 25) error stop x = (2+3)*(2+3)*4*2*(1+2) if (x /= 600) error stop x = x / 60 if (x /= 10) error stop x = x + 1 if (x /= 11) error stop x = x - 1 if (x /= 10) error stop end program lfortran-lfortran-2f73434/integration_tests/common_16.f900000664000175000017500000000163115141516316023517 0ustar alastairalastair! Test: COMMON block alignment edge case ! Tests storage association with types that might need alignment padding ! if the struct were not packed. COMMON blocks should be storage-associated ! (consecutive in memory) regardless of natural alignment requirements. program common_16 implicit none integer(1) :: i1 real(8) :: r8 integer(4) :: i4 common /align/ i1, r8, i4 i1 = 42 r8 = 3.14159d0 i4 = 999 call sub_verify() if (i1 /= 100) error stop "i1 should be 100 after subroutine" print *, "PASS: common_16" end program subroutine sub_verify() implicit none ! Same layout - verify values persist integer(1) :: a real(8) :: b integer(4) :: c common /align/ a, b, c if (a /= 42) error stop "a should be 42" if (abs(b - 3.14159d0) > 1.0d-10) error stop "b should be pi" if (c /= 999) error stop "c should be 999" a = 100 end subroutine lfortran-lfortran-2f73434/integration_tests/separate_compilation_07.f900000664000175000017500000000021715141516316026430 0ustar alastairalastairprogram separate_compilation_07 use separate_compilation_07b_mpi integer :: ierr call MPI_Init(ierr) print *, ierr end program lfortran-lfortran-2f73434/integration_tests/string_77.f900000664000175000017500000000146015141516316023544 0ustar alastairalastair! Mainly testing declaration in function module string_77_mod contains pure function foo (x) result(res) character(*), intent(in) :: x character(:), allocatable :: res allocate(character(len(x) + len("abc")):: res) res = x // 'abc' end function pure function boo(x,y) result(res) integer, intent(in) :: x,y integer :: res res = x + y end function function ff(line,length) result(strout) character(len=*):: line integer :: length character(len=boo(length, len(foo(line)))) :: strout ! the main concern of this test -- Is to handle this declaration correctly end function end module program string_77 use string_77_mod print *, len(ff("Hello", 10)) !! Expected output: 18 if(len(ff("Hello", 10)) /= 18) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_74.f900000664000175000017500000000034015141516316023530 0ustar alastairalastair! Test using type member in array constructor program arrays_74 type :: m integer :: aa(3) end type m integer :: j(5) type(m) :: tt tt%aa = [3, 4, 5] j = [ 1,2, tt%aa] end program arrays_74lfortran-lfortran-2f73434/integration_tests/write_15.f900000664000175000017500000000056315141516316023363 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4888 ! String array concatenation (//) in write statement ! Exact MRE from issue body program writetesta implicit none character(3):: c(6) = 'ab' character(80) :: output write(output,"(6A)") c//' ' print "(A)", trim(output) if (trim(output) /= 'ab ab ab ab ab ab') error stop end program writetesta lfortran-lfortran-2f73434/integration_tests/polymorphic_select_type_01.f900000664000175000017500000000063015141516316027164 0ustar alastairalastairprogram main type :: type_a integer :: a end type type_a class(type_a), allocatable :: x character(100) :: ss allocate(x) x%a = 10 select type(x) type is (type_a) print *, x write(ss, "(i0)") x if (trim(ss) /= "10") error stop "FAILED: wrong value from write" class default error stop "FAILED: wrong type" end select end programlfortran-lfortran-2f73434/integration_tests/interface_09.f900000664000175000017500000000111715141516316024170 0ustar alastairalastairmodule interface_09_m abstract interface subroutine add(x, y, z) integer, intent(in) :: x integer, intent(in) :: y integer, intent(in) :: z end subroutine end interface end module program interface_09 use interface_09_m, only : add procedure (add) :: add_def procedure (add), pointer :: p p => add_def call p(5, 10, 15) end program subroutine add_def(x, y, z) integer, intent(in) :: x integer, intent(in) :: y integer, intent(in) :: z print *, "sum: ", x + y + z end subroutinelfortran-lfortran-2f73434/integration_tests/intrinsics_250.f900000664000175000017500000000050715141516316024475 0ustar alastairalastairprogram intrinsics_250 integer, dimension(2,2) :: x real(8) :: res(2) x = 2 res = func(x, 1) contains function func(x, dim) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim real(8) :: res(2) print*, sum(abs(x), dim) res = sum(abs(x), dim) if (any(res /= [4, 4])) error stop end function func end program lfortran-lfortran-2f73434/integration_tests/file_38.f900000664000175000017500000000123515141516316023152 0ustar alastairalastairprogram file_38 ! MRE: action='read' should not allow writes implicit none integer :: u, ios ! Create test file open(newunit=u, file="file_38.dat", status="replace") write(u, *) "original" close(u) ! Open with action='read' and status='old' open(newunit=u, file="file_38.dat", action='read', status='old') ! Try to write - this MUST fail with action='read' write(u, *, iostat=ios) "overwritten" close(u) if (ios == 0) error stop "BUG: write succeeded with action=read" if (ios < 0) error stop "BUG: expected positive iostat for error (not EOF)" print *, "PASSED: write blocked with ios=", ios end program lfortran-lfortran-2f73434/integration_tests/modules_65.f900000664000175000017500000000107415141516316023704 0ustar alastairalastairprogram modules_65 use modules_65_base, only: base_t, holder_t use modules_65_child, only: child_t use modules_65_worker, only: classify implicit none type(holder_t) :: h1, h2 integer :: r allocate(child_t :: h1%item) h1%item%width = 10 select type (x => h1%item) class is (child_t) x%extra = 99 end select allocate(base_t :: h2%item) h2%item%width = 7 r = classify(h1) if (r /= 99) error stop r = classify(h2) if (r /= 7) error stop print *, "PASSED: modules_65" end program modules_65 lfortran-lfortran-2f73434/integration_tests/intrinsics_395.f900000664000175000017500000000034215141516316024504 0ustar alastairalastairprogram intrinsics_395 implicit none complex(8) :: a a = cmplx(cmplx(1, 2), kind=8) if (abs(real(a, kind=8) - 1.0_8) > 1.0e-9_8) error stop if (abs(aimag(a) - 2.0_8) > 1.0e-9_8) error stop end program intrinsics_395 lfortran-lfortran-2f73434/integration_tests/submodule_04.f900000664000175000017500000000203115141516316024216 0ustar alastairalastairmodule mod_submodule_04 implicit none private public :: open_hashmap_type type :: open_hashmap_type contains procedure :: map_entry => map_open_entry end type open_hashmap_type interface module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_submodule_04 submodule(mod_submodule_04) submod_submodule_04 implicit none contains module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key integer, parameter :: i = 5 key = i end subroutine map_open_entry end submodule submod_submodule_04 program submodule_04 use mod_submodule_04, only : open_hashmap_type implicit none type(open_hashmap_type) :: map integer :: key = 1 call map % map_entry( key ) print *, key if (key /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_19.f900000664000175000017500000000271515141516316023534 0ustar alastairalastairsubroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a interface subroutine intiailise_array_kernel(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface call intiailise_array_kernel(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_19 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/string_33.f900000664000175000017500000000024315141516316023532 0ustar alastairalastairprogram string_33 implicit none character(len=1) :: str write(str, '(a)') "A" print *, "|"//str//"|" if (str /= "A") error stop end program lfortran-lfortran-2f73434/integration_tests/custom_operator_11.f900000664000175000017500000000271215141516316025450 0ustar alastairalastairmodule custom_operator_11_mod1 interface operator(.in.) module procedure string_contains ! string in an integer array ?? end interface operator(.in.) contains logical function string_contains(search_string,array) character(*), intent(in) :: search_string integer,intent(in) :: array(:) character(len=10) :: string_buffer integer :: i string_contains = .false. do i = 1, size(array) write(string_buffer, '(i0)') array(i) string_contains = string_contains .or. (trim(string_buffer) == search_string) end do end function string_contains end module custom_operator_11_mod1 module custom_operator_11_mod2 use custom_operator_11_mod1, only: operator(.in.) implicit none interface operator(.in.) procedure target_in end interface operator(.in.) contains subroutine temp() integer, allocatable :: arr(:) character(len=:), allocatable :: str arr = [42,666] str = '42' if (.not. (str .in. arr)) error stop end subroutine temp function target_in(needle, arr) result(x) integer, intent(in) :: needle integer, intent(in) :: arr(:) logical :: x x = any(needle==arr) end function target_in end module custom_operator_11_mod2 program custom_operator_11 use custom_operator_11_mod2, only: operator(.in.),temp if (.not. (42 .in. [42,666])) error stop if ('22' .in. [42,666]) error stop if (0 .in. [42,666]) error stop call temp() end program custom_operator_11lfortran-lfortran-2f73434/integration_tests/derived_type_with_default_init_01.f900000664000175000017500000000100015141516316030454 0ustar alastairalastairmodule module_derived_type_with_default_init_01 public :: myType, global_myType type :: myType logical :: a = .true. integer :: i = 2 end type myType type(myType) :: global_myType end module module_derived_type_with_default_init_01 program derived_type_with_default_init_01 use module_derived_type_with_default_init_01, global => global_myType if (global % a .neqv. .true.) error stop if (global % i .ne. 2) error stop end program derived_type_with_default_init_01lfortran-lfortran-2f73434/integration_tests/modules_65_worker.f900000664000175000017500000000071515141516316025276 0ustar alastairalastairmodule modules_65_worker use modules_65_base, only: holder_t use modules_65_child, only: child_t implicit none contains function classify(h) result(res) type(holder_t), intent(in) :: h integer :: res res = -1 select type (x => h%item) class is (child_t) res = x%extra class default res = x%width end select end function classify end module modules_65_worker lfortran-lfortran-2f73434/integration_tests/types_18.f900000664000175000017500000000017415141516316023376 0ustar alastairalastairprogram types_18 type(real(kind=4)) :: x x = 3.14 print *, x if (abs(x - 3.14) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/entry_09.f900000664000175000017500000000101715141516316023370 0ustar alastairalastairSUBROUTINE dinvr(x) IMPLICIT NONE DOUBLE PRECISION x DOUBLE PRECISION, SAVE :: big,small DOUBLE PRECISION zsmall, zbig print *, "small: ", small print *, "big: ", big if (abs(small - (-1.6d0)) > 1d-10) error stop if (abs(big - 10.9d0) > 1d-10) error stop entry distinv(zsmall, zbig) small = -1.6d0 big = 10.9d0 return end subroutine program entry_09 implicit none double precision :: x x = 0.5d0 call distinv(-1.6d0, 10.9d0) call dinvr(x) end program lfortran-lfortran-2f73434/integration_tests/procedure_01.f900000664000175000017500000000104015141516316024203 0ustar alastairalastairmodule procedure_01_module implicit none abstract interface integer function fn(n) integer, intent(in) :: n end function end interface contains integer function plus(f, x) procedure(fn) :: f integer, intent(in) :: x plus = f(x+4) end function end module program procedure_01 use procedure_01_module, only: plus implicit none integer :: i i = plus(myf, 5) print *, i if (i /= 18) error stop contains integer function myf(n) integer, intent(in) :: n myf = 2*n end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_173.f900000664000175000017500000000363715141516316024510 0ustar alastairalastairprogram intrinsics_171 use iso_fortran_env, only: sp => real32, dp => real64 real :: x real :: y real(dp) :: z real(dp) :: w real(sp), parameter :: x1 = fraction(178.1387e-4) real(dp), parameter :: y1 = fraction(1.01_dp) real(sp), parameter :: ar1(3) = fraction([1.1213, 2.1643, 3.613]) real(dp), parameter :: ar2(3) = fraction([1.1213_dp, 2.1643_dp, 3.613_dp]) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] x = 178.1387e-4 y = 1.00 z = -5.1 w = 0.0 print *, x1 if (x1 - 0.57004_sp > 1e-5) error stop print*, y1 if (y1 - 0.50500000000000000_dp > 1e-5) error stop print*, ar1 if (any(ar1 - [0.560649991_sp, 0.541074991_sp, 0.903249979_sp] > 1e-5)) error stop print*, ar2 if (any(ar2 - [0.56064999999999998_dp, 0.54107499999999997_dp, 0.90325000000000000_dp] > 1e-5)) error stop print *, fraction(x) if (fraction(x) - 0.57004 > 1e-5) error stop print *, fraction(y) if (fraction(y) - 0.50000 > 1e-5) error stop print *, fraction(z) if (fraction(z) - (-0.63749998807907104_dp) > 1e-8) error stop print *, fraction(w) if (fraction(w) - (0.0000000000000000_dp) > 1e-5) error stop print *, fraction(178.1387e-4) if (fraction(178.1387e-4) - (0.57004) > 1e-5) error stop print *, fraction(1.0) if (fraction(1.0) - (0.50000) > 1e-5) error stop print *, fraction(-5.1_dp) if (fraction(-5.1_dp) - (-0.637499988_dp ) > 1e-8) error stop print *, fraction(0.0_dp) if (fraction(0.0_dp) - (0.00000000_dp) > 1e-5) error stop print *, fraction(arr1) if (any(fraction(arr1) - [0.743749976_sp, 0.750000000_sp, 0.704531252_sp] > 1e-5)) error stop print *, fraction(arr2) if (any(fraction(arr2) - [0.86953124999999998_dp, 0.75000000000000000_dp, 0.65961914062500004_dp] > 1e-5)) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_146.f900000664000175000017500000000154115141516316024500 0ustar alastairalastairprogram intrinsic_146 real :: a, b, c double precision :: result a = 5.2 b = 3.2 c = -4.1 result = dprod(a,b) print *, result if (abs(result - (16.64)) > 1e-5) error stop result = dprod(a,c) print *, dprod(a,c) if (abs(result - (-21.32)) > 1e-5) error stop result = dprod(b,c) print *, result if (abs(result - (-13.12)) > 1e-5) error stop result = dprod(5.2,3.2) print *, result if (abs(result - (16.64)) > 1e-5) error stop result = dprod(5.2,-4.1) print *, result if (abs(result - (-21.32)) > 1e-5) error stop result = dprod(3.2,-4.1) print *, result if (abs(result - (-13.12)) > 1e-5) error stop print *, kind(dprod(a,b)) if (kind(dprod(a,b)) /= 8) error stop print *, kind(dprod(5.2, 3.2)) if (kind(dprod(5.2, 3.2)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_131.f900000664000175000017500000000426615141516316024501 0ustar alastairalastairprogram intrinsics_131 implicit none integer, parameter :: x1 = max(1, 2) integer(8), parameter :: x2 = max(1_8, 2_8) real, parameter :: x3 = max(1.0, 2.0) real(8), parameter :: x4 = max(1.0_8, 2.0_8) character(len=10), parameter :: x5 = max("str", "string") integer, parameter :: ar1(3) = max([1, 12, 3], [4, 5, 6]) integer(8), parameter :: ar2(3) = max([1_8, 12_8, 3_8], [4_8, 5_8, 6_8]) real, parameter :: ar3(3) = max([1.0, 12.0, 3.0], [4.0, 5.0, 6.0]) real(8), parameter :: ar4(3) = max([1.0_8, 12.0_8, 3.0_8], [4.0_8, 5.0_8, 6.0_8]) ! character(len=10), parameter :: ar5(3) = max(["str1", "str2", "char"], ["!str#$", "xtring", "charac"]) ! Does not work - #4582 integer :: i1, i2 integer(8) :: i3, i4 real :: r1, r2 real(8) :: r3, r4 character(len=10) :: string_var, string_var2, string_var3 i1 = 123 i2 = 456 i3 = 123_8 i4 = 456_8 r1 = 123.0 r2 = 456.0 r3 = 123.0_8 r4 = 456.0_8 string_var = "str" string_var2 = "string" string_var3 = "character" print *, x1 if (x1 /= 2) error stop print *, x2 if (x2 /= 2_8) error stop print *, x3 if (x3 /= 2.0) error stop print *, x4 if (x4 /= 2.0_8) error stop print *, x5 if (x5 /= "string") error stop print *, ar1 if (any(ar1 /= [4, 12, 6])) error stop print *, ar2 if (any(ar2 /= [4_8, 12_8, 6_8])) error stop print *, ar3 if (any(ar3 /= [4.0, 12.0, 6.0])) error stop print *, ar4 if (any(ar4 /= [4.0_8, 12.0_8, 6.0_8])) error stop ! print *, ar5 ! if (any(ar5 /= ["str1", "string", "charac"])) error stop print *, max(i1, i2) if (max(i1, i2) /= i2) error stop print *, max(i3, i4) if (max(i3, i4) /= i4) error stop print *, max(r1, r2) if (max(r1, r2) /= r2) error stop print *, max(r3, r4) if (max(r3, r4) /= r4) error stop print*, max("str", "character") if (max("str", "character") /= "str") error stop print*, max(string_var, string_var2) if (max(string_var, string_var2) /= string_var2) error stop print*, max(string_var3, string_var2) if (max(string_var3, string_var2) /= string_var2) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_23.f900000664000175000017500000000232615141516316026061 0ustar alastairalastair! Test implicit interface procedure dummy with mixed call patterns ! When a procedure dummy f is: ! 1. Passed as argument to another subroutine ! 2. Called with both variable args f(x) and expression args f(x+1) ! All calls should use consistent by-reference calling convention program implicit_interface_23 implicit none double precision :: x, result x = 2.0d0 call compute(square, x, result) ! Expected: square(2) + square(3) = 4 + 9 = 13 if (abs(result - 13.0d0) > 1.0d-10) error stop print *, "PASS" contains double precision function square(y) double precision, intent(in) :: y square = y * y end function end program subroutine compute(f, x, result) implicit none double precision, intent(in) :: x double precision, intent(out) :: result double precision :: f, tmp external :: f ! Pass f to another subroutine first (creates implicit interface) tmp = x call use_func(f, tmp) ! Then call f with both variable and expression arguments result = f(x) + f(x + 1.0d0) end subroutine subroutine use_func(g, z) implicit none double precision, intent(inout) :: z double precision :: g external :: g z = g(z) end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_197.f900000664000175000017500000001211515141516316024505 0ustar alastairalastairprogram intrinsics_197 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: x(40) real(dp) :: expected(40) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(40) = bessel_y0([9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) x = [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp,9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [ 7.9836428649154907E-155_dp,-7.0751499885966513E-155_dp, 4.4632457212022053E-155_dp, -7.7717941781117305E-156_dp, & -2.1476418943648812E-002_dp, 0.45752410314844527_dp, -3.6134118144921369E-003_dp, -1.1810118244863275_dp, & 5.7258225070763252E-002_dp, -1.9980991452871046E-002_dp, 0.27136794388300378_dp, 0.26703177612919299_dp, & -223.60567312692987_dp, -223.93677423698244_dp, -226.06259684300088_dp, -224.71105113517498_dp, & -0.10066167676587488_dp, 1.3491498398094682E-002_dp, 0.11694884231468369_dp, -0.14624416810911833_dp, & 0.11351877059712150_dp, 0.26579485639687389_dp, 0.26597878435358130_dp, 0.26633862894209037_dp, & -0.23184540282244587_dp, -0.23210076724614023_dp, -0.23235626136445603_dp, -0.23261188523008530_dp, & -0.43830934413197298_dp, -0.43839015710774321_dp, -0.43847110563441455_dp, -0.43863340934604428_dp, & -444.01882239162842_dp, -444.11695700415237_dp, -444.23302545068867_dp, -444.55822289723721_dp, & 3.1963700362099140E-002_dp, 3.0400895527807309E-002_dp, 2.8592509948203688E-002_dp, 2.4299538193472119E-002_dp ] do i = 1, size(x) print *, bessel_y0(x(i)), "i = ", i if (abs(bessel_y0(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [-2.1476418943648812E-002_sp, 0.45752410314844527_sp, -3.6134118144921369e-3_sp, -1.1810118244863275_sp, & 5.72582334E-02_sp, -1.99812334E-02_sp, 0.271367937_sp, 0.277011007_sp, & -0.100661635_sp, 1.34913139E-02_sp, 0.116948858_sp, -0.146244213_sp, & 0.113518834_sp, 0.265794873_sp, 0.265978813_sp, 0.266338646_sp, & -0.231845424_sp, -0.232100740_sp, -0.232356280_sp, -0.232611880_sp, & -0.438309371_sp, -0.438390195_sp, -0.438471109_sp, -0.438633382_sp, & 3.19634713E-02_sp, 3.04011665E-02_sp, 2.85927802E-02_sp, 2.42997743E-02_sp] do i = 1, size(y) print *, bessel_y0(y(i)), "i = ", i if (abs(bessel_y0(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-lfortran-2f73434/integration_tests/modules_01.f900000664000175000017500000000026115141516316023667 0ustar alastairalastairmodule modules_01_a implicit none contains subroutine b() print *, "b()" end subroutine end module program modules_01 use modules_01_a, only: b implicit none call b() end lfortran-lfortran-2f73434/integration_tests/intrinsics_178.f900000664000175000017500000000532415141516316024510 0ustar alastairalastairprogram intrinsics_178 use iso_fortran_env, only: sp => real32, dp => real64 real :: y real :: z real(dp) :: w real(dp) :: x real(sp), parameter :: x1 = rrspacing(178.1387e-4) real(dp), parameter :: y1 = rrspacing(1.01_dp) real(sp), parameter :: ar1(3) = rrspacing([1.1213, 2.1643, 3.613]) real(dp), parameter :: ar2(3) = rrspacing([1.1213_dp, 2.1643_dp, 3.613_dp]) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] x = 4.1 y = 7.8 z = 3.2 w = 5.6 print *, x1 if (x1 - 9.56374900e+06_sp > 1e-5) error stop print*, y1 if (y1 - 4.54863562364420100e+15_dp > 1e-5) error stop print*, ar1 if (any(ar1 - [9.40614600e+06_sp, 9.07773200e+06_sp, 1.51540200e+07_sp] > 1e-5)) error stop print*, ar2 if (any(ar2 - [5.04988626217053700e+15_dp, 4.87357033675898200e+15_dp, 8.13575272684480100e+15_dp] > 1e-5)) error stop print *, rrspacing(4.1) if ((rrspacing(4.1) - 8598323.00) > 1e-7) error stop print *, rrspacing(7.8) if ((rrspacing(7.8) - 16357786.0) > 1e-7) error stop print *, rrspacing(3.2_dp) if ((rrspacing(3.2_dp) - 7205759403792794.0_dp) > 1e-7) error stop print *, rrspacing(5.6_dp) if ((rrspacing(5.6_dp) - 6305039478318694.0_dp) > 1e-7) error stop print *, rrspacing(x) if ((rrspacing(x) - 461618961805475800.0_dp) > 1e-7) error stop print *, rrspacing(y) if ((rrspacing(y) - 16357786.0) > 1e-7) error stop print *, rrspacing(z) if ((rrspacing(z) - 13421773.0 ) > 1e-7) error stop print *, rrspacing(w) if ((rrspacing(w) - 630503947831869400.0) > 1e-7) error stop print *, rrspacing(4.1_dp) if ((rrspacing(4.1_dp) - 4616189618054758.0_dp) > 1e-7) error stop print *, rrspacing(7.8_dp) if ((rrspacing(7.8_dp) - 8782019273372467.0_dp) > 1e-7) error stop print *, rrspacing(3.2_dp) if ((rrspacing(3.2_dp) - 7205759403792794.0_dp) > 1e-7) error stop print *, rrspacing(5.6_dp) if ((rrspacing(5.6_dp) - 6305039478318694.0_dp) > 1e-7) error stop print *, kind(rrspacing(4.1)) if (kind(rrspacing(4.1)) /= 4) error stop print *, kind(rrspacing(7.8_dp)) if (kind(rrspacing(7.8_dp)) /= 8) error stop print *, kind(rrspacing(y)) if (kind(rrspacing(y)) /= 4) error stop print *, kind(rrspacing(x)) if (kind(rrspacing(x)) /= 8) error stop print *, rrspacing(arr1) if (any(rrspacing(arr1) - [1.24780540e+07_sp, 1.25829120e+07_sp, 1.18200730e+07_sp] > 1e-5)) error stop print *, rrspacing(arr2) if (any(rrspacing(arr2) - [7.83204122697400300e+15_sp, 6.75539944105574400e+15_sp, & 5.94132103185039400e+15_sp] > 1e-5)) error stop end program lfortran-lfortran-2f73434/integration_tests/print_arr_07.f900000664000175000017500000000024515141516316024227 0ustar alastairalastair! Check the working of ArrayItem program print_arr_07 implicit none integer :: x(3) x(1) = 1 x(2) = 2 x(3) = 3 print *, x, x(2) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_225.f900000664000175000017500000000130615141516316024475 0ustar alastairalastairprogram intrinsics_225 implicit none integer(1) :: a1(2) integer(4) :: b1(5) integer(8) :: c1(10) integer(1), parameter :: a2 = iany([1, 2, 3, 4, 5]) integer(4), parameter :: b2 = iany([3, 5, 7, 9, 11]) integer(8), parameter :: c2 = iany([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) a1 = [3, 5] b1 = [3, 5, 7, 9, 11] c1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print*, iany(a1) if (iany(a1) /= 7) error stop print*, iany(b1) if (iany(b1) /= 15) error stop print*, iany(c1) if (iany(c1) /= 15) error stop print*, a2 if (a2 /= 7) error stop print*, b2 if (b2 /= 15) error stop print*, c2 if (c2 /= 15) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_07.f900000664000175000017500000000105515141516316024013 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() real, dimension(:), allocatable :: temp integer :: i temp = solution() print *, temp do i = lbound(temp, 1), ubound(temp, 1) if (abs(temp(i) * i - 1.0) > 1e-5) error stop end do end subroutine compare_solutions pure function solution() result(x) real, dimension(:), allocatable :: x x = [1.0, 0.5, 1.0/3.0, 0.25, 0.2] end function solution end program main lfortran-lfortran-2f73434/integration_tests/types_17.f900000664000175000017500000000034115141516316023371 0ustar alastairalastairprogram types_17 implicit none contains subroutine f1() integer, pointer :: ptr nullify(ptr) end subroutine subroutine f2() character(len=2), pointer :: ptr nullify(ptr) end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_348.f900000664000175000017500000000037515141516316024510 0ustar alastairalastairprogram intrinsics_348 integer :: A(2, 2) call temp(A) contains subroutine temp(A) integer, intent(inout) :: A(:, :) integer :: X(4) X = [1,2,3,4] print *, reshape(X, shape(A)) end subroutine end programlfortran-lfortran-2f73434/integration_tests/forall_02.f900000664000175000017500000000023115141516316023474 0ustar alastairalastairprogram forall_02 integer :: arr(5) forall (i = 1:5) arr(i) = i * 2 end forall print *, arr if (any(arr /= [2, 4, 6, 8, 10])) error stop end program lfortran-lfortran-2f73434/integration_tests/string_56.f900000664000175000017500000000123415141516316023540 0ustar alastairalastairmodule string_56_mod implicit none public :: global_names character(len=:), allocatable :: global_names(:) contains function get_message() result(msg) character(:), allocatable :: msg msg = "World" end function get_message end module string_56_mod program string_56 use string_56_mod character(:), allocatable :: current_argument current_argument = "Hello" global_names=[character(len=5) :: current_argument] if (global_names(1) /= "Hello") error stop select case(get_message()) case("World") current_argument = "World" end select if (current_argument /= "World") error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_op_30.f900000664000175000017500000000051315141516316024220 0ustar alastairalastairmodule arrays_op_30_mod integer, parameter :: arr(3) = [1, 2, 3] end module arrays_op_30_mod program arrays_op_30 use arrays_op_30_mod integer, parameter :: arr2(3) = [1, 2, 3] integer :: val1, val2 val1 = arr(1) if (val1 /= 1) error stop val2 = arr2(1) if (val2 /= 1) error stop end program arrays_op_30 lfortran-lfortran-2f73434/integration_tests/array_section_01.f900000664000175000017500000000312315141516316025061 0ustar alastairalastairsubroutine vecfcn(l, m, n, o) implicit none integer, intent(in) :: l, m, n, o integer :: i, j, k, a, b, c, d real :: fvec(l), fvec2d(l, m), fvec3d(l, m, n), fvec4d(l, m, n, o) i = 5 j = 5 k = 5 fvec(1) = 1 fvec(2:l) = 0.0 print *, fvec if (fvec(1) /= 1.0) error stop if (fvec(2) /= 0.0) error stop if (fvec(10) /= 0.0) error stop fvec2d = 1.0 fvec2d(:, k) = 2.0 print *, fvec2d do a = 1, l do b = 1, m if( b == k ) then if( fvec2d(a, b) /= 2.0 ) error stop else if( fvec2d(a, b) /= 1.0 ) error stop end if end do end do fvec3d = 1.0 fvec3d(:, k, :i) = 2.0 print *, fvec3d do a = 1, l do b = 1, m do c = 1, n if( b == 5 .and. c <= i ) then if( fvec3d(a, b, c) /= 2.0 ) error stop else if( fvec3d(a, b, c) /= 1.0 ) error stop end if end do end do end do fvec4d = 1.0 fvec4d(:, k, :i, j) = 2.0 print *, fvec4d do a = 1, l do b = 1, m do c = 1, n do d = 1, o if( b == 5 .and. c <= i .and. d == j ) then if( fvec4d(a, b, c, d) /= 2.0 ) error stop else if( fvec4d(a, b, c, d) /= 1.0 ) error stop end if end do end do end do end do end subroutine vecfcn program main call vecfcn(10, 10, 10, 10) end program main lfortran-lfortran-2f73434/integration_tests/procedure_decl_01_a.f900000664000175000017500000000014515141516316025477 0ustar alastairalastairprogram procedure_decl_01_a use, non_intrinsic :: procedure_decl_01_b end program procedure_decl_01_alfortran-lfortran-2f73434/integration_tests/custom_operator_07.f900000664000175000017500000000221415141516316025452 0ustar alastairalastairmodule custom_operator_07_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_07_a module custom_operator_07_b use custom_operator_07_a implicit none contains subroutine test_concat type(string_t) :: str, left, right left = string_t("a") right = string_t("b") str = left // right end subroutine test_concat end module custom_operator_07_b program custom_operator_07 use custom_operator_07_b implicit none call test_concat() end program custom_operator_07 lfortran-lfortran-2f73434/integration_tests/modules_44_module.f900000664000175000017500000000041715141516316025246 0ustar alastairalastairmodule modules_44_module_fpm_filesystem implicit none contains subroutine warnwrite(fname, data) character(len=*), intent(in) :: fname character(len=*), intent(in) :: data(:) end subroutine warnwrite end module modules_44_module_fpm_filesystem lfortran-lfortran-2f73434/integration_tests/intrinsics_102.f900000664000175000017500000000033215141516316024465 0ustar alastairalastairprogram intrinsics_102 implicit none real, allocatable :: arr(:), sin1d(:) allocate(arr(10), sin1d(10)) arr = 1.0 sin1d = sin(arr) print *, sin1d if( any(abs(sin1d - 8.41471016e-01) > 1e-6) ) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_70.f900000664000175000017500000000107015141516316025072 0ustar alastairalastairprogram derived_types_70 implicit none type :: task logical :: done end type task type :: container type(task), allocatable :: deps(:) end type container class(container), allocatable :: x logical :: finished integer :: i allocate(x) allocate(x%deps(3)) call temp(x) if (any(x%deps(:)%done .neqv. [.true., .false., .true.])) error stop contains subroutine temp(tab) class(container), intent(inout) :: tab tab%deps(1)%done = .true. tab%deps(2)%done = .false. tab%deps(3)%done = .true. end subroutine end program lfortran-lfortran-2f73434/integration_tests/custom_operator_10.f900000664000175000017500000000237715141516316025456 0ustar alastairalastairmodule custom_operator_10_mod implicit none type string_t private character(len=:), allocatable :: string_ contains generic :: operator(//) => character_cat_string_t procedure, private, pass(rhs) :: character_cat_string_t end type interface elemental module function character_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none character(len=*), intent(in) :: lhs class(string_t), intent(in) :: rhs character(len=5) lhs_cat_rhs end function end interface type test_diagnosis_t private character(len=:), allocatable :: diagnostics_string_ end type interface operator(//) elemental module function append_string_if_test_failed(lhs, rhs) result(lhs_cat_rhs) implicit none class(test_diagnosis_t), intent(in) :: lhs type(string_t), intent(in) :: rhs character(len=5) lhs_cat_rhs end function end interface contains module procedure append_string_if_test_failed lhs_cat_rhs = lhs%diagnostics_string_ // rhs end procedure module procedure character_cat_string_t lhs_cat_rhs = lhs // rhs%string_ end procedure end module custom_operator_10_mod program custom_operator_10 use custom_operator_10_mod implicit none end program custom_operator_10 lfortran-lfortran-2f73434/integration_tests/arrays_37.f900000664000175000017500000000065115141516316023534 0ustar alastairalastairprogram arrays_37 use iso_fortran_env, only: dp => real64 real(dp), allocatable :: result(:) real(dp) :: start_, end_, step_ integer :: i allocate(result(10)) start_ = 1.0_dp end_ = 10.0_dp step_ = 1.0_dp result = [(start_ + (i - 1)*step_, i=1, size(result), 1)] print *, result i = 1 do while (i <= size(result)) if (abs(result(i) - (start_ + (i - 1)*step_)) > 1.0e-15_dp) error stop i = i + 1 end do end program lfortran-lfortran-2f73434/integration_tests/arrays_09_size.f900000664000175000017500000000047715141516316024573 0ustar alastairalastairmodule mod_arrays_09_size contains subroutine sub(xx) real :: xx(5) real :: buggy(count(xx > 0.0)) if (size(buggy) /= 3) error stop end subroutine sub end module mod_arrays_09_size program arrays_09_size use mod_arrays_09_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end programlfortran-lfortran-2f73434/integration_tests/array_op_07.f900000664000175000017500000000026315141516316024043 0ustar alastairalastairprogram array_op_7 integer :: A(2) = [2,2] logical :: B(2) integer :: i B = abs(A) > maxval(abs(A)) do i = 1, 2 if (B(i) .neqv. .false.) error stop end do end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_28.f900000664000175000017500000000031415141516316026431 0ustar alastairalastair! Common block with CHARACTER - main program program separate_compilation_28 implicit none character(32) :: srnamt common /srnamc/ srnamt call set_name() call print_name() end program lfortran-lfortran-2f73434/integration_tests/openmp_14.f900000664000175000017500000000174315141516316023527 0ustar alastairalastairsubroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i !$omp parallel !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 !$omp parallel do reduction(+:sum) do i = 1, n sum = sum + a(i) end do !$omp end parallel do print *, 'Sum = ', sum ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same if (abs(sum - 12905576.0) > 1e-8) error stop end subroutine program openmp_14 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a call omp_set_num_threads(8) call initialize_array(n, a) call parallel_sum(n, a) print *, a(1), a(n) end program lfortran-lfortran-2f73434/integration_tests/file_15.f900000664000175000017500000000060715141516316023147 0ustar alastairalastairprogram file_15 implicit none integer :: items(10), u = 10, i, n integer :: ios(2) open(u, file='file_03_data.txt', action='read') read(u, *, iostat=ios(1)) do i = 1, 10 read(u, *) n items(i) = n end do close(u) if (items(2) /= 102) error stop if (sum(items) /= 1055) error stop if (ios(1) /= 0) error stop end program file_15 lfortran-lfortran-2f73434/integration_tests/class_43.f900000664000175000017500000000152415141516316023335 0ustar alastairalastairmodule class_43_mod type, abstract :: SomeType end type SomeType type, abstract :: Base contains procedure(method), deferred :: method end type Base abstract interface subroutine method(self,arr) import class(Base), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) end subroutine method end interface type, extends(Base) :: Extended class(Base), allocatable :: basic contains procedure :: method => implementation end type Extended contains subroutine implementation(self,arr) class(Extended), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) call self%basic%method(arr) end subroutine implementation end module class_43_mod program class_43 use class_43_mod end program class_43lfortran-lfortran-2f73434/integration_tests/intrinsics_21.f900000664000175000017500000000420115141516316024404 0ustar alastairalastairprogram intrinsics_21 ! Test mod / modulo intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = modulo(-5., 3.), & s2 = modulo(5., -3.), & s3 = modulo(-5., -3.), & s4 = modulo(5., 3.), & s1b = mod(-5., 3.), & s2b = mod(5., -3.), & s3b = mod(-5., -3.), & s4b = mod(5., 3.) real(dp), parameter :: & d1 = modulo(-5._dp, 3._dp), & d2 = modulo(5._dp, -3._dp), & d3 = modulo(-5._dp, -3._dp), & d4 = modulo(5._dp, 3._dp), & d1b = mod(-5._dp, 3._dp), & d2b = mod(5._dp, -3._dp), & d3b = mod(-5._dp, -3._dp), & d4b = mod(5._dp, 3._dp) integer, parameter :: & j1 = modulo(-5, 3), & j2 = modulo(5, -3), & j3 = modulo(-5, -3), & j4 = modulo(5, 3), & j1b = mod(-5, 3), & j2b = mod(5, -3), & j3b = mod(-5, -3), & j4b = mod(5, 3) real :: x1, x2 real(dp) :: y1, y2 integer :: i1, i2 i1 = -5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(-5., 3.), modulo(-5._dp, 3._dp), modulo(x1, x2), modulo(y1, y2), s1, d1 print *, mod(-5., 3.), mod(-5._dp, 3._dp), mod(x1, x2), mod(y1, y2), s1b, d1b print *, modulo(-5, 3), modulo(i1, i2), j1 print *, mod(-5, 3), mod(i1, i2), j1b i1 = 5; i2 = -3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(5., -3.), modulo(5._dp, -3._dp), modulo(x1, x2), modulo(y1, y2), s2, d2 print *, mod(5., -3.), mod(5._dp, -3._dp), mod(x1, x2), mod(y1, y2), s2b, d2b print *, modulo(5, -3), modulo(i1, i2), j2 print *, mod(5, -3), mod(i1, i2), j2b i1 = -5; i2 = -3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(-5., -3.), modulo(-5._dp, -3._dp), modulo(x1, x2),modulo(y1, y2), s3, d3 print *, mod(-5., -3.), mod(-5._dp, -3._dp), mod(x1, x2), mod(y1, y2), s3b, d3b print *, modulo(-5, -3), modulo(i1, i2), j3 print *, mod(-5, -3), mod(i1, i2), j3b i1 = 5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; print *, modulo(5., 3.), modulo(5._dp, 3._dp), modulo(x1, x2), modulo(y1, y2), s4, d4 print *, mod(5., 3.), mod(5._dp, 3._dp), mod(x1, x2), mod(y1, y2), s4b, d4b print *, modulo(5, 3), modulo(i1, i2), j4 print *, mod(5, 3), mod(i1, i2), j4b end lfortran-lfortran-2f73434/integration_tests/expr_17.f900000664000175000017500000000052415141516316023206 0ustar alastairalastairprogram expr_17 implicit none type t real, dimension(:), pointer :: x end type t type(t) :: type real, target :: r(2) real :: ans(2) r = 34 type%x => r ans = type%x**2 print *, ans if (abs(ans(1) - 1156.0) > 1e-5) error stop if (abs(ans(2) - 1156.0) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/polymorphic_class_compare.f900000664000175000017500000000206115141516316027157 0ustar alastairalastairmodule gFTL2_Integer32Complex32Map implicit none type :: map_SetIterator integer::i end type map_SetIterator interface operator(==) module procedure map_s_iter_equal end interface operator(==) interface operator(/=) module procedure map_s_iter_not_equal end interface operator(/=) contains logical function map_s_iter_equal(a, b) result(eq) type(map_SetIterator), intent(in) :: a type(map_SetIterator), intent(in) :: b eq = a%i == b%i end function map_s_iter_equal logical function map_s_iter_not_equal(a, b) result(ne) implicit none class(map_SetIterator), intent(in) :: a, b ne = a == b ne = .not. ne end function map_s_iter_not_equal end module gFTL2_Integer32Complex32Map program polymorphic_class_compare use gFTL2_Integer32Complex32Map implicit none type(map_SetIterator) :: iter1, iter2 ! Initialize iterators iter1%i = 1 iter2%i = 1 if (iter1 /= iter2) error stop "Error: iter1 and iter2 should be equal" end program polymorphic_class_comparelfortran-lfortran-2f73434/integration_tests/custom_operator_02.f900000664000175000017500000000113415141516316025445 0ustar alastairalastairmodule custom_operator_02_a implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_02_a module custom_operator_02_b integer :: negation = 5 end module custom_operator_02_b program custom_operator_02 use custom_operator_02_b use custom_operator_02_a implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_02 lfortran-lfortran-2f73434/integration_tests/implied_do_loops13.f900000664000175000017500000000046015141516316025405 0ustar alastairalastairprogram implied_do_loops13 implicit none character(:), allocatable :: tmp_line character(len=5) :: values(3) integer :: i tmp_line = "Hello" values = [(tmp_line, i = 1, 3)] do i = 1, 3 if (values(i) /= "Hello") error stop 1 end do end program implied_do_loops13 lfortran-lfortran-2f73434/integration_tests/derived_types_64.f900000664000175000017500000000172215141516316025101 0ustar alastairalastairmodule mod_derived_types_64 implicit none ! derived type with the same name as interface type :: toml_datetime character(len=:), allocatable :: date end type toml_datetime ! same name is derived type above interface toml_datetime module procedure :: toml_datetime_ctor end interface contains function toml_datetime_ctor(date_str, time_str) result(dt) character(len=*), intent(in) :: date_str, time_str type(toml_datetime) :: dt ! raise an error if this function is executed error stop print *, "This function isn't executed" dt%date = date_str end function toml_datetime_ctor end module program derived_types_64 use mod_derived_types_64 implicit none type(toml_datetime) :: ts1 character(len=10) :: tmp = "2025-06-11" ts1 = toml_datetime(tmp) print *, "Date: ", ts1%date if (ts1%date /= "2025-06-11") error stop end program derived_types_64 lfortran-lfortran-2f73434/integration_tests/c_ptr_05.f900000664000175000017500000000234315141516316023335 0ustar alastairalastairprogram c_ptr_05 use iso_c_binding, only: c_ptr, c_f_pointer, c_char, c_loc, c_null_char, c_associated implicit none type(c_ptr) :: plapla integer(8) :: ii character(len=:,kind=c_char), allocatable, target :: buffer character(len=:), allocatable :: result ii = 4 allocate(character(len=ii+1,kind=c_char) :: buffer) buffer = c_char_"ABCD" // c_null_char plapla = c_loc(buffer) result = f_string_cptr_n(plapla, ii) print *, "Returned string:", trim(result) if (trim(result) /= "ABCD") error stop contains function f_string_cptr_n(cptr, n) result(s) use iso_c_binding, only: c_ptr, c_f_pointer, c_char implicit none type(c_ptr), intent(in), value :: cptr integer(8), intent(in) :: n character(len=n,kind=c_char) :: s character(len=n,kind=c_char), pointer :: sptr if (.not. c_associated(cptr)) then error stop "ERROR: f_string_cptr_n(): NULL C pointer passed" end if call c_f_pointer(cptr, sptr) if (.not. associated(sptr)) then error stop "ERROR: c_f_pointer(): failed to associate Fortran pointer" end if s = sptr end function f_string_cptr_n end program lfortran-lfortran-2f73434/integration_tests/intrinsics_270.f900000664000175000017500000001201215141516316024471 0ustar alastairalastairprogram intrinsics_270 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = atan([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = atan([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.56088872649127330_dp, -0.47735511827211041_dp, -0.28462833491299150_dp, & 0.56088872649127330_dp, 0.47735511827211041_dp, 0.28462833491299150_dp, 0.78539816339744828_dp, & 0.69239044268167327_dp, 0.76118851632111739_dp, -0.23708207111515284_dp] expected_y = [-0.560888708_sp, -0.477355093_sp, -0.284628332_sp, & 0.560888708_sp, 0.477355093_sp, 0.284628332_sp, 0.785398185_sp, & 0.692390442_sp, 0.761188507_sp, -0.237082079_sp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] res_x = atan(arg_x) res_y = atan(arg_y) expected_res_x = [-0.59664481328347907_dp, -0.49794635545452487_dp, -0.28862459062845508_dp, & 0.59664481328622843_dp, 0.49794635545452487_dp, 0.28862459062845508_dp, 0.51866936925501661_dp, & 7.7808866037245739E-002_dp, 0.25629014680688234_dp, -0.23936274280729375_dp, & -0.62937821282601869_dp, 0.51866936925501661_dp, 7.7808866037245739E-002_dp, & 0.25629014680688234_dp, -0.23936274280729375_dp] expected_res_y = [-0.596644759_sp, -0.497946322_sp, -0.288624585_sp, & 0.596644759_sp, 0.497946322_sp, 0.288624585_sp, 0.518669426_sp, & 7.78088495E-02_sp, 0.256290108_sp, -0.239362746_sp, & -0.629378200_sp, 0.518669426_sp, 7.78088495E-02_sp, & 0.256290108_sp, -0.239362746_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, atan(a) if (abs(atan(a)) - 0.47780028380709660_dp > 1e-12) error stop print *, atan(0.5178181202_dp) if (abs(atan(0.5178181202_dp) - 0.47780028380709660_dp) > 1e-12) error stop print *, atan(b) if (atan(b) - (-7.26877153E-02_sp) > 1e-5) error stop print *, atan(-0.072816_sp) if (atan(-0.072816_sp) - (-7.26877153E-02_sp) > 1e-5) error stop print *, atan(c) if (atan(c) - (-0.47780028380709660_dp) > 1e-12) error stop print *, atan(-0.5178181202_dp) if (atan(-0.5178181202_dp) - (-0.47780028380709660_dp) > 1e-12) error stop print *, atan(d) if (atan(d) - (7.26877153E-02_sp) > 1e-5) error stop print *, atan(0.072816_sp) if (atan(0.072816_sp) - (7.26877153E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, atan(a) if (abs(atan(a) - (-0.26550729967368875_dp)) > 1e-12) error stop print *, atan(-0.271927291_dp) if (abs(atan(-0.271927291_dp) - (-0.26550729967368875_dp)) > 1e-12) error stop print *, atan(b) if (atan(b) - ( -0.568086922_sp) > 1e-5) error stop print *, atan(-0.6382728_sp) if (atan(-0.6382728_sp) - (-0.568086922_sp) > 1e-5) error stop print *, atan(c) if (atan(c) - (0.26550729967368875_dp) > 1e-12) error stop print *, atan(0.271927291_dp) if (atan(0.271927291_dp) - (0.26550729967368875_dp) > 1e-12) error stop print *, atan(d) if (atan(d) - (0.568086922_sp) > 1e-5) error stop print *, atan(0.6382728_sp) if (atan(0.6382728_sp) - (0.568086922_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/complex_28.f900000664000175000017500000000036015141516316023677 0ustar alastairalastair! Test: complex*16 zero parameter with complex literal program complex_28 implicit none complex*16 zero parameter (zero = (0.0, 0.0)) complex*16 t(2, 2) t(1, 1) = zero if (t(1, 1) /= zero) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_11.f900000664000175000017500000000015515141516316024407 0ustar alastairalastairprogram intrinsics_11 integer, parameter :: x = 3 real, parameter :: y = real(x) print*, y end program lfortran-lfortran-2f73434/integration_tests/file_24.f900000664000175000017500000000153115141516316023144 0ustar alastairalastairprogram file_24 implicit none integer :: unit_no character(len=100) :: line character(len=100) :: filename filename = 'file_22_data.txt ' unit_no = 2 open (unit_no, file=filename) read(unit_no, *) line print *, "Contents of 'file_22_data.txt': ", line close(unit_no) open (unit_no, file="file_22_data.txt ") read(unit_no, *) line print *, "Contents of 'file_22_data.txt': ", line close(unit_no) print * open (unit_no, file="file 24 data.txt ") read(unit_no, *) line print *, "Contents of 'file 24 data.txt': ", line close(unit_no) filename = 'file 24 data.txt ' open (unit_no, file=filename) read(unit_no, *) line print *, "Contents of 'file 24 data.txt': ", line close(unit_no) end program file_24 lfortran-lfortran-2f73434/integration_tests/arrays_80.f900000664000175000017500000000066115141516316023533 0ustar alastairalastairprogram arrays_80 real :: A(5, 10), g(5) A = 1.0 g = 2.0 print *, trstlp(A, g) if( abs(trstlp(A, g) - 60.0) > 1e-8 ) error stop if( abs(trstlp(A, g) - sum(A) - sum(g)) > 1e-8 ) error stop contains function trstlp(A, g) result(d) real :: A(:,:), g(:) integer :: n, m real :: A_aug(size(A, 1), size(A, 2) + 1) real :: d m = size(A, 2) + 1 n = size(A, 1) A_aug = reshape([A, g], [n, m]) d = sum(A_aug) end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_149.f900000664000175000017500000000551515141516316024510 0ustar alastairalastairprogram intrinsics_149 type :: my_type integer :: a end type integer :: vector(2) = [1, 1] logical :: mask(2,2) integer :: field(2,2), unity(2,2) real :: vector_r(6) logical :: mask_r(3,2) real :: field_r(3,2), unity_r(3,2) double precision :: vector_d(6) logical :: mask_d(6) double precision :: field_d(6), unity_d(6) real :: vector_(4) logical :: mask_(4) real :: field_(4), unity_(4) real :: unity__(4) complex :: vector_c(8) logical :: mask_c(2, 4) complex :: field_c(2, 4), unity_c(2, 4) ! ! result: unity matrix integer, parameter :: unity_comp(4) = unpack([1, 2, 3, 4], [.true., .false., .true., .false.], [5, 6, 7, 8]) real, parameter :: unity_comp_r(4) = unpack([23.12, 23.12, 23.12, 23.12], [.false., .true., .true., .false.],& [681.31, 681.31, 681.31, 681.31]) type(my_type), dimension(4) :: struct_field type(my_type), dimension(2) :: struct_vec type(my_type) :: struct_res(4) print *, unity_comp if (sum(unity_comp) /= 17) error stop print*, unity_comp_r print*, sum(unity_comp_r) if (abs(sum(unity_comp_r) - 1408.85999) > 1e-5) error stop field = 0 mask = reshape([.true., .false., .false., .true.], shape(mask)) unity = unpack(vector, mask, field) print *, unity if (sum(unity) /= 2) error stop if (unity(1,1) /= 1) error stop if (unity(2,2) /= 1) error stop vector_r = 23.12 field_r = 681.31 mask_r = reshape([.true., .false., .false., .true., .true., .false.], shape(mask_r)) unity_r = unpack(vector_r, mask_r, field_r) print *, unity_r print *, sum(unity_r) if (abs(sum(unity_r) - 2113.29004) > 1e-8) error stop vector_d = 23.12D0 mask_d = .true. field_r = 681.31D0 unity_d = unpack(vector_d, mask_d, field_d) print *, unity_d print *, sum(unity_d) if (abs(sum(unity_d) - 138.72D0) > 1e-12) error stop print *, unpack([23.12, 23.12, 23.12, 23.12], [.true., .false., .true., .false.], [1.0, 2.0, 3.0, 4.0]) unity__ = unpack([23.12, 23.12, 23.12, 23.12], [.true., .false., .true., .false.], [1.0, 2.0, 3.0, 4.0]) print *, unity__ print *, sum(unity__) if (abs(sum(unity__) - 52.2400017) > 1e-8) error stop vector_ = [23.12, 23.12, 23.12, 23.12] mask_ = [.true., .false., .true., .false.] field_ = [1.0, 2.0, 3.0, 4.0] unity_ = unpack(vector_, mask_, field_) print *, unity_ print *, sum(unity_) if (abs(sum(unity_) - 52.2400017) > 1e-8) error stop vector_c = (23.12, -23.12) mask_c = reshape([.true., .false., .true., .false., .true., .false., .true., .false.], shape(mask_c)) field_c = (1.10, -91.24) unity_c = unpack(vector_c, mask_c, field_c) print *, unity_c print *, abs(sum(unity_c)) if (abs(abs(sum(unity_c)) - 467.586426) > 1e-8) error stop struct_vec(1)%a = 10 struct_vec(2)%a = 20 struct_field = [ my_type(1), my_type(2), my_type(3), my_type(4) ] struct_res = unpack(struct_vec, mask_, struct_field) if (struct_res(1)%a /= 10 .or. struct_res(3)%a /= 20) error stop if (struct_res(2)%a /= 2 .or. struct_res(4)%a /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/template_add_03.f900000664000175000017500000000171515141516316024651 0ustar alastairalastairmodule template_add_03_m implicit none private public :: add_t, test_template requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template add_t(t, f) require :: r(t, f) private public :: add_generic contains function add_generic(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z z = f(x, y) end function end template contains subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_add_03 use template_add_03_m implicit none call test_template() end program lfortran-lfortran-2f73434/integration_tests/test_ieee_arithmetic.f900000664000175000017500000000475615141516316026113 0ustar alastairalastairprogram test_ieee_arithmetic use iso_fortran_env, only : sp => real32, dp => real64 use ieee_arithmetic implicit none real(4) :: a = -1.0_sp, b = 1.0_sp real(8) :: x = 7.9_dp, y = -3.0_dp print*, ieee_is_nan(-1.0) if (ieee_is_nan(-1.0) .neqv. .false.) error stop print*, ieee_is_finite(-1.0) if (ieee_is_finite(-1.0) .neqv. .true.) error stop print*, ieee_is_negative(-1.0) if (ieee_is_negative(-1.0) .neqv. .true.) error stop print*, ieee_copy_sign(-1.0, 1.0) if (ieee_copy_sign(-1.0, 1.0) /= 1.0) error stop print*, ieee_support_datatype(-1.0) if (ieee_support_datatype(-1.0) .neqv. .true.) error stop print*, ieee_is_normal(-1.0) if (ieee_is_normal(-1.0) .neqv. .true.) error stop print*, ieee_unordered(-1.0, 1.0) if (ieee_unordered(-1.0, 1.0) .neqv. .false.) error stop print*, ieee_logb(-1.0) if (ieee_logb(-1.0) /= 0) error stop print*, ieee_rem(-1.0, 1.0) if (ieee_rem(-1.0, 1.0) /= 0) error stop print*, ieee_is_nan(a) if (ieee_is_nan(a) .neqv. .false.) error stop print*, ieee_is_finite(a) if (ieee_is_finite(a) .neqv. .true.) error stop print*, ieee_is_negative(a) if (ieee_is_negative(a) .neqv. .true.) error stop print*, ieee_copy_sign(a, b) if (abs(ieee_copy_sign(a, b) - 1.0_sp) > 1e-6) error stop print*, ieee_support_datatype(a) if (ieee_support_datatype(a) .neqv. .true.) error stop print*, ieee_is_normal(a) if (ieee_is_normal(a) .neqv. .true.) error stop print*, ieee_unordered(a, b) if (ieee_unordered(a, b) .neqv. .false.) error stop print*, ieee_logb(a) if (ieee_logb(a) /= 0) error stop print*, ieee_rem(a, b) if (abs(ieee_rem(a, b) - 0) > 1e-6) error stop print*, ieee_is_nan(x) if (ieee_is_nan(x) .neqv. .false.) error stop print*, ieee_is_finite(x) if (ieee_is_finite(x) .neqv. .true.) error stop print*, ieee_is_negative(x) if (ieee_is_negative(x) .neqv. .false.) error stop print*, ieee_copy_sign(x, y) if (abs(ieee_copy_sign(x, y) - (-7.9)) > 1e-6) error stop print*, ieee_support_datatype(x) if (ieee_support_datatype(x) .neqv. .true.) error stop print*, ieee_is_normal(x) if (ieee_is_normal(x) .neqv. .true.) error stop print*, ieee_unordered(x, y) if (ieee_unordered(x, y) .neqv. .false.) error stop print*, ieee_logb(x) if (ieee_logb(x) /= 2.0) error stop print*, ieee_rem(x, y) if (abs(ieee_rem(x, y) - -1.0999999046325684) > 1e-6_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_344.f900000664000175000017500000000041415141516316024476 0ustar alastairalastairprogram main integer, dimension(2, 2) :: x integer(8), dimension(2, 2) :: y integer(8), dimension(2, 2) :: ans x = 2 ans = maskl(x, 8) y = -4611686018427387904_8 print *, ans print *, y if (any(ans /= y)) error stop end program lfortran-lfortran-2f73434/integration_tests/transfer_10.f900000664000175000017500000000133415141516316024045 0ustar alastairalastairprogram mre_transfer_no_c_char implicit none character(len=1) :: buf(20) character(len=*), parameter :: fstr = "hello" integer :: i integer, parameter :: expected(5) = [104, 101, 108, 108, 111] call f_character_transfer(fstr, buf, size(buf)) do i = 1, 5 if (iachar(buf(i)) /= expected(i)) error stop "wrong value" end do print *, "test passed" contains subroutine f_character_transfer(rhs, lhs, length) implicit none character(len=*), intent(in) :: rhs character(len=1), intent(out) :: lhs(*) integer, intent(in) :: length integer :: n n = min(length, len(rhs)) lhs(1:n) = transfer(rhs, lhs(1:n)) end subroutine f_character_transfer end program mre_transfer_no_c_char lfortran-lfortran-2f73434/integration_tests/derived_types_101.f900000664000175000017500000000125015141516316025145 0ustar alastairalastairprogram derived_types_101 implicit none type :: base integer, allocatable :: s(:) end type base type, extends(base) :: string_t integer, allocatable :: keys(:) end type string_t type(string_t) :: arg print *, "First call" call new(arg) print *, "Second call" call new(arg) contains subroutine new(args) type(string_t), intent(out) :: args if (allocated(args%s)) error stop "ERROR: args%s is allocated" if (allocated(args%keys)) error stop "ERROR: args%keys is allocated" allocate(args%s(10)) allocate(args%keys(10)) end subroutine new end program derived_types_101 lfortran-lfortran-2f73434/integration_tests/callback_03.f900000664000175000017500000000120115141516316023750 0ustar alastairalastairmodule callback_03 contains real function cb(f, a, b) real, intent(in) :: a, b interface real function f(x) implicit none real, intent(in) :: x end function end interface cb = (b-a) + f(a) + f(b) end function subroutine foo1(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = 2*x end function f end subroutine foo1 subroutine foo2(c, d) real :: c, d print *, cb(f, c, d) contains real function f(x) real, intent(in) :: x f = -2*x end function f end subroutine foo2 end module program main use callback_03 call foo1(1.5, 2.0) call foo2(1.5, 2.0) end program main lfortran-lfortran-2f73434/integration_tests/arrays_83.f900000664000175000017500000000063515141516316023537 0ustar alastairalastairprogram arrays_83 integer :: anew2(17) integer, allocatable :: q_new(:) allocate(q_new(2)) q_new = [100, 1220] anew2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, q_new] print *, anew2 if( any(anew2(1:15) /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) ) error stop if( anew2(16) /= 100 ) error stop if( anew2(17) /= 1220 ) error stop end program arrays_83 lfortran-lfortran-2f73434/integration_tests/intrinsics_253.f900000664000175000017500000000374215141516316024504 0ustar alastairalastairprogram intrinsics_253 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp), parameter :: r1 = derfc(1.1_dp) real(dp), parameter :: r2 = derfc(4.12_dp) real(dp), parameter :: ar1(3) = derfc([0.5_dp, -1.5_dp, 2.2_dp]) real(dp), parameter :: ar2(2) = derfc([-0.2_dp, 0.0_dp]) real(dp) :: x, y, z real(dp) :: arr1(3), arr2(3), res(3) x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 1.58035442023170862e-21_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 8.54408946394494113e-06_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 0.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 2.00000000000000000e+00_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 1.99999145591053606e+00_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 2.00000000000000000e+00_dp) > 1e-12) error stop print *, r1 if (abs(r1 - 1.19794930425918267e-01_dp) > 1e-12_dp) error stop print *, r2 if (abs(r2 - 5.65815721936131674e-09_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [4.79500122186953481e-01_dp, 1.96610514647531076e+00_dp, & 1.86284629798188941e-03_dp]) > 1e-12_dp)) error stop print *, ar2 if (any(abs(ar2 - [1.22270258921047859e+00_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_dp, -3.1473863781_dp, -7389.83936383_dp] print *, derfc(arr1) if (any(abs(derfc(arr1) - [2.00000000000000000e+00_dp, 1.99999145591053606e+00_dp, & 2.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = derfc(arr2) print *, res if (any(abs(res - [1.58035442023170862e-21_dp, 8.54408946394494113e-06_dp, & 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/bindc_02b.f900000664000175000017500000000317415141516316023447 0ustar alastairalastairmodule bindc_02b use iso_c_binding, only: c_ptr, c_int implicit none interface ! void driver(); subroutine driver() bind(c) end subroutine ! void print_ptr1(int n, float *A); subroutine print_ptr1(n, A) bind(c) import :: c_ptr, c_int integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A end subroutine ! void print_ptr2(int *n, float *A); subroutine print_ptr2(n, A) bind(c) import :: c_ptr, c_int integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A end subroutine end interface contains ! void callback1(int n, float *A); subroutine callback1(n, A) bind(c) integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback1: calling print_ptr1(n, A), n =", n call print_ptr1(n, A) end subroutine ! void callback1b(int n, float *A); subroutine callback1b(n, A) bind(c) integer(c_int), value, intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback1b: calling print_ptr2(n, A), n =", n call print_ptr2(n, A) end subroutine ! void callback2(int *n, float *A); subroutine callback2(n, A) bind(c) integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback2: calling print_ptr2(n, A), n =", n call print_ptr2(n, A) end subroutine ! void callback2b(int *n, float *A); subroutine callback2b(n, A) bind(c) integer(c_int), intent(in) :: n type(c_ptr), value, intent(in) :: A print *, "callback2b: calling print_ptr1(n, A), n =", n call print_ptr1(n, A) end subroutine end module lfortran-lfortran-2f73434/integration_tests/fma.f900000664000175000017500000000115115141516316022461 0ustar alastairalastairprogram fma implicit none real :: x = 4.0 real, parameter :: pi = 3.14 real(8) :: S1 = 1.0, S2 = 2.0 real(8) :: z = 1.0 integer ::b(10) real :: r x = (x * 4 + 0.5_4*sign(1._4, x)) - x * pi z = S1+z*S2 if( abs(x - 3.94) > 1e-6 ) error stop if( abs(z - 3.0) > 1e-6 ) error stop b = 1 r = 1 b(1) = nint(sign(1.0,r +r*r), 4) ! Test FMA opt. with `--fast` (functioncall with fma nested) print *, b(1) if(b(1) /= 1) error stop b(1) = r -r*r ! Test FMA opt. with `--fast` (sub op) print *, b(1) if(b(1) /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/char_array_indexing.f900000664000175000017500000000067015141516316025723 0ustar alastairalastairprogram character_array_indexing character(len=2), dimension(2) :: b character(len=2), dimension(2) :: a b(1) = "xi" b(2) = "xp" if (len(b(2:1:-2)) /= 2) error stop if (size(b(2:1:-2)) /= 1) error stop a(1:2) = b(1:2) if (a(1) /= "xi") error stop if (a(2) /= "xp") error stop a(1:2) = b(2:1:-1) if (a(1) /= "xp") error stop if (a(2) /= "xi") error stop end program character_array_indexing lfortran-lfortran-2f73434/integration_tests/bindc_06b.c0000664000175000017500000000023315141516316023270 0ustar alastairalastair#include #include int c_int4 = 1; int64_t c_int8 = 2; int tmp_value = 12; bool c_logical = false; void *c_type_c_ptr = &tmp_value; lfortran-lfortran-2f73434/integration_tests/doloop_05.f900000664000175000017500000000025215141516316023517 0ustar alastairalastairprogram doloop_05 implicit none integer :: i, j 1 j = 0 2 I_LOOP: do i = 1, 10 3 if (i == 2) cycle I_loop 4 j = j + i 5 end do i_Loop 6 if (j /= 53) error stop end lfortran-lfortran-2f73434/integration_tests/functions_23.f900000664000175000017500000000065115141516316024236 0ustar alastairalastairprogram functions_23 real :: x(5, 5) real :: res(5) x = 4.59 res = corr_2_rsp_rsp(x, 1) print *, res if (any(abs(res - 21.0681019) > 1e-6)) error stop contains function corr_2_rsp_rsp(x, dim, mask) result(res) real, intent(in) :: x(:, :) integer, intent(in) :: dim logical, intent(in), optional :: mask real :: res(merge(size(x, 1), size(x, 2), mask = 1 null() end type ctx_t abstract interface real function f_iface(x) real, intent(in) :: x end function f_iface end interface end module issue_9063_m program test_main use issue_9063_m print *, "Test Passed Successfully!" end program test_main lfortran-lfortran-2f73434/integration_tests/intrinsics_402.f900000664000175000017500000000100215141516316024463 0ustar alastairalastairprogram intrinsics_402 implicit none intrinsic :: iabs call xub (iabs, 42) call xub (iabs, -99) contains subroutine xub (ifn, val) implicit none interface function ifn(x) result(r) integer, intent(in) :: x integer :: r end function end interface integer :: val integer :: result result = ifn (val) print *, result if (val == 42 .and. result /= 42) error stop "Expected 42" if (val == -99 .and. result /= 99) error stop "Expected 99" end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_op_15.f900000664000175000017500000000145715141516316024233 0ustar alastairalastairmodule arrays_op_15_module_01 implicit none type t integer :: i end type t contains function new_value(i) result(res) integer :: i type(t) :: res res%i = i end function new_value function get_default_values() result(type_1) type(t), allocatable :: type_1(:) allocate(type_1(2)) type_1 = [new_value(1), new_value(2)] end function get_default_values end module arrays_op_15_module_01 program arrays_op_15 use arrays_op_15_module_01 implicit none type(t) :: res type(t), allocatable :: values(:) allocate(values(2)) values = get_default_values() print *, values(1), values(2) res = values(1) if (res%i /= 1) error stop res = values(2) if (res%i /= 2) error stop end program arrays_op_15 lfortran-lfortran-2f73434/integration_tests/class_47.f900000664000175000017500000000261515141516316023343 0ustar alastairalastairmodule class_47_mod type, abstract :: AbsType contains procedure(method2), deferred :: method2 end type AbsType abstract interface function method2(self,arr) result(a) import class(AbsType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) end function method2 end interface type, extends(AbsType) :: MyType contains procedure :: method2 => my_method2 end type MyType type :: SomeType integer, allocatable :: arr(:) class(MyType), allocatable :: obj contains procedure :: method1 end type SomeType contains subroutine method1(self) class(SomeType), intent(inout) :: self allocate(MyType :: self%obj) self%arr = self%obj%method2(self%arr) end subroutine method1 function my_method2(self, arr) result(a) class(MyType), intent(in) :: self integer, intent(in) :: arr(:) integer :: a(size(arr)) integer :: i do i = 1, size(arr) a(i) = arr(i) * 2 end do end function my_method2 end module class_47_mod program class_47 use class_47_mod implicit none class(SomeType), allocatable :: s allocate(s) allocate(s%arr(3)) s%arr = [1, 2, 3] call s%method1() print *, "s%arr: ", s%arr if (.not. all(s%arr == [2, 4, 6])) error stop end program class_47lfortran-lfortran-2f73434/integration_tests/double_complex_01.f900000664000175000017500000000011115141516316025212 0ustar alastairalastairdouble complex function wzdtoc() end function program main end program lfortran-lfortran-2f73434/integration_tests/enum_02.f900000664000175000017500000000017715141516316023172 0ustar alastairalastairprogram enum_02 use enum_02_module, only: compiler_enum implicit none print *, compiler_enum end program enum_02 lfortran-lfortran-2f73434/integration_tests/arrays_op_7.f900000664000175000017500000000034515141516316024147 0ustar alastairalastairprogram arrays_op_7 implicit none integer :: x(3), y(3) x = 3 call f(x, y) print *, y contains subroutine f(x, y) integer, intent(in) :: x(:) integer, intent(out) :: y(:) y = x end subroutine end program lfortran-lfortran-2f73434/integration_tests/print_05.f900000664000175000017500000000030315141516316023354 0ustar alastairalastairprogram print_05 implicit none character(len=4) :: s1(4) = ['sngl', 'dble', 'xten', 'quad'] integer :: i print *, s1 do i = 1, size(s1) print *, i, "|", s1(i), "|" end do end program print_05 lfortran-lfortran-2f73434/integration_tests/case_09.f900000664000175000017500000000135315141516316023145 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/8407 ! Select case with multiple range conditions in a single case ! Exact MRE from issue body program casetest implicit none integer :: i do i = 1,5 select case (i) case (2:3,5) print "(A,I0)",'case (2:3,5) i=',i case default print "(A,I0)",'case default i=',i end select end do if (.not. check()) error stop contains logical function check() integer :: j check = .true. do j = 1,5 select case (j) case (2:3,5) if (j /= 2 .and. j /= 3 .and. j /= 5) check = .false. case default if (j /= 1 .and. j /= 4) check = .false. end select end do end function check end program casetest lfortran-lfortran-2f73434/integration_tests/logical3.f900000664000175000017500000000265215141516316023422 0ustar alastairalastairprogram logical3 ! This program checks logical operators implicit none logical :: a, b ! assigning values a = .true. b = .false. if (a .and. b) then print *, "Line 1 - Condition is true" error stop else print *, "Line 1 - Condition is false" end if if (a .or. b) then print *, "Line 2 - Condition is true" else print *, "Line 2 - Condition is false" error stop end if if (a .xor. b) then print *, "Line xor - Condition is true" else print *, "Line xor - Condition is false" error stop end if ! changing values a = .false. b = .true. if (.not.(a .and. b)) then print *, "Line 3 - Condition is true" else print *, "Line 3 - Condition is false" error stop end if if (b .neqv. a) then print *, "Line 4 - Condition is true" else print *, "Line 4 - Condition is false" error stop end if if (b .eqv. a) then print *, "Line 5 - Condition is true" error stop else print *, "Line 5 - Condition is false" end if ! changing values a = .true. b = .true. if (a .and. b) then print *, "Line 6 - Condition is true" else print *, "Line 6 - Condition is false" error stop end if if (a .or. b) then print *, "Line 7 - Condition is true" else print *, "Line 7 - Condition is false" error stop end if if (a .xor. b) then print *, "Line 8 xor - Condition is true" error stop else print *, "Line 8 xor - Condition is false" end if end program logical3 lfortran-lfortran-2f73434/integration_tests/lapack_10.f900000664000175000017500000000161015141516316023451 0ustar alastairalastairprogram lapack_10 implicit none ! Declare LSAMEN for the caller logical :: lsamen character(len=3) :: a, b integer :: n a = 'ABC' b = 'Abc' n = 3 print *, lsamen(n, a, b) end program lapack_10 logical function lsamen(n, ca, cb) implicit none integer, intent(in) :: n character(len=*), intent(in) :: ca, cb integer :: i logical :: lsame external :: lsame lsamen = .false. if (len(ca) < n .or. len(cb) < n) return do i = 1, n if (.not. lsame(ca(i:i), cb(i:i))) return end do lsamen = .true. end function lsamen logical function lsame(a, b) implicit none character(len=*), intent(in) :: a, b ! Case-insensitive comparison of single characters lsame = (iachar(a) == iachar(b) .or. & iachar(a) == iachar(b) + 32 .or. & iachar(a) + 32 == iachar(b)) end function lsame lfortran-lfortran-2f73434/integration_tests/fortran_01.f900000664000175000017500000000023615141516316023674 0ustar alastairalastairprogram fortran_01 use iso_c_binding, only: c_ptr, c_loc implicit none integer, pointer :: x type(c_ptr) :: ptr ptr = c_loc(x) end programlfortran-lfortran-2f73434/integration_tests/loop_var_use_after_loop.f900000664000175000017500000000203315141516316026625 0ustar alastairalastairprogram main implicit none integer :: i ! Loop 1 do i = 1, 2 print *,'In loop 1 i =', i if (i < 2) exit end do print *,'After loop 1 i = ', i if (i /= 1) error stop ! Loop 2 print * do i = 1, 3 print *,'In loop 2 i = ', i if (i < 2) then print *, "if (i < 2) then" else exit end if end do print *,'After loop 2 i = ', i if (i /= 2) error stop ! Loop 3 print * do i = 1, 6 print *,'In loop 3 i = ', i if (i <= 4) then if (i - 1 == 3) then if (i - 1 == 2) exit exit end if end if end do print *,'After loop 3 i = ', i if (i /= 4) error stop ! Loop 4 print * do i = 1, 6 print *,'In loop 4 i = ', i if (i <= 4) then if (i - 1 == 3) then if (i - 1 == 2) exit exit else print *, "i - 1 /= 3" end if end if end do print *,'After loop 4 i = ', i if (i /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_65_child.f900000664000175000017500000000030615141516316025044 0ustar alastairalastairmodule modules_65_child use modules_65_base, only: base_t implicit none type, extends(base_t) :: child_t integer :: extra = 42 end type child_t end module modules_65_child lfortran-lfortran-2f73434/integration_tests/complex_17.f900000664000175000017500000000125515141516316023701 0ustar alastairalastairpure function linspace_n_1_cdp_cdp(x, y, n) result(res) integer, intent(in) :: n complex :: res(n) real, intent(in) :: x(n) real, intent(in) :: y(n) res = cmplx(x, y) end function linspace_n_1_cdp_cdp program complex_17 implicit none integer :: i real :: x(10), y(10) complex :: z(10) interface pure function linspace_n_1_cdp_cdp(x, y, n) result(res) integer, intent(in) :: n complex :: res(n) real, intent(in) :: x(n) real, intent(in) :: y(n) end function linspace_n_1_cdp_cdp end interface x = 1.0 y = 2.0 z = linspace_n_1_cdp_cdp(x, y, 10) print *, z print *, abs(z) do i = 1, 10 if (abs(abs(z(i)) - 2.236068) > 1e-8) error stop end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_347.f900000664000175000017500000000075015141516316024504 0ustar alastairalastairprogram intrinsics_347 integer :: x(2, 2), y(4, 2, 2) x = reshape([1, 2, 3, 4], [2, 2]) y = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) print *, reshape([1, 2, 3, 4],[2, 2]) if (any(x /= reshape([1, 2, 3, 4], [2, 2]))) error stop print *, reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) if (any(y /= reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]))) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_39.f900000664000175000017500000000074215141516316023534 0ustar alastairalastairprogram openmp_39 use omp_lib ! declare variables as required integer :: ny, nx, nz,nk integer :: iy, ix, iz,ik ny=3 nx=4 nz=5 nk=6 !$omp parallel do collapse(2) private(iy, ix, iz) do ix = 1, nx do iy = 1, ny print *,"iy->", iy,"ix->", ix do iz = 1, nz do ik = 1, nk print *,"iy->", iy,"ix->", ix,"iz->", iz,"ik->", ik end do end do end do end do !$omp end parallel do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_99.f900000664000175000017500000000045015141516316024425 0ustar alastairalastairmodule intrinsics_99_m implicit none contains function all_true(tf,idim) result(vec) logical, intent(in) :: tf(:,:) integer, intent(in) :: idim logical :: vec(size(tf,dim=3-idim)) vec = .true. end function all_true end module program intrinsics_99 end lfortran-lfortran-2f73434/integration_tests/class_84.f900000664000175000017500000000433215141516316023342 0ustar alastairalastairmodule class_84_mod implicit none type :: string_t character(len=:), allocatable :: s end type type :: temp type(string_t), allocatable :: strs(:) end type type :: dependency_config_t type(temp), allocatable :: arr(:) end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t end type dependency_node_t end module class_84_mod program class_84 use class_84_mod implicit none type(dependency_node_t), allocatable :: a, b !------------------------- ! Allocate scalars !------------------------- allocate(a, b) !------------------------- ! Initialize 'a' !------------------------- allocate(a%arr(2)) allocate(a%arr(1)%strs(2)) allocate(character(len=5) :: a%arr(1)%strs(1)%s) allocate(character(len=3) :: a%arr(1)%strs(2)%s) a%arr(1)%strs(1)%s = "hello" a%arr(1)%strs(2)%s = "abc" allocate(a%arr(2)%strs(1)) allocate(character(len=4) :: a%arr(2)%strs(1)%s) a%arr(2)%strs(1)%s = "test" !------------------------- ! Assignment under test !------------------------- b = a !------------------------- ! Validation: allocation !------------------------- if (.not. allocated(b%arr)) error stop "b%arr not allocated" if (size(b%arr) /= 2) error stop "b%arr wrong size" if (.not. allocated(b%arr(1)%strs)) error stop "b%arr(1)%strs not allocated" if (size(b%arr(1)%strs) /= 2) error stop "b%arr(1)%strs wrong size" if (.not. allocated(b%arr(1)%strs(1)%s)) error stop "string not allocated" if (len(b%arr(1)%strs(1)%s) /= 5) error stop "string length mismatch" !------------------------- ! Validation: values !------------------------- if (b%arr(1)%strs(1)%s /= "hello") error stop "value copy failed" if (b%arr(1)%strs(2)%s /= "abc") error stop "value copy failed" if (b%arr(2)%strs(1)%s /= "test") error stop "value copy failed" !------------------------- ! Validation: deep copy !------------------------- a%arr(1)%strs(1)%s = "xxxxx" if (b%arr(1)%strs(1)%s == "xxxxx") error stop "shallow copy detected" print *, "OK: extended-type allocatable assignment is correct" end program class_84 lfortran-lfortran-2f73434/integration_tests/custom_operator_01.f900000664000175000017500000000121215141516316025441 0ustar alastairalastairmodule custom_operator_01_a implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_01_a module custom_operator_01_b integer :: negation = 5 end module custom_operator_01_b program custom_operator_01 use custom_operator_01_b, only : negation use custom_operator_01_a, only : operator(.negation.) implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_367.f900000664000175000017500000000155115141516316024506 0ustar alastairalastairPROGRAM intrinsics_367 CHARACTER(len=255) :: test_env_var integer :: stat CALL get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var) WRITE (*,*) TRIM(test_env_var) if (trim(test_env_var) /= "STATUS OK!") error stop test_env_var = "" call get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var, status=stat) print *, trim(test_env_var) if (stat /= 0) error stop if (trim(test_env_var) /= "STATUS OK!") error stop test_env_var = "" call get_environment_variable("LFORTRAN_TEST_ENV_VAR_MISSING", test_env_var, status=stat) if (stat == 0) error stop if (trim(test_env_var) /= "") error stop ! Test with only name and status (no value parameter) call get_environment_variable("LFORTRAN_TEST_ENV_VAR", status=stat) if (stat /= 0) error stop call get_environment_variable("LFORTRAN_TEST_ENV_VAR_MISSING", status=stat) if (stat == 0) error stop END PROGRAM lfortran-lfortran-2f73434/integration_tests/class_60.f900000664000175000017500000000154315141516316023335 0ustar alastairalastairmodule class_60_mod implicit none type :: base_t end type type, extends(base_t) :: extended_t integer :: key end type type :: temp_t type(extended_t) :: child(2) end type contains subroutine call_describe(obj) class(base_t), intent(in) :: obj(:) class(base_t), allocatable :: obj_tmp allocate(obj_tmp) obj_tmp = obj(1) select type (obj_tmp) type is (extended_t) ! if (obj_tmp%key /= 10) error stop ! TODO: Handle array arg in convert_to_polymorphic in LLVM Backend class default error stop end select end subroutine end module class_60_mod program class_60 use class_60_mod interface describe module procedure :: call_describe end interface type(temp_t) :: x x%child(1) = extended_t(10) x%child(2) = extended_t(20) call describe(x%child) end program class_60lfortran-lfortran-2f73434/integration_tests/derived_types_49.f900000664000175000017500000000123515141516316025103 0ustar alastairalastairmodule derived_types_49_m implicit none public :: base, derived type, abstract :: base integer :: a end type base type, extends(base) :: derived integer :: b end type derived type, extends(derived) :: derived2 integer :: c integer :: d end type derived2 end module derived_types_49_m program derived_types_49 use derived_types_49_m implicit none type(derived2) :: set0, set1 set0 = derived2(10, 20, 30, 40) set1 = set0 if (set1%a /= set0%a) error stop if (set1%b /= set0%b) error stop if (set1%c /= set0%c) error stop if (set1%d /= set0%d) error stop end program derived_types_49 lfortran-lfortran-2f73434/integration_tests/intrinsics_176.f900000664000175000017500000000574415141516316024514 0ustar alastairalastairprogram intrinsics_176 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real :: x real(dp) :: y integer :: i integer(8) :: j real(sp), parameter :: x1 = set_exponent(4.1, 4) real(dp), parameter :: y1 = set_exponent(4.1_dp, 5) real(sp), parameter :: ar1(3) = set_exponent([1.1213, 2.1643, 3.613], 3_8) real(dp), parameter :: ar2(3) = set_exponent([1.1213_dp, 2.1643_dp, 3.613_dp], 3) real(sp) :: arr1(3) real(dp) :: arr2(3) arr1 = [11.90_sp, 12.00_sp, 45.09_sp] arr2 = [890.4_dp, 12.00_dp, 675.45_dp] print *, x1 if ((x1 - 8.19999981) > 1e-7) error stop print *, y1 if ((y1 - 16.3999999999999986_dp) > 1e-12) error stop print *, ar1 if (any(ar1 - [4.48519993e+00_sp, 4.32859993e+00_sp, 7.22599983e+00_sp] > 1e-5)) error stop print *, ar2 if (any(ar2 - [4.48519999999999985e+00_dp, 4.32859999999999978e+00_dp, 7.22599999999999998e+00_dp] > 1e-5)) error stop print *, set_exponent(arr1, 3) if (any(set_exponent(arr1, 3) - [11.90_sp, 12.00_sp, 45.09_sp] > 1e-5)) error stop print *, set_exponent(arr2, 3) if (any(set_exponent(arr2, 3) - [890.4_dp, 12.00_dp, 675.45_dp] > 1e-5)) error stop i = 4 j = 5 x = 4.1 y = 4.1_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - 8.19999981) > 1e-7) error stop print *, set_exponent(4.1_dp, 5) if ((set_exponent(4.1_dp, 5) - 16.3999999999999986_dp) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - 16.399999999999999_dp) > 1e-12) error stop print *, set_exponent(4.1, 4) if ((set_exponent(4.1, 4) - 8.19999981) > 1e-7) error stop i = 11 j = 7 x = 0.5 y = 0.5_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - 1024.00000) > 1e-7) error stop print *, set_exponent(0.5_dp, 7) if ((set_exponent(0.5_dp, 7) - 64.000000000000000_dp) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - 64.000000000000000_dp) > 1e-12) error stop print *, set_exponent(0.5, 11) if ((set_exponent(0.5, 11) - 1024.00000) > 1e-7) error stop i = 15 j = 12 x = -11.56 y = -15.678_dp print *, set_exponent(x, i) if ((set_exponent(x, i) - (-23674.8809)) > 1e-7) error stop print *, set_exponent(-15.678_dp, 12) if ((set_exponent(-15.678_dp, 12) - (-4013.5680000000002_dp)) > 1e-12) error stop print *, set_exponent(y, j) if ((set_exponent(y, j) - (-4013.5680000000002_dp)) > 1e-12) error stop print *, set_exponent(-11.56, 15) if ((set_exponent(-11.56, 15) - (-23674.880)) > 1e-7) error stop print *, kind(set_exponent(x, i)) if (kind(set_exponent(x, i)) /= 4) error stop print *, kind(set_exponent(-15.678_dp, 12)) if (kind(set_exponent(-15.678_dp, 12)) /= 8) error stop print *, kind(set_exponent(y, j)) if (kind(set_exponent(y, j)) /= 8) error stop print *, kind(set_exponent(-11.56, 15)) if (kind(set_exponent(-11.56, 15)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/bindc5.f900000664000175000017500000000156315141516316023071 0ustar alastairalastairmodule thread_data_module_tasks use, intrinsic :: iso_c_binding implicit none type :: thread_data type(c_ptr) :: i_ptr end type thread_data end module thread_data_module_tasks program bindc5 use thread_data_module_tasks use, intrinsic :: iso_c_binding implicit none integer, target :: i integer, pointer :: ptr_i, ptr_i2 type(thread_data), pointer :: d,d1 type(thread_data), target :: threadData, taskData type(c_ptr) :: threadPtr, taskPtr i=0 threadData%i_ptr = c_loc(i) threadPtr = c_loc(threadData) call c_f_pointer(threadPtr, d) call c_f_pointer(d%i_ptr, ptr_i) ptr_i=2 taskData%i_ptr = d%i_ptr taskPtr = c_loc(taskData) call c_f_pointer(taskPtr, d1) call c_f_pointer(d1%i_ptr, ptr_i2) ptr_i2=3 print*, i,ptr_i2,ptr_i if(i/=ptr_i2 .and. i/=ptr_i) error stop end program bindc5lfortran-lfortran-2f73434/integration_tests/arrays_79.f900000664000175000017500000000074415141516316023545 0ustar alastairalastairmodule arrays_79_mod contains subroutine ff(q) integer, intent(in) :: q(:,:) integer :: anew(size(q)) integer :: anew2(4) anew2 = [q] print *, anew2 anew = reshape(anew2, [size(q)]) print *, anew if(any(anew /= [1,2,3,4])) error stop end subroutine ff end module arrays_79_mod program arrays_79 use arrays_79_mod integer :: arr(2,2) arr = reshape([1,2,3,4], [2,2]) call ff(arr) end program arrays_79lfortran-lfortran-2f73434/integration_tests/intrinsics_239.f900000664000175000017500000000261415141516316024505 0ustar alastairalastairprogram intrinsics_239 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp) :: x = 0.17_sp real(dp) :: y = 0.29_dp real(sp), parameter :: x1 = erfc_scaled(0.11_sp) real(dp), parameter :: y1 = erfc_scaled(0.34_dp) real(sp) :: x2(3) = [0.11_sp, 0.12_sp, 0.13_sp] real(dp) :: y2(3) = [0.34_dp, 0.35_dp, 0.36_dp] real(sp), parameter :: x3(3) = erfc_scaled([0.11_sp, 0.12_sp, 0.13_sp]) real(dp), parameter :: y3(3) = erfc_scaled([0.34_dp, 0.35_dp, 0.36_dp]) print *, erfc_scaled(x) if ( abs(erfc_scaled(x) - 0.833758295_sp) > 1e-6 ) error stop print *, erfc_scaled(y) if ( abs(erfc_scaled(y) - 0.74152871645209784_dp) > 1e-12 ) error stop print *, x1 if ( abs(x1 - 0.887045681_sp) > 1e-6 ) error stop print *, y1 if ( abs(y1 - 0.70791780660314296_dp) > 1e-12 ) error stop print *, erfc_scaled(x2) if ( any(abs(erfc_scaled(x2) - [0.887045741_sp, 0.877791286_sp, 0.868690372_sp]) > 1e-6) ) error stop print *, erfc_scaled(y2) if ( any(abs(erfc_scaled(y2) - [0.70791780660314296_dp, 0.70149633111958920_dp, 0.69517054536879996_dp]) > 1e-12) ) error stop print *, x3 if ( any(abs(x3 - [0.887045741_sp, 0.877791286_sp, 0.868690372_sp]) > 1e-6) ) error stop print *, y3 if ( any(abs(y3 - [0.70791780660314296_dp, 0.70149633111958909_dp, 0.69517054536879996_dp]) > 1e-12) ) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_72.f900000664000175000017500000000166115141516316023535 0ustar alastairalastairprogram arrays_72 implicit none real :: xpt(5, 10) xpt = 2.0 xpt(1, :) = 3.0 xpt(2, :) = 4.0 xpt(3, :) = 5.0 xpt(:, 4) = 6.0 xpt(:, 5) = 7.0 xpt(:, 6) = 8.0 xpt(:, 7) = 9.0 call initq(xpt) contains function diag(A) result(D) implicit none real(4), intent(in) :: A(:, :) real(4), allocatable :: D(:) integer :: dlen, i dlen = max(0_4, int(min(size(A, 1), size(A, 2)) - 0, 4)) allocate(D(dlen)) D = [(A(i, i), i=1, dlen)] end function diag subroutine initq(xpt) real(4), intent(in), target :: xpt(:, :) real(4) :: xa(min(size(xpt, 1), size(xpt, 2) - size(xpt, 1) - 1)) real(4) :: xb(size(xa)) integer :: ndiag, n, npt n = int(size(xpt, 1), kind(n)) npt = int(size(xpt, 2), kind(npt)) ndiag = min(n, npt - n - 1) xa = diag(xpt(:, 2:ndiag + 1)) xb = diag(xpt(:, n + 2:n + ndiag + 1)) print *, xa print *, xb if( any(xa /= [3.0, 4.0, 6.0, 7.0]) ) error stop if( any(xb /= [9.0, 4.0, 5.0, 2.0]) ) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/character_04.f900000664000175000017500000000015615141516316024161 0ustar alastairalastairprogram character_04 implicit none character(len=1, kind=1), parameter :: c_null_char = "" end programlfortran-lfortran-2f73434/integration_tests/read_07.f900000664000175000017500000000113315141516316023137 0ustar alastairalastair! MRE: Formatted READ with mixed types (string + logical) ! ICE in visit_FileRead: get_string_type() called on non-character type ! Reduced from LAPACK BLAS/TESTING/dblat2.f program read_07 implicit none character(6) :: sname logical :: ltest integer :: u, stat open(newunit=u, file="read_07_data.txt", status="old", iostat=stat) if (stat /= 0) error stop read(u, fmt=100, iostat=stat) sname, ltest if (stat /= 0) error stop 100 format(a6, l2) close(u) if (sname /= "ABCDEF") error stop if (.not. ltest) error stop print *, "PASS" end program read_07 lfortran-lfortran-2f73434/integration_tests/arrays_reshape_17.f900000664000175000017500000000100115141516316025227 0ustar alastairalastairprogram arrays_reshape_17 use iso_fortran_env, only: int8 integer(int8), dimension(8) :: x x = [1_1, 2_1, 3_1, 4_1, 5_1, 6_1, 7_1, 8_1] print *, median_all_1_iint8_dp(x) if (abs(median_all_1_iint8_dp(x) - 36.0) > 1e-16) error stop contains function median_all_1_iint8_dp(x) result(res) use iso_fortran_env, only: int64, int8, dp => real64 integer(int8), intent(inout) :: x(:) real(dp) :: res integer(kind = int64) :: n n = size(x) x = reshape(x, [n]) res = sum(x) end function median_all_1_iint8_dp end program lfortran-lfortran-2f73434/integration_tests/entry_03.f900000664000175000017500000000135115141516316023363 0ustar alastairalastairsubroutine x(dummy) real :: dummy print *, "Printed using subroutine call: ", dummy if (abs(dummy - 10.0) > 1e-7) error stop dummy = 5.0 entry y(dummy) print *, "Printed using y entry statement: ", dummy if (abs(dummy - 5.0) > 1e-7) error stop dummy = 2.5 return entry z(dummy) print *, "Printed using z entry statement: ", dummy if (abs(dummy - 2.5) > 1e-7) error stop dummy = 1.25 return entry w(dummy) print *, "Printed using w entry statement: ", dummy if (abs(dummy - 1.25) > 1e-7) error stop return end subroutine program entry_03 real :: dummy dummy = 10.0 call x(dummy) dummy = 5.0 call y(dummy) dummy = 2.5 call z(dummy) dummy = 1.25 call w(dummy) end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_19.f900000664000175000017500000000265115141516316026461 0ustar alastairalastairmodule operator_overloading_19_mod1 implicit none ! Abstract base type type, abstract :: temp contains procedure(is_equal), deferred :: is_same generic :: operator(==) => is_same end type temp abstract interface logical function is_equal(this, other) import :: temp class(temp), intent(in) :: this, other end function is_equal end interface end module operator_overloading_19_mod1 module operator_overloading_19_mod2 use operator_overloading_19_mod1 implicit none type, extends(temp) :: temp1 integer :: id contains procedure :: is_same => temp1_is_same end type temp1 type, extends(temp1) :: temp2 real :: extra end type temp2 contains ! Compare two temp1 objects logical function temp1_is_same(this, other) class(temp1), intent(in) :: this class(temp), intent(in) :: other class(temp1), pointer :: other_t1 temp1_is_same = .false. select type(other_t1 => other) type is (temp1) temp1_is_same = (this%id == other_t1%id) type is (temp2) temp1_is_same = (this%id == other_t1%id) end select end function temp1_is_same end module operator_overloading_19_mod2 program operator_overloading_19 use operator_overloading_19_mod1 use operator_overloading_19_mod2 ! implicit none class(temp2), allocatable :: a, b allocate(a, b) a%id = 5 b%id = 5 if (.not. a == b) error stop end program operator_overloading_19 lfortran-lfortran-2f73434/integration_tests/test_ieee_is_normal.f900000664000175000017500000000511715141516316025735 0ustar alastairalastair! Test ieee_is_normal function program test_ieee_is_normal use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, inf_sp, nan_sp, denorm_sp, tmp_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_is_normal..." ! Test 1: Normal positive value x_sp = 1.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(1.0) = ", result if (.not. result) error stop "1.0 should be normal" ! Test 2: Normal negative value x_sp = -5.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(-5.0) = ", result if (.not. result) error stop "-5.0 should be normal" ! Test 3: Large normal value x_sp = 1.0e30_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(1.0e30) = ", result if (.not. result) error stop "1.0e30 should be normal" ! Test 4: Small normal value (just above tiny) tmp_sp = 0.0_real32 x_sp = tiny(tmp_sp) result = ieee_is_normal(x_sp) print *, "ieee_is_normal(tiny) = ", result if (.not. result) error stop "tiny should be normal" ! Test 5: Zero (not normal) x_sp = 0.0_real32 result = ieee_is_normal(x_sp) print *, "ieee_is_normal(0.0) = ", result if (result) error stop "0.0 should not be normal" ! Test 6: Infinity (not normal) tmp_sp = 1.0_real32 inf_sp = ieee_value(tmp_sp, ieee_positive_inf) result = ieee_is_normal(inf_sp) print *, "ieee_is_normal(+inf) = ", result if (result) error stop "+inf should not be normal" ! Test 7: Negative infinity (not normal) inf_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_is_normal(inf_sp) print *, "ieee_is_normal(-inf) = ", result if (result) error stop "-inf should not be normal" ! Test 8: NaN (not normal) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) result = ieee_is_normal(nan_sp) print *, "ieee_is_normal(NaN) = ", result if (result) error stop "NaN should not be normal" ! Test 9: Denormal number (not normal) denorm_sp = ieee_value(tmp_sp, ieee_positive_denormal) result = ieee_is_normal(denorm_sp) print *, "ieee_is_normal(denormal) = ", result if (result) error stop "Denormal should not be normal" ! Test 10: Double precision normal x_dp = 2.5_real64 result = ieee_is_normal(x_dp) print *, "ieee_is_normal(2.5d0) = ", result if (.not. result) error stop "2.5d0 should be normal" print *, "All ieee_is_normal tests passed!" end program test_ieee_is_normal lfortran-lfortran-2f73434/integration_tests/lfortran_intrinsic_sin.f900000664000175000017500000003223715141516316026511 0ustar alastairalastairmodule lfortran_intrinsic_sin ! Implicit dependencies ! abs impure/math ! modulo pure/math2 ! min builtin/array ! max builtin/array use iso_c_binding, only: c_double, c_int use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 implicit none private public sin interface sin module procedure dsin end interface real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp contains ! sin -------------------------------------------------------------------------- ! Our implementation here is based off of the C files from the Sun compiler ! ! Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ! ! Developed at SunSoft, a Sun Microsystems, Inc. business. ! Permission to use, copy, modify, and distribute this ! software is freely granted, provided that this notice ! is preserved. ! sin(x) ! https://www.netlib.org/fdlibm/s_sin.c ! Return sine function of x. ! ! kernel function: ! __kernel_sin ... sine function on [-pi/4,pi/4] ! __kernel_cos ... cose function on [-pi/4,pi/4] ! __ieee754_rem_pio2 ... argument reduction routine ! ! Method. ! Let S,C and T denote the sin, cos and tan respectively on ! [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 ! in [-pi/4 , +pi/4], and let n = k mod 4. ! We have ! ! n sin(x) cos(x) tan(x) ! ---------------------------------------------------------- ! 0 S C T ! 1 C -S -1/T ! 2 -S -C T ! 3 -C S -1/T ! ---------------------------------------------------------- ! ! Special cases: ! Let trig be any of sin, cos, or tan. ! trig(+-INF) is NaN, with signals; ! trig(NaN) is that NaN; ! ! Accuracy: ! TRIG(x) returns trig(x) nearly rounded ! real(dp) function dsin(x) result(r) real(dp), intent(in) :: x real(dp) :: y(2) integer :: n if (abs(x) < pi/4) then r = kernel_dsin(x, 0.0_dp, 0) else n = rem_pio2_c(x, y) select case (modulo(n, 4)) case (0) r = kernel_dsin(y(1), y(2), 1) case (1) r = kernel_dcos(y(1), y(2)) case (2) r = -kernel_dsin(y(1), y(2), 1) case default r = -kernel_dcos(y(1), y(2)) end select end if end function ! __kernel_sin( x, y, iy) ! http://www.netlib.org/fdlibm/k_sin.c ! kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 ! Input x is assumed to be bounded by ~pi/4 in magnitude. ! Input y is the tail of x. ! Input iy indicates whether y is 0. (if iy=0, y assume to be 0). ! ! Algorithm ! 1. Since sin(-x) = -sin(x), we need only to consider positive x. ! 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. ! 3. sin(x) is approximated by a polynomial of degree 13 on ! [0,pi/4] ! 3 13 ! sin(x) ~ x + S1*x + ... + S6*x ! where ! ! |sin(x) 2 4 6 8 10 12 | -58 ! |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 ! | x | ! ! 4. sin(x+y) = sin(x) + sin'(x')*y ! ~ sin(x) + (1-x*x/2)*y ! For better accuracy, let ! 3 2 2 2 2 ! r = x! (S2+x! (S3+x! (S4+x! (S5+x! S6)))) ! then 3 2 ! sin(x) = x + (S1*x + (x! (r-y/2)+y)) elemental real(dp) function kernel_dsin(x, y, iy) result(res) real(dp), intent(in) :: x, y integer, intent(in) :: iy real(dp), parameter :: half = 5.00000000000000000000e-01_dp real(dp), parameter :: S1 = -1.66666666666666324348e-01_dp real(dp), parameter :: S2 = 8.33333333332248946124e-03_dp real(dp), parameter :: S3 = -1.98412698298579493134e-04_dp real(dp), parameter :: S4 = 2.75573137070700676789e-06_dp real(dp), parameter :: S5 = -2.50507602534068634195e-08_dp real(dp), parameter :: S6 = 1.58969099521155010221e-10_dp real(dp) :: z, r, v if (abs(x) < 2.0_dp**(-27)) then res = x return end if z = x*x v = z*x r = S2+z*(S3+z*(S4+z*(S5+z*S6))) if (iy == 0) then res = x + v*(S1+z*r) else res = x-((z*(half*y-v*r)-y)-v*S1) end if end function ! __kernel_cos( x, y ) ! https://www.netlib.org/fdlibm/k_cos.c ! kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 ! Input x is assumed to be bounded by ~pi/4 in magnitude. ! Input y is the tail of x. ! ! Algorithm ! 1. Since cos(-x) = cos(x), we need only to consider positive x. ! 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. ! 3. cos(x) is approximated by a polynomial of degree 14 on ! [0,pi/4] ! 4 14 ! cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x ! where the remez error is ! ! | 2 4 6 8 10 12 14 | -58 ! |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 ! | | ! ! 4 6 8 10 12 14 ! 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then ! cos(x) = 1 - x*x/2 + r ! since cos(x+y) ~ cos(x) - sin(x)*y ! ~ cos(x) - x*y, ! a correction term is necessary in cos(x) and hence ! cos(x+y) = 1 - (x*x/2 - (r - x*y)) ! For better accuracy when x > 0.3, let qx = |x|/4 with ! the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125. ! Then ! cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)). ! Note that 1-qx and (x*x/2-qx) is EXACT here, and the ! magnitude of the latter is at least a quarter of x*x/2, ! thus, reducing the rounding error in the subtraction. elemental real(dp) function kernel_dcos(x, y) result(res) real(dp), intent(in) :: x, y real(dp), parameter :: one= 1.00000000000000000000e+00_dp real(dp), parameter :: C1 = 4.16666666666666019037e-02_dp real(dp), parameter :: C2 = -1.38888888888741095749e-03_dp real(dp), parameter :: C3 = 2.48015872894767294178e-05_dp real(dp), parameter :: C4 = -2.75573143513906633035e-07_dp real(dp), parameter :: C5 = 2.08757232129817482790e-09_dp real(dp), parameter :: C6 = -1.13596475577881948265e-11_dp real(dp) :: z, r, qx, hz, a if (abs(x) < 2.0_dp**(-27)) then res = one return end if z = x*x r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))) if (abs(x) < 0.3_dp) then res = one - (0.5_dp*z - (z*r - x*y)) else if (abs(x) > 0.78125_dp) then qx = 0.28125_dp else qx = abs(x)/4 end if hz = 0.5_dp*z-qx a = one-qx res = a - (hz - (z*r-x*y)) end if end function integer function rem_pio2_c(x, y) result(n) ! Computes 128bit float approximation of modulo(x, pi/2) returned ! as the sum of two 64bit floating point numbers y(1)+y(2) ! This function roughly implements: ! y(1) = modulo(x, pi/2) ! 64bit float ! y(2) = modulo(x, pi/2) - y(1) ! The exact tail ! n = (x-y(1)) / (pi/2) ! The y(1) is the modulo, and y(2) is a tail. When added directly ! as y(1) + y(2) it will be equal to just y(1) in 64bit floats, but ! if used separately in polynomial approximations one can use y(2) to get ! higher accuracy. real(dp), intent(in) :: x real(dp), intent(out) :: y(2) interface integer(c_int) function ieee754_rem_pio2(x, y) bind(c) use iso_c_binding, only: c_double, c_int real(c_double), value, intent(in) :: x real(c_double), intent(out) :: y(2) end function end interface n = ieee754_rem_pio2(x, y) end function ! Our implementation here is designed around range reduction to [-pi/2, pi/2] ! Subsequently, we fit a 64 bit precision polynomials via Sollya (https://www.sollya.org/) ! -- Chebyshev (32 terms) -- ! This has a theoretical approximation error bound of [-7.9489615048122632526e-41;7.9489615048122632526e-41] ! Due to rounding errors; we obtain a maximum error (w.r.t. gfortran) of ~ E-15 over [-10, 10] ! -- Remez (16 terms) -- [DEFAULT] (fewer terms) ! Due to rounding errors; we obtain a maximum error (w.r.t. gfortran) of ~ E-16 over [-10, 10] ! For large values, e.g. 2E10 we have an absolute error of E-7 ! For huge(0) we have an absolute error of E-008 ! TODO: Deal with very large numbers; the errors get worse above 2E10 ! For huge(0.0) we have 3.4028234663852886E+038 -0.52187652333365853 0.99999251142364332 1.5218690347573018 ! value gfortran sin lfortran sin absolute error elemental real(dp) function dsin2(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n y = modulo(x, 2*pi) y = min(y, pi - y) y = max(y, -pi - y) y = min(y, pi - y) r = kernel_dsin2(y) end function ! Accurate on [-pi/2,pi/2] to about 1e-16 elemental real(dp) function kernel_dsin2(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: S1 = 0.9999999999999990771_dp real(dp), parameter :: S2 = -0.16666666666664811048_dp real(dp), parameter :: S3 = 8.333333333226519387e-3_dp real(dp), parameter :: S4 = -1.9841269813888534497e-4_dp real(dp), parameter :: S5 = 2.7557315514280769795e-6_dp real(dp), parameter :: S6 = -2.5051823583393710429e-8_dp real(dp), parameter :: S7 = 1.6046585911173017112e-10_dp real(dp), parameter :: S8 = -7.3572396558796051923e-13_dp real(dp) :: z z = x*x res = x * (S1+z*(S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))) end function elemental real(dp) function kernel_dcos2(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: C1 = 0.99999999999999999317_dp real(dp), parameter :: C2 = 4.3522024034217346524e-18_dp real(dp), parameter :: C3 = -0.49999999999999958516_dp real(dp), parameter :: C4 = -8.242872826356848038e-17_dp real(dp), parameter :: C5 = 4.166666666666261697e-2_dp real(dp), parameter :: C6 = 4.0485005435941782636e-16_dp real(dp), parameter :: C7 = -1.3888888888731381616e-3_dp real(dp), parameter :: C8 = -8.721570096570797013e-16_dp real(dp), parameter :: C9 = 2.4801587270604889267e-5_dp real(dp), parameter :: C10 = 9.352687193379247843e-16_dp real(dp), parameter :: C11 = -2.7557315787234544468e-7_dp real(dp), parameter :: C12 = -5.2320806585871644286e-16_dp real(dp), parameter :: C13 = 2.0876532326120694722e-9_dp real(dp), parameter :: C14 = 1.4637857803935104813e-16_dp real(dp), parameter :: C15 = -1.146215379106821115e-11_dp real(dp), parameter :: C16 = -1.6185683697669940221e-17_dp real(dp), parameter :: C17 = 4.6012969591571265687e-14_dp ! Remez16 res = C1 + x * (C2 + x * & (C3 + x * (C4 + x * & (C5 + x * (C6 + x * & (C7 + x * (C8 + x * & (C9 + x * (C10 + x * & (C11 + x * (C12 + x * & (C13 + x * (C14 + x * & (C15 + x * (C16 + x * C17))))))))))))))) end function real(dp) function dsin3(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n if (abs(x) < pi/4) then r = kernel_dsin2(x) else n = rem_pio2(x, y) select case (modulo(n, 4)) case (0) r = kernel_dsin2(y) case (1) r = kernel_dcos2(y) case (2) r = -kernel_dsin2(y) case default r = -kernel_dcos2(y) end select end if end function integer function rem_pio2(x, y) result(n) real(dp), intent(in) :: x real(dp), intent(out) :: y y = modulo(x, pi/2) if (y > pi/4) y = y-pi/2 n = (x-y) / (pi/2) end function end module program main use iso_fortran_env, only: sp => real32, dp => real64 use lfortran_intrinsic_sin implicit none real(dp) :: x x = 0.0_dp print*, sin(x) if (abs(sin(x) - 0.0_dp) > 1e-12) error stop x = 1.0_dp print*, sin(x) if (abs(sin(x) - 0.84147098480789650665_dp) > 1e-12) error stop x = 1.57_dp print*, sin(x) if (abs(sin(x) - 0.999999682931834610503_dp) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/optional_03.f900000664000175000017500000000144215141516316024050 0ustar alastairalastairmodule test_optional_module_01 implicit none type :: string character(:), allocatable :: s end type contains subroutine sub_01(x) type(string), optional, intent(inout) :: x(:) if (present(x)) then x(1)%s = "presentx" end if end subroutine end module test_optional_module_01 module test_optional_module_02 use test_optional_module_01, only: sub_01, string implicit none contains subroutine sub_02() type(string) :: strdt(1) call sub_01() call sub_01(strdt) print *, strdt(1)%s if( strdt(1)%s /= "presentx" ) error stop end subroutine sub_02 end module test_optional_module_02 program optional_03 use test_optional_module_02, only: sub_02 implicit none call sub_02() end program lfortran-lfortran-2f73434/integration_tests/read_02.f900000664000175000017500000000122315141516316023132 0ustar alastairalastairprogram read_02 implicit none integer :: i character(len=10) :: tmp integer :: u open(newunit=u, file="read_02_data.txt") read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "aa") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "bb") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "cc") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "dd") error stop read(u, '(A)', iostat=i) tmp print *, i, tmp, len(tmp) if (trim(tmp) /= "ee") error stop close(u) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_145.f900000664000175000017500000000171215141516316024477 0ustar alastairalastairprogram intrinsics_145 complex :: a(3), b(3) complex :: res complex(8) :: c(3), d(3) complex(8) :: res_8 a = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] b = [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)] res = dot_product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)]) print *, abs(res) if (abs(abs(res) - 217.745270) > 1e-8) error stop res = dot_product(a, b) print *, abs(res) if (abs(abs(res) - 217.745270) > 1e-8) error stop c = [(1.0D0, 2.0D0), (3.0D0, 4.0D0), (5.0D0, 6.0D0)] d = [(7.0D0, 8.0D0), (9.0D0, 10.0D0), (11.0D0, 12.0D0)] res_8 = dot_product(c, d) print *, abs(res_8) if (abs(abs(res_8) - 217.74526401279087D0) > 1e-12) error stop res_8 = dot_product([(1.0D0, 2.0D0), (3.0D0, 4.0D0), (5.0D0, 6.0D0)], [(7.0D0, 8.0D0), (9.0D0, 10.0D0), (11.0D0, 12.0D0)]) print *, abs(res_8) if (abs(abs(res_8) - 217.74526401279087D0) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/interface_06.f900000664000175000017500000000066015141516316024167 0ustar alastairalastairprogram interface_06 implicit none interface a procedure a1 procedure a2 end interface integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function end program lfortran-lfortran-2f73434/integration_tests/arrays_08_func.f900000664000175000017500000000112615141516316024543 0ustar alastairalastairprogram arrays_08_func implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(x, y) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine copy_from_to(a, b) integer, intent(in) :: a(:) integer, intent(out) :: b(:) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-lfortran-2f73434/integration_tests/complex_15.f900000664000175000017500000000023315141516316023672 0ustar alastairalastairprogram complex_15 implicit none complex(8) :: k, z k = (3, -4) z = -k print *, k, z if (abs(z) == k) error stop if (z /= (-3, 4)) error stop end program lfortran-lfortran-2f73434/integration_tests/nested_18.f900000664000175000017500000000401115141516316023506 0ustar alastairalastair! Test for nested function global variables passes ! with function calls in conditions ! Test for both, scalars and arrays ! Test 1: Do-while loop with function call in condition (3 iterations) ! Test 2: IF block with function call in condition module nested_18_temp contains subroutine demo() implicit none integer :: a integer :: arr(5) integer :: counter ! Test 1: Do-While loop - runs 6 times ! Check Upodates from Main to Function ! And from function to Main a = 0 arr(1:5) = 0 counter = 0 GET_ARGS: do while(increment()) ! Check updates from function to main counter = counter + 1 if (counter == 1 .and. a /= 1 .and. arr(1) /= 1) error stop if (counter == 3 .and. a /= 3 .and. arr(3) /= 3) error stop if (counter == 5 .and. a /= 5 .and. arr(5) /= 3) error stop print *, "Iteration", counter, ": a =", a, ": arr =", arr ! Update a inside main to check from main to function a = a + 1 arr = arr + 1 counter = counter + 1 print *, "Iteration", counter, ": a =", a, ": arr =", arr if (counter == 6) exit GET_ARGS end do GET_ARGS print *, "a =", a print *, "arr =", arr if (a /= 6) error stop if (arr(1) /= 6) error stop ! Test 2: IF block with function call in condition a = 10 if (set_value(25)) then print *, "In IF body: a =", a if (a /= 25) error stop a = a + 5 end if print *, a if (a /= 30) error stop contains logical function increment() arr = arr + 1 a = a + 1 increment = .true. end function increment logical function set_value(val) integer, intent(in) :: val a = val set_value = .true. end function set_value end subroutine demo end module nested_18_temp program nested_18 use nested_18_temp implicit none call demo() print *, "Nested variable test passed" end program nested_18lfortran-lfortran-2f73434/integration_tests/modules_31.f900000664000175000017500000000016315141516316023673 0ustar alastairalastairprogram modules_31 use fpm_cmd_update_modules_31 implicit none print *, "running modules_31 program" end program lfortran-lfortran-2f73434/integration_tests/intent_out_module_dealloc.f900000664000175000017500000000263515141516316027146 0ustar alastairalastair! Test that module subroutines properly deallocate intent(out) allocatable ! dummies at function entry per Fortran standard. ! ! This is an MRE for a bug where the IntentOutDeallocateVisitor pass ! incorrectly skipped ALL module procedures (thinking they were compiler- ! generated intrinsics) due to checking only deftype == Implementation. module intent_out_module_dealloc_m implicit none contains subroutine reset_array(x) integer, allocatable, intent(out) :: x(:) ! Per Fortran standard, x must be deallocated on entry if (allocated(x)) error stop 1 allocate(x(3)) x = [10, 20, 30] end subroutine reset_array end module intent_out_module_dealloc_m program intent_out_module_dealloc use intent_out_module_dealloc_m, only: reset_array implicit none integer, allocatable :: arr(:) ! First call: arr is not allocated call reset_array(arr) if (.not. allocated(arr)) error stop 2 if (size(arr) /= 3) error stop 3 if (arr(1) /= 10 .or. arr(2) /= 20 .or. arr(3) /= 30) error stop 4 ! Second call: arr IS allocated, should be deallocated on entry deallocate(arr) allocate(arr(5)) arr = [1, 2, 3, 4, 5] call reset_array(arr) if (.not. allocated(arr)) error stop 5 if (size(arr) /= 3) error stop 6 if (arr(1) /= 10 .or. arr(2) /= 20 .or. arr(3) /= 30) error stop 7 print *, "PASS" end program intent_out_module_dealloc lfortran-lfortran-2f73434/integration_tests/openmp_55.f900000664000175000017500000000073615141516316023535 0ustar alastairalastair program openmp_55 use omp_lib implicit none integer :: i,n=10,counter call omp_set_num_threads(8) counter=0 !$OMP PARALLEL !$OMP MASTER do i = 1, n !$OMP TASK shared(counter) !$OMP ATOMIC counter=counter+1 print *, "Task Done by TID:-",omp_get_thread_num() !$OMP END TASK end do !$OMP END MASTER !$OMP END PARALLEL if(counter/=10) error stop end program openmp_55 lfortran-lfortran-2f73434/integration_tests/string_98.f900000664000175000017500000000054015141516316023545 0ustar alastairalastairprogram trim_param_concat implicit none character(len=*), parameter :: s = 'hello' character(len=*), parameter :: t = 'world' character(len=6) :: r1 character(len=10) :: r2 r1 = trim(s)//'x' if (r1 /= 'hellox') error stop r2 = trim(s)//trim(t) if (r2 /= 'helloworld') error stop print *, "PASSED" end program lfortran-lfortran-2f73434/integration_tests/nested_09.f900000664000175000017500000000063715141516316023520 0ustar alastairalastairprogram nested_09 implicit none integer :: i real :: x, fvec(5) x = 1 call fcn(x, fvec) print *, fvec do i = 1, 5 if ((abs(fvec(i)) - 1.0) > 1e-6) error stop end do contains subroutine check_deriv() call fcn(x, fvec) end subroutine check_deriv subroutine fcn(x, fvec) real, intent(in) :: x real, intent(out) :: fvec(5) fvec = x end subroutine fcn end program lfortran-lfortran-2f73434/integration_tests/array_op_01.f900000664000175000017500000000053315141516316024035 0ustar alastairalastairsubroutine chkder(m, Err) implicit none integer, intent(in) :: m real, intent(out) :: Err(m) real :: zero zero = 0.0 Err = zero end subroutine chkder program main implicit none integer :: i real :: Err(2) call chkder(2, Err) do i = 1, 2 if (Err(i) /= 0.0) error stop end do end program lfortran-lfortran-2f73434/integration_tests/string_55.f900000664000175000017500000000033715141516316023542 0ustar alastairalastairprogram string_55 character(len=20) :: str = 'gfortran ' str = adjustr(str) print *, str print "(a)", str ! 12 EMPTY CHARACTERS + "gfortran" if(str /= " gfortran") error stop end programlfortran-lfortran-2f73434/integration_tests/tuple_test_01_.f900000664000175000017500000000222115141516316024544 0ustar alastairalastairmodule tuple_test_01_mod implicit none contains subroutine f() type(_lfortran_tuple(integer, real, character(len=:), logical)) :: t1, t2 type(_lfortran_tuple(integer, integer)) :: t3 type(_lfortran_tuple(real, real)) :: t4 integer :: a, b real :: af, bf t1 = _lfortran_tuple_constant(1, 2.0, "3", .true.) t2 = _lfortran_tuple_constant(2, 3.0, "3", .false.) if (_lfortran_get_item(t2, 0) - _lfortran_get_item(t1, 0) /= 1) error stop if (abs(_lfortran_get_item(t2, 1) - _lfortran_get_item(t1, 1) - 1.0) > 1e-12) error stop if (_lfortran_get_item(t1, 2) /= _lfortran_get_item(t2, 2)) error stop if (.not. (_lfortran_get_item(t1, 3) .or. _lfortran_get_item(t2, 3))) error stop t3 = _lfortran_tuple_constant(1, 2) t4 = _lfortran_tuple_constant(1.0, 2.0) a = _lfortran_get_item(t3, 0) b = _lfortran_get_item(t3, 1) af = _lfortran_get_item(t4, 0) bf = _lfortran_get_item(t4, 1) if (af /= real(a)) error stop if (bf /= real(b)) error stop end subroutine end module program main use tuple_test_01_mod implicit none call f() end program lfortran-lfortran-2f73434/integration_tests/write_13.f900000664000175000017500000000055515141516316023362 0ustar alastairalastair! Test writes into substrings inside FileWrite Nodes program write_13 implicit none character(10):: string = 'ABCDEFGHIJ' character(len=5) :: string2 write(string2(1:),'(a)') "Hello" write(string(1:4),'(A)') 'abcd' print *, string, string2 if (string/='abcdEFGHIJ') error stop if (string2/='Hello') error stop end program write_13lfortran-lfortran-2f73434/integration_tests/template_03.f900000664000175000017500000000231515141516316024036 0ustar alastairalastairmodule template_03_m requirement op(T, U, V, op) type, deferred :: T type, deferred :: U type, deferred :: V interface elemental function op(a, b) type(T), intent(in) :: a type(U), intent(in) :: b type(V) :: op end function end interface end requirement template axpy_tmpl(T, U, V, W, plus, times) public :: axpy require :: op(V, W, V, plus) require :: op(T, U, W, times) contains subroutine axpy(a, x, y) type(T), intent(in) :: a type(U), intent(in) :: x(:) type(V), intent(inout) :: y(:) integer :: i do i = 1, size(x) y(i) = plus(y(i), times(a, x(i))) end do end subroutine end template contains subroutine f() integer, parameter :: sp = kind(1.0), dp = kind(1.d0) instantiate axpy_tmpl(real, integer, real, real, operator(+), operator(*)) real :: a integer :: x(3) real :: y(3) a = 0.5 x = 2 y = 0 call axpy(a, x, y) print *, y end subroutine end module program template_03 use template_03_m, only: f call f() end programlfortran-lfortran-2f73434/integration_tests/openmp_13.f900000664000175000017500000000227415141516316023526 0ustar alastairalastairsubroutine initialize_array_kernel_1(n, a) integer, intent(in) :: n real, intent(out) :: a(n) integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine subroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i call initialize_array_kernel_1(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_13 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: c print *, c(2) call omp_set_num_threads(4) call initialize_array(n, c) print *, c(1), c(n), c(12), c(12841) if (abs(c(1) - 12.91) > 1e-8) error stop if (abs(c(n) - 12.91) > 1e-8) error stop if (abs(c(12) - 12.91) > 1e-8) error stop if (abs(c(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/write_10.f900000664000175000017500000000273315141516316023357 0ustar alastairalastairmodule write_10_m type :: mytype character(len=:), allocatable :: raw end type interface write(unformatted) module procedure :: my_write end interface interface read(unformatted) module procedure :: my_read end interface contains subroutine my_write(x, unit, iostat, iomsg) class(mytype), intent(in) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, iostat=iostat, iomsg=iomsg) len(x%raw) print *, "Writing length:", len(x%raw) if (len(x%raw) /= 5) error stop end subroutine subroutine my_read(x, unit, iostat, iomsg) class(mytype), intent(inout) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg integer :: l read(unit, iostat=iostat, iomsg=iomsg) l allocate(character(len=l) :: x%raw) end subroutine end module write_10_m program write_10 use write_10_m implicit none type(mytype) :: x, y integer :: u, iostat character(len=100) :: iomsg x%raw = "hello" open(newunit=u, form="unformatted", status="scratch") write(u, iostat=iostat, iomsg=iomsg) x print *, len(x%raw) if (len(x%raw) /= 5) error stop rewind(u) read(u, iostat=iostat, iomsg=iomsg) y print *, len(y%raw) if (len(y%raw) /= 5) error stop close(u) end program write_10 lfortran-lfortran-2f73434/integration_tests/arrays_21.f900000664000175000017500000000115115141516316023521 0ustar alastairalastairprogram arrays_21 integer :: i6(6) = (/-14, 3, 0, -2, 19, 1/) integer :: i23(2, 3) = reshape((/-14, 3, 0, -2, 19, 1/), (/2, 3/)) print *, i23 ! writes -14 3 ! 0 -2 ! 19 1 print *, maxloc(i6) ! writes 5 print *, maxloc(i23) ! writes 1 3 print *, maxloc(i23, dim=1) ! writes 2 1 1 print *, maxloc(i23, dim=2) ! writes 3 1 print *, maxloc(i23, dim=1, mask=(i23 < 10)) ! writes 2 1 2 end program arrays_21 lfortran-lfortran-2f73434/integration_tests/associate_14.f900000664000175000017500000000035615141516316024203 0ustar alastairalastairprogram associate_14 character(:), allocatable , target:: char_physically_descriptor character(:), pointer :: char_ptr char_physically_descriptor = "hello" char_ptr => char_physically_descriptor end program associate_14lfortran-lfortran-2f73434/integration_tests/submodule_07.f900000664000175000017500000000102515141516316024223 0ustar alastairalastairmodule mod_wrapper_submodule_07 implicit none private public :: key_type type :: key_type integer :: value end type key_type end module mod_wrapper_submodule_07 module mod_submodule_07 use mod_wrapper_submodule_07 contains module subroutine sub() print *, "Hello World" end subroutine end module mod_submodule_07 submodule(mod_submodule_07) submod_submodule_07 use mod_wrapper_submodule_07 end submodule submod_submodule_07 program main use mod_submodule_07 end program lfortran-lfortran-2f73434/integration_tests/class_12.f900000664000175000017500000000125115141516316023326 0ustar alastairalastairmodule class_12_mod type, abstract :: abstract_type contains procedure(integer_method), deferred, nopass :: integer_method end type abstract_type abstract interface function integer_method() result(n) integer :: n end function integer_method end interface type :: Wrapper class(abstract_type), allocatable :: obj contains procedure :: caller end type Wrapper contains subroutine caller(self) class(Wrapper), intent(in) :: self integer :: n n = self%obj%integer_method() end subroutine caller end module program class_12 use class_12_mod implicit none print *, "Ok" end program lfortran-lfortran-2f73434/integration_tests/derived_types_12.f900000664000175000017500000000214115141516316025066 0ustar alastairalastairmodule mod implicit none type, public :: t integer :: i contains generic, public :: assignment(=) => set procedure, private :: set generic, public :: operator(>) => greater procedure, private :: greater generic, public :: operator(.mul.) => multiply procedure, private :: multiply end type t contains subroutine set(x, y) class(t), intent(out) :: x type(t), intent(in) :: y x%i = y%i + 1 end subroutine set function greater(x, y) result(is_greater) class(t), intent(in) :: x type(t), intent(in) :: y logical :: is_greater is_greater = x%i > y%i end function greater function multiply(x, y) result(product) class(t), intent(in) :: x type(t), intent(in) :: y integer :: product product = x%i * y%i end function multiply end module mod program alloc_assign use mod implicit none logical :: is_greater integer :: product type(t) :: xt, yt xt = t(5) yt = xt print *, xt%i, yt%i if( xt%i /= 6 ) error stop if( yt%i /= 7 ) error stop is_greater = (xt > yt) if (is_greater) error stop product = (xt.mul.yt) if (product /= 42) error stop end program alloc_assign lfortran-lfortran-2f73434/integration_tests/derived_types_16_module.f900000664000175000017500000000137115141516316026443 0ustar alastairalastairmodule fpm_command_line implicit none public :: fpm_run_settings, get_command_line_settings type :: fpm_run_settings integer :: int real :: float logical :: bool end type contains subroutine get_command_line_settings(cmd_settings) class(fpm_run_settings), allocatable, intent(out) :: cmd_settings cmd_settings=fpm_run_settings(0, 1.0, .true.) end subroutine get_command_line_settings end module fpm_command_line program derived_types_16 use fpm_command_line implicit none class(fpm_run_settings), allocatable :: settings allocate(settings) call get_command_line_settings(settings) if (settings%int /= 0) error stop if (abs(settings%float - 1.0) > 1e-6) error stop if (settings%bool .neqv. .true.) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_72.f900000664000175000017500000000027215141516316024416 0ustar alastairalastairprogram intrinsics_72 real(8) :: x, y, datan2 x = 2.33D0 y = 3.41D0 print *, datan2(x,y) if(abs(datan2(x,y) - 0.59941916594660438) > 1d-6) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_op_14.f900000664000175000017500000000075515141516316024232 0ustar alastairalastairprogram arrays_op_14 implicit none integer :: y(3) real :: x(3), fvec(15) x = 1 y = 2.0 fvec = x(1) print *, fvec call verify(fvec, 1.0) fvec = y(2) print *, fvec call verify(fvec, 2.0) contains subroutine verify(array, value) real, intent(in) :: array(:), value integer :: i do i = lbound(array, 1), ubound(array, 1) if (abs(array(i) - value) > 1e-6) error stop end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/expr_13.f900000664000175000017500000000207415141516316023204 0ustar alastairalastairprogram flip_sign_dead_code implicit none integer :: number real :: x, eps = 1e-6 integer :: a = 1, b = 2 integer, parameter :: ap = 1, bp = 2 real :: c = 1.0, d = 2.0 real, parameter :: cp = 1.0, dp = 2.0 number = 123 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (-5.5)) > eps) error stop number = 124 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (5.5)) > eps) error stop if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if if( a == b ) then print *, "a == b" if( ap == bp ) then print *, "ap == bp" else print *, "ap /= bp" end if else if( ap == cp ) then print *, "ap == cp" if( cp == dp ) then print *, "cp == dp" else print *, "cp /= dp" end if else if( c == d ) then print *, "c == d" end if end program lfortran-lfortran-2f73434/integration_tests/functions_45.f900000664000175000017500000000033115141516316024235 0ustar alastairalastair! Test calling a string-returing function in a loop program functions_45 integer :: i integer :: n_slashes n_slashes = 20 do i=1 , 10 print *, repeat('\', n_slashes / 2) end do end program lfortran-lfortran-2f73434/integration_tests/array_02_pack.f900000664000175000017500000000025415141516316024336 0ustar alastairalastairprogram array_02_pack integer :: m(4), p(4) m = [ 1, 0, 0, 2 ] p = pack(m, m /= 0, [ 0, 0, 3, 4 ]) print *, p if( any(p /= [1, 2, 3, 4]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/module_array_init.f900000664000175000017500000000313415141516316025427 0ustar alastairalastairmodule mod_module_array_init implicit none integer, dimension(2) :: arr_integer_with_zero = 0 integer, dimension(3) :: arr_integer_with_unary_minus = -1 real, dimension(2) :: arr_real_with_zero = 0 real, dimension(4) :: arr_real_with_unary_minus = -1 complex, dimension(2) :: arr_complex_with_zero = (0.0, 0.0) logical, dimension(2) :: arr_logical_with_false = .false. ! TODO: the below commented out declarations don't work correctly ! in LLVM backend ! logical, dimension(2) :: arr_logical_with_true = .true. ! logical, dimension(2) :: arr_logical_with_true_false = [.true., .false.] end module program module_array_init use mod_module_array_init implicit none print *, arr_integer_with_zero if (any(arr_integer_with_zero /= 0)) error stop print *, arr_integer_with_unary_minus if (any(arr_integer_with_unary_minus /= -1)) error stop print*, arr_real_with_zero if (any(arr_real_with_zero /= 0.)) error stop print *, arr_real_with_unary_minus if (any(arr_real_with_unary_minus /= -1.)) error stop print *, arr_complex_with_zero if (any(arr_complex_with_zero /= (0., 0.))) error stop print *, arr_logical_with_false if (any(arr_logical_with_false .neqv. .false.)) error stop ! TODO: comment out this once the declarations above ! works ! print *, arr_logical_with_true ! if (any(arr_logical_with_true .neqv. .true.)) error stop ! print *, arr_logical_with_true_false ! if (arr_logical_with_false(1) .neqv. .true.) error stop ! if (arr_logical_with_false(2) .neqv. .false.) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_dp_param.f900000664000175000017500000000034015141516316025227 0ustar alastairalastairprogram complex_dp_param integer, parameter :: prec1 = 4, prec2 = 8 complex(prec1) :: u = (1.05, 1.05) complex(prec2) :: v = (1.05, 1.05_8) complex(prec2) :: zero = 0.0_4 print *, u, v, zero end programlfortran-lfortran-2f73434/integration_tests/intrinsics_305.f900000664000175000017500000000200415141516316024470 0ustar alastairalastairprogram intrinsics_305 implicit none real, parameter :: x1 = realpart((1.0, 2.0)) real(8), parameter :: x2 = realpart((1.0_8, 2.0_8)) real, parameter :: ar1(3) = realpart([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = realpart([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 1.0) error stop print *, x2 if (x2 /= 1.0_8) error stop print *, realpart(x) if (realpart(x) /= 1.0) error stop print *, realpart(y) if (realpart(y) /= 1.0_8) error stop print *, ar1 if (any(ar1 /= [1.0, 3.0, 5.0])) error stop print *, ar2 if (any(ar2 /= [1.0_8, 3.0_8, 5.0_8])) error stop print *, realpart(x) if (realpart(x) /= 1.0) error stop print *, realpart(y) if (realpart(y) /= 1.0_8) error stop print *, realpart(z) if (any(realpart(z) /= [1.0, 3.0, 5.0])) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_24.f900000664000175000017500000000062715141516316023533 0ustar alastairalastairprogram arrays_24 implicit none real :: x(1), y(1), z(1) x = [5.15] y = [-3.20] z = f(x, y) print *, z if (abs(z(1) - 1.95) > 1e-5) error stop contains function f(a, b) result(r) real, intent(in) :: a(:), b(:) real :: r(size(a)) integer :: i do i = 1, size(a) r(i) = a(i) + b(i) end do end function end programlfortran-lfortran-2f73434/integration_tests/arithmetic_if_03.f900000664000175000017500000000145715141516316025040 0ustar alastairalastairprogram arithmetic_if_03 integer(8) :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_20.f900000664000175000017500000000116615141516316026057 0ustar alastairalastairprogram implicit_interface_20 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(2) a(1) = 1.0d0 a(2) = 2.0d0 call wrapper(a) end program implicit_interface_20 subroutine wrapper(a) use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(*) external :: worker call worker(a) end subroutine wrapper subroutine worker(a) use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: a(*) if (a(1) /= 1.0d0) error stop if (a(2) /= 2.0d0) error stop print *, a(1) end subroutine worker lfortran-lfortran-2f73434/integration_tests/derived_types_46.f900000664000175000017500000000072515141516316025103 0ustar alastairalastairmodule derived_types_46_m type :: derived integer :: n end type derived interface derived procedure :: init end interface derived contains function init() result(self) type(derived) :: self self%n = 10 end function init end module derived_types_46_m program derived_types_46 use derived_types_46_m, only: derived type(derived) :: obj obj = derived() if (obj%n /= 10) error stop end program derived_types_46 lfortran-lfortran-2f73434/integration_tests/print_10.f900000664000175000017500000000056315141516316023360 0ustar alastairalastairprogram print_10 implicit none character(8) :: a(2) = ['aa','bb'] character(25) :: out write(out, "(2(1X,A))") '"'//a//'"' ! Expected output (spaces are important) if (out /= ' "aa " "bb "') then print *, 'GOT : >'//out//'<' print *, 'EXPECTED: > "aa " "bb "<' error stop 1 end if end program lfortran-lfortran-2f73434/integration_tests/select_type_13.f900000664000175000017500000000360615141516316024550 0ustar alastairalastairmodule select_type_13_module implicit none type, abstract :: shape contains procedure(area), deferred :: get_area end type shape abstract interface real function area(this) import :: shape class(shape), intent(in) :: this end function end interface type, extends(shape) :: circle real :: r contains procedure :: get_area => circle_area end type circle type, extends(shape) :: rectangle real :: a, b contains procedure :: get_area => rectangle_area end type rectangle contains real function circle_area(this) class(circle), intent(in) :: this circle_area = 3.14159 * this%r * this%r end function circle_area real function rectangle_area(this) class(rectangle), intent(in) :: this rectangle_area = this%a * this%b end function rectangle_area end module select_type_13_module program select_type_13 use select_type_13_module implicit none class(shape), allocatable :: s1, s2 allocate(circle :: s1) select type (s1) class is (rectangle) print *, "Matched as rectangle" class is (circle) print *, "Matched as circle" s1%r = 10.0 print *, s1%r if (s1%r /= 10.0) error stop ! TODO: Support calling methods on derived types in select type ! print *, s1%get_area() class default print *, "Matched as shape" end select allocate(rectangle :: s2) select type (s2) class is (circle) print *, "Matched as circle" class is (rectangle) print *, "Matched as rectangle" s2%a = 5.0 s2%b = 4.0 print *, s2%a, s2%b if (s2%a /= 5.0) error stop if (s2%b /= 4.0) error stop ! TODO: Support calling methods on derived types in select type ! print *, s2%get_area() class default print *, "Matched as shape" end select end program select_type_13 lfortran-lfortran-2f73434/integration_tests/string_08.f900000664000175000017500000000214215141516316023534 0ustar alastairalastairmodule string_08_mod implicit none contains integer elemental function len_trim(string) result(r) character(len=*), intent(in) :: string r = len(string) if (r == 0) return do while(string(r:r) == " ") r = r - 1 if (r == 0) exit end do end function function trim(x) result(r) character(len=*),intent(in) :: x character(len=len_trim(x)) :: r integer :: i do i = 1, len(r) r(i:i) = x(i:i) end do end function end module program string_08 use string_08_mod implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-lfortran-2f73434/integration_tests/class_09.f900000664000175000017500000000314315141516316023336 0ustar alastairalastairmodule class_09_module implicit none private public point, point2d, point3d type, abstract :: point real res contains procedure(func), deferred :: radius end type point abstract interface subroutine func( this ) import point class(point) this end subroutine func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d type, extends(point2d) :: point3d real z contains procedure :: radius => r3d end type point3d contains subroutine r2d( this ) class(point2d) this this%res = sqrt( this%x ** 2 + this%y ** 2 ) print *, this%res end subroutine r2d subroutine r3d( this ) class(point3d) this this%res = sqrt( this%x ** 2 + this%y ** 2 + this%z ** 2 ) print *, this%res end subroutine r3d end module class_09_module program class_09_program use class_09_module implicit none class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 0, 3, 4 ) type(point3d), target :: p3d = point3d( 0, 3, 4, 5 ) print *, p2d%x, p2d%y print *, p3d%x, p3d%y, p3d%z ptr => p2d print *, "2-d radius is: " call ptr%radius() if (ptr%res /= 5.) error stop ptr => p3d print *, "3-d radius is: " call ptr%radius() if (abs(ptr%res - 7.07106781) > 1e-7) error stop p3d%x = 3.0 p3d%y = 4.0 p3d%z = 0.0 print *, "3-d radius is: " call ptr%radius() if (ptr%res /= 5.) error stop end program class_09_program lfortran-lfortran-2f73434/integration_tests/file_03_data.txt0000664000175000017500000000037515141516316024360 0ustar alastairalastair10 101 Adam Johnson 15 55.4 102 Lisa Martinez 16 48.6 103 Ethan Thompson 14 50.0 104 Emma Davis 15 45.3 105 Benjamin Wilson 16 60.8 106 Sophia Taylor 14 50.7 107 Oliver Harris 15 56.2 108 Ava Jackson 16 47.6 109 Lucas Hall 14 58.1 110 Mia Young 15 46.9 lfortran-lfortran-2f73434/integration_tests/arrays_92.f900000664000175000017500000000050615141516316023534 0ustar alastairalastairmodule arrays_92_mod implicit none integer, parameter :: ints(0:9) = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] integer :: e = 3 end module arrays_92_mod program arrays_92 use arrays_92_mod, only : e, ints integer :: x x = ints(e) print *, "x: ", x if (x /= 14) error stop end program arrays_92 lfortran-lfortran-2f73434/integration_tests/nested_13.f900000664000175000017500000000104015141516316023500 0ustar alastairalastairmodule nested_13_mod implicit none contains subroutine get_prototype(prototype) character(len=:), allocatable, intent(out) :: prototype call expand_name() contains subroutine expand_name() prototype = "Hello" end subroutine expand_name end subroutine get_prototype end module nested_13_mod program nested_13 use nested_13_mod implicit none character(len=:), allocatable :: proto call get_prototype(proto) if (proto /= "Hello") error stop end program nested_13lfortran-lfortran-2f73434/integration_tests/intrinsics_233.f900000664000175000017500000000127115141516316024475 0ustar alastairalastairprogram intrinsics_233 implicit none real :: x real :: z = -1.0 real :: y(3) x = -1.0 x = sqrt(x) y = [sqrt(x), log(x), exp(x)] print*, x print *, isnan(x) if (isnan(x) .neqv. .true.) error stop print*, y(1) print *, isnan(y(1)) if (isnan(y(1)) .neqv. .true.) error stop print*, y(2) print *, isnan(y(2)) if (isnan(y(2)) .neqv. .true.) error stop print*, y(3) print *, isnan(y(3)) if (isnan(y(3)) .neqv. .true.) error stop !tests for compile time argument print *, isnan(1.0) if (isnan(1.0) .neqv. .false.) error stop print *, isnan(sqrt(z)) if (isnan(sqrt(z)) .neqv. .true.) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_180.f900000664000175000017500000000052315141516316024475 0ustar alastairalastairprogram intrinsics_180 implicit none character(len=20) :: x integer :: pos x = "fortran" pos = scan(x, "ao") print *, pos if (pos /= 2) error stop pos = scan(x, "a") print *, pos if (pos /= 6) error stop pos = scan(x, "ao", .true.) print *, pos if (pos /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/program_04.f900000664000175000017500000000005115141516316023666 0ustar alastairalastairimplicit none print *, "hello world" end lfortran-lfortran-2f73434/integration_tests/separate_compilation_27.f900000664000175000017500000000031215141516316026426 0ustar alastairalastairprogram separate_compilation_27 use io_separate_compilation_27, only: open implicit none integer :: u = 1 call open(u) print *, u if (u /= 3) error stop end program separate_compilation_27lfortran-lfortran-2f73434/integration_tests/intrinsics_220.f900000664000175000017500000000304615141516316024473 0ustar alastairalastairprogram intrinsics_220 integer :: a, b, i integer(8) :: c, d, e integer(4) :: expected_1(3) integer(8) :: expected_2(3) integer :: iterator integer(4), parameter :: result_1(3) = merge_bits([-10, 10, -10], [-15, 15, 15], [-2, 2, -2]) integer(8), parameter :: result_2(3) = merge_bits([1005627, -1005627827, 92748272], & [1027293, 1026271812, -82927282], [10098, -1628291, -10098]) expected_1 = [-9, 15, -9] expected_2 = [1018047_8, -1005613491_8, 92748224_8] do iterator = 1, size(result_1) print *, result_1(iterator) if (result_1(iterator) /= expected_1(iterator)) error stop end do do iterator = 1, size(result_2) print *, result_2(iterator) if (result_2(iterator) /= expected_2(iterator)) error stop end do a = -10 b = -15 i = -2 c = 1005627 d = 1027293 e = 10098 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= -9) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= 1018047) error stop a = 10 b = 15 i = 2 c = -1005627827 d = 1026271812 e = -1628291 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= 15) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= -1005613491) error stop a = -10 b = 15 i = -2 c = 92748272 d = -82927282 e = -10098 print *, merge_bits(a, b, i) if(merge_bits(a, b, i) /= -9) error stop print *, merge_bits(c, d, e) if(merge_bits(c, d, e) /= 92748224) error stop end programlfortran-lfortran-2f73434/integration_tests/string_66.f900000664000175000017500000000154115141516316023542 0ustar alastairalastairmodule string_66_mod implicit none contains pure function str_int(i) result(s) integer, intent(in) :: i character(len=100) :: s write(s, '(i0)') i end function pure integer function str_real_len(r, fmt) result(sz) real, intent(in) :: r character(len=*), intent(in) :: fmt integer, parameter :: MAX_STR = 100 character(MAX_STR) :: s write(s, fmt) r sz = len_trim(s) end function function str_real_n(r, n) result(s) real :: r integer :: n character(len=str_real_len(r, "(f0." // str_int(n) // ")")) :: s print *, len(s) if(len(s) /= 14) error stop end function end module program string_66 use string_66_mod character(:),allocatable :: strr real :: r integer :: i r = 102.2 i = 10 strr = str_real_n(r,i) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_78.f900000664000175000017500000000573515141516316024435 0ustar alastairalastairprogram intrinsics_78 implicit none integer :: ix, iy, iresult integer(8) :: j integer(4) :: i real(8) :: a real(4) :: b real :: rx, ry, rresult double precision :: dx, dy, dresult ! Test integer values ix = 10 iy = 3 iresult = mod(ix, iy) print *, "Test 1: mod(", ix, ",", iy, ") = ", iresult if (iresult /= 1) error stop "Test 1 failed" ix = 10 iy = 5 iresult = mod(ix, iy) print *, "Test 2: mod(", ix, ",", iy, ") = ", iresult if (iresult /= 0) error stop "Test 2 failed" ix = -10 iy = 3 iresult = mod(ix, iy) print *, "Test 3: mod(", ix, ",", iy, ") = ", iresult if (iresult /= -1) error stop "Test 3 failed" ! Test real values rx = 10.0 ry = 3.0 rresult = mod(rx, ry) print *, "Test 4: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 1.0) > 1e-9) error stop "Test 4 failed" rx = 10.0 ry = 5.0 rresult = mod(rx, ry) print *, "Test 5: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 0.0) > 1e-9) error stop "Test 5 failed" rx = -10.0 ry = 3.0 rresult = mod(rx, ry) print *, "Test 6: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - (-1.0)) > 1e-9) error stop "Test 6 failed" rx = 12.98 ry = 3.0 rresult = mod(rx, ry) print *, "Test 7: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 0.98) > 1e-6) error stop "Test 7 failed" rx = 12.98 ry = 13.0 rresult = mod(rx, ry) print *, "Test 8: mod(", rx, ",", ry, ") = ", rresult if (abs(rresult - 12.98) > 1e-9) error stop "Test 8 failed" ! Test double precision values dx = 10.0D0 dy = 3.0D0 dresult = mod(dx, dy) print *, "Test 9: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 1.0D0) > 1d-9) error stop "Test 9 failed" dx = 12.98D0 dy = 3.0D0 dresult = mod(dx, dy) print *, "Test 10: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 0.98D0) > 1d-9) error stop "Test 10 failed" dx = 12.98D0 dy = 13.0D0 dresult = mod(dx, dy) print *, "Test 11: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - 12.98D0) > 1d-9) error stop "Test 11 failed" dx = -12.98D0 dy = 13.0D0 dresult = mod(dx, dy) print *, "Test 12: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - (-12.98D0)) > 1d-9) error stop "Test 12 failed" dx = -3.14D0 dy = -2.0D0 dresult = mod(dx, dy) print *, "Test 13: mod(", dx, ",", dy, ") = ", dresult if (abs(dresult - (-1.14D0)) > 1d-9) error stop "Test 13 failed" ! Test integer values with different kinds i = 121 j = 121 iresult = kind(mod(j,i)) print *, "Test 14: kind(mod(", i, ",", j, ")) = ", iresult if(iresult /= 8) error stop "Test 14 failed" ! Test real values with different kinds a = 121.882 b = 121.882 iresult = kind(mod(a,b)) print *, "Test 15: kind(mod(", a, ",", b, ")) = ", iresult if(iresult /= 8) error stop "Test 15 failed" end program intrinsics_78 lfortran-lfortran-2f73434/integration_tests/intrinsics_182.f900000664000175000017500000000207215141516316024500 0ustar alastairalastairprogram intrinsics_182 use iso_fortran_env, only: dp => real64 integer :: i, j, shift1 integer(8) :: a, b, shift2 i = 10 j = 4 shift1 = 3 a = 7 b = 12 shift2 = 5 print *, dshiftl(10, 4, 3) if(dshiftl(10, 4, 3) /= 80) error stop print *, dshiftl(7_dp, 12_dp, 5) if(dshiftl(7_dp, 12_dp , 5) /= 224) error stop print *, dshiftl(10, 12, 7) if(dshiftl(10, 12, 7) /= 1280) error stop print *, dshiftl(i, j, shift1) if(dshiftl(i, j, shift1) /= 80) error stop print *, dshiftl(a, b, shift2) if(dshiftl(a, b, shift2) /= 224) error stop print *, kind(dshiftl(10, 4, 3)) if(kind(dshiftl(10, 4, 3)) /= 4) error stop print *, kind(dshiftl(7_dp, 12_dp, 5)) if(kind(dshiftl(7_dp, 12_dp, 5)) /= 8) error stop print *, kind(dshiftl(10, 12, 7)) if(kind(dshiftl(10, 12, 7)) /= 4) error stop print *, kind(dshiftl(i, j, shift1)) if(kind(dshiftl(i, j, shift1)) /= 4) error stop print *, kind(dshiftl(a, b, shift2)) if(kind(dshiftl(a, b, shift2)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_19b.f900000664000175000017500000000056115141516316026577 0ustar alastairalastairsubmodule(mod_separate_compilation_19) submod_separate_compilation_19 implicit none contains module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key integer, parameter :: i = 5 key = i end subroutine map_open_entry end submodule submod_separate_compilation_19lfortran-lfortran-2f73434/integration_tests/arrays_01_multi_dim.f900000664000175000017500000000131015141516316025557 0ustar alastairalastairprogram arrays_01_multi_dim implicit none integer, parameter :: no_of_height = 3 integer, parameter :: no_of_row = 2 integer, parameter :: no_of_col = 3 integer :: arr(no_of_height, no_of_row, no_of_col) integer :: height integer :: row integer :: col do height = 1, no_of_height do row = 1, no_of_row do col = 1, no_of_col arr(height, row, col) = height * row * col end do end do end do do height = 1, no_of_height write(*,*) "height =", height do row = 1, no_of_row do col = 1, no_of_col write(*,*) arr(height, row, col) end do end do end do end program arrays_01_multi_dim lfortran-lfortran-2f73434/integration_tests/separate_compilation_03a.f900000664000175000017500000000023715141516316026567 0ustar alastairalastairmodule separate_compilation_03a_module contains real function integrate_trapz_1(Rp) result(s) real, intent(in) :: Rp(:) s = sum(Rp) end function end module lfortran-lfortran-2f73434/integration_tests/modules_20.f900000664000175000017500000000026615141516316023675 0ustar alastairalastairprogram modules_20 use modules_20b, only: trim2, tfc implicit none character(*), parameter :: s1 = " A B ", s2 = " " call trim2(s1) call trim2(s2) call trim2("xx ") end program lfortran-lfortran-2f73434/integration_tests/list_test_02_.f900000664000175000017500000000511215141516316024371 0ustar alastairalastairmodule list_test_02_mod implicit none character(len=:), allocatable :: tmp_str contains function fill_list_str(size) result(a) integer, intent(in) :: size type(_lfortran_list(character(len=:))) :: a integer :: i character(len=:), allocatable :: str_tmp a = _lfortran_list_constant("0_str", "1_str") do i = 0, size-1 write(str_tmp, '(I0)') i + 2 str_tmp = trim(str_tmp)//"_str" call _lfortran_list_append(a, str_tmp) end do end function subroutine test_list_01() type(_lfortran_list(character(len=:))) :: a, b character(len=:), allocatable :: string integer :: i character(len=:), allocatable :: str_tmp string = "string_" b = _lfortran_list_constant(string, string) a = fill_list_str(10) do i = 0, 9 write(str_tmp, '(I0)') i + 2 call _lfortran_list_append(b, trim(string) // trim(str_tmp)) end do do i = 0, 11 print *, _lfortran_get_item(a, i), _lfortran_get_item(b, i) end do call _lfortran_set_item(a, 11, "no_str") call _lfortran_set_item(a, 10, string) do i = 0, 11 if (i / 2 == 2 * i) then write(str_tmp, '(I0)') i call _lfortran_set_item(b, i, trim(str_tmp) // "_str") else write(string, '(I0)') i string = trim(string) // "_str" call _lfortran_set_item(b, i, string) end if end do do i = 0, 9 if (_lfortran_get_item(b, i) /= _lfortran_get_item(a, i)) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(character(len=:))) :: x, y integer :: i character(len=:), allocatable :: str_tmp, s x = _lfortran_list_constant("1", "2") do i = 0, 49 write(str_tmp, '(I0)') i call _lfortran_list_append(x, "str_" // trim(str_tmp)) end do write(str_tmp, '(A,A)') "str_", _lfortran_get_item(x, 0) call _lfortran_set_item(x, 0, trim(str_tmp)) write(str_tmp, '(A,A)') "str_", _lfortran_get_item(x, 1) call _lfortran_set_item(x, 1, trim(str_tmp)) do i = 0, _lfortran_len(x) - 1 call _lfortran_list_append(y, _lfortran_get_item(x, i)) end do do i = 0, _lfortran_len(y) - 1 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine tests() call test_list_01() call test_list_02() end subroutine end module program test_list_str use list_test_02_mod implicit none call tests() end program lfortran-lfortran-2f73434/integration_tests/array_03_pack.f900000664000175000017500000000065315141516316024342 0ustar alastairalastairprogram array_03_pack implicit none character(len=1), dimension(:,:), allocatable :: array integer :: packoutput(10) allocate(array(3, 5)) array(1, :) = "a" array(2, :) = "." array(3, :) = "c" print *, ichar(pack(array, mask=(array /= '.'))) packoutput = ichar(pack(array, mask=(array /= '.'))) if( any(packoutput /= [97, 99, 97, 99, 97, 99, 97, 99, 97, 99]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/string_93.f900000664000175000017500000000214115141516316023537 0ustar alastairalastairprogram w1 implicit none call notstring_test () contains subroutine notstring_test () character(7), parameter :: notstring_dataa(7) = & ["candy ", 'x ', "not bad", 'bad ', 'not ', & 'is not ', 'no '] character(10), parameter :: notstring_expected(7) = & ['not candy ', 'not x ', 'not bad ', 'not bad ', 'not ', & 'not is not', 'not no '] character(len (notstring_expected)) :: notstring_results(size (notstring_dataa)) integer :: i ! notString ! The following line causes an 'Unhandled Exception'. notstring_results = [(notstring (notstring_dataa(i)), i=1, size (notstring_dataa))] print *, merge ('passed', 'failed', & all (notstring_results == notstring_expected)) end subroutine function notstring (str) character(*), intent(in) :: str character(:), allocatable :: notstring if (len (str) < 3) then notstring = 'not ' // str else if (str(1:3) /= 'not') then notstring = 'not ' // str else notstring = str end if end function end program lfortran-lfortran-2f73434/integration_tests/derived_types_14_module.f900000664000175000017500000000115215141516316026436 0ustar alastairalastairmodule derived_types_14_module !> Possible kinds of TOML values in key-value pairs implicit none private type :: enum_type !> Invalid type integer :: invalid = 100 !> String type integer :: string = 101 !> Boolean type integer :: boolean = 102 !> Integer type integer :: int = 103 !> Float type integer :: float = 104 !> Datetime type integer :: datetime = 105 end type enum_type !> Actual enumerator with TOML value types type(enum_type), public, parameter :: toml_type = enum_type() end module lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_11_stubs.c0000664000175000017500000000125315141516316027637 0ustar alastairalastair/* Minimal stubs for LAPACK routines - just enough to link and run */ int lsame(void *a, void *b) { return 1; } float slamch(void *cmach) { return 1.0f; } float slange(void *norm, void *m, void *n, void *a, void *lda, void *work) { return 0.0f; } void sgemm(void *transa, void *transb, void *m, void *n, void *k, void *alpha, void *a, void *lda, void *b, void *ldb, void *beta, void *c, void *ldc) {} void slacpy(void *uplo, void *m, void *n, void *a, void *lda, void *b, void *ldb) {} void slascl(void *type, void *kl, void *ku, void *cfrom, void *cto, void *m, void *n, void *a, void *lda, void *info) {} void xerbla(void *srname, void *info) {} lfortran-lfortran-2f73434/integration_tests/where_12.f900000664000175000017500000000111115141516316023326 0ustar alastairalastairprogram where_12 integer ::arr(3,3,3) integer ::arr2(3,3,3) arr = 10 arr2 = 11 arr(:,2,:) = 0 where(arr == 0) arr = 555 arr2 = 555 end where print *, arr if(any(arr(:,2,:) /= 555) .or. any(arr(:,1,:) /= 10) .or. any(arr(:,3,:) /= 10)) error stop ! Test whether the other array got affected or not, just to make sure assignments inside if are handled correctly by where pass. print *, arr2 if(any(arr2(:,2,:) /= 555) .or. any(arr2(:,1,:) /= 11) .or. any(arr2(:,3,:) /= 11)) error stop end program where_12lfortran-lfortran-2f73434/integration_tests/separate_compilation_19a.f900000664000175000017500000000075115141516316026577 0ustar alastairalastairmodule mod_separate_compilation_19 implicit none private public :: open_hashmap_type type :: open_hashmap_type contains procedure :: map_entry => map_open_entry end type open_hashmap_type interface module subroutine map_open_entry(map, key) class(open_hashmap_type), intent(inout) :: map integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_separate_compilation_19lfortran-lfortran-2f73434/integration_tests/intrinsics_124.f900000664000175000017500000000375615141516316024506 0ustar alastairalastairprogram intrinsics_124 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = lshift([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = lshift([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [24, -52, 144, 320, 2144] integer(8) :: expected_res2(5) = [210944, 356352, 1408, -95, -137216] integer(4), parameter :: comp1 = lshift(12, 1) integer(8), parameter :: comp2 = lshift(103, 11) print *, comp1 if (comp1 /= 24) error stop print *, comp2 if (comp2 /= 210944) error stop res_x = lshift(arg_x, arg_y) res_x2 = lshift(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, lshift(10_4, 0) if (.not. lshift(10_4, 0) == 10) error stop print*, lshift(-10_8, 1) if ( lshift(-10_8, 1) /= -20 ) error stop print*, lshift(not(10_4), 2) if ( lshift(not(10_4), 2) /= -44 ) error stop print*, lshift(not(10_8), 3) if ( lshift(not(10_8), 3) /= -88 ) error stop print*, lshift(-x, y) if ( lshift(-x, y) /= -64 ) error stop print*, lshift(i, j) if ( lshift(i, j) /= 128 ) error stop print*, lshift(10, 1) if ( lshift(10, 1) /= 20 ) error stop print*, lshift(8, 2) if ( lshift(8, 2) /= 32 ) error stop end lfortran-lfortran-2f73434/integration_tests/class_23.f900000664000175000017500000000123315141516316023330 0ustar alastairalastairmodule class_23_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type contains subroutine test(self) class(base) :: self select type(self) type is (derived) if (self%m /= 10) error stop if (self%n /= 20) error stop end select end subroutine end module program class_23 use class_23_m implicit none class(base), allocatable :: b type(derived) :: d allocate(derived :: b) d = derived(10, 20) b = d call test(b) end program lfortran-lfortran-2f73434/integration_tests/intent_out_array_01.f900000664000175000017500000000155515141516316025614 0ustar alastairalastair! Test for intent(out) allocatable array of derived type with nested allocatables ! Issue #9097: nested allocatables must be deallocated before outer array on re-entry program intent_out_array_01 implicit none type :: node_t integer, allocatable :: data(:) end type type(node_t), allocatable :: nodes(:) call create_nodes(nodes, 3, 5) call create_nodes(nodes, 2, 4) ! Re-entry: must dealloc nested first if (size(nodes) /= 2) error stop if (size(nodes(1)%data) /= 4) error stop print *, "PASS" contains subroutine create_nodes(nodes, n, sz) type(node_t), allocatable, intent(out) :: nodes(:) integer, intent(in) :: n, sz integer :: i allocate(nodes(n)) do i = 1, n allocate(nodes(i)%data(sz)) nodes(i)%data = i * 10 end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_381.f900000664000175000017500000000043015141516316024475 0ustar alastairalastairPROGRAM intrinsics_381 CHARACTER(len=255) :: test_env_var integer :: len CALL get_environment_variable("LFORTRAN_TEST_ENV_VAR", test_env_var, len) WRITE (*,*) TRIM(test_env_var) if (trim(test_env_var) /= "STATUS OK!") error stop print *, len if (len /= 10) error stop END PROGRAM lfortran-lfortran-2f73434/integration_tests/bindc_03.f900000664000175000017500000000154415141516316023305 0ustar alastairalastairsubroutine fn() bind(c) print *, "Hello from fn in fortran" end subroutine subroutine test_val( val ) bind(c) use iso_c_binding integer(c_int), value :: val print *, "val = ", val if ( val /= 42 ) error stop end subroutine program bindc_03 use iso_c_binding implicit none interface subroutine fn() bind(c) end subroutine subroutine test_val( val ) bind(c) import :: c_int integer(c_int), value :: val end subroutine subroutine execute_function( fn ) bind(c, name = "execute_function") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine execute_function_with_arg( fn, val ) bind(c, name = "execute_function_with_arg") import :: c_funptr, c_int integer(c_int), value :: val type(c_funptr), value :: fn end subroutine end interface call execute_function( c_funloc( fn ) ) call execute_function_with_arg( c_funloc( test_val ), 42 ) end program lfortran-lfortran-2f73434/integration_tests/file_31_data.txt0000664000175000017500000000015715141516316024357 0ustar alastairalastair10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 lfortran-lfortran-2f73434/integration_tests/interface_16.f900000664000175000017500000000357215141516316024175 0ustar alastairalastair! This integration test tests for the comparison of `Var_t` expressions ! at runtime. ! ! The test is framed such that it checks if a variable passed from ! one subroutine to another for setting the dimension of an array works. ! ! The underlying idea is that when a variable is used to set the dimension ! of an array in a subroutine, the passed variable is internally checked for ! equality of expression with the parameter variable. If the variable ! expressions are equal, the program will execute, else it will fail. ! ! ! This means that for a subroutine ! ! SUBROUTINE subroutine_1 ( arr_1, nx ) ! ! INTEGER, DIMENSION(nx), INTENT(IN) :: arr_1 ! ! INTEGER, INTENT(IN) :: nx ! ! END SUBROUTINE subroutine_1 ! ! and another subroutine ! ! SUBROUTINE subroutine_2 ( arr_2, ny ) ! ! INTEGER, DIMENSION(ny):: arr_2 ! ! INTEGER, INTENT(IN) :: ny ! ! CALL subroutine_1 ( arr_2, ny ) ! ! END SUBROUTINE subroutine_2 ! ! ! the expression type of the argument variable `ny` to `subroutine_1` must be equal to ! the parameter variable `nx`. MODULE module_interface_16 INTERFACE sub MODULE PROCEDURE subroutine_1 END INTERFACE sub CONTAINS SUBROUTINE subroutine_1 ( arr_1, nx ) INTEGER, DIMENSION(nx), INTENT(IN) :: arr_1 INTEGER, INTENT(IN) :: nx PRINT *, nx IF (nx /= 4) ERROR STOP PRINT *, arr_1 IF (all(arr_1 /= [1, 2, 3, 4])) ERROR STOP END SUBROUTINE subroutine_1 SUBROUTINE subroutine_2 ( arr_2, ny ) INTEGER, DIMENSION(ny):: arr_2 INTEGER, INTENT(IN) :: ny CALL subroutine_1 ( arr_2, ny ) END SUBROUTINE subroutine_2 END MODULE module_interface_16 PROGRAM interface_16 USE module_interface_16 IMPLICIT NONE INTEGER :: n INTEGER, DIMENSION(4) :: test_arr n = 4 test_arr = [1, 2, 3, 4] CALL subroutine_2( test_arr, n ) END PROGRAM interface_16 lfortran-lfortran-2f73434/integration_tests/associate_01.f900000664000175000017500000000104215141516316024170 0ustar alastairalastairprogram associate_01 implicit none real, allocatable :: a(:), b(:,:), c(:,:,:) real, pointer :: x(:), y(:,:,:) real :: a_1, c_234, c_121 integer :: n a_1 = 0 n = 10 allocate(a(5)) allocate(b(n,n), c(n, 5, n)) 1 loop: associate (x => a, y => c, z => c(:, 2, :)) x(1) = a_1 + 5 y(2,3,4) = 3 z(1, 1) = 17 if (size(z) /= 100) error stop end associate loop a_1 = a(1) if(a(1).EQ.5) GO TO 1 c_234 = c(2,3,4) c_121 = c(1,2,1) if (a_1 /= 10.) error stop if (c_234 /= 3.) error stop if (c_121 /= 17.) error stop end program associate_01 lfortran-lfortran-2f73434/integration_tests/use_03.f900000664000175000017500000000064715141516316023025 0ustar alastairalastairmodule test_use_03 use iso_fortran_env, ip => int32 implicit none integer,parameter :: i = real64 contains subroutine test_ip_working() print *, ip if ( ip /= 4 ) error stop end subroutine end module test_use_03 program use_03 use test_use_03 implicit none print *, i, ip if ( i /= 8 ) error stop if ( ip /= 4 ) error stop call test_ip_working() end program lfortran-lfortran-2f73434/integration_tests/associate_21_mod.f900000664000175000017500000000142615141516316025037 0ustar alastairalastairmodule associate_21_mod_a implicit none type :: dependency_t character(len=:), allocatable :: name integer :: key end type dependency_t end module associate_21_mod_a module associate_21_mod_b use associate_21_mod_a implicit none type :: model_t type(dependency_t), allocatable :: dependency(:) contains procedure :: update_dependency end type model_t contains subroutine update_dependency(self, ii, key) class(model_t), intent(inout) :: self integer, intent(in) :: ii integer, intent(in) :: key associate (dep => self%dependency(ii)) dep%name = "LFortran" dep%key = key end associate end subroutine update_dependency end module associate_21_mod_blfortran-lfortran-2f73434/integration_tests/arrays_op_29.f900000664000175000017500000000051715141516316024234 0ustar alastairalastairprogram arrays_op_29 implicit none real(8) :: x(2) = (/ 0.5_8, 0.5_8 /) print *, R3(x) if( any(R3(x) /= -3.5) ) error stop contains function R3(x) real(8), intent(in) :: x(:) real(8) :: R3(size(x)) real(8) :: a, b real(8), parameter :: c = 2.0 a = x(1) b = x(2) R3 = a**2.0 + b**2.0 - c**2.0 end function end program arrays_op_29 lfortran-lfortran-2f73434/integration_tests/intrinsics_259.f900000664000175000017500000000545715141516316024517 0ustar alastairalastairprogram intrinsics_259 implicit none character(5) :: hello = "hello" character(5) :: world = "world" character(8) :: lfortran = "lfortran" character(7) :: fortran = "fortran" character(5) :: sym = "#s@ym" character(4) :: sym2 = "s_y!" logical, parameter :: l1 = lgt("hello", "world") logical, parameter :: l2 = lge("lfortran", "fortran") logical, parameter :: l3 = llt("#s@ym", "world") logical, parameter :: l4 = lle("hello", "s_y!") logical, parameter :: ar1(3) = lgt(["hello", "world", "#s@ym"], ["world", "hello", "s_y!0"]) logical, parameter :: ar2(3) = lgt(["lfortran", "gfortran", "fort_ran"], ["world", "hello", "s_y!0"]) logical, parameter :: ar3(3) = lge(["lfortran", "gfortran", "fort_ran"], ["hello", "world", "#s@ym"]) logical, parameter :: ar4(3) = llt(["hello", "world", "#s@ym"], ["world", "hello", "s_y!0"]) character(5) :: arr1(3) character(5) :: arr2(3) character(8) :: arr3(3) character(5) :: arr4(3) logical :: res(3) arr1 = ["hello", "world", "#s@ym"] arr2 = ["world", "hello", "s_y!0"] arr3 = ["lfortran", "gfortran", "fort_ran"] arr4 = ["world", "hello", "s_y!0"] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, l3 if (l3 .neqv. .true.) error stop print *, l4 if (l4 .neqv. .true.) error stop print *, ar1 ! if (all(ar1 .neqv. [.false., .true., .false.])) error stop ! does not work yet print *, ar2 ! if (all(ar2 .neqv. [.false., .false., .false.])) error stop print *, ar3 ! if (all(ar3 .neqv. [.true., .false., .true.])) error stop print *, ar4 ! if (all(ar4 .neqv. [.true., .false., .true.])) error stop print *, lgt(hello, world) if (lgt(hello, world) .neqv. .false.) error stop print *, lge(lfortran, fortran) if (lge(lfortran, fortran) .neqv. .true.) error stop print *, llt(sym, world) if (llt(sym, world) .neqv. .true.) error stop print *, lle(hello, sym2) if (lle(hello, sym2) .neqv. .true.) error stop print *, lgt(arr1, arr2) if (all(lgt(arr1, arr2) .neqv. [.true., .true., .true.])) error stop print *, lge(arr2, arr3) if (all(lge(arr2, arr3) .neqv. [.true., .true., .true.])) error stop print *, llt(arr3, arr4) if (all(llt(arr3, arr4) .neqv. [.true., .true., .true.])) error stop print *, lle(arr4, arr1) if (all(lle(arr4, arr1) .neqv. [.true., .true., .true.])) error stop res = lgt(arr1, arr2) if (all(res .neqv. [.true., .true., .true.])) error stop res = lge(arr2, arr3) if (all(res .neqv. [.true., .true., .true.])) error stop res = llt(arr3, arr4) if (all(res .neqv. [.true., .true., .true.])) error stop res = lle(arr4, arr1) if (all(res .neqv. [.true., .true., .true.])) error stop end programlfortran-lfortran-2f73434/integration_tests/expr_04.f900000664000175000017500000000030315141516316023175 0ustar alastairalastairprogram expr_04 implicit none integer :: x x = 2**4; if (x /= 16) error stop x = 2.**4; if (x /= 16) error stop x = 2**4.; if (x /= 16) error stop x = 2.**4.; if (x /= 16) error stop end program lfortran-lfortran-2f73434/integration_tests/types_08.f900000664000175000017500000000046715141516316023402 0ustar alastairalastairprogram types_08 implicit none contains subroutine f(i, j) integer, optional, intent(in) :: i integer, intent(in) :: j optional :: j end subroutine subroutine g(i, j) integer, optional, intent(in) :: i integer j intent(in) j optional j end subroutine end program lfortran-lfortran-2f73434/integration_tests/openmp_15.f900000664000175000017500000000263615141516316023532 0ustar alastairalastairsubroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i !$omp parallel !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a, ctr) use omp_lib implicit none integer, intent(in) :: n, ctr real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 !$omp parallel do reduction(+:sum) do i = 1, n sum = sum + a(i) end do !$omp end parallel do ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same print *, sum if ( ctr == 1 ) then if (abs(sum - 12933994.0) > 1e-7) error stop else ! if (abs(sum - 25867988.0) > 1e-7) error stop ! lfortran always gives 2.58679600e+07 end if end subroutine subroutine reduce_array(n, a, b) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a real, dimension(n) :: b integer :: i !$omp parallel do do i = 2, n b(i) = a(i) + a(i-1) end do !$omp end parallel do b(1) = a(1) * 2 end subroutine program openmp_15 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a, b call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n) call parallel_sum(n, a, 1) call reduce_array(n, a, b) call parallel_sum(n, b, 0) end program lfortran-lfortran-2f73434/integration_tests/elemental_11.f900000664000175000017500000001002715141516316024167 0ustar alastairalastairprogram elemental_11 implicit none real, dimension(3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(3) :: result_2param real, dimension(3) :: result_3param array_param = [ 1.0, 2.0, 3.0 ] scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = [ 2.0, 0.0, 0.0 ] if (abs(result_2param(1) - expected_ans(1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = [ 2.0, 6.0, 12.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = [ 2.0, 5.0, 10.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = [ 2.0, 4.0, 6.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = [ 2.0, 3.0, 4.0 ] if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = [ 2.0, 0.0, 0.0 ] if (abs(result_3param(1) - expected_ans(1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_11 lfortran-lfortran-2f73434/integration_tests/modules_58.f900000664000175000017500000000021715141516316023704 0ustar alastairalastairprogram test_external_symbol use module_58_module02 call mms_allocate() call test_alocate_external end program test_external_symbollfortran-lfortran-2f73434/integration_tests/intrinsics_216.f900000664000175000017500000001073315141516316024501 0ustar alastairalastairprogram intrinsics_216 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(18) real(sp) :: x(19) real(dp) :: expected_w(18) real(sp) :: expected_x(19) real(dp), parameter :: res(18) = tand([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = tand([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.33893680906656531_dp, 0.61847095166537402_dp, 1.0618790637212407_dp, & -0.33893680906656531_dp, -0.61847095166537402_dp, -1.0618790637212407_dp, -31.626730189083542_dp, & -22.355091700495215_dp, -18.246009265584753_dp, -15.795576912540882_dp, -14.122687866626119_dp, & -12.887346837923063_dp, -11.926878796582502_dp, -11.152376450806424_dp, -10.510603475834616_dp, & -9.9674784142684150_dp, -9.5000362475747657_dp, -9.0921624583853777_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.320999980_sp, 0.526000023_sp, 0.727999985_sp, -0.320999980_sp, & -0.526000023_sp, -0.727999985_sp, -1.00000000_sp, -0.998999894_sp, -0.998999894_sp, & -0.997999907_sp, -0.997999907_sp, -0.996999860_sp, -0.996999860_sp, -0.995999992_sp, & -0.995999992_sp, -0.995000064_sp, -0.995000064_sp, -0.993999898_sp, -0.993999898_sp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, tand(w(i)) if (abs(tand(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, tand(x(i)) if (abs(tand(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, tand(a) if (abs(tand(a) - 0.342922598) > 1e-3) error stop print *, tand(b) if (abs(tand(b) - 0.640190780) > 1e-3) error stop print *, tand(c) if (abs(tand(c) - 1.07699490) > 1e-3) error stop print *, tand(18.928_sp) if (abs(tand(18.928_sp) - 0.342922598) > 1e-3) error stop print *, tand(32.627_sp) if (abs(tand(32.627_sp) - 0.640190780) > 1e-3) error stop print *, tand(47.123_sp) if (abs(tand(47.123_sp) - 1.07699490) > 1e-3) error stop print *, tand(d) if (abs(tand(d) - 0.34099778889496968) > 1e-3) error stop print *, tand(e) if (abs(tand(e) - 0.64266073192537432) > 1e-3) error stop print *, tand(f) if (abs(tand(f) - 1.0807816506290617) > 1e-3) error stop print *, tand(18.829262783_dp) if (abs(tand(18.829262783_dp) - 0.34099778889496968) > 1e-3) error stop print *, tand(32.727262783_dp) if (abs(tand(32.727262783_dp) - 0.64266073192537432) > 1e-3) error stop print *, tand(47.223262783_dp) if (abs(tand(47.223262783_dp) - 1.0807816506290617) > 1e-3) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_62_terminal.f900000664000175000017500000000146315141516316025576 0ustar alastairalastairmodule modules_62_terminal implicit none private public :: toml_terminal, ansi_code ! Nested type type :: ansi_code integer :: style = -1 integer :: bg = -1 integer :: fg = -1 end type ansi_code ! Main type with multiple ansi_code components and default init type :: toml_terminal type(ansi_code) :: reset = ansi_code() type(ansi_code) :: bold = ansi_code() end type toml_terminal interface toml_terminal module procedure :: new_terminal end interface toml_terminal contains pure function new_terminal(use_color) result(new) logical, intent(in) :: use_color type(toml_terminal) :: new if (use_color) then new%reset = ansi_code(0, -1, -1) new%bold = ansi_code(1, -1, -1) end if end function new_terminal end module modules_62_terminal lfortran-lfortran-2f73434/integration_tests/file_open_02.f900000664000175000017500000000017615141516316024165 0ustar alastairalastairprogram open_recl_test integer :: u open(newunit=u, file="test.bin", access="direct", recl=4) close(u) end programlfortran-lfortran-2f73434/integration_tests/functions_33.f900000664000175000017500000000102015141516316024226 0ustar alastairalastairmodule functions_33_mod abstract interface subroutine interface_signature() end subroutine end interface procedure(interface_signature), pointer :: func_ptr contains subroutine test_uobyqa() func_ptr => ff call func_ptr() end subroutine subroutine ff() print *, "hi" end subroutine end module functions_33_mod program functions_33 use functions_33_mod call test_uobyqa() end program lfortran-lfortran-2f73434/integration_tests/read_05.f900000664000175000017500000000030115141516316023131 0ustar alastairalastairprogram main implicit none character(len=10) :: x ! Accept READ with format literal and no unit if (.false.) then read '(A)', x end if print *, 'ok' end program lfortran-lfortran-2f73434/integration_tests/openmp_56.f900000664000175000017500000000061215141516316023527 0ustar alastairalastairprogram openmp_56 use omp_lib implicit none integer :: counter counter=0 call omp_set_num_threads(10) !$omp parallel !$omp task shared(counter) !$omp atomic counter=counter+1 print *, "Task done by TID:-",omp_get_thread_num() !$omp end task !$omp end parallel if(counter/=10) error stop end program openmp_56 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_14.f900000664000175000017500000001535115141516316026602 0ustar alastairalastair! Stress test for stack usage when legacy sequence association rewrites a(i) ! to an array section for an external (separate-compilation) assumed-size dummy. ! ! The key is to avoid materializing array-section descriptors when only the ! address of the first element is required. program legacy_array_sections_14 use, intrinsic :: iso_c_binding, only: c_int, c_long implicit none integer, parameter :: n = 300 integer, parameter :: depth = 25 integer, parameter :: check_idx = 150 real, allocatable :: a(:) call limit_stack_bytes(262144_c_long) allocate(a(n)) a = 0.0 call recurse(depth, a) if (abs(a(check_idx) - real(depth)) > 1.0e-6) error stop print *, "PASSED" contains subroutine limit_stack_bytes(bytes) use, intrinsic :: iso_c_binding, only: c_int, c_long implicit none integer(c_long), intent(in) :: bytes integer(c_int), parameter :: rlimit_stack = 3 type, bind(c) :: rlimit_t integer(c_long) :: rlim_cur integer(c_long) :: rlim_max end type rlimit_t interface integer(c_int) function setrlimit(resource, rl) bind(c, name="setrlimit") import :: c_int, rlimit_t integer(c_int), value :: resource type(rlimit_t), intent(in) :: rl end function setrlimit end interface type(rlimit_t) :: rl integer(c_int) :: rc rl%rlim_cur = bytes rl%rlim_max = bytes rc = setrlimit(rlimit_stack, rl) if (rc /= 0) error stop end subroutine limit_stack_bytes recursive subroutine recurse(level, a) implicit none integer, intent(in) :: level real, intent(inout) :: a(*) external :: foo if (level == 0) return ! Many distinct call sites to amplify per-function stack usage. call foo(a(1)) call foo(a(2)) call foo(a(3)) call foo(a(4)) call foo(a(5)) call foo(a(6)) call foo(a(7)) call foo(a(8)) call foo(a(9)) call foo(a(10)) call foo(a(11)) call foo(a(12)) call foo(a(13)) call foo(a(14)) call foo(a(15)) call foo(a(16)) call foo(a(17)) call foo(a(18)) call foo(a(19)) call foo(a(20)) call foo(a(21)) call foo(a(22)) call foo(a(23)) call foo(a(24)) call foo(a(25)) call foo(a(26)) call foo(a(27)) call foo(a(28)) call foo(a(29)) call foo(a(30)) call foo(a(31)) call foo(a(32)) call foo(a(33)) call foo(a(34)) call foo(a(35)) call foo(a(36)) call foo(a(37)) call foo(a(38)) call foo(a(39)) call foo(a(40)) call foo(a(41)) call foo(a(42)) call foo(a(43)) call foo(a(44)) call foo(a(45)) call foo(a(46)) call foo(a(47)) call foo(a(48)) call foo(a(49)) call foo(a(50)) call foo(a(51)) call foo(a(52)) call foo(a(53)) call foo(a(54)) call foo(a(55)) call foo(a(56)) call foo(a(57)) call foo(a(58)) call foo(a(59)) call foo(a(60)) call foo(a(61)) call foo(a(62)) call foo(a(63)) call foo(a(64)) call foo(a(65)) call foo(a(66)) call foo(a(67)) call foo(a(68)) call foo(a(69)) call foo(a(70)) call foo(a(71)) call foo(a(72)) call foo(a(73)) call foo(a(74)) call foo(a(75)) call foo(a(76)) call foo(a(77)) call foo(a(78)) call foo(a(79)) call foo(a(80)) call foo(a(81)) call foo(a(82)) call foo(a(83)) call foo(a(84)) call foo(a(85)) call foo(a(86)) call foo(a(87)) call foo(a(88)) call foo(a(89)) call foo(a(90)) call foo(a(91)) call foo(a(92)) call foo(a(93)) call foo(a(94)) call foo(a(95)) call foo(a(96)) call foo(a(97)) call foo(a(98)) call foo(a(99)) call foo(a(100)) call foo(a(101)) call foo(a(102)) call foo(a(103)) call foo(a(104)) call foo(a(105)) call foo(a(106)) call foo(a(107)) call foo(a(108)) call foo(a(109)) call foo(a(110)) call foo(a(111)) call foo(a(112)) call foo(a(113)) call foo(a(114)) call foo(a(115)) call foo(a(116)) call foo(a(117)) call foo(a(118)) call foo(a(119)) call foo(a(120)) call foo(a(121)) call foo(a(122)) call foo(a(123)) call foo(a(124)) call foo(a(125)) call foo(a(126)) call foo(a(127)) call foo(a(128)) call foo(a(129)) call foo(a(130)) call foo(a(131)) call foo(a(132)) call foo(a(133)) call foo(a(134)) call foo(a(135)) call foo(a(136)) call foo(a(137)) call foo(a(138)) call foo(a(139)) call foo(a(140)) call foo(a(141)) call foo(a(142)) call foo(a(143)) call foo(a(144)) call foo(a(145)) call foo(a(146)) call foo(a(147)) call foo(a(148)) call foo(a(149)) call foo(a(150)) call foo(a(151)) call foo(a(152)) call foo(a(153)) call foo(a(154)) call foo(a(155)) call foo(a(156)) call foo(a(157)) call foo(a(158)) call foo(a(159)) call foo(a(160)) call foo(a(161)) call foo(a(162)) call foo(a(163)) call foo(a(164)) call foo(a(165)) call foo(a(166)) call foo(a(167)) call foo(a(168)) call foo(a(169)) call foo(a(170)) call foo(a(171)) call foo(a(172)) call foo(a(173)) call foo(a(174)) call foo(a(175)) call foo(a(176)) call foo(a(177)) call foo(a(178)) call foo(a(179)) call foo(a(180)) call foo(a(181)) call foo(a(182)) call foo(a(183)) call foo(a(184)) call foo(a(185)) call foo(a(186)) call foo(a(187)) call foo(a(188)) call foo(a(189)) call foo(a(190)) call foo(a(191)) call foo(a(192)) call foo(a(193)) call foo(a(194)) call foo(a(195)) call foo(a(196)) call foo(a(197)) call foo(a(198)) call foo(a(199)) call foo(a(200)) call recurse(level - 1, a) end subroutine recurse end program legacy_array_sections_14 lfortran-lfortran-2f73434/integration_tests/arrays_reshape_27.f900000664000175000017500000000064315141516316025243 0ustar alastairalastairprogram arrays_reshape_27 implicit none integer, parameter :: n(2) = [2, 2] integer, parameter :: arr(4) = [1,2,3,4] real :: b(2,2) = reshape(arr, n) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_27 lfortran-lfortran-2f73434/integration_tests/modules_26.f900000664000175000017500000000172715141516316023706 0ustar alastairalastairmodule modern_minpack implicit none contains subroutine fdjac1(fcn1) implicit none interface subroutine fcn1(n1, x) implicit none integer, intent(in) :: n1 real, intent(in) :: x(n1) end subroutine fcn1 end interface end subroutine subroutine fdjac2(fcn, m) implicit none integer, intent(in) :: m interface subroutine fcn(m) implicit none integer, intent(in) :: m end subroutine end interface call fcn(m) end subroutine fdjac2 end module modern_minpack program main use modern_minpack implicit none call fdjac1(fcn) call fdjac2(fcn2, 1) contains subroutine fcn(n, x) implicit none integer, intent(in) :: n real, intent(in) :: x(n) end subroutine fcn subroutine fcn2(m) implicit none integer, intent(in) :: m end subroutine fcn2 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_323.f900000664000175000017500000000056615141516316024503 0ustar alastairalastairprogram intrinsics_323 real, allocatable :: L(:,:), U(:,:) call lu(L, U) contains subroutine lu(L, U) real, intent(out), allocatable :: L(:,:), U(:,:) allocate(L(5,5), U(5,5)) L = 12.91 U = -12.91 print *, dot_product(L(4,1:3), U(1:3,4)) if (abs(dot_product(L(4,1:3), U(1:3,4)) - (-500.004272)) > 1e-8) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/cycle_and_exit2.f900000664000175000017500000000076415141516316024763 0ustar alastairalastairprogram test_loops integer :: i, j, k l1 : do i = 1, 5 print *, "l1 start" l2 : do j = 1, 4 print *, "l2 start" l3 : do k = 1, 2 if (k > 0) then cycle l1 end if print *, "l1", i, "l2", j, "l3", k if (k > 0) then print *, "error l2" end if end do l3 end do l2 end do l1 if (j == 1 .and. k == 1) then print *, "pass" else print *, "error", i, j, k end if end programlfortran-lfortran-2f73434/integration_tests/bits_05.f900000664000175000017500000000356315141516316023174 0ustar alastairalastairprogram bits_05 implicit none integer(4) :: from, res integer(8) :: from8, res8 integer :: i, pos, len integer(8) :: i8, pos8, len8 integer, parameter :: i1 = ibits(10, 2, 2) integer(8), parameter :: i2 = ibits(10_8, 2, 2) integer, parameter :: i3 = ibits(10, 5_8, 2) integer(8), parameter :: i4 = ibits(10_8, 5_8, 2) integer, parameter :: ar1(3) = ibits([10, 20, 30], 2, 2) integer(8), parameter :: ar2(3) = ibits([10_8, 20_8, 30_8], 2, 2) integer :: arr1(3) = [102134, 20, 30] integer(8) :: arr2(3) = [1042890_8, 20_8, 30_8] i = 102394 pos = 2 len = 2 print *, ibits(i, pos, len) if (ibits(i, pos, len) /= 2) error stop i8 = 102394_8 pos8 = 12_8 len8 = 7_8 print *, ibits(i8, pos8, len8) if (ibits(i8, pos8, len8) /= 24) error stop print *, ibits(i, pos8, len) if (ibits(i, pos8, len) /= 0) error stop from = 10 from8 = 10_8 res = ibits(from, 2, 2) if (res /= 2) error stop res8 = ibits(from8, 2, 2) if (res8 /= 2_8) error stop res = ibits(from, 0, 2) if (res /= 2) error stop res8 = ibits(from8, 0, 2) if (res8 /= 2_8) error stop from = -20 from8 = -20_8 res = ibits(from, 29, 2) if (res /= 3) error stop res8 = ibits(from8, 29, 2) if (res8 /= 3) error stop res = ibits(from, 2, 2) if (res /= 3) error stop res8 = ibits(from8, 2, 2) if (res8 /= 3) error stop print *, ibits(arr1, 2, 2) if (any(ibits(arr1, 2, 2) /= [1, 1, 3])) error stop print *, ibits(arr2, 2, 2) if (any(ibits(arr2, 2, 2) /= [2, 1, 3])) error stop print *, kind(ibits(10, 2, 2)) if (kind(ibits(10, 2, 2)) /= 4) error stop print *, kind(ibits(10_8, 2, 2)) if (kind(ibits(10_8, 2, 2)) /= 8) error stop print *, kind(ibits(10, 2_8, 2_8)) if (kind(ibits(10, 2_8, 2_8)) /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_30_module1.f900000664000175000017500000000076515141516316025330 0ustar alastairalastairmodule fpm_git_modules_30 implicit none type :: git_target_t character(len=:), allocatable :: url character(len=:), allocatable :: object end type git_target_t contains function git_target_branch(url, branch) result(self) character(len=*), intent(in) :: url character(len=*), intent(in) :: branch type(git_target_t) :: self self%url = url self%object = branch end function git_target_branch end module fpm_git_modules_30 lfortran-lfortran-2f73434/integration_tests/elemental_04.f900000664000175000017500000000043015141516316024166 0ustar alastairalastairprogram elemental_04 integer :: res(2) res = is_close([1., 2.], 2.) print *, res if (any(res /= 5)) error stop contains elemental integer function is_close(a, b) result(r) real, intent(in) :: a real, intent(in) :: b r = 5 end function is_close end program lfortran-lfortran-2f73434/integration_tests/functions_53.f900000664000175000017500000000051615141516316024241 0ustar alastairalastairprogram functions_53 implicit none type :: temp integer, allocatable :: arr(:) end type type(temp), allocatable :: x x = parse_temp() if (.not. allocated(x)) error stop contains function parse_temp() result(res) type(temp) :: res allocate(res%arr(2)) end function end programlfortran-lfortran-2f73434/integration_tests/bindc_02c.c0000664000175000017500000000155715141516316023277 0ustar alastairalastair#include #include #include "bindc_02c.h" void driver() { float A[12]; printf("driver: initializing A[i] = i\n"); for (int i=0; i < 12; i++) { A[i] = i; } printf("driver: calling callback1(12, A)\n"); callback1(12, A); printf("driver: calling callback1b(12, A)\n"); callback1b(12, A); int n = 12; printf("driver: calling callback2(&n, A)\n"); callback2(&n, A); printf("driver: calling callback2b(&n, A)\n"); callback2b(&n, A); } void print_ptr1(int n, float *A) { printf("print_ptr1: n = %d\n", n); printf("[ "); for (int i=0; i < n; i++) { printf("%f ", A[i]); } printf("]\n"); } void print_ptr2(int *n, float *A) { printf("print_ptr2: n = %d\n", *n); printf("[ "); for (int i=0; i < *n; i++) { printf("%f ", A[i]); } printf("]\n"); } lfortran-lfortran-2f73434/integration_tests/read_32.f900000664000175000017500000000053215141516316023137 0ustar alastairalastairprogram daio3 implicit none integer, parameter :: unit_no = 24 integer :: i, i1 open (unit_no, file='fort.24', access='direct', recl=132) do i = 1, 10 write (unit_no, rec=i) i end do do i = 1, 10 read (unit_no, rec=i) i1 if (i1 /= i) error stop end do close (unit_no) print *, "all tests passed" end programlfortran-lfortran-2f73434/integration_tests/intrinsics_52.f900000664000175000017500000000066615141516316024423 0ustar alastairalastairprogram intrinsics_52 integer :: a, b, c, d, e, f a = 2 b = -3 c = 5 d = 10 e = 20 f = -30 if (max0(10,20) /= 20) error stop if (max0(3,5,4) /= 5) error stop if (max0(a,b) /= a) error stop if (max0(a,b,c) /= c) error stop if (max0(d,e,f,a,b,c) /= e) error stop if (min0(10,20) /= 10) error stop if (min0(3,5,4) /= 3) error stop if (min0(a,b) /= b) error stop if (min0(c,b,a) /= b) error stop if (min0(d,e,f,a,b,c) /= f) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_183.f900000664000175000017500000000100015141516316024467 0ustar alastairalastairprogram intrinsics_183 integer :: a1 = 3 integer :: a2 = 2 integer :: a3 = 1 integer :: a4 = -5 integer(8) :: a = 20 print*, ibits(3, 2, 1) if (ibits(3, 2, 1) /= 0) error stop print*, ibits(-5, 2, 2) if (ibits(-5, 2, 2) /= 2) error stop print*, ibits(a1, a2, a3) if (ibits(a1, a2, a3) /= 0) error stop print*, ibits(a4, a2, a2) if (ibits(a4, a2, a2) /= 2) error stop print*, ibits(a, 2_4, 2_4) if (ibits(a, 2_4, 2_4) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_40.f900000664000175000017500000000210215141516316025064 0ustar alastairalastairmodule derived_types_40_func_type abstract interface subroutine OBJ(x) real, intent(inout) :: x(:) end subroutine end interface contains subroutine temp_calfun(x) real, intent(inout) :: x(:) x = x + 1 end subroutine temp_calfun end module derived_types_40_func_type module derived_types_40_prob_mod use derived_types_40_func_type public :: temp_calfun type PROB_T procedure(OBJ),nopass, pointer :: calfun => null() procedure(OBJ),nopass, pointer :: calfun2 => temp_calfun end type PROB_T procedure(OBJ), pointer :: orig_calfun contains subroutine construct(prob) type(PROB_T), intent(out) :: prob real :: x(5) x = 0 prob % calfun => temp_calfun call prob % calfun(x) if (any(x /= 1.0)) error stop call prob % calfun2(x) if (any(x /= 2.0)) error stop end subroutine end module program derived_types_40 use derived_types_40_prob_mod type(PROB_T) :: prob real :: x(5) x = 0 orig_calfun => prob % calfun2 call orig_calfun(x) if (any(x /= 1.0)) error stop call construct(prob) end programlfortran-lfortran-2f73434/integration_tests/bits_02.f900000664000175000017500000000060215141516316023160 0ustar alastairalastairprogram bits_02 use iso_fortran_env, only: block_kind => int64, bits_kind => int32 implicit none integer(bits_kind), parameter :: block_size = bit_size(0_block_kind) integer(block_kind), parameter :: all_zeros = 0_block_kind integer(block_kind), parameter :: all_ones = not(all_zeros) print *, block_size print *, all_zeros print *, all_ones end program lfortran-lfortran-2f73434/integration_tests/derived_types_39.f900000664000175000017500000000175315141516316025107 0ustar alastairalastairmodule derived_types_39_mod type :: tt integer :: ll contains procedure :: ssub procedure :: ff end type tt contains subroutine ssub(dt, checker) class(tt), intent(in) :: dt integer :: checker print *, checker , " -- ", dt%ll if(checker /= dt%ll) error stop end subroutine ssub function ff(dt) result(i) class(tt), intent(in) :: dt integer :: i i = dt%ll print *, i end function ff end module derived_types_39_mod program derived_types_39 use derived_types_39_mod type(tt) :: vals2(3) vals2(1)%ll = 11 vals2(2)%ll = 22 vals2(3)%ll = 33 ! Check derivedType subroutine call call vals2(1)%ssub(11) call vals2(2)%ssub(22) call vals2(3)%ssub(33) ! Check derivedType function call if(vals2(1)%ff() /= 11) error stop if(vals2(2)%ff() /= 22) error stop if(vals2(3)%ff() /= 33) error stop end program derived_types_39lfortran-lfortran-2f73434/integration_tests/bindc_01c.c0000664000175000017500000000044015141516316023264 0ustar alastairalastair#include #include #include "bindc_01c.h" void ret_ptr_c(void **p) { *p = malloc(sizeof(float)*12); } void print_ptr_c(int n, void *p) { float *a = p; printf("[ "); for (int i=0; i < n; i++) { printf("%f ", a[i]); } printf("]\n"); } lfortran-lfortran-2f73434/integration_tests/procedure_16.f900000664000175000017500000000216515141516316024222 0ustar alastairalastairmodule pintrf_mod implicit none private public :: OBJCON contains subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end module pintrf_mod module cobylb_mod_procedure_16 contains subroutine cobylb(calcfc, amat) use, non_intrinsic :: pintrf_mod, only : OBJCON implicit none procedure(OBJCON) :: calcfc real, intent(in) :: amat(:,:) call evaluate(calcfc_internal) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal(:) call calcfc(x_internal) end subroutine calcfc_internal subroutine evaluate(calcfc) use, non_intrinsic :: pintrf_mod, only : OBJCON implicit none procedure(OBJCON) :: calcfc call calcfc([1.0, 2.0]) end subroutine evaluate end subroutine cobylb end module program procedure_16 use cobylb_mod_procedure_16 real :: amat(5, 5) call cobylb(calcfc, amat) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if (abs(sum(x) - 3.0) > 1e-8) error stop end subroutine calcfc end program lfortran-lfortran-2f73434/integration_tests/class_41.f900000664000175000017500000000211115141516316023324 0ustar alastairalastairmodule class_41_mod type, public :: AbsType contains procedure :: abs_method end type AbsType type, extends(AbsType) :: AbsExtendedType end type AbsExtendedType type :: Wrapper class(AbsExtendedType), allocatable :: obj type(AbsExtendedType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s ! Calling subroutine with extended type as self call self%wrapped%obj%abs_method(42) call type_s%wrapped%t_obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop end subroutine abs_method end module class_41_mod program class_41 use class_41_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) call var%caller() end program class_41 lfortran-lfortran-2f73434/integration_tests/intrinsics_47.f900000664000175000017500000000054515141516316024423 0ustar alastairalastairprogram intrinsics_47 implicit none logical :: l logical :: a(3) = [.true., .true., .true.] l = all([.true., .true.]) l = all([.true., .false.]) l = all([.false.]) l = all([.true.]) l = all(a) l = all([1 == 2, 0 == 0]) l = all([l]) l = all([.false., a, .true.]) if (l) error stop end program intrinsics_47 lfortran-lfortran-2f73434/integration_tests/separate_compilation_24.f900000664000175000017500000000050415141516316026426 0ustar alastairalastairmodule tester_separate_compilation_24 use sorting_separate_compilation_24 implicit none end module tester_separate_compilation_24 program separate_compilation_24 use tester_separate_compilation_24 implicit none integer :: n = 1 call sort( n ) print *, n if (n /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/block_10.f900000664000175000017500000000066615141516316023322 0ustar alastairalastairprogram block_10 implicit none integer :: i character(len=100) :: result result = "" do i = 1, 2 block character(len=:), allocatable :: temp(:) temp = [character(len=5) :: "a", "b", "c"] if (i == 1) then result = temp(1) end if end block end do if (trim(result) /= "a") error stop "Expected: a" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/openmp_45.f900000664000175000017500000000116515141516316023531 0ustar alastairalastairmodule openmp_45_parallel_sections implicit none contains subroutine compute_a() print *, "Computing A" end subroutine compute_a subroutine compute_b() print *, "Computing B" end subroutine compute_b subroutine compute_c() print *, "Computing C" end subroutine compute_c end module openmp_45_parallel_sections program openmp_45 use omp_lib use openmp_45_parallel_sections implicit none integer :: tid=0 !$omp parallel sections !$omp section call compute_a() !$omp section call compute_b() !$omp section call compute_c() !$omp end parallel sections end program openmp_45lfortran-lfortran-2f73434/integration_tests/derived_types_04.f900000664000175000017500000000101215141516316025063 0ustar alastairalastairmodule derived_types_04_bitset type, abstract :: bitset_type private integer(8) :: num_bits contains procedure(all_abstract), deferred, pass(self) :: all end type bitset_type abstract interface elemental function all_abstract( self ) result(all) import :: bitset_type logical :: all class(bitset_type), intent(in) :: self end function all_abstract end interface end module program debug implicit none end program lfortran-lfortran-2f73434/integration_tests/bin_op_complex_dp.f900000664000175000017500000000030415141516316025375 0ustar alastairalastairprogram bin_op_complex_dp complex(4) :: zero complex(8) :: v, u complex :: x zero = 1.0_4/7 u = 1.0_4/7 v = 1.0_8/7 x = 1.0_4/7 print *, zero, v, x, u end programlfortran-lfortran-2f73434/integration_tests/intrinsics_375.f900000664000175000017500000000062515141516316024506 0ustar alastairalastairsubroutine sub() character(len=:), allocatable :: buffer character(:), allocatable :: dummy allocate(character((5)) :: dummy) dummy = "12345" call move_alloc( dummy, buffer ) print *, allocated(buffer) print *, buffer if (allocated(buffer) .neqv. .true.) error stop if (buffer /= "12345") error stop end subroutine program intrinsics_375 call sub() end programlfortran-lfortran-2f73434/integration_tests/do_loop_06.f900000664000175000017500000000043115141516316023656 0ustar alastairalastairprogram do_loop_06 integer :: i integer, allocatable :: arr(:) allocate(arr(10)) arr = [1,2,3,4,5,6,7,8,9,10] do i =1,2 print *, "dummy do loop" exit end do print *, arr if (any(arr /= [1,2,3,4,5,6,7,8,9,10])) error stop end program lfortran-lfortran-2f73434/integration_tests/string_26.f900000664000175000017500000000017315141516316023536 0ustar alastairalastairprogram string_26 character(len=3) :: s1, s2 character(len=6) :: s s1 = "abc" s2 = "def" s = s1//s2 print *, s end program lfortran-lfortran-2f73434/integration_tests/derived_types_33.f900000664000175000017500000000135615141516316025100 0ustar alastairalastairmodule testdrive_derived_types_33 implicit none private public :: error_type, test_skipped type :: error_type integer :: stat character(len=:), allocatable :: message end type error_type contains pure function test_skipped(error) result(is_skipped) type(error_type), intent(in), optional :: error logical :: is_skipped is_skipped = .false. if (present(error)) then is_skipped = error%stat == 1 end if end function test_skipped end module testdrive_derived_types_33 program main use testdrive_derived_types_33 implicit none type(error_type), allocatable :: error_obj allocate(error_obj) error_obj%stat = 1 print *, test_skipped(error_obj) print *, error_obj%stat end program lfortran-lfortran-2f73434/integration_tests/case_03.f900000664000175000017500000000127015141516316023135 0ustar alastairalastairprogram case03 implicit none ! local variable declaration integer :: marks integer, parameter :: a = 1, b = 2 marks = 94 select case (marks) case ((40 + b):) print *, "Pass!" case (:(39 - a)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks marks = -1 select case (marks) case ((40 + b):) print *, "Pass!" case (0:(39 - a)) print *, "Failed!" case default print*, "Invalid marks" end select print*, "Your marks are ", marks end program lfortran-lfortran-2f73434/integration_tests/complex_23.f900000664000175000017500000000026415141516316023675 0ustar alastairalastairprogram complex_23 complex, parameter :: arr(1) = [(1,1)] complex :: d(1) d = arr + 1 print *, d if (any(d /= [(2.0,1.0)])) error stop end program complex_23 lfortran-lfortran-2f73434/integration_tests/floor_01.f900000664000175000017500000000100215141516316023332 0ustar alastairalastairprogram floor_01 implicit none real, parameter :: x1 = 3.3 ! 3 real, parameter :: x2 = 3.5 ! 3 real, parameter :: x3 = 3.7 ! 3 real, parameter :: y1 = -3.3 ! -4 real, parameter :: y2 = -3.5 ! -4 real, parameter :: y3 = -3.7 ! -4 if(floor(x1, kind=8) /= 3_8 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop if(floor(y1, kind=4) /= -4 .or. floor(y2) /= -4 .or. floor(y3, kind=8) /= -4) error stop print*, floor(x1), floor(x2), floor(x3) print*, floor(y1), floor(y2), floor(y3) end program lfortran-lfortran-2f73434/integration_tests/tuple_test_concat_.f900000664000175000017500000000560115141516316025600 0ustar alastairalastairprogram test_tuple_concat implicit none call tuple_concat() contains subroutine tuple_concat() _lfortran_tuple(integer, integer) :: t1 _lfortran_tuple(real, character(len=:), integer) :: t2 _lfortran_tuple(real) :: t3 _lfortran_tuple(integer, integer, real, character(len=:), integer, real) :: t4 _lfortran_tuple(integer, real) :: t5 _lfortran_tuple(integer, real, integer, real) :: t6 _lfortran_tuple(integer, real, integer, real, integer, real) :: t7 _lfortran_tuple(integer, real, integer, real, integer, real, integer, real) :: t8 _lfortran_list(_lfortran_tuple(integer, real)) :: l1 integer:: start, i _lfortran_tuple(_lfortran_tuple(_lfortran_tuple(integer, integer), _lfortran_tuple(integer, real)), _lfortran_tuple(real, character(len=:), integer)) :: t9 t1 = _lfortran_tuple_constant(1, 2) t2 = _lfortran_tuple_constant(3.0, "abc", -10) t3 = _lfortran_tuple_constant(10.0) t4 = _lfortran_concat(t1, _lfortran_concat(t2, t3)) if ( .not. _lfortran_eq(t4, _lfortran_tuple_constant(_lfortran_get_item(t1, 0), & _lfortran_get_item(t1, 1), _lfortran_get_item(t2, 0),_lfortran_get_item(t2, 1), & _lfortran_get_item(t2, 2),_lfortran_get_item(t3, 0))) ) error stop if ( .not. _lfortran_eq(_lfortran_concat(t4, t3), _lfortran_concat(t1, t2, t3, & _lfortran_tuple_constant(_lfortran_get_item(t3, 0)))) ) error stop start = 117 do i = start, start + 2 t5 = _lfortran_tuple_constant(i, real(i*i)) call _lfortran_list_append(l1, t5) if (i == start) then t6 = _lfortran_concat(t5, _lfortran_get_item(l1, -1)) else if (i == start + 1) then t7 = _lfortran_concat(t6, _lfortran_get_item(l1, -1)) else t8 = _lfortran_concat(t7, _lfortran_get_item(l1, -1)) end if end do if ( .not. _lfortran_eq(t6, _lfortran_concat(_lfortran_get_item(l1, 0), & _lfortran_get_item(l1, 0)))) error stop if ( .not. _lfortran_eq(t7, _lfortran_concat(t6, _lfortran_get_item(l1, 1)))) error stop if ( .not. _lfortran_eq(t8, _lfortran_concat(t7, _lfortran_get_item(l1, 2)))) error stop t9 = _lfortran_concat(_lfortran_tuple_constant(_lfortran_tuple_constant(t1, t5)), _lfortran_tuple_constant(t2)) if ( .not. (_lfortran_eq(_lfortran_get_item(_lfortran_get_item(t9, 0), 0), t1) .and. & _lfortran_eq(_lfortran_get_item(_lfortran_get_item(t9, 0), 1), t5) .and. & _lfortran_eq(_lfortran_get_item(t9, 1), t2)) ) error stop end subroutine end program test_tuple_concat lfortran-lfortran-2f73434/integration_tests/format_50.f900000664000175000017500000000411415141516316023514 0ustar alastairalastairprogram format_50 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: tiny_val, huge_val, test_val character(20) :: str tiny_val = tiny(1.0_dp) huge_val = huge(1.0_dp) test_val = 1.23456789e10_dp ! Test ES format with E3 print "(A,ES11.3E3)", 'tiny =', tiny_val print "(A,ES11.3E3)", 'huge =', huge_val print "(A,ES11.3E3)", 'test =', test_val ! Test EN format with E3 print "(A,EN11.3E3)", 'test =', test_val ! Test E format with E3 print "(A,E11.3E3)", 'test =', test_val ! Test ES format with E4 print "(A,ES12.3E4)", 'tiny =', tiny_val print "(A,ES12.3E4)", 'test =', test_val ! Verify with write statements - check that 'E' is present write(str, "(ES11.3E3)") tiny_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 tiny missing E" if (trim(adjustl(str)) /= "2.225E-308") error stop "ES11.3E3 tiny failed" write(str, "(ES11.3E3)") huge_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 huge missing E" if (trim(adjustl(str)) /= "1.798E+308") error stop "ES11.3E3 huge failed" write(str, "(ES11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "ES11.3E3 test missing E" if (trim(adjustl(str)) /= "1.235E+010") error stop "ES11.3E3 test failed" write(str, "(EN11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "EN11.3E3 test missing E" if (trim(adjustl(str)) /= "12.346E+009") error stop "EN11.3E3 test failed" write(str, "(E11.3E3)") test_val if (index(trim(str), 'E') == 0) error stop "E11.3E3 test missing E" if (trim(adjustl(str)) /= "0.123E+011") error stop "E11.3E3 test failed" write(str, "(ES12.3E4)") tiny_val if (index(trim(str), 'E') == 0) error stop "ES12.3E4 tiny missing E" if (trim(adjustl(str)) /= "2.225E-0308") error stop "ES12.3E4 tiny failed" write(str, "(ES12.3E4)") test_val if (index(trim(str), 'E') == 0) error stop "ES12.3E4 test missing E" if (trim(adjustl(str)) /= "1.235E+0010") error stop "ES12.3E4 test failed" print *, "PASSED" end program format_50 lfortran-lfortran-2f73434/integration_tests/common_08.f900000664000175000017500000000017615141516316023523 0ustar alastairalastairsubroutine prja() integer iownd, iowns common /ls0001/ iownd(14), iowns(6) end program common_08 call prja() end program lfortran-lfortran-2f73434/integration_tests/procedure_decl_01_b.f900000664000175000017500000000050115141516316025474 0ustar alastairalastairmodule eval_dependency contains subroutine OBJCON() end subroutine OBJCON end module eval_dependency module procedure_decl_01_b contains subroutine evaluate(calcfc) use eval_dependency implicit none procedure(OBJCON) :: calcfc call calcfc() end subroutine evaluate end module procedure_decl_01_blfortran-lfortran-2f73434/integration_tests/common_27.f900000664000175000017500000000034615141516316023523 0ustar alastairalastairprogram common_save call sub() print *, "test passed" end program subroutine sub() real :: xyzzy common /block/ xyzzy save /block/ xyzzy = xyzzy + 1.0 if (xyzzy /= 1.0) error stop "wrong value" end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_76.f900000664000175000017500000000071415141516316024423 0ustar alastairalastairprogram intrinsics_76 implicit none real(8) :: gamma = 1 real(8) :: x(3), xsqrt(3) gamma = 0.3612163121_8 x = [1._8, 2._8, 3._8] if( any(abs(exp(-gamma*sqrt(x)) - [0.69682824978102864_8, 0.59999316978514361_8, 0.53491629349743086_8]) > 1e-6) ) error stop print *, exp(-gamma*sqrt(x)) xsqrt = -gamma*sqrt(x) if( any(abs(exp(xsqrt) - [0.69682824978102864_8, 0.59999316978514361_8, 0.53491629349743086_8]) > 1e-6) ) error stop print *, exp(xsqrt) end program lfortran-lfortran-2f73434/integration_tests/move_alloc_pointer_alias.f900000664000175000017500000000055315141516316026754 0ustar alastairalastairprogram move_alloc_pointer_alias implicit none real, allocatable, target :: a(:), b(:) real, pointer :: c(:) allocate(a(10), source=10.0) c => a call move_alloc(a, b) if (.not. associated(c)) error stop if (size(b) /= 10) error stop if (any(b /= 10.0)) error stop c(2) = 2.0 if (b(2) /= 2.0) error stop end program lfortran-lfortran-2f73434/integration_tests/expr_07.f900000664000175000017500000000011315141516316023177 0ustar alastairalastairprogram expr_07 implicit none real :: x = 3.3 + 6.0 print *, x end program lfortran-lfortran-2f73434/integration_tests/format_53.f900000664000175000017500000000401615141516316023520 0ustar alastairalastairprogram format_53 ! Test TR (tab right), TL (tab left), and T (absolute tab) format descriptors implicit none character(12):: str1 = 'abcdefghijkl', str2 character(4) :: str3 character(8) :: str4 ! Test 1: TR (tab right) - skip first 4 characters read(str1,"(tr4,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 1 failed: TR" ! Test 2: TL (tab left) - move forward then back ! TR8 moves to position 8, TL4 moves back 4 positions to position 4 read(str1,"(tr8,tl4,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 2 failed: TL" ! Test 3: Multiple TR operations read(str1,"(tr2,tr2,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 3 failed: Multiple TR" ! Test 4: TR followed by TL to read from beginning read(str1,"(tr6,tl6,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'abcdefghijkl') error stop "Test 4 failed: TR+TL to start" ! Test 5: TR to skip, read partial, then more operations read(str1,"(tr3,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 5 failed: TR with width" ! Test 6: T (absolute tab) - tab to position 5 read(str1,"(t5,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'efghijkl ') error stop "Test 6 failed: T absolute" ! Test 7: T to position 1 (beginning) read(str1,"(t1,a)") str2 print "(A)", '"'//str2//'"' if (str2 /= 'abcdefghijkl') error stop "Test 7 failed: T to start" ! Test 8: T to middle, read partial read(str1,"(t4,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 8 failed: T with width" ! Test 9: Combination of T and TR read(str1,"(t3,tr2,a8)") str4 print "(A)", '"'//str4//'"' if (str4 /= 'efghijkl') error stop "Test 9 failed: T+TR combo" ! Test 10: T followed by TL read(str1,"(t7,tl3,a4)") str3 print "(A)", '"'//str3//'"' if (str3 /= 'defg') error stop "Test 10 failed: T+TL combo" print *, "All tests passed" end program format_53 lfortran-lfortran-2f73434/integration_tests/cycle_and_exit4.f900000664000175000017500000000223615141516316024761 0ustar alastairalastairprogram test_blocks integer :: i logical :: pass = .true. b1 : block print *, "b1" i = i + 1 b2 : block print *, "b2" i = i + 2 exit b1 i = i + 3 exit b2 i = i + 4 end block b2 i = i + 5 print *, "error b1" pass = .false. end block b1 b3 : block print *, "b3" b4 : block print *, "b4" b5 : block print *, "b5" exit b3 end block b5 print *, "error b4" pass = .false. end block b4 print *, "error b3" pass = .false. end block b3 b6 : block integer :: i print *, "b6" block print *, "b7" ! TODO: Implement this in asr_to_llvm.cpp ! do i = 1, 10 ! if (i > 5) then ! exit ! end if ! end do ! if (i /= 6) then ! pass = .false. ! end if end block end block b6 if (pass) then print *, "pass" end if end programlfortran-lfortran-2f73434/integration_tests/inquire_04.f900000664000175000017500000000116015141516316023675 0ustar alastairalastairprogram inquire_access_name implicit none integer :: io logical :: opened character(len=20) :: access_mode character(len=64) :: file_name io = 37 open(unit=io, file='inquire_04_data.txt', status='replace', action='readwrite') inquire(unit=io, opened=opened, access=access_mode, name=file_name) if (.not. opened) error stop 'unit not marked as opened' if (trim(access_mode) /= 'SEQUENTIAL') error stop 'unexpected access mode' if (trim(file_name) /= 'inquire_04_data.txt') error stop 'unexpected name value' close(unit=io, status='delete') end program inquire_access_name lfortran-lfortran-2f73434/integration_tests/modules_45.f900000664000175000017500000000540015141516316023677 0ustar alastairalastairmodule modules_45_fpm_manifest_profile implicit none type :: file_scope_flag end type file_scope_flag type :: profile_config_t character(len=:), allocatable :: profile_name character(len=:), allocatable :: compiler integer :: os_type character(len=:), allocatable :: flags character(len=:), allocatable :: c_flags character(len=:), allocatable :: cxx_flags character(len=:), allocatable :: link_time_flags type(file_scope_flag), allocatable :: file_scope_flags(:) logical :: is_built_in end type profile_config_t contains function new_profile(profile_name, compiler, os_type, flags, c_flags, cxx_flags, & link_time_flags, file_scope_flags, is_built_in) & & result(profile) character(len=*), intent(in) :: profile_name character(len=*), intent(in) :: compiler integer, intent(in) :: os_type character(len=*), optional, intent(in) :: flags character(len=*), optional, intent(in) :: c_flags character(len=*), optional, intent(in) :: cxx_flags character(len=*), optional, intent(in) :: link_time_flags type(file_scope_flag), optional, intent(in) :: file_scope_flags(:) logical, optional, intent(in) :: is_built_in type(profile_config_t) :: profile end function new_profile subroutine get_flags(profile_name, compiler_name, os_type, profiles, profindex, os_valid) character(len=:), allocatable, intent(in) :: profile_name character(len=:), allocatable, intent(in) :: compiler_name integer, intent(in) :: os_type type(profile_config_t), allocatable, intent(inout) :: profiles(:) integer, intent(inout) :: profindex logical, intent(in) :: os_valid character(len=:), allocatable :: flags, c_flags, cxx_flags, link_time_flags, key_name, file_name, file_flags, err_message type(file_scope_flag), allocatable :: file_scope_flags(:) integer :: ikey, ifile, stat logical :: is_valid profiles(profindex) = new_profile(profile_name, compiler_name, os_type, & & flags, c_flags, cxx_flags, link_time_flags, file_scope_flags) profindex = profindex + 1 end subroutine get_flags end module modules_45_fpm_manifest_profile program modules_45 use modules_45_fpm_manifest_profile implicit none character(len=:), allocatable :: profile_name, compiler_name integer :: os_type, profindex logical :: os_valid type(profile_config_t), allocatable :: profiles(:) allocate(character(len=40) :: profile_name) allocate(character(len=40) :: compiler_name) allocate(profiles(5)) call get_flags(profile_name, compiler_name, os_type, & profiles, profindex, os_valid) end program lfortran-lfortran-2f73434/integration_tests/la_constants.f900000664000175000017500000001774715141516316024430 0ustar alastairalastairmodule la_constants_module integer, parameter :: sp = kind(1.e0) real(sp), parameter :: szero = 0.0_sp real(sp), parameter :: shalf = 0.5_sp real(sp), parameter :: sone = 1.0_sp real(sp), parameter :: stwo = 2.0_sp real(sp), parameter :: sthree = 3.0_sp real(sp), parameter :: sfour = 4.0_sp real(sp), parameter :: seight = 8.0_sp real(sp), parameter :: sten = 10.0_sp complex(sp), parameter :: czero = ( 0.0_sp, 0.0_sp ) complex(sp), parameter :: chalf = ( 0.5_sp, 0.0_sp ) complex(sp), parameter :: cone = ( 1.0_sp, 0.0_sp ) character *1, parameter :: sprefix = 'S' character *1, parameter :: cprefix = 'C' real(sp), parameter :: sulp = epsilon(0._sp) real(sp), parameter :: seps = sulp * 0.5_sp real(sp), parameter :: ssafmin = real(radix(0._sp), sp)**max( minexponent(0._sp)-1, 1-maxexponent(0._sp) ) real(sp), parameter :: ssafmax = sone / ssafmin real(sp), parameter :: ssmlnum = ssafmin / sulp real(sp), parameter :: sbignum = ssafmax * sulp real(sp), parameter :: srtmin = sqrt(ssmlnum) real(sp), parameter :: srtmax = sqrt(sbignum) real(sp), parameter :: stsml = real(radix(0._sp), sp)**ceiling( (minexponent(0._sp) - 1) * 0.5_sp) real(sp), parameter :: stbig = real(radix(0._sp), sp)**floor( (maxexponent(0._sp) - digits(0._sp) + 1) * 0.5_sp) real(sp), parameter :: sssml = real(radix(0._sp), sp)**( - floor( (minexponent(0._sp) - digits(0._sp)) * 0.5_sp)) real(sp), parameter :: ssbig = real(radix(0._sp), sp)**( - ceiling( (maxexponent(0._sp) + digits(0._sp) - 1) * 0.5_sp)) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: dzero = 0.0_dp real(dp), parameter :: dhalf = 0.5_dp real(dp), parameter :: done = 1.0_dp real(dp), parameter :: dtwo = 2.0_dp real(dp), parameter :: dthree = 3.0_dp real(dp), parameter :: dfour = 4.0_dp real(dp), parameter :: deight = 8.0_dp real(dp), parameter :: dten = 10.0_dp complex(dp), parameter :: zzero = ( 0.0_dp, 0.0_dp ) complex(dp), parameter :: zhalf = ( 0.5_dp, 0.0_dp ) complex(dp), parameter :: zone = ( 1.0_dp, 0.0_dp ) character *1, parameter :: dprefix = 'D' character *1, parameter :: zprefix = 'Z' real(dp), parameter :: dulp = epsilon(0._dp) real(dp), parameter :: deps = dulp * 0.5_dp real(dp), parameter :: dsafmin = real(radix(0._dp), dp)**max( minexponent(0._dp)-1, 1-maxexponent(0._dp) ) real(dp), parameter :: dsafmax = done / dsafmin real(dp), parameter :: dsmlnum = dsafmin / dulp real(dp), parameter :: dbignum = dsafmax * dulp real(dp), parameter :: drtmin = sqrt(dsmlnum) real(dp), parameter :: drtmax = sqrt(dbignum) real(dp), parameter :: dtsml = real(radix(0._dp), dp)**ceiling( (minexponent(0._dp) - 1) * 0.5_dp) real(dp), parameter :: dtbig = real(radix(0._dp), dp)**floor( (maxexponent(0._dp) - digits(0._dp) + 1) * 0.5_dp) real(dp), parameter :: dssml = real(radix(0._dp), dp)**( - floor( (minexponent(0._dp) - digits(0._dp)) * 0.5_dp)) real(dp), parameter :: dsbig = real(radix(0._dp), dp)**( - ceiling( (maxexponent(0._dp) + digits(0._dp) - 1) * 0.5_dp)) end module program la_constants use la_constants_module print *, "szero: ", szero if ( abs( szero - 0.0_sp) > 1.0e-8) error stop "szero test failed" print *, "shalf: ", shalf if ( abs( shalf - 0.5_sp) > 1.0e-8) error stop "shalf test failed" print *, "sone: ", sone if ( abs( sone - 1.0_sp) > 1.0e-8) error stop "sone test failed" print *, "stwo: ", stwo if ( abs( stwo - 2.0_sp) > 1.0e-8) error stop "stwo test failed" print *,"sthree: ", sthree if( abs( sthree - 3.0_sp) > 1.0e-8) error stop "sthree test failed" print *, "sfour: ", sfour if ( abs( sfour - 4.0_sp) > 1.0e-8) error stop "sfour test failed" print *, "seight: ", seight if ( abs( seight - 8.0_sp) > 1.0e-8) error stop "seight test failed" print *, "sten: ", sten if ( abs( sten - 10.0_sp) > 1.0e-8) error stop "sten test failed" print *, "czero: ", czero if ( abs( real(czero) - 0.0_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "czero test failed" print *, "chalf: ", chalf if ( abs( real(chalf) - 0.5_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "chalf test failed" print *, "cone: ", cone if ( abs( real(cone) - 1.0_sp) > 1.0e-8 .or. abs( aimag(czero) - 0.0_sp) > 1.0e-8) error stop "cone test failed" print *, "sulp: ", sulp if (abs (sulp - 1.19209290e-7) > 1.0e-8) error stop "sulp test failed" print *, "seps: ", seps if (abs (seps - 5.96046448e-8) > 1.0e-8) error stop "seps test failed" print *, "ssafmin: ", ssafmin if (abs (ssafmin - 1.17549435e-38) > 1.0e-8 ) error stop "ssafmin test failed" print *, "ssafmax: ", ssafmax if (abs (ssafmax - 8.50705917302346159e+37) > 1.0) error stop "ssafmax test failed" print *, "ssmlnum: ", ssmlnum if (abs (ssmlnum - 9.86076132e-32) > 1.0e-8 ) error stop "ssmlnum test failed" print *, "sbignum: ", sbignum if (abs (sbignum - 1.01412048018258352e+31) > 1.0e-8) error stop "sbignum test failed" print *, "srtmin: ", srtmin if (abs (srtmin - 3.14018486e-16) > 1.0e-8) error stop "srtmin test failed" print *, "srtmax: ", srtmax if (abs (srtmax - 3.18452583626288650e+15)/srtmax > 2.0e-8) error stop "srtmax test failed" print *, "stsml: ", stsml if (abs (stsml - 1.08420217e-19) > 1.0e-8) error stop "stsml test failed" print *, "stbig: ", stbig if (abs (stbig - 4.50359962737049600e+15) > 1.0e-8) error stop "stbig test failed" print *, "sssml: ", sssml if (abs (sssml - 3.77789318629571617e+22) > 1.0e-8) error stop "sssml test failed" print *, "ssbig: ", ssbig if (abs (ssbig - 1.32348898e-23) > 1.0e-8) error stop "ssbig test failed" print*, "dzero: ", dzero if ( abs( dzero - 0.0_dp) > 1.0d-16) error stop "dzero test failed" print*, "dhalf: ", dhalf if ( abs( dhalf - 0.5_dp) > 1.0d-16) error stop "dhalf test failed" print*, "done: ", done if ( abs( done - 1.0_dp) > 1.0d-16) error stop "done test failed" print*, "dtwo: ", dtwo if ( abs( dtwo - 2.0_dp) > 1.0d-16) error stop "dtwo test failed" print*, "dthree: ", dthree if ( abs( dthree - 3.0_dp) > 1.0d-16) error stop "dthree test failed" print*, "dfour: ", dfour if ( abs( dfour - 4.0_dp) > 1.0d-16) error stop "dfour test failed" print*, "deight: ", deight if ( abs( deight - 8.0_dp) > 1.0d-16) error stop "deight test failed" print*, "dten: ", dten if ( abs( dten - 10.0_dp) > 1.0d-16) error stop "dten test failed" print *, "zzero: ", zzero if (abs(real(zzero) - 0.0_dp) > 1.0d-16 .or. abs(aimag(zzero) - 0.0_dp) > 1.0d-16) error stop "zzero test failed" print *, "zhalf :", zhalf if (abs(real(zhalf) - 0.5_dp) > 1.0d-16 .or. abs(aimag(zhalf) - 0.0_dp) > 1.0d-16) error stop "zhalf test failed" print *, "zone: ", zone if (abs(real(zone) - 1.0_dp) > 1.0d-16 .or. abs(aimag(zone) - 0.0_dp) > 1.0d-16) error stop "zone test failed" print *, "dulp: ", dulp if ( abs(dulp - 2.22044604925031308d-16) > 1.0d-16 ) error stop "dulp test failed" print *, "deps: ", deps if ( abs(deps - 1.11022302462515654d-16) > 1.0d-16 ) error stop "deps test failed" print *, "dsafmin: ", dsafmin if ( abs(dsafmin - 2.22507385850720138d-308) > 1.0d-16 ) error stop "dsafmin test failed" print *, "dsafmax: ", dsafmax if ( abs(dsafmax - 4.49423283715578977d+307) > 1.0d-16 ) error stop "dsafmax test failed" print *, "dsmlnum: ", dsmlnum if ( abs(dsmlnum - 1.00208418000448639d-292) > 1.0d-16 ) error stop "dsmlnum test failed" print *, "dbignum: ", dbignum if ( abs(dbignum - 9.97920154767359906d+291) > 1.0d-16 ) error stop "dbignum test failed" print *, "drtmin: ", drtmin if ( abs(drtmin - 1.00104154759155046d-146) > 1.0d-16 ) error stop "drtmin test failed" print *, "drtmax: ", drtmax if ( abs(drtmax - 9.98959536101117514d+145) > 1.0d-16 ) error stop "drtmax test failed" print *, "dtsml: ", dtsml if ( abs(dtsml - 1.49166814624004135d-154) > 1.0d-16 ) error stop "dtsml test failed" print *, "dtbig: ", dtbig if ( abs(dtbig - 1.99791907220223503d+146) > 1.0d-16 ) error stop "dtbig test failed" print *, "dssml: ", dssml if ( abs(dssml - 4.49891379454319638d+161) > 1.0d-16 ) error stop "dssml test failed" print *, "dsbig: ", dsbig if (abs ( dsbig - 1.1137937474253874d-163) > 1.0d-16) error stop "dsbig test failed" print *, "All tests passed!" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_322.f900000664000175000017500000000025615141516316024476 0ustar alastairalastairprogram intrinsics_322 character(3) :: cx(2) cx(1) = "woo" cx(2) = "oba" print *, index(cx, "a") if (any(index(cx, "a") /= [0, 3])) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_48.f900000664000175000017500000000704315141516316023707 0ustar alastairalastairmodule modules_48_fpm_strings implicit none type string_t character(len=:), allocatable :: s end type interface fnv_1a procedure :: fnv_1a_char procedure :: fnv_1a_string_t end interface fnv_1a contains pure function fnv_1a_char(input, seed) result(hash) character(*), intent(in) :: input integer(8), intent(in), optional :: seed integer(8) :: hash integer :: i integer(8), parameter :: FNV_OFFSET_32 = 2166136261_8 integer(8), parameter :: FNV_PRIME_32 = 16777619_8 if (present(seed)) then hash = seed else hash = FNV_OFFSET_32 end if do i = 1, len(input) hash = ieor(hash, iachar(input(i:i), 8)) * FNV_PRIME_32 end do end function fnv_1a_char pure function fnv_1a_string_t(input, seed) result(hash) type(string_t), intent(in) :: input(:) integer(8), intent(in), optional :: seed integer(8) :: hash integer :: i hash = fnv_1a(input(1)%s,seed) do i = 2, size(input) hash = fnv_1a(input(i)%s,hash) end do end function fnv_1a_string_t function is_fortran_name(line) result (lout) character(len=*), parameter :: int = '0123456789' character(len=*), parameter :: lower = 'abcdefghijklmnopqrstuvwxyz' character(len=*), parameter :: upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' character(len=*), parameter :: allowed = upper // lower // int // '_' character(len=*), intent(in) :: line character(len=:), allocatable :: name logical :: lout name = trim(line) if( len(name) /= 0 ) then lout = .true. & & .and. verify(name(1:1), lower//upper) == 0 & & .and. verify(name, allowed) == 0 & & .and. len(name) <= 63 else lout = .false. end if end function is_fortran_name function string_cat(strings, delim) result(cat) type(string_t), intent(in) :: strings(:) character(*), intent(in), optional :: delim character(:), allocatable :: cat integer :: i character(:), allocatable :: delim_str if (size(strings) < 1) then cat = '' return end if if (present(delim)) then delim_str = delim else delim_str = '' end if cat = strings(1)%s do i=2,size(strings) cat = cat//delim_str//strings(i)%s end do end function string_cat end module program modules_48 use modules_48_fpm_strings implicit none character(len=40) :: char_str character(len=:), allocatable :: char_str_alloc, cat_str_alloc integer(8) :: char_str_hash1, char_str_hash2 integer(8) :: char_str_hash3, char_str_hash4 type(string_t) :: string_var(2) allocate(character(len=40) :: char_str_alloc) char_str_alloc = "runningmodules_48_1" string_var(1)%s = char_str_alloc char_str = "runningmodules_48_2" string_var(2)%s = char_str char_str_hash1 = fnv_1a(char_str, 2166136261_8) char_str_hash2 = fnv_1a(char_str) print *, char_str_hash1, char_str_hash2 if( char_str_hash1 /= char_str_hash2 ) error stop char_str_hash3 = fnv_1a_string_t(string_var, 2166136261_8) char_str_hash4 = fnv_1a_string_t(string_var) print *, char_str_hash3, char_str_hash4 if( char_str_hash3 /= char_str_hash4 ) error stop cat_str_alloc = string_cat(string_var, ":") print *, cat_str_alloc, is_fortran_name(cat_str_alloc) if( cat_str_alloc /= "runningmodules_48_1:runningmodules_48_2" ) error stop if( is_fortran_name(cat_str_alloc) ) error stop cat_str_alloc = string_cat(string_var) print *, cat_str_alloc, is_fortran_name(cat_str_alloc) if( cat_str_alloc /= "runningmodules_48_1runningmodules_48_2" ) error stop if( .not. is_fortran_name(cat_str_alloc) ) error stop end program lfortran-lfortran-2f73434/integration_tests/ilp64_complex_literal_01.f900000664000175000017500000000240015141516316026415 0ustar alastairalastair! Test: complex literal kind with -fdefault-integer-8 ! Complex literals with integer components should produce default complex kind (4), ! not complex(8), even when integers are promoted to 64-bit by -fdefault-integer-8. program ilp64_complex_literal_01 implicit none complex :: c1, c2 complex :: arr(2) complex(8) :: c8 ! Test 1: Simple complex literal assignment with integers c1 = (-1, 0) if (kind(c1) /= 4) error stop "c1 should have kind 4" if (abs(real(c1) - (-1.0)) > 1e-6) error stop "c1 real part wrong" if (abs(aimag(c1)) > 1e-6) error stop "c1 imag part wrong" ! Test 2: Complex literal in DATA statement data arr /(-1,0),(1,0)/ if (kind(arr(1)) /= 4) error stop "arr should have kind 4" if (abs(real(arr(1)) - (-1.0)) > 1e-6) error stop "arr(1) real part wrong" if (abs(real(arr(2)) - 1.0) > 1e-6) error stop "arr(2) real part wrong" ! Test 3: Mixed integer/real should produce kind from real c2 = (-1, 0.0d0) if (kind((-1, 0.0d0)) /= 8) error stop "mixed int/real(8) should give kind 8" ! Test 4: Real(8) components should produce complex(8) c8 = (-1.0d0, 0.0d0) if (kind(c8) /= 8) error stop "c8 should have kind 8" print *, "PASS: all complex literal kind tests" end program lfortran-lfortran-2f73434/integration_tests/derived_types_59.f900000664000175000017500000000052515141516316025105 0ustar alastairalastairmodule derived_types_59_m implicit none type inside integer :: m = 0 end type inside type wrapper type(inside) :: i = inside() end type end module program derived_types_59 use derived_types_59_m implicit none type(wrapper) :: w w = wrapper() if (w%i%m /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_83.f900000664000175000017500000000137015141516316025101 0ustar alastairalastairmodule wrappers_derived_types_83 implicit none type :: other_type class(*), allocatable :: value end type other_type interface set module procedure set_other end interface set contains subroutine set_other( other, value ) type(other_type), intent(out) :: other class(*), intent(in) :: value allocate(other % value, source=value) end subroutine set_other end module wrappers_derived_types_83 program derived_types_83 use wrappers_derived_types_83 implicit none contains subroutine input_random_data( ) class(*), allocatable :: dummy type(other_type) :: other call set ( other, dummy ) end subroutine input_random_data end programlfortran-lfortran-2f73434/integration_tests/class_94.f900000664000175000017500000001001115141516316023332 0ustar alastairalastair! Tests passing struct arrays to class array parameters module class_94_types implicit none type :: base_type integer :: value end type base_type type, extends(base_type) :: extended_type integer :: extra end type extended_type contains ! Subroutine that accepts class array subroutine process_class_array(arr) class(base_type), intent(in) :: arr(:) integer :: i do i = 1, size(arr) ! select type(arr) !! TODO: fix this select type ! type is (base_type) if (arr(i)%value /= i * 10) error stop "Base type value mismatch" ! type is (extended_type) ! if (arr(i)%value /= i * 10) error stop "Extended type value mismatch" ! if (arr(i)%extra /= i * 100) error stop "Extended type extra mismatch" ! end select end do end subroutine process_class_array ! Subroutine that accepts class array and modifies it subroutine modify_class_array(arr) class(base_type), intent(inout) :: arr(:) integer :: i do i = 1, size(arr) ! select type(arr) !! TODO: fix this select type ! type is (base_type) arr(i)%value = arr(i)%value + 1 ! type is (extended_type) ! arr(i)%value = arr(i)%value + 1 ! arr(i)%extra = arr(i)%extra + 1 ! end select end do end subroutine modify_class_array ! Function that accepts class array and returns sum function sum_class_values(arr) result(total) class(base_type), intent(in) :: arr(:) integer :: total, i total = 0 do i = 1, size(arr) total = total + arr(i)%value end do end function sum_class_values end module class_94_types program class_94 use class_94_types implicit none type(base_type), allocatable :: base_arr(:) type(extended_type), allocatable :: ext_arr(:) integer :: i, total ! Test 1: Pass base_type array to class array parameter print *, "Test 1: base_type array -> class array" allocate(base_arr(3)) do i = 1, 3 base_arr(i)%value = i * 10 end do call process_class_array(base_arr) print *, "Test 1 passed" ! TODO: Test 2: Pass extended_type array to class array parameter ! print *, "Test 2: extended_type array -> class array" ! allocate(ext_arr(3)) ! do i = 1, 3 ! ext_arr(i)%value = i * 10 ! ext_arr(i)%extra = i * 100 ! end do ! call process_class_array(ext_arr) ! print *, "Test 2 passed" ! ! Test 3: Modify base_type array via class array parameter print *, "Test 3: Modify base_type array" call modify_class_array(base_arr) do i = 1, 3 if (base_arr(i)%value /= i * 10 + 1) error stop "Modification failed" end do print *, "Test 3 passed" ! TODO: Test 4: Modify extended_type array via class array parameter ! print *, "Test 4: Modify extended_type array" ! call modify_class_array(ext_arr) ! do i = 1, 3 ! if (ext_arr(i)%value /= i * 10 + 1) error stop "Extended modification failed" ! if (ext_arr(i)%extra /= i * 100 + 1) error stop "Extended extra modification failed" ! end do ! print *, "Test 4 passed" ! Test 5: Use function with class array parameter print *, "Test 5: Function with class array" total = sum_class_values(base_arr) if (total /= 63) error stop "Sum of base_arr failed" ! (11 + 21 + 31) ! total = sum_class_values(ext_arr) ! if (total /= 63) error stop "Sum of ext_arr failed" ! (11 + 21 + 31) print *, "Test 5 passed" ! Test 6: Same type as class (base_type -> class(base_type)) print *, "Test 6: Same type as class" deallocate(base_arr) allocate(base_arr(2)) base_arr(1)%value = 100 base_arr(2)%value = 200 total = sum_class_values(base_arr) print *, "Total:", total ! if (total /= 300) error stop "Same type test failed" !! TODO: fails with --fast ! print *, "Test 6 passed" end program class_94 lfortran-lfortran-2f73434/integration_tests/class_procedure_args_01.f900000664000175000017500000000171515141516316026415 0ustar alastairalastairmodule class_procedure_args_01 type,public :: clock contains procedure,public :: toc => clock_end procedure :: increment end type clock type(clock),public :: clk contains subroutine clock_end(me, case_str) class(clock),intent(inout) :: me character(len=*),intent(in) :: case_str print *, case_str if (case_str /= "5") stop end subroutine clock_end subroutine sub(case_str) character(len=*),intent(in) :: case_str print *, case_str if (case_str /= "6") error stop end subroutine sub function increment(me, x) result(res) class(clock),intent(inout) :: me integer, intent(in) :: x integer :: res res = x + 1 end function increment end module class_procedure_args_01 program main use class_procedure_args_01 procedure(sub), pointer :: toc call clk%toc("5") toc => sub call toc("6") if (clk%increment(x=5) /= 6) error stop end program main lfortran-lfortran-2f73434/integration_tests/separate_compilation_26.f900000664000175000017500000000033715141516316026434 0ustar alastairalastairprogram separate_compilation_26 use quadrature_separate_compilation_26 , only: gauss_legendre implicit none integer :: x = 1 call gauss_legendre(x) print *, x if (x /= 2) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_77.f900000664000175000017500000000053415141516316024424 0ustar alastairalastairprogram intrinsics_77 implicit none real, allocatable :: mat1(:, :), mat2(:, :), mat3(:, :), mat4(:, :) real :: error allocate(mat1(5, 5), mat2(5, 5), mat3(5, 5), mat4(5, 5)) mat1 = 2.0 mat2 = 3.0 mat3 = mat1 + mat2 mat4 = 5.0 error = maxval(abs(mat3 - mat4)) print *, maxval(abs(mat3 - mat4)) if( (error - 0.0) > 1e-8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/elemental_18.f900000664000175000017500000000063515141516316024202 0ustar alastairalastairprogram elemental_18 integer :: arr(10) logical :: logi character(len=1) :: str_arr(10) str_arr = "a" arr = 97 ! ASCII equivalent of 'a' logi = all(peek(arr) == str_arr) if(logi .neqv. .true.) error stop contains elemental function peek(pos) result(ch) integer, intent(in) :: pos character(1) :: ch ch = achar(pos) end function peek end program lfortran-lfortran-2f73434/integration_tests/arrays_86.f900000664000175000017500000000061715141516316023542 0ustar alastairalastairprogram test_key_slice use iso_fortran_env, only: int8 integer(int8), dimension(10) :: full_key integer :: i call process_key(full_key(:)) contains subroutine process_key(key) integer(int8), intent(in) :: key(0:) integer :: i print *, lbound(key, 1) if( lbound(key, 1) /= 0 ) error stop end subroutine process_key end program test_key_slice lfortran-lfortran-2f73434/integration_tests/operator_overloading_13.f900000664000175000017500000000233615141516316026453 0ustar alastairalastairmodule operator_overloading_13_module implicit none private public :: operator(.separatedBy.) interface operator(.separatedBy.) module function strings_with_separator(sep, strings) result(csv) implicit none character(len=*), intent(in) :: sep character(len=*), dimension(:), intent(in) :: strings character(len=:), allocatable :: csv end function end interface contains module function strings_with_separator(sep, strings) result(csv) implicit none character(len=*), intent(in) :: sep character(len=*), dimension(:), intent(in) :: strings character(len=:), allocatable :: csv integer :: i character(len=:), allocatable :: temp csv = "" do i = 1, size(strings) if (i > 1) csv = csv // sep csv = csv // trim(strings(i)) end do end function end module operator_overloading_13_module program operator_overloading_13 use operator_overloading_13_module, only: operator(.separatedBy.) implicit none character(len=:), allocatable :: csv character(len=*), dimension(3), parameter :: strings = ["abc", "def", "ghi"] csv = "," .separatedBy. strings print *, "CSV Result: ", trim(csv) if (trim(csv) /= "abc,def,ghi") error stop end program lfortran-lfortran-2f73434/integration_tests/ilp64_kind_arg_01.f900000664000175000017500000000070515141516316025016 0ustar alastairalastairprogram ilp64_kind_arg_01 use, intrinsic :: iso_fortran_env, only: real32 implicit none integer, parameter :: WP = real32 complex(kind=WP) :: c real(kind=WP) :: r integer(4) :: exit_code r = 1.0_WP c = cmplx(r, 0.0_WP, kind=WP) exit_code = 0 if (abs(real(c) - 1.0_WP) > 0.001_WP) exit_code = 1 if (abs(aimag(c)) > 0.001_WP) exit_code = 2 if (exit_code /= 0) stop exit_code print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/arrays_30.f900000664000175000017500000000366115141516316023531 0ustar alastairalastairprogram arrays_30 implicit none integer :: i1(64) = [ 479, 735, -870, 410, 446, -627, 879, -72, & -948, 693, 133, -672, 897, -227, 965, 9, & 0, 997, 721, -240, 765, -426, 361, 751, & 669, -94, 534, 806, -23, 844, 246, -114, & 673, -445, 654, -274, -53, 505, -414, 269, & -345, 268, -544, 629, 353, -808, 199, 322, & 995, -697, 290, -514, 350, -777, 664, 195, & -401, 348, 86, -620, 153, 144, 65, -431 ] integer :: i2(4, 16) integer :: i3(2, 4, 8) integer :: i4(2, 4, 2, 4) integer :: res_01(1), res_02(2), res_03(3), res_04(4) integer :: max = 997 i2 = reshape(i1, [4, 16]) i3 = reshape(i1, [2, 4, 8]) i4 = reshape(i1, [2, 4, 2, 4]) res_01 = maxloc(i1) res_02 = maxloc(i2) res_03 = maxloc(i3) res_04 = maxloc(i4) if (maxloc(i1, 1) /= 18) error stop if (i1(res_01(1)) /= max) error stop if (i2(res_02(1), res_02(2)) /= i1(res_01(1))) error stop if (i3(res_03(1), res_03(2), res_03(3)) /= max) error stop if (i4(res_04(1), res_04(2), res_04(3), res_04(4)) /= max) error stop res_01 = shape(maxloc(i1)) if (res_01(1) /= 1) error stop res_01 = shape(maxloc(i2, 1)) if (res_01(1) /= 16) error stop res_02 = shape(maxloc(i3, 2)) if (res_02(1) /= 2 .or. res_02(2) /= 8) error stop res_03 = shape(maxloc(i4, 3)) if (res_03(1) /= 2 .or. res_03(2) /= 4 .or. res_03(3) /= 4) error stop if (size(maxloc(i2, 2)) /= 4) error stop if (size(maxloc(i3, 3)) /= 8) error stop if (size(maxloc(i4, 4)) /= 16) error stop res_04 = maxloc(i2, 2) if (i2(1, res_04(1)) /= 995) error stop if (i2(2, res_04(2)) /= max) error stop if (i2(3, res_04(3)) /= 965) error stop if (i2(4, res_04(4)) /= 806) error stop end program arrays_30 lfortran-lfortran-2f73434/integration_tests/complex_02.f900000664000175000017500000000026115141516316023667 0ustar alastairalastairprogram complex_02 implicit none complex :: x, z, w, i_ real :: a, b x = (1.0,-3.0) a = 3.0 b = 4.0 i_ = (0, 1) z = a + i_*b w = a+b + i_*(a-b) print *, x, z, w end program lfortran-lfortran-2f73434/integration_tests/file_26.f900000664000175000017500000000631515141516316023153 0ustar alastairalastairprogram file_26 implicit none integer, parameter :: n = 5 integer :: data_out(n), data_in(n) integer, allocatable :: data_out_alloc(:) real, allocatable :: data_out_alloc_real(:) real :: data_in_real(n) integer :: i, write_unit, read_unit, ios character(len=2) :: tmp character(len=3) :: tmp2 data_out = (/ 1, 2, 3, 4, 5 /) allocate(data_out_alloc(n)) allocate(data_out_alloc_real(n)) data_out_alloc = [1, 2, 3, 4, 5] data_out_alloc_real = [1, 2, 3, 4, 5] open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace') write(write_unit) data_out write(9, *) data_out close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old') read(read_unit) data_in close(read_unit) print *, data_out print *, data_in if (any(data_out /= data_in)) error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out write(9, *) data_out close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in close(read_unit) print *, data_out print *, data_in if (any(data_out /= data_in)) error stop open(newunit=write_unit, file='file_26_data2.dat', form='unformatted', status='replace') write(write_unit) "Hello" close(write_unit) open(newunit=read_unit, file='file_26_data2.dat', form='unformatted', status='old') read(read_unit) tmp, tmp2 close(read_unit) print *, tmp, " ", tmp2 if (tmp /= "He" .or. tmp2 /= "llo") error stop open(newunit=write_unit, file='file_26_data2.dat', form='unformatted', status='replace', access="stream") write(write_unit) "Hello" close(write_unit) open(newunit=read_unit, file='file_26_data2.dat', form='unformatted', status='old', access="stream") read(read_unit) tmp, tmp2 close(read_unit) print *, tmp, " ", tmp2 if (tmp /= "He" .or. tmp2 /= "llo") error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out_alloc close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in close(read_unit) print *, data_out_alloc print *, data_in if (any(data_out_alloc /= data_in)) error stop open(newunit=write_unit, file='file_26_data.dat', form='unformatted', status='replace', access="stream") write(write_unit) data_out_alloc_real close(write_unit) open(newunit=read_unit, file='file_26_data.dat', form='unformatted', status='old', access="stream") read(read_unit) data_in_real close(read_unit) print *, data_out_alloc_real print *, data_in_real if (any(data_out_alloc_real /= data_in_real)) error stop call test_sub(data_out) if(any(data_out /= [10, 20, 30, 40, 50])) error stop contains subroutine test_sub(res2) integer :: lun integer, parameter :: res(5) = [10, 20, 30, 40, 50] integer, intent(out) :: res2(:) open(newunit=lun, file="file_26_data.dat", status="replace", form="unformatted", access="stream") write(lun) res rewind(lun) read(lun) res2 close(lun) end subroutine test_sub end program lfortran-lfortran-2f73434/integration_tests/openmp_21.f900000664000175000017500000000070115141516316023516 0ustar alastairalastairprogram openmp_21 use omp_lib integer, parameter :: n = 100000 integer :: i real :: b(n) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_359.f900000664000175000017500000000031315141516316024502 0ustar alastairalastairprogram intrinsics_359 implicit none integer :: k print *, pack( [(k, k = 1, 2)] , [.true., .true.] ) if (any(pack( [(k, k = 1, 2)] , [.true., .true.] ) /= [1, 2])) error stop end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_16.f900000664000175000017500000000031015141516316026422 0ustar alastairalastairprogram separate_compilation_16 use mod_separate_compilation_16 implicit none integer :: key = 5 call map_open_entry( key ) print *, key if (key /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_10a.f900000664000175000017500000000037715141516316026572 0ustar alastairalastairmodule history_mod_separate_compilation_10a contains subroutine rangehist(xhist) real, intent(inout) :: xhist(:, :) real :: x(25) x = 12.912 xhist = reshape(x, shape(xhist)) xhist = 99.124 end subroutine end module lfortran-lfortran-2f73434/integration_tests/select_type_23.f900000664000175000017500000000110315141516316024537 0ustar alastairalastairprogram select_type_23 implicit none type :: base_settings end type base_settings type, extends(base_settings) :: fpm_new_settings character(len=:), allocatable :: name end type fpm_new_settings class(base_settings), allocatable :: cmd_settings character(len=:), allocatable :: act_name(:) cmd_settings = fpm_new_settings("build") select type (settings => cmd_settings) type is (fpm_new_settings) act_name = [ trim(settings%name) ] end select if (act_name(1) /= "build") error stop end program select_type_23 lfortran-lfortran-2f73434/integration_tests/allocate_15.f900000664000175000017500000000043415141516316024012 0ustar alastairalastairprogram allocate_15 implicit none integer, allocatable :: x(:), y(:), z(:) allocate(x(3), y(3)) allocate(z(size(x+y) - 1)) if (size(z) /= 2) error stop deallocate(z) allocate(z(1 + size(x+y))) if (size(z) /= 4) error stop deallocate(z) end program lfortran-lfortran-2f73434/integration_tests/complex_21.f900000664000175000017500000000031015141516316023663 0ustar alastairalastairprogram complex_21 implicit none complex :: a = (1.0, 2.0) complex(8) :: b = (1.0_8, 2.0_8) if (cmplx(a, kind=8) /= b) error stop if (cmplx(b, kind=4) /= a) error stop end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_24a.f900000664000175000017500000000035215141516316026570 0ustar alastairalastairmodule sorting_separate_compilation_24 implicit none interface module subroutine sort(n) integer, intent(inout) :: n end subroutine end interface end module sorting_separate_compilation_24lfortran-lfortran-2f73434/integration_tests/class_58.f900000664000175000017500000000066615141516316023351 0ustar alastairalastairmodule class_58_mod implicit none type :: mytype integer :: val end type mytype contains subroutine expect_class(x) class(mytype), intent(inout) :: x(:) x(1)%val = 7 end subroutine expect_class end module class_58_mod program class_58 use class_58_mod implicit none type(mytype), allocatable :: y(:) allocate(y(3)) y(1)%val = 5 call expect_class(y) if (y(1)%val /= 7) error stop end program class_58lfortran-lfortran-2f73434/integration_tests/class_89.f900000664000175000017500000000163315141516316023350 0ustar alastairalastair module class_89_mod implicit none type :: other_type class(*), allocatable :: value end type other_type contains subroutine copy_other(src, dest) type(other_type), intent(in) :: src type(other_type), intent(out) :: dest allocate(dest%value, source=src%value) end subroutine copy_other end module class_89_mod program class_89 use class_89_mod, only : copy_other, other_type implicit none type :: dummy_type integer :: val(15) end type dummy_type type(other_type) :: other_in, other_out type(dummy_type) :: dummy_val integer :: i dummy_val%val = [(i, i=1,15)] allocate(other_in%value, source=dummy_val) call copy_other(other_in, other_out) select type(p => other_out%value) type is (dummy_type) print *, p%val if (any(p%val /= dummy_val%val)) error stop end select end program class_89lfortran-lfortran-2f73434/integration_tests/derived_types_14.f900000664000175000017500000000245315141516316025076 0ustar alastairalastairmodule derived_types_14_module1 use derived_types_14_module implicit none contains !> Determine TOML value type function toml_get_value_type(raw) result(vtype) !> Raw representation of TOML string character(len=*), intent(in) :: raw !> Value type integer :: vtype if (check(raw)) then vtype = toml_type%string return end if if (check(raw)) then vtype = toml_type%boolean return end if if (check(raw)) then vtype = toml_type%int return end if if (check(raw)) then vtype = toml_type%float return end if if (check(raw)) then vtype = toml_type%datetime return end if vtype = toml_type%invalid end function function check(raw) result(res) !> Raw representation of TOML string character(len=*), intent(in) :: raw !> Value type logical :: res res = .true. end function end module derived_types_14_module1 program main implicit none print *, "running derived_types_14 main program" end program main lfortran-lfortran-2f73434/integration_tests/passing_array_03.f900000664000175000017500000000127315141516316025067 0ustar alastairalastairMODULE passing_array_03_mod implicit none CONTAINS FUNCTION test_01 (value) result(res) implicit none ! Ranks aren't equal, but it works as long as we can slice the passed array. INTEGER, DIMENSION(2,2,2),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry INTEGER, DIMENSION(6,2) :: value integer :: ret ret = test_01(value) print *, ret if (ret /= 8) error stop end subroutine test_entry END MODULE passing_array_03_mod program passing_array_03 use passing_array_03_mod implicit none call test_entry end program passing_array_03 lfortran-lfortran-2f73434/integration_tests/intrinsics_75.f900000664000175000017500000000035615141516316024424 0ustar alastairalastairprogram intrinsics_75 implicit none real(8) :: lambda = 1.123 real(8) :: x(10) integer :: i_max = 2 x = 23. print *, exp(-lambda * (x(i_max:i_max+4)-x(1))) if( any(exp(-lambda * (x(i_max:i_max+4)-x(1))) /= 1.0) ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_387.f900000664000175000017500000000107415141516316024510 0ustar alastairalastairprogram intrinsics_387 implicit none character(len=:), allocatable :: temp integer :: stat = -1 temp = "echo Hello from Fortran!" call execute_command_line(temp) temp = "export LFORTRAN_TEST_VAR_INTRINSIC=42; echo $LFORTRAN_TEST_VAR_INTRINSIC" call execute_command_line(temp) call execute_command_line(temp, exitstat=stat) print *, "Exit status:", stat if ( stat /= 0 ) error stop call execute_command_line("exit 2", exitstat=stat) print *, "exitstat =", stat if (stat /= 2) error stop end program intrinsics_387 lfortran-lfortran-2f73434/integration_tests/generic_name_01.f900000664000175000017500000000266615141516316024646 0ustar alastairalastairmodule Complex_module implicit none type :: ComplexType real :: r real :: i contains procedure :: integer_add_subrout procedure :: real_add_subrout generic :: add => integer_add_subrout, real_add_subrout end type contains subroutine integer_add_subrout(this, r, i, sum) class(ComplexType), intent(in) :: this integer, intent(in) :: r, i type(ComplexType), intent(out) :: sum print *, "Calling integer_add_subrout" sum%r = this%r + r sum%i = this%i + i end subroutine subroutine real_add_subrout(this, r, i, sum) class(ComplexType), intent(in) :: this real, intent(in) :: r, i type(ComplexType), intent(out) :: sum print *, "Calling real_add_subrout" sum%r = this%r + r sum%i = this%i + i end subroutine end module program generic_name_01 use Complex_module, only: ComplexType implicit none real :: fpone, fptwo, fpzero, negfpone integer :: ione, izero type(ComplexType) :: a, c fpone = 1.0 fptwo = 2.0 fpzero = 0.0 ione = 1 izero = 0 negfpone = -1.0 c = ComplexType(fpone, fptwo) call c%add(ione, izero, a) print *, a%r, a%i if( a%r /= 2.0 ) error stop if( a%i /= 2.0 ) error stop call c%add(fpzero, negfpone, a) print *, a%r, a%i if( a%r /= 1.0 ) error stop if( a%i /= 1.0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/class_61.f900000664000175000017500000000130315141516316023330 0ustar alastairalastairprogram class_61 implicit none type, abstract :: fpm_cmd_settings end type type, extends(fpm_cmd_settings) :: fpm_run_settings character(len=3), allocatable :: name(:) end type fpm_run_settings class(fpm_cmd_settings), allocatable :: settings character(len=3), allocatable :: arr(:) allocate(arr(3)) arr = ["abc", "def", "ghi"] allocate(fpm_run_settings :: settings) settings = fpm_run_settings(name=arr) select type(settings) type is (fpm_run_settings) if (settings%name(1) /= "abc") error stop if (settings%name(2) /= "def") error stop if (settings%name(3) /= "ghi") error stop class default error stop end select end program class_61lfortran-lfortran-2f73434/integration_tests/functions_43.f900000664000175000017500000000125715141516316024243 0ustar alastairalastairmodule functions_43_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains elemental function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "0" res%string_ = x%string_ end function bracket end module functions_43_mod program functions_43 use functions_43_mod implicit none type(string_t) :: lines(3) lines(1)%string_ = "1" lines(2)%string_ = "2" lines(3)%string_ = "3" lines = bracket(lines) if (lines(1)%string_ /= "1") error stop if (lines(2)%string_ /= "2") error stop if (lines(3)%string_ /= "3") error stop end program functions_43 lfortran-lfortran-2f73434/integration_tests/return_03.f900000664000175000017500000000063715141516316023547 0ustar alastairalastairprogram main integer :: main_out = 999 call main1(main_out) print *, "main1 called" contains subroutine main1(out_var) integer :: out_var integer :: i i = 10 if (i .GT. 5) then out_var = i print *, "early return" return end if print *, "normal return" out_var = i end subroutine main1 end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_23.f900000664000175000017500000000200515141516316025231 0ustar alastairalastairmodule lincoa_mod implicit none contains subroutine get_lincon(amat) implicit none real, intent(out), allocatable :: amat(:, :) integer :: m, n m = 3 n = 2 allocate(amat(m, n)) amat = reshape([1., 2., 3., 4., 5., 6.], shape(amat)) end subroutine get_lincon subroutine get_lincon1(amat) implicit none real, intent(out), allocatable :: amat(:, :) integer :: m, n m = 3 n = 2 amat = reshape([4., 5., 6., 1., 2., 3.], [m, n]) end subroutine get_lincon1 end module lincoa_mod program arrays_reshape_23 use lincoa_mod implicit none real, allocatable :: a(:, :), b(:, :) call get_lincon(a) print *, a if( any(a(:, 1) /= [1.0, 2.0, 3.0]) ) error stop if( any(a(:, 2) /= [4.0, 5.0, 6.0]) ) error stop call get_lincon1(b) print *, b if( any(b(:, 1) /= [4.0, 5.0, 6.0]) ) error stop if( any(b(:, 2) /= [1.0, 2.0, 3.0]) ) error stop end program arrays_reshape_23 lfortran-lfortran-2f73434/integration_tests/expr_03.f900000664000175000017500000000052215141516316023177 0ustar alastairalastairprogram expr_03 implicit none integer :: x x = -2 if (x /= -2) error stop x = -2*3 if (x /= -6) error stop x = -2*(-3) if (x /= 6) error stop x = 3 - 1 if (x /= 2) error stop x = 1 - 3 if (x /= -2) error stop if (x /= (-2)) error stop x = 1 - (-3) if (x /= 4) error stop if (x /= +4) error stop if (x /= (+4)) error stop end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops8.f900000664000175000017500000000042415141516316025331 0ustar alastairalastair program implied_do_loops8 integer :: i, input(2,2) input = reshape([(i, i = 1, 4)], [2, 2]) print * , input if (input(1,1) /= 1) error stop if (input(2,1) /= 2) error stop if (input(1,2) /= 3) error stop if (input(2,2) /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/bindc_10.f900000664000175000017500000000067115141516316023303 0ustar alastairalastairprogram bind_10 use iso_c_binding, only: c_char implicit none character(len=1) :: result(2) integer :: n n = getcwd(result) if (n >= 0) then print *, "Test passed" else print *, "Test passed (negative result)" end if contains function getcwd(buf) result(n) bind(c, name="getcwd") character(kind=c_char,len=1), dimension(:), intent(out) :: buf integer :: n end function getcwd end program bind_10 lfortran-lfortran-2f73434/integration_tests/associate_08.f900000664000175000017500000000214015141516316024177 0ustar alastairalastairmodule associate_08_module_1 implicit none type t_1 integer :: i end type t_1 type t_2 type(t_1), pointer :: type_2(:) end type t_2 contains subroutine sub_1(type_1, i) class(t_2), intent(inout) :: type_1 integer, intent(in) :: i allocate(type_1%type_2(1)) associate(target=>type_1%type_2(1)%i) target = i end associate end subroutine sub_1 subroutine sub_2(progress) class(t_2), intent(inout), allocatable :: progress(:) allocate(progress(1)) allocate(progress(1)%type_2(1)) associate(target => progress(1)) target%type_2(1)%i = 345 end associate end subroutine sub_2 end module program associate2 use associate_08_module_1 implicit none type(t_2) :: type_1 class(t_2), allocatable :: t_2_array(:) call sub_1(type_1, 123) if (type_1%type_2(1)%i /= 123) error stop print *, type_1%type_2(1)%i ! TODO: Fix when implementing class arrays ! call sub_2(t_2_array) ! print *, t_2_array(1)%type_2(1)%i end program associate2 lfortran-lfortran-2f73434/integration_tests/file_14.f900000664000175000017500000000053015141516316023141 0ustar alastairalastairprogram file_14 implicit none real, pointer :: line(:) integer :: u = 10 open(u, file='file_08.txt', action='read') allocate(line(4)) read(u, *) line close(u) if (line(1) /= 1.) error stop if (line(2) /= 2.) error stop if (line(3) /= 3.) error stop if (line(4) /= 4.) error stop end program file_14 lfortran-lfortran-2f73434/integration_tests/union_test_03.f900000664000175000017500000000074615141516316024420 0ustar alastairalastairmodule lp_union_test_03_mod implicit none _lfortran_union_type :: test_type integer :: int_ real :: float_ end _lfortran_union_type end module program lp_union_test_03 use lp_union_test_03_mod implicit none integer::x type(test_type) :: test_union test_union%int_ = 100 x = test_union%int_ !Support direct comparision later if ( x /= 100 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_10.f900000664000175000017500000000012215141516316024400 0ustar alastairalastairprogram intrinsics_10 integer, parameter :: x = 3 print*, real(x) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_60_data.txt0000664000175000017500000000001215141516316025615 0ustar alastairalastaira Z ÿ © lfortran-lfortran-2f73434/integration_tests/use_01.f900000664000175000017500000000103515141516316023013 0ustar alastairalastairMODULE one IMPLICIT NONE INTEGER :: nx = 1 CONTAINS SUBROUTINE sub (n) INTEGER, INTENT(INOUT) :: n n = n + 1 END SUBROUTINE sub INTEGER FUNCTION fun() result(i) i = 3 END FUNCTION END MODULE one MODULE two USE one, ONLY: nx, sub, fun IMPLICIT NONE END MODULE two PROGRAM test USE two USE one, ONLY: nx, sub, fun PRINT *, nx IF (nx /= 1) ERROR STOP CALL sub ( nx ) PRINT *, nx IF (nx /= 2) ERROR STOP PRINT *, fun() if (fun() /= 3) ERROR STOP END PROGRAM test lfortran-lfortran-2f73434/integration_tests/print_07.f900000664000175000017500000000173315141516316023366 0ustar alastairalastairprogram print_07 implicit none character(20) :: output ! Test RU - Round Up write(output, "(RU,F6.2)") 1.235 print *, output if (output /= " 1.24") error stop "RU rounding failed" ! Test RD - Round Down write(output, "(RD,F6.2)") 1.235 print *, output if (output /= " 1.23") error stop "RD rounding failed" ! Test RN - Round to Nearest (round half away from zero) write(output, "(RN,F6.2)") 1.235 print *, output if (output /= " 1.24") error stop "RN rounding (1.235) failed" write(output, "(RN,F6.2)") 1.225 print *, output if (output /= " 1.23") error stop "RN rounding (1.225) failed" ! Test RZ - Round toward Zero write(output, "(RZ,F6.2)") 1.225 print *, output if (output /= " 1.22") error stop "RZ rounding (1.225) failed" write(output, "(RZ,F6.2)") 1.235 print *, output if (output /= " 1.23") error stop "RZ rounding (1.235) failed" end program lfortran-lfortran-2f73434/integration_tests/struct_type_02.f900000664000175000017500000000023215141516316024603 0ustar alastairalastairprogram struct_type_02 type :: struct real :: field = 5.0 end type struct type(struct) :: array(3) print*, array(:)%field end programlfortran-lfortran-2f73434/integration_tests/allocatble_c_ptr.f900000664000175000017500000000032015141516316025204 0ustar alastairalastairprogram allocatble_c_ptr use iso_c_binding, only: c_ptr implicit none type(c_ptr), allocatable :: c_requests(:) allocate(c_requests(4)) deallocate(c_requests) end program allocatble_c_ptr lfortran-lfortran-2f73434/integration_tests/format_54.f900000664000175000017500000000046015141516316023520 0ustar alastairalastairprogram format_54 implicit none character(4) :: fmt(4) character(len=32) :: actual character(len=*), parameter :: expected = 'hello world!' fmt = [ '("he', 'llo ', 'worl', 'd!")' ] actual = '' write(actual, fmt) if (trim(actual) /= expected) error stop end program format_54 lfortran-lfortran-2f73434/integration_tests/derived_types_24.f900000664000175000017500000000170515141516316025076 0ustar alastairalastairmodule derived_types_24_module_01 implicit none type t_1 integer :: i contains procedure :: sub_01, sub_03 end type t_1 type t_2 type(t_1) :: yt contains procedure :: sub_02 end type t_2 contains subroutine sub_01(this) class(t_1), intent(in) :: this print *, this%i if(this%i /= 123) error stop end subroutine sub_01 subroutine sub_02(this) class(t_2), intent(in) :: this type(t_2) :: t call this%yt%sub_01() t%yt%i = 42 call t%yt%sub_03() end subroutine sub_02 subroutine sub_03(this) class(t_1), intent(in) :: this print *, this%i if(this%i /= 42) error stop end subroutine sub_03 end module derived_types_24_module_01 program derived_types_24 use derived_types_24_module_01 implicit none type(t_2) :: xt xt%yt%i = 123 call xt%sub_02() end program derived_types_24 lfortran-lfortran-2f73434/integration_tests/where_09.f900000664000175000017500000000037515141516316023347 0ustar alastairalastairprogram where_09 implicit none integer :: a(3) integer :: b(3) a = [1,0,-1] b = 0 where(abs(a) == 1) b = 555 print *, b if (b(1) /= 555) error stop if (b(2) /= 0) error stop if (b(3) /= 555) error stop end program where_09 lfortran-lfortran-2f73434/integration_tests/goto_01.f900000664000175000017500000000012215141516316023163 0ustar alastairalastairprogram goto_01 implicit none integer :: a a = 5 go to 1 1 print *, a end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_07.f900000664000175000017500000000151715141516316026061 0ustar alastairalastairmodule pass_array_by_data_07_module implicit none contains function gdef(x) real, intent(in) :: x(:) real :: gdef(size(x)) gdef = x + 1.0 end function end module program pass_array_by_data_07 use pass_array_by_data_07_module, only: gdef implicit none real :: array(10) array = 2.0 print *, f(gdef1, array) if( f(gdef1, array) /= 20.0 ) error stop print *, f(gdef, array) if( f(gdef, array) /= 40.0 ) error stop contains function f(g, array) result(s) real, intent(in) :: array(:) real :: s interface function g(x) real, intent(in) :: x(:) real :: g(size(x)) end function end interface real :: array1(size(array)) array1 = array + 1.0 array1 = g(array1) s = sum(array1) end function function gdef1(x) real, intent(in) :: x(:) real :: gdef1(size(x)) gdef1 = x - 1.0 end function end program lfortran-lfortran-2f73434/integration_tests/file_46.f900000664000175000017500000000131515141516316023150 0ustar alastairalastairprogram file_46 implicit none character(len=40), parameter :: help_text(2) = [character(len=40) :: & 'NAME', 'DESCRIPTION'] integer :: i, lun character(len=200) :: line integer :: expected_len integer :: filesize open(newunit=lun, file='out.txt', status='replace', action='write') write(lun,'(g0)') (trim(help_text(i)), i=1, size(help_text)) expected_len = len('NAME'//new_line('a')//'DESCRIPTION'//new_line('a')) inquire(file='out.txt', size=filesize) if (filesize /= expected_len) then error stop 'EXTRA BYTES WRITTEN (LIKELY SPACES)' end if print *, 'PASSED: no trailing spaces written' close(lun, status='delete') end program file_46 lfortran-lfortran-2f73434/integration_tests/common_03.f900000664000175000017500000000067015141516316023515 0ustar alastairalastairsubroutine pass() real A(2), B integer i(5), e common /SaMpLe/ A, B, i if (abs(A(1) - 10.0) > 1e-7) error stop if (abs(B - 20.0) > 1e-7) error stop print *, A, B, e end subroutine program common3 real A, B, z1, z2 integer c, d, e, f, g, h, i(5), j common z1, /c/ c, /b/ d /Sample/ A(2), /b/ e, f, //z2 /c/ g, h, j /sample/ B, i A = [10.0, 11.0] B = 20.0 e = 123 call pass() end program lfortran-lfortran-2f73434/integration_tests/matrix_01_transpose.f900000664000175000017500000000254415141516316025627 0ustar alastairalastairprogram matrix_01_tranpose implicit none integer :: i, j, a(3, 4), b(4, 3) real :: x(5, 5), y(5, 5) double precision :: d(1,2), e(2,1) complex :: c(2, 2), f(2, 2) logical :: l(12, 31), m(31, 12) a = reshape( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4] ) b = transpose(a) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) if (a(i, j) /= b(j, i)) error stop end do end do x = reshape( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], [5, 5] ) y = transpose(x) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) if (abs(x(i, j) - y(j, i)) > 1e-6) error stop end do end do d = reshape( [1, 2], [1, 2] ) e = transpose(d) do i = lbound(d, 1), ubound(d, 1) do j = lbound(d, 2), ubound(d, 2) if (abs(d(i, j) - e(j, i)) > 1e-12) error stop end do end do c = reshape( [ (1, 2), (3, 4), (5, 6), (7, 8) ], [2, 2] ) f = transpose(c) do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) if (abs(real(c(i, j)) - real(f(j, i))) > 1e-6) error stop if (abs(aimag(c(i, j)) - aimag(f(j, i))) > 1e-6) error stop end do end do l = .true. m = transpose(l) do i = lbound(l, 1), ubound(l, 1) do j = lbound(l, 2), ubound(l, 2) if (l(i, j) .neqv. m(j, i)) error stop end do end do end program matrix_01_tranpose lfortran-lfortran-2f73434/integration_tests/namelist_08.f900000664000175000017500000000372015141516316024045 0ustar alastairalastairprogram namelist_multi_groups implicit none ! Variables for first group integer :: a, b ! Variables for second group real :: x, y ! Variables for third group character(len=10) :: name1, name2 ! Define three separate namelist groups namelist /group1/ a, b namelist /group2/ x, y namelist /group3/ name1, name2 ! Initialize group1 variables a = 100 b = 200 ! Initialize group2 variables x = 1.5 y = 2.5 ! Initialize group3 variables name1 = 'hello' name2 = 'world' ! Write each group to separate files open(unit=11, file='namelist_group1.dat', status='replace', form='formatted') write(11, nml=group1) close(11) open(unit=12, file='namelist_group2.dat', status='replace', form='formatted') write(12, nml=group2) close(12) open(unit=13, file='namelist_group3.dat', status='replace', form='formatted') write(13, nml=group3) close(13) ! Reset all variables a = 0 b = 0 x = 0.0 y = 0.0 name1 = '' name2 = '' ! Read each group from respective files open(unit=11, file='namelist_group1.dat', status='old', form='formatted') read(11, nml=group1) close(11) open(unit=12, file='namelist_group2.dat', status='old', form='formatted') read(12, nml=group2) close(12) open(unit=13, file='namelist_group3.dat', status='old', form='formatted') read(13, nml=group3) close(13) ! Verify group1 values if (a /= 100) error stop "Variable a mismatch" if (b /= 200) error stop "Variable b mismatch" ! Verify group2 values if (abs(x - 1.5) > 1.0e-5) error stop "Variable x mismatch" if (abs(y - 2.5) > 1.0e-5) error stop "Variable y mismatch" ! Verify group3 values if (trim(name1) /= 'hello') error stop "Variable name1 mismatch" if (trim(name2) /= 'world') error stop "Variable name2 mismatch" print *, "Multiple namelist groups test passed!" end program namelist_multi_groups lfortran-lfortran-2f73434/integration_tests/int_dp.f900000664000175000017500000000016015141516316023172 0ustar alastairalastairprogram int_dp integer(4) :: u = 2147483647 integer(8) :: v = 2147483647 print *, u, v end programlfortran-lfortran-2f73434/integration_tests/openmp_05.f900000664000175000017500000000052515141516316023524 0ustar alastairalastairprogram openmp_05 use omp_lib integer :: n = 10, i call omp_set_num_threads(4) !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" print *, "i = ", i, "from thread = ", omp_get_thread_num() if (omp_get_thread_num() > 4) error stop end do !$omp end do !$omp end parallel print *, "end program" end program lfortran-lfortran-2f73434/integration_tests/common_12.f900000664000175000017500000000057415141516316023520 0ustar alastairalastairsubroutine dvode () double precision tau common /dvod01/ tau(13) end subroutine dvstep () double precision tau double precision h common /dvod01/ tau(13) h = 5.6d0 tau(1) = h return end program common_12 double precision tau common /dvod01/ tau(13) call dvstep() if (abs(tau(1) - 5.6d0) > 1e-10) error stop print *, tau(1) end program lfortran-lfortran-2f73434/integration_tests/implicit_typing_05.f900000664000175000017500000000046515141516316025435 0ustar alastairalastairsubroutine outer() print *, f(2.0_8) if ( abs(f(2.0_8) - 14.928527864588919) > 1e-7 ) error stop contains function f(r) implicit real(kind=8) (f, r, n) n = 3.9_8 f = r**n end function f end subroutine outer program implicit_typing_05 call outer() end program implicit_typing_05 lfortran-lfortran-2f73434/integration_tests/derived_types_20_module1.f900000664000175000017500000000236715141516316026525 0ustar alastairalastairmodule fpm_command_line_20 use M_CLI2_20, only : specified implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_new_settings character(len=:), allocatable :: name logical :: with_executable=.false. logical :: with_test=.false. logical :: with_lib=.true. logical :: with_example=.false. logical :: with_full=.false. logical :: with_bare=.false. logical :: backfill=.true. end type contains subroutine get_command_line_settings(cmd_settings) class(fpm_cmd_settings), allocatable, intent(out) :: cmd_settings allocate(fpm_new_settings :: cmd_settings) if (any( specified([character(len=10) :: 'src','lib','app','test','example']) ) ) then cmd_settings=fpm_new_settings(& & backfill=.false., & & name="xyz", & & with_executable=.true., & & with_lib=.false., & & with_test=.true., & & with_example=.false., & & verbose=.true. ) end if end subroutine get_command_line_settings end module fpm_command_line_20 lfortran-lfortran-2f73434/integration_tests/struct_allocate.f900000664000175000017500000000064015141516316025110 0ustar alastairalastairmodule mod_struct_allocate implicit none integer, parameter, private :: mxdim = 3 type :: rp1d real(8), dimension(:), pointer :: f end type type :: sds type(rp1d), dimension(mxdim) :: scales end type end module program struct_allocate use mod_struct_allocate implicit none type(sds) :: s allocate(s%scales(1)%f(4)) allocate(s%scales(2)%f(3)) end program lfortran-lfortran-2f73434/integration_tests/nested_20.f900000664000175000017500000000064215141516316023505 0ustar alastairalastairmodule nested_20_mod implicit none type t integer :: i = 1 integer :: arr(2) = [10, 20] end type t type(t), parameter :: t_param = t() end module nested_20_mod program nested_20 use nested_20_mod implicit none ! Check scalar component if (t_param%i /= 1) error stop ! Check array component if (any(t_param%arr /= [10, 20])) error stop end program nested_20 lfortran-lfortran-2f73434/integration_tests/nested_vars3.f900000664000175000017500000000111415141516316024315 0ustar alastairalastairmodule nested_vars3 implicit none contains subroutine h(a, filename) integer, intent(in) :: a character(len=*), intent(in) :: filename integer, parameter :: x = 10 call g() contains subroutine g() print *, x if (x /= 10) error stop print *, a if (a /= 5) error stop if (filename /= "xyz") error stop end subroutine end subroutine end module program nested_vars3_main use nested_vars3, only: h implicit none call h(5, "xyz") end program lfortran-lfortran-2f73434/integration_tests/intrinsics_50.f900000664000175000017500000000426015141516316024413 0ustar alastairalastairprogram intrinsics_50 implicit none logical :: is_one_present, is_five_present character(len=1) :: strings(2, 2) character(len=80), parameter :: help_text_build_common(*) = [character(len=80) :: & ' --profile PROF Selects the compilation profile for the build. ',& ' Currently available profiles are "release" for ',& ' high optimization and "debug" for full debug options. ',& ' If --flag is not specified the "debug" flags are the ',& ' default. ',& ' --no-prune Disable tree-shaking/pruning of unused module dependencies '& ] is_one_present = string_array_contains("1", ["2", "3", "1"]) print *, is_one_present if( .not. is_one_present ) error stop is_one_present = string_array_contains("1", ["2", "3"]) print *, is_one_present if( is_one_present ) error stop strings(1, 1) = "2" strings(1, 2) = "3" strings(2, 1) = "4" strings(2, 2) = "5" is_one_present = string_array_contains_nested("1", strings) print *, is_one_present if( is_one_present ) error stop is_five_present = string_array_contains_nested("5", strings) print *, is_five_present if( .not. is_five_present ) error stop contains logical function string_array_contains(search_string, array) character(*), intent(in) :: search_string character(*), intent(in) :: array(:) integer :: i string_array_contains = any([(array(i)==search_string, & i=1,size(array))]) end function string_array_contains logical function string_array_contains_nested(search_string, array) character(*), intent(in) :: search_string character(*), intent(in) :: array(:, :) integer :: i, j string_array_contains_nested = any([((array(i, j)==search_string, & j=1,size(array, 2)), & i=1,size(array, 1))]) end function string_array_contains_nested end program intrinsics_50 lfortran-lfortran-2f73434/integration_tests/file_29.f900000664000175000017500000000270615141516316023156 0ustar alastairalastairprogram file_29 implicit none integer :: io, stat character(len=31) :: buffer character(len=3) :: temp = "no" open(newunit=io, status="scratch") write(io, "(a)") repeat("abc", 10), repeat("def", 100), repeat("ghi", 1000) rewind(io) ! Test 1: advance="no" triggers EOR read(io, '(a)', advance="no", iostat=stat) buffer if (stat /= -2) error stop if (.not. is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 2: normal read after EOR read(io, '(a)', advance="no", iostat=stat) buffer if (stat /= 0) error stop if (is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 3: advance="yes" normal read rewind(io) read(io, '(a)', advance="yes", iostat=stat) buffer if (stat /= 0) error stop if (is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 4: variable advance mode ("no") rewind(io) read(io, '(a)', advance=temp, iostat=stat) buffer if (stat /= -2) error stop if (.not. is_iostat_eor(stat)) error stop if (is_iostat_end(stat)) error stop ! Test 5: switch temp to "yes" and continue temp = "yes" read(io, '(a)', advance=temp, iostat=stat) buffer if (stat /= 0) error stop ! Check end of file (EOF) do read(io, '(a)', iostat=stat) buffer if (stat /= 0) exit end do if (.not. is_iostat_end(stat)) error stop close(io) end program file_29 lfortran-lfortran-2f73434/integration_tests/cycle_and_exit5.f900000664000175000017500000000043215141516316024756 0ustar alastairalastairprogram cycle_and_exit5 implicit none integer :: i, j integer(8) :: s s = 0 do i = 1, 10 if( 3*(i/3) == i ) exit do j = 1, 20 s = s + i + j end do if( 2*(i/2) == i ) cycle s = 2*s end do print *, s if( s/= 710 ) error stop end program cycle_and_exit5 lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_01.f900000664000175000017500000000037315141516316026052 0ustar alastairalastairprogram main implicit none integer :: info_original contains subroutine compare_solutions(x) implicit none integer :: y real, intent(in) :: x(:) y = info_original end subroutine end program main lfortran-lfortran-2f73434/integration_tests/complex_09.f900000664000175000017500000000027415141516316023702 0ustar alastairalastairprogram complex_09 integer :: i = 42 real :: x = 3.14 complex :: z1, z2 z1 = cmplx(i, x) print *, z1, cmplx(x, kind=8) z2 = cmplx(z2, kind=8) end program complex_09lfortran-lfortran-2f73434/integration_tests/array_06_transfer.f900000664000175000017500000000110015141516316025237 0ustar alastairalastairmodule mod_array_06_transfer implicit none integer, allocatable :: val(:) contains subroutine sub( value ) character(*), intent(in) :: value allocate(val(len(value))) ! --realloc-lhs is not able to allocate val and so, adding explicit allocation val = transfer(value, val, 1 * len(value)) end subroutine sub end module program array_06_transfer use mod_array_06_transfer character(4) :: value = "1234" call sub(value) print *, val ! Currently, output of transfer using String is not matching with gfortran end program lfortran-lfortran-2f73434/integration_tests/arrays_op_28.f900000664000175000017500000000064315141516316024233 0ustar alastairalastairprogram arrays_op_28 implicit none real :: R(5), V(5), Vmid(3) R = 45 V = 23 Vmid(:3) = func(R(:4), V(:4)) print '(f10.2)', Vmid if( any(Vmid /= 1035.00) ) error stop contains function func(R, V) result(Vmid) real, intent(in) :: R(:), V(:) real :: Vmid(size(R)-1) integer :: i do i = 1, size(Vmid) Vmid(i) = R(i)*V(i) end do end function end program arrays_op_28 lfortran-lfortran-2f73434/integration_tests/defined_op_match_01.f900000664000175000017500000000146415141516316025475 0ustar alastairalastairmodule m_version_defined_op_match_01 implicit none private public :: version_t type :: version_t integer, allocatable :: num(:) contains generic :: operator(.match.) => match procedure, private :: match end type version_t contains logical function match(this, other) class(version_t), intent(in) :: this, other if (.not. allocated(this%num) .or. .not. allocated(other%num)) then match = .false. elseif (size(this%num) /= size(other%num)) then match = .false. else match = all(this%num == other%num) end if end function match end module m_version_defined_op_match_01 program defined_op_match_01 use m_version_defined_op_match_01 implicit none type(version_t) :: v1, v2 if (v1 .match. v2) error stop end program defined_op_match_01 lfortran-lfortran-2f73434/integration_tests/file_07.f900000664000175000017500000000214215141516316023144 0ustar alastairalastairprogram file_07 implicit none integer :: u = 11, i, j, k integer, allocatable :: int_arr(:, :) real, allocatable :: real_arr(:, :, :) integer :: int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height open(u, file="file_07_data.dat", form="unformatted", access="stream", status="old") read(u) int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height print *, int_arr_rows, int_arr_cols, real_arr_rows, real_arr_cols, real_arr_height allocate(int_arr(int_arr_rows, int_arr_cols), real_arr(real_arr_rows, real_arr_cols, real_arr_height)) read(u) int_arr read(u) real_arr do i = 1, int_arr_rows do j = 1, int_arr_cols print *, int_arr(i, j) end do end do print *, sum(int_arr) if (sum(int_arr) /= 5) error stop do i = 1, real_arr_rows do j = 1, real_arr_cols do k = 1, real_arr_height print *, real_arr(i, j, k) end do end do end do print *, sum(real_arr) if (abs(sum(real_arr) - 1.56999826) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/template_05.f900000664000175000017500000000273415141516316024045 0ustar alastairalastairmodule template_05_m requirement req(T, op) type, deferred :: t elemental function op(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r end function end requirement template tmp(T, plus) require :: req(T, plus) template tmp_minus(minus) require :: req(T, minus) require :: req(T, plus) template tmp_mult(mult) require :: req(T, mult) template tmp_div(div) require :: req(T, div) end template end template contains function g_minus(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r r = minus(x, y) end function end template contains function g_plus(x, y) result(r) type(T), intent(in) :: x, y type(T) :: r r = plus(x, y) end function end template end module program template_05 use template_05_m instantiate tmp(integer, operator(+)), & only: integer_plus => g_plus, integer_tmp_minus => tmp_minus instantiate integer_tmp_minus(operator(-)), & only: integer_minus => g_minus, integer_tmp_mult => tmp_mult instantiate tmp(real, operator(+)), & only: real_plus => g_plus, real_tmp_minus => tmp_minus instantiate real_tmp_minus(operator(-)), & only: real_minus => g_minus, real_tmp_mult => tmp_mult end programlfortran-lfortran-2f73434/integration_tests/array_04_transfer.f900000664000175000017500000000305615141516316025251 0ustar alastairalastairmodule array_04_transfer_mod use, intrinsic :: iso_fortran_env, only: int32, int64, real32, int8 implicit none integer(int32), parameter :: sc_constsub = int(z'deadbeef', int32) integer(int32), parameter :: int32_arr(2) = [sc_constsub, sc_constsub] real(real32), parameter :: real32_arr(2) = [real(1.23, real32), real(4.56, real32)] integer(int64), parameter :: int32_int64 = transfer(int32_arr, 0_int64) integer(int64), parameter :: real32_int64 = transfer(real32_arr, 0_int64) integer(int64), parameter :: real32_int32 = transfer(real32_arr, 0_int32) end module program array_04_transfer use array_04_transfer_mod implicit none real :: value(5) = [1.1, 1.2, 1.3, 1.4, 1.5] integer(int8) :: key(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] integer :: val(5) val = transfer(value, val, 1 * size(value)) print * , val if (all(val /= [1066192077, 1067030938, 1067869798, 1068708659, 1069547520])) error stop if (real32_int32 /= 1067282596) error stop if (real32_int64 /= 4652758847580893348_8) error stop if (int32_int64 /= -2401053088876216593_8) error stop call test_sub(key) contains subroutine test_sub(key) integer(int64), save :: bend = 1 integer(int8), intent(in), target :: key(0:) integer(int64) :: buf(0:1) buf(0:2*bend-1) = transfer( key(0:16_8*bend-1_8), 0_int64, 2*bend ) print *, buf !! TODO: fix incorrect bug value ! if (any(buf /= [578437695752307201_8, 1157159078456920585_8])) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/namelist_11.f900000664000175000017500000000374615141516316024047 0ustar alastairalastairprogram test_null implicit none ! Test null value syntax: var= (skip assignment) integer :: a, b, c real :: x, y, z namelist /nulltest/ a, b, c, x, y, z ! Initialize to known values a = 100 b = 200 c = 300 x = 1.5 y = 2.5 z = 3.5 ! Create input file with null values ! b= and y= should leave those variables unchanged open(unit=10, file='namelist_null.dat', status='replace', form='formatted') write(10, '(A)') ' &NULLTEST' write(10, '(A)') ' a=1' write(10, '(A)') ' b=' write(10, '(A)') ' c=3' write(10, '(A)') ' x=10.5' write(10, '(A)') ' y=' write(10, '(A)') ' z=30.5' write(10, '(A)') ' /' close(10) ! Read namelist with null values open(unit=10, file='namelist_null.dat', status='old', form='formatted') read(10, nml=nulltest) close(10) ! Verify a was changed to 1 if (a /= 1) then print *, "Error: a =", a, "expected 1" error stop "Null value test failed for a" end if ! Verify b was NOT changed (null value) if (b /= 200) then print *, "Error: b =", b, "expected 200 (unchanged)" error stop "Null value test failed for b" end if ! Verify c was changed to 3 if (c /= 3) then print *, "Error: c =", c, "expected 3" error stop "Null value test failed for c" end if ! Verify x was changed to 10.5 if (abs(x - 10.5) > 1.0e-5) then print *, "Error: x =", x, "expected 10.5" error stop "Null value test failed for x" end if ! Verify y was NOT changed (null value) if (abs(y - 2.5) > 1.0e-5) then print *, "Error: y =", y, "expected 2.5 (unchanged)" error stop "Null value test failed for y" end if ! Verify z was changed to 30.5 if (abs(z - 30.5) > 1.0e-5) then print *, "Error: z =", z, "expected 30.5" error stop "Null value test failed for z" end if print *, "Null value namelist test passed!" end program test_null lfortran-lfortran-2f73434/integration_tests/intrinsics_378.f900000664000175000017500000000075615141516316024516 0ustar alastairalastairprogram intrinsics_378 implicit none integer, allocatable :: a(:), b(:), c(:) allocate(a(3), b(3)) a = [1, 2, 3] call move_alloc(a, b) print *, allocated(a) print *, b if (.not. allocated(b)) error stop if (allocated(c)) error stop if (any(b /= [1, 2, 3])) error stop call move_alloc(b, c) print *, allocated(b) print *, c if (allocated(b)) error stop if (.not. allocated(c)) error stop if (any(c /= [1, 2, 3])) error stop end program intrinsics_378 lfortran-lfortran-2f73434/integration_tests/array_shape_func_call.f900000664000175000017500000000073415141516316026230 0ustar alastairalastairprogram array_shape_func_call integer :: call_count = 0 call ss(ff(f(), 20)) if (call_count /= 1) then error stop "f() called more than once" end if contains function ff(x, y) result(str) integer :: x integer :: y integer :: str(x) end function function f() result(ret) integer :: ret call_count = call_count + 1 ret = 10 end function subroutine ss(x) integer :: x(*) end subroutine end program array_shape_func_call lfortran-lfortran-2f73434/integration_tests/procedure_02.f900000664000175000017500000000113315141516316024207 0ustar alastairalastairmodule procedure_02_module implicit none abstract interface subroutine fn(n, y) integer, intent(in) :: n integer, intent(out) :: y end subroutine end interface contains integer function plus(f, x) procedure(fn) :: f integer, intent(in) :: x call f(x+4, plus) end function end module program procedure_02 use procedure_02_module, only: plus implicit none integer :: i i = plus(myf, 5) print *, i if (i /= 18) error stop contains subroutine myf(n, y) integer, intent(in) :: n integer, intent(out) :: y y = 2*n end subroutine end program lfortran-lfortran-2f73434/integration_tests/character_06.f900000664000175000017500000000040015141516316024153 0ustar alastairalastairprogram character_06 integer :: a character :: b(1) a = 1 call error_subroutine(b,a) contains subroutine error_subroutine(b, a) integer :: a, i character :: b(a) b = 'x' print *, b do i = 1, a if (b(i) /= 'x') error stop end do return end end program lfortran-lfortran-2f73434/integration_tests/arrays_90.f900000664000175000017500000000050215141516316023526 0ustar alastairalastairprogram arrays_90 integer, parameter :: offset(*) = [0, 1, 2, 3, 4] integer, parameter :: offset2(2,3) = reshape([1, 2, 3, 2, 1, 3], [2, 3]) integer :: temp(2) temp = offset(2:3) if (any(temp /= [1, 2])) error stop temp = offset2(:, 2) print *, temp if (any(temp /= [3, 2])) error stop end programlfortran-lfortran-2f73434/integration_tests/associate_27.f900000664000175000017500000000200115141516316024174 0ustar alastairalastairmodule nf_linear2d_layer implicit none private public :: linear2d_layer type :: linear2d_layer real, allocatable :: weights(:,:) real, allocatable :: biases(:) contains procedure :: get_params_ptr end type contains subroutine get_params_ptr(self, w_ptr, b_ptr) class(linear2d_layer), intent(in), target :: self real, pointer, intent(out) :: w_ptr(:), b_ptr(:) w_ptr(1:size(self%weights)) => self%weights b_ptr => self%biases end subroutine end module program associate_27 use nf_linear2d_layer implicit none type(linear2d_layer) :: layer real, pointer :: w(:), b(:) allocate(layer%weights(2,2)) allocate(layer%biases(2)) layer%weights = reshape([1.,2.,3.,4.], [2,2]) layer%biases = [5.,6.] call layer%get_params_ptr(w, b) if (.not. associated(w) .or. .not. associated(b)) error stop w(1) = -1. b(2) = -2. if (layer%weights(1,1) /= -1.) error stop if (layer%biases(2) /= -2.) error stop end program lfortran-lfortran-2f73434/integration_tests/where_02.f900000664000175000017500000000044515141516316023336 0ustar alastairalastairprogram main implicit none real a(2) real b(2) a(1) = 1.0 a(2) = 2.0 b(1) = 0.5 b(2) = 3.5 where (a > b) a = 1.5 endwhere print *, a if (abs(a(1) - 1.5) > 1e-7) error stop if (abs(a(2) - 2.0) > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_32.f900000664000175000017500000000100015141516316023663 0ustar alastairalastairmodule fpm_targets implicit none type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type build_target_t character(:), allocatable :: output_file character(:), allocatable :: version end type build_target_t contains function func() result(target_ptr) type(build_target_t), pointer :: target_ptr target_ptr => null() end function func end module fpm_targets program modules_32 implicit none print *, "running modules_32 program" end program lfortran-lfortran-2f73434/integration_tests/select_type_07.f900000664000175000017500000000335415141516316024553 0ustar alastairalastairprogram select_type_07 implicit none class(*), allocatable :: obj type :: structType integer :: code character(len=20) :: message end type structType type(structType) :: err integer :: y = 0 call print_obj(42, y) if (y /= 1) error stop call print_obj(3.14, y) if (y /= 2) error stop call print_obj("Hello", y) if (y /= 3) error stop err%code = 500 err%message = "Server Error" call print_obj(err, y) if (y /= 4) error stop contains subroutine print_obj(x, y) class(*), intent(in) :: x integer, intent(out) :: y integer :: val1 real :: val2 doubleprecision :: dbval character(len=:), allocatable :: val3 type(structType) :: val4 select type(x) type is (integer) val1 = x dbval = x print *, val1 if (val1 /= 42) error stop if (dbval /= 42.0d0) error stop y = 1 type is (real) val2 = x dbval = x print *, val2 if (val2 /= 3.14) error stop if (dbval /= 3.14) error stop y = 2 type is (character(*)) call check_char(x, y) type is (structType) val4 = x print *, val4%code print *, val4%message if (val4%code /= 500) error stop if (val4%message /= "Server Error") error stop y = 4 end select end subroutine print_obj subroutine check_char(val, y) character(len=*) :: val integer, intent(out) :: y print *, val if (val /= "Hello") error stop y = 3 end subroutine check_char end program select_type_07 lfortran-lfortran-2f73434/integration_tests/intrinsics_155.f900000664000175000017500000000443515141516316024505 0ustar alastairalastairprogram intrinsics_155 logical, parameter :: l1 = bgt(10, 5) logical, parameter :: l2 = bgt(10_8, -5_8) integer :: k1 = 10 integer :: k2 = 5 integer :: k3 = -5 integer :: k4 = 15 integer :: k5 = 0 integer :: k6 = -15 logical :: t = .true. logical, parameter :: ar1(4) = bgt([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = bgt([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, bgt(10, 5) if (bgt(10, 5) .neqv. .true.) error stop print*, bgt(-5, 10) if (bgt(-5, 10) .neqv. .true.) error stop print*, bgt(-5, 5) if (bgt(-5, 5) .neqv. .true.) error stop print*, bgt(-5, -15) if (bgt(-5, -15) .neqv. .true.) error stop print*, bgt(5, 15) if (bgt(5, 15) .neqv. .false.) error stop print*, bgt(5, -15) if (bgt(5, -15) .neqv. .false.) error stop print*, bgt(0, -5) if (bgt(0, -5) .neqv. .false.) error stop print*, bgt(0, 5) if (bgt(0, 5) .neqv. .false.) error stop print*, bgt(-5, 0) if (bgt(-5, 0) .neqv. .true.) error stop print*, bgt(5, 0) if (bgt(5, 0) .neqv. t) error stop print*, bgt(k1, k2) if (bgt(k1, k2) .neqv. .true.) error stop print*, bgt(k3, k1) if (bgt(k3, k1) .neqv. .true.) error stop print*, bgt(k3, k3) if (bgt(k3, k3) .neqv. .false.) error stop print*, bgt(k3, k6) if (bgt(k3, k6) .neqv. .true.) error stop print*, bgt(k2, k4) if (bgt(k2, k4) .neqv. .false.) error stop print*, bgt(k2, k6) if (bgt(k2, k6) .neqv. .false.) error stop print*, bgt(k5, k3) if (bgt(k5, k3) .neqv. .false.) error stop print*, bgt(k5, k2) if (bgt(k5, k2) .neqv. .false.) error stop print*, bgt(k3, k5) if (bgt(k3, k5) .neqv. .true.) error stop print*, bgt(k2, k5) if (bgt(k2, k5) .neqv. t) error stop print *, bgt(arr1, 5) if (any(bgt(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = bgt(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end programlfortran-lfortran-2f73434/integration_tests/ilp64_stop_01.f900000664000175000017500000000041115141516316024217 0ustar alastairalastairprogram ilp64_stop_01 implicit none integer :: x x = 1 ! Test error stop with literal if (x /= 1) error stop 1 ! Test stop with literal ! (only test success path - we just need the compilation to succeed) print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/associate_05.f900000664000175000017500000000065315141516316024203 0ustar alastairalastairprogram associate_05 real :: x(10), y(10), theta(10), a(10) real, allocatable :: myreal(:) allocate(myreal(10)) x = 0.42 y = 0.35 myreal = 9.1 theta = 1.5 a = 0.4 associate ( z => -(x*2 + y*2) * theta, v => myreal) v = a + z v(1) = v(1) * 4.6 v(2:5) = v(2:5) * v(2:5) v(6:10) = v(6:10) * 2.6 end associate print *, myreal end program associate_05 lfortran-lfortran-2f73434/integration_tests/cpp_pre_01.f900000664000175000017500000000060715141516316023653 0ustar alastairalastairprogram cpp_pre_01 #ifdef SOMETHING #endif // This should work # define square(a) /* This should be ignored as well */ a * a #define abc "ABC" integer :: a = 10 /* hi*/ /* This is a multi-line comment line 2*** /** line 3 */ print *, /*hi, "abc\n"*/ square(a), "hi /* abc*/ //abc" print *, "asdjfal" // "djafl" print *, abc end program lfortran-lfortran-2f73434/integration_tests/intrinsics_325.f900000664000175000017500000000045415141516316024501 0ustar alastairalastairprogram intrinsics_325 integer(8) :: d(2) = [1,2] integer(8) :: spread_(2, 2) spread_ = spread(d, dim=2, ncopies=2) print *, spread_ if (spread_(1, 1) /= 1) error stop if (spread_(1, 2) /= 1) error stop if (spread_(2, 1) /= 2) error stop if (spread_(2, 2) /= 2) error stop end program intrinsics_325 lfortran-lfortran-2f73434/integration_tests/derived_types_26.f900000664000175000017500000000314515141516316025100 0ustar alastairalastairmodule derived_types_26_fpm_error_module implicit none type :: error_t character(len=:), allocatable :: message integer :: z end type error_t contains function bad_name_error(error, label, name) type(error_t), allocatable, intent(out) :: error character(len=*), intent(in) :: label character(len=*), intent(in) :: name integer :: bad_name_error allocate(error) ! allocate(character(len=4) :: error%message) ! TODO: Should happen automatically in AST -> ASR transition error%message = label//"_"//name error%z = 20 bad_name_error = 101 end function bad_name_error subroutine bad_name_error2() !> Instance of the error data type(error_t), allocatable:: error logical :: check integer :: e check = .false. if (.not.check) then allocate(error) e = 404 error%message = 'there is an error' error%z = 10 else allocate(error) e = 0 error%message = 'there is not an error' error%z = 20 end if if (e /= 404) error stop if (error%z /= 10) error stop print *, error%message end subroutine bad_name_error2 end module derived_types_26_fpm_error_module program derived_types_26 use derived_types_26_fpm_error_module implicit none type(error_t), allocatable :: error integer :: ret ret = bad_name_error(error, "1", "x") if (ret /= 101) error stop print *, error%message if (error%z /= 20) error stop call bad_name_error2() end program lfortran-lfortran-2f73434/integration_tests/str_to_char.f900000664000175000017500000000064315141516316024232 0ustar alastairalastairprogram str_to_char implicit none character(kind=1, len=3) :: text = "hej" character(kind=1, len=*), parameter :: lowercase = "abcdefghijklmnopqrstuvwxyz" integer :: it = 1 call get_index(text(it:)) contains subroutine get_index(c) character(kind=1), intent(in) :: c if (len(c) /= 1) error stop if (index(lowercase, c) /= 8) error stop end subroutine end program str_to_char lfortran-lfortran-2f73434/integration_tests/use_02.f900000664000175000017500000000034715141516316023021 0ustar alastairalastairmodule use_02_module use iso_fortran_env, only: dp => real64 end module program use_02 use use_02_module integer(dp) :: i i = 1234567890123456789_dp if (i /= 1234567890123456789_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/string_38.f900000664000175000017500000000017115141516316023537 0ustar alastairalastair PROGRAM EXAMPLE CHARACTER(4) :: NAME NAME="XXYY" PRINT *, NAME(1:2) END PROGRAM lfortran-lfortran-2f73434/integration_tests/intrinsics_181.f900000664000175000017500000000100015141516316024465 0ustar alastairalastairprogram intrinsics_181 implicit none character(3), parameter :: s1 = repeat("a", 3) character(10), parameter :: s2 = repeat("#$", 5_8) character(len=2) :: x1 character(len=4) :: x2 x1 = "wh" x2 = "what" print *, s1 if (s1 /= "aaa") error stop print *, s2 if (s2 /= "#$#$#$#$#$") error stop print *, repeat(x1, 3) if (repeat(x1, 3) /= "whwhwh") error stop print *, "|"//repeat(x2, 3)//"|" if (repeat(x2, 3) /= "whatwhatwhat") error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_op_25.f900000664000175000017500000000013615141516316024225 0ustar alastairalastairprogram arrays_op_25 real :: b(3, 5) call random_number(b) print *, b end program lfortran-lfortran-2f73434/integration_tests/equivalence_11.f900000664000175000017500000000066615141516316024532 0ustar alastairalastair! MRE: EQUIVALENCE + DATA with double precision arrays ! Reduced from LAPACK BLAS testing (dblat1.f DATA statements) program equivalence_11 implicit none double precision :: a(4), b(4) equivalence (a(1), b(1)) data b /1.0d0, 2.0d0, 3.0d0, 4.0d0/ if (abs(a(1) - 1.0d0) > 1.0d-10) error stop if (abs(a(2) - 2.0d0) > 1.0d-10) error stop if (abs(a(4) - 4.0d0) > 1.0d-10) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/write_14.f900000664000175000017500000000134015141516316023354 0ustar alastairalastairprogram write_err_01 ! Test WRITE with ERR= label (valid in Fortran) implicit none character(100) :: buffer integer :: iostat character(256) :: iomsg ! Test basic WRITE with ERR= write(buffer, '(a, i0)', err=999, iostat=iostat, iomsg=iomsg) "Value: ", 42 if (trim(adjustl(buffer)) /= "Value: 42") error stop "Expected 'Value: 42'" if (iostat /= 0) error stop "iostat should be 0" ! Test WRITE with ERR= only (no iostat/iomsg) write(buffer, '(a)', err=999) "Hello World" if (trim(adjustl(buffer)) /= "Hello World") error stop "Expected 'Hello World'" print *, "PASS: WRITE with ERR= works correctly" stop 999 print *, "Error occurred unexpectedly" error stop 1 end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_09c.c0000664000175000017500000000006015141516316026415 0ustar alastairalastair#include int c_MPI_COMM_WORLD = 412; lfortran-lfortran-2f73434/integration_tests/interface_12.f900000664000175000017500000000052015141516316024157 0ustar alastairalastairsubroutine find_fit(expr) interface function expr() result(y) implicit none real :: y(1) end function end interface end subroutine program main implicit none call find_fit(expression) contains function expression() result(y) real :: y(1) end function end program lfortran-lfortran-2f73434/integration_tests/iso_fortran_env_01.f900000664000175000017500000000065115141516316025417 0ustar alastairalastairprogram iso_fortran_env_01 use iso_fortran_env, only: numeric_storage_size, character_storage_size, iostat_eor print *, "numeric_storage_size: ", numeric_storage_size if (numeric_storage_size /= 32) error stop print *, "character_storage_size: ", character_storage_size if (character_storage_size /= 8) error stop print *, "iostat_eor: ", iostat_eor if (iostat_eor /= -2) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_38.f900000664000175000017500000000111315141516316023527 0ustar alastairalastairpure function linspace_n_1_cdp_cdp(n) result(res) integer, intent(in) :: n complex :: res(max(n, 0)) res = (1.0, 3.0) end function linspace_n_1_cdp_cdp program arrays_38 implicit none integer :: n, i complex :: res(5) complex :: res2(0) interface pure function linspace_n_1_cdp_cdp(n) result(res) integer, intent(in) :: n complex :: res(max(n, 0)) end function linspace_n_1_cdp_cdp end interface res = linspace_n_1_cdp_cdp(5) print *, res do i = 1, 5 if (abs(res(i) - (1.0, 3.0)) > 1e-8) error stop end do res2 = linspace_n_1_cdp_cdp(-3) print *, res2 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_139.f900000664000175000017500000000523715141516316024510 0ustar alastairalastairprogram intrinsic_139 integer :: i = 17, j = 3 real :: f = 17.5_4, f2 = 5.5_4 real :: r = 17.5_8, r2 = 5.5_8 integer, parameter :: x1 = modulo(11, 2) integer(8), parameter :: x2 = modulo(11, -2) real, parameter :: x3 = modulo(11.0_4, 2.0_4) real, parameter :: x4 = modulo(11.0_8, -2.0_4) real(8), parameter :: x5 = modulo(11.0_8, 2.0_8) integer, parameter :: ar1(3) = modulo([1, 2, 3], 2) integer(8), parameter :: ar2(3) = modulo([11_8, -2_8, 31_8], 2) real, parameter :: ar3(3) = modulo([1.0, 2.0, 3.0], 2.0) real(8), parameter :: ar4(3) = modulo([1.0_8, -2.0_8, 3.0_8], 2.0_8) print *, x1 if ( x1 /= 1 ) error stop print *, x2 if ( x2 /= -1 ) error stop print *, x3 if ( abs(x3 - 1.00000000) > 1e-5 ) error stop print *, x4 if ( abs(x4 - (-1.00000000)) > 1e-5 ) error stop print *, x5 if ( abs(x5 - 1.00000000) > 1e-5 ) error stop print *, ar1 if ( any(ar1 /= [1, 0, 1]) ) error stop print *, ar2 if ( any(ar2 /= [1, 0, 1]) ) error stop print *, ar3 if ( any(abs(ar3 - [1.00000000, 0.00000000, 1.00000000]) > 1e-5) ) error stop print *, ar4 if ( any(abs(ar4 - [1.00000000, 0.00000000, 1.00000000]) > 1e-5) ) error stop print *, modulo(i,j) if ( modulo(i,j) /= 2 ) error stop print *, modulo(f,f2) if ( abs(modulo(f,f2) - 1.00000000) > 1e-5 ) error stop print *, modulo(r,f2) if ( abs(modulo(r,f2) - 1.00000000) > 1e-5 ) error stop print *, modulo(f,r2) if ( abs(modulo(f,r2) - 1.00000000) > 1e-5 ) error stop print *, modulo(-i,j) if ( modulo(-i,j) /= 1 ) error stop print *, modulo(-f,f2) if ( abs(modulo(-f,f2) - 4.50000000) > 1e-5 ) error stop print *, modulo(-r,f2) if ( abs(modulo(-r,f2) - 4.50000000) > 1e-5 ) error stop print *, modulo(-f,r2) if ( abs(modulo(-f,r2) - 4.50000000) > 1e-5 ) error stop print *, modulo(i,-j) if ( modulo(i,-j) /= -1 ) error stop print *, modulo(f,-f2) if ( abs(modulo(f,-f2) + 4.50000000 ) > 1e-5 ) error stop print *, modulo(r,-f2) if ( abs(modulo(r,-f2) + 4.50000000) > 1e-5 ) error stop print *, modulo(f,-r2) if ( abs(modulo(f,-r2) + 4.50000000) > 1e-5 ) error stop print *, modulo(-i,-j) if ( modulo(-i,-j) /= -2 ) error stop print *, modulo(-f,-f2) if ( abs(modulo(-f,-f2) + 1.00000000) > 1e-5 ) error stop print *, modulo(-r,-f2) if ( abs(modulo(-r,-f2) + 1.00000000) > 1e-5 ) error stop print *, modulo(-f,-r2) if ( abs(modulo(-f,-r2) + 1.00000000) > 1e-5 ) error stop print *, modulo(17,-3) if ( modulo(17,-3) /= -1 ) error stop print*, modulo(-17, 3) if ( modulo(-17,3) /= 1 ) error stop end program lfortran-lfortran-2f73434/integration_tests/max_02.f900000664000175000017500000000012615141516316023005 0ustar alastairalastairprogram max_02 integer(8) :: y integer :: z print *, max(y, z) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_355.f900000664000175000017500000000053415141516316024503 0ustar alastairalastairmodule timerm implicit none private public print_time contains subroutine print_time(rate) integer rate call system_clock(count_rate=rate) end subroutine print_time end module timerm program intrinsic_355 use timerm integer :: rate call print_time(rate) print *, rate if (rate /= 1000) error stop end lfortran-lfortran-2f73434/integration_tests/where_04.f900000664000175000017500000000115115141516316023333 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() implicit none real :: reldiff(2) real :: absdiff reldiff = [0.0,0.0] absdiff = 0.5 where (solution() /= 0.0) reldiff = absdiff / abs(solution()) if (abs(reldiff(1) - 5.0) > 1e-7) error stop if (abs(reldiff(2) - 5.0) > 1e-7) error stop print *, reldiff end subroutine compare_solutions pure function solution() result(x) implicit none real,dimension(:),allocatable :: x x = [0.10,0.10] end function solution end program main lfortran-lfortran-2f73434/integration_tests/line_continuation_01.f900000664000175000017500000000041015141516316025734 0ustar alastairalastairprogram line_continuation_01 implicit none integer :: i i = 5 if (i < 4) & print *, i if (i > 4) & ! This will print print *, i if (i > 4) & ! This will also print print *, i if (i > 4) & ! Yes ! This will also print print *, i end program lfortran-lfortran-2f73434/integration_tests/intrinsics_412.f900000664000175000017500000000066215141516316024477 0ustar alastairalastairprogram intrinsics_412 integer :: ii call update(ii) print *, ii if (ii /= 1) error stop contains subroutine update(return_value) integer, intent(out) :: return_value character(len=:),allocatable :: long character(len=:),allocatable,save :: shorts(:) allocate(character(len=3) :: shorts(3)) shorts = ['abc', 'def', 'ghi'] long = 'banana' return_value=maxloc([0,merge(1, 0, shorts == long)],dim=1) end subroutine update end program lfortran-lfortran-2f73434/integration_tests/test_ieee_next.f900000664000175000017500000000551115141516316024726 0ustar alastairalastair! Test ieee_next_after function (Fortran 2003 standard) program ieee_next_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_after use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(4) :: x_sp, next_sp, inf_sp real(8) :: x_dp, next_dp, inf_dp print *, "Testing ieee_next_after..." ! Test 1: ieee_next_after toward larger value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) print *, "ieee_next_after(1.0, 2.0) =", next_sp if (next_sp <= x_sp) error stop "next_after toward larger should be greater than x" ! Test 2: ieee_next_after toward smaller value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 0.0_real32) print *, "ieee_next_after(1.0, 0.0) =", next_sp if (next_sp >= x_sp) error stop "next_after toward smaller should be less than x" ! Test 3: ieee_next_after toward same value should return same value x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, x_sp) print *, "ieee_next_after(1.0, 1.0) =", next_sp if (next_sp /= x_sp) error stop "next_after(x, x) should equal x" ! Test 4: Verify inverse property x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) next_sp = ieee_next_after(next_sp, 0.0_real32) if (next_sp /= x_sp) error stop "Should be able to go forward and back" print *, "Inverse property verified for single precision" ! Test 5: From 0.0 toward positive should give smallest positive x_sp = 0.0_real32 next_sp = ieee_next_after(x_sp, 1.0_real32) print *, "ieee_next_after(0.0, 1.0) =", next_sp if (next_sp <= 0.0) error stop "Should be positive" ! Test 6: From 0.0 toward negative should give smallest negative x_sp = 0.0_real32 next_sp = ieee_next_after(x_sp, -1.0_real32) print *, "ieee_next_after(0.0, -1.0) =", next_sp if (next_sp >= 0.0) error stop "Should be negative" ! Test 7: Double precision tests x_dp = 1.0_real64 next_dp = ieee_next_after(x_dp, 2.0_real64) print *, "ieee_next_after(1.0d0, 2.0d0) =", next_dp if (next_dp <= x_dp) error stop "Should be greater" x_dp = 1.0_real64 next_dp = ieee_next_after(x_dp, 0.0_real64) print *, "ieee_next_after(1.0d0, 0.0d0) =", next_dp if (next_dp >= x_dp) error stop "Should be less" ! Test 8: Verify spacing relationship for positive x toward larger x_sp = 1.0_real32 next_sp = ieee_next_after(x_sp, 2.0_real32) print *, "Difference: next_after(1.0, 2.0) - 1.0 =", next_sp - x_sp print *, "spacing(1.0) =", spacing(x_sp) ! The difference should equal spacing(x) for positive x if (abs((next_sp - x_sp) - spacing(x_sp)) > 1e-10) then error stop "next_after - x should equal spacing(x)" end if print *, "All ieee_next_after tests passed!" end program ieee_next_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_357.f900000664000175000017500000000053615141516316024507 0ustar alastairalastairprogram intrinsics_357 implicit none integer :: m, n real :: A(3, 4) m = 3 n = 4 A = rand2(m, n) contains impure function rand2(m, n) result(x) implicit none integer, intent(in) :: m, n real :: x(max(m, 0), max(n, 0)) call random_number(harvest=x) end function rand2 end programlfortran-lfortran-2f73434/integration_tests/intrinsics_127.f900000664000175000017500000000116315141516316024477 0ustar alastairalastairprogram intrinsics_127 implicit none integer, parameter :: x1 = ifix(4.23) integer, parameter :: y1 = ifix(123.41) integer, parameter :: ar1(3) = ifix([1.0, 2.11, -31.0]) real :: arr1(3) = [1.0, 2.11, -31.0] real :: x x = 4.23 print *, x1 if (x1 /= 4) error stop print *, y1 if (y1 /= 123) error stop print *, ar1 if (any(ar1 /= [1, 2, -31])) error stop print *, ifix(arr1) if (any(ifix(arr1) /= [1, 2, -31])) error stop print *, ifix(x) if( .not. ifix(x) == 4 ) error stop print *, ifix(4.23) if (ifix(123.41) /= 123 ) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_11.f900000664000175000017500000000044015141516316026421 0ustar alastairalastairprogram separate_compilation_11 use separate_compilation_11a_module implicit none integer :: a, b a = 1 b = 2 call parent_of_nested_subroutine(a, b) print *, "a =", a if ( a /= 2 ) error stop print *, "b =", b if ( b /= 4 ) error stop end program lfortran-lfortran-2f73434/integration_tests/test_backspace_01.f900000664000175000017500000000064315141516316025176 0ustar alastairalastairprogram test_backspace_01 implicit none character(80) :: line integer :: u = 10 open(10, file='file_01_data.txt', status='old', action='read') read(u, '(A)') line write(*, '(A)') line backspace(u) read(u, '(A)') line write(*, '(A)') "Read and printed the same line again:" write(*, '(A)') line if (line /= "10130") error stop close(u) end program test_backspace_01 lfortran-lfortran-2f73434/integration_tests/types_16.f900000664000175000017500000000211115141516316023365 0ustar alastairalastairprogram types_16 implicit none integer, parameter :: dp = kind(0.d0) print *, add_floats(-2.3, 5.6) print *, get_neg_f32() print *, get_pi() print *, get_pi_64() print *, computeCircleArea(5.0_dp) contains function sqr(x) result(r) implicit none real(dp), intent(in):: x real(dp) :: r r = x * x return end function function add_floats(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y return end function function get_pi() result(r) real :: r r = 3.14 return end function function get_pi_64() result(r) real(dp) :: r r = 3.14_dp return end function function get_neg_f32() result(r) real :: r r = -2.5 return end function function computeCircleArea(radius) result(area) implicit none real(dp), intent(in):: radius real(dp) :: PI, area PI = get_pi_64() area = PI * sqr(radius) return end function end program lfortran-lfortran-2f73434/integration_tests/nested_vars_allocatable_call.f900000664000175000017500000000076415141516316027562 0ustar alastairalastairmodule nested_vars_allocatable_mod contains subroutine s(a) integer, allocatable, intent(inout) :: a(:) integer :: i do i = 1, size(a) call t(a(i)) end do contains subroutine t(x) integer, intent(inout) :: x if (size(a) > 0) x = x end subroutine end subroutine end module program nested_vars_allocatable_call use nested_vars_allocatable_mod integer, allocatable :: a(:) allocate(a(1)) a = 1 call s(a) if (a(1) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/arrayitem_02.f900000664000175000017500000000065715141516316024226 0ustar alastairalastairprogram arrayitem_02 implicit none type :: a1 integer, allocatable :: x(:) end type type :: a2 type(a1) :: y(4) end type type :: a3 type(a2) :: z(3) end type type :: a4 type(a3) :: w(2) end type type(a4) :: obj allocate(obj%w(1)%z(2)%y(3)%x(50)) print *, size(obj%w(1)%z(2)%y(3)%x) if(size(obj%w(1)%z(2)%y(3)%x) /= 50) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_17.f900000664000175000017500000000172615141516316023533 0ustar alastairalastairsubroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, intent(inout) :: b(:) integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_17 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a interface subroutine initialize_array(n, b) implicit none integer, intent(in) :: n real, intent(inout) :: b(:) end subroutine end interface print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/statement_05.f900000664000175000017500000000045515141516316024234 0ustar alastairalastairsubroutine st_fn_bug() implicit none complex :: ZA, Q, res ZA(Q) = cmplx(abs(real(Q)), abs(aimag(Q))) res = ZA(complex(1, 2)) print *, res if (res /= complex(1, 2)) error stop end subroutine st_fn_bug program statement_05 implicit none call st_fn_bug() end programlfortran-lfortran-2f73434/integration_tests/derived_types_29.f900000664000175000017500000000051015141516316025074 0ustar alastairalastairprogram derived_types_29 implicit none type t integer :: x end type t type(t) :: type_1 type_1%x = 10 call sub(type_1%x) print*,type_1%x if (type_1%x /= 4352) error stop contains subroutine sub(x) integer, intent(out) :: x x = 4352 end subroutine sub end program lfortran-lfortran-2f73434/integration_tests/intrinsics_169.f900000664000175000017500000000024115141516316024501 0ustar alastairalastairprogram intrinsics_169 implicit none integer(4) :: a a = -huge(-1) - 1 print *, mod(a, 10) if (mod(a, 10) /= -8) error stop end program lfortran-lfortran-2f73434/integration_tests/print_arr_02.f900000664000175000017500000000140715141516316024223 0ustar alastairalastairprogram print_arr_with_selectcase implicit none integer :: i, out, m integer :: x(3) = [1, 2, 3], y(3) = [4, 5, 6] integer :: x1(3) = [10, 20, 30], y1(3) = [40, 50, 50] integer, parameter :: a = 1, b = 2 i = 2 m = 45 select case(i) case (1) print *, x out = x(1) case (2) print *, y out = y(1) case (3) print *, "3" out = -1 end select if (out /= 4) error stop select case (m) case ((40 + b):) print *, x1 out = x1(1) case (:(39 - a)) print *, y1 out = y1(1) case default print *, "Invalid" out = -1 end select if (out /= 10) error stop end lfortran-lfortran-2f73434/integration_tests/complex_10.f900000664000175000017500000000024115141516316023664 0ustar alastairalastairprogram complex_10 implicit none complex(8) :: k, z k = (3, -4) z = conjg(k) print *, k, z if (abs(z - (3,4)) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_52_module1.f900000664000175000017500000000146215141516316025327 0ustar alastairalastairmodule module_52_tomlf_de use module_52_tomlf_error, only : toml_error use module_52_tomlf_type, only : toml_table implicit none interface toml_parse module procedure :: toml_parse_unit module procedure :: toml_parse_string end interface toml_parse contains subroutine toml_parse_unit(table, unit, error) type(toml_table), allocatable, intent(out) :: table integer, intent(in) :: unit type(toml_error), allocatable, intent(out), optional :: error end subroutine toml_parse_unit subroutine toml_parse_string(table, conf, error) type(toml_table), allocatable, intent(out) :: table character(len=*), intent(in), target :: conf(:) type(toml_error), allocatable, intent(out), optional :: error end subroutine toml_parse_string end module module_52_tomlf_de lfortran-lfortran-2f73434/integration_tests/dealloc_03.f900000664000175000017500000000075715141516316023636 0ustar alastairalastairprogram dealloc_03 implicit none type :: toml_value integer :: x end type class(toml_value), allocatable :: tmp allocate(tmp) tmp%x = 42 print *, "Value of x in tmp:", tmp%x call new_table(tmp) print *, "Value of x in tmp after new_table call:", tmp%x if (tmp%x /= 0) error stop contains subroutine new_table(self) class(toml_value), allocatable, intent(out) :: self allocate(self) self%x = 0 end subroutine new_table end program lfortran-lfortran-2f73434/integration_tests/doloop_13.f900000664000175000017500000000054615141516316023524 0ustar alastairalastairsubroutine check1() integer incx common /com/incx do 80 incx = 1, 2 80 continue return end subroutine subroutine stest() integer incx, i common /com/incx do 40 i = 1, 5 40 continue return end subroutine program doloop_13 integer incx common /com/incx call check1() call stest() if (incx /= 3) error stop end program lfortran-lfortran-2f73434/integration_tests/optional_08.f900000664000175000017500000000437015141516316024060 0ustar alastairalastairprogram optional_08 implicit none type :: base character(len=:), allocatable :: working_dir end type base class(base), allocatable :: obj character(len=:), allocatable :: working_dir ! --------------------------- ! Initial setup ! --------------------------- working_dir = "Hello" if (.not. allocated(working_dir)) then error stop "ERROR: working_dir not allocated after assignment" end if ! --------------------------- ! Get command-line settings ! --------------------------- call get_command_line_settings(obj) if (.not. allocated(obj)) then error stop "ERROR: obj not allocated by get_command_line_settings" end if ! --------------------------- ! Extract working directory ! --------------------------- call get_working_dir(obj, working_dir) if (.not. allocated(working_dir)) then error stop "ERROR: working_dir not allocated after get_working_dir" end if print *, "SUCCESS" print *, "working_dir =", trim(working_dir) contains subroutine get_working_dir(settings, working_dir_) class(base), optional, intent(in) :: settings character(len=:), allocatable, intent(out) :: working_dir_ ! Validate presence if (.not. present(settings)) then error stop "ERROR: settings not present in get_working_dir" end if ! Validate allocation of component if (.not. allocated(settings%working_dir)) then error stop "ERROR: settings%working_dir not allocated" end if ! Safe assignment (auto-allocates working_dir_) working_dir_ = settings%working_dir end subroutine get_working_dir subroutine get_command_line_settings(cmd_settings) class(base), allocatable, intent(out) :: cmd_settings allocate(cmd_settings) if (.not. allocated(cmd_settings)) then error stop "ERROR: failed to allocate cmd_settings" end if ! Initialize component explicitly cmd_settings%working_dir = "Hello" if (.not. allocated(cmd_settings%working_dir)) then error stop "ERROR: cmd_settings%working_dir not allocated" end if end subroutine get_command_line_settings end program lfortran-lfortran-2f73434/integration_tests/class_allocate_03.f900000664000175000017500000000170415141516316025175 0ustar alastairalastairprogram class_allocate_03 implicit none type :: base end type base type, extends(base) :: derived character(len=20), allocatable :: names(:) end type derived class(base), allocatable :: obj call get_command_line_settings(obj) select type(obj) type is(derived) if (size(obj%names) /= 2) error stop if (obj%names(1) /= 'global_name1') error stop if (obj%names(2) /= 'global_name2') error stop end select contains subroutine get_command_line_settings(cmd_settings) class(base), allocatable, intent(out) :: cmd_settings character(len=20), allocatable :: global_names(:) allocate(character(len=20) :: global_names(2)) global_names = ['global_name1', 'global_name2'] allocate(derived :: cmd_settings) cmd_settings = derived(names = global_names) end subroutine get_command_line_settings end program class_allocate_03 lfortran-lfortran-2f73434/integration_tests/class_71.f900000664000175000017500000000047015141516316023335 0ustar alastairalastair! This file checks correct type-conversions in print statements ! inside select statements program class_71 class(*), allocatable :: x allocate(x, source=42) select type (x) type is (integer) print *, x class default print *, "Unknown type" end select end program class_71lfortran-lfortran-2f73434/integration_tests/subroutines_10.f900000664000175000017500000000073415141516316024606 0ustar alastairalastairprogram subroutines_10 implicit none real :: x call subroutines_10_sub(x, 3, *100, *200) if (x < 0 .and. x > 10) error stop stop 100 print*, "Negative input value" error stop 200 print*, "Input value too large" error stop end program subroutines_10 subroutine subroutines_10_sub(x, i, *, *) real, intent(out) :: x integer, intent(in) :: i if (i<0) return 1 if (i>10) return 2 x = i end subroutine subroutines_10_sub lfortran-lfortran-2f73434/integration_tests/format_26.f900000664000175000017500000000052615141516316023522 0ustar alastairalastairsubroutine sub2(N,JA) implicit none integer,intent(in) :: N, ja(N) print "(*(1X,I0))",ja end subroutine sub2 program format_26 call sub(2,[42,666]) call sub2(2,[42,666]) contains subroutine sub(N,JA) implicit none integer,intent(in) :: N, ja(:) print "(*(1X,I0))",ja end subroutine sub end program format_26lfortran-lfortran-2f73434/integration_tests/intrinsics_336.f900000664000175000017500000000024715141516316024503 0ustar alastairalastairprogram intrinsics_336 integer, parameter :: SIMPLE_FACTORS(*) = [3,5,7,11,13,17,19,23] integer :: n n = 1 if(any(mod(n,SIMPLE_FACTORS)==0)) error stop end programlfortran-lfortran-2f73434/integration_tests/string_85.f900000664000175000017500000000124015141516316023537 0ustar alastairalastairprogram string_85 call test_func() call test_func() print *, "Passed" contains subroutine test_func() character(10), save :: ch = '0123456789' integer, save :: call_count = 0 call_count = call_count + 1 print *, "ch before: '", ch, "'" if (call_count == 1) then if (ch /= '0123456789') error stop 'First call: initial value incorrect' else if (call_count == 2) then if (ch /= '0123X56789') error stop 'Second call: value not persisted from first call' end if ch(5:5) = 'X' print *, "ch after: '", ch, "'" if (ch /= '0123X56789') error stop 'Modified value incorrect' end subroutine test_func end program lfortran-lfortran-2f73434/integration_tests/real_dp_param.f900000664000175000017500000000030215141516316024501 0ustar alastairalastairprogram real_dp_param integer, parameter :: prec1 = 4, prec2 = 8 real(prec1) :: u = 1.05 real(prec2) :: v = 1.05 real(prec2) :: zero = 0.0_4 print *, u, v, zero end programlfortran-lfortran-2f73434/integration_tests/submodule_02.f900000664000175000017500000000247615141516316024231 0ustar alastairalastair! Reference - http://fortranwiki.org/fortran/show/Submodules module stdlib_kinds_submodule_02 use iso_fortran_env, only: rkind1 => real32 use iso_fortran_env, only: int32 implicit none public rkind1, int32 end module stdlib_kinds_submodule_02 module points use :: stdlib_kinds_submodule_02, only: rkind => rkind1 implicit none type :: point real :: x, y end type point interface module function point_dist_func(a, b) result(distance) type(point), intent(in) :: a, b real(rkind) :: distance end function point_dist_func end interface interface module subroutine point_dist_subrout(a, b, distance) type(point), intent(in) :: a, b real(rkind), intent(out) :: distance end subroutine point_dist_subrout end interface end module points submodule (points) points_a contains module function point_dist_func(a, b) result(distance) type(point), intent(in) :: a, b real(rkind) :: distance distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2) end function point_dist_func module subroutine point_dist_subrout(a, b, distance) type(point), intent(in) :: a, b real(rkind), intent(out) :: distance distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2) end subroutine point_dist_subrout end submodule points_a program submodules_02 implicit none end program lfortran-lfortran-2f73434/integration_tests/warning_characterstar.f900000664000175000017500000000014315141516316026271 0ustar alastairalastairprogram warning_characterstar character*4 x character*5 y end program warning_characterstarlfortran-lfortran-2f73434/integration_tests/array_section_03.f900000664000175000017500000000066515141516316025073 0ustar alastairalastairprogram array_section_03 implicit none integer :: y(2, 3) integer :: x(2) y = reshape([6, 3, 8, 5, 2, 7], shape(y)) x = func(y(:,1)) print *, size(y(:, 1)) print *, func(y(:,1)) if(size(y(:,1)) /= 2) error stop if(x(1) /= 6 .or. x(2) /= 3) error stop contains function func(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x)) y = x end function func end program array_section_03lfortran-lfortran-2f73434/integration_tests/intrinsics_144.f900000664000175000017500000000134515141516316024500 0ustar alastairalastairprogram intrinsics_144 logical :: a(3), b(3) logical :: res a = .true. b = .false. res = dot_product(a, b) print *, res if (res) error stop res = dot_product([.true., .true., .true.], [.false., .false., .false.]) print *, res if (res) error stop res = dot_product([.true., .true., .true.], [.true., .true., .true.]) print *, res if (.not. res) error stop b = .true. res = dot_product(a, b) print *, res if (.not. res) error stop res = dot_product([.false., .false., .false.], [.false., .false., .false.]) print *, res if (res) error stop a = .false. b = .false. res = dot_product(a, b) print *, res if (res) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_129.f900000664000175000017500000000044315141516316024501 0ustar alastairalastairprogram intrinsics_129 complex(4) :: x, y(4) real(4) :: res(4) x = (1.0, 2.0) y = (3.0, 4.0) res = abs(y) print*, abs(y) print *, res if (any(abs(res - 5.0) > 1e-7)) error stop print *, abs(x) if (abs(abs(x) - 2.236068) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/class_31.f900000664000175000017500000000147515141516316023337 0ustar alastairalastairmodule class_31_test_module type :: Composed integer :: x end type Composed type :: Wrapper class(Composed), allocatable :: obj end type Wrapper contains function init(obj) result(self) type(Wrapper) :: self class(Composed), intent(in) :: obj ! needed because lfortran does not automatically allocate this allocate(self%obj) self%obj = obj end function init end module class_31_test_module program class_31 use class_31_test_module implicit none class(Composed), allocatable :: c type(Wrapper) :: t allocate(c) c%x = 42 t = init(c) print *, "value of t%obj%x: ", t%obj%x if (t%obj%x /= 42) error stop c%x = 3 ! verify deep copy print *, "value of t%obj%x: ", t%obj%x if (t%obj%x == 3) error stop end program class_31lfortran-lfortran-2f73434/integration_tests/fortran_primes_01.f900000664000175000017500000000227215141516316025255 0ustar alastairalastairmodule fortran_primes_01_module use iso_fortran_env implicit none integer, parameter :: IP = int32 ! Integer kind parameter for 32-bit integers integer, parameter :: WP = int64 ! Integer kind parameter for 64-bit integers end module fortran_primes_01_module elemental function witnesses_for_64(n) result(i) use fortran_primes_01_module implicit none integer(WP), intent(in) :: n ! Input integer with kind parameter WP integer(WP) :: i ! Output integer with kind parameter WP ! Compute the number of Miller-Rabin witnesses for n using bitwise XOR, left shift, and multiplication i = ieor(shifta(n, 32_WP), n) * int(z'45d9f3b3335b369', WP) end function witnesses_for_64 program fortran_primes_01 use fortran_primes_01_module implicit none integer(WP) :: n, i interface function witnesses_for_64(n) result(i) use fortran_primes_01_module implicit none integer(WP), intent(in) :: n integer(WP) :: i end function witnesses_for_64 end interface n = 2_WP ! Set n to 2 (with kind parameter WP) i = witnesses_for_64(n) print *, i if (i /= 629165251193693906_WP) error stop end program lfortran-lfortran-2f73434/integration_tests/file_39_test.txt0000664000175000017500000000003015141516316024423 0ustar alastairalastair1 2 3 4 5 6 lfortran-lfortran-2f73434/integration_tests/class_100.f900000664000175000017500000000165115141516316023410 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6975 ! Segfault upon compilation of select type with deferred function result module class_100_module type, abstract :: InputType contains procedure(some_method), deferred :: some_method end type InputType type, abstract :: OutputType end type OutputType abstract interface function some_method(self) result(obj) import class(InputType), intent(in) :: self class(*), allocatable :: obj end function some_method end interface contains function some_func(t) result(res) class(InputType), intent(in) :: t class(*), allocatable :: res select type( obj => t%some_method() ) class is (OutputType) res = obj end select end function some_func end module class_100_module program class_100 use class_100_module print *, "PASS" end program class_100 lfortran-lfortran-2f73434/integration_tests/class_36.f900000664000175000017500000000266115141516316023342 0ustar alastairalastairmodule class_36_module type :: SomeType integer :: x = 2 contains procedure, pass :: subroutine_pass procedure, nopass :: subroutine_nopass procedure, pass :: function_pass procedure, nopass :: function_nopass end type SomeType contains subroutine subroutine_pass(self, var) class(SomeType), intent(in) :: self real(8), intent(out) :: var print *, "var inside subroutine_pass: ", var if (var /= 16.33) error stop var = 32.33 call self%subroutine_nopass(var) end subroutine subroutine_pass subroutine subroutine_nopass(var) real(8), intent(out) :: var print *, "var inside subroutine_nopass: ", var if (var /= 32.33) error stop var = 64.33 end subroutine subroutine_nopass integer function function_pass (self) class(SomeType) :: self function_pass = self%x end function function_pass integer function function_nopass (var) integer :: var function_nopass = var end function function_nopass end module class_36_module program class_36 use class_36_module implicit none type(SomeType) :: my_var real(8) :: r r = 16.33 call my_var%subroutine_pass(r) print *, "r after subroutine call: ", r if (r /= 64.33) error stop print *, "return from function_pass: ", function_pass(my_var) print *, "return from function_nopass: ", function_nopass(42) end programlfortran-lfortran-2f73434/integration_tests/array_op_03.f900000664000175000017500000000030515141516316024034 0ustar alastairalastairprogram main implicit none real :: x(2) real(8) :: a = -1.0 x = -a if (abs(x(1) - 1) > 1e-8) error stop if (abs(x(2) - 1) > 1e-8) error stop print *, x end program main lfortran-lfortran-2f73434/integration_tests/select_type_03.f900000664000175000017500000000223515141516316024544 0ustar alastairalastairmodule class_default_select_type_user use class_default_select_type, only: toml_stat implicit none public :: toml_table, get_table type :: toml_value integer :: int real :: float end type type, extends(toml_value) :: toml_table logical :: implicit = .false. logical :: inline = .false. end type contains subroutine get_table(table, ptr, stat) class(toml_table), intent(inout) :: table type(toml_table), pointer, intent(out) :: ptr integer, intent(out), optional :: stat class(toml_value), pointer :: tmp nullify(ptr) if (associated(tmp)) then select type(tmp) type is(toml_table) ptr => tmp if (present(stat)) stat = toml_stat%success class default if (present(stat)) stat = toml_stat%fatal end select else call check_table(table) end if end subroutine get_table subroutine check_table(tab) class(toml_table), intent(out) :: tab print *, "inside check_table" end subroutine check_table end module class_default_select_type_user lfortran-lfortran-2f73434/integration_tests/file_21.f900000664000175000017500000000042715141516316023144 0ustar alastairalastairprogram file_21 implicit none integer :: j character(len=1) :: c(2) j = 11 open(j, file="file_21_data.txt") read(j, *) c close(j) print *, c(1) if (c(1) /= "a") error stop print *, c(2) if (c(2) /= "c") error stop end program file_21lfortran-lfortran-2f73434/integration_tests/parameter_04.f900000664000175000017500000000064415141516316024207 0ustar alastairalastairprogram parameter_04 implicit none integer, parameter :: l_knd = kind(.true.) integer, parameter :: sp = selected_real_kind(6) integer, parameter :: dp = selected_real_kind(14) integer, parameter :: i32 = selected_int_kind(6) integer, parameter :: i64 = selected_int_kind(12) logical(l_knd) :: l real(sp) :: r1 real(dp) :: r2 integer(i32) :: i1 integer(i64) :: i2 l = .true. print *, l_knd, sp, dp, i32, i64 end program lfortran-lfortran-2f73434/integration_tests/file_49.f900000664000175000017500000000057515141516316023162 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4647 ! Scratch file with form='unformatted' ! Exact MRE from issue body program file_49 implicit none character :: q*12 open(42, status='scratch', form='unformatted') write(42) 'Hello world!' rewind 42 read(42) q close(42) print *, q if (q /= 'Hello world!') error stop end program file_49 lfortran-lfortran-2f73434/integration_tests/intrinsics_241.f900000664000175000017500000000224215141516316024473 0ustar alastairalastairprogram intrinsics_241 logical :: a, b logical(8) :: c, d logical(8), parameter :: e = logical(.true., 8) logical(4), parameter :: f = logical(.false., 4) logical(4), parameter :: ar1(3) = logical([.true., .false., .true.], 4) a = .true. b = .false. c = .true. d = .false. print *, e if (e .neqv. .true.) error stop print *, kind(f) if (f .neqv. .false.) error stop print *, kind(logical(a, 8)) if(kind(logical(a, 8)) /= 8) error stop print *, kind(logical(b, 4)) if(kind(logical(b, 4)) /= 4) error stop print *, kind(logical(c, 8)) if(kind(logical(c, 8)) /= 8) error stop print *, kind(logical(d, 4)) if(kind(logical(d, 4)) /= 4) error stop print *, kind(logical(.true., 8)) if(kind(logical(.true., 8)) /= 8) error stop print *, kind(logical(.false., 4)) if(kind(logical(.false., 4)) /= 4) error stop print *, kind(logical(.true._8, 8)) if(kind(logical(.true._8, 8)) /= 8) error stop print *, kind(logical(.false._8, 4)) if(kind(logical(.false._8, 4)) /= 4) error stop print *, ar1 if(any(ar1 .neqv. [.true., .false., .true.])) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_02_size.f900000664000175000017500000000061215141516316024553 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) integer(8) :: size_a8 integer(8) :: size_b8 integer(4) :: size_a4 integer(4) :: size_b4 size_a4 = size(a, kind=4) size_b4 = size(b, dim=1, kind=4) size_a8 = size(a, kind=8) size_b8 = size(b, dim=1, kind=8) if( size_a4 /= 3 ) error stop if( size_b4 /= 4 ) error stop if( size_a8 /= 3_8 ) error stop if( size_b8 /= 4_8 ) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_62.f900000664000175000017500000000202115141516316024407 0ustar alastairalastairprogram intrinsics_62 implicit none type t integer :: x, y end type t integer :: x1(2), res_01(1) integer(8) :: res_02(2) integer, allocatable :: x2(:), x3(:, :) real :: y(3, 4) character(3) :: z type(t) :: type_1(1) type(t), allocatable :: type_2(:) res_01 = shape(x1) if (res_01(1) /= 2) error stop allocate(x2(3)) res_01 = shape(x2) if (res_01(1) /= 3) error stop allocate(x3(10, 11)) res_02 = shape(x3, 8) if (res_02(1) /= 10 .and. res_02(2) /= 11) error stop res_02 = shape(y, kind=8) if (res_02(1) /= 3 .and. res_02(2) /= 4) error stop res_01 = shape(type_1) if (res_01(1) /= 1) error stop ! TODO: Move type definition to global scope (ASR refactoring) ! allocate(type_2(4)) ! res_01 = shape(type_2) ! if (res_01(1) /= 4) error stop ! TODO: Support size(x), where x is rank 0 if (size(shape(z)) /= 0) error stop end program intrinsics_62 lfortran-lfortran-2f73434/integration_tests/const_array_01.f900000664000175000017500000000031615141516316024544 0ustar alastairalastairprogram const_array_01 implicit none real, parameter :: A(5) = [1.1, 3.0, 10.0, 2.1, 5.5] integer, parameter :: x(*) = [4, 9, 6, 12, 13] print *, A if (x(1) /= 4) error stop if (x(5) /= 13) error stop end lfortran-lfortran-2f73434/integration_tests/cycle_and_exit6.f900000664000175000017500000000033315141516316024757 0ustar alastairalastairprogram cycles_stuck implicit none integer :: iiter, maxit maxit = 5 do iiter = 1, maxit if ( .true. ) then cycle print *, "inside loop" end if end do print *, "End of program." end lfortran-lfortran-2f73434/integration_tests/modules_31_module1.f900000664000175000017500000000235115141516316025322 0ustar alastairalastairmodule fpm_dependency_modules_31 implicit none type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(len=:), allocatable :: proj_dir character(len=:), allocatable :: revision logical :: done = .false. logical :: update = .false. end type dependency_node_t type :: dependency_tree_t integer :: unit integer :: verbosity character(len=:), allocatable :: dep_dir integer :: ndep type(dependency_node_t), allocatable :: dep(:) character(len=:), allocatable :: cache contains generic :: update => update_dependency procedure, private :: update_dependency end type dependency_tree_t contains subroutine update_dependency(self, name, error) class(dependency_tree_t), intent(inout) :: self character(len=*), intent(in) :: name type(error_t), allocatable, intent(out) :: error end subroutine update_dependency end module fpm_dependency_modules_31 lfortran-lfortran-2f73434/integration_tests/procedure_06.f900000664000175000017500000000130715141516316024216 0ustar alastairalastairmodule procedure_06_module contains subroutine cb(a,terminate) implicit none integer, intent(in), optional :: a logical, intent(out), optional :: terminate if (present(terminate)) then print *, 'terminate = ', terminate if (terminate) error stop end if end subroutine cb end module procedure_06_module program procedure_06 use procedure_06_module logical :: terminate_var call temp(cb) contains subroutine temp(call_back) implicit none procedure(cb) :: call_back logical :: terminate_var = .false. call call_back(terminate = terminate_var) end subroutine temp end program procedure_06 lfortran-lfortran-2f73434/integration_tests/string_97.f900000664000175000017500000000035015141516316023543 0ustar alastairalastairprogram string_97 implicit none character(len=1), dimension(3) :: b print "(3(1X,A))", transfer('abc', ['x']) b = transfer('abc', b) if (any(b /= ['a','b','c'])) error stop 'Test failed' end program string_97 lfortran-lfortran-2f73434/integration_tests/program_03.f900000664000175000017500000000107115141516316023670 0ustar alastairalastairprogram closuretest ! Obtained from https://events.prace-ri.eu/event/694/attachments/627/918/advanced_fortran_handout.pdf integer :: z do z=1,10 print *, apply(add_z, 1) end do contains function apply(fun,x) result(y) !procedure(intfun) :: fun integer :: x, y interface integer function fun(x) integer :: x end function fun end interface y = fun(x) end function function add_z(x) result(y) integer :: x, y y = x + z end function end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_02.f900000664000175000017500000000071115141516316026052 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b) contains subroutine driver(fnc, arr) integer, intent(in) :: arr(3) print *, abs(-1.0) ! This loads the runtime library(bug fixed) call fnc(arr) end subroutine subroutine implicit_interface_check(arr1) integer, intent(in) :: arr1(3) if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_01.f900000664000175000017500000000041115141516316026416 0ustar alastairalastairprogram separate_compilation_01 use separate_compilation_01_module implicit none real :: x = 9124.19 call set_val(x) call get_val(x) call test_val(x) print *, "val = ", val print *, "x = ", x if (abs(val - x) > 1e-8) error stop end program separate_compilation_01 lfortran-lfortran-2f73434/integration_tests/array_indices_array_item_assignment_3.f900000664000175000017500000000065415141516316031427 0ustar alastairalastairprogram array_indices_array_item_assignment_3 implicit none type :: line integer :: first end type integer :: arr(5) = [1, 2, 3, 4, 5] integer :: shift(5) type(line) :: l_arr(5) integer :: i do i = 1, 5 l_arr(i)%first = i*10 end do shift(:) = l_arr(arr)%first - 1 if (any([9, 19, 29, 39, 49] /= shift)) error stop end program array_indices_array_item_assignment_3 lfortran-lfortran-2f73434/integration_tests/string_88.f900000664000175000017500000000077115141516316023552 0ustar alastairalastair! This program checks Len Function ! On allocation of String Arrays with size = 0 program string_88 implicit none character(len=:), allocatable :: list1(:), list2(:) character(len=23), pointer :: list3(:) !Using pointer allocation list1 = [character(len=23):: ] allocate(character(len=23) :: list2(0)) allocate(list3(0)) print *,len(list1), len(list2), len(list3) if (len(list1) /= 23) error stop if (len(list2) /= 23) error stop if (len(list3) /= 23) error stop end program string_88lfortran-lfortran-2f73434/integration_tests/intrinsics_12.f900000664000175000017500000000031615141516316024407 0ustar alastairalastairprogram intrinsics_12 print*,kind(5) ! 4 print*,kind(5_4) ! 4 print*,kind(5_8) ! 8 print*,kind(0.d0) ! 8 print*,kind(0.0) ! 4 print*,kind(5._4) ! 4 print*,kind(5._8) ! 8 print*,kind(.true.) ! 4 end program lfortran-lfortran-2f73434/integration_tests/hashmap_derived_pointer_associated.f900000664000175000017500000000421015141516316030777 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_derived_pointer_associated implicit none integer(4), parameter :: pool_size = 64 type :: open_map_entry_type integer(4) :: hash_val end type open_map_entry_type type :: open_map_entry_pool integer(4) :: next = 0 type(open_map_entry_type), allocatable :: more_map_entries(:) type(open_map_entry_pool), pointer :: lastpool => null() end type open_map_entry_pool type :: open_hashmap_type type(open_map_entry_pool), pointer :: cache => null() end type open_hashmap_type end module stdlib_hashmaps_hashmap_derived_pointer_associated module stdlib_hashmap_open_hashmap_derived_pointer_associated use stdlib_hashmaps_hashmap_derived_pointer_associated implicit none contains subroutine extend_open_map_entry_pool(pool) type(open_map_entry_pool), intent(inout), pointer :: pool type(open_map_entry_pool), pointer :: map_entry_pool_head allocate(map_entry_pool_head) allocate(map_entry_pool_head % more_map_entries(0:pool_size-1)) map_entry_pool_head % lastpool => pool pool => map_entry_pool_head pool % next = 0 end subroutine extend_open_map_entry_pool module subroutine init_open_map( map ) class(open_hashmap_type), intent(out) :: map type(open_map_entry_pool), pointer :: pool => null() call extend_open_map_entry_pool(map % cache) if (associated(map % cache)) then print *, "Pointer is Associated" else print *, "Pointer is not Associated" error stop "Pointer is not associated" end if pool => map % cache print *, pool % next end subroutine init_open_map end module stdlib_hashmap_open_hashmap_derived_pointer_associated program hashmap_derived_pointer_associated use stdlib_hashmaps_hashmap_derived_pointer_associated, only : open_hashmap_type use stdlib_hashmap_open_hashmap_derived_pointer_associated implicit none type(open_hashmap_type) :: map call init_open_map(map) end program hashmap_derived_pointer_associatedlfortran-lfortran-2f73434/integration_tests/pointer_to_cptr.f900000664000175000017500000000134215141516316025132 0ustar alastairalastairprogram pointer_to_cptr use iso_c_binding, only: c_ptr, c_loc, c_f_pointer, c_int implicit none integer, target :: arr(5) = [1, 2, 3, 4, 5] type(c_ptr) :: arr_ptr arr_ptr = c_loc(arr) call process_array(arr_ptr, size(arr)) contains subroutine process_array(ptr, n) use iso_c_binding, only: c_ptr, c_f_pointer, c_int type(c_ptr), intent(in) :: ptr integer, intent(in) :: n integer(c_int), pointer :: f_arr(:) integer :: i call c_f_pointer(ptr, f_arr, [n]) print *, "Array elements from process_array:" do i = 1, n print *, "Element", i, "=", f_arr(i) end do end subroutine process_array end program pointer_to_cptr lfortran-lfortran-2f73434/integration_tests/class_34.f900000664000175000017500000000065615141516316023342 0ustar alastairalastairprogram class_34 implicit none type :: val_type integer :: origin = 3 end type class(val_type), allocatable :: val1 allocate(val1) call sub(val1) print *, "Outside val1%origin: ", val1%origin if (val1%origin /= 5) error stop contains subroutine sub(val) type(val_type), allocatable, intent(out) :: val allocate(val) val%origin = 5 end subroutine sub end program class_34 lfortran-lfortran-2f73434/integration_tests/functions_42.f900000664000175000017500000000102615141516316024234 0ustar alastairalastairmodule functions_42_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "2" res%string_ = x%string_ end function bracket end module functions_42_mod program functions_42 use functions_42_mod implicit none type(string_t) :: lines lines%string_ = "1" lines = bracket(lines) if (lines%string_ /= "1") error stop end program functions_42 lfortran-lfortran-2f73434/integration_tests/separate_compilation_06a.f900000664000175000017500000000055715141516316026577 0ustar alastairalastairmodule separate_compilation_06a_module contains function get_midpoints(R, V) result(Vmid) real, intent(in) :: R(:), V(:) real :: Vmid(size(R)-1) integer :: i print *, sum(R), sum(V) Vmid = 0.5 * (V(1:size(R)-1) + V(2:size(R))) if ( abs(sum(R) - 4.96500000e+02 ) > 1e-8 ) error stop if ( abs(sum(V) - 5.01404822e-01 ) > 1e-8 ) error stop end function end module lfortran-lfortran-2f73434/integration_tests/cond_06.f900000664000175000017500000000102415141516316023145 0ustar alastairalastair! Test integer comparisons with mixed kinds program cond_06 implicit none integer(4) :: i4 integer(8) :: i8 integer :: count i4 = 5 i8 = 5 count = 0 if (i8 == i4) count = count + 1 if (i4 == i8) count = count + 1 if (i8 == 5) count = count + 1 if (i8 /= 10) count = count + 1 i8 = 10 i4 = 5 if (i8 > i4) count = count + 1 if (i4 < i8) count = count + 1 if (i8 >= i4) count = count + 1 if (i4 <= i8) count = count + 1 if (count /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/array_section_11.f900000664000175000017500000000107615141516316025067 0ustar alastairalastairprogram test_array_section implicit none real, allocatable :: arr(:,:) real, allocatable :: section(:,:) integer :: i, j allocate(arr(4,4)) allocate(section(2,2)) do j = 1, 4 do i = 1, 4 arr(i, j) = real(i + j * 10) end do end do section = arr(2:3, 2:3) if (abs(section(1,1) - 22.0) > 0.001) error stop 1 if (abs(section(2,1) - 23.0) > 0.001) error stop 2 if (abs(section(1,2) - 32.0) > 0.001) error stop 3 if (abs(section(2,2) - 33.0) > 0.001) error stop 4 print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/subroutines_08.f900000664000175000017500000000133315141516316024611 0ustar alastairalastairprogram main integer :: x = 10 integer :: y(1) = [20] print *, x print *, y(1) call test1(1, x) print *, x if (x /= 1) error stop call test2(2, x) print *, x if (x /= 2) error stop call test3(3, x) print *, x if (x /= 3) error stop ! call test1(2,y(1)) ! Not yet supported ! print *, y(1) ! if (y(1) /= 2) error stop end program main subroutine test1(i,a) integer, intent(in) :: i integer :: a a = i end subroutine test1 subroutine test2(i,a) integer, intent(in) :: i integer, intent(inout) :: a a = i end subroutine test2 subroutine test3(i,a) integer, intent(in) :: i integer, intent(out) :: a a = i end subroutine test3 lfortran-lfortran-2f73434/integration_tests/custom_operator_03.f900000664000175000017500000000120615141516316025446 0ustar alastairalastairmodule custom_operator_03_a implicit none public :: operator(.negation.) integer :: y interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_operator_03_a module custom_operator_03_b integer :: negation = 5 end module custom_operator_03_b program custom_operator_03 use custom_operator_03_b, only: negation use custom_operator_03_a, temp => y implicit none integer :: res, x x = 10 res = .negation. x print *, res end program custom_operator_03 lfortran-lfortran-2f73434/integration_tests/intrinsics_122.f900000664000175000017500000000503615141516316024475 0ustar alastairalastairprogram intrinsic_122 implicit none integer :: a(2,3), b(3,2), c(2), d real, allocatable :: e(:,:) integer, parameter :: x1 = rank(1) integer, parameter :: x2 = rank(4.0) integer, parameter :: x3 = rank(.false.) integer, parameter :: x4 = rank((1.0, 2.9)) integer, parameter :: x5 = rank("abc") integer, parameter :: ar1 = rank([445, 32, 12]) integer, parameter :: ar2 = rank([9.08, 0.1, 0.2]) integer, parameter :: ar3 = rank([.true., .false.]) integer, parameter :: ar4 = rank([(1.0, 2.9), (3.0, 4.0)]) integer, parameter :: ar5 = rank(["abc", "def"]) integer :: i = 789 real :: r = 120.34 character(len=3) :: s = "abc" logical :: l = .true. complex :: ci = (1.0, 2.0) integer :: arr1(4) = [11, 14, 66, 32] real :: arr2(4) = [1.0, 2.0, 3.0, 4.0] complex :: arr3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical :: arr4(4) = [.true., .false., .true., .false.] character(len=3) :: arr5(4) = ["abc", "def", "ghi", "jkl"] print *, x1 if (x1 /= 0) error stop print *, x2 if (x2 /= 0) error stop print *, x3 if (x3 /= 0) error stop print *, x4 if (x4 /= 0) error stop print *, x5 if (x5 /= 0) error stop print *, ar1 if (ar1 /= 1) error stop print *, ar2 if (ar2 /= 1) error stop print *, ar3 if (ar3 /= 1) error stop print *, ar4 if (ar4 /= 1) error stop print *, ar5 if (ar5 /= 1) error stop print *, rank(i) if (rank(i) /= 0) error stop print *, rank(r) if (rank(r) /= 0) error stop print *, rank(s) if (rank(s) /= 0) error stop print *, rank(l) if (rank(l) /= 0) error stop print *, rank(ci) if (rank(ci) /= 0) error stop print *, rank(arr1) if (rank(arr1) /= 1) error stop print *, rank(arr2) if (rank(arr2) /= 1) error stop print *, rank(arr3) if (rank(arr3) /= 1) error stop print *, rank(arr4) if (rank(arr4) /= 1) error stop print *, rank(arr5) if (rank(arr5) /= 1) error stop a = reshape([1, 2, 3, 4, 5, 6], [2, 3]) b = reshape([10, 20, 30, 40, 50, 60], [3, 2]) print*, rank(1) if ( rank(1) /= 0 ) error stop print*, rank([.true., .false.]) if ( rank([.true., .false.]) /= 1 ) error stop print*, rank(a) if ( rank(a) /= 2 ) error stop print*, rank(b) if ( rank(b) /= 2 ) error stop print*, rank(c) if ( rank(c) /= 1 ) error stop print*, rank(d) if ( rank(d) /= 0 ) error stop print*, rank(e) if ( rank(e) /= 2 ) error stop endlfortran-lfortran-2f73434/integration_tests/array_op_05.f900000664000175000017500000000035315141516316024041 0ustar alastairalastairprogram array_op_05 implicit none integer, allocatable :: i(:, :) logical :: result allocate(i(3, 2)) result = all(shape(i) == [3, 2]) print *, result if ( .not.result ) error stop end program array_op_05 lfortran-lfortran-2f73434/integration_tests/modules_07_module.f900000664000175000017500000000015315141516316025242 0ustar alastairalastairmodule modules_07_module implicit none contains subroutine b() print *, "b()" end subroutine end module lfortran-lfortran-2f73434/integration_tests/elemental_function_scalar_array_arg.f900000664000175000017500000000211115141516316031142 0ustar alastairalastairmodule mod_elemental_function_scalar_array_arg implicit none interface count module procedure count_char_char end interface contains !> Returns an integer elemental function count_char_char(string, pattern) result(res) character(len=*), intent(in) :: string character(len=*), intent(in) :: pattern integer :: res res = 1 end function count_char_char end module program elemental_function_scalar_array_arg use mod_elemental_function_scalar_array_arg implicit none character(len=128) :: string integer :: count_value1(3) integer :: count_value2(3) string = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?" print *, count_char_char(string, ["would", "chuck", "could"]) count_value1 = count_char_char(string, ["would", "chuck", "could"]) if (any(count_value1 /= [1, 1, 1])) error stop print *, count(string, ["would", "chuck", "could"]) count_value2 = count(string, ["would", "chuck", "could"]) if (any(count_value2 /= [1, 1, 1])) error stop end program lfortran-lfortran-2f73434/integration_tests/equivalence_08.f900000664000175000017500000000065215141516316024533 0ustar alastairalastairdouble precision function d1mach() integer small(2) double precision dmach(5) equivalence (dmach(1),small(1)) dmach = 1.3d0 if (small(1) /= -858993459) error stop if (small(2) /= 1073007820) error stop d1mach = 1.3d0 end function program equivalence_08 interface double precision function d1mach() end function end interface print *, d1mach() if (abs(d1mach() - 1.3d0) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_22.f900000664000175000017500000000043515141516316024011 0ustar alastairalastairprogram allocate_22 use iso_fortran_env, only: int64, int32 implicit none integer(int64) :: array_size, stat integer(int32), allocatable :: buf(:) array_size = 10 allocate( buf(0:array_size/2-1), stat=stat) if (stat /= 0) error stop end program allocate_22lfortran-lfortran-2f73434/integration_tests/array_03.f900000664000175000017500000000116715141516316023345 0ustar alastairalastairprogram array_03 integer, parameter :: RP = kind(0.0D0) integer, parameter :: IK = kind(0) real(RP) :: G(2, 2) integer(IK) :: knew real(RP):: zmat(1:1, 1:1) knew = 1 zmat = reshape([1.0_RP], [1, 1]) G = planerot(zmat(knew, [1_IK, 1])) print *, G if (any(G /= reshape([1.0_RP, -1.0_RP, 1.0_RP, 1.0_RP], [2, 2]))) error stop contains function planerot(x) result(G) real(RP), intent(in) :: x(:) real(RP) :: c, s, r real(RP) :: G(2, 2) r = 1 s = 1 c = x(1) / r G = reshape([c, -s, s, c], [2, 2]) end function end program lfortran-lfortran-2f73434/integration_tests/modules_25_module1.f900000664000175000017500000000077315141516316025333 0ustar alastairalastairmodule tomlf_de_character use tomlf_de_tokenizer_25 implicit none private public :: toml_character_tokenizer type, extends(toml_tokenizer) :: toml_character_tokenizer character(len=:), pointer :: conf contains procedure :: next_token end type toml_character_tokenizer contains subroutine next_token(de, dot_is_token) class(toml_character_tokenizer), intent(inout) :: de logical, intent(in) :: dot_is_token end subroutine next_token end module tomlf_de_character lfortran-lfortran-2f73434/integration_tests/allocate_13.f900000664000175000017500000000130215141516316024003 0ustar alastairalastairmodule allocate_13_module implicit none private public :: toml_value type :: toml_value integer, allocatable :: a(:) contains procedure :: value_proc end type toml_value contains subroutine value_proc(self) class(toml_value), intent(inout) :: self allocate(self%a(2)) deallocate(self%a) end subroutine value_proc end module allocate_13_module program allocate_13_program use allocate_13_module implicit none type(toml_value) :: tv allocate(tv%a(4)) deallocate(tv%a) if (allocated(tv%a)) error stop call tv%value_proc if (allocated(tv%a)) error stop print *, "ok" end program allocate_13_program lfortran-lfortran-2f73434/integration_tests/print_arr_01.f900000664000175000017500000000034415141516316024221 0ustar alastairalastairprogram main implicit none integer :: a(5) = [1, 2, 3, 4, 5] integer :: b = 130 b = b + 41 if (b > 1000) then print *, a error stop else print *, "Success" end if end program lfortran-lfortran-2f73434/integration_tests/intrinsics_140.f900000664000175000017500000000471415141516316024477 0ustar alastairalastairprogram intrinsics_140 implicit none integer, parameter :: wp = selected_int_kind(9) integer, parameter :: dp = selected_int_kind(18_8) integer :: k1 = 1 integer :: k2 = 2 integer :: k3 = 3 integer :: k4 = 4 integer(8) :: k5 = 5 integer(8) :: k6 = 6 integer(8) :: k7 = 7 integer(8) :: k8 = 8 integer(8) :: k9 = 9 integer(8) :: k10 = 10 integer(8) :: k11 = 11 print *, wp if (wp /= 4) error stop print *, dp if (dp /= 8) error stop print *, selected_int_kind(1) if (selected_int_kind(1) /= 1) error stop print *, selected_int_kind(2) if (selected_int_kind(2) /= 1) error stop print *, selected_int_kind(3) if (selected_int_kind(3) /= 2) error stop print *, selected_int_kind(4) if (selected_int_kind(4) /= 2) error stop print *, selected_int_kind(5) if (selected_int_kind(5) /= 4) error stop print *, selected_int_kind(6) if (selected_int_kind(6) /= 4) error stop print *, selected_int_kind(7) if (selected_int_kind(7) /= 4) error stop print *, selected_int_kind(8) if (selected_int_kind(8) /= 4) error stop print *, selected_int_kind(9) if (selected_int_kind(9) /= 4) error stop print *, selected_int_kind(10) if (selected_int_kind(10) /= 8) error stop print *, selected_int_kind(11) if (selected_int_kind(11) /= 8) error stop print *, selected_int_kind(k1) if (selected_int_kind(k1) /= 1) error stop print *, selected_int_kind(k2) if (selected_int_kind(k2) /= 1) error stop print *, selected_int_kind(k3) if (selected_int_kind(k3) /= 2) error stop print *, selected_int_kind(k4) if (selected_int_kind(k4) /= 2) error stop print *, selected_int_kind(k5) if (selected_int_kind(k5) /= 4) error stop print *, selected_int_kind(k6) if (selected_int_kind(k6) /= 4) error stop print *, selected_int_kind(k7) if (selected_int_kind(k7) /= 4) error stop print *, selected_int_kind(k8) if (selected_int_kind(k8) /= 4) error stop print *, selected_int_kind(k9) if (selected_int_kind(k9) /= 4) error stop print *, selected_int_kind(k10) if (selected_int_kind(k10) /= 8) error stop print *, selected_int_kind(k11) if (selected_int_kind(k11) /= 8) error stop print *, kind(selected_int_kind(1)) if (kind(selected_int_kind(1)) /= 4) error stop print *, kind(selected_int_kind(2_8)) if (kind(selected_int_kind(2_8)) /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/c_ptr_06.f900000664000175000017500000000074515141516316023342 0ustar alastairalastairprogram c_ptr_06 use iso_c_binding implicit none character(len=1), pointer :: fchars(:) type(c_ptr) :: cptr integer, parameter :: N = 6 character(kind=c_char), target :: cbuf(6) cbuf = [ 'H', 'E', 'L', 'L', 'O', C_NULL_CHAR ] cptr = c_loc(cbuf) call c_f_pointer(cptr, fchars, [N]) print *, "First few elements of fchars:" print *, fchars if(any(fchars /= [ 'H', 'E', 'L', 'L', 'O', C_NULL_CHAR])) error stop end program lfortran-lfortran-2f73434/integration_tests/int_03.f900000664000175000017500000000117015141516316023013 0ustar alastairalastairprogram int_03 implicit none integer, parameter :: dp = kind(0.d0) integer(8) :: ans(5) integer :: i4 integer(8) :: i8 complex(dp) :: w8 complex :: w4 ans(1) = 8524933037632333570_8 ans(2) = -1069250973542918798_8 ans(3) = -5123867065024149335_8 ans(4) = 7303655603304982073_8 ans(5) = 5108441843522503546_8 print *, ans w8 = (7.7_8, 5.0_8) i4 = w8 i8 = w8 print *, i4, i8 if (i4 /= 7) error stop if (i8 /= 7) error stop w4 = (7.7, 5.0) i4 = w4 i8 = w4 print *, i4, i8 if (i4 /= 7) error stop if (i8 /= 7) error stop end program lfortran-lfortran-2f73434/integration_tests/pointer_04.f900000664000175000017500000000062215141516316023703 0ustar alastairalastairprogram pointer_04 implicit none type :: base integer :: v end type class(base), allocatable :: x class(base), pointer :: y type(base), target :: t t%v = 42 y => t allocate(x, source=y) if (.not. allocated(x)) error stop if (x%v /= 42) error stop t%v = 100 if (y%v /= 100) error stop if (x%v /= 42) error stop end program pointer_04 lfortran-lfortran-2f73434/integration_tests/intrinsics_111.f900000664000175000017500000000037115141516316024470 0ustar alastairalastairprogram intrinsics_111 integer :: a, b, result a = 10 b = 7 if ( .not. min( a1 = a, a2 = b ) == 7 ) error stop if ( .not. min( a, a2 = b ) == 7 ) error stop if ( .not. min( a, b ) == 7 ) error stop end program intrinsics_111 lfortran-lfortran-2f73434/integration_tests/array_bound_3.f900000664000175000017500000000046215141516316024451 0ustar alastairalastairprogram array_bound_3 implicit none integer :: x(4, 3) integer :: lbound_x(2) integer :: ubound_x(2) lbound_x = lbound(x) ubound_x = ubound(x) print *, lbound_x print *, ubound_x if (sum(lbound_x) /= 2) error stop if (sum(ubound_x) /= 7) error stop end program lfortran-lfortran-2f73434/integration_tests/nan_handling_01.f900000664000175000017500000000020015141516316024630 0ustar alastairalastairprogram nan_handling_01 double precision :: b, c c = 0.0D0 b = c / 0.0D0 if (b >= 2.0D0) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_74.f900000664000175000017500000000067515141516316023540 0ustar alastairalastairmodule omp_threadprivate_mod implicit none integer :: j_start = 1 !$omp threadprivate(j_start) contains integer function get_j_start() implicit none get_j_start = j_start end function get_j_start end module omp_threadprivate_mod program openmp_74 use omp_threadprivate_mod, only: get_j_start implicit none integer :: j j = get_j_start() if (j /= 1) error stop end program openmp_74 lfortran-lfortran-2f73434/integration_tests/openmp_33.f900000664000175000017500000000235615141516316023531 0ustar alastairalastairprogram openmp_33 use omp_lib integer, parameter :: Nx = 600, Ny = 450, n_max = 255, dp=kind(0.d0) real(dp), parameter :: xcenter = -0.5_dp, ycenter = 0.0_dp, & width = 4, height = 3, dx_di = width/Nx, dy_dj = -height/Ny, & x_offset = xcenter - (Nx+1)*dx_di/2, y_offset = ycenter - (Ny+1)*dy_dj/2 real(dp) :: x, y, x_0, y_0, x_sqr, y_sqr, wtime integer :: i, j, n, image(Nx, Ny) call omp_set_num_threads(4) wtime = omp_get_wtime() !$omp parallel shared(image) private(i, j, x, y, x_0, y_0, x_sqr, y_sqr, n) !$omp do do j = 1, Ny y_0 = y_offset + dy_dj * j do i = 1, Nx x_0 = x_offset + dx_di * i x = 0; y = 0; n = 0 do x_sqr = x ** 2; y_sqr = y ** 2 if (x_sqr + y_sqr > 4 .or. n == n_max) then image(i,j) = 255-n exit end if y = y_0 + 2 * x * y x = x_0 + x_sqr - y_sqr n = n + 1 end do end do end do !$omp end do !$omp end parallel wtime = omp_get_wtime() - wtime print *, 'Time = ', wtime, "(s)" print *, sum(image) if ( sum(image) /= 59157126 ) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_56.f900000664000175000017500000000247315141516316025106 0ustar alastairalastairmodule derived_types_56_m implicit none type, abstract :: base contains procedure(base_m), deferred, pass(self) :: m procedure(base_m2), deferred, pass(self) :: m2 generic :: m_gen => m2, m end type type, extends(base) :: derived contains procedure, pass(self) :: m => derived_m procedure, pass(self) :: m2 => derived_m2 end type abstract interface subroutine base_m(self, outi) import :: base class(base) :: self integer :: outi end subroutine subroutine base_m2(self, outi, my) import :: base class(base) :: self integer :: outi integer :: my end subroutine end interface contains subroutine derived_m(self, outi) class(derived) :: self integer :: outi outi = 2 end subroutine subroutine derived_m2(self, outi, my) class(derived) :: self integer :: outi, my outi = 3 end subroutine end module program derived_types_56 use derived_types_56_m implicit none type(derived) :: d integer :: outi call d%m_gen(outi, 10) if (outi /= 3) error stop call d%m_gen(outi) if (outi /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/format_24.f900000664000175000017500000000303715141516316023520 0ustar alastairalastairprogram format_24 implicit none complex(8) :: z real(8) :: rvals(3) character(len=*), parameter :: FMT = '(*(g0.5,1x))' integer, parameter :: WP = selected_real_kind(15,307) real(WP) :: g = 1 rvals = [1.1d0, 2.2d0, 3.3d0] z = (1.23d0, -4.56d0) write(*,FMT) 'test: ', g print "(G0.17)", 1d0/3d0 ! Real division with repeating decimal print "(G0.5)", 12345.6789d0 ! Wide number, smaller precision print "(G0.17)", 0.00000001234567d0 ! Small magnitude number print "(G0.17)", 123456789012345.0d0 ! Large magnitude number print "(G0.17)", 1.234567890123456d0 ! High-precision number print "(G0.17)", -42.0d0 ! Negative real print "(G0.17)", 0.0d0 ! Zero print "(G0.17)", 42 ! Integer print "(G0.17)", -1000 ! Negative integer print "(G0.17)", .true. ! Logical true print "(G0.17)", .false. ! Logical false print "(G0.17)", "Hello G format!" ! Character string print "(G0.17)", z ! Complex number print "(3G0.17)", rvals ! Array of real numbers print "(G0.17)", 123456789012345.d+4 print "(G0.17)", -123456789012345.d+7 print "(G0.7)", 0.00001234 print "(G15.7)", 1.0 print "(G15.7)", 1.23 print "(G15.7)", 1234567.8 print "(G15.7)", 0.0001234 print "(G15.7)", 1234567.8 print "(4G15.7)", 1.0, 1.23, 1234567.8, 0.0001234 end program format_24 lfortran-lfortran-2f73434/integration_tests/test_ieee_is_negative.f900000664000175000017500000000473615141516316026255 0ustar alastairalastair! Test ieee_is_negative function program ieee_is_negative_01 use, intrinsic :: ieee_arithmetic, only: ieee_is_negative use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(4) :: x_sp, neg_zero_sp real(8) :: x_dp, neg_zero_dp print *, "Testing ieee_is_negative..." ! Test 1: Positive value x_sp = 1.0 print *, "ieee_is_negative(1.0) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "1.0 should not be negative" ! Test 2: Negative value x_sp = -1.0 print *, "ieee_is_negative(-1.0) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "-1.0 should be negative" ! Test 3: Positive zero x_sp = 0.0 print *, "ieee_is_negative(+0.0) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "+0.0 should not be negative" ! Test 4: Negative zero (critical test!) neg_zero_sp = -0.0 print *, "ieee_is_negative(-0.0) =", ieee_is_negative(neg_zero_sp) if (.not. ieee_is_negative(neg_zero_sp)) error stop "-0.0 should be negative" ! Test 5: Negative zero created by calculation neg_zero_sp = -1.0 * 0.0 print *, "ieee_is_negative(-1.0 * 0.0) =", ieee_is_negative(neg_zero_sp) if (.not. ieee_is_negative(neg_zero_sp)) error stop "Calculated -0.0 should be negative" ! Test 6: Small negative value x_sp = -1.0e-30 print *, "ieee_is_negative(-1.0e-30) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "Small negative should be negative" ! Test 7: Small positive value x_sp = 1.0e-30 print *, "ieee_is_negative(1.0e-30) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "Small positive should not be negative" ! Test 8: Double precision negative zero neg_zero_dp = -0.0d0 print *, "ieee_is_negative(-0.0d0) =", ieee_is_negative(neg_zero_dp) if (.not. ieee_is_negative(neg_zero_dp)) error stop "Double precision -0.0 should be negative" ! Test 9: Large negative value x_sp = -huge(x_sp) print *, "ieee_is_negative(-huge) =", ieee_is_negative(x_sp) if (.not. ieee_is_negative(x_sp)) error stop "-huge should be negative" ! Test 10: Large positive value x_sp = huge(x_sp) print *, "ieee_is_negative(+huge) =", ieee_is_negative(x_sp) if (ieee_is_negative(x_sp)) error stop "+huge should not be negative" print *, "All ieee_is_negative tests passed!" end program ieee_is_negative_01 lfortran-lfortran-2f73434/integration_tests/matmul_04.f900000664000175000017500000000071715141516316023527 0ustar alastairalastairprogram matmul_04 implicit none real, allocatable :: A(:,:), B(:,:), C(:,:) real :: expected allocate(A(3, 4), B(4, 2)) A = 1.0 B = 1.0 ! C is not allocated - should be auto-allocated with --realloc-lhs-arrays C = matmul(A, B) expected = 4.0 if (abs(C(1,1) - expected) > 1e-6) error stop if (abs(C(3,2) - expected) > 1e-6) error stop if (size(C, 1) /= 3) error stop if (size(C, 2) /= 2) error stop print *, "OK: matmul with auto-allocated result" end program lfortran-lfortran-2f73434/integration_tests/format_46.f900000664000175000017500000000107615141516316023525 0ustar alastairalastairprogram format_46 implicit none integer :: i, j real :: x character(8) :: string1, string2 string1 = '42' read (string1, 100) i print 100, i if (i /= 42) error stop 100 format (I3) string1 = ' 123 ' read (string1, '(I5)') j if (j /= 123) error stop print *, 'j =', j string2 = '3.14159 ' read (string2, '(F7.5)') x if (abs(x - 3.14159) > 0.0001) error stop print *, 'x =', x string1 = '-99 ' read (string1, '(I4)') i if (i /= -99) error stop print *, 'i =', i end program format_46 lfortran-lfortran-2f73434/integration_tests/arrays_96.f900000664000175000017500000000054215141516316023540 0ustar alastairalastairprogram arrays_96 integer :: arr(2) arr(1) = 1 arr(2) = 121 call ff(arr) contains subroutine ff(s) integer, dimension(0:), intent(inout) :: s ! TODO: Fix case where intent is `unspecified` print *, s(0) if(s(0) /= 1) error stop print *, s(1) if(s(1) /= 121) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/select_rank_08.f900000664000175000017500000000121515141516316024520 0ustar alastairalastairprogram select_rank_08 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(inout) :: x(..) integer, save :: a(2) = [5, 3] integer, save :: b(2, 3) = reshape([6, 5, 4, 3, 2, 1], [2, 3]) select rank(x) rank (1) x = a print *, x if (any(x /= a)) error stop rank (2) x = b print *, x if (any(x /= b)) error stop end select end subroutine check end program select_rank_08 lfortran-lfortran-2f73434/integration_tests/string_91.f900000664000175000017500000000067515141516316023547 0ustar alastairalastairprogram old_charlen character*5 string5 ! Compiles with a constant character*(5) string5const ! Constant with parens character*(2+3) string5expr ! Expression string5 = "hello" string5const = "world" string5expr = "12345" print *, string5 print *, string5const print *, string5expr if (string5 /= "hello") error stop if (string5const /= "world") error stop if (string5expr /= "12345") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_215.f900000664000175000017500000001110515141516316024472 0ustar alastairalastairprogram intrinsics_215 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: a, b, c real(dp) :: d, e, f integer :: i real(dp) :: w(19) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp), parameter :: res(19) = cosd([18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, & -88.1889782219856926_dp, -87.4387217993888584_dp, -86.8629570229495442_dp, -86.3775039053440139_dp, & -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, -83.7235599383380418_dp]) real(sp), parameter :: res_sp(19) = cosd([17.7966309_sp, 27.7443714_sp, 36.0546188_sp, & -17.7966309_sp, -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp]) expected_w = [0.94707919415432207_dp, 0.85048456776122638_dp, 0.68557712914011359_dp, & 0.94707919415432207_dp, 0.85048456776122638_dp, 0.68557712914011359_dp, 0.0000000000000000_dp, & 3.1603029890377138E-002_dp, 4.4687850642047139E-002_dp, 5.4724377477153467E-002_dp, & 6.3182370832535792E-002_dp, 7.0631207523869075E-002_dp, 7.7362936649548061E-002_dp, & 8.3551070946493652E-002_dp, 8.9308677876631062E-002_dp, 9.4714304254108886E-002_dp, & 9.9825146707179999E-002_dp, 0.10468438946844835_dp, 0.10932558657585983_dp] w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, -18.7234114226922479_dp, & -31.7355871858161613_dp, -46.7189879975828859_dp, -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, -85.5629967823348778_dp, -85.2072890476047604_dp, & -84.8761629060389708_dp, -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_x = [0.952147365_sp, 0.885033369_sp, 0.808456302_sp, & 0.952147365_sp, 0.885033369_sp, 0.808456302_sp, 0.707106769_sp, 0.707460463_sp, 0.707460463_sp, & 0.707814276_sp, 0.707814276_sp, 0.708168268_sp, 0.708168268_sp, 0.708522379_sp, & 0.708522379_sp, 0.708876729_sp, 0.708876729_sp, 0.709231317_sp, 0.709231317_sp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, cosd(w(i)) if (abs(cosd(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_x(i)) > 1e-5) error stop end do do i = 1, size(x) print *, cosd(x(i)) if (abs(cosd(x(i)) - expected_x(i)) > 1e-5) error stop end do a = 18.928_sp b = 32.627_sp c = 47.123_sp d = 18.829262783_dp e = 32.727262783_dp f = 47.223262783_dp print *, cosd(a) if (abs(cosd(a) - 0.945926964) > 1e-3) error stop print *, cosd(b) if (abs(cosd(b) - 0.842198431) > 1e-3) error stop print *, cosd(c) if (abs(cosd(c) - 0.680426717) > 1e-3) error stop print *, cosd(18.928_sp) if (abs(cosd(18.928_sp) - 0.945926964) > 1e-3) error stop print *, cosd(32.627_sp) if (abs(cosd(32.627_sp) - 0.842198431) > 1e-3) error stop print *, cosd(47.123_sp) if (abs(cosd(47.123_sp) - 0.680426717) > 1e-3) error stop print *, cosd(d) if (abs(cosd(d) - 0.94648454528292103) > 1e-3) error stop print *, cosd(e) if (abs(cosd(e) - 0.84125362666495140) > 1e-3) error stop print *, cosd(f) if (abs(cosd(f) - 0.67914334502356000) > 1e-3) error stop print *, cosd(18.829262783_dp) if (abs(cosd(18.829262783_dp) - 0.94648454528292103) > 1e-3) error stop print *, cosd(32.727262783_dp) if (abs(cosd(32.727262783_dp) - 0.84125362666495140) > 1e-3) error stop print *, cosd(47.223262783_dp) if (abs(cosd(47.223262783_dp) - 0.67914334502356000) > 1e-3) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_constructor_01.f900000664000175000017500000000204015141516316026162 0ustar alastairalastairprogram arrays_constructor_01 implicit none character(5) :: str = "Hello" integer :: i = 1, ios, j real, pointer :: dw_(:,:) type :: MyClass integer :: value end type MyClass type(MyClass) :: v1, v2, v3, arr(3) character(4), parameter :: arr1(1:2,1:2)=reshape(['a ', '1 ', 'b ', '2 '], [2,2]) integer, parameter :: lpunc = 4 character:: input(lpunc) = & [("2",i=1,lpunc)] print *, ["aaa", "aaa"] print *, [str(i+1:i+1), str(i:i)] print *, ["aaa", str(i+1:i+3), "aaa"] print *, [str(i+1:i+3), "aaa"] arr = [MyClass :: v1, v2, v3] print *, arr print*, arr1 if (any(arr1 /= reshape(['a ', '1 ', 'b ', '2 '], [2,2]))) error stop print *, input if (any(input /= ['2', '2', '2', '2'])) error stop allocate(dw_(2,3)) dw_ = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2,3]) print *, [dw_] if (all([dw_] /= [1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) error stop "Test failed" deallocate(dw_) end program arrays_constructor_01 lfortran-lfortran-2f73434/integration_tests/openmp_37.f900000664000175000017500000000114315141516316023526 0ustar alastairalastairprogram openmp_37 use omp_lib ! declare variables as required integer :: ny, nx, nk integer :: iy, ix, ik ny=3 nx=4 nk=6 !$omp parallel do private(iy, ix) do iy = 1, ny !$omp parallel do collapse(2) do ix = 1, nx do ik = 1, nk print *,"iy->", iy,"ix->", ix end do end do !$omp end parallel do !$omp parallel do do ix = 1, nx do ik = 1, nk print *,"iy->", iy,"ix->", ix end do end do !$omp end parallel do end do !$omp end parallel do end programlfortran-lfortran-2f73434/integration_tests/global_allocatable_02.f900000664000175000017500000000126515141516316026010 0ustar alastairalastair! Checking global scope of f allocatable array. module mod_test_allocatable_02 implicit none integer, allocatable, dimension(:,:) :: f end module mod_test_allocatable_02 subroutine r use mod_test_allocatable_02 implicit none logical :: ret ret = all (f(1,:) == [1,2,3,4]) if (ret .eqv. .false.) error stop deallocate(f) allocate(f(6,6)) f(2,:) = [10,10,10,10,10,10] end subroutine r program mm use mod_test_allocatable_02 implicit none logical :: ret allocate(f(4,4)) f(1,:) = [1, 2, 3, 4] print *,f call r print *,f ret = all (f(2,:) == [10,10,10,10,10,10]) if(ret .eqv. .false.) error stop end program mmlfortran-lfortran-2f73434/integration_tests/intrinsics_39.f900000664000175000017500000000111415141516316024415 0ustar alastairalastairprogram test_time_and_date character(len=8) :: date character(len=10) :: time character(len=5) :: zone integer,dimension(8) :: values ! using keyword arguments call date_and_time(date, time, zone, values) call date_and_time() call date_and_time(date=date, zone=zone) call date_and_time(time=time) call date_and_time(zone = zone) call date_and_time(zone = zone, time = time, values = values, date = date) call date_and_time(values=values) print '(a,2x,a,2x,a)', date, time, zone print '(8i5)', values end program test_time_and_datelfortran-lfortran-2f73434/integration_tests/modules_62.f900000664000175000017500000000144515141516316023703 0ustar alastairalastair! Test for modfile serialization with nested derived types and default initialization. ! This tests the fix for a bug where structure constructors in default initialization ! expressions contained direct Struct references to types from external modules that ! weren't explicitly imported. When serializing the modfile, these external Struct ! references caused assertion failures during deserialization because the symtab IDs ! weren't present in the modfile's symbol table map. program modules_62 use modules_62_parser, only: parser_config, parse implicit none type(parser_config) :: cfg integer :: val call parse(cfg, val) ! Default level is 0, default reset%style is -1 ! So val should be 0 + (-1) = -1 if (val /= -1) error stop print *, "PASSED: modules_62" end program modules_62 lfortran-lfortran-2f73434/integration_tests/openmp_12.f900000664000175000017500000000150015141516316023514 0ustar alastairalastairsubroutine initialize_array(n, b) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: b integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_12 use omp_lib integer, parameter :: n = 100000 real, dimension(n) :: a print *, a(2) call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/format_20.f900000664000175000017500000000135015141516316023510 0ustar alastairalastairprogram format_20 type :: struct character(17) :: field integer :: int end type struct type(struct) :: array(3) character(*), parameter :: title = 'Some title string: ' character(100) :: res character(100) :: expected_res = "Some title string: 1234567890 ABCDEFGHIJ Abcdefghijklmn" array(1) = struct('1234567890',1) array(2) = struct('ABCDEFGHIJ',2) array(3) = struct('Abcdefghijklmn',3) print '(a,3a15)', title, array(:)%field write(*,'(a,3a15)') title, array(:)%field write(res,'(a,3a15)') title, array(:)%field ! The rest of `res` and `expected_res` length are empty spaces (which is fine in this test). if(res /= expected_res) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_93.f900000664000175000017500000000101515141516316023531 0ustar alastairalastairprogram arrays_93 implicit none integer :: result logical :: array(5) array = [ .true., .false., .true., .false., .true.] call falseloc(array, result) print *, "Number of false elements:", result if (result /= 2) error stop contains subroutine falseloc(array, return_value) logical, intent(in) :: array(:) integer, intent(out) :: return_value integer :: loc(count(.not.(array))) return_value = size(loc) end subroutine falseloc end program arrays_93 lfortran-lfortran-2f73434/integration_tests/derived_types_38.f900000664000175000017500000000143415141516316025102 0ustar alastairalastairmodule derived_types_38_mod type :: m integer :: i end type m end module derived_types_38_mod program derived_types_38 use derived_types_38_mod ! Uncomment below test case after supporting procedure ! declaration using subroutine, inside a derived type declared ! in `program`. type :: t integer :: i ! procedure(f), nopass, pointer :: proc end type t type(m) :: m_var type(t) :: t_var m_var%i = 1 t_var%i = 2 call f() call g() ! t_var%proc => g ! call t_var%proc() print *, t_var%i if (t_var%i /= 3) error stop contains subroutine f() print *, m_var if (m_var%i /= 1) error stop end subroutine f subroutine g() t_var%i = t_var%i + 1 end subroutine g end program derived_types_38 lfortran-lfortran-2f73434/integration_tests/template_matrix.f900000664000175000017500000001121615141516316025120 0ustar alastairalastairmodule matrix_m use monoid_m, only: derive_extended_monoid use semiring_m, only: semiring use unit_ring_m, only: unit_ring_only_minus, derive_unit_ring_from_minus use field_m, only: field_only_division implicit none private public :: matrix_tmpl template matrix_tmpl(T, plus_t, zero_t, times_t, one_t, n) require :: semiring(T, plus_t, zero_t, times_t, one_t) instantiate derive_extended_monoid(T, plus_t, zero_t), only: sum => mconcat integer :: n private public :: & matrix, & plus_matrix, & times_matrix, & zero, & one, & matrix_subtraction_tmpl type :: matrix type(T) :: elements(n, n) end type interface operator(+) procedure :: plus_matrix end interface interface operator(*) procedure times_matrix end interface template matrix_subtraction_tmpl(minus_t) require :: unit_ring_only_minus(T, plus_t, zero_t, times_t, one_t, minus_t) private public :: operator(-), gaussian_solver_tmpl interface operator(-) procedure minus_matrix end interface template gaussian_solver_tmpl(div_t) instantiate derive_unit_ring_from_minus(T, plus_t, zero_t, times_t, one_t, minus_t), only: negate require :: field_only_division(T, plus_t, zero_t, times_t, one_t, minus_t, negate, div_t) private contains elemental function div_matrix(x, y) result(quotient) type(matrix), intent(in) :: x, y type(matrix) :: quotient quotient = back_substitute(row_eschelon(x), y) end function pure function row_eschelon(x) result(reduced) type(matrix), intent(in) :: x type(matrix) :: reduced integer :: i, ii, j type(T) :: r reduced = x do i = 1, n ! Assume pivot m(i,i) is not zero do ii = i+1, n r = div_t(reduced%elements(i,i), reduced%elements(ii,i)) reduced%elements(ii, i) = zero_t() do j = i+1, n reduced%elements(ii, j) = minus_t(reduced%elements(ii, j), times_t(reduced%elements(i, j), r)) end do end do end do end function pure function back_substitute(x, y) result(solved) type(matrix), intent(in) :: x, y type(matrix) :: solved integer :: i, j type(T) :: tmp(n) solved = y do i = n, 1, -1 tmp = zero_t() do j = i+1, n tmp = plus_t(tmp, times_t(x%elements(i,j), solved%elements(:,j))) end do solved%elements(:,i) = div_t(minus_t(solved%elements(:, i), tmp), x%elements(i,i)) end do end function end template contains elemental function minus_matrix(x, y) result(difference) type(matrix), intent(in) :: x, y type(matrix) :: difference difference%elements = minus_t(x%elements, y%elements) end function end template contains elemental function plus_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined combined%elements = plus_t(x%elements, y%elements) end function pure function zero() type(matrix) :: zero zero%elements = zero_t() end function elemental function times_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j, k type(T) :: dot do i = 1, n do j = 1, n combined%elements(i, j) = sum(times_t(x%elements(i,:), y%elements(:,j))) end do end do end function pure function one() type(matrix) :: one integer :: i one%elements = zero_t() do concurrent (i = 1:n) one%elements(i, i) = one_t() end do end function end template end module lfortran-lfortran-2f73434/integration_tests/namelist_16.f900000664000175000017500000000435515141516316024051 0ustar alastairalastairprogram test_allocatable_arrays implicit none integer, allocatable :: act_name(:) real, allocatable :: values(:) logical :: temp_log integer :: i namelist /alloc_nml/ act_name, values, temp_log ! Allocate arrays allocate(act_name(3)) allocate(values(4)) ! Initialize act_name = [10, 20, 30] values = [1.5, 2.5, 3.5, 4.5] temp_log = .true. ! Write to file open(unit=10, file='namelist_alloc.dat', status='replace', form='formatted') write(10, nml=alloc_nml) close(10) ! Reset values act_name = 0 values = 0.0 temp_log = .false. ! Read from file open(unit=10, file='namelist_alloc.dat', status='old', form='formatted') read(10, nml=alloc_nml) close(10) ! Verify act_name if (act_name(1) /= 10) then print *, "Error: act_name(1) =", act_name(1), "expected 10" error stop "Test failed for act_name(1)" end if if (act_name(2) /= 20) then print *, "Error: act_name(2) =", act_name(2), "expected 20" error stop "Test failed for act_name(2)" end if if (act_name(3) /= 30) then print *, "Error: act_name(3) =", act_name(3), "expected 30" error stop "Test failed for act_name(3)" end if ! Verify values if (abs(values(1) - 1.5) > 1.0e-5) then print *, "Error: values(1) =", values(1), "expected 1.5" error stop "Test failed for values(1)" end if if (abs(values(2) - 2.5) > 1.0e-5) then print *, "Error: values(2) =", values(2), "expected 2.5" error stop "Test failed for values(2)" end if if (abs(values(3) - 3.5) > 1.0e-5) then print *, "Error: values(3) =", values(3), "expected 3.5" error stop "Test failed for values(3)" end if if (abs(values(4) - 4.5) > 1.0e-5) then print *, "Error: values(4) =", values(4), "expected 4.5" error stop "Test failed for values(4)" end if ! Verify logical if (.not. temp_log) then print *, "Error: temp_log =", temp_log, "expected .true." error stop "Test failed for temp_log" end if print *, "Allocatable array namelist test passed!" ! Clean up deallocate(act_name) deallocate(values) end program test_allocatable_arrays lfortran-lfortran-2f73434/integration_tests/int_dp_param.f900000664000175000017500000000025515141516316024357 0ustar alastairalastairprogram int_dp_param integer, parameter :: prec1 = 4, prec2 = 8 integer(prec1) :: u = 2147483647 integer(prec2) :: v = 2147483647 print *, u, v end programlfortran-lfortran-2f73434/integration_tests/intrinsics_265.f900000664000175000017500000000607115141516316024505 0ustar alastairalastairprogram intrinsics_265 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = cos(1.0_sp) real(dp), parameter :: a2 = cos(1.0_dp) complex(sp), parameter :: a3 = cos((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = cos((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = cos([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = cos([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = cos([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = cos([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 0.540302277_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 0.54030230586813977_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (1.27101231_sp, -1.79172683_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (1.2710123394623098_dp, -1.7917268800098574_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.540302277_sp, 0.0707372017_sp, -0.416146845_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [0.54030230586813977_dp, 0.070737201667702906_dp, -0.41614683654714241_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(1.27101231_sp, -1.79172683_sp), (-2.55193281_sp, -5.50143528_sp), & (-16.4069729_sp, -2.33449578_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(1.2710123394623098_dp, -1.7917268800098574_dp), (-2.5519328677533650_dp, -5.5014353663786872_dp), & (-16.406972071821489_dp, -2.3344956961624304_dp)]) > 1e-12_dp)) error stop print *, cos(b1) if (abs(cos(b1) - 0.877582550_sp) > 1e-6_sp) error stop print *, cos(b2) if (abs(cos(b2) - 0.76484218728448850_dp) > 1e-12_dp) error stop print *, cos(b3) if (abs(cos(b3) - (1.10151446_sp, -0.363684386_sp)) > 1e-6_sp) error stop print *, cos(b4) if (abs(cos(b4) - (1.1015144315669947_dp, -0.36368439983078843_dp)) > 1e-12_dp) error stop print *, cos(br1) if (any(abs(cos(br1) - [0.877582550_sp, 0.764842212_sp, 0.621609986_sp]) > 1e-6_sp)) error stop print *, cos(br2) if (any(abs(cos(br2) - [0.87758256189037276_dp, 0.76484218728448850_dp, 0.62160996827066439_dp]) > 1e-12_dp)) error stop print *, cos(bc1) if (any(abs(cos(bc1) - [(1.10151446_sp, -0.363684386_sp), (1.03716779_sp, -1.04624867_sp), & (0.629266918_sp, -2.05168462_sp)]) > 1e-6_sp)) error stop print *, cos(bc2) if (any(abs(cos(bc2) - [(1.1015144315669947_dp, -0.36368439983078843_dp), (1.0371677653004676_dp, & -1.0462486051241380_dp), (0.62926681652278482_dp, -2.0516846479972717_dp)]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/sum_01.f900000664000175000017500000000226115141516316023025 0ustar alastairalastairprogram test_sum integer :: x(5, 10), i, j, xsum, xsum1(10), correct1(10), correct2(10) logical :: modx(5, 10) correct1 = (/20, 25, 30, 35, 40, 45, 50, 55, 60, 65/) correct2 = (/8, 15, 12, 21, 16, 27, 20, 33, 24, 39/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xsum = sum(x) print *, xsum if( xsum /= 425 ) error stop xsum = sum(x, mask=modx) print *, xsum if( xsum /= 215 ) error stop xsum1 = sum(x, 1) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct1(i) ) error stop end do xsum1 = sum(x, 1, mask=modx) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct2(i) ) error stop end do xsum1 = sum(x, dim=1) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct1(i) ) error stop end do xsum1 = sum(x, dim=1, mask=modx) print *, xsum1 do i = lbound(xsum1, 1), ubound(xsum1, 1) if( xsum1(i) /= correct2(i) ) error stop end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_89.f900000664000175000017500000000023515141516316024425 0ustar alastairalastair! gh2941 program intrinsics_89 implicit none integer :: x x = (2+3)*5 print *, x, sin(0.5) if (abs(sin(0.5) - 0.479425550) > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_299.f900000664000175000017500000000011115141516316024501 0ustar alastairalastairprogram intrinsics_299 print *, command_argument_count() end program lfortran-lfortran-2f73434/integration_tests/block_08.f900000664000175000017500000000102115141516316023313 0ustar alastairalastairfunction diff_1_int32(n_) result(y) integer, allocatable :: y(:) integer :: size_work integer, intent(in) :: n_ if (n_ <= 0) return allocate(y(n_)) block integer :: work(size_work) y = 13 end block end function diff_1_int32 program block_08 integer, allocatable :: x(:) interface function diff_1_int32(n_) result(y) integer, allocatable :: y(:) integer, intent(in) :: n_ end function diff_1_int32 end interface allocate(x(10)) x = diff_1_int32(10) print *, x if (any(x /= 13)) error stop end program lfortran-lfortran-2f73434/integration_tests/struct_type_03.f900000664000175000017500000000032315141516316024605 0ustar alastairalastairprogram struct_type_03 type :: struct real :: field = 5.0 end type struct type(struct) :: array(3) write(*,*) sum(array(:)%field) if (sum(array(:)%field) /= 15.0) error stop end programlfortran-lfortran-2f73434/integration_tests/save_05.f900000664000175000017500000000063115141516316023162 0ustar alastairalastairsubroutine f(i) implicit none integer, save :: small integer, intent(in) :: i if (i == 1) then small = 12 else if (i == 2) then if (small /= 12) error stop end if print *, small end subroutine subroutine g(i) implicit none integer :: big integer, intent(in) :: i if (i == 1) then big = 6 end if print *, big end subroutine program save_05 implicit none call f(1) call g(1) call f(2) end program lfortran-lfortran-2f73434/integration_tests/matmul_02.f900000664000175000017500000001537315141516316023531 0ustar alastairalastair! This test is testing the code from: ! https://github.com/lfortran/lfortran/issues/2444 module cpu_matmul_02 implicit none contains subroutine matmul1(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: n integer :: i, j, k n = size(A, 1) C = 0 do j = 1, n do k = 1, n do i = 1, n C(i,j) = C(i,j) + A(i,k)*B(k,j) end do end do end do end subroutine subroutine kernel6(A, B, C, x, y, i1, s1) real, intent(in) :: A(0:,0:), B(0:,0:) real, intent(out) :: C(0:,0:) integer, intent(in) :: x, y, i1, s1 integer :: k real :: u(0:6-1,0:16-1) ! SIMD real, dimension(0:8-1) :: A0, A1, A2, A3, A4, A5 ! SIMD ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) u(0,0*8:0*8+8-1) = C(x+0,y+0*8:y+0*8+8-1) u(0,1*8:1*8+8-1) = C(x+0,y+1*8:y+1*8+8-1) u(1,0*8:0*8+8-1) = C(x+1,y+0*8:y+0*8+8-1) u(1,1*8:1*8+8-1) = C(x+1,y+1*8:y+1*8+8-1) u(2,0*8:0*8+8-1) = C(x+2,y+0*8:y+0*8+8-1) u(2,1*8:1*8+8-1) = C(x+2,y+1*8:y+1*8+8-1) u(3,0*8:0*8+8-1) = C(x+3,y+0*8:y+0*8+8-1) u(3,1*8:1*8+8-1) = C(x+3,y+1*8:y+1*8+8-1) u(4,0*8:0*8+8-1) = C(x+4,y+0*8:y+0*8+8-1) u(4,1*8:1*8+8-1) = C(x+4,y+1*8:y+1*8+8-1) u(5,0*8:0*8+8-1) = C(x+5,y+0*8:y+0*8+8-1) u(5,1*8:1*8+8-1) = C(x+5,y+1*8:y+1*8+8-1) do k = i1, i1+s1-1 A0(:) = A(x+0,k) u(0, 0*8:0*8+8-1) = u(0, 0*8:0*8+8-1) + & A0(:) * B(k, y+0*8:y+0*8+8-1) u(0, 1*8:1*8+8-1) = u(0, 1*8:1*8+8-1) + & A0(:) * B(k, y+1*8:y+1*8+8-1) A1(:) = A(x+1,k) u(1, 0*8:0*8+8-1) = u(1, 0*8:0*8+8-1) + & A1(:) * B(k, y+0*8:y+0*8+8-1) u(1, 1*8:1*8+8-1) = u(1, 1*8:1*8+8-1) + & A1(:) * B(k, y+1*8:y+1*8+8-1) A2(:) = A(x+2,k) u(2, 0*8:0*8+8-1) = u(2, 0*8:0*8+8-1) + & A2(:) * B(k, y+0*8:y+0*8+8-1) u(2, 1*8:1*8+8-1) = u(2, 1*8:1*8+8-1) + & A2(:) * B(k, y+1*8:y+1*8+8-1) A3(:) = A(x+3,k) u(3, 0*8:0*8+8-1) = u(3, 0*8:0*8+8-1) + & A3(:) * B(k, y+0*8:y+0*8+8-1) u(3, 1*8:1*8+8-1) = u(3, 1*8:1*8+8-1) + & A3(:) * B(k, y+1*8:y+1*8+8-1) A4(:) = A(x+4,k) u(4, 0*8:0*8+8-1) = u(4, 0*8:0*8+8-1) + & A4(:) * B(k, y+0*8:y+0*8+8-1) u(4, 1*8:1*8+8-1) = u(4, 1*8:1*8+8-1) + & A4(:) * B(k, y+1*8:y+1*8+8-1) A5(:) = A(x+5,k) u(5, 0*8:0*8+8-1) = u(5, 0*8:0*8+8-1) + & A5(:) * B(k, y+0*8:y+0*8+8-1) u(5, 1*8:1*8+8-1) = u(5, 1*8:1*8+8-1) + & A5(:) * B(k, y+1*8:y+1*8+8-1) end do C(x+0,y+0*8:y+0*8+8-1) = u(0,0*8:0*8+8-1) C(x+0,y+1*8:y+1*8+8-1) = u(0,1*8:1*8+8-1) C(x+1,y+0*8:y+0*8+8-1) = u(1,0*8:0*8+8-1) C(x+1,y+1*8:y+1*8+8-1) = u(1,1*8:1*8+8-1) C(x+2,y+0*8:y+0*8+8-1) = u(2,0*8:0*8+8-1) C(x+2,y+1*8:y+1*8+8-1) = u(2,1*8:1*8+8-1) C(x+3,y+0*8:y+0*8+8-1) = u(3,0*8:0*8+8-1) C(x+3,y+1*8:y+1*8+8-1) = u(3,1*8:1*8+8-1) C(x+4,y+0*8:y+0*8+8-1) = u(4,0*8:0*8+8-1) C(x+4,y+1*8:y+1*8+8-1) = u(4,1*8:1*8+8-1) C(x+5,y+0*8:y+0*8+8-1) = u(5,0*8:0*8+8-1) C(x+5,y+1*8:y+1*8+8-1) = u(5,1*8:1*8+8-1) end subroutine subroutine kernel7(A, B, C, x, y, i1, s1) real, intent(in) :: A(0:,0:), B(0:,0:) real, intent(out) :: C(0:,0:) integer, intent(in) :: x, y, i1, s1 integer :: i, j, k real :: u(0:6-1,0:16-1) ! SIMD real :: Ai(0:8-1) ! SIMD ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) do i = 0, 6-1 do j = 0, 2-1 u(i,j*8:j*8+8-1) = C(x+i,y+j*8:y+j*8+8-1) end do end do do k = i1, i1+s1-1 do i = 0, 6-1 Ai(:) = A(x+i,k) do j = 0, 2-1 u(i, j*8:j*8+8-1) = u(i, j*8:j*8+8-1) + & Ai(:) * B(k, y+j*8:y+j*8+8-1) end do end do end do do i = 0, 6-1 do j = 0, 2-1 C(x+i,y+j*8:y+j*8+8-1) = u(i,j*8:j*8+8-1) end do end do end subroutine subroutine matmul7(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: s1, s2, s3, n integer :: i1, i2, i3, x, y n = size(A, 1) ! Use the commented out numbers for a good benchmark s3 = 48 ! 64 s2 = 12 ! 120 s1 = 24 ! 240 C = 0 do i3 = 0, n-1, s3 do i2 = 0, n-1, s2 do i1 = 0, n-1, s1 do x = i2, i2+s2-1, 6 do y = i3, i3+s3-1, 16 call kernel6(A, B, C, x, y, i1, s1) end do end do end do end do end do end subroutine end module program main use cpu_matmul_02, only: matmul1, matmul7 implicit none integer, parameter :: dp = kind(0.d0) integer :: n, iter, i real(dp) :: t1, t2, t, GHz, fma_clock, freq, measured, percent_peak real, allocatable :: A(:,:), B(:,:), C(:,:), C2(:,:) real :: err ! Use n=960 for a good benchmark n = 96 iter = 1 print *, "Size (n x n): n =", n print *, "Iter =", iter print *, "Size MB:", 4._dp*n*n/1024**2 allocate(A(n,n), B(n,n), C(n,n), C2(n,n)) call random_number(A) call random_number(B) print *, "Fortran intrinsic matmul:" call cpu_time(t1) do i = 1, iter C = matmul(A, B) end do call cpu_time(t2) t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" print * print *, "matmul7:" call cpu_time(t1) do i = 1, iter call matmul7(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-4) error stop print * print *, "matmul1:" call cpu_time(t1) do i = 1, iter call matmul1(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-4) error stop end program lfortran-lfortran-2f73434/integration_tests/string_84.f900000664000175000017500000000053215141516316023541 0ustar alastairalastairprogram string_84 implicit none character(len=:), pointer :: str character(5), target :: temp_str temp_str = "Hello" str => temp_str str(2:2) = "?" print *, temp_str if(temp_str /= "H?llo") error stop if(.not. associated(str)) error stop nullify(str) if(associated(str)) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_12.f900000664000175000017500000000044015141516316026422 0ustar alastairalastairprogram separate_compilation_12 use separate_compilation_12a_module implicit none integer :: a, b a = 1 b = 2 call parent_of_nested_subroutine(a, b) print *, "a =", a if ( a /= 2 ) error stop print *, "b =", b if ( b /= 4 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_293.f900000664000175000017500000000221715141516316024504 0ustar alastairalastairprogram intrinsics_293 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: a integer :: i real(dp) :: dgamma_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(dp) :: dgamma_res_dp(3) real(dp) :: expected_dp(3) = [1.0896523574228969_dp, 2.8783551043979587_dp, 1.0675143148681314_dp] real(dp), parameter :: res(3) = dgamma([0.875_dp, 3.367_dp, 2.140_dp]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do dgamma_res_dp = dgamma(dgamma_runtime_dp) do i = 1, 3 print *, dgamma_res_dp(i) if (abs(dgamma_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do a = dgamma(10.92839272_dp) print *, a if (a - 3067135.1568285478_dp > 1e-12_dp) error stop print *,dgamma(10.92839272_dp) if (dgamma(10.92839272_dp) - 3067135.1568285478_dp > 1e-12_dp) error stop a = dgamma(83.728927_dp) print *, a ! if (abs(a - 1.1895370148607565E+124_dp) > 1e-12_dp) error stop print *,dgamma(83.728927_dp) ! if (abs(dgamma(83.728927_dp) - 1.1895370148607565E+124_dp) > 1e-12_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_33.f900000664000175000017500000000103615141516316023526 0ustar alastairalastairprogram arrays_33 implicit none type d real(8), dimension(:), pointer :: r end type type(d) :: objd real(8), target :: array(10) array = 24.0 call f(array, objd) objd%r => array ! TODO: Remove array = 25.0 print *, objd%r if( any(objd%r /= 25.0) ) error stop contains subroutine f(array, objd) real(8), intent(out), target :: array(:) type(d), intent(out) :: objd real(8), target :: array1(size(array)) objd%r => array1 array1 = array if( any(objd%r /= 24.0) ) error stop ! objd%r => array TODO: Uncomment end subroutine end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_03.f900000664000175000017500000000136715141516316026060 0ustar alastairalastairprogram main implicit none integer :: x1(20) call find_fit(expression) call ub_proc(x1) contains real function expression(x) result(y) real, intent(in) :: x(3) y = x(1) + x(2) + x(3) end function expression subroutine ub_proc (x) integer, intent(in) :: x(0:) integer :: temp (0:ubound (x, 1)) if (lbound(x,1) /= 0 .or. ubound(x,1) /= 19 ) error stop if (lbound(temp,1) /= 0 .or. ubound(temp, 1) /= 19) error stop end subroutine subroutine find_fit(expr) real :: x(3) real :: y interface real function expr(x) result(y) real, intent(in) :: x(3) end function expr end interface x(1) = 1.0 x(2) = 2.0 x(3) = 3.0 y = expr(x) if (abs(y - 6.0) > 1e-7) error stop print *, y end subroutine find_fit end program main lfortran-lfortran-2f73434/integration_tests/line_continuation_02.f900000664000175000017500000000242015141516316025740 0ustar alastairalastairprogram line_continuation_02 implicit none ! Here are the rules for & based on the § 6.3.2.4 ("Free form statement ! continuation") in Fortran 2018 standard. ! The & character in a comment has no effect ! The & character can be used to continue a line like this: integer & :: j ! If it is used between tokens, then one can, but does not have to put another & ! on the next line: integer & &:: k ! If & is used to continue the line in the middle of a token, one must put ! another & at the next line: inte& &ger :: i i = 5 pr& &i& &nt *, i ! One can continue strings also by treating them as tokens: print *, "some string & &is continued" ! Unless the & is at the end of the line, it can be used as a regular ! character in a string: print *, "some string can contain & as a regular character & &is continued" print *, "Even here: && && <- there will be two &" ! One can put arbitrary comments and empty lines after & that will be skipped: print *, & i print *, & ! comment 1 ! comment 2 ! comment 3 i print *, & ! comment 1 ! comment 2 ! comment 3 &i ! In strings the comment cannot be after the first &, but it can be on ! subsequent lines: print *, "some string & ! comment 2 ! comment 3 &is continued" end program lfortran-lfortran-2f73434/integration_tests/mangle_underscore_01.f900000664000175000017500000000050615141516316025715 0ustar alastairalastairsubroutine add(x, y) real :: x, y print *, x + y if (abs(x + y - 0.7) > 1e-7) error stop end subroutine subroutine sub(x,y) real :: x, y print *, x - y if (abs(x - y - (-4.5)) > 1e-7) error stop end subroutine program mangle_underscore_01 call add(-1.9, 2.6) call sub(-1.9, 2.6) end program lfortran-lfortran-2f73434/integration_tests/print_arr_03.f900000664000175000017500000000210115141516316024214 0ustar alastairalastairprogram main implicit none ! print *, [4, 9] ! print *, [[2, -2, 5, 7, [8, -9, [10]]], [3, 3], [-11]] call f() contains subroutine f() integer, allocatable :: a(:, :) real :: b(2, 2) integer :: i, j allocate(a(5, 10)) do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = i + j end do end do b(1, 1) = 1.1 b(1, 2) = -1.2 b(2, 1) = 2.1 b(2, 2) = -2.2 print *, [[1, a, 2, 3], a, 5, [abs(-2)]] print *, "hello", ["hey", ["xyz", ["abc"]]], [[1, a, 2, 3], a, 5, [abs(-2)]], "bye" print *, [ 2.1, [3.14, [-5.11, [abs(-21.22), [abs(21.22)]]]] ] print *, "Integer(2x2) ArrayConst", [[1, 2], [3, 4]], "Array End" print *, "Real(2x2) ArrayVar", b, "Array End" print *, "Real(2x2) ArrayConst", [[1.1, -1.2], [2.1, -2.2]], "Array End" print *, "Integer(2x2), Real(2x2), ArrayConst", [[1, 2], [3, 4]], [[1.1, -1.2], [2.1, -2.2]], "ArrayEnd" end subroutine end program lfortran-lfortran-2f73434/integration_tests/derived_types_97_mod2.f900000664000175000017500000000054015141516316026025 0ustar alastairalastairmodule derived_types_97_mod2 use derived_types_97_mod1 implicit none contains subroutine create_point(p) type(point_t), intent(out) :: p ! This uses keyword arguments with a type that has a generic interface p = point_t(x = 10, y = 20) end subroutine create_point end module derived_types_97_mod2 lfortran-lfortran-2f73434/integration_tests/do_concurrent_04.f900000664000175000017500000000100615141516316025064 0ustar alastairalastair! equivalent to openmp_07.f90 subroutine static_counter(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * 1 end do ctr = ctr + local_ctr end subroutine program do_concurrent_04 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call static_counter(n, ctr) print *, ctr if (ctr /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/data_implied_do_02.f900000664000175000017500000000060015141516316025313 0ustar alastairalastairprogram data_implied_do_02 integer i double precision coef(5,4) data (coef(i,1),i=1,5)/1.0D0,1.0D0,3*0.0D0/ if (abs(coef(1,1) - 1.0D0) > 1e-12) error stop if (abs(coef(2,1) - 1.0D0) > 1e-12) error stop if (abs(coef(3,1) - 0.0D0) > 1e-12) error stop if (abs(coef(4,1) - 0.0D0) > 1e-12) error stop if (abs(coef(5,1) - 0.0D0) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/inquire_05.f900000664000175000017500000000176315141516316023707 0ustar alastairalastairprogram inquire_05 implicit none integer :: io integer :: pos_value character(len=*), parameter :: txt = "ABC" integer, parameter :: expected_pos = 4 open(newunit=io, file="inquire_pos_stream.bin", access="stream", form="unformatted", status="replace") write(io) txt close(io) open(file="inquire_pos_stream.bin", & & status="old", & & access="stream", & & position="append", & & newunit=io) inquire(unit=io, pos=pos_value) close(io, status="delete") print *, "Position after append =", pos_value if (pos_value /= expected_pos) error stop "Position mismatch after append" open(newunit=io, file="inquire_pos_stream2.bin", access="stream", form="unformatted", status="replace") write(io) txt inquire(unit=io, pos=pos_value) close(io, status="delete") print *, "Position before close =", pos_value if (pos_value /= expected_pos) error stop "Position mismatch before close" end program inquire_05 lfortran-lfortran-2f73434/integration_tests/shifta_01.f900000664000175000017500000000274515141516316023506 0ustar alastairalastairprogram shifta_01 implicit none integer(kind=4) :: n, x, result ! Test case 1: shift by 0 bits n = 12345678 x = 0 result = shifta(n, x) print *, "Test case 1: shifta(", n, ",", x, ") = ", result if (result /= n) error stop "Test case 1 failed" ! Test case 2: shift by 1 bit n = 12345678 x = 1 result = shifta(n, x) print *, "Test case 2: shifta(", n, ",", x, ") = ", result if (result /= 6172839) error stop "Test case 2 failed" ! Test case 3: shift by 15 bits n = 12345678 x = 15 result = shifta(n, x) print *, "Test case 3: shifta(", n, ",", x, ") = ", result if (result /= 376) error stop "Test case 3 failed" ! Test case 4: shift by 16 bits n = 12345678 x = 16 result = shifta(n, x) print *, "Test case 4: shifta(", n, ",", x, ") = ", result if (result /= 188) error stop "Test case 4 failed" ! Test case 5: shift by 30 bits n = 2**29 x = 30 result = shifta(n, x) print *, "Test case 5: shifta(", n, ",", x, ") = ", result if (result /= 0) error stop "Test case 5 failed" n = 2**30 x = 30 result = shifta(n, x) print *, "Test case 5: shifta(", n, ",", x, ") = ", result if (result /= 1) error stop "Test case 5 failed" ! Test case 6: shift by 31 bits n = 2**29 + 3 x = 31 result = shifta(n, x) print *, "Test case 6: shifta(", n, ",", x, ") = ", result if (result /= 0) error stop "Test case 6 failed" end program shifta_01 lfortran-lfortran-2f73434/integration_tests/modules_14_a.f900000664000175000017500000000045615141516316024201 0ustar alastairalastairmodule modules_14_a implicit none interface a module procedure a1 module procedure a2 end interface contains subroutine a1(a) integer, intent(inout) :: a a = a + 1 end subroutine subroutine a2(a) real, intent(inout) :: a a = a + 1 end subroutine end module lfortran-lfortran-2f73434/integration_tests/intrinsics_243.f900000664000175000017500000001035515141516316024501 0ustar alastairalastairprogram intrinsics_243 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a, b real(sp) :: d, e integer :: i real(dp) :: sqrt_runtime_dp(3) = [5.678_dp, 892.272_dp, 72.312_dp] real(dp) :: log_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(dp) :: abs_runtime_dp(3) = [-723.182_dp, 9.124_dp, -123.145_dp] real(sp) :: sqrt_runtime_sp(3) = [5.678, 892.272, 72.312] real(sp) :: log_runtime_sp(3) = [0.875, 3.367, 2.140] real(sp) :: abs_runtime_sp(3) = [-723.182, 9.124, -123.145] real(dp) :: sqrt_res_dp(3), log_res_dp(3), abs_res_dp(3) real(sp) :: sqrt_res_sp(3), log_res_sp(3), abs_res_sp(3) real(dp) :: expected1_dp(3) = [2.38285542994114508e+00_dp, 2.98709223158576087e+01_dp, 8.50364627674505336e+00_dp] real(dp) :: expected2_dp(3) = [-0.13353139262452263_dp, 1.2140221401789375_dp, 0.76080582903376015_dp] real(dp) :: expected3_dp(3) = [7.23182000000000000e+02_dp, 9.12400000000000000e+00_dp, 1.23145000000000000e+02_dp] real(sp) :: expected1_sp(3) = [2.38285542, 2.98709221e+01, 8.50364590] real(sp) :: expected2_sp(3) = [-1.33531392e-01, 1.21402216e+00, 7.60805905e-01] real(sp) :: expected3_sp(3) = [7.23182007e+02, 9.12399960e+00, 1.23144997e+02] real(dp), parameter :: res1(3) = sqrt([5.678_dp, 892.272_dp, 72.312_dp]) real(dp), parameter :: res2(3) = log([0.875_dp, 3.367_dp, 2.140_dp]) real(dp), parameter :: res3(3) = abs([-723.182_dp, 9.124_dp, -123.145_dp]) real(sp), parameter :: res1_sp(3) = sqrt([5.678, 892.272, 72.312]) real(sp), parameter :: res2_sp(3) = log([0.875, 3.367, 2.140]) real(sp), parameter :: res3_sp(3) = abs([-723.182, 9.124, -123.145]) do i = 1, 3 print *, res1(i) if (abs(res1(i) - expected1_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res2(i) if (abs(res2(i) - expected2_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res3(i) if (abs(res3(i) - expected3_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res1_sp(i) if (abs(res1_sp(i) - expected1_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, res2_sp(i) if (abs(res2_sp(i) - expected2_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, res3_sp(i) if (abs(res3_sp(i) - expected3_sp(i)) > 1e-5) error stop end do sqrt_res_dp = sqrt(sqrt_runtime_dp) log_res_dp = log(log_runtime_dp) abs_res_dp = abs(abs_runtime_dp) sqrt_res_sp = sqrt(sqrt_runtime_sp) log_res_sp = log(log_runtime_sp) abs_res_sp = abs(abs_runtime_sp) do i = 1, 3 print *, sqrt_res_dp(i) if (abs(sqrt_res_dp(i) - expected1_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected2_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, abs_res_dp(i) if (abs(abs_res_dp(i) - expected3_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, sqrt_res_sp(i) if (abs(sqrt_res_sp(i) - expected1_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected2_sp(i)) > 1e-5) error stop end do do i = 1, 3 print *, abs_res_sp(i) if (abs(abs_res_sp(i) - expected3_sp(i)) > 1e-5) error stop end do a = 1.1_dp b = 1.2_dp d = 1.1 e = 1.2 if (b-a > 0.2_dp) error stop if (abs(b-a) > 0.2_dp) error stop if (abs(a-b) > 0.2_dp) error stop if (abs(e-d) > 0.2) error stop if (abs(d-e) > 0.2) error stop if (abs(1.2_dp-1.1_dp) > 0.2_dp) error stop if (abs(1.1_dp-1.2_dp) > 0.2_dp) error stop if (abs(1.2-1.1) > 0.2) error stop if (abs(1.1-1.2) > 0.2) error stop a = 4._dp d = 4. if (abs(sqrt(a)-2._dp) > 1e-12_dp) error stop if (abs(sqrt(4._dp)-2._dp) > 1e-12_dp) error stop if (abs(sqrt(d)-2.) > 1e-5) error stop if (abs(sqrt(4.)-2.) > 1e-5) error stop a = 4._dp d = 4. if (abs(log(a)-1.3862943611198906_dp) > 1e-12_dp) error stop if (abs(log(4._dp)-1.3862943611198906_dp) > 1e-12_dp) error stop if (abs(log(d)-1.3862943611198906) > 1e-5) error stop if (abs(log(4.)-1.3862943611198906) > 1e-5) error stop endlfortran-lfortran-2f73434/integration_tests/rewind_inquire_flush.f900000664000175000017500000000052515141516316026147 0ustar alastairalastairprogram rewind_inquire_flush implicit none integer :: ios, len, a, b character :: fm logical :: ext rewind(unit=9, iostat=ios, err=10) inquire (file='file_b', exist=ext) inquire (4, form=fm, iostat=ios, err=20) inquire (iolength=len) a, b 10 print *, "err rewind" 20 print *, "err inquire" end programlfortran-lfortran-2f73434/integration_tests/intrinsics_143.f900000664000175000017500000000142415141516316024475 0ustar alastairalastairprogram intrinsics_143 real :: a(3), b(3) real :: res double precision :: c(5), d(5) double precision :: res_dp a = [1.0,2.0,3.0] b = [4.0,5.0,6.0] res = dot_product(a, b) print *, res if (abs(res - 32.0) > 1e-8) error stop res = dot_product([1.0,2.0,3.0], [4.0,5.0,6.0]) print *, res if (abs(res - 32.0) > 1e-8) error stop c = [1.213D0, 2.113D0, 3.123D0, 4.12D0, 5.13D0] d = [4.213D0, 5.113D0, 6.123D0, 7.12D0, 8.13D0] res_dp = dot_product(c, d) print *, res_dp if (abs(res_dp - 106.077567D0) > 1e-12) error stop res_dp = dot_product([1.213D0, 2.113D0, 3.123D0, 4.12D0, 5.13D0], [4.213D0, 5.113D0, 6.123D0, 7.12D0, 8.13D0]) print *, res_dp if (abs(res_dp - 106.077567D0) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/file_13.f900000664000175000017500000000132015141516316023136 0ustar alastairalastairprogram file_13 implicit none integer :: num character(:), allocatable :: filename, form, status, access open(UNIT=1, file="file_01_data.txt", form="formatted", access="stream", status="old") read(1, *) num close(1) print *, num if (num /= 10130) error stop allocate(character(16) :: filename) allocate(character(9) :: form) allocate(character(6) :: status) allocate(character(3) :: access) filename = "file_03_data.txt" form = "formatted" access = "stream" status = "old" open(UNIT=1, file=filename, form=form, access=access, status=status, pad="no") read(1, *) num close(1) print *, num if (num /= 10) error stop end program lfortran-lfortran-2f73434/integration_tests/types_04.f900000664000175000017500000000032715141516316023371 0ustar alastairalastairprogram types_04 implicit none real :: r, x integer :: i r = 1.5 i = 2 x = i*i x = r*r x = i*r x = r*i x = i+i x = r+r x = r+i x = i+r x = i-i x = r-r x = r-i x = i-r x = i/i x = r/r x = i/r x = r/i end program lfortran-lfortran-2f73434/integration_tests/intrinsics_228.f900000664000175000017500000000146715141516316024510 0ustar alastairalastairprogram intrinsics_228 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: x, y, z x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derf(x) if (abs(derf(x) - 1.00000000000000000e+00_dp) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derf(x) if (abs(derf(x) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/file_41.f900000664000175000017500000000220415141516316023141 0ustar alastairalastairprogram file_41 implicit none integer :: unit, ios character(len=*), parameter :: fname = "test_stream.txt" character(len=*), parameter :: expected = "build" character(len=len(expected)) :: found ! ---- Write ---- open(newunit=unit, file=fname, access="stream", action="write", iostat=ios) if (ios /= 0) error stop "open(write) failed" write(unit, iostat=ios) expected if (ios /= 0) error stop "write failed" close(unit) ! ---- Read back ---- open(newunit=unit, file=fname, access="stream", action="read", iostat=ios) if (ios /= 0) error stop "open(read) failed" read(unit, iostat=ios) found if (ios /= 0) error stop "read failed" close(unit) ! ---- Verify ---- if (found /= expected) then print *, "EXPECTED:", expected print *, "FOUND: ", found error stop "content mismatch" end if ! ---- Delete file ---- open(newunit=unit, file=fname, status="old", iostat=ios) if (ios /= 0) error stop "reopen for delete failed" close(unit, status="delete") print *, "PASS: stream write/read/delete successful" end program file_41 lfortran-lfortran-2f73434/integration_tests/file_17.f900000664000175000017500000000105515141516316023147 0ustar alastairalastairprogram file_17 integer :: i real :: arr(3) real :: a, b, c arr(1) = 100.123 arr(2) = -2.14 arr(3) = 528.156 open(10, file="file_17_util.txt", status="replace") write(10, "((es23.16))") (arr(i), i=1, size(arr)) close(10) open(10, file="file_17_util.txt") read(10, *) a, b, c close(10) print *, arr(1), a print *, arr(2), b print *, arr(3), c if (abs(arr(1) - a) > 1e-5) error stop if (abs(arr(2) - b) > 1e-5) error stop if (abs(arr(3) - c) > 1e-5) error stop end program file_17 lfortran-lfortran-2f73434/integration_tests/save_10.f900000664000175000017500000000054315141516316023160 0ustar alastairalastairsubroutine foo_save_10(reference) integer, intent(in) :: reference(2) integer, save :: calls(2) = [1, 1] calls = calls + 1 print *, 'FOO: ', calls, reference if (all(calls /= reference)) error stop end subroutine foo_save_10 program save_10 integer i do i=2,4 call foo_save_10([i,i]) end do end program save_10lfortran-lfortran-2f73434/integration_tests/intrinsics_29.f900000664000175000017500000000030415141516316024414 0ustar alastairalastairprogram intrinsics_29 implicit none real(4) :: random_sp real(8) :: random_dp call random_number(random_sp) call random_number(random_dp) print*, random_sp, random_dp end program intrinsics_29 lfortran-lfortran-2f73434/integration_tests/submodule_12.f900000664000175000017500000000071715141516316024226 0ustar alastairalastairmodule submodule_12_m implicit none interface submodule_12_m_i pure module function Func() result(format_string) character(len=:), allocatable :: format_string end function end interface end module submodule_12_m submodule(submodule_12_m) submodule_12_s implicit none contains module procedure Func end procedure end submodule submodule_12_s program submodule_12 use submodule_12_m implicit none end program submodule_12 lfortran-lfortran-2f73434/integration_tests/arrays_05_size.f900000664000175000017500000000046515141516316024564 0ustar alastairalastairmodule modd_arrays_05_size integer(8),parameter :: arr_size = 10 end module modd_arrays_05_size program arrays_05_size use modd_arrays_05_size integer :: arr(arr_size) print * , kind(arr_size) if (kind(arr_size) /= 8) error stop print * , size(arr) if (size(arr) /= 10) error stop end programlfortran-lfortran-2f73434/integration_tests/char_array_indexing_02.f900000664000175000017500000000060315141516316026220 0ustar alastairalastairmodule mod_char_array_indexing_02 implicit none character, parameter :: chars(0:9) = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] end module mod_char_array_indexing_02 program char_array_indexing_02 use mod_char_array_indexing_02, only : chars implicit none character(len=1) :: x x = chars(3) print *, "x: ", x if (x /= "d") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_13.f900000664000175000017500000000100515141516316024404 0ustar alastairalastairprogram intrinsics_13 integer, parameter :: p = kind(5) ! 4 integer, parameter :: p1 = kind(5_4) ! 4 integer, parameter :: p2 = kind(5_8) ! 8 integer, parameter :: p3 = kind(0.d0) ! 8 integer, parameter :: p4 = kind(0.0) ! 4 integer, parameter :: p5 = kind(5._4) ! 4 integer, parameter :: p6 = kind(5._8) ! 8 integer, parameter :: p7 = kind(.true.) ! 4 if (p /= 4 .and. p1 /= 4 .and. p2 /= 8) error stop if (p3 /= 8 .and. p4 /= 4 .and. p5 /= 4) error stop if (p6 /= 8 .and. p7 /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/lcompilers_test_module.f900000664000175000017500000000201315141516316026471 0ustar alastairalastairmodule lcompilers_test_module use iso_fortran_env, only: sp => real32, dp => real64 interface lcompilers_test module procedure :: lcompilers_test_r32_r32 module procedure :: lcompilers_test_r64_r64 end interface contains elemental impure subroutine lcompilers_test_r32_r32(actual, expected, tol) real(sp), intent(in) :: actual real(sp), intent(in) :: expected real(sp), optional, intent(in) :: tol print *, "actual: ", actual print *, "expected: ", expected if (present(tol)) then if (abs(actual - expected) > tol * 1e-8_sp) error stop else if (abs(actual - expected) > 1e-8_sp) error stop end if end subroutine elemental impure subroutine lcompilers_test_r64_r64(actual, expected, tol) real(dp), intent(in) :: actual real(dp), intent(in) :: expected real(dp), optional, intent(in) :: tol print *, "actual: ", actual print *, "expected: ", expected if (present(tol)) then if (abs(actual - expected) > tol * 1e-12_dp) error stop else if (abs(actual - expected) > 1e-12_dp) error stop end if end subroutine end module lfortran-lfortran-2f73434/integration_tests/file_43.f900000664000175000017500000000116315141516316023146 0ustar alastairalastairprogram file_43 implicit none integer :: n integer :: i real :: r logical :: l integer :: iarr(5) real :: rarr(3,2) print *, "IOLENGTH tests:" inquire(iolength=n) i print *, "integer :", n if (n /= 4) error stop inquire(iolength=n) r print *, "real :", n if (n /= 4) error stop inquire(iolength=n) l print *, "logical :", n if (n /= 4) error stop inquire(iolength=n) iarr print *, "integer(5) :", n if (n /= 20) error stop inquire(iolength=n) rarr print *, "real(3x2) :", n if (n /= 24) error stop end program lfortran-lfortran-2f73434/integration_tests/intent_01.f900000664000175000017500000000041715141516316023523 0ustar alastairalastairmodule dflt_intent contains subroutine foo(c, d) real :: c, d, e, g e = f(c) g = f(d) contains real function f(x) real, intent(in) :: x f = 2*x print *, f end function f end subroutine foo end module program main use dflt_intent call foo(0.0, 2.0) end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_25.f900000664000175000017500000000072715141516316025244 0ustar alastairalastairprogram arrays_reshape_25 implicit none real :: b(3, 2) = reshape([-1, -3, 6, 7, 8, 9], [3, 2]) if (b(1,1) /= -1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= -3.0) error stop "Mismatch at b(2,1)" if (b(3,1) /= 6.0) error stop "Mismatch at b(3,1)" if (b(1,2) /= 7.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 8.0) error stop "Mismatch at b(2,2)" if (b(3,2) /= 9.0) error stop "Mismatch at b(3,2)" end program arrays_reshape_25 lfortran-lfortran-2f73434/integration_tests/openmp_bindc_01.f900000664000175000017500000000322015141516316024652 0ustar alastairalastairmodule module_openmp_bindc_01 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads end interface end module subroutine lcompilers_function() bind(c) use module_openmp_bindc_01 implicit none integer(c_int) :: thread_id thread_id = omp_get_thread_num() print *, "Hello from thread ", thread_id if (thread_id >= 4) error stop end subroutine program openmp_bindc_01 use module_openmp_bindc_01 implicit none interface subroutine lcompilers_function() bind(c) end subroutine end interface integer :: max_threads call omp_set_num_threads(4) max_threads = omp_get_max_threads() if (max_threads /= 4) error stop print *, "Max threads: ", max_threads call GOMP_parallel(c_funloc(lcompilers_function), c_null_ptr, max_threads, 0) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_105.f900000664000175000017500000000044615141516316024476 0ustar alastairalastairPROGRAM intrinsics_105 INTEGER, DIMENSION(-1:1, -1:2, -1:10) :: A INTEGER :: result(3) result = shape(A) print*, shape(A) if ( result(1) /= 3 ) error stop if ( result(2) /= 4 ) error stop if ( result(3) /= 12 ) error stop if ( size(shape(42)) /= 0 ) error stop END PROGRAM lfortran-lfortran-2f73434/integration_tests/string_25.f900000664000175000017500000000127515141516316023541 0ustar alastairalastairprogram string_25 character(len=3) :: s1, s2 character(len=4) :: s3 character(len=2) :: s4 s1 = "abc" s2 = "abc" s3 = "defe" s4 = "ab" if (s1 == s2) then print *, "equal" else print *, "not equal" end if if (s4 < s1) then print *, "less than" else print *, "not less than" end if if (s3 > s4) then print *, "greater than" else print *, "not greater than" end if if (s2 /= s4) then print *, "not equal" else print *, "not, not equal" end if if (s4 <= s3) then print *, "less than equal to" else print *, "not less than equal to" end if if (s3 >= s2) then print *, "greater than equal to" else print *, "not greater than equal to" end if end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_22b.f900000664000175000017500000000027215141516316026570 0ustar alastairalastairsubmodule (math_separate_compilation_22) math_separate_compilation_22_logspace implicit none contains module procedure logspace_sub n = 3 end procedure end submodulelfortran-lfortran-2f73434/integration_tests/test_inquire_size.f900000664000175000017500000000065015141516316025466 0ustar alastairalastairprogram test_inquire_size implicit none integer :: fh integer :: length character(*), parameter :: test_lines = 'build.f90' open(newunit=fh, file="test_inquire_size_test.txt", access="stream", form='unformatted', status='replace') write(fh) test_lines inquire(fh, size=length) close(fh) print *, "File size =", length, "bytes" if(length /= 9) error stop end program test_inquire_size lfortran-lfortran-2f73434/integration_tests/openmp_22.f900000664000175000017500000000073615141516316023527 0ustar alastairalastairprogram openmp_22 use omp_lib integer, parameter :: n = 100000 integer :: i real, allocatable :: b(:) allocate(b(n)) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_247.f900000664000175000017500000000350715141516316024506 0ustar alastairalastairprogram intrinsics_247 implicit none character(len = 11), parameter :: space_at_end_ = adjustr('gfortran ') character(len = 16), parameter :: space_in_between_ = adjustr(' g for tran ') character(len = 25), parameter :: spaces_with_symbols_ = adjustr(' # gfor* t $ ran & ') character(len = 2), parameter :: a(4) = adjustr(["ab", "cd", "ef", "gh"]) character(len = 7), parameter :: b(3) = adjustr([" hello", " world", "fortran"]) character(len = 10) :: c1 character(len = 10) :: c2 character(len = 10) :: c3(3) character(len = 10) :: res(3) c1 = "lfortran " c2 = " gfortran" c3 = [" fort ran ", " lfortran", "gfortran "] print *, adjustr(c1) if (adjustr(c1) /= " lfortran") error stop print *, adjustr(c2) if (adjustr(c2) /= " gfortran") error stop print *, space_at_end_ if (space_at_end_ /= " gfortran") error stop print *, space_in_between_ if (space_in_between_ /= " g for tran") error stop print *, spaces_with_symbols_ if (spaces_with_symbols_ /= " # gfor* t $ ran &") error stop print *, a if (any(a /= ["ab", "cd", "ef", "gh"])) error stop print *, b if (any(b /= [" hello", " world", "fortran"])) error stop print *, adjustr(["|a ", "b2 ", "3 c", " d4", "e| "]) if (any(adjustr(["|a ", "b2 ", "3 c", " d4", "e| "]) /= [" |a", " b2", "3 c", " d4", " e|"])) error stop print *, adjustr(["lfortran ", " compiler ", "opensource"]) if (any(adjustr(["lfortran ", " compiler ", "opensource"]) /= [" lfortran", " compiler", "opensource"])) error stop print *, adjustr([c1, c2]) if (any(adjustr([c1, c2]) /= [" lfortran", " gfortran"])) error stop res = adjustr([c1, c2, c3(1)]) print *, res if (any(res /= [" lfortran", " gfortran", " fort ran"])) error stop end programlfortran-lfortran-2f73434/integration_tests/string_09.f900000664000175000017500000000123615141516316023540 0ustar alastairalastairprogram string_09 implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-lfortran-2f73434/integration_tests/modules_23_module.f900000664000175000017500000000466615141516316025255 0ustar alastairalastairmodule string_module implicit none type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface string_type pure elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string pure elemental module function new_string_from_integer_int8(val) result(new) integer(1), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int8 pure elemental module function new_string_from_integer_int16(val) result(new) integer(2), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int16 pure elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 pure elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 end interface string_type interface assignment(=) module procedure :: assign_char_to_string end interface assignment(=) contains elemental subroutine assign_char_to_string(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_char_to_string elemental function len_string(string3) result(length) type(string_type), intent(in) :: string3 integer :: length if (allocated(string3%raw)) then length = len(string3%raw) else length = 0 end if end function len_string elemental function adjustl_string(string1) result(adjusted_string) type(string_type), intent(in) :: string1 type(string_type) :: adjusted_string adjusted_string%raw = adjustl(maybe(string1)) end function adjustl_string pure function maybe(string2) result(maybe_string) type(string_type), intent(in) :: string2 character(len=len_string(string2)) :: maybe_string if (allocated(string2%raw)) then maybe_string = string2%raw else maybe_string = '' end if end function maybe end modulelfortran-lfortran-2f73434/integration_tests/types_real_to_complex_cast.f900000664000175000017500000000032715141516316027334 0ustar alastairalastairprogram types_real_to_complex_cast integer, parameter :: dp = kind(0.d0) complex(dp) :: c real(dp) :: i c = 1.0_dp i = 1.2_dp c = i if (abs(c - 1.2_dp) > 1e-12_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_267.f900000664000175000017500000000361615141516316024511 0ustar alastairalastairprogram intrinsics_267 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(dp), parameter :: a1 = dsin(1.0_dp) real(dp), parameter :: a2 = dcos(1.0_dp) real(dp), parameter :: a3 = dtan(1.0_dp) real(dp), parameter :: ar1(3) = dsin([1.0_dp, 1.5_dp, 2.0_dp]) real(dp), parameter :: ar2(3) = dcos([1.0_dp, 1.5_dp, 2.0_dp]) real(dp), parameter :: ar3(3) = dtan([1.0_dp, 1.5_dp, 2.0_dp]) real(dp) :: b = 0.7_dp real(dp) :: br(3) = [0.5_dp, 0.7_dp, 0.9_dp] ! dsin print *, a1 if (abs(a1 - 8.41470984807896507e-01_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.84147098480789650_dp, 0.99749498660405445_dp, 0.90929742682568171_dp]) > 1e-12_dp)) error stop print *, sin(b) if (abs(sin(b) - 0.64421768723769102_dp) > 1e-12_dp) error stop print *, sin(br) if (any(abs(sin(br) - [0.47942553860420301_dp, 0.64421768723769102_dp, 0.78332690962748341_dp]) > 1e-12_dp)) error stop ! dcos print *, a2 if (abs(a2 - 5.40302305868139717e-01_dp) > 1e-12_dp) error stop print *, ar2 if (any(abs(ar2 - [0.54030230586813977_dp, 0.070737201667702905_dp, -0.41614683654714241_dp]) > 1e-12_dp)) error stop print *, dcos(b) if (abs(dcos(b) - 0.76484218728448849_dp) > 1e-12_dp) error stop print *, dcos(br) if (any(abs(dcos(br) - [0.87758256189037276_dp, 0.76484218728448849_dp, 0.62160996827066441_dp]) > 1e-12_dp)) error stop ! dtan print *, a3 if (abs(a3 - 1.55740772465490223_dp) > 1e-12_dp) error stop print *, ar3 if (any(abs(ar3 - [1.55740772465490223_dp, 14.101419947171719_dp, -2.185039863261519_dp]) > 1e-12_dp)) error stop print *, dtan(b) if (abs(dtan(b) - 0.84228838046307941_dp) > 1e-12_dp) error stop print *, dtan(br) if (any(abs(dtan(br) - [0.54630248984379048_dp, 0.84228838046307941_dp, 1.2601582175503392_dp]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_50.f900000664000175000017500000000430615141516316025075 0ustar alastairalastairmodule stdlib_bitsets implicit none public :: & bitset_type, & bitset_large, & bitset_64, & bitset_64_concrete type, abstract :: bitset_type integer(4) :: num_bits contains procedure(clear_bit_abstract), deferred, pass(self) :: clear_bit procedure(clear_range_abstract), deferred, pass(self) :: clear_range generic :: clear => clear_bit, clear_range end type bitset_type abstract interface elemental subroutine clear_bit_abstract(self, pos) import :: bitset_type class(bitset_type), intent(inout) :: self integer(4), intent(in) :: pos end subroutine clear_bit_abstract pure subroutine clear_range_abstract(self, start_pos, stop_pos) import :: bitset_type class(bitset_type), intent(inout) :: self integer(4), intent(in) :: start_pos, stop_pos end subroutine clear_range_abstract end interface type, abstract, extends(bitset_type) :: bitset_large private integer(8), private, allocatable :: blocks(:) contains end type bitset_large type, abstract, extends(bitset_type) :: bitset_64 private integer(8), private :: block = 0 contains end type bitset_64 type, extends(bitset_64) :: bitset_64_concrete contains procedure, pass(self) :: clear_bit => clear_bit_impl procedure, pass(self) :: clear_range => clear_range_impl end type bitset_64_concrete contains elemental subroutine clear_bit_impl(self, pos) class(bitset_64_concrete), intent(inout) :: self integer(4), intent(in) :: pos ! Dummy implementation end subroutine clear_bit_impl pure subroutine clear_range_impl(self, start_pos, stop_pos) class(bitset_64_concrete), intent(inout) :: self integer(4), intent(in) :: start_pos, stop_pos ! Dummy implementation end subroutine clear_range_impl end module stdlib_bitsets program derived_types_50 use stdlib_bitsets implicit none type(bitset_64_concrete) :: set0, set1 set0%num_bits = 64 set1 = set0 if (set1%num_bits /= 64) error stop end program derived_types_50 lfortran-lfortran-2f73434/integration_tests/error_stop_04.f900000664000175000017500000000006615141516316024423 0ustar alastairalastairprogram error_stop_04 error stop "hi" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_163.f900000664000175000017500000001126515141516316024503 0ustar alastairalastairprogram intrinsics_163 integer :: x, y, size1 integer(8) :: a, b, size2 integer(kind=1) :: res_1 integer(kind=2) :: res_2 integer(kind=4) :: res_4 integer(kind=8) :: res_8 integer(kind=1), parameter :: para_1 = ishftc(10_1, -2_1) integer(kind=2), parameter :: para_2 = ishftc(10_2, -2_2) integer(kind=4), parameter :: para_4 = ishftc(10_4, -2_4) integer(kind=8), parameter :: para_8 = ishftc(10_8, -2_8) if (para_1 /= -126) error stop if (para_2 /= -32766) error stop if (para_4 /= -2147483646) error stop if (para_8 /= -9223372036854775806_8) error stop res_1 = ishftc(10_1, 2_1) print *, res_1 if (res_1 /= 40) error stop res_1 = ishftc(10_1, -2_1) print *, res_1 if (res_1 /= -126) error stop res_1 = ishftc(-10_1, 2_1) print *, res_1 if (res_1 /= -37) error stop res_1 = ishftc(-10_1, -2_1) print *, res_1 if (res_1 /= -67) error stop res_2 = ishftc(10_2, 2_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2) print *, res_2 if (res_2 /= -32766) error stop res_2 = ishftc(-10_2, 2_2) print *, res_2 if (res_2 /= -37) error stop res_2 = ishftc(-10_2, -2_2) print *, res_2 if (res_2 /= -16387) error stop res_4 = ishftc(10_4, 2_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4) print *, res_4 if (res_4 /= -2147483646) error stop res_4 = ishftc(-10_4, 2_4) print *, res_4 if (res_4 /= -37) error stop res_4 = ishftc(-10_4, -2_4) print *, res_4 if (res_4 /= -1073741827) error stop res_8 = ishftc(10_8, 2_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8) print *, res_8 if (res_8 /= -9223372036854775806_8) error stop res_8 = ishftc(-10_8, 2_8) print *, res_8 if (res_8 /= -37_8) error stop res_8 = ishftc(-10_8, -2_8) print *, res_8 if (res_8 /= -4611686018427387907_8) error stop res_1 = ishftc(127_1, 7_1) print *, res_1 if (res_1 /= -65) error stop res_1 = ishftc(127_1, -7_1) print *, res_1 if (res_1 /= -2) error stop res_1 = ishftc(-127_1, 7_1) print *, res_1 if (res_1 /= -64) error stop res_1 = ishftc(-127_1, -7_1) print *, res_1 if (res_1 /= 3) error stop res_2 = ishftc(32767_2, 15_2) print *, res_2 if (res_2 /= -16385) error stop res_2 = ishftc(32767_2, -15_2) print *, res_2 if (res_2 /= -2) error stop res_2 = ishftc(-32767_2, 15_2) print *, res_2 if (res_2 /= -16384) error stop res_2 = ishftc(-32767_2, -15_2) print *, res_2 if (res_2 /= 3) error stop res_4 = ishftc(2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741825) error stop res_4 = ishftc(2147483647_4, -31_4) print *, res_4 if (res_4 /= -2) error stop res_4 = ishftc(-2147483647_4, 31_4) print *, res_4 if (res_4 /= -1073741824) error stop res_4 = ishftc(-2147483647_4, -31_4) print *, res_4 if (res_4 /= 3) error stop res_8 = ishftc(9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387905_8) error stop res_8 = ishftc(9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= -2) error stop res_8 = ishftc(-9223372036854775807_8, 63_8) print *, res_8 if (res_8 /= -4611686018427387904_8) error stop res_8 = ishftc(-9223372036854775807_8, -63_8) print *, res_8 if (res_8 /= 3) error stop res_1 = ishftc(10_1, 2_1, 4_1) print *, res_1 if (res_1 /= 10) error stop res_1 = ishftc(10_1, -2_1, 7_1) print *, res_1 if (res_1 /= 66) error stop res_2 = ishftc(10_2, 2_2, 6_2) print *, res_2 if (res_2 /= 40) error stop res_2 = ishftc(10_2, -2_2, 11_2) print *, res_2 if (res_2 /= 1026) error stop res_4 = ishftc(10_4, 2_4, 13_4) print *, res_4 if (res_4 /= 40) error stop res_4 = ishftc(10_4, -2_4, 31_4) print *, res_4 if (res_4 /= 1073741826) error stop res_8 = ishftc(10_8, 2_8, 62_8) print *, res_8 if (res_8 /= 40_8) error stop res_8 = ishftc(10_8, -2_8, 59_8) print *, res_8 if (res_8 /= 288230376151711746_8) error stop x = 17 y = 4 size1 = 6 a = 8 b = 2 size2 = 4 print *, ishftc(a, b, size2) if (ishftc(a, b, size2) /= 2) error stop print *, ishftc(x, y, size1) if (ishftc(x, y, size1) /= 20) error stop a = 293436938_8 res_8 = ishftc(a, 23) print *, res_8 if (res_8 /= 2461527445602304_8) error stop b = -1292093_8 res_8 = ishftc(b, -32) print *, res_8 if (res_8 /= -5549492883423233_8) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_15.f900000664000175000017500000000050115141516316023522 0ustar alastairalastair program arrays_15 integer :: b(2) b = [244, 1404] call foo() contains subroutine foo() b(1) = 43 call foo2(size(b), b) end subroutine subroutine foo2(m, vec) integer :: m, vec(m) if (m /= 2) error stop if (vec(1) /= 43) error stop if (vec(2) /= 1404) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/modules_09.f900000664000175000017500000000015215141516316023676 0ustar alastairalastairprogram modules_09 use modules_09_a, only: a implicit none if (a() /= 13) error stop print *, "OK" end lfortran-lfortran-2f73434/integration_tests/derived_types_02.f900000664000175000017500000000111615141516316025066 0ustar alastairalastairmodule derived_types_02_m implicit none integer, parameter :: r8 = kind(0.d0) type :: B end type type C end type type, extends(B), public :: X private real(r8) :: r1 type(C), pointer :: cc => null() real(r8), pointer :: r2(:) => null(), r3(:) => null() contains procedure, private :: p1 procedure :: p2 end type X contains subroutine p1(this) class(X), intent(out) :: this end subroutine subroutine p2(this) class(X), intent(inout) :: this end subroutine end module program derived_types_02 use derived_types_02_m, only: X implicit none type(X) :: b end lfortran-lfortran-2f73434/integration_tests/namelist_13_module.f900000664000175000017500000000030515141516316025402 0ustar alastairalastairmodule config_module implicit none integer :: param1 = 10 integer :: param2 = 20 real :: tolerance = 1.0e-6 namelist /config/ param1, param2, tolerance end module config_module lfortran-lfortran-2f73434/integration_tests/intrinsics_246.f900000664000175000017500000000347115141516316024505 0ustar alastairalastairprogram intrinsics_246 implicit none character(len = 25), parameter :: space_at_end_ = adjustl('gfortran ') character(len = 25), parameter :: space_in_between_ = adjustl(' g for tran ') character(len = 25), parameter :: spaces_with_symbols_ = adjustl(' # gfor* t $ ran & ') character(len = 2), parameter :: a(4) = adjustl(["ab", "cd", "ef", "gh"]) character(len = 7), parameter :: b(3) = adjustl([" hello", " world", "fortran"]) character(len = 10) :: c1 character(len = 10) :: c2 character(len = 10) :: c3(3) character(len = 10) :: res(3) c1 = "lfortran " c2 = " gfortran" c3 = [" fort ran ", " lfortran", "gfortran "] print *, adjustl(c1) if (adjustl(c1) /= "lfortran ") error stop print *, adjustl(c2) if (adjustl(c2) /= "gfortran ") error stop print *, space_at_end_ if (space_at_end_ /= "gfortran") error stop print *, space_in_between_ if (space_in_between_ /= "g for tran") error stop print *, spaces_with_symbols_ if (spaces_with_symbols_ /= "# gfor* t $ ran &") error stop print *, a if (any(a /= ["ab", "cd", "ef", "gh"])) error stop print *, b if (any(b /= ["hello ", "world ", "fortran"])) error stop print *, adjustl([" |a", "b2 ", "3 c", " d4", " e|"]) if (any(adjustl([" |a", "b2 ", "3 c", " d4", " e|"]) /= ["|a ", "b2 ", "3 c", "d4 ", "e| "])) error stop print *, adjustl([" lfortran", " compiler ", "opensource"]) if (any(adjustl([" lfortran", " compiler ", "opensource"]) /= ["lfortran ", "compiler ", "opensource"])) error stop print *, adjustl([c1, c2]) if (any(adjustl([c1, c2]) /= ["lfortran ", "gfortran "])) error stop res = adjustl([c1, c2, c3(1)]) print *, res if (any(res /= ["lfortran ", "gfortran ", "fort ran "])) error stop end program lfortran-lfortran-2f73434/integration_tests/cond_01.f900000664000175000017500000000030215141516316023136 0ustar alastairalastairprogram cond_01 implicit none if (.false.) error stop if (1 == 2) error stop if (1 /= 1) error stop if (1 > 2) error stop if (1 >= 2) error stop if (2 < 1) error stop if (2 <= 1) error stop end lfortran-lfortran-2f73434/integration_tests/implicit_interface_14.f900000664000175000017500000000020615141516316026054 0ustar alastairalastairprogram main implicit type(foo)(a-z) type foo integer x, y end type z = foo(42, 1) print *, z%x, z%y end lfortran-lfortran-2f73434/integration_tests/derived_types_85.f900000664000175000017500000000201215141516316025075 0ustar alastairalastairmodule derived_types_85_module implicit none type :: shlex_token character(len=:), allocatable :: text contains procedure :: neq generic :: operator(/=) => neq end type shlex_token contains logical function neq(a, b) class(shlex_token), intent(in) :: a, b if (.not.allocated(a%text) .or. .not.allocated(b%text)) then neq = allocated(a%text) .neqv. allocated(b%text) else neq = (a%text /= b%text) end if end function neq end module program derived_types_85 use derived_types_85_module implicit none type(shlex_token), allocatable :: list(:), lmsvcrt(:) integer :: i allocate(list(3), lmsvcrt(3)) list(1)%text = "foo" list(2)%text = "bar" list(3)%text = "baz" lmsvcrt(1)%text = "foo" lmsvcrt(2)%text = "BAR" lmsvcrt(3)%text = "baz" if (list(1) /= lmsvcrt(1)) error stop if (.not.(list(2) /= lmsvcrt(2))) error stop if (list(3) /= lmsvcrt(3)) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_370.f900000664000175000017500000000041015141516316024471 0ustar alastairalastairprogram intrinsics implicit none integer, dimension(5) :: value integer :: val, iloc value = [0, 2, 1, 3, 1] val = 1 iloc = findloc(value, val, dim=1) print * , iloc if (iloc /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/template_sort_02.f900000664000175000017500000000526015141516316025106 0ustar alastairalastairmodule template_sort_02_type implicit none public :: my_type, my_type_lt type my_type real :: d end type contains pure elemental function lt_my_type(lhs, rhs) result(res) type(my_type), intent(in) :: lhs, rhs logical :: res res = lhs%d <= rhs%d end function end module module template_sort_02_m use template_sort_02_type implicit none requirement op_r(T, U, V, op_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function op_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(T), intent(in) :: rhs type(V) :: res end function end requirement contains subroutine swap {T} (lhs, rhs) type, deferred :: T type(T), intent(inout) :: lhs type(T), intent(inout) :: rhs type(T) :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine ! non-generic reference recursive subroutine quicksort {T, lt} (arr, low, high) require :: op_r(T, T, logical, lt) type(T), intent(inout) :: arr(:) integer, intent(in) :: low, high integer :: i, last type(T) :: pivot if (low < high) then pivot = arr(high) last = low - 1 do i = low, high - 1 if (lt(arr(i), pivot)) then last = last + 1 call swap{T}(arr(last), arr(i)) end if end do call swap{T}(arr(last + 1), arr(high)) call quicksort(arr, low, last) call quicksort(arr, last + 2, high) end if end subroutine pure elemental function lt_real(lhs, rhs) result(res) real, intent(in) :: lhs real, intent(in) :: rhs logical :: res res = lhs < rhs end function pure elemental function lt_integer(lhs, rhs) result(res) integer, intent(in) :: lhs integer, intent(in) :: rhs logical :: res res = lhs < rhs end function subroutine test_template() integer :: xi(10), i real :: xr(10) type(my_type) :: xm(10) xi = [2,4,1,5,6,24,51,3,42,2] xr = [2,4,1,5,6,24,51,3,42,2] do i = 1, 10 xm(i) = my_type(xr(i)) end do call quicksort{integer, lt_integer}(xi, 1, 10) call quicksort{real, lt_real}(xr, 1, 10) call quicksort{my_type, lt_my_type}(xm, 1, 10) print *, xi print *, xr print *, xm end subroutine end module program template_sort_02 use template_sort_02_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_20a.f900000664000175000017500000000031215141516316026560 0ustar alastairalastairmodule stdlib_error_separate_compilation_20 implicit none interface module subroutine error_stop(code) integer, intent(inout) :: code end subroutine error_stop end interface end modulelfortran-lfortran-2f73434/integration_tests/arrays_13_size.f900000664000175000017500000000143215141516316024556 0ustar alastairalastairmodule stdlib_sorting_arrays_13_size implicit none integer, parameter :: max_merge_stack = 93 type run_type integer(8) :: base = 0 integer(8) :: len = 0 end type run_type end module stdlib_sorting_arrays_13_size module stdlib_sorting_sort_index_arrays_13_size use stdlib_sorting_arrays_13_size implicit none contains module subroutine sort_index( item ) real, intent(inout) :: item type(run_type) :: runs(0:max_merge_stack-1) print *, size(runs) if (size(runs) /= 93) error stop end subroutine sort_index end module stdlib_sorting_sort_index_arrays_13_size program arrays_13_size use stdlib_sorting_sort_index_arrays_13_size implicit none real :: item call sort_index(item) end programlfortran-lfortran-2f73434/integration_tests/dict_test_01.f900000664000175000017500000000175315141516316024210 0ustar alastairalastairprogram dict_test_01 implicit none real :: eps = 1e-6 _lfortran_dict(integer, integer(4)):: dict_i dict_i = _lfortran_dict_constant(1, 2, 2, 5, 3, 7) if (_lfortran_len(dict_i) /= 3) error stop call _lfortran_set_item(dict_i, 3, 5) if (_lfortran_len(dict_i) /= 3) error stop call _lfortran_set_item(dict_i, -15, 6) if (_lfortran_len(dict_i) /= 4) error stop if (_lfortran_get_item(dict_i, -15) /= 6) error stop if (_lfortran_get_item(dict_i, 2) /= 5) error stop type(_lfortran_dict(integer(4), real(4))):: dict_r dict_r = _lfortran_dict_constant(1, 1.2, 2, 2.5, 3, 4.7) if (_lfortran_len(dict_r) /= 3) error stop call _lfortran_set_item(dict_r, 3, 5.5) if (_lfortran_len(dict_r) /= 3) error stop call _lfortran_set_item(dict_r, -14, 6.4) if (_lfortran_len(dict_r) /= 4) error stop if (abs(_lfortran_get_item(dict_r, -14) - 6.4) > eps) error stop if (abs(_lfortran_get_item(dict_r, 2) - 2.5) > eps) error stop end program dict_test_01 lfortran-lfortran-2f73434/integration_tests/data_10.f900000664000175000017500000000146215141516316023134 0ustar alastairalastairprogram data_10 integer :: a, i, j, x(5), y(5), z(5) real :: k, l data x, j / 1, 2, 3, 4, 5, 3 / print *, x, j if (x(1) /= 1) error stop if (x(2) /= 2) error stop if (x(3) /= 3) error stop if (x(4) /= 4) error stop if (x(5) /= 5) error stop if (j /= 3) error stop data k, (y(i), i = 1, 5), l / 10.0, 1, 2, 3, 4, 5, 12.0 / print *, k, l, y if (y(1) /= 1) error stop if (y(2) /= 2) error stop if (y(3) /= 3) error stop if (y(4) /= 4) error stop if (y(5) /= 5) error stop if (abs(k - 10.0) > 1e-8) error stop data a, z / 1, 2, 3,4, 2*5 / print *, a, z if (a /= 1) error stop if (z(1) /= 2) error stop if (z(2) /= 3) error stop if (z(3) /= 4) error stop if (z(4) /= 5) error stop if (z(5) /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_24.f900000664000175000017500000000133015141516316024407 0ustar alastairalastairprogram intrinsics_24 implicit none integer(4) :: count, rate, max integer(8) :: count_64, rate_64, max_64 call system_clock(count, rate, max) write(*,*) count ! writes current count write(*,*) rate ! writes count rate write(*,*) max ! writes maximum count possible write(*,*) real(count)/real(rate) ! current count in seconds call system_clock(count_64, rate_64, max_64) write(*,*) count_64 ! writes current count write(*,*) rate_64 ! writes count rate write(*,*) max_64 ! writes maximum count possible write(*,*) real(count_64)/real(rate_64) ! current count in seconds end program lfortran-lfortran-2f73434/integration_tests/arrays_51.f900000664000175000017500000000072215141516316023527 0ustar alastairalastair! Check that lcompilers_get_i() returns mutated value of i not just hard coded value of 4 module arrays_51_mod IMPLICIT NONE integer :: i = 4 integer :: arr_mod(4,6) contains subroutine sub (arr) integer , INTENT(OUT):: arr(4,i) print *,size(arr) if(size(arr) /= 24) error stop end subroutine sub end module arrays_51_mod program arrays_51 use arrays_51_mod i = 6 call sub(arr_mod) end program arrays_51 lfortran-lfortran-2f73434/integration_tests/openmp_24.f900000664000175000017500000000075615141516316023533 0ustar alastairalastairprogram openmp_24 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) allocate(b(n)) call omp_set_num_threads(4) !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/generic_interface_function_call_of_function_call.f900000664000175000017500000000446015141516316033644 0ustar alastairalastairmodule stdlib_linalg implicit none ! Define the generic interface 'diag' interface diag procedure :: diag_iint16_mat ! Handles matrix to vector procedure :: diag_iint16_vec ! Handles vector to matrix end interface contains ! Function to extract the diagonal of a matrix module function diag_iint16_mat(A) result(res) integer(4), intent(in) :: A(:,:) integer(4) :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i, i) end do end function diag_iint16_mat ! Function to create a diagonal matrix from a vector module function diag_iint16_vec(v) result(res) integer(4), intent(in) :: v(:) integer(4) :: res(size(v), size(v)) integer :: i, j ! Initialize the result matrix to zero res = 0 ! Assign the vector elements to the diagonal of the matrix do i = 1, size(v) res(i, i) = v(i) end do end function diag_iint16_vec ! Test subroutine to demonstrate diag(diag(a)) subroutine test_diag_int16() integer, parameter :: n = 4 integer(4) :: a(n, n), d(n**2) integer(4) :: e(n, n) integer :: j ! Initialize the array 'd' with values from 1 to n^2 do j = 1, n**2 d(j) = j end do ! Reshape 'd' into an n x n matrix 'a' a = reshape(d, [n, n]) ! Apply diag twice: first to extract the diagonal vector, ! then to create a diagonal matrix e = diag(diag(a)) ! Optional: Print the results for verification print *, "Matrix a:" do j = 1, n print *, a(j, :) end do print *, "Diagonal of a:" print *, diag(a) if (any(diag(a) /= [1, 6, 11, 16])) error stop print *, "diag(diag(a)):" print *, e(1, :) if (any(e(1, :) /= [1, 0, 0, 0])) error stop print *, e(2, :) if (any(e(2, :) /= [0, 6, 0, 0])) error stop print *, e(3, :) if (any(e(3, :) /= [0, 0, 11, 0])) error stop print *, e(4, :) if (any(e(4, :) /= [0, 0, 0, 16])) error stop end subroutine test_diag_int16 end module stdlib_linalg program main use stdlib_linalg implicit none call test_diag_int16() end program main lfortran-lfortran-2f73434/integration_tests/entry_05.f900000664000175000017500000000063515141516316023371 0ustar alastairalastairsubroutine dzror(n, r) implicit none double precision abstol,reltol,zx intrinsic abs,max double precision ftol integer n real r(n) ftol(zx) = 0.5d0*max(abstol,reltol*abs(zx)) r = -83.03 entry dstzr() return end program entry_05 real :: r(10) integer :: i call dzror(10, r) do i = 1, 10 if (abs(r(i) - (-83.03)) > 1e-8) error stop end do print *, r end program lfortran-lfortran-2f73434/integration_tests/modules_64.f900000664000175000017500000000063615141516316023706 0ustar alastairalastairMODULE xmod REAL(kind(1d0)) :: x = -666 END MODULE xmod PROGRAM modules_64 USE xmod USE xmod, ONLY: xrenamed => x REAL :: x x = 666 if (kind(xrenamed) == kind(x)) error stop if (xrenamed /= -666) error stop if (x /= 666) error stop if (kind(xrenamed) /= 8) error stop if (kind(x) /= 4) error stop END PROGRAM modules_64 lfortran-lfortran-2f73434/integration_tests/string_22.f900000664000175000017500000000062015141516316023527 0ustar alastairalastairprogram test_string_22 implicit none type :: string character(:), allocatable :: s end type type(string) :: a, b a%s = "abc" b = a print *, a%s, b%s if (a%s /= "abc") error stop if (b%s /= "abc") error stop b%s = "xyz" print *, a%s, b%s if (a%s /= "abc") error stop if (b%s /= "xyz") error stop a%s = "def" print *, a%s, b%s if (a%s /= "def") error stop if (b%s /= "xyz") error stop end program lfortran-lfortran-2f73434/integration_tests/string_41.f900000664000175000017500000000063115141516316023532 0ustar alastairalastairprogram string_41 print *, real_sp_to_string() if (real_sp_to_string() /= 'TestingLFortran') error stop contains pure function real_sp_to_string() result(string) character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer buffer = 'TestingLFortran' string = trim(buffer) end function real_sp_to_string end program lfortran-lfortran-2f73434/integration_tests/intrinsics_97.f900000664000175000017500000000022215141516316024420 0ustar alastairalastairprogram intrinsics_97 real(4) a real(8) b print*, tiny(a) print*, tiny(b) print*, kind(tiny(a)) print*, kind(tiny(b)) end lfortran-lfortran-2f73434/integration_tests/openmp_08.f900000664000175000017500000000125115141516316023524 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n real, intent(out) :: ctr real :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * 1.5 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_08 use omp_lib integer, parameter :: n = 10 real :: ctr real :: res = 1.5**10 call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs((ctr - res)) > 0.0002 ) error stop end program lfortran-lfortran-2f73434/integration_tests/doconcurrentloop_02.f900000664000175000017500000000064615141516316025626 0ustar alastairalastairprogram doconcurrentloop_02 implicit none real, dimension(10) :: a real :: sum integer :: N, i N = size(a) sum = 0 do concurrent (i = 1:N) a(i) = a(i-1) + 5 end do call arraySum(a, sum) contains subroutine arraySum(a, sum) real, intent(in) :: a(:) real, intent(out) :: sum do concurrent (i = 1:N) reduce(+: s) sum = sum + a(i) end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/template_matrix_01.f900000664000175000017500000000402315141516316025416 0ustar alastairalastairmodule template_matrix_01_m implicit none private public :: matrix_t requirement elemental_op(t, op) type, deferred :: t pure elemental function op(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function end requirement template matrix_t(t, plus, times, n) require :: elemental_op(t, plus), elemental_op(t, times) integer :: n private public :: add_matrix type :: matrix type(t) :: elements(n, n) end type contains pure function add_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r r%elements = plus(a%elements, b%elements) end function pure function mul_matrix(a, b) result(r) type(matrix), intent(in) :: a, b type(matrix) :: r type(t) :: dot(n) type(t) :: temp integer :: i, j, k do i = 1, n do j = 1, n dot = times(a%elements(i,:), b%elements(:,j)) temp = dot(1) do k = 2, n temp = plus(temp, dot(i)) end do r%elements(i,j) = temp end do end do end function end template end module program template_matrix_01 use template_matrix_01_m integer, parameter :: n = 2 integer :: i, j instantiate matrix_t(integer, operator(+), operator(*), n), & only: int_matrix => matrix, & int_add_matrix => add_matrix, & int_mul_matrix => mul_matrix type(int_matrix) :: am, bm, cm, dm do i = 1, n do j = 1, n am%elements(i,j) = i bm%elements(i,j) = i end do end do cm = int_add_matrix(am, bm) dm = int_mul_matrix(am, bm) print *, cm%elements(1,1), cm%elements(1,2) print *, cm%elements(2,1), cm%elements(2,2), achar(10) print *, dm%elements(1,1), dm%elements(1,2) print *, dm%elements(2,1), dm%elements(2,2) end programlfortran-lfortran-2f73434/integration_tests/modules_15c.c0000664000175000017500000000665215141516316023675 0ustar alastairalastair#include #include "modules_15c.h" int f_int_float(int *a, float *b) { return *a + *b; } int f_int_double(int *a, double *b) { return *a + *b; } int f_int_float_complex(int *a, float_complex_t *b) { return *a + crealf(*b) + cimagf(*b); } int f_int_double_complex(int *a, double_complex_t *b) { return *a + creal(*b) + cimag(*b); } int f_int_float_complex_value(int a, float_complex_t b) { return a + crealf(b) + cimagf(b); } int f_int_double_complex_value(int a, double_complex_t b) { return a + creal(b) + cimag(b); } float_complex_t f_float_complex_value_return(float_complex_t b) { float_complex_t r; #if _WIN32 r = _FCmulcr(b, 2.0); #else r = b * 2; #endif return r; } double_complex_t f_double_complex_value_return(double_complex_t b) { double_complex_t r; #if _WIN32 r = _Cmulcr(b, 2.0); #else r = b * 2; #endif return r; } int f_int_float_value(int a, float b) { return a + b; } int f_int_double_value(int a, double b) { return a + b; } int f_int_intarray(int n, int *b) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } double f_int_doublearray(int n, double *b) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray_star(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } // -------------------------------------------------------------------- void sub_int_float(int *a, float *b, int *r) { *r = *a + *b; } void sub_int_double(int *a, double *b, int *r) { *r = *a + *b; } void sub_int_float_complex(int *a, float_complex_t *b, int *r) { *r = *a + crealf(*b) + cimagf(*b); } void sub_int_double_complex(int *a, double_complex_t *b, int *r) { *r = *a + creal(*b) + cimag(*b); } void sub_int_float_value(int a, float b, int *r) { *r = a + b; } void sub_int_double_value(int a, double b, int *r) { *r = a + b; } void sub_int_float_complex_value(int a, float_complex_t b, int *r) { *r = a + crealf(b) + cimagf(b); } void sub_int_double_complex_value(int a, double_complex_t b, int *r) { *r = a + creal(b) + cimag(b); } void sub_int_intarray(int n, int *b, int *r) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_floatarray(int n, float *b, float *r) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_doublearray(int n, double *b, double *r) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } int f_string(char *s) { return strlen(s); } int32_t call_fortran_i32(int32_t i) { return fortran_i32(&i); } int32_t call_fortran_i32_value(int32_t i) { return fortran_i32_value(i); } int64_t call_fortran_i64(int64_t i) { return fortran_i64(&i); } int64_t call_fortran_i64_value(int64_t i) { return fortran_i64_value(i); } float call_fortran_f32(float i) { return fortran_f32(&i); } float call_fortran_f32_value(float i) { return fortran_f32_value(i); } double call_fortran_f64(double i) { return fortran_f64(&i); } double call_fortran_f64_value(double i) { return fortran_f64_value(i); } lfortran-lfortran-2f73434/integration_tests/separate_compilation_14a.f900000664000175000017500000000021715141516316026567 0ustar alastairalastairmodule separate_compilation_14a_module integer :: global_var integer :: global_var_initialised = 89 end module separate_compilation_14a_module lfortran-lfortran-2f73434/integration_tests/complex_05.f900000664000175000017500000000043515141516316023675 0ustar alastairalastairprogram complex_05 implicit none complex, parameter :: x = (1.0,-3.0) real, parameter :: a = 3.0, b = 4.0 complex, parameter :: y = (a, b) complex, parameter :: i_ = (0, 1) complex, parameter :: z = a + i_*b complex, parameter :: w = a+b + i_*(a-b) print *, x, y, z, w end program lfortran-lfortran-2f73434/integration_tests/program_cmake_01.f900000664000175000017500000000023315141516316025025 0ustar alastairalastair! This is a test program that CMake uses to check that the Fortran compiler is ! working. PROGRAM TESTFortran PRINT *, 'Hello' END lfortran-lfortran-2f73434/integration_tests/arrays_intrin_06.f900000664000175000017500000000047515141516316025117 0ustar alastairalastairprogram arrays_intrin_06 integer :: i, j integer, parameter :: dp = kind(0.d0) real(dp) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = (i + j) / 7._dp end do end do print *, minval(x) if (abs(minval(x) - 0.28571428571428570) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_29.f900000664000175000017500000000046415141516316024246 0ustar alastairalastairprogram function_29 implicit none integer, allocatable :: x(:) allocate(x(2)) x = [1, 2] call my_func(x) contains subroutine my_func(arr) integer, intent(in) :: arr(2) print *, arr if (any(arr /= [1, 2])) error stop end subroutine my_func end program function_29 lfortran-lfortran-2f73434/integration_tests/openmp_63.f900000664000175000017500000000464115141516316023533 0ustar alastairalastairprogram openmp_63 use omp_lib implicit none integer, parameter :: n = 100 integer, parameter :: max_threads = 8 integer :: i, tid, nthreads integer :: thread_iterations(1:max_threads) = 0 ! Count iterations per thread integer :: thread_first(1:max_threads) = 1000 ! First iteration for each thread integer :: thread_last(1:max_threads) = -1 ! Last iteration for each thread integer :: expected_chunk_size logical :: test_passed = .true. ! Set number of threads call omp_set_num_threads(4) nthreads=0 !$omp parallel private(tid) !$omp single nthreads = omp_get_num_threads() !$omp end single !$omp end parallel print *, "Testing STATIC schedule with", nthreads, "threads" ! Test static schedule (default chunk) !$omp parallel do schedule(static) private(tid) do i = 1, n tid = omp_get_thread_num() + 1 !$omp critical thread_iterations(tid) = thread_iterations(tid) + 1 if (i < thread_first(tid)) thread_first(tid) = i if (i > thread_last(tid)) thread_last(tid) = i !$omp end critical end do !$omp end parallel do print*, thread_first(1:nthreads) print*, thread_last(1:nthreads) print*, thread_iterations(1:nthreads) ! Verify static behavior print *, "=== STATIC Schedule Results ===" expected_chunk_size = (n + nthreads - 1) / nthreads do i = 1, nthreads print '(A,I1,A,I3,A,I3,A,I3)', & "Thread ", i, ": iterations=", thread_iterations(i), & ", first=", thread_first(i), ", last=", thread_last(i) ! Static should give contiguous chunks if (thread_iterations(i) > 0) then ! Check contiguous iterations if (thread_last(i) - thread_first(i) + 1 /= thread_iterations(i)) then print *, "ERROR: Thread", i, "did not get contiguous iterations!" test_passed = .false. end if ! Check chunk sizes are roughly equal if (abs(thread_iterations(i) - expected_chunk_size) > 1) then print *, "ERROR: Thread", i, "chunk size deviates too much!" test_passed = .false. end if end if end do if (.not. test_passed) then error stop "STATIC schedule test FAILED!" end if print *, "STATIC schedule test PASSED!" end program openmp_63lfortran-lfortran-2f73434/integration_tests/string_20.f900000664000175000017500000000103615141516316023527 0ustar alastairalastairprogram string_20 use, intrinsic :: iso_c_binding, only : c_char, c_null_char implicit none print *, "working ok" contains subroutine f_c_character(rhs, lhs, len) character(kind=c_char), intent(out) :: lhs(*) character(len=*), intent(in) :: rhs integer, intent(in) :: len integer :: length length = min(len-1, len_trim(rhs)) lhs(1:length) = transfer(rhs(1:length), lhs(1:length)) lhs(length+1:length+1) = c_null_char end subroutine f_c_character end program lfortran-lfortran-2f73434/integration_tests/file_20.f900000664000175000017500000000066315141516316023145 0ustar alastairalastairprogram expr2 implicit none integer :: ios character(len=50) :: data character(len=50) :: temp temp = "apple" open(1, form="unformatted", file="file_20_tmp.dat") write(1, iostat=ios) temp close(1) print *, ios if (ios /= 0) error stop open(2, form="unformatted", file="file_20_tmp.dat") read(2) data close(2) print *, data if (trim(data) /= "apple") error stop end program lfortran-lfortran-2f73434/integration_tests/format_28.f900000664000175000017500000000267415141516316023532 0ustar alastairalastairprogram format_28 implicit none integer w,io character(12) fmt real :: x = -0.0 real, parameter :: a(4) = [ 1.0, 2.0, 3.0, 4.0 ] real, parameter :: b(4) = a / SUM(a) print "(4E11.3)", b do w = 6,9 write(fmt,'(A,I0,A)') '(A,ES',w,'.2E1)' write(*,fmt,iostat=io) fmt//' ',3e20 if(io/=0) cycle end do print "(ES6.2E1)", 3e20 print "(ES7.2E1)", 3e20 print "(ES8.2E2)", 3e20 print "(ES9.2E1)", 3e20 print "(ES10.2E1)", 3e20 print "(ES11.2E1)", 3e20 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0e0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 write(*,"(ES0.0E0)") 1.23456789E+10 write(*,"(ES0.0E0)") -1.23456789E+10 write(*, "(ES7.3E4)") 1.23456789E+10 write(*, "(ES7.3E4)") -1.23456789E+10 write(*,"(ES10.3E2)") 1.23e-40 write(*,"(ES10.3E2)") -1.23e-40 write(*,"(ES10.2E1)") 123.45 write(*,"(ES10.2E2)") 123.45 write(*,"(ES10.2E3)") 123.45 write(*,"(ES10.2E2)") 1.0e+2 write(*,"(ES10.2E2)") 1.0e+0 write(*,"(ES10.2E2)") 9.995e+0 write(*,"(SP,ES10.2E1)") 123.45 write(*,"(SS,ES10.2E1)") 123.45 write(*,"(ES4.1E1)") 3.14e+0 write(*,"(ES5.1E1)") 3.14e+0 write(*,"(ES6.1E1)") 0.0 write(*,"(ES0.0E0)") 0.0 print '(E7.2)', 289. print '(E7.2)', 289. print '(E8.2)', 289. print '(E7.2)', 0.289 print '(E9.2)', 1.23456789e+12 print '(E7.2)', -289. end program format_28 lfortran-lfortran-2f73434/integration_tests/openmp_bindc_02.f900000664000175000017500000000573015141516316024663 0ustar alastairalastairmodule module_openmp_bindc_02 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module module thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n, ctr end type thread_data end module thread_data_module subroutine lcompilers_increment_ctr(data) bind(C) use thread_data_module use iso_c_binding use module_openmp_bindc_02 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata integer(c_int) :: n, local_ctr integer(c_int) :: i, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if local_ctr = 0 do i = start + 1, end local_ctr = local_ctr + 1 end do call GOMP_barrier() call GOMP_atomic_start() tdata%ctr = tdata%ctr + local_ctr call GOMP_atomic_end() end subroutine subroutine increment_ctr(n, ctr) use thread_data_module use module_openmp_bindc_02 implicit none integer(c_int), intent(in) :: n integer(c_int), intent(inout) :: ctr type(thread_data), target :: data type(c_ptr) :: tdata interface subroutine lcompilers_increment_ctr(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface data%n = n data%ctr = ctr tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_increment_ctr), tdata, 0, 0) ctr = data%ctr end subroutine program openmp_bindc_02 use module_openmp_bindc_02 use thread_data_module implicit none integer(c_int) :: n = 1000000, ctr call omp_set_num_threads(4) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-lfortran-2f73434/integration_tests/read_12.f900000664000175000017500000000105515141516316023136 0ustar alastairalastairprogram read_12 implicit none complex :: z4 complex(8) :: z8 open(10, file='_read_12_test.dat', status='replace') write(10, *) (1.0, 2.0) write(10, *) (3.0d0, 4.0d0) close(10) open(10, file='_read_12_test.dat', status='old') read(10, *) z4 read(10, *) z8 close(10, status='delete') if (abs(real(z4) - 1.0) > 1e-5) error stop if (abs(aimag(z4) - 2.0) > 1e-5) error stop if (abs(real(z8) - 3.0d0) > 1d-10) error stop if (abs(aimag(z8) - 4.0d0) > 1d-10) error stop print *, "OK" end program lfortran-lfortran-2f73434/integration_tests/format_05.f900000664000175000017500000000050615141516316023515 0ustar alastairalastairprogram format_05 real :: a,b,c,d character(100) :: s a = 123.456 b = 123.45678 c = 12.34 d = 123.45 print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2,f10.3)', -a, b, -c, d, d write (s, '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)') -a, b, -c, d if (trim(s) /= " -0.01E+04 0.001235E+05 -1.23E+01 1.23E+02") error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_70.f900000664000175000017500000000103115141516316023517 0ustar alastairalastair! For OMP C Target Constructs Dump program openmp_70 implicit none real :: a(1000000), b(1000000) integer :: i b=5 a=0 !$omp target map(tofrom:a, b) !$omp teams !$omp distribute parallel do do i = 1, 1000000 a(i) = i + b(i)*340 end do !$omp end distribute parallel do !$omp end teams !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_70lfortran-lfortran-2f73434/integration_tests/select_type_15.f900000664000175000017500000000351315141516316024547 0ustar alastairalastair! Testing nested variable (structType) `ll` module select_type_15 implicit none type, abstract :: abstract_t integer :: i end type type, extends(abstract_t) :: tt integer, allocatable :: arr(:) end type integer, parameter :: CONSTANT_NUMBER = 101 contains subroutine xx(ll_abstract) class(abstract_t), intent(inout) :: ll_abstract call nested1() ! Verify changed `i` value print *, ll_abstract%i if(ll_abstract%i /= -1) ERROR STOP ! Verify changed `arr` value select type(ll_abstract) type is(tt) print *, ll_abstract%arr(10) if(ll_abstract%arr(10) /= -1) error stop class default print *, "Unknown ll type" error stop end select contains subroutine nested1() call ss(ll_abstract) end subroutine nested1 end subroutine xx subroutine ss(ll_abstract) class(abstract_t), intent(inout) :: ll_abstract ! select on type + Check member value + Change it select type(ll_abstract) type is(tt) print *, "This is a tt" PRINT *, "ll_abstract%i =", ll_abstract%i IF(ll_abstract%i /=CONSTANT_NUMBER) ERROR STOP print *, ll_abstract%arr(10) IF(ll_abstract%arr(10) /= 1) error stop ll_abstract%i = -1 ll_abstract%arr(10) = -1 class default print *, "Unknown type" error stop end select end subroutine end module select_type_15 program select_type_15_prog use select_type_15 implicit none type(tt) :: ll ll%i = CONSTANT_NUMBER allocate(ll%arr(10)) ll%arr = 1 call xx(ll) end programlfortran-lfortran-2f73434/integration_tests/select_type_19.f900000664000175000017500000000116615141516316024555 0ustar alastairalastairmodule select_type_19_m implicit none contains subroutine takes_logical_array(a) logical, intent(in) :: a(:) if (count(a) /= 2) error stop end subroutine takes_logical_array end module select_type_19_m program select_type_19 use select_type_19_m, only: takes_logical_array implicit none logical, target :: l(3) class(*), pointer :: generic(:) l = [.true., .false., .true.] generic => l select type (generic) type is (logical) call takes_logical_array(generic) class default error stop end select print *, "ok" end program select_type_19 lfortran-lfortran-2f73434/integration_tests/file_35.f900000664000175000017500000000062215141516316023146 0ustar alastairalastairprogram file_35 implicit none integer :: lun, ios = 8 character(len=100) :: message open(newunit=lun, file="file_35_test.txt", status="replace") close(unit=lun, iostat=ios, iomsg=message) print *, ios if (ios /= 0) then print *, "Close error:", trim(message) error stop else print *, "File closed successfully." end if end program file_35 lfortran-lfortran-2f73434/integration_tests/intrinsics_271.f900000664000175000017500000000205515141516316024500 0ustar alastairalastairprogram intrinsics_271 implicit none integer(4), parameter :: i1 = leadz(1050) integer(8), parameter :: i2 = leadz(00) integer, parameter :: ar1(3) = leadz([82471095, 829012001, 039024800]) integer(4) :: i3 = 283200001 integer(8) :: i4 = 289000001 integer(4) :: arr1(3) = [82471095, 829012001, 039024800] integer(8) :: arr2(3) = [13471095, 8290000, 0392414800] print *, i1 if (i1 /= 21) error stop print *, i2 if (i2 /= 32) error stop print *, ar1 if (any(ar1 /= [5, 2, 6])) error stop print *, leadz(i3) if (leadz(i3) /= 3) error stop print *, leadz(i4) if (leadz(i4) /= 35) error stop print *, leadz(arr1) if (any(leadz(arr1) /= [5, 2, 6])) error stop print *, leadz(arr2) if (any(leadz(arr2) /= [40, 41, 35])) error stop print *, kind(leadz(0)) if (kind(leadz(0)) /= 4) error stop print *, kind(leadz(0_4)) if (kind(leadz(0_4)) /= 4) error stop print *, kind(leadz(0_8)) ! if (kind(leadz(0_8)) /= 4) error stop ! Gives wrong output #4361 end programlfortran-lfortran-2f73434/integration_tests/arrays_64.f900000664000175000017500000000016515141516316023534 0ustar alastairalastairprogram array_64 integer :: X(2) X = [0,1] X(X + 1) = 11235 print *, X if ( any(X /= 11235) ) error stop end program lfortran-lfortran-2f73434/integration_tests/data_09.f900000664000175000017500000000022515141516316023140 0ustar alastairalastairprogram data_09 integer vect(3350), i data vect /3350*2/ do i = 1, 3350 if (vect(i) /= 2) error stop end do end program lfortran-lfortran-2f73434/integration_tests/modules_30_module3.f900000664000175000017500000000116415141516316025324 0ustar alastairalastairmodule fpm_manifest_executable_modules_30 implicit none public :: executable_config type :: executable_config character(len=:), allocatable :: name character(len=:), allocatable :: source_dir character(len=:), allocatable :: main end type executable_config contains subroutine default_executable(self, name) type(executable_config), intent(out) :: self character(len=*), intent(inout) :: name self%name = name self%source_dir = "app" self%main = "main.f90" end subroutine default_executable end module fpm_manifest_executable_modules_30 lfortran-lfortran-2f73434/integration_tests/case_07.f900000664000175000017500000000175715141516316023153 0ustar alastairalastairprogram case_07 implicit none if (test_case('a') /= "a:j") error stop if (test_case('d') /= "a:j") error stop if (test_case('l') /= "l:p") error stop if (test_case('p') /= "l:p") error stop if (test_case('z') /= "z") error stop if (test_case('k') /= "not found") error stop if (test_case('r') /= "not found") error stop contains function test_case(c) result(res) character(len=1), intent(in) :: c character(len=10) :: res select case (c) case ('a' : 'j') res = "a:j" print *, 'one of the first ten letters' case ('l' : 'p') res = "l:p" print *, 'one of l, m, n, o, p' case ('z') res = "z" print *, 'one of z' case default res = "not found" print *, 'other characters, which may not be letters' end select end function test_case end program case_07 lfortran-lfortran-2f73434/integration_tests/derived_types_23.f900000664000175000017500000000044015141516316025070 0ustar alastairalastairmodule derived_types_23_vtk90m contains subroutine vtk90() implicit none character(len=6) :: description description = " abc" print *, adjustl(description) end subroutine vtk90 end module program derived_types_23 use derived_types_23_vtk90m call vtk90() end program lfortran-lfortran-2f73434/integration_tests/format_22.f900000664000175000017500000000237215141516316023517 0ustar alastairalastairprogram format_22 implicit none integer :: x, y, z integer(8) :: x8, y8, z8 integer(1) :: x1, y1, z1 integer(2) :: x2, y2, z2 x = 21 y = 100 z = 0 x8 = 31 y8 = 10 z8 = 0 x1 = 11 y1 = 10 z1 = 0 x2 = 9 y2 = 42 z2 = 0 print *, "b format for integer(4)" print '(B0)', x print '(B1)', x print '(B2)', x print '(B3)', x print '(B4)', x print '(B5)', x print '(B6)', x print '(B7)', x print '(B8)', x print '(B9)', x print '(B10)', x print "(a,b32,a)",'-1 in b32 format: "', -1,'"' print "(a,b0 ,a)",'-1 in b0 format: "', -1,'"' print "(a,b32 ,a)",'10 in b32 format: "', 10,'"' print "(a,b0 ,a)",'11 in b0 format: "', 11,'"' print '(B0)', y print '(B4)', y print '(B5)', y print '(B10)', y print '(B0)', z print '(B4)', z print *, "b format for integer(8)" print '(B0)', x8 print '(B7)', x8 print '(B4)', y8 print '(B5)', y8 print '(B10)', z8 print '(B0)', z8 print *, "b format for integer(1)" print '(B4)', x1 print '(B5)', x1 print '(B10)', y1 print '(B0)', y1 print '(B4)', z1 print '(B5)', z1 print *, "b format for integer(2)" print '(B10)', x2 print '(B0)', x2 print '(B4)', y2 print '(B5)', y2 print '(B10)', z2 print '(B0)', z2 end program format_22lfortran-lfortran-2f73434/integration_tests/file_10.f900000664000175000017500000000244115141516316023140 0ustar alastairalastairprogram file_10 implicit none character(:), allocatable :: sentence1 character(:), allocatable :: sentence2 character(:), allocatable :: sentence3 character(:), allocatable :: sentence4 character :: c integer :: u = 11, iostat, i open(u, file="file_10_data.txt", form="formatted", access="stream", status="old") sentence1 = get_prompt(u) print *, sentence1 if (sentence1 /= "hello hi bye.") error stop sentence2 = get_prompt(u) print *, sentence2 if (sentence2 /= "1234\nhi hello \n abcd!?") error stop sentence3 = get_prompt(u) print *, sentence3 if (sentence3 /= "\n ajdfsalfj;as\n \r jdalfk\14") error stop sentence4 = get_prompt(u) print *, sentence4 if (sentence4 /= "dsfjlkf\r\tjkdlfas\n\r\t\n") error stop rewind(u) do i = 1, 14 read(u, "(a)", advance="no", iostat=iostat) c end do print*, iostat if (iostat /= -2) error stop contains function get_prompt(fp) result(input) integer, intent(in) :: fp character(:), allocatable :: input character(1024) :: tmp integer ::ios read(fp, "(a)", iostat=ios) tmp if (ios == 0) then input = trim(tmp) else input = "" end if end function end program lfortran-lfortran-2f73434/integration_tests/functions_38.f900000664000175000017500000000121115141516316024235 0ustar alastairalastairmodule utils implicit none contains subroutine stop_error(msg) character(len=*) :: msg ! Message to print on stdout print *, msg end subroutine end module module error_util use utils, only: stop_error implicit none contains integer function error(err, eps) result(r) real(8), intent(in) :: err, eps print "('Test failed: error = ', es10.2, ' > ', es10.2, ' specified.')", & err, eps call stop_error("Aborting...") r = 0 end function end module program functions_38 use error_util, only: error implicit none call driver() contains subroutine driver() integer :: tmp tmp = error(1.0_8, 0.0_8) end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_53.f900000664000175000017500000000014015141516316023523 0ustar alastairalastairprogram arrays_53 logical :: k(5) = .false. print *, "k: ", k if(any(k)) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_18a.f900000664000175000017500000000032115141516316026567 0ustar alastairalastairmodule mod_separate_compilation_18 implicit none interface module function f(a) result(r) integer, intent(in) :: a integer :: r end function end interface end modulelfortran-lfortran-2f73434/integration_tests/allocate_30.f900000664000175000017500000000321315141516316024005 0ustar alastairalastairprogram allocate_30 implicit none call test_fixed_length_char_array() call test_deferred_length_char_array() call test_zero_size_char_array() contains subroutine test_fixed_length_char_array() character(len=10), allocatable :: from(:), to(:) allocate(from(3)) from(1) = "Hello" from(2) = "World" from(3) = "Test" call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 3) error stop if (len(to) /= 10) error stop if (to(1) /= "Hello") error stop if (to(2) /= "World") error stop if (to(3) /= "Test") error stop end subroutine test_fixed_length_char_array subroutine test_deferred_length_char_array() character(len=:), allocatable :: from(:), to(:) allocate(character(len=5) :: from(2)) from(1) = "12345" from(2) = "abcde" call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 2) error stop if (len(to) /= 5) error stop if (to(1) /= "12345") error stop if (to(2) /= "abcde") error stop end subroutine test_deferred_length_char_array subroutine test_zero_size_char_array() character(len=:), allocatable :: from(:), to(:) allocate(character(len=8) :: from(0)) call move_alloc(from, to) if (allocated(from)) error stop if (.not. allocated(to)) error stop if (size(to) /= 0) error stop if (len(to) /= 8) error stop end subroutine test_zero_size_char_array end program allocate_30lfortran-lfortran-2f73434/integration_tests/string_73.f900000664000175000017500000000063015141516316023536 0ustar alastairalastair! Test allocatable integer as substring bounds program string_73 character(6):: str integer, allocatable :: ii integer, allocatable :: ii2 str = "Hello!" allocate(ii) allocate(ii2) ii = 6 if(str(3:ii) /= "llo!") error stop ii2 = 3 if(str(ii2:6) /= "llo!") error stop ii = 3 ii2 = 6 if(str(ii:ii2) /= "llo!") error stop end program string_73lfortran-lfortran-2f73434/integration_tests/nested_vars2.f900000664000175000017500000000065115141516316024321 0ustar alastairalastairmodule nested_vars2 implicit none contains subroutine h(x) integer, intent(inout) :: x x = x + 1 return call g() contains subroutine g() x = x + 1 end subroutine end subroutine end module program nested_vars2_main use nested_vars2, only: h implicit none integer :: x x = 5 call h(x) print *, x if (x /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/expr_06.f900000664000175000017500000000011215141516316023175 0ustar alastairalastairprogram expr_06 implicit none integer :: x = 3 + 6 print *, x end program lfortran-lfortran-2f73434/integration_tests/functions_35.f900000664000175000017500000000134315141516316024240 0ustar alastairalastairmodule global_dims implicit none integer, parameter :: nt_g=5 integer, parameter :: np_g=7 end module program functions_35 use global_dims implicit none real, dimension(:, :), allocatable, target :: br0_g allocate(br0_g(nt_g, np_g)) call sub1(br0_g) end program functions_35 subroutine sub1 (br0_g) use global_dims implicit none real, dimension(nt_g,np_g) :: br0_g real :: sum0 call sub2 (nt_g-2,np_g-2, br0_g(2:4,2:6)) sum0=sum(br0_g(2,2:6)) print *, "sum0: ", sum0 if (sum0 /= 1.21607137) error stop end subroutine subroutine sub2 (nx,ny,f) implicit none integer :: nx,ny real, dimension(nx,ny) :: f f = 2.43214264512062073e-01 return end subroutine lfortran-lfortran-2f73434/integration_tests/nested_01.f900000664000175000017500000000045615141516316023507 0ustar alastairalastairmodule nested_01_a implicit none contains integer function b() integer e print *, "b()" e = d() b = 0 contains integer function d() print *, "d()" d = 1 end function d end function b end module program nested_01 use nested_01_a, only: b implicit none integer c c = b() end lfortran-lfortran-2f73434/integration_tests/intrinsics_38.f900000664000175000017500000000177115141516316024425 0ustar alastairalastairprogram intrinsics_38 implicit none character(len=25) :: empty = adjustr('') character(len=25) :: all_spaces = adjustr(' ') character(len=25) :: simple = adjustr('gfortran') character(len=25) :: space_at_start = adjustr(' gfortran') character(len=25) :: space_at_end = adjustr('gfortran ') character(len=25) :: space_in_between = adjustr(' g for tran ') character(len=25) :: spaces_with_symbols = adjustr(' # gfor* t $ ran & ') if (empty /= '') error stop if (all_spaces /= ' ') error stop if (simple /= 'gfortran') error stop if (space_at_start /= ' gfortran') error stop if (space_at_end /= ' gfortran') error stop if (space_in_between /= ' g for tran') error stop if (spaces_with_symbols /= ' # gfor* t $ ran &') error stop print *, empty print *, all_spaces print *, simple print *, space_at_start print *, space_at_end print *, space_in_between print *, spaces_with_symbols end programlfortran-lfortran-2f73434/integration_tests/arrays_20.f900000664000175000017500000000053715141516316023527 0ustar alastairalastairprogram arrays_20 implicit none integer, allocatable :: list_integer(:) logical, allocatable :: list_logical(:) character(len=5), allocatable :: list_character(:) list_integer = [integer ::] list_logical = [logical ::] list_character = [character(len=len(list_character)) ::] end program arrays_20 lfortran-lfortran-2f73434/integration_tests/arrays_32.f900000664000175000017500000000177315141516316023535 0ustar alastairalastairprogram array_32 implicit none type :: der_type real :: r integer :: i end type real, dimension(5) :: a, b complex, dimension(6) :: x integer, dimension(3) :: c logical, dimension(2) :: d type(der_type), dimension(7) :: p real, dimension(2,3) :: e complex, dimension(6,8) :: y integer, dimension(3,4) :: f logical, dimension(5,2) :: g type(der_type), dimension(7,9) :: q real, dimension(2:3,3:4,4:5) :: h complex, dimension(6:7,8:10,11:13) :: z integer, dimension(3:4,4:5,3:4) :: i logical, dimension(5:6,2:3,2:4) :: j type(der_type), dimension(7:10,9:15,16:18) :: r if( lbound(p, 1) /= 1 ) error stop if( ubound(p, 1) /= 7 ) error stop if( lbound(q, 1) /= 1 ) error stop if( ubound(q, 1) /= 7 ) error stop if( lbound(q, 2) /= 1 ) error stop if( ubound(q, 2) /= 9 ) error stop if( lbound(r, 1) /= 7 ) error stop if( ubound(r, 1) /= 10 ) error stop if( lbound(r, 2) /= 9 ) error stop if( ubound(r, 2) /= 15 ) error stop if( lbound(r, 3) /= 16 ) error stop if( ubound(r, 3) /= 18 ) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_23.f900000664000175000017500000000007515141516316023676 0ustar alastairalastairprogram module_23 use string_module implicit none end programlfortran-lfortran-2f73434/integration_tests/CMakeLists.txt0000664000175000017500000064704115141516316024154 0ustar alastairalastaircmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(lfort C Fortran) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (Debug, Release)" FORCE) endif () set(LFORTRAN_BACKEND no CACHE STRING "Only compile the LFortran subset for the given backend") set(FAST no CACHE BOOL "Run supported tests with --fast") set(NOFAST_LLVM16 no CACHE BOOL "Don't run unsupported tests with --fast when llvm < 17") set(STD_F23 no CACHE BOOL "Run tests with --std-f23") set(LLVM_GOC no CACHE BOOL "Run tests with --separate-compilation") enable_testing() message("\n") message("Configuration results") message("---------------------") message("Fortran compiler: ${CMAKE_Fortran_COMPILER}") message("C compiler : ${CMAKE_C_COMPILER}") message("Build type: ${CMAKE_BUILD_TYPE}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) message("Fortran compiler flags: ${CMAKE_Fortran_FLAGS_${BTYPE}}") message("C compiler flags : ${CMAKE_C_FLAGS_${BTYPE}}") message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") message("LFORTRAN_BACKEND: ${LFORTRAN_BACKEND}") message("FAST: ${FAST}") message("NEW_CLASSES: ${NEW_CLASSES}") message("NOFAST_LLVM16: ${NOFAST_LLVM16}") message("STD_F23: ${STD_F23}") message("LLVM_GOC: ${LLVM_GOC}") macro(RUN_UTIL RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) set(fail ${${RUN_FAIL}}) set(name ${${RUN_NAME}}) set(file_name ${${RUN_FILE_NAME}}) set(labels ${${RUN_LABELS}}) set(extra_files ${${RUN_EXTRAFILES}}) set(extra_args ${${RUN_EXTRA_ARGS}}) set(copy_to_bin ${${RUN_COPY_TO_BIN}}) set(gfortran_args ${${RUN_GFORTRAN_ARGS}}) if (NOT name) message(FATAL_ERROR "Must specify the NAME argument") endif() if (LFORTRAN_BACKEND) if (${LFORTRAN_BACKEND} IN_LIST labels) # Test is supported by the given LFortran backend set(ADD_TEST ON) else() # Test is not supported by the given LFortran backend set(ADD_TEST OFF) endif() else() # GFortran if ("gfortran" IN_LIST labels) set(ADD_TEST ON) elseif ("gfortranImplicitArgument" IN_LIST labels) set(ADD_TEST ON) else() set(ADD_TEST OFF) endif() endif() if (ADD_TEST) if ((LFORTRAN_BACKEND STREQUAL "cpp") OR (LFORTRAN_BACKEND STREQUAL "x86") OR (LFORTRAN_BACKEND STREQUAL "c") OR (LFORTRAN_BACKEND STREQUAL "fortran")) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=${LFORTRAN_BACKEND}) target_link_options(${name} PUBLIC --backend=${LFORTRAN_BACKEND}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "wasm") # wasm test execute_process(COMMAND lfortran ${extra_args} --backend=wasm ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) find_program(WASM_EXEC_RUNTIME node) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX REPLACE "v([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" NODE_MAJOR_VERSION "${WASM_EXEC_VERSION}") if (NODE_MAJOR_VERSION LESS 16) message(STATUS "${WASM_EXEC_RUNTIME} version: ${WASM_EXEC_VERSION}") set(WASM_EXEC_FLAGS "--experimental-wasm-bigint") endif() set(WASM_EXEC_FLAGS ${WASM_EXEC_FLAGS} "--experimental-wasi-unstable-preview1") add_test(${name} ${WASM_EXEC_RUNTIME} ${WASM_EXEC_FLAGS} ${CURRENT_BINARY_DIR}/${name}.js) elseif (LFORTRAN_BACKEND STREQUAL "llvm_wasm") find_program(WASM_EXEC_RUNTIME wasmtime) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=llvm --target=wasm32-wasi) target_link_options(${name} PUBLIC --backend=llvm --target=wasm32-wasi -Wl,-zstack-size=52428800 -Wl,--initial-memory=268435456 -Wl,--max-memory=268435456) add_test(${name} ${WASM_EXEC_RUNTIME} ${CURRENT_BINARY_DIR}/${name} --dir=.) elseif (LFORTRAN_BACKEND STREQUAL "llvm_wasm_emcc") find_program(WASM_EXEC_RUNTIME node) execute_process(COMMAND "${WASM_EXEC_RUNTIME}" --version OUTPUT_VARIABLE WASM_EXEC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${extra_args} --backend=llvm --target=wasm32-unknown-emscripten) target_link_options(${name} PUBLIC --backend=llvm --target=wasm32-unknown-emscripten) if (copy_to_bin) target_link_options(${name} PUBLIC --emcc-embed ${copy_to_bin}) endif() add_test(${name} ${WASM_EXEC_RUNTIME} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm2") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --separate-compilation ${extra_args}) target_link_options(${name} PUBLIC --separate-compilation ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_rtlib") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --separate-compilation ${extra_args}) set_source_files_properties(${file_name}.f90 PROPERTIES COMPILE_OPTIONS "--rtlib") add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvmImplicit") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} --implicit-typing --implicit-interface -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvmStackArray") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} --stack-arrays=true -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_integer_8") execute_process(COMMAND lfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 ${extra_args} -fdefault-integer-8 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_nopragma") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --ignore-pragma ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "c_nopragma") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --backend=c --ignore-pragma ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_single_invocation") set(extra_files_full ${extra_files}) list(TRANSFORM extra_files_full PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command( OUTPUT ${CURRENT_BINARY_DIR}/${name} COMMAND lfortran -I${CMAKE_CURRENT_SOURCE_DIR} ${extra_args} ${extra_files_full} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${CURRENT_BINARY_DIR}/${name} DEPENDS ${extra_files_full} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(${name}_single_invocation ALL DEPENDS ${CURRENT_BINARY_DIR}/${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC $<$:${extra_args}>) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_omp") add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib ${extra_args}) target_link_options(${name} PUBLIC --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib ${extra_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) set_tests_properties(${name} PROPERTIES ENVIRONMENT "KMP_TEAMS_THREAD_LIMIT=32" ) elseif (LFORTRAN_BACKEND STREQUAL "target_offload") set(c_file "${CURRENT_BINARY_DIR}/${file_name}.c") execute_process( COMMAND lfortran ${extra_args} --openmp --show-c --target-offload ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 OUTPUT_FILE ${c_file} RESULT_VARIABLE convert_result ) configure_file( ${CMAKE_SOURCE_DIR}/../src/libasr/config.h.in ${CMAKE_SOURCE_DIR}/../src/libasr/config.h @ONLY ) add_executable(${name} ${CMAKE_SOURCE_DIR}/../src/libasr/runtime/lfortran_intrinsics.c ${CMAKE_SOURCE_DIR}/../src/libasr/runtime/cuda_cpu_runtime.c ${c_file} ) target_include_directories(${name} PUBLIC ${CMAKE_SOURCE_DIR}/../src/ ${CMAKE_SOURCE_DIR}/../src/libasr/runtime ) target_compile_options(${name} PUBLIC -fopenmp) target_link_libraries(${name} PUBLIC m) target_link_options(${name} PUBLIC -fopenmp) target_link_options(${name} PUBLIC -L$ENV{CONDA_PREFIX}/lib ${extra_args}) add_test(NAME ${name} COMMAND ${name}) elseif (LFORTRAN_BACKEND STREQUAL "llvm_submodule") set(object_files "") set(prev_file "") foreach(extra_file ${extra_files}) get_filename_component(obj_name ${extra_file} NAME_WE) add_library(${obj_name} OBJECT ${extra_file}) target_compile_options(${obj_name} PUBLIC $<$:${extra_args}>) if (prev_file) add_dependencies(${obj_name} ${prev_file}) endif() set(prev_file ${obj_name}) list(APPEND object_files $) endforeach() add_executable(${name} ${file_name}.f90 ${object_files}) target_compile_options(${name} PUBLIC $<$:${extra_args}>) add_dependencies(${name} ${prev_file}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "gfortranModfileCompilation") execute_process(COMMAND gfortran ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -c) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir") execute_process(COMMAND lfortran ${extra_args} --backend=mlir ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir_omp") execute_process(COMMAND lfortran ${extra_args} --backend=mlir --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib --mlir-gpu-offloading ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) elseif (LFORTRAN_BACKEND STREQUAL "mlir_llvm_omp") execute_process(COMMAND lfortran ${extra_args} --backend=llvm --openmp --openmp-lib-dir=$ENV{CONDA_PREFIX}/lib --mlir-gpu-offloading ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.f90 -o ${name}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) else () add_executable(${name} ${file_name}.f90 ${extra_files}) target_compile_options(${name} PUBLIC ${gfortran_args}) target_link_options(${name} PUBLIC ${gfortran_args}) add_test(${name} ${CURRENT_BINARY_DIR}/${name}) endif() if (labels) set_tests_properties(${name} PROPERTIES LABELS "${labels}") endif() if (fail) set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE) endif() if (copy_to_bin) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${copy_to_bin} DESTINATION ${CURRENT_BINARY_DIR}) endif() endif() endmacro(RUN_UTIL) macro(RUN) set(options FAIL NOFAST_TILL_LLVM16 NO_FAST NO_STD_F23 OLD_CLASSES NO_LLVM_GOC) set(oneValueArgs NAME FILE INCLUDE_PATH COPY_TO_BIN) set(multiValueArgs LABELS EXTRAFILES EXTRA_ARGS GFORTRAN_ARGS) cmake_parse_arguments(RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) foreach(b ${RUN_LABELS}) if (NOT (b MATCHES "^(llvm|llvm2|llvm_rtlib|c|cpp|x86|wasm|gfortran|llvmImplicit|llvmStackArray|llvm_integer_8|fortran|c_nopragma|llvm_nopragma|llvm_wasm|llvm_wasm_emcc|llvm_omp|target_offload|llvm_submodule|mlir|mlir_omp|mlir_llvm_omp|llvm_single_invocation)$")) message(FATAL_ERROR "Unsupported backend: ${b}") endif() endforeach() # Use FILE if provided, otherwise use NAME as the file name if (RUN_FILE) set(RUN_FILE_NAME ${RUN_FILE}) else() set(RUN_FILE_NAME ${RUN_NAME}) endif() if (RUN_INCLUDE_PATH) # Only one include path supported for now # Later add support for multiple include paths by looping over and appending to extra args set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} -I${CMAKE_CURRENT_SOURCE_DIR}/${RUN_INCLUDE_PATH}) set(RUN_GFORTRAN_ARGS ${RUN_GFORTRAN_ARGS} -I${CMAKE_CURRENT_SOURCE_DIR}/${RUN_INCLUDE_PATH}) endif() if ((STD_F23) AND (NOT RUN_NO_STD_F23)) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --std=f23) set(RUN_NAME "${RUN_NAME}_STD_F23") endif() if ((LLVM_GOC) AND (NOT RUN_NO_LLVM_GOC) AND (NOT LFORTRAN_BACKEND STREQUAL "fortran")) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --separate-compilation) set(RUN_NAME "${RUN_NAME}_LLVM_GOC") endif() if (RUN_OLD_CLASSES) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --old-classes) set(RUN_NAME "${RUN_NAME}_OLD_CLASSES") list(REMOVE_ITEM RUN_LABELS gfortran) RUN_UTIL(RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) elseif (FAST AND ((NOT NOFAST_LLVM16)) AND (NOT RUN_NO_FAST)) set(RUN_EXTRA_ARGS ${RUN_EXTRA_ARGS} --fast) set(RUN_NAME "${RUN_NAME}_FAST") list(REMOVE_ITEM RUN_LABELS gfortran) # remove gfortran from --fast test RUN_UTIL(RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) else () RUN_UTIL(RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXTRA_ARGS RUN_COPY_TO_BIN RUN_GFORTRAN_ARGS) endif() endmacro(RUN) # only compiles till object file # to make sure that the ASR generation is successful macro(COMPILE) set(oneValueArgs NAME) set(multiValueArgs COMPILERS) cmake_parse_arguments(COMPILE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(name ${COMPILE_NAME}) set(compilers ${COMPILE_COMPILERS}) if (NOT name) message(FATAL_ERROR "Must specify the NAME argument") endif() if (NOT compilers) message(FATAL_ERROR "Must specify the COMPILER argument") endif() foreach(compiler ${compilers}) if (compiler STREQUAL "lfortran" AND ${LFORTRAN_BACKEND} STREQUAL "llvm") add_custom_command( OUTPUT ${name}_lfortran.mod COMMAND lfortran -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.f90) add_library(${name}_lfortran OBJECT ${name}_lfortran.mod) elseif(compiler STREQUAL "gfortran" AND ${LFORTRAN_BACKEND} STREQUAL "no") add_custom_command( OUTPUT ${name}_gfortran.mod COMMAND gfortran -c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.f90) add_library(${name}_gfortran OBJECT ${name}_gfortran.mod) endif() endforeach() endmacro(COMPILE) # The supported test labels are: # # gfortran --- compile with GFortran # fortran --- convert to Fortran code and compile with GFortran # llvm --- compile with LFortran, only generate binary code at the very end # llvm2 --- compile with LFortran, generate object files # llvm_rtlib --- compile with LFortran loading ASR runtime library, generate object files # cpp --- compile to C++, compile C++ to binary # x86 --- compile to x86 binary directly # wasm --- compile to WASM binary directly # mlir --- generate mlir, convert to llvm ir and compile to binary # mlir_omp --- generate mlir with OpenMP, convert to llvm ir and compile to binary # llvm_single_invocation --- compile all sources in a single LFortran invocation # mlir_llvm_omp --- generate mlir for a module with OpenMP, convert and link # it with the existing llvm ir and compile to binary # `reduce` is not supported by GFortran yet: # RUN(NAME doconcurrentloop_02 LABELS gfortran) # GFortran + LFortran LLVM + LFortran C++ RUN(NAME program_cmake_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME program_cmake_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME internal_subr_host_vars_01 LABELS gfortran llvm) RUN(NAME nested_callback_arrays LABELS gfortran llvm) RUN(NAME abort_01 LABELS gfortran llvm) RUN(NAME error_stop_01 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm llvm2 fortran) RUN(NAME error_stop_02 FAIL LABELS llvm llvm_wasm llvm_wasm_emcc wasm llvm2 fortran) RUN(NAME error_stop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME error_stop_04 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME stop_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm llvm2 c fortran) RUN(NAME stop_02 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME stop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME ilp64_stop_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_file_ops_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_logical_read_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME ilp64_complex_literal_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME print_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp llvm2 wasm fortran mlir) RUN(NAME print_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm fortran) RUN(NAME print_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) # RUN(NAME print_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc OLD_CLASSES) RUN(NAME print_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2) RUN(NAME print_arr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_arr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 wasm c fortran) RUN(NAME print_arr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm2 fortran) RUN(NAME print_arr_04 LABELS llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --apply-fortran-mangling) RUN(NAME print_arr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME crlf_fixed_form LABELS gfortran llvm EXTRA_ARGS --fixed-form GFORTRAN_ARGS -ffixed-form) RUN(NAME print_arr_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran mlir) RUN(NAME print_arr_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME include_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME include_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME include_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran INCLUDE_PATH include_03) RUN(NAME use_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME use_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME use_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm) RUN(NAME use_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm) RUN(NAME volatile_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME volatile_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME volatile_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME cond_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME cond_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME cond_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cond_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cond_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cond_06 LABELS gfortran llvm) RUN(NAME complex_solutions LABELS gfortran llvm) RUN(NAME expr_01 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME expr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran mlir) RUN(NAME expr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran mlir) RUN(NAME expr_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME expr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp c fortran) # it contains pow, wasm supports only x**2 RUN(NAME expr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME expr_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME expr_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # it uses string compare RUN(NAME expr_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME string_concat_deferred_len LABELS gfortran llvm) RUN(NAME expr_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME expr_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME expr_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c) RUN(NAME expr_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME data_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_05 LABELS gfortran) # llvmImplicit removed RUN(NAME data_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c) RUN(NAME data_07 LABELS gfortran) # TODO: Fix this test RUN(NAME data_08 LABELS gfortran llvmImplicit) RUN(NAME data_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME data_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_11 LABELS gfortran llvmImplicit) RUN(NAME data_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME data_16 LABELS gfortran llvmImplicit) RUN(NAME data_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME datastmt_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME max_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME max_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME min_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME min_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME minmax_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME arithmetic_if_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # arithmetic tests use goto RUN(NAME arithmetic_if_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME arithmetic_if_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME arithmetic_if_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) RUN(NAME if_label_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_label_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME variables_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME variables_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME variables_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME if_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME if_02 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c) RUN(NAME if_03 FAIL LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c) RUN(NAME if_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME if_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME if_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # select case range RUN(NAME while_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm c fortran) RUN(NAME while_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm c fortran) RUN(NAME while_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --fixed-form fortran) RUN(NAME while_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME while_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME doloop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp x86 wasm fortran) RUN(NAME doloop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp x86 wasm mlir fortran) RUN(NAME doloop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # uses goto target RUN(NAME doloop_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # uses goto RUN(NAME doloop_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c cpp wasm fortran) RUN(NAME doloop_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nested subroutine RUN(NAME doloop_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # implicit cast loop variable RUN(NAME doloop_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME doloop_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME doloop_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cycle_and_exit2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cycle_and_exit3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cycle_and_exit6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME goto_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm mlir fortran) RUN(NAME subroutines_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm fortran) RUN(NAME subroutines_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_06 LABELS gfortran llvm) RUN(NAME subroutines_07 LABELS gfortran llvm) RUN(NAME subroutines_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME subroutines_09 LABELS gfortran llvm) RUN(NAME subroutines_10 LABELS gfortran) RUN(NAME subroutines_11 LABELS gfortran llvm fortran) RUN(NAME subroutines_12 LABELS gfortran llvm fortran) RUN(NAME subroutines_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME subroutines_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME subroutines_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME subroutines_18 LABELS gfortran llvm) RUN(NAME subroutines_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME subroutines_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp x86 wasm mlir fortran) RUN(NAME functions_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_06 LABELS gfortran llvm) RUN(NAME functions_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_09 LABELS gfortran llvm fortran) RUN(NAME functions_10 LABELS gfortran llvm) RUN(NAME functions_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME functions_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_16 LABELS gfortran llvm) RUN(NAME functions_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --fixed-form) RUN(NAME functions_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_33 LABELS gfortran llvm) RUN(NAME functions_34 LABELS gfortran llvm) RUN(NAME functions_35 LABELS gfortran llvm) RUN(NAME functions_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_41 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_42 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_43 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_44 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_45 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_46 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME functions_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME functions_50 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_51 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_52 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME functions_53 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_01 LABELS gfortran) RUN(NAME types_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME types_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) # GFortran + LFortran C++ RUN(NAME doconcurrentloop_01 LABELS gfortran cpp) RUN(NAME arrays_01 LABELS gfortran cpp llvm llvmStackArray wasm) RUN(NAME arrays_01_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_02_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_03_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_04_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_05_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_06_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_07_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_08_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_09_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_10_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_11_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_12_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_13_size LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME matrix_01_transpose LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME matrix_02_matmul LABELS gfortran fortran) RUN(NAME array_01_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_01_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_02_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_03_pack LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_02_transfer LABELS gfortran) RUN(NAME array_03_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_04_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_05_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_06_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_07_transfer LABELS gfortran llvm) RUN(NAME array_08_transfer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_04_all LABELS gfortran fortran) RUN(NAME arrays_01_real LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_01_complex LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME block_data_complex LABELS llvm gfortran) RUN(NAME arrays_01_logical LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_01_multi_dim LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME integer_bin_op_dim_external_module LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_bound_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME array_bound_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME array_bound_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_bound_4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_bound_5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_op_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_7 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_8 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_9 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME arrays_op_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_op_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) RUN(NAME arrays_op_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_op_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME arrays_op_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_op_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_op_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_reshape_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_reshape_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray NO_STD_F23) RUN(NAME arrays_reshape_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_reshape_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_reshape_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_reshape_31 LABELS gfortran llvm) RUN(NAME arrays_elemental_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_03_func LABELS gfortran cpp llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_03_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_04_func LABELS gfortran cpp llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_04_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_18_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray llvm_integer_8) # maxloc, minloc RUN(NAME arrays_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray llvm_integer_8) # maxloc RUN(NAME arrays_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm fortran) # init expr with fixed size arr as dependency RUN(NAME arrays_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME arrays_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES arrays_50_mod.f90) RUN(NAME arrays_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_75 LABELS gfortran llvm) RUN(NAME arrays_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME arrays_100 LABELS gfortran llvm) RUN(NAME arrays_101 LABELS gfortran llvm) RUN(NAME arrays_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) # DISABLED: #8115 - ICE: get_struct_sym_from_struct_expr returns nullptr for empty struct array constructors [tp ::] # RUN(NAME array_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assumed_rank_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME select_rank_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_rank_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_allocatable_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_allocatable_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_array_pointer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME global_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_03 LABELS gfortran llvm) RUN(NAME pointer_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_section_is_non_allocatable LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_section LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_section_assignment LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrays_constructor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_constructor_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_constructor_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocatble_c_ptr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME hashmap_struct_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME hashmap_nested_dealloc_derived_pointer LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME hashmap_derived_pointer_associated LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME call_subroutine_without_type LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME call_subroutine_without_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # GFortran RUN(NAME arrays_02 LABELS gfortran llvm) RUN(NAME arrays_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_08_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_08_func_pass_arr_dims LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME arrays_09 LABELS gfortran llvm) RUN(NAME arrays_10 LABELS gfortran llvm) RUN(NAME arrays_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray cpp) RUN(NAME arrays_12 LABELS gfortran) # constant arrays RUN(NAME arrays_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) # constant arrays RUN(NAME arrays_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_inputs_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) # constant arrays RUN(NAME arrays_16_func LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrays_intrin_01 LABELS gfortran llvm fortran) # minval, maxval RUN(NAME arrays_intrin_02 LABELS gfortran) # all, any RUN(NAME arrays_intrin_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) # maxval RUN(NAME arrays_intrin_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # maxval RUN(NAME arrays_intrin_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) # minval RUN(NAME arrays_intrin_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # minval RUN(NAME arrays_intrin_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) # min RUN(NAME arrays_intrin_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME arrays_intrin_09 LABELS gfortran llvm) # any/count logical mask RUN(NAME any_01 LABELS gfortran) RUN(NAME any_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sum_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sum_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME product_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME product_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME reserved_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME reserved_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME reserved_03 LABELS gfortran llvm) RUN(NAME namelist_01 LABELS gfortran llvm) RUN(NAME namelist_02 LABELS gfortran llvm) RUN(NAME namelist_03 LABELS gfortran llvm) RUN(NAME namelist_04 LABELS gfortran llvm) RUN(NAME namelist_05 LABELS gfortran llvm) RUN(NAME namelist_06 LABELS gfortran llvm) RUN(NAME namelist_07 LABELS gfortran llvm) RUN(NAME namelist_08 LABELS gfortran llvm) RUN(NAME namelist_09 LABELS gfortran llvm) RUN(NAME namelist_10 LABELS gfortran llvm) RUN(NAME namelist_11 LABELS gfortran llvm) RUN(NAME namelist_12 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME namelist_13 LABELS gfortran llvm EXTRAFILES namelist_13_module.f90) RUN(NAME namelist_14 LABELS gfortran llvm) RUN(NAME namelist_15 LABELS gfortran llvm) RUN(NAME namelist_16 LABELS gfortran llvm) RUN(NAME namelist_17 LABELS gfortran llvm) RUN(NAME namelist_18 LABELS gfortran llvm) RUN(NAME namelist_19 LABELS gfortran llvm) RUN(NAME namelist_20 LABELS gfortran llvm) RUN(NAME namelist_21 LABELS gfortran llvm) RUN(NAME namelist_22 LABELS gfortran llvm) RUN(NAME namelist_23 LABELS gfortran llvm) RUN(NAME namelist_24 LABELS gfortran llvm) RUN(NAME namelist_25 LABELS gfortran llvm) RUN(NAME namelist_26 LABELS gfortran llvm) RUN(NAME namelist_27 LABELS gfortran llvm) RUN(NAME namelist_28 LABELS gfortran llvm) RUN(NAME nested_namelist_01 LABELS gfortran llvm) RUN(NAME format_01 LABELS gfortran llvm fortran) RUN(NAME format_02 LABELS gfortran llvm fortran) RUN(NAME format_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_08 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_08s LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME format_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME format_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_01 LABELS gfortran) RUN(NAME submodule_02 LABELS gfortran fortran) RUN(NAME submodule_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME submodule_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME floor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # floor body RUN(NAME floor_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # floor symboltable RUN(NAME floor_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modulo_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME int_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # int body RUN(NAME int_02 LABELS gfortran wasm fortran) # int symboltable RUN(NAME int_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # large int and prints array RUN(NAME intrinsics_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sqrt, abs, log RUN(NAME intrinsics_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cos RUN(NAME intrinsics_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # tan RUN(NAME intrinsics_04s LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ctan RUN(NAME intrinsics_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hyperbolics RUN(NAME intrinsics_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # inverse trignometric RUN(NAME intrinsics_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind RUN(NAME intrinsics_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # tiny symboltable RUN(NAME intrinsics_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # tiny body RUN(NAME intrinsics_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # real body RUN(NAME intrinsics_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # real symboltable RUN(NAME intrinsics_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind body RUN(NAME intrinsics_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # kind symboltable RUN(NAME intrinsics_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_real,int_kind body RUN(NAME intrinsics_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # real RUN(NAME intrinsics_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aimag RUN(NAME intrinsics_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp, log, erf RUN(NAME intrinsics_17b LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # log RUN(NAME intrinsics_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_18c LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # multiple intrinsics RUN(NAME intrinsics_19c LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp, log, sqrt RUN(NAME intrinsics_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trig RUN(NAME intrinsics_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # modulo and mod RUN(NAME intrinsics_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # min, max RUN(NAME intrinsics_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # huge RUN(NAME intrinsics_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # System_clock RUN(NAME intrinsics_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ishft RUN(NAME intrinsics_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # btest RUN(NAME intrinsics_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # min, max RUN(NAME intrinsics_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # range RUN(NAME intrinsics_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # ceiling RUN(NAME intrinsics_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # new_line RUN(NAME intrinsics_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) # epsilon refer: #5222 RUN(NAME intrinsics_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # any RUN(NAME intrinsics_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustl RUN(NAME intrinsics_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # date_and_time RUN(NAME intrinsics_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint, anint RUN(NAME intrinsics_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # command_argument_count RUN(NAME intrinsics_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dim RUN(NAME intrinsics_44 LABELS gfortran) # cshift RUN(NAME intrinsics_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # iso_fortran_env RUN(NAME intrinsics_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # ichar & iachar RUN(NAME intrinsics_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # all RUN(NAME intrinsics_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # log_gamma RUN(NAME intrinsics_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cmplx, sin RUN(NAME intrinsics_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #trig RUN(NAME intrinsics_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0, min0 RUN(NAME intrinsics_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # repeat RUN(NAME intrinsics_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0 RUN(NAME intrinsics_open_close_read_write LABELS gfortran llvm) RUN(NAME intrinsics_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) #min RUN(NAME intrinsics_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # merge RUN(NAME intrinsics_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN intrinsics_60_data.txt) # iachar for extended ascii RUN(NAME intrinsics_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # any RUN(NAME intrinsics_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # sign RUN(NAME intrinsics_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dcosh, dsinh, dtanh, dtan RUN(NAME intrinsics_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dsign RUN(NAME intrinsics_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # radix RUN(NAME intrinsics_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint RUN(NAME intrinsics_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_72 LABELS gfortran llvmImplicit) # datan2 RUN(NAME intrinsics_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sngl RUN(NAME intrinsics_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c fortran) # random_number RUN(NAME intrinsics_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp RUN(NAME intrinsics_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exp RUN(NAME intrinsics_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # mod RUN(NAME intrinsics_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # Trailz RUN(NAME intrinsics_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # array support tan, cosh, sinh, tanh RUN(NAME intrinsics_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minexponent RUN(NAME intrinsics_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxexponent RUN(NAME intrinsics_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min for strings RUN(NAME intrinsics_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # index RUN(NAME intrinsics_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # anint RUN(NAME intrinsics_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # digits RUN(NAME intrinsics_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # tiny RUN(NAME intrinsics_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # size RUN(NAME intrinsics_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_101 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # repeat RUN(NAME intrinsics_102 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sin RUN(NAME intrinsics_103 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # char RUN(NAME intrinsics_104 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm fortran) RUN(NAME intrinsics_105 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_106 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge RUN(NAME intrinsics_107 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_108 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftr RUN(NAME intrinsics_109 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape, matmul RUN(NAME intrinsics_110 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min0 RUN(NAME intrinsics_111 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_112 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max0 RUN(NAME intrinsics_113 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_114 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # aint RUN(NAME intrinsics_115 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # anint RUN(NAME intrinsics_116 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # atan2 RUN(NAME intrinsics_117 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_118 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # hypot RUN(NAME intrinsics_119 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_120 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # product RUN(NAME intrinsics_121 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_122 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rank RUN(NAME intrinsics_123 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftl RUN(NAME intrinsics_124 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lshift RUN(NAME intrinsics_125 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_126 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # random_number RUN(NAME intrinsics_127 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ifix RUN(NAME intrinsics_128 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # idint RUN(NAME intrinsics_129 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_130 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ishft RUN(NAME intrinsics_131 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max for strings RUN(NAME intrinsics_132 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # Floor RUN(NAME intrinsics_133 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Ceiling RUN(NAME intrinsics_134 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Adjustl RUN(NAME intrinsics_135 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nint RUN(NAME intrinsics_136 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rshift RUN(NAME intrinsics_137 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # huge RUN(NAME intrinsics_138 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # precision RUN(NAME intrinsics_139 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # modulo RUN(NAME intrinsics_140 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_int_kind RUN(NAME intrinsics_141 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scale RUN(NAME intrinsics_142 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_143 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dot_product RUN(NAME intrinsics_144 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_145 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_146 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dprod RUN(NAME intrinsics_147 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_148 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_149 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # unpack RUN(NAME intrinsics_150 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskr RUN(NAME intrinsics_151 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl RUN(NAME intrinsics_152 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_real_kind RUN(NAME intrinsics_153 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dim RUN(NAME intrinsics_154 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_155 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bgt RUN(NAME intrinsics_156 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # blt RUN(NAME intrinsics_157 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ble RUN(NAME intrinsics_158 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bge RUN(NAME intrinsics_159 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # matmul RUN(NAME intrinsics_160 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ior RUN(NAME intrinsics_161 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ieor RUN(NAME intrinsics_162 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # Not RUN(NAME intrinsics_163 LABELS gfortran llvm fortran) # ishftc RUN(NAME intrinsics_164 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iand RUN(NAME intrinsics_165 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sum RUN(NAME intrinsics_166 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibset RUN(NAME intrinsics_167 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # btest RUN(NAME intrinsics_168 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibclr RUN(NAME intrinsics_169 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # mod RUN(NAME intrinsics_170 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # exponent RUN(NAME intrinsics_171 LABELS llvm llvm_wasm llvm_wasm_emcc) # tolowercase RUN(NAME intrinsics_172 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # count RUN(NAME intrinsics_173 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # fraction RUN(NAME intrinsics_174 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shape RUN(NAME intrinsics_175 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_176 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # set_exponent RUN(NAME intrinsics_177 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_178 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # rrspacing RUN(NAME intrinsics_179 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_180 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scan RUN(NAME intrinsics_181 LABELS gfortran llvm fortran) # repeat RUN(NAME intrinsics_182 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dshiftl RUN(NAME intrinsics_183 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ibits RUN(NAME intrinsics_184 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # selected_char_kind RUN(NAME intrinsics_185 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # verify RUN(NAME intrinsics_186 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # verify RUN(NAME intrinsics_187 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # popcnt RUN(NAME intrinsics_188 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgt, lge, lle, llt RUN(NAME intrinsics_189 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # scan RUN(NAME intrinsics_190 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_191 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_192 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_j0 RUN(NAME intrinsics_193 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # poppar RUN(NAME intrinsics_194 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min RUN(NAME intrinsics_195 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max RUN(NAME intrinsics_196 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_j1 RUN(NAME intrinsics_197 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_y0 RUN(NAME intrinsics_198 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_199 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # count RUN(NAME intrinsics_200 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) # pack RUN(NAME intrinsics_201 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # any RUN(NAME intrinsics_202 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #parameter RUN(NAME intrinsics_203 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # asind RUN(NAME intrinsics_204 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_y1 RUN(NAME intrinsics_205 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acosd RUN(NAME intrinsics_206 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # poppar RUN(NAME intrinsics_207 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # double precision intrinsics RUN(NAME intrinsics_208 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bit_size RUN(NAME intrinsics_209 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atand RUN(NAME intrinsics_210 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES lcompilers_test_module.f90) # bessel_jn RUN(NAME intrinsics_211 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # bessel_yn RUN(NAME intrinsics_212 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # specific type intrinsics RUN(NAME intrinsics_213 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cpu_time RUN(NAME intrinsics_214 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sind RUN(NAME intrinsics_215 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cosd RUN(NAME intrinsics_216 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tand RUN(NAME intrinsics_217 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # all RUN(NAME intrinsics_218 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # new_line RUN(NAME intrinsics_219 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #parameter, sum RUN(NAME intrinsics_220 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # merge_bits RUN(NAME intrinsics_221 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_222 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dreal RUN(NAME intrinsics_223 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # nearest RUN(NAME intrinsics_224 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spacing RUN(NAME intrinsics_225 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iany RUN(NAME intrinsics_226 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iall RUN(NAME intrinsics_227 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # norm2 RUN(NAME intrinsics_228 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derf RUN(NAME intrinsics_229 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # derfc RUN(NAME intrinsics_230 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bessel RUN(NAME intrinsics_231 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dgamma RUN(NAME intrinsics_232 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # iparity RUN(NAME intrinsics_233 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # isnan RUN(NAME intrinsics_234 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # parity RUN(NAME intrinsics_235 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgamma algama dlgama RUN(NAME intrinsics_236 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # bit_size, huge RUN(NAME intrinsics_237 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sngl RUN(NAME intrinsics_238 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl, idl RUN(NAME intrinsics_239 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # erfc_scaled RUN(NAME intrinsics_240 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dshiftr RUN(NAME intrinsics_241 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # logical RUN(NAME intrinsics_242 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nint RUN(NAME intrinsics_243 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sqrt, abs, log (all kind of real) RUN(NAME intrinsics_244 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_245 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_246 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustl RUN(NAME intrinsics_247 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # adjustr RUN(NAME intrinsics_248 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # eoshift RUN(NAME intrinsics_249 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # nested_sum RUN(NAME intrinsics_250 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_251 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # erf RUN(NAME intrinsics_252 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # derf RUN(NAME intrinsics_253 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # erfc RUN(NAME intrinsics_254 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # derfc RUN(NAME intrinsics_255 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dbesjn, dbesyn RUN(NAME intrinsics_256 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minval RUN(NAME intrinsics_257 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # product RUN(NAME intrinsics_product_nodes_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # product RUN(NAME intrinsics_258 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # abs RUN(NAME intrinsics_259 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lgt, llt, lge, lle RUN(NAME intrinsics_260 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sum RUN(NAME intrinsics_261 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # ceiling RUN(NAME intrinsics_262 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # floor RUN(NAME intrinsics_263 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxval RUN(NAME intrinsics_264 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sin RUN(NAME intrinsics_265 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cos RUN(NAME intrinsics_266 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tan RUN(NAME intrinsics_267 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dsin, dcos, dtan RUN(NAME intrinsics_268 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # asin RUN(NAME intrinsics_269 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acos RUN(NAME intrinsics_270 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atan RUN(NAME intrinsics_271 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_272 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_273 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dprod RUN(NAME intrinsics_274 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # epsilon refer: #5222 RUN(NAME intrinsics_275 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # and RUN(NAME intrinsics_276 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # or RUN(NAME intrinsics_277 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # xor RUN(NAME intrinsics_278 LABELS gfortran llvm fortran) # tiny RUN(NAME intrinsics_279 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sinh RUN(NAME intrinsics_280 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cosh RUN(NAME intrinsics_281 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # tanh RUN(NAME intrinsics_282 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # hypot RUN(NAME intrinsics_283 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # asinh RUN(NAME intrinsics_284 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # acosh RUN(NAME intrinsics_285 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # real RUN(NAME intrinsics_286 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # atanh RUN(NAME intrinsics_288 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_289 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # ishftc RUN(NAME intrinsics_290 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # log10 RUN(NAME intrinsics_291 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # gamma RUN(NAME intrinsics_292 LABELS gfortran llvm fortran) # command_argument_count RUN(NAME intrinsics_293 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dgamma RUN(NAME intrinsics_294 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # log_gamma RUN(NAME intrinsics_295 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # exp RUN(NAME intrinsics_296 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # storage_size RUN(NAME intrinsics_297 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # poppar RUN(NAME intrinsics_298 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dot_product RUN(NAME intrinsics_299 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # command_argument_count RUN(NAME intrinsics_300 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # kind RUN(NAME intrinsics_301 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_302 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_303 LABELS gfortran llvm) # random_seed RUN(NAME intrinsics_304 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # sign RUN(NAME intrinsics_305 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # realpart RUN(NAME intrinsics_306 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # imagpart RUN(NAME intrinsics_307 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # imag RUN(NAME intrinsics_308 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dgamma RUN(NAME intrinsics_309 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_310 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # digits RUN(NAME intrinsics_311 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) # minloc RUN(NAME intrinsics_312 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minloc RUN(NAME intrinsics_313 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # maxloc RUN(NAME intrinsics_314 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # dshift RUN(NAME intrinsics_315 LABELS llvm llvm_wasm llvm_wasm_emcc) # out_of_range RUN(NAME intrinsics_316 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max, min RUN(NAME intrinsics_317 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # get_command_argument RUN(NAME intrinsics_318 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # cpu_time RUN(NAME intrinsics_319 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # system_clock RUN(NAME intrinsics_320 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # len_trim RUN(NAME intrinsics_321 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trim RUN(NAME intrinsics_322 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # index RUN(NAME intrinsics_323 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dot_product RUN(NAME intrinsics_324 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # max RUN(NAME intrinsics_325 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_326 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_327 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # transpose RUN(NAME intrinsics_328 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_329 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # idnint RUN(NAME intrinsics_330 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #amax0, max1 RUN(NAME intrinsics_331 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_332 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_333 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_334 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc RUN(NAME move_alloc_pointer_alias LABELS gfortran llvm) RUN(NAME intrinsics_335 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #kind, real RUN(NAME intrinsics_336 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #any RUN(NAME intrinsics_337 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # dble, dfloat, float, shifta RUN(NAME intrinsics_338 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # compiler_options RUN(NAME intrinsics_339 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_340 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # leadz RUN(NAME intrinsics_341 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # trailz RUN(NAME intrinsics_342 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_343 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_344 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # maskl RUN(NAME intrinsics_345 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_346 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar RUN(NAME intrinsics_347 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape RUN(NAME intrinsics_348 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # reshape RUN(NAME intrinsics_349 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_350 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_351 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # spread RUN(NAME intrinsics_352 LABELS gfortran llvm) # random_seed RUN(NAME intrinsics_353 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # random_number RUN(NAME intrinsics_354 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # minval RUN(NAME intrinsics_355 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # system_clock RUN(NAME intrinsics_356 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_357 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_358 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # getseed RUN(NAME intrinsics_359 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # pack RUN(NAME intrinsics_360 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_361 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME intrinsics_362 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_363 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_364 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cshift RUN(NAME intrinsics_365 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # is_contiguous RUN(NAME intrinsics_366 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # shiftl, shiftr, trailz, btest, ibclr RUN(NAME intrinsics_367 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_368 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # kind RUN(NAME intrinsics_369 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_370 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_371 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_372 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_373 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_374 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_375 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc for string RUN(NAME intrinsics_376 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # present RUN(NAME intrinsics_377 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minval, maxval RUN(NAME intrinsics_378 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # move_alloc RUN(NAME intrinsics_379 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # get_command_argument RUN(NAME intrinsics_380 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_381 LABELS gfortran llvm) # get_environment_variable RUN(NAME intrinsics_382 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_383 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # pack RUN(NAME intrinsics_384 LABELS gfortran llvm fortran) # eoshift RUN(NAME intrinsics_385 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # nearest RUN(NAME intrinsics_386 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # product RUN(NAME intrinsics_387 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_388 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_389 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # loc RUN(NAME intrinsics_390 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # c_f_ptr RUN(NAME intrinsics_391 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # sum, selected_real_kind, minloc, merge RUN(NAME intrinsics_392 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # present RUN(NAME intrinsics_393 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME intrinsics_394 LABELS gfortran llvm) # execute_command_line RUN(NAME intrinsics_395 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx kind cast regression RUN(NAME intrinsics_396 LABELS gfortran llvm) RUN(NAME intrinsics_397 LABELS llvm llvm_wasm llvm_wasm_emcc) # selected_logical_kind RUN(NAME intrinsics_398 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # findloc RUN(NAME intrinsics_399 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # intrinsic impure subroutine RUN(NAME intrinsics_400 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # compiler_options RUN(NAME intrinsics_401 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # minloc RUN(NAME intrinsics_402 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # intrinsic statement with procedure argument RUN(NAME intrinsics_403 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # min1, max1 RUN(NAME intrinsics_404 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_405 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intrinsics_406 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar with array arguments RUN(NAME intrinsics_407 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # complex abs() overflow RUN(NAME intrinsics_408 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # complex abs() underflow RUN(NAME intrinsics_409 LABELS gfortran llvm) # execute_command_line with file flush RUN(NAME intrinsics_410 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) # maxloc/minloc/shape with -fdefault-integer-8 RUN(NAME intrinsics_411 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # iachar with transfer of assumed-length strings RUN(NAME intrinsics_412 LABELS gfortran llvm) # max_loc FAST RUN(NAME la_constants LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # LAPACK constants RUN(NAME integer_boz_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_dshiftr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_01 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_02 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_03 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_04 LABELS gfortran fortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME passing_array_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME parameter_01 LABELS gfortran llvm) RUN(NAME parameter_02 LABELS gfortran llvm) RUN(NAME parameter_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) #kind RUN(NAME parameter_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # selected_real,int_kind symboltable RUN(NAME parameter_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) # Implicit IntegerToReal RUN(NAME parameter_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME parameter_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_10 LABELS gfortran llvm fortran) # sin RUN(NAME parameter_11 LABELS gfortran llvm fortran) # merge RUN(NAME parameter_12 LABELS gfortran llvm fortran) # implied do loops RUN(NAME parameter_13 LABELS gfortran llvm) # compile time example RUN(NAME parameter_14 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME parameter_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME parameter_16 LABELS gfortran llvm) RUN(NAME fortuno_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran mlir) RUN(NAME modules_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME modules_03 LABELS gfortran llvm) RUN(NAME modules_04 LABELS gfortran llvm) RUN(NAME modules_05 LABELS gfortran llvm) RUN(NAME modules_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modules_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_07_module.f90) RUN(NAME modules_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_22_module.f90) RUN(NAME modules_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_23_module.f90) RUN(NAME modules_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_08_a.f90 modules_08_b.f90) RUN(NAME modules_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_09_b.f90 modules_09_a.f90) RUN(NAME modules_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME modules_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_12 LABELS gfortran llvm) RUN(NAME modules_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME modules_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_14_a.f90) RUN(NAME modules_15 LABELS gfortran llvm EXTRAFILES modules_15b.f90 modules_15c.c NOFAST_TILL_LLVM16) RUN(NAME modules_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_16b.f90) RUN(NAME modules_18 LABELS gfortran llvm EXTRAFILES modules_18b.f90 modules_18c.c) RUN(NAME modules_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_19b.f90) RUN(NAME modules_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_20b.f90) RUN(NAME modules_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_21b.f90) RUN(NAME modules_24 LABELS gfortran llvm) RUN(NAME modules_25 LABELS gfortran EXTRAFILES modules_25_module.f90 modules_25_module1.f90) RUN(NAME modules_27 LABELS gfortran EXTRAFILES modules_27_module1.f90 modules_27_module2.f90) RUN(NAME modules_28 LABELS gfortran EXTRAFILES modules_28_module1.f90 modules_28_module2.f90) RUN(NAME modules_29 LABELS gfortran EXTRAFILES modules_29_module1.f90 modules_29_module2.f90 modules_29_module3.f90) RUN(NAME modules_30 LABELS gfortran EXTRAFILES modules_30_module1.f90 modules_30_module2.f90 modules_30_module3.f90 modules_30_module4.f90) RUN(NAME modules_31 LABELS gfortran EXTRAFILES modules_31_module1.f90 modules_31_module2.f90) RUN(NAME modules_32 LABELS gfortran llvm) RUN(NAME modules_33 LABELS gfortran EXTRAFILES modules_33_module1.f90 modules_33_module2.f90 modules_33_module3.f90) RUN(NAME modules_34 LABELS gfortran EXTRAFILES modules_34_module1a.f90 modules_34_module1.f90 modules_34_module2.f90 modules_34_module3.f90) RUN(NAME modules_35 LABELS gfortran) RUN(NAME modules_36 LABELS gfortran) RUN(NAME modules_37 LABELS gfortran llvm) RUN(NAME modules_38 LABELS gfortran llvm) RUN(NAME modules_39 LABELS gfortran EXTRAFILES modules_39_module.f90) RUN(NAME modules_44 LABELS gfortran EXTRAFILES modules_44_module.f90) RUN(NAME modules_40 LABELS gfortran llvm) RUN(NAME modules_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_43 LABELS gfortran) RUN(NAME modules_45 LABELS gfortran) RUN(NAME modules_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME modules_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_50 LABELS gfortran llvm) RUN(NAME modules_51 LABELS gfortran llvmImplicit) RUN(NAME modules_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_58_module.f90) RUN(NAME modules_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_62_terminal.f90 modules_62_parser.f90) RUN(NAME modules_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES modules_63_module.f90) RUN(NAME modules_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_65 LABELS gfortran llvm EXTRAFILES modules_65_base.f90 modules_65_child.f90 modules_65_worker.f90) RUN(NAME associate_06 LABELS gfortran EXTRAFILES associate_06_module.f90) RUN(NAME lfortran_intrinsic_sin LABELS gfortran llvm EXTRAFILES lfortran_intrinsic_sin_c.c) RUN(NAME bindc1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc5 LABELS gfortran llvm) RUN(NAME bindc6 LABELS gfortran llvm EXTRAFILES bindc6_sum.c) RUN(NAME bindc_01 LABELS gfortran llvm EXTRAFILES bindc_01b.f90 bindc_01c.c) RUN(NAME bindc_02 LABELS gfortran llvm EXTRAFILES bindc_02b.f90 bindc_02c.c) RUN(NAME bindc_03 LABELS gfortran llvm EXTRAFILES bindc_03c.c) # RUN(NAME bindc_04 LABELS gfortran llvm EXTRAFILES bindc_04c.c OLD_CLASSES) RUN(NAME bindc_05 LABELS gfortran llvm EXTRAFILES bindc_05c.c) RUN(NAME bindc_06 LABELS gfortran llvm EXTRAFILES bindc_06b.c) RUN(NAME bindc_07 LABELS gfortran llvm EXTRAFILES bindc_07.c) RUN(NAME bindc_08 LABELS gfortran llvm EXTRAFILES bindc_08.c EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME bindc_09 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME bindc_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bindc_11 LABELS gfortran llvm) RUN(NAME bindc_12 LABELS gfortran llvm) RUN(NAME case_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME case_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_04 LABELS gfortran) RUN(NAME case_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp) RUN(NAME case_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME case_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME case_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_04 LABELS gfortran EXTRAFILES select_type_03_module.f90 select_type_03.f90) RUN(NAME select_type_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME select_type_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_11 LABELS gfortran llvm) RUN(NAME select_type_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME select_type_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_18 LABELS gfortran llvm) RUN(NAME select_type_19 LABELS gfortran llvm) RUN(NAME select_type_20 LABELS gfortran llvm) RUN(NAME select_type_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME select_type_23 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME program_02 LABELS gfortran llvm) RUN(NAME program_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME program_04 LABELS gfortran llvm) RUN(NAME where_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_04 LABELS gfortran) # TODO: Fix this test #1631 RUN(NAME where_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME where_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME where_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME forallloop_01 LABELS gfortran) RUN(NAME forall_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME forall_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-typing) RUN(NAME parsing_01 LABELS gfortran) RUN(NAME parsing_02 LABELS gfortran) RUN(NAME parsing_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME interface_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_03 LABELS gfortran llvm) RUN(NAME interface_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_06 LABELS gfortran) RUN(NAME interface_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_09 LABELS gfortran) RUN(NAME interface_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_12a LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES interface_12b.f90) RUN(NAME interface_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME interface_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME interface_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implicit_interface_01 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_02 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_03 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_04 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_05 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_06 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_07 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_08 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_09 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_10 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_11 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_12 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_13 LABELS gfortran llvmImplicit) RUN(NAME implicit_interface_14 LABELS gfortran) # ! TODO: fix this test RUN(NAME implicit_interface_15 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_15b.f90) RUN(NAME implicit_interface_16 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_16b.f90) RUN(NAME implicit_interface_17 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_17b.f90) RUN(NAME implicit_interface_18 LABELS gfortran llvmImplicit EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_19 LABELS gfortran llvm EXTRA_ARGS --implicit-typing --implicit-interface EXTRAFILES implicit_interface_19b.f90) RUN(NAME implicit_interface_20 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_21 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME implicit_interface_22 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_23 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_24 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_25 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_26 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_interface_27 LABELS gfortran llvm EXTRA_ARGS --implicit-interface EXTRAFILES implicit_interface_27b.f90) RUN(NAME implicit_interface_28 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME implicit_typing_01 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_02 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_03 LABELS gfortran llvmImplicit) RUN(NAME implicit_typing_04 LABELS gfortran llvmImplicit EXTRA_ARGS --implicit-interface) RUN(NAME implicit_typing_05 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --implicit-typing) RUN(NAME implicit_typing_07 LABELS gfortran llvm EXTRA_ARGS --implicit-typing) RUN(NAME generic_name_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME generic_name_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_04 LABELS gfortran llvm) RUN(NAME operator_overloading_05_module3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES operator_overloading_05_module1.f90 operator_overloading_05_module2.f90) RUN(NAME operator_overloading_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME operator_overloading_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_unary_operator_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME custom_operator_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME types_07 LABELS gfortran) RUN(NAME types_08 LABELS gfortran) RUN(NAME types_09 LABELS gfortran llvm) RUN(NAME types_10 LABELS gfortran llvm) RUN(NAME types_11 LABELS gfortran llvm) RUN(NAME types_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME types_13 LABELS gfortran) RUN(NAME types_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME types_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME types_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_07 LABELS gfortran llvm) # cmplx RUN(NAME complex_08 LABELS gfortran llvm fortran) # conjg RUN(NAME complex_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # cmplx RUN(NAME complex_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # conjg RUN(NAME complex_11 LABELS gfortran llvmImplicit wasm fortran) RUN(NAME complex_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_26 LABELS gfortran llvm) RUN(NAME complex_28 LABELS gfortran llvm) RUN(NAME complex_29 LABELS gfortran llvm) RUN(NAME complex_30 LABELS gfortran llvm) RUN(NAME complex_31 LABELS gfortran llvm) RUN(NAME complex_32 LABELS gfortran llvm) RUN(NAME complex_array_member_access LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_implicit_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME complex_sub_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_mul_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME complex_div_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_pow_test LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME complex_unary_minus_03 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME dcmplx_01 LABELS gfortran llvm) # dcmplx, dconjg RUN(NAME logical1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME logical4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME logical_casting_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --logical-casting NO_STD_F23) RUN(NAME tsunami LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_02 LABELS gfortran llvm) RUN(NAME derived_types_03 LABELS gfortran llvm) RUN(NAME derived_types_04 LABELS gfortran llvm) RUN(NAME derived_types_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_05 LABELS gfortran llvm) RUN(NAME derived_types_07 LABELS gfortran llvm) RUN(NAME derived_types_08 LABELS gfortran llvm) RUN(NAME derived_types_09 LABELS gfortran EXTRAFILES derived_types_09b.f90 derived_types_09c.f90) RUN(NAME derived_types_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_15 LABELS gfortran llvm) RUN(NAME derived_types_14 LABELS gfortran EXTRAFILES derived_types_14_module.f90) RUN(NAME derived_types_16_module LABELS gfortran) RUN(NAME derived_types_18 LABELS gfortran) RUN(NAME derived_types_19 LABELS gfortran EXTRAFILES derived_types_19_module.f90) RUN(NAME derived_types_20 LABELS gfortran EXTRAFILES derived_types_20_module2.f90 derived_types_20_module1.f90) RUN(NAME derived_types_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_32 LABELS gfortran) RUN(NAME derived_types_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN derived_types_35_file.txt) RUN(NAME derived_types_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_40 LABELS gfortran llvm) RUN(NAME derived_types_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_81 LABELS gfortran llvm) RUN(NAME derived_types_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES derived_types_84_module.f90 EXTRA_ARGS --separate-compilation) RUN(NAME derived_types_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_88 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME derived_types_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES derived_types_97_mod1.f90 derived_types_97_mod2.f90) RUN(NAME derived_types_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME derived_types_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_types_101 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_type_with_default_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME derived_type_with_default_init_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME multi_file_member_access_01 LABELS gfortran llvm llvm_single_invocation EXTRAFILES multi_file_member_access_01_mod.f90) RUN(NAME multi_file_member_access_02 LABELS gfortran llvm_single_invocation EXTRAFILES multi_file_member_access_02_mod.f90) RUN(NAME type_bound_generic_member_access_01 LABELS gfortran llvm) RUN(NAME type_parameter_inquiry_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME line_continuation_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME line_continuation_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME program_01 LABELS gfortran) RUN(NAME init_values LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME param_pass_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME allocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays fortran) RUN(NAME allocate_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_array_descriptor_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME realloc_lhs_16 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 --realloc-lhs-arrays GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME realloc_lhs_17 FILE realloc_lhs_16 LABELS llvm EXTRA_ARGS --descriptor-index-64 --realloc-lhs-arrays) RUN(NAME automatic_allocation_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME automatic_allocation_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME automatic_allocation_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --std=f23) RUN(NAME block_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_02 LABELS gfortran llvm fortran) RUN(NAME block_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME block_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME block_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME block_10 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME associate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_08 LABELS gfortran llvm) RUN(NAME associate_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES associate_18_module.f90) RUN(NAME associate_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES associate_21_mod.f90) RUN(NAME associate_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME associate_24 LABELS gfortran llvm) RUN(NAME associate_25 LABELS gfortran llvm) RUN(NAME associate_26 LABELS llvm) RUN(NAME associate_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME attr_dim_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_dim_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit fortran) RUN(NAME real_dp_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME real_dp_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME bin_op_real_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bin_op_real_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bin_op_real_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME const_real_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME real_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME int_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME int_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME bin_op_complex_dp LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME complex_dp_param LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME const_kind_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME const_kind_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME const_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME const_array_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME string_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc cpp wasm fortran) RUN(NAME string_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME string_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # lge, lgt lle, llt RUN(NAME string_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) # achar RUN(NAME string_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # len RUN(NAME string_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) COMPILE(NAME string_30 COMPILERS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_38 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME string_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME string_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_58 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES string_62b.f90) RUN(NAME string_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_65 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_68 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_76 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_88 LABELS llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) #remove gfortran label, as functionality gave incorrect results RUN(NAME string_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_92 LABELS gfortran llvm) RUN(NAME string_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME string_97 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_99 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME string_100 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME nested_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_vars1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME nested_vars2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME nested_vars3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME nested_vars_allocatable_call LABELS gfortran llvm) RUN(NAME nbody LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME intent_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME callback_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME recursion_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME recursion_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME recursion_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME return_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # contains module RUN(NAME return_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME return_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME file_01 LABELS gfortran llvm COPY_TO_BIN file_01_data.txt) RUN(NAME file_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME file_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_03_data.txt) RUN(NAME file_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_04_data.dat) RUN(NAME file_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_05_data.dat) RUN(NAME file_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_06_data.dat) RUN(NAME file_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_07_data.dat) RUN(NAME file_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_08.txt) RUN(NAME file_09 LABELS gfortran llvm COPY_TO_BIN file_01_data.txt) RUN(NAME file_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_10_data.txt) RUN(NAME file_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME file_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_12_data.txt) RUN(NAME file_13 LABELS gfortran llvm llvm_wasm COPY_TO_BIN file_01_data.txt) RUN(NAME file_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_08.txt) RUN(NAME file_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran COPY_TO_BIN file_03_data.txt) RUN(NAME file_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_18_data.txt) RUN(NAME file_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_19_data.txt) # the below test case writes and reads that same file for testing purpose RUN(NAME file_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_21_data.txt) RUN(NAME file_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_22_data.txt) RUN(NAME file_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_23_data.txt) RUN(NAME file_24 LABELS gfortran llvm COPY_TO_BIN "file 24 data.txt" file_22_data.txt) RUN(NAME file_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --cpp) RUN(NAME file_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME file_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_close_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_open_01 LABELS llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME file_open_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_open_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME file_overwrite LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME inquire_08 LABELS gfortran llvm) RUN(NAME inquire_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_inquire_size LABELS gfortran llvm ) RUN(NAME test_backspace_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME class_01 LABELS gfortran llvm) RUN(NAME class_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_03 LABELS gfortran llvm) RUN(NAME class_04 LABELS gfortran llvm fortran) RUN(NAME class_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_36 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_37 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_38 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_39 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_40 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_41 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_42 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_43 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_44 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_45 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_46 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_47 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_48 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_49 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_50 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_51 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_52 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_53 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_54 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_55 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_56 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_57 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_58 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_59 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_60 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_61 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_62 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_63 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS -c --cpp EXTRAFILES class_63_module_1.f90 class_63_module_2.f90) RUN(NAME class_64 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_65 LABELS gfortran) RUN(NAME class_66 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_67 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_68 LABELS gfortran) RUN(NAME class_69 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_70 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_71 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_72 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_73 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_74 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_75 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_76 LABELS gfortran llvm) RUN(NAME class_77 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_78 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_79 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_80 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_81 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_82 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_83 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_84 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_85 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME class_86 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_87 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_88 LABELS llvm) RUN(NAME class_89 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_90 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_STD_F23) RUN(NAME class_91 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_92 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_93 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_94 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_95 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_96 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_97 LABELS gfortran llvm) RUN(NAME class_98 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_99 LABELS gfortran llvm) RUN(NAME class_100 LABELS gfortran llvm) RUN(NAME class_101 LABELS gfortran llvm) RUN(NAME class_102 LABELS gfortran llvm) RUN(NAME class_103 LABELS gfortran llvm) RUN(NAME class_procedure_args_01 LABELS gfortran llvm) RUN(NAME derived_type_member_procedure_call_01 LABELS gfortran llvm) RUN(NAME class_allocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_allocate_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME class_allocate_03 LABELS gfortran llvm) RUN(NAME kwargs_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME kwargs_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_iso_c_binding LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_iso_c_binding_constants LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_iso_fortran_env LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_ieee_arithmetic LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_arithmetic_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_arithmetic_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME iso_fortran_env_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME test_ieee_next LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_next_up LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_next_down LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_logb LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_rem LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_is_negative LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_scalb LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_rint LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_int LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_real LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_copy_sign LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME test_ieee_is_normal LABELS llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_is_finite LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_unordered LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME test_ieee_support LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME abs_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran mlir) RUN(NAME abs_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm fortran) RUN(NAME abs_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm c fortran) RUN(NAME sqrt_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sqrt_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME sin_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME sin_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cos_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME bits_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME bits_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #bgt, #bge, #blt, #ble RUN(NAME bits_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) #ibits RUN(NAME bits_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME cpu_time_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # RUN(NAME cpu_time_02_wasm LABELS wasm) RUN(NAME system_clock_01 LABELS gfortran llvm) RUN(NAME boz_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME boz_02 LABELS llvm llvm_wasm llvm_wasm_emcc) #remove gfortran label, as functionality is not supported by gfortran RUN(NAME cmd_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME cmd_02 LABELS gfortran llvm) RUN(NAME flip_sign LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME div_to_mul LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME fma LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME fma_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME fma_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME loop_unroll_small LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME loop_unroll_large LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME loop_var_use_after_loop LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME sign_from_value LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME rewind_inquire_flush LABELS gfortran) RUN(NAME flush_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt) RUN(NAME flush_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN file_01_data.txt file_02_data.txt) RUN(NAME flush_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_to1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_to2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_to3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME conv_complex2real LABELS gfortran llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_02 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_04 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_05 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_01b LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_add_01c LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_add_04 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_nested LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_01b LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_travel_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_triple LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_array_01 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_02 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_03 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_04 LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME template_array_04b LABELS llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_matrix_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # DISABLED: #8115 - ASR verify: FunctionType contains types tied to scope after template instantiation # RUN(NAME template_matrix_test LABELS llvm llvm_wasm llvm_wasm_emcc EXTRAFILES # template_semigroup.f90 # template_monoid.f90 # template_semiring.f90 # template_unitring.f90 # template_field.f90 # template_matrix.f90 # ) RUN(NAME template_struct_01 LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_vector LABELS llvm llvm_wasm llvm_wasm_emcc) RUN(NAME template_simple_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_02 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_03 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_simple_04 LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_sort_01 LABELS llvm llvm_wasm llvm_wasm_emcc NOFAST_TILL_LLVM16) # FIXME: This test had worked before, but fails now with --fast. RUN(NAME template_sort_02 LABELS llvm llvm_wasm llvm_wasm_emcc NOFAST_TILL_LLVM16) # FIXME: This test had worked before, but fails now with --fast. RUN(NAME template_lapack_01 LABELS llvm llvm_wasm llvm_wasm_emcc wasm) RUN(NAME template_interface_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME template_commutative LABELS llvm llvm_wasm llvm_wasm_emcc) # FIXME: add visit_OverloadedBinOp to wasm RUN(NAME statement1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dlaswap LABELS gfortran llvm) RUN(NAME implied_do_loops1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops2 LABELS gfortran fortran) RUN(NAME implied_do_loops3 LABELS gfortran fortran) RUN(NAME implied_do_loops4 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops5 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops6 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops7 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops8 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops9 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME implied_do_loops14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran NO_FAST) RUN(NAME implied_do_loops15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --implicit-typing) RUN(NAME implied_do_loops16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implied_do_loops17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implied_do_loops18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops_strings LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME implied_do_loops_print LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME minpack_01 LABELS gfortran llvm_rtlib EXTRAFILES minpack_01_module.f90 minpack_01_func.f90) RUN(NAME minpack_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME external_01 LABELS gfortran llvmImplicit) RUN(NAME external_02 LABELS gfortran llvmImplicit) RUN(NAME external_03 LABELS gfortran llvmImplicit) RUN(NAME external_04 LABELS gfortran llvmImplicit) RUN(NAME external_05 LABELS gfortran llvmImplicit) RUN(NAME external_06 LABELS gfortran llvmImplicit) RUN(NAME external_07 LABELS gfortran llvmImplicit) RUN(NAME external_08 LABELS gfortran llvmImplicit) RUN(NAME external_09 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_10 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_11 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME external_12 LABELS gfortran llvm EXTRAFILES external_12_module.f90) RUN(NAME external_13 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --mangle-underscore-external) RUN(NAME external_14 LABELS gfortran llvm EXTRAFILES external_14_module.f90) RUN(NAME interface_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME private1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME modules_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME enum_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES enum_02_module.f90) RUN(NAME enum_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME enum_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME enum_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES enum_06_module.f90) RUN(NAME array_section_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_section_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_section_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_section_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME array_section_09 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME array_section_10 LABELS gfortran llvm) RUN(NAME array_section_11 LABELS gfortran llvm EXTRA_ARGS --descriptor-index-64) RUN(NAME array_section_12 LABELS gfortran llvm) RUN(NAME nested_vars_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME pass_array_by_data_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME pass_array_by_data_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME pass_array_by_data_13 LABELS gfortran llvm) RUN(NAME implicit_deallocate_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_02_data.txt) RUN(NAME read_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_03_data.txt) RUN(NAME read_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME read_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_07_data.txt) RUN(NAME read_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_20 LABELS gfortran llvm) RUN(NAME read_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME read_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME read_27 LABELS gfortran llvm) RUN(NAME read_28 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_29 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_30 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_31 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc COPY_TO_BIN read_31_data.txt) RUN(NAME read_32 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_33 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_34 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME read_35 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME write_14 LABELS gfortran llvm) RUN(NAME write_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME write_fortran_01 LABELS gfortran llvm fortran) RUN(NAME write_fortran_02 LABELS gfortran llvm fortran) RUN(NAME do_loop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME iso_c_binding_01 LABELS gfortran llvm) RUN(NAME iso_c_binding_02 LABELS gfortran llvm) RUN(NAME array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME array_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray fortran) RUN(NAME do_loop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop) RUN(NAME do_loop_04 LABELS llvm) # This test is not supported by gfortran, as it uses a loop variable after the loop ( bad code practice ) RUN(NAME do_loop_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME do_loop_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) #TODO: fix mlir, commented in PR: #6060 RUN(NAME array_op_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_op_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray wasm) RUN(NAME array_op_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_op_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME array_op_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_op_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_slice_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray c) RUN(NAME array_slice_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_slice_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray c) RUN(NAME array_slice_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME declaration_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_02 LABELS gfortran llvm) RUN(NAME declaration_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME declaration_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_05 LABELS gfortran llvmImplicit) RUN(NAME procedure_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_09_b LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_09_a.f90) RUN(NAME procedure_10 LABELS gfortran llvm) RUN(NAME procedure_11 LABELS gfortran llvm) RUN(NAME procedure_12 LABELS gfortran llvm) RUN(NAME procedure_13 LABELS gfortran llvm) RUN(NAME procedure_14 LABELS gfortran llvm) RUN(NAME procedure_15 LABELS gfortran llvm) RUN(NAME procedure_16 LABELS gfortran llvm) RUN(NAME procedure_17 LABELS gfortran llvm) RUN(NAME procedure_18 LABELS gfortran llvm) RUN(NAME procedure_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_20 LABELS gfortran llvm) RUN(NAME procedure_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_22_a.f90) RUN(NAME procedure_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_24 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME procedure_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocated_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocate_07 LABELS gfortran llvm EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocate_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME allocate_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME dealloc_02 LABELS gfortran) RUN(NAME dealloc_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dealloc_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME double_complex_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME lapack_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME lapack_02 LABELS gfortran llvm EXTRA_ARGS --fixed-form --legacy-array-sections --implicit-interface GFORTRAN_ARGS -ffixed-form) RUN(NAME lapack_03 LABELS gfortran llvm EXTRA_ARGS --fixed-form --legacy-array-sections --implicit-interface --cpp-infer GFORTRAN_ARGS -ffixed-form) RUN(NAME lapack_04 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_05 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_06 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_07 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_08 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_09 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME lapack_10 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME common_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_04 LABELS gfortran llvm) # TODO: Fix these tests RUN(NAME common_05 LABELS gfortran) RUN(NAME common_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit) RUN(NAME common_07 LABELS gfortran llvmImplicit) RUN(NAME common_08 LABELS gfortran llvmImplicit) RUN(NAME common_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmImplicit) RUN(NAME common_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_24 LABELS gfortran llvm llvm2 EXTRAFILES common_24a.f90 common_24b.f90 EXTRA_ARGS --implicit-interface --separate-compilation) RUN(NAME common_25 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_26 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_27 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME common_substring_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME statement_01 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_02 LABELS gfortran llvmImplicit) RUN(NAME statement_03 LABELS gfortran llvmImplicit) RUN(NAME statement_04 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_05 LABELS llvm gfortran llvmImplicit) RUN(NAME statement_06 LABELS llvm gfortran) RUN(NAME data_implied_do_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME data_implied_do_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME save_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME save_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_06 LABELS gfortran llvm) RUN(NAME entry_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME entry_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME entry_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_09 LABELS gfortran llvm fortran) RUN(NAME character_10 LABELS gfortran EXTRAFILES character_10c.c) RUN(NAME character_11 LABELS gfortran EXTRAFILES character_11c.c) RUN(NAME character_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_17 LABELS gfortran llvmImplicit) RUN(NAME character_18 LABELS gfortran llvmImplicit) RUN(NAME character_19 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME character_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_indexing LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_indexing_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_parameter_padding_trimming LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME character_array_parameter_padding_trimming LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME c_ptr_07 LABELS gfortran llvm) RUN(NAME c_ptr_08 LABELS gfortran llvm) RUN(NAME arrayitem_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME arrayitem_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_indices_array_item LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_indices_array_item_assignment LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_1 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_2 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME array_indices_array_item_assignment_3 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME implicit_argument_casting_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-argument-casting GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME implicit_argument_casting_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-argument-casting GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME implicit_argument_casting_03 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --implicit-argument-casting GFORTRAN_ARGS -fallow-argument-mismatch) RUN(NAME specfun_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --use-loop-variable-after-loop --implicit-typing) RUN(NAME cpp_pre_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc c wasm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME cpp_pre_06 LABELS gfortran llvm EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME dabs_01 LABELS gfortran llvmImplicit) RUN(NAME minpack_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --cpp GFORTRAN_ARGS -cpp) RUN(NAME optional_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME optional_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME end_name_match LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME mangle_underscore_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --mangle-underscore --all-mangling) RUN(NAME nan_handling_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME precision_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME precision_02 LABELS gfortran) # TODO fix this test RUN(NAME precision_03 LABELS gfortran llvm) RUN(NAME array_unbounded_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME array_unbounded_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray) RUN(NAME matmul_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvm_nopragma) RUN(NAME matmul_02 LABELS gfortran) RUN(NAME matmul_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME matmul_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME simd_01 LABELS gfortran c llvm llvm_nopragma c_nopragma) RUN(NAME simd_02 LABELS gfortran c llvm llvm_nopragma c_nopragma) RUN(NAME legacy_array_sections_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --legacy-array-sections --implicit-interface) RUN(NAME legacy_array_sections_04 LABELS gfortran llvm2 EXTRA_ARGS --implicit-interface --legacy-array-sections EXTRAFILES legacy_array_sections_04b.f90) RUN(NAME legacy_array_sections_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc llvmStackArray EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_10 LABELS gfortran llvm llvm2 EXTRAFILES legacy_array_sections_10_foo.f90 EXTRA_ARGS --legacy-array-sections --implicit-interface --separate-compilation) RUN(NAME legacy_array_sections_11 LABELS gfortran llvm EXTRAFILES legacy_array_sections_11_stubs.c EXTRA_ARGS --fixed-form --implicit-interface --implicit-typing --legacy-array-sections --separate-compilation GFORTRAN_ARGS -ffixed-form -fno-underscoring) RUN(NAME legacy_array_sections_12 LABELS gfortran llvm EXTRA_ARGS --implicit-interface --legacy-array-sections) RUN(NAME legacy_array_sections_13 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections) RUN(NAME legacy_array_sections_14 LABELS gfortran llvm EXTRAFILES legacy_array_sections_14_foo.f90 EXTRA_ARGS --legacy-array-sections --implicit-interface --separate-compilation) RUN(NAME legacy_array_sections_15 LABELS gfortran llvm EXTRA_ARGS --legacy-array-sections -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME cmake_minimal_test_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME char_array_initialization_declaration LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME ip_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME shifta_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME shifta_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_12 LABELS gfortran) RUN(NAME equivalence_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME equivalence_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc NO_FAST) RUN(NAME equivalence_16 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) RUN(NAME fortran_primes_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME goto_gototarget_return_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME selected_int_kind_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME capital_01 LABELS gfortran llvmImplicit) RUN(NAME do_concurrent_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc mlir mlir_omp mlir_llvm_omp) RUN(NAME do_concurrent_02 LABELS llvm_omp llvm) RUN(NAME do_concurrent_03 LABELS llvm_omp) RUN(NAME do_concurrent_04 LABELS llvm_omp) RUN(NAME do_concurrent_05 LABELS llvm_omp) RUN(NAME do_concurrent_06 LABELS llvm_omp) RUN(NAME do_concurrent_07 LABELS llvm_omp) RUN(NAME do_concurrent_08 LABELS llvm_omp) RUN(NAME do_concurrent_09 LABELS llvm_omp) RUN(NAME do_concurrent_10 LABELS llvm_omp) RUN(NAME do_concurrent_11 LABELS llvm_omp llvm) # every other `do_concurrent` test can work with llvm, the only reason RUN(NAME do_concurrent_12 LABELS llvm_omp llvm) # to not include is that we do a `omp_set_num_threads(xx)` call RUN(NAME do_concurrent_13 LABELS llvm_omp llvm) # to not include is that we do a `omp_set_num_threads(xx)` call RUN(NAME transfer_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_02 LABELS gfortran llvm) RUN(NAME transfer_03 LABELS gfortran llvm) RUN(NAME transfer_04 LABELS gfortran llvm) RUN(NAME transfer_05 LABELS gfortran llvm) RUN(NAME transfer_06 LABELS gfortran llvm) RUN(NAME transfer_07 LABELS gfortran llvm fortran) RUN(NAME transfer_08 LABELS gfortran llvm fortran) RUN(NAME transfer_09 LABELS gfortran llvm fortran) RUN(NAME transfer_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME transfer_11 LABELS gfortran llvm) RUN(NAME present_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME present_04 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME present_05 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME present_06 LABELS gfortran llvm EXTRA_ARGS --implicit-interface) RUN(NAME types_20 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME arrayprint_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME print_arr_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME pointer_to_cptr LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME binop_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME logical_arrays_logical_binop_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME dfloat_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_08 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_09 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_10 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_11 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_12 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_13 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME elemental_14 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_15 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_16 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_17 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_18 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME types_21 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_22 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_23 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_real_to_complex_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME types_real_array_to_complex_array_cast LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME lbound_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME module_function_with_nopass LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME module_function_without_nopass LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME polymorphic_arguments_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME polymorphic_arguments_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME allocatable_polymorphic_mold_01 LABELS gfortran llvm) RUN(NAME allocatable_dummy_descriptor_01 LABELS gfortran llvm) RUN(NAME polymorphic_class_compare LABELS gfortran) RUN(NAME nested_struct_proc_01 LABELS gfortran llvm) RUN(NAME binop_of_struct_instance_in_function_call gfortran llvm fortran) RUN(NAME test_call_arg_structinstance_member gfortran llvm fortran) RUN(NAME openmp_bindc_01 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_02 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_03 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_bindc_04 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_01 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_02 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_03 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_04 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_05 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_06 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_07 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_08 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_09 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_10 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_11 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_12 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_13 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_14 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_15 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_16 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_17 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_18 LABELS gfortran llvm_omp EXTRA_ARGS --fast GFORTRAN_ARGS -fopenmp) # compute pi RUN(NAME openmp_19 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_20 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_21 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_22 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_23 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_24 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_25 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_26 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_27 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_28 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_29 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_30 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # matmul RUN(NAME openmp_31 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_32 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_33 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # mandelbrot RUN(NAME openmp_34 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) # Ensure uniform load distribution over threads RUN(NAME openmp_35 LABELS gfortran llvm_omp GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_36 LABELS gfortran llvm GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_37 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_38 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_39 LABELS gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_40 LABELS llvm_omp llvm) RUN(NAME openmp_41 LABELS llvm_omp llvm) RUN(NAME openmp_42 LABELS llvm_omp llvm) RUN(NAME openmp_43 LABELS llvm_omp llvm) RUN(NAME openmp_44 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_45 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_47 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_48 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_49 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_50 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_51 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_52 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_53 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_54 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_55 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_56 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_57 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_58 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_59 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_60 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_61 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_62 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_63 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_64 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_65 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_66 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_67 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_68 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_69 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_70 LABELS target_offload) RUN(NAME openmp_71 LABELS target_offload) RUN(NAME openmp_72 LABELS target_offload) RUN(NAME openmp_73 LABELS llvm_omp gfortran GFORTRAN_ARGS -fopenmp) RUN(NAME openmp_74 LABELS gfortran llvm) RUN(NAME nullify_01 LABELS gfortran fortran llvm) RUN(NAME nullify_02 LABELS gfortran fortran llvm) RUN(NAME nullify_03 LABELS gfortran llvm) RUN(NAME nullify_04 LABELS gfortran llvm) RUN(NAME nullify_05 LABELS gfortran llvm) RUN(NAME nullify_06 LABELS gfortran llvm) RUN(NAME nullify_07 LABELS gfortran llvm) RUN(NAME fortran_01 LABELS gfortran llvm fortran) RUN(NAME fortran_02 LABELS gfortran fortran) RUN(NAME contig LABELS gfortran llvm) RUN(NAME compiler_version_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME compiler_version_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME compiler_version_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME exit_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME exit_02 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_02 LABELS gfortran llvm) RUN(NAME struct_type_03 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_04 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_05 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_06 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME struct_type_07 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME func_parameter_type_02 LABELS gfortran) # function passed in other argument of function RUN(NAME logical_not_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME assign_allocatable_array_of_struct_instances LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME allocatable_component_struct_array_01 LABELS gfortran llvm) RUN(NAME generic_interface_function_call_of_function_call LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME elemental_function_scalar_array_arg LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME elemental_function_overloaded_compare LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --realloc-lhs-arrays) RUN(NAME procedure_decl_01_a LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRAFILES procedure_decl_01_b.f90) RUN(NAME array_concat LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) # array passed in ArrayInitializer RUN(NAME multiple_objects_args LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME module_array_init LABELS gfortran llvm llvm_wasm llvm_wasm_emcc fortran) RUN(NAME attr_intrinsic LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME separate_compilation_01 LABELS gfortran llvm EXTRAFILES separate_compilation_01b.f90) RUN(NAME separate_compilation_02 LABELS gfortran llvm EXTRAFILES separate_compilation_02b.f90) RUN(NAME separate_compilation_03 LABELS gfortran llvm EXTRAFILES separate_compilation_03a.f90 separate_compilation_03b.f90 EXTRA_ARGS --skip-pass=pass_array_by_data) RUN(NAME separate_compilation_04 LABELS gfortran llvm EXTRAFILES separate_compilation_04a.f90 separate_compilation_04b.f90) RUN(NAME separate_compilation_05 LABELS gfortran llvm EXTRAFILES separate_compilation_05a.f90 separate_compilation_05b.f90) RUN(NAME separate_compilation_06 LABELS gfortran llvm EXTRAFILES separate_compilation_06a.f90 separate_compilation_06b.f90) RUN(NAME separate_compilation_07 LABELS gfortran llvm EXTRAFILES separate_compilation_07a.f90 separate_compilation_07b.f90 separate_compilation_07c.c) RUN(NAME separate_compilation_08 LABELS gfortran llvm EXTRAFILES separate_compilation_08a.f90 separate_compilation_08b.f90) RUN(NAME separate_compilation_09 LABELS gfortran llvm EXTRAFILES separate_compilation_09a.f90 separate_compilation_09b.f90 separate_compilation_09c.c) RUN(NAME separate_compilation_10 LABELS gfortran llvm EXTRAFILES separate_compilation_10a.f90) RUN(NAME separate_compilation_11 LABELS gfortran llvm EXTRAFILES separate_compilation_11a.f90) RUN(NAME separate_compilation_12 LABELS gfortran llvm EXTRAFILES separate_compilation_12a.f90) RUN(NAME separate_compilation_13 LABELS gfortran llvm EXTRAFILES separate_compilation_13a.f90) RUN(NAME separate_compilation_class_star_01 LABELS gfortran llvm EXTRAFILES separate_compilation_class_star_01a.f90) RUN(NAME separate_compilation_14 LABELS gfortran llvm EXTRAFILES separate_compilation_14a.f90) RUN(NAME separate_compilation_15 LABELS gfortran llvm EXTRAFILES separate_compilation_15a.f90) RUN(NAME separate_compilation_16 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_16a.f90 separate_compilation_16b.f90) RUN(NAME separate_compilation_17 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_17a.f90 separate_compilation_17b.f90) RUN(NAME separate_compilation_18 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_18a.f90 separate_compilation_18b.f90) RUN(NAME separate_compilation_19 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_19a.f90 separate_compilation_19b.f90) RUN(NAME separate_compilation_20 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_20a.f90 separate_compilation_20b.f90) RUN(NAME separate_compilation_21 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_21a.f90 separate_compilation_21b.f90) RUN(NAME separate_compilation_22 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_22a.f90 separate_compilation_22b.f90) RUN(NAME separate_compilation_23 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_23a.f90 separate_compilation_23b.f90) RUN(NAME separate_compilation_24 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_24a.f90 separate_compilation_24b.f90) RUN(NAME separate_compilation_25 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_25a.f90 separate_compilation_25b.f90) RUN(NAME separate_compilation_26 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_26a.f90 separate_compilation_26b.f90) RUN(NAME separate_compilation_27 LABELS gfortran llvm_submodule EXTRAFILES separate_compilation_27a.f90 separate_compilation_27b.f90) RUN(NAME separate_compilation_28 LABELS gfortran llvm EXTRAFILES separate_compilation_28a.f90 separate_compilation_28b.f90 EXTRA_ARGS --implicit-interface) RUN(NAME separate_compilation_29 LABELS gfortran llvm EXTRAFILES separate_compilation_29a.f90 separate_compilation_29b.f90 EXTRA_ARGS --separate-compilation) RUN(NAME no_explicit_return_type_01 LABELS gfortran llvm llvm_wasm llvm_wasm_emcc EXTRA_ARGS --implicit-typing) RUN(NAME logical_testing LABELS gfortran llvm) RUN(NAME formatted_read_01 LABELS gfortran llvm COPY_TO_BIN formatted_read_input_01.txt) RUN(NAME format_before_read_01 LABELS gfortran llvm) # LFortran extensions (lists, dicts, etc.) RUN(NAME list_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_of_lists_test LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME set_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_of_tuples_test LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # Completely ported tests RUN(NAME list_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_06_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_08_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME list_test_09_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_concat_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME tuple_test_nested_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_01_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_02_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # RUN(NAME dict_test_03_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # Fix segault RUN(NAME dict_test_04_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_07_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME dict_test_13_ LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extensions (union) RUN(NAME union_test_01 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME union_test_02 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME union_test_03 LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extensions (unsigned int) RUN(NAME test_unsigned LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran # LFortran extenstion (Python's str) RUN(NAME test_str LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME test_ord LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME test_rep LABELS llvm llvm_wasm llvm_wasm_emcc) # No gfortran RUN(NAME str_to_char LABELS gfortran llvm) # test for polymorphic select type RUN(NAME polymorphic_select_type_01 LABELS gfortran llvm) RUN(NAME polymorphic_select_type_02 LABELS gfortran llvm) RUN(NAME defined_op_match_01 LABELS gfortran llvm) #test for forward declaration of derived type RUN(NAME issue_9063 LABELS gfortran llvm) RUN(NAME issue_4901 LABELS gfortran llvm) RUN(NAME issue_7357 LABELS gfortran llvm) RUN(NAME issue_8324 LABELS gfortran llvm) RUN(NAME intent_out_array_01 LABELS gfortran llvm) RUN(NAME intent_out_allocatable_component_dealloc LABELS gfortran llvm) RUN(NAME intent_out_struct_member_no_dealloc LABELS gfortran llvm) RUN(NAME intent_out_module_dealloc LABELS gfortran llvm) RUN(NAME array_shape_func_call LABELS gfortran llvm llvm_wasm llvm_wasm_emcc) RUN(NAME ilp64_kind_arg_01 LABELS gfortran llvm EXTRA_ARGS -fdefault-integer-8 GFORTRAN_ARGS -fdefault-integer-8) # UTF-8 BOM handling RUN(NAME utf8_bom_01 LABELS gfortran llvm) lfortran-lfortran-2f73434/integration_tests/derived_types_71.f900000664000175000017500000000134715141516316025102 0ustar alastairalastairmodule derived_type_71_mod type build_target_t integer :: key end type type build_target_ptr type(build_target_t), pointer :: ptr end type build_target_ptr end module program derived_type_71 use derived_type_71_mod type(build_target_t), pointer :: x type(build_target_t), target :: z type(build_target_ptr) :: y z%key = 12 x => z y = build_target_ptr(x) if (y%ptr%key /= 12) error stop call temp(y) if (y%ptr%key /= 15) error stop contains subroutine temp(b1) type(build_target_ptr), intent(inout) :: b1 call temp2(b1%ptr) end subroutine subroutine temp2(b2) type(build_target_t), intent(inout) :: b2 b2%key = 15 end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_295.f900000664000175000017500000000656715141516316024522 0ustar alastairalastairprogram intrinsics_295 use iso_fortran_env, only: sp=>real32, dp=>real64 implicit none real(sp) :: x real(dp) :: y complex(sp) :: z complex(dp) :: w real(sp), parameter :: x1 = exp(1.5_sp) real(dp), parameter :: y1 = exp(1.5_dp) complex(sp), parameter :: x2 = exp((1.5_sp, 2.5_sp)) complex(dp), parameter :: y2 = exp((1.11_dp, 2.21_dp)) real(sp), parameter :: ar1(3) = exp([1.1_sp, 2.2_sp, 3.3_sp]) real(dp), parameter :: ar2(3) = exp([1.31_dp, 2.42_dp, 3.13_dp]) complex(sp), parameter :: ar3(3) = exp([(1.5_sp, 2.5_sp), (3.5_sp, 4.5_sp), (5.5_sp, 6.5_sp)]) complex(dp), parameter :: ar4(3) = exp([(1.5_dp, 2.5_dp), (3.5_dp, 4.5_dp), (5.5_dp, 6.5_dp)]) real(sp) :: arr1(3) = [1.1_sp, 2.2_sp, 3.3_sp] real(dp) :: arr2(3) = [1.31_dp, 2.42_dp, 3.13_dp] complex(sp) :: arr3(3) = [(1.1_sp, 2.2_sp), (3.3_sp, 4.4_sp), (5.5_sp, 6.6_sp)] complex(dp) :: arr4(3) = [(1.1_dp, 2.2_dp), (3.3_dp, 4.4_dp), (5.5_dp, 6.6_dp)] complex(sp) :: res1(3) complex(dp) :: res2(3) print *, x1 if (abs(x1 - 4.48168907_sp) > 1e-5) error stop print *, y1 if (abs(y1 - 4.481689070338064822e+00_dp) > 1e-10) error stop print *, x2 if (abs(x2 - (-3.59047651_sp, 2.682166_sp)) > 1e-5) error stop print *, y2 if (abs(y2 - (-1.81016628947939662e+00_dp, 2.4352882519970085_dp)) > 1e-10) error stop print *, ar1 if (any(ar1 - [3.00416613e+00_sp, 9.02501392e+00_sp, 2.71126385e+01_sp] > 1e-6)) error stop print *, ar2 if (any(ar2 - [3.70617371221019898e+00_dp, 1.12458593148818444e+01_dp, 2.28739795424408072e+01_dp] > 1e-10)) error stop print *, ar3 if (abs(ar3(1) - (-3.590477_sp,2.682166_sp)) > 1e-6) error stop if (abs(ar3(2) - (-6.980598_sp,-32.371353_sp)) > 1e-6) error stop if (abs(ar3(3) - (238.963120_sp,52.638126_sp) ) > 1e-6) error stop print *, ar4 if (abs(ar4(1) - (-3.5904765855678136_dp, 2.6821660671324890_dp)) > 1e-10) error stop if (abs(ar4(2) - (-6.9805981691441259_dp, -32.371351649713368_dp)) > 1e-10) error stop if (abs(ar4(3) - (238.96311316471733_dp, 52.638125553863652_dp) ) > 1e-10) error stop x = exp(1.5_sp) print *, x if (abs(x - 4.48168907_sp) > 1e-5) error stop y = exp(1.5_dp) print *, y if (abs(y - 4.481689070338064822_dp) > 1e-10) error stop z = exp((1.5_sp, 2.5_sp)) print *, z if (abs(z - ((-3.59047651_sp, 2.682166_sp))) > 1e-5) error stop w = exp((1.11_dp, 2.21_dp)) print *, w if (abs(w - (-1.8101662894793968_dp, 2.4352882519970085_dp)) > 1e-10) error stop print *, exp(arr1) if (any(exp(arr1) - [3.00416613e+00_sp, 9.02501392e+00_sp, 2.71126385e+01_sp] > 1e-6)) error stop print *, exp(arr2) if (any(exp(arr2) - [3.7061737122101990_dp, 11.245859314881844_dp, 22.873979542440807_dp] > 1e-10)) error stop res1 = exp(arr3) print *, res1 if (abs(res1(1) - (-1.767955_sp, 2.428857_sp)) > 1e-6) error stop if (abs(res1(2) - (-8.332603_sp, -25.800444_sp)) > 1e-6) error stop if (abs(res1(3) - (232.514252_sp, 76.231628_sp) ) > 1e-5) error stop res2 = exp(arr4) print *, res2 if (abs(res2(1) - (-1.7679550615130259_dp, 2.4288574268376881_dp)) > 1e-10) error stop if (abs(res2(2) - (-8.3326051321743808_dp, -25.800443425515649_dp)) > 1e-10) error stop if (abs(res2(3) - (232.51424902677110_dp, 76.231658218318316_dp) ) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_46.f900000664000175000017500000000131415141516316023526 0ustar alastairalastairprogram omp_task_mre use omp_lib implicit none integer, parameter :: n = 10 real :: array(n) integer :: i ! Initialize the array do i = 1, n array(i) = real(i) end do !$OMP PARALLEL SECTIONS SHARED(array) !$OMP SECTION do i = 1, n !$OMP TASK FIRSTPRIVATE(i) SHARED(array) array(i) = array(i) * real(i) print *, "Task: i = ", i, ", computed by thread ", omp_get_thread_num() !$OMP END TASK end do !$OMP SECTION print*, "All tasks submitted. Waiting for completion." !$OMP END PARALLEL SECTIONS ! Print the updated array print *, "Updated array:" do i = 1, n print *, "array(", i, ") = ", array(i) end do end program omp_task_mrelfortran-lfortran-2f73434/integration_tests/pass_array_by_data_09.f900000664000175000017500000000170215141516316026057 0ustar alastairalastairmodule pass_array_by_data_09_mod interface interface_1 procedure :: ff end interface interface_1 contains function ff(inp) result(oout) integer, intent(in) :: inp(:) integer :: oout print *, inp if(any(inp /= [1,2,3,4,5])) error stop oout = 11 end function end module pass_array_by_data_09_mod program pass_array_by_data_09 use pass_array_by_data_09_mod type :: tt integer :: i end type tt integer, allocatable :: ll(:) type(tt) :: inst_tt call ffo(inst_tt) contains subroutine ffo(dummy) class(tt), intent(in):: dummy ! This shouldn't idenify this function `ffo` as StructMethodDeclaration. It's a normal function. integer :: r integer, dimension(5) :: rr rr = [1,2,3,4,5] r = interface_1(rr) print *, r if(r /= 11) error stop end subroutine ffo end program pass_array_by_data_09 lfortran-lfortran-2f73434/integration_tests/intrinsics_368.f900000664000175000017500000000144015141516316024504 0ustar alastairalastairmodule intrinsics_368_test_mod implicit none logical, parameter :: param=ichar(transfer(1,'a')) == 0 end module intrinsics_368_test_mod program intrinsics_368 use intrinsics_368_test_mod implicit none integer(kind=transfer(4_1, 0)) :: x1 integer(kind=kind(0)) :: x2 integer(kind=(4+0)) :: x3 integer :: i integer(kind=sum([(i, i=0,3)])-2) :: x4 integer(kind=INT(61*BESSEL_JN(4, 2.5))) :: x5 integer,parameter::dp=kind(1d0),nextp=selected_real_kind(precision(1d0)+1) integer,parameter::ep = merge(nextp,dp,nextp>0) print *,'pi=acos(-1.0_dp)=', acos(-1.0_dp) if (abs(acos(-1.0_dp) - 3.1415926535897931) > 1e-7) error stop print *,'pi=acos(-1.0_ep)=',acos(-1.0_ep) if (abs(acos(-1.0_ep) - 3.1415926535897931) > 1e-7) error stop end programlfortran-lfortran-2f73434/integration_tests/file_05.f900000664000175000017500000000130615141516316023143 0ustar alastairalastairprogram file_05 implicit none integer :: u = 11, i, j integer :: arr(2, 3) integer, allocatable :: alloc_arr(:, :) open(u, file="file_05_data.dat", form="unformatted", access="stream", status="old") read(u) arr close(u) do i = 1, 2 do j = 1, 3 print *, arr(i, j) end do end do print *, sum(arr) if (sum(arr) /= 8) error stop open(u, file="file_05_data.dat", form="unformatted", access="stream", status="old") allocate(alloc_arr(2, 3)) read(u) alloc_arr close(u) do i = 1, 2 do j = 1, 3 print *, alloc_arr(i, j) end do end do if (sum(alloc_arr) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/volatile_03.f900000664000175000017500000000017615141516316024045 0ustar alastairalastairprogram volatile_03 implicit none character, volatile :: x character :: y = '2' y = x end program volatile_03lfortran-lfortran-2f73434/integration_tests/intrinsics_15.f900000664000175000017500000000110215141516316024404 0ustar alastairalastairprogram intrinsics_15 use iso_fortran_env, only: sp=>real32, dp=>real64 integer :: x real(sp) :: r32 real(dp) :: r64 complex(sp) :: c32 complex(dp) :: c64 x = 5; r32 = 5; r64 = 5; c32 = (5._sp, 7._sp); c64 = (5._dp, 7._dp) ! No kind argument r32 = real(x) r32 = real(r32) r32 = real(r64) r32 = real(c32) r32 = real(c64) ! single precision kind r32 = real(x, sp) r32 = real(r32, sp) r32 = real(r64, sp) r32 = real(c32, sp) r32 = real(c64, sp) ! double precision kind r64 = real(x, dp) r64 = real(r32, dp) r64 = real(r64, dp) r64 = real(c32, dp) r64 = real(c64, dp) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_186.f900000664000175000017500000000056715141516316024513 0ustar alastairalastairprogram intrinsic_186 implicit none character(7) :: string print*, verify(maybe(string), "foo") if (verify(maybe(string), "foo") /= 3) error stop contains function maybe(string) result(maybe_string) character(7) :: string character(len=len(string)) :: maybe_string maybe_string = "fortran" end function maybe end program lfortran-lfortran-2f73434/integration_tests/inquire_06.f900000664000175000017500000000033315141516316023700 0ustar alastairalastairprogram inquire_recl implicit none integer :: u, r open(newunit=u, file="inquire_06.bin", access="direct", recl=32) inquire(unit=u, recl=r) if (r /= 32) error stop close(u, status="delete") end program lfortran-lfortran-2f73434/integration_tests/openmp_25.f900000664000175000017500000000173515141516316023532 0ustar alastairalastairsubroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a integer :: i !$omp parallel shared(a) private(i) !$omp do do i = 1, n a(i) = 12.91 end do !$omp end do !$omp end parallel print *, a(1), a(n), a(12), a(12841) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(n) - 12.91) > 1e-8) error stop if (abs(a(12) - 12.91) > 1e-8) error stop if (abs(a(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_25 use omp_lib integer, parameter :: n = 100000 integer :: i real, pointer :: b(:) interface subroutine initialise_array(n, a) integer, intent(in) :: n real, dimension(:), intent(inout) :: a end subroutine end interface allocate(b(n)) call omp_set_num_threads(4) call initialise_array(n, b) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/class_56.f900000664000175000017500000000324415141516316023342 0ustar alastairalastairmodule class_56_mod1 implicit none type :: toml_value integer :: x = 0 contains procedure :: accept end type type :: string_t character(len=:), allocatable :: s end type string_t contains subroutine accept(self) class(toml_value), intent(inout) :: self self%x = self%x + 1 end subroutine end module module class_56_mod2 use class_56_mod1 implicit none type :: ser_config contains procedure :: temp procedure :: temp2 end type contains subroutine temp(self, val) class(ser_config), intent(inout) :: self class(toml_value), intent(inout) :: val select type(val) type is (toml_value) call val%accept() class default print *, "Unknown type" end select end subroutine subroutine temp2(self, val) class(ser_config), intent(inout) :: self class(toml_value), intent(inout) :: val select type(val) class is (toml_value) call val%accept() class default print *, "Unknown type" end select end subroutine subroutine pkgcfg_list_all(descriptions) type(string_t), optional, allocatable, intent(out) :: descriptions(:) allocate(descriptions(2)) descriptions(1)%s = "Package 1" descriptions(2)%s = "Package 2" end subroutine end module program class_56 use class_56_mod2 implicit none type(ser_config) :: cfg type(toml_value) :: v type(string_t), allocatable :: descriptions(:) v%x = 1 call cfg%temp(v) if (v%x /= 2) error stop call cfg%temp2(v) if (v%x /= 3) error stop call pkgcfg_list_all(descriptions) if (descriptions(1)%s /= "Package 1") error stop if (descriptions(2)%s /= "Package 2") error stop end program lfortran-lfortran-2f73434/integration_tests/types_21.f900000664000175000017500000000045615141516316023373 0ustar alastairalastairprogram types_21 integer(8) :: res integer(8) :: x(5) res = fun(x) print*, res if ( res /= 5 ) error stop contains function fun (x) result(res) integer(8) :: res integer(8), intent(in) :: x(:) res = size(x, kind=8) end endlfortran-lfortran-2f73434/integration_tests/intrinsics_18c.f900000664000175000017500000000451615141516316024566 0ustar alastairalastairprogram intrinsics_18c ! This program tests all trigonometric intrinsics, both in declarations ! and in executable statements. Single and double precision, complex only. integer, parameter :: dp = kind(0.d0) complex, parameter :: & s1 = sin((0.5,0.5)), & s2 = cos((0.5,0.5)), & s3 = tan((0.5,0.5)), & s4 = asin((0.5,0.5)), & s5 = acos((0.5,0.5)), & s6 = atan((0.5,0.5)), & s7 = sinh((0.5,0.5)), & s8 = cosh((0.5,0.5)), & s9 = tanh((0.5,0.5)), & s10 = asinh((0.5,0.5)), & s11 = acosh((1.5,1.5)), & s12 = atanh((0.5,0.5)) complex(dp), parameter :: & d1 = sin((0.5_dp,0.5_dp)), & d2 = cos((0.5_dp,0.5_dp)), & d3 = tan((0.5_dp,0.5_dp)), & d4 = asin((0.5_dp,0.5_dp)), & d5 = acos((0.5_dp,0.5_dp)), & d6 = atan((0.5_dp,0.5_dp)), & d7 = sinh((0.5_dp,0.5_dp)), & d8 = cosh((0.5_dp,0.5_dp)), & d9 = tanh((0.5_dp,0.5_dp)), & d10 = asinh((0.5_dp,0.5_dp)), & d11 = acosh((1.5_dp,1.5_dp)), & d12 = atanh((0.5_dp,0.5_dp)) complex :: x, x2 complex(dp) :: y, y2 x = (0.5,0.5) y = (0.5_dp,0.5_dp) x2 = (1.5,1.5) y2 = (1.5_dp,1.5_dp) print *, sin((0.5,0.5)), sin((0.5_dp,0.5_dp)), s1, d1, sin(x), sin(y) print *, cos((0.5,0.5)), cos((0.5_dp,0.5_dp)), s2, d2, cos(x), cos(y) print *, tan((0.5,0.5)), tan((0.5_dp,0.5_dp)), s3, d3, tan(x), tan(y) print *, asin((0.5,0.5)), asin((0.5_dp,0.5_dp)), s4, d4, asin(x), asin(y) if (abs(real(asin((0.5, 0.5))) - 0.452278435) > 1e-7) error stop if (abs(real(asin(x)) - 0.452278435) > 1e-7) error stop print *, acos((0.5,0.5)), acos((0.5_dp,0.5_dp)), s5, d5, acos(x), acos(y) if (abs(real(acos((0.5, 0.5))) - 1.11851788) > 1e-7) error stop if (abs(real(acos(x)) - 1.11851788) > 1e-7) error stop print *, atan((0.5,0.5)), atan((0.5_dp,0.5_dp)), s6, d6, atan(x), atan(y) if (abs(real(atan((0.5, 0.5))) - 0.553574383) > 1e-7) error stop if (abs(real(atan(x)) - 0.553574383) > 1e-7) error stop print *, sinh((0.5,0.5)), sinh((0.5_dp,0.5_dp)), s7, d7, sinh(x), sinh(y) print *, cosh((0.5,0.5)), cosh((0.5_dp,0.5_dp)), s8, d8, cosh(x), cosh(y) print *, tanh((0.5,0.5)), tanh((0.5_dp,0.5_dp)), s9, d9, tanh(x), tanh(y) print *, asinh((0.5,0.5)), asinh((0.5_dp,0.5_dp)), s10, d10, asinh(x), asinh(y) print *, acosh((1.5,1.5)), acosh((1.5_dp,1.5_dp)), s11, d11, acosh(x2), acosh(y2) print *, atanh((0.5,0.5)), atanh((0.5_dp,0.5_dp)), s12, d12, atanh(x), atanh(y) end lfortran-lfortran-2f73434/integration_tests/block_06.f900000664000175000017500000000063315141516316023321 0ustar alastairalastairprogram block_06 implicit none integer :: a, b real :: c, d a = 5 b = -5 c = 0.5 d = 7.5 block integer :: x, y real :: z, w x = 10 y = -10 z = 2.25 w = -2.25 print *, x, y, z, w print *, a, b, c, d a = x b = y c = z d = w end block print *, a, b, c, d end program block_06 lfortran-lfortran-2f73434/integration_tests/arrays_12.f900000664000175000017500000000117515141516316023527 0ustar alastairalastairprogram arrays_12 implicit none integer :: i real, dimension(2, 2) :: B integer, parameter:: C(3, 2, 3) = reshape([(i, i = 1, 18)], [3, 2, 3]) ! vector subscripts integer, dimension(3) :: U = [1, 3, 2] integer, dimension(4) :: V = [3, 1, 1, 2] ! test back to back reshape - C is 3 x 2 x 3 function B = reshape(reshape(C, [4]), [2, 2]) print *, B print *, C(1, :, :) print *, C(2, :, :) print *, C(3, :, :) ! test vector as subscripts for rank 3 array print *, C(U, 2, V) print *, C(3, U(3:), V) ! test spread intrinsic print *, spread(C, 2, 2) end program lfortran-lfortran-2f73434/integration_tests/common_17.f900000664000175000017500000000141215141516316023515 0ustar alastairalastair! Test: COMMON block with type aliasing (same storage, different types) ! This tests storage association where the same bytes are viewed differently program common_17 implicit none double precision :: arr(4) ! 32 bytes double precision :: original_value common /data/ arr arr(1) = 1.0d0 original_value = arr(1) call sub_int_view() ! After sub_int_view modifies the first 4 bytes, arr(1) should be different if (arr(1) == original_value) error stop "Type aliasing failed - arr(1) unchanged" print *, "PASS: common_17" end program subroutine sub_int_view() implicit none integer :: iarr(8) ! 32 bytes (different layout) common /data/ iarr ! Modify first integer (first 4 bytes of arr(1)) iarr(1) = 999 end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_86.f900000664000175000017500000000067015141516316024425 0ustar alastairalastairprogram intrinsics_86 real(4) :: x integer :: res res = kind(3.0) print *, res if (res /= 4) error stop res = kind(x) print *, res if (res /= 4) error stop res = kind(3) print *, res if (res /= 4) error stop res = kind(3.0d0) print *, res if (res /= 8) error stop res = kind(3d0) print *, res if (res /= 8) error stop res = kind(3.0e0) print *, res if (res /= 4) error stop res = kind("a") print *, res if (res /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_113.f900000664000175000017500000000046415141516316024475 0ustar alastairalastairprogram intrinsics_113 print *, sign(a=-12.,b=0.) print *, sign(a=-12.,b=1.) print *, sign(a=-12.,b=-1.) if ( .not. sign( a = -12, b = 1 ) == 12 ) error stop if ( .not. sign( -12, b = 0 ) == 12 ) error stop if ( .not. sign( -12, -1 ) == -12 ) error stop end program intrinsics_113 lfortran-lfortran-2f73434/integration_tests/openmp_51.f900000664000175000017500000000100115141516316023513 0ustar alastairalastairprogram openmp_51 use omp_lib implicit none call omp_set_num_threads(10) !$omp parallel if(omp_get_thread_num() == 0) then !$omp task print *, "Task 0 done by TID:-",omp_get_thread_num() !$omp end task end if if(omp_get_thread_num() == 1) then !$omp task print *, "Task 1 done by TID:-",omp_get_thread_num() !$omp end task end if !$omp end parallel end program openmp_51lfortran-lfortran-2f73434/integration_tests/associate_02.f900000664000175000017500000000075115141516316024177 0ustar alastairalastairprogram associate_02 implicit none integer, pointer :: p1 real(8), pointer :: p2 integer, target :: t1 = 2 real(8), target :: t2 = 2.0_8 complex(4), pointer :: p3 complex(4), target :: t3 = (2.0_4, 3.0_4) p1 => t1 p2 => t2 p3 => t3 p1 = 1 p2 = 4.0_4 print *, p1 print *, t1 t1 = p2 + p1 print *, p1 print *, t1 t1 = 8 print *, p1 print *, t1 p3 = 2*p3 print *, p3 print *, t3 end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_17b.f900000664000175000017500000000072115141516316026573 0ustar alastairalastairsubmodule(mod_separate_compilation_17) submod_separate_compilation_17 implicit none contains module function int8_fnv_1( key ) result(hash_code) integer(1), intent(inout) :: key(:) integer(4) :: hash_code integer(1), parameter :: array(4) = [1, 2, 3, 4] integer(4), parameter :: result = 5 hash_code = result key = array end function int8_fnv_1 end submodule submod_separate_compilation_17lfortran-lfortran-2f73434/integration_tests/modules_52_module2.f900000664000175000017500000000024615141516316025327 0ustar alastairalastairmodule module_52_tomlf_type implicit none type :: toml_table logical :: implicit = .false. logical :: inline = .false. end type toml_table end module lfortran-lfortran-2f73434/integration_tests/nullify_02.f900000664000175000017500000000034315141516316023703 0ustar alastairalastairprogram nullify_02 implicit none real, pointer :: p1 real, target :: t1 integer, pointer :: p2 integer, target :: t2 p1=>t1 p1 = 1 p2=>t2 p2 = 2. nullify(p1, p2) end program nullify_02 lfortran-lfortran-2f73434/integration_tests/derived_types_45.f900000664000175000017500000000050015141516316025071 0ustar alastairalastairmodule derived_types_45_mod implicit none type myint integer :: m end type end module derived_types_45_mod program derived_types_45 use derived_types_45_mod implicit none type(myint), allocatable :: ins ins = myint(44) if (ins%m /= 44) error stop end program derived_types_45 lfortran-lfortran-2f73434/integration_tests/operator_overloading_04.f900000664000175000017500000000254415141516316026454 0ustar alastairalastairmodule operator_overloading_04_stdlib_string_type type :: string_type ! Use the sequence statement below as a hack to prevent extending this type. ! It is not used for storage association. sequence character(len=:), allocatable :: raw end type string_type interface assignment(=) module procedure :: assign_string_char end interface assignment(=) contains pure subroutine assign_string_char(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_string_char elemental function trim_string(string) result(trimmed_string) type(string_type), intent(in) :: string type(string_type) :: trimmed_string trimmed_string = string%raw end function trim_string end module module operator_overloading_stdlib_string_use use operator_overloading_04_stdlib_string_type, only: string_type implicit none contains pure function chomp_string(string) result(chomped_string) ! Avoid polluting the module scope and use the assignment only in this scope use operator_overloading_04_stdlib_string_type, only : assignment(=) type(string_type), intent(in) :: string type(string_type) :: chomped_string integer :: last end function chomp_string end module program stdlib_string end program lfortran-lfortran-2f73434/integration_tests/common_20.f900000664000175000017500000000364715141516316023523 0ustar alastairalastair! Test: COMMON block bidirectional value sharing (F2018 8.10.3) ! Verifies that values written in one program unit are visible in others, ! and that modifications in subroutines are visible back in the main program. ! Also tests that different variable names can access the same storage. program common_20 implicit none integer :: a, b, c real :: x, y common/valblk/a, b, c, x, y ! Initialize all values a = 10 b = 20 c = 30 x = 1.5 y = 2.5 ! Verify values can be read in subroutine call sub_read_verify() ! Verify values modified in subroutine are visible here if (a /= 100) error stop "a should be 100 after sub_read_verify" if (b /= 200) error stop "b should be 200 after sub_read_verify" if (c /= 300) error stop "c should be 300 after sub_read_verify" ! Test with different variable names call sub_diff_names() if (a /= 111) error stop "a should be 111 after sub_diff_names" print *, "PASS: common_20" end program subroutine sub_read_verify() implicit none integer :: a, b, c real :: x, y common/valblk/a, b, c, x, y ! Verify we can read values set in main if (a /= 10) error stop "a should be 10" if (b /= 20) error stop "b should be 20" if (c /= 30) error stop "c should be 30" if (abs(x - 1.5) > 0.001) error stop "x should be 1.5" if (abs(y - 2.5) > 0.001) error stop "y should be 2.5" ! Modify values - should be visible in main a = 100 b = 200 c = 300 end subroutine subroutine sub_diff_names() implicit none ! Different variable names but same storage integer :: p, q, r real :: s, t common/valblk/p, q, r, s, t ! p, q, r should have values 100, 200, 300 from previous subroutine if (p /= 100) error stop "p should be 100" if (q /= 200) error stop "q should be 200" if (r /= 300) error stop "r should be 300" ! Modify first variable p = 111 end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_391.f900000664000175000017500000000266715141516316024514 0ustar alastairalastairprogram intrinsics_391 implicit none integer,parameter:: kr1 = selected_real_kind(1), maxkr = 3, & skr2 = selected_real_kind(precision(1.0_kr1)+1), & kr2 = merge(skr2,kr1, skr2>0), & skr3 = selected_real_kind(precision(1.0_kr2)+1), & kr3 = merge(skr3,kr2, skr3>0),& ! kr3 = skr3 if that's a valid real kind, kr2 if not allkr(maxkr+1) = [kr1,kr2,kr3,kr3] ,& nkr = minloc(abs(allkr(1:maxkr)-allkr(2:maxkr+1)),1) integer :: result1(4), result2 integer, parameter:: allkr1(4) = [-1,2,-3,4] integer, parameter :: nkr1(4) = abs(allkr1(1:4)) integer,parameter:: nkr2 = sum(abs(allkr1(1:3))) print *, nkr1 result1 = nkr1 if (any(result1 /= [1, 2, 3, 4])) error stop print *, nkr2 result2 = nkr2 if (result2 /= 6) error stop print *, nkr call realkinds(nkr) contains subroutine realkinds( nkr) integer,intent(in)::nkr integer :: n print "(A,I0)",'precision(1.0_kr1) = ',precision(1.0_kr1) if(nkr>=2) print "(A,I0)",'precision(1.0_kr2) = ',precision(1.0_kr2) if(nkr>=3) print "(A,I0)",'precision(1.0_kr3) = ',precision(1.0_kr3) write(*,"(A,I0,A)",advance='no') & 'Number of different real kinds = ',nkr,', real kinds:' print "(*(1X,I0))",allkr(1:nkr) print "(3A)",'There ',merge('may be','are no',nkr>=maxkr),' more real kinds' end subroutine realkinds end program intrinsics_391 lfortran-lfortran-2f73434/integration_tests/openmp_20.f900000664000175000017500000000110115141516316023510 0ustar alastairalastairsubroutine initialise_array(n) integer, intent(in) :: n real, dimension(n) :: b integer :: i !$omp parallel shared(b) private(i) !$omp do do i = 1, n b(i) = 12.91 end do !$omp end do !$omp end parallel print *, b(1), b(n) print *, b(1), b(n), b(12), b(12841) if (abs(b(1) - 12.91) > 1e-8) error stop if (abs(b(n) - 12.91) > 1e-8) error stop if (abs(b(12) - 12.91) > 1e-8) error stop if (abs(b(12841) - 12.91) > 1e-8) error stop end subroutine program openmp_20 use omp_lib integer, parameter :: n = 100000 call omp_set_num_threads(4) call initialise_array(n) end program lfortran-lfortran-2f73434/integration_tests/interface_05.f900000664000175000017500000000101715141516316024163 0ustar alastairalastairmodule interface_05_mod implicit none interface a module procedure a1 module procedure a2 end interface contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function end module program interface_05 use interface_05_mod, only: a implicit none integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_op_8.f900000664000175000017500000000134615141516316024152 0ustar alastairalastairprogram arrays_op_8 implicit none call array_expr_01() contains subroutine array_expr_01() integer :: dim1, dim2, dim3, dim1d, i integer :: shape1d(1), shape3d(3) real(8) :: eps real(8) :: e(10, 10, 5), f(10, 10, 5) real(8) :: g(500), e1d(500), f1d(500) eps = 1e-12 dim1 = 10 dim2 = 10 dim3 = 5 dim1d = dim1 * dim2 * dim3 do i = 1, dim1d e1d(i) = i + 1 f1d(i) = i + 1 end do shape3d(1) = dim1 shape3d(2) = dim2 shape3d(3) = dim3 shape1d(1) = dim1d e = reshape(e1d, shape3d) f = reshape(f1d, shape3d) g = reshape(e + f, shape1d) do i = 1, dim1d if ( abs(g(i) - 2*(i + 1)) > eps ) error stop end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/select_rank_09.f900000664000175000017500000000213615141516316024524 0ustar alastairalastair program select_rank_test implicit none integer :: b(2) = [1,2] integer :: c(2,2) = reshape([1,2,3,4],[2,2]) integer :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) integer, intent(in) :: x(..) integer, intent(in) :: expected integer :: minloc_res1(1) integer :: minloc_res2(2) select rank(y=>x) rank(1) print *, y minloc_res1 = minloc(y) if (minloc_res1(1) /= 1) error stop if (y(2) /= 2) error stop if (expected /= 1) error stop rank(2) print *, y minloc_res2 = minloc(y) if (any(minloc_res2 /= [1, 1])) error stop print *, minloc(y) if (expected /= 2) error stop rank(3) print *, y print *, minloc(y) if (expected /= 3) error stop end select end subroutine check end program select_rank_testlfortran-lfortran-2f73434/integration_tests/modules_09_b.f900000664000175000017500000000022215141516316024175 0ustar alastairalastairmodule modules_09_b implicit none private public b, i integer, parameter :: i = 5 contains integer function b() b = 5 end function end module lfortran-lfortran-2f73434/integration_tests/arrays_op_20.f900000664000175000017500000000051715141516316024223 0ustar alastairalastairprogram arrays_op_20 implicit none real, allocatable :: array(:, :), arrayoutput(:, :) allocate(array(3, 3)) arrayoutput = f(5, array) print *, size(arrayoutput) if( size(arrayoutput) /= 24 ) error stop contains function f(m, input) result(output) integer :: m real :: input(m) real :: output(2:m, m:2*m) end function end program lfortran-lfortran-2f73434/integration_tests/modules_11.f900000664000175000017500000000055215141516316023673 0ustar alastairalastairmodule modules_11_module11 implicit none integer :: i = 1 integer :: j = 2 contains subroutine access_internally() print*, "i = ", i end subroutine access_internally end module program access_externally use modules_11_module11 implicit none print*, "j = ", j call access_internally() end program access_externally lfortran-lfortran-2f73434/integration_tests/expr_10.f900000664000175000017500000000033115141516316023173 0ustar alastairalastairprogram expr_10 integer, parameter :: dp = kind(0.d0) real(dp) :: x x = 2.2e-5_dp print *, x if (abs(x-2.2e-5_dp) > 1e-10_dp) error stop x = 2.2d-5 print *, x if (abs(x-2.2e-5_dp) > 1e-10_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_21b.f900000664000175000017500000000023015141516316024027 0ustar alastairalastairmodule modules_21b contains subroutine sub(n) integer, intent(in) :: n real, allocatable, dimension(:) :: X allocate(X(n)) end subroutine end module lfortran-lfortran-2f73434/integration_tests/class_16.f900000664000175000017500000000120615141516316023332 0ustar alastairalastairmodule stdlib_logger implicit none public :: logger_type type :: logger_type integer(4) :: max_width = 5 end type logger_type contains subroutine format_output_string( self) class(logger_type) :: self call format_first_line() if (self%max_width /= 15) error stop contains subroutine format_first_line() if (self%max_width /= 10) error stop self%max_width = 15 end subroutine format_first_line end subroutine end module program class_16 use stdlib_logger implicit none type(logger_type) :: logger logger%max_width = 10 call format_output_string(logger) end program lfortran-lfortran-2f73434/integration_tests/boz_01.f900000664000175000017500000000112415141516316023010 0ustar alastairalastairprogram boz_01 implicit none integer :: boz_1, boz_2, boz_3, boz_4, boz_5 real:: boz_6 boz_1 = int(b'01011101') boz_2 = int(o'2347') boz_3 = int(z'ABC') !Testing Truncation of BOZ boz_4 = int(Z'234567890abcdef1') boz_5 = int(Z'2234567890abcdef1') !Checking Real Conversion of BOZ boz_6 = real(b'01101') !Check with Integer Equivalent Values if (boz_4 /= boz_5) error stop if (boz_1 /= 93) error stop if (boz_2 /= 1255) error stop if (boz_3 /= 2748) error stop if (boz_4 /= 180150001) error stop if (boz_5 /= 180150001) error stop print *, boz_1, boz_2, boz_3, boz_4, boz_5, boz_6 end program lfortran-lfortran-2f73434/integration_tests/const_real_dp.f900000664000175000017500000000026015141516316024532 0ustar alastairalastairprogram const_real_dp real(4) :: zero real(8) :: v, u real :: x zero = 0.0_4 u = 1.05_4 v = 1.05_8 x = 1.05 print *, zero, v, x, u end programlfortran-lfortran-2f73434/integration_tests/return_05.f900000664000175000017500000000014315141516316023541 0ustar alastairalastairsubroutine f() end subroutine program main return print *, "Hello world" end program main lfortran-lfortran-2f73434/integration_tests/modules_09_a.f900000664000175000017500000000023115141516316024174 0ustar alastairalastairmodule modules_09_a use modules_09_b, only: b, i implicit none private public a contains integer function a() a = 3 + b() + i end function end module lfortran-lfortran-2f73434/integration_tests/equivalence_13.f900000664000175000017500000000071115141516316024523 0ustar alastairalastairprogram equivalence_13 implicit none integer :: ia(5), ic logical :: la(2), lc equivalence (la(1),lc), (ia(5), ic) ic = -42 ia = [1, 2, 3, 4, 5] if (ia(5) /= 5) error stop "ia(5) should be 5" if (ic /= 5) error stop "ic should be 5 (equivalenced to ia(5))" lc = .false. la = .true. if (.not. la(1)) error stop "la(1) should be true" if (.not. lc) error stop "lc should be true (equivalenced to la(1))" end program equivalence_13 lfortran-lfortran-2f73434/integration_tests/parameter_03.f900000664000175000017500000000015115141516316024177 0ustar alastairalastairprogram parameter_03 implicit none integer, parameter :: l_knd = kind(.true.) print *, l_knd end program lfortran-lfortran-2f73434/integration_tests/modules_60.f900000664000175000017500000000102115141516316023667 0ustar alastairalastairmodule inf_mod_1 interface is_finite module procedure is_finite_1 end interface is_finite contains subroutine is_finite_1() end subroutine is_finite_1 end module inf_mod_1 module infnan_mod_1 use inf_mod_1, only : is_finite contains subroutine is_finite_1(x) integer , intent(in) :: x print *, x if (x /= 1) error stop end subroutine is_finite_1 end module infnan_mod_1 program bobyqa_exmp use infnan_mod_1 call is_finite_1(1) end program bobyqa_exmp lfortran-lfortran-2f73434/integration_tests/shifta_02.f900000664000175000017500000000112015141516316023471 0ustar alastairalastairprogram shifta_02 integer(kind=8) :: n, x integer result n = 2**30 - 1 x = 1 result = shifta(n, x) print *, "shifta(", n, ", ", x, ") = ", result if (result /= 536870911) error stop n = 2**29 x = 32 result = shifta(n, x) print *, "shifta(", n, ", ", x, ") = ", result if (result /= 0) error stop block integer(8) :: x = 32 integer :: y = 2 result = shifta(x, y) print *, "shifta(", x, ", ", y, ") = ", result if (result /= 8) error stop "Test case failed: shifta type mismatch" end block end program lfortran-lfortran-2f73434/integration_tests/array_op_09.f900000664000175000017500000000025415141516316024045 0ustar alastairalastairprogram test integer :: A(3,2) = reshape([1,2,3,4,5,6], [3,2]) integer :: X(2) X = abs(sum(A, dim=1)) if(X(1) /= 6) error stop if(X(2) /= 15) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_63.f900000664000175000017500000000013315141516316023675 0ustar alastairalastairprogram test use mre_read_string_fmt_mod implicit none call temp() end program lfortran-lfortran-2f73434/integration_tests/allocate_28.f900000664000175000017500000000055515141516316024022 0ustar alastairalastairprogram allocate_28 implicit none type :: my_type integer :: x end type class(my_type), allocatable :: obj class(my_type), allocatable :: original allocate(my_type :: original) original%x = 123 allocate(obj, mold=original) obj%x = 456 print *, "obj%x =", obj%x if (obj%x /= 456) error stop end program allocate_28lfortran-lfortran-2f73434/integration_tests/select_type_08.f900000664000175000017500000000161715141516316024554 0ustar alastairalastairprogram select_type_08 implicit none type base integer :: x end type integer :: case_int class(*), allocatable :: x allocate(x, source = 10) call f(x, case_int) if (case_int /= 0) error stop deallocate(x) allocate(x, source = base(10)) call f(x, case_int) if (case_int /= 1) error stop contains subroutine f(generic, selected_case) class(*) :: generic integer, intent(out) :: selected_case select type(generic) type is (integer) print *, generic if (generic /= 10) error stop selected_case = 0 type is (base) print *, generic%x if (generic%x /= 10) error stop selected_case = 1 class default error stop end select end subroutine f end program select_type_08 lfortran-lfortran-2f73434/integration_tests/sqrt_01.f900000664000175000017500000000024515141516316023212 0ustar alastairalastairprogram sqrt_01 implicit none real :: x x = sqrt(4.0) if (abs(x - 2) > 1e-5) error stop x = sqrt(2.0) if (abs(x - 1.4142135623730951) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/attr_dim_04.f900000664000175000017500000000020215141516316024020 0ustar alastairalastairsubroutine asr_vpe () dimension ca(136) character(1) ca end subroutine program attr_dim_04 call asr_vpe() end programlfortran-lfortran-2f73434/integration_tests/where_15.f900000664000175000017500000000106015141516316023334 0ustar alastairalastairprogram where_15 implicit none real(4), allocatable :: x0(:) real(4), allocatable :: xl(:) real(4), allocatable :: xu(:) real(4) :: rhobeg integer :: i rhobeg = 0.5 allocate(x0(5), xl(5), xu(5)) xl = 0.5 xu = 3.0 do i = lbound(x0, 1), ubound(x0, 1) x0 = i end do where (x0 <= xl + 0.5 * rhobeg) x0 = xl elsewhere(x0 < xl + rhobeg) x0 = xl + rhobeg end where where (x0 >= xu - 0.5 * rhobeg) x0 = xu elsewhere(x0 > xu - rhobeg) x0 = xu - rhobeg end where print *, x0 if( any(x0 /= [3.0, 3.0, 3.0, 3.0, 3.0]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_13a.f900000664000175000017500000000037515141516316026573 0ustar alastairalastairmodule separate_compilation_13a_module use, intrinsic:: ieee_arithmetic, only: ieee_quiet_nan, ieee_class_type contains subroutine check(x) real, intent(inout) :: x TYPE(ieee_class_type) :: xy xy = ieee_quiet_nan x = 151.15981 end subroutine end module lfortran-lfortran-2f73434/integration_tests/bindc_04.f900000664000175000017500000000356715141516316023315 0ustar alastairalastairmodule thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data type(c_ptr) :: a integer(c_int) :: n end type thread_data end module thread_data_module subroutine lcompilers_initialise_array(data) bind(C) use thread_data_module use iso_c_binding implicit none type(c_ptr), intent(in), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:) call c_f_pointer(data, tdata) call c_f_pointer(tdata%a, a, [5]) print *, "Array address in fortran :", tdata%a print *, "c_loc(a) :", c_loc(a) print *, sum(a) if (abs(sum(a) - 10.0) > 1.0e-8) error stop end subroutine subroutine b_func_fortran(data) bind(C) use thread_data_module use iso_c_binding implicit none type(c_ptr), intent(in), value :: data real(c_float), pointer :: a(:) call c_f_pointer(data, a, [5]) print *, "Array address in fortran b_func_fortran:", data print *, "c_loc(a) b_func_fortran:", c_loc(a) print *, sum(a) if (abs(sum(a) - 10.0) > 1.0e-8) error stop end subroutine program bindc_04 use iso_c_binding use thread_data_module interface subroutine lcompilers_initialise_array(data) bind(C) import :: c_ptr type(c_ptr), intent(in), value :: data end subroutine subroutine a_func(fn) bind(C, name="a_func") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine b_func_fortran(data) bind(C) import :: c_ptr type(c_ptr), intent(in), value :: data end subroutine subroutine b_func(fn) bind(C, name="b_func") import :: c_funptr type(c_funptr), value :: fn end subroutine subroutine c_func(arr) bind(C, name="c_func") import :: c_ptr type(c_ptr), value :: arr end subroutine end interface type(thread_data), target :: tdata real(c_float), dimension(:), pointer :: a allocate(a(5)) a = [1.0, 2.0, 3.0, 4.0, 5.0] tdata%a = c_loc(a) tdata%n = 5 call a_func(c_funloc(lcompilers_initialise_array)) call b_func(c_funloc(b_func_fortran)) call c_func(c_loc(a)) end program bindc_04 lfortran-lfortran-2f73434/integration_tests/associate_19.f900000664000175000017500000000141315141516316024203 0ustar alastairalastairmodule module_xx_associate_19 type :: chaining_map_entry_pool type(chaining_map_entry_pool), pointer :: lastpool => null() end type chaining_map_entry_pool end module module_xx_associate_19 module stdlib_hashmap_chaining_associate_19 use module_xx_associate_19 contains recursive subroutine free_map_entry_pool(pool) type(chaining_map_entry_pool), intent(inout), pointer :: pool if (associated(pool % lastpool)) error stop end subroutine free_map_entry_pool end module stdlib_hashmap_chaining_associate_19 program associate_19 use stdlib_hashmap_chaining_associate_19 type(chaining_map_entry_pool), pointer :: pool allocate(pool) pool % lastpool => null() call free_map_entry_pool(pool) end program associate_19 lfortran-lfortran-2f73434/integration_tests/do_loop_01.f900000664000175000017500000000026115141516316023652 0ustar alastairalastairprogram main implicit none integer :: j j = 0 do j = j + 1 if (j > 10) exit print *, j end do print *, "out of loop" end program lfortran-lfortran-2f73434/integration_tests/functions_24.f900000664000175000017500000000035115141516316024234 0ustar alastairalastair program functions_24 character a a = characterfunc() contains character*1 function characterfunc() characterfunc = 'A' end function characterfunc end program lfortran-lfortran-2f73434/integration_tests/file_39.f900000664000175000017500000000214715141516316023156 0ustar alastairalastairprogram file_39 ! Test position='append' in OPEN statement implicit none integer :: u, a(3), b(3) character(*), parameter :: filename = "file_39_test.txt" ! Write first line open(newunit=u, file=filename, action='write', status='replace', & access='stream', form='formatted') write(u, *) 1, 2, 3 close(u) ! Append second line using position='append' open(newunit=u, file=filename, action='write', position='append', & status='old', access='stream', form='formatted') write(u, *) 4, 5, 6 close(u) ! Read both lines back open(newunit=u, file=filename, action='read', status='old', & access='stream', form='formatted') read(u, *) a read(u, *) b close(u) ! Verify first line is [1,2,3], second line is [4,5,6] if (.not. all(a == [1, 2, 3])) then print *, "FAIL: first line should be [1,2,3], got", a error stop end if if (.not. all(b == [4, 5, 6])) then print *, "FAIL: second line should be [4,5,6], got", b error stop end if print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/parameter_09.f900000664000175000017500000000155015141516316024211 0ustar alastairalastairprogram parameter_09 real, parameter :: D(*) = [1.0, 2.0] + 2.0 real, parameter :: A(*) = sin(D) * 9.0 integer, parameter :: B(*) = [1, 2] + 2 real, parameter :: C(*) = sin(A) + cos(D) * 3.15 / 2.0 real, parameter :: E(*) = [1.0, 2.0] + [2.0, 3.0] complex, parameter :: F(*) = [(1.0, 2.0), (3.0, 4.0), (124.1, 14.5)] + [(5.0, 6.0), (7.0, 8.0), (7.0, 8.0)] complex , parameter :: G(*) = 3.0 / cos(C) + tan(A) * 6.0 / sin(D) print *, sum(A) if (abs(sum(A) - (-5.54114246)) > 1e-6) error stop print *, sum(D) if (abs(sum(D) - 7.0) > 1e-8) error stop print *, sum(B) if (sum(B) /= 7) error stop print *, sum(C) if (abs(sum(C) - (-2.13744116)) > 1e-6) error stop print *, sum(E) if (abs(sum(E) - 8.0) > 1e-8) error stop print *, abs(sum(F)) if (abs(abs(sum(F)) - 153.116501) > 1e-5) error stop print *, abs(sum(G)) if (abs(abs(sum(G)) - 225.452) > 1e-3) error stop end program lfortran-lfortran-2f73434/integration_tests/parsing_02.f900000664000175000017500000000266015141516316023670 0ustar alastairalastairmodule program_parsing_02_submodule implicit none integer :: complex = 1 logical :: true = .TRUE. logical :: false = .FALSE. type :: type type(type), allocatable :: types(:) end type interface module subroutine function(integer,real) integer, intent(in) :: integer integer, intent(out) :: real end subroutine function end interface contains end module program_parsing_02_submodule submodule (program_parsing_02_submodule) program_parsing_02_module contains module procedure function real = 2*integer end procedure function end submodule program_parsing_02_module program program_parsing_02 use program_parsing_02_submodule, only: character => complex, subroutine => function, & then => true, else => false, type implicit none integer :: integer, real type(type) :: types integer = character ! Thanks to https://stackoverflow.com/a/57015100/1876449 types = type(types=[type(types=[type(), type(), type()]), type()]) block: block logical :: if endif: if (then) then if = then else if (else) then if = else else if = .not.(else) .and. .not.(if) endif endif print *, if end block block associate: associate (logical=>character,complex=>real) call subroutine(logical,complex) print*, (complex) end associate associate end program program_parsing_02 lfortran-lfortran-2f73434/integration_tests/intrinsics_79.f900000664000175000017500000000407015141516316024425 0ustar alastairalastairprogram intrinsics_79 implicit none integer :: x, result ! Test case 1: x = 0 x = 0 result = trailz(x) print *, "Test case 1: trailz(", x, ") = ", result if (result /= 32) error stop "Test case 1 failed" ! Test case 2: x = 1 x = 1 result = trailz(x) print *, "Test case 2: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 2 failed" ! Test case 3: x = 2 x = 2 result = trailz(x) print *, "Test case 3: trailz(", x, ") = ", result if (result /= 1) error stop "Test case 3 failed" ! Test case 4: x = 3 x = 3 result = trailz(x) print *, "Test case 4: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 4 failed" ! Test case 5: x = 4 x = 4 result = trailz(x) print *, "Test case 5: trailz(", x, ") = ", result if (result /= 2) error stop "Test case 5 failed" ! Test case 6: x = 8 x = 8 result = trailz(x) print *, "Test case 6: trailz(", x, ") = ", result if (result /= 3) error stop "Test case 6 failed" ! Test case 7: x = 16 x = 16 result = trailz(x) print *, "Test case 7: trailz(", x, ") = ", result if (result /= 4) error stop "Test case 7 failed" ! Test case 8: x = 2147483647 (maximum 32-bit integer) x = 2147483647 result = trailz(x) print *, "Test case 8: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 8 failed" ! Test case 9: x = -1 (all bits set) x = -1 result = trailz(x) print *, "Test case 9: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 9 failed" ! Test case 10: x = -2147483648 (minimum 32-bit integer) x = -2147483647 result = trailz(x) print *, "Test case 10: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 10 failed" ! Test case 11: x = 1431655765 (1010101010101010101010101010101 in binary) x = 1431655765 result = trailz(x) print *, "Test case 11: trailz(", x, ") = ", result if (result /= 0) error stop "Test case 11 failed" end program intrinsics_79 lfortran-lfortran-2f73434/integration_tests/subroutines_13.f900000664000175000017500000000046015141516316024605 0ustar alastairalastairprogram subroutines_13 character(20) :: cmd integer :: a integer :: b CALL get_command(cmd, a, b) print *, cmd print *, a print *, b CALL get_command(cmd, a) print *, cmd print *, a CALL get_command(cmd) print *, cmd CALL get_command() end program lfortran-lfortran-2f73434/integration_tests/modules_39.f900000664000175000017500000000062415141516316023705 0ustar alastairalastairmodule modules_39_fpm_39 use modules_39_module_fpm_filesystem_39, only: join_path, filewrite public :: build_model contains subroutine build_model() call filewrite(join_path("build", ".gitignore"), ["*"]) end subroutine build_model end module modules_39_fpm_39 program modules_39 use modules_39_fpm_39 implicit none call build_model() print *, "executing modules_39" end program modules_39 lfortran-lfortran-2f73434/integration_tests/interface_07.f900000664000175000017500000000116115141516316024165 0ustar alastairalastairmodule interface_07_mod implicit none interface a module procedure a1 module procedure a2 end interface contains integer function a1(a) integer, intent(in) :: a a1 = a + 1 end function real function a2(a) real, intent(in) :: a a2 = a + 1 end function subroutine run() integer :: i real :: r i = 5 i = a(i) if (i /= 6) error stop r = 6 r = a(r) if (r /= 7) error stop i = 7 i = a(i) if (i /= 8) error stop end subroutine end module program interface_07 use interface_07_mod, only: run implicit none call run() end program lfortran-lfortran-2f73434/integration_tests/class_30.f900000664000175000017500000000117115141516316023327 0ustar alastairalastair module class_30_mod type :: abstract_lexer end type type :: stack_item integer :: scope end type stack_item type, extends(abstract_lexer) :: toml_lexer integer :: top = 1 type(stack_item), allocatable :: stack(:) end type toml_lexer end module program class_30 use class_30_mod type(toml_lexer) :: lexer allocate(lexer%stack(10)) lexer%stack(lexer%top)%scope = 1 call check_scope(lexer) contains subroutine check_scope(lex) class(toml_lexer), intent(in) :: lex if (lex%stack(lex%top)%scope /= 1) error stop end subroutine check_scope end programlfortran-lfortran-2f73434/integration_tests/functions_36.f900000664000175000017500000000206015141516316024236 0ustar alastairalastair ! Test circular dependencies when declaring interface and using it in the function constructing that same interface module functions_36_mod real :: var interface generic !>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Depends on both `f1` and `f2` to be declared procedure :: f1 procedure :: f2 end interface contains pure function f1(vv) result(length) real, intent(in) :: vv integer :: rr(generic(vv, 2)) !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Depends on `f2` (but through interface) to be fully declared integer :: length length = size(rr) end function pure function f2(rr, int) result(length) real, intent(in) :: rr integer, intent(in) :: int integer :: length length = int*2 end function subroutine maybe() character(10) :: string(generic(var)) print *, size(string) if (size(string) /= 4) error stop end subroutine maybe end module program functions_36 use functions_36_mod var =1.5 call maybe() end program lfortran-lfortran-2f73434/integration_tests/nested_05.f900000664000175000017500000000054015141516316023505 0ustar alastairalastairmodule nested_05_a implicit none contains subroutine b() integer :: x real :: y x = 6 y = 5.5 print *, x print *, y call c() print *, x print *, y contains subroutine c() print *, x print *, y x = 4 y = 3.5 end subroutine c end subroutine b end module program nested_05 use nested_05_a, only: b implicit none call b() end lfortran-lfortran-2f73434/integration_tests/procedure_05.f900000664000175000017500000000057015141516316024216 0ustar alastairalastairfunction dnan() double precision dnan dnan = 0.0d0 end function dnan subroutine clqmn(x,y) implicit double precision (x,y) implicit complex*16 (c,z) z = dcmplx(x, y) xc=abs(z) ls=0 if (dimag(z) == 0.0d0.or.xc < 1.0d0) ls=1 if(ls /=0 ) error stop return end program main implicit none call clqmn(1.0d0, 2.0d0) end program mainlfortran-lfortran-2f73434/integration_tests/bindc_08.c0000664000175000017500000000013115141516316023125 0ustar alastairalastair#include int c_is_dir(char* path) { printf("%c", path[0]); return 0; }lfortran-lfortran-2f73434/integration_tests/derived_types_66.f900000664000175000017500000000034015141516316025076 0ustar alastairalastairprogram derived_types_66 implicit none type :: val_type integer :: origin = 3 end type type(val_type), allocatable :: val allocate(val) if (val%origin /= 3) error stop end program derived_types_66 lfortran-lfortran-2f73434/integration_tests/return_06.f900000664000175000017500000000005115141516316023540 0ustar alastairalastairprogram main return end program main lfortran-lfortran-2f73434/integration_tests/do_concurrent_08.f900000664000175000017500000000167215141516316025101 0ustar alastairalastair! equivalent to openmp_14.f90 subroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i do concurrent (i=1:n) a(i) = 12.91 end do print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 do concurrent (i=1:n) reduce(+:sum) sum = sum + a(i) end do print *, 'Sum = ', sum ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same if (abs(sum - 12905576.0) > 1e-8) error stop end subroutine program do_concurrent_08 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a call omp_set_num_threads(8) call initialize_array(n, a) call parallel_sum(n, a) print *, a(1), a(n) end program lfortran-lfortran-2f73434/integration_tests/arrays_68.f900000664000175000017500000000023515141516316023536 0ustar alastairalastairprogram arrays_68 integer :: A(4) = [1,2,3,4] A([1,2]) = [5,5] print *, A if (A(1) /= 5) error stop if (A(2) /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_48.f900000664000175000017500000000063215141516316025102 0ustar alastairalastairmodule derived_types_48_m implicit none type t integer :: x = 1 integer :: y = 2 end type type, extends(t) :: ext_t type(t) :: ins = t() end type end module derived_types_48_m program derived_types_48 use derived_types_48_m implicit none type(ext_t) :: i if (i%ins%x /= 1) error stop if (i%ins%y /= 2) error stop end program derived_types_48 lfortran-lfortran-2f73434/integration_tests/write_08.f900000664000175000017500000000034615141516316023364 0ustar alastairalastairprogram test character(len=20) :: str character(len=:), allocatable :: sformat real :: x = 3.14159 sformat = "(F6.2)" write(str, sformat) x print *, str if (trim(str) /= " 3.14") error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_187.f900000664000175000017500000000347415141516316024514 0ustar alastairalastairprogram intrinsics_187 implicit none integer :: x, y, z integer(8) :: a, b, c integer, parameter :: x1 = popcnt(44) integer(8), parameter :: y1 = popcnt(5468272828_8) integer, parameter :: z1 = popcnt(-501) integer(8), parameter :: w1 = popcnt(-3526282829_8) integer, parameter :: ar1(3) = popcnt([83983, 5468272, -3526282]) integer(8), parameter :: ar2(3) = popcnt([83983_8, 5468272828_8, -3526282829_8]) print *, x1 if(x1 /= 3) error stop print *, y1 if(y1 /= 19) error stop print *, z1 if(z1 /= 26) error stop print *, w1 if(w1 /= 48) error stop print *, ar1 if(any(ar1 /= [7, 10, 20])) error stop print *, ar2 if(any(ar2 /= [7, 19, 48])) error stop x = 44 y = -501 z = 0 a = 5468272828_8 b = -3526282829_8 c = 83983_8 print *, popcnt(x) if(popcnt(x) /= 3) error stop print *, popcnt(44) if(popcnt(44) /= 3) error stop print *, popcnt(y) if(popcnt(y) /= 26) error stop print *, popcnt(-501) if(popcnt(-501) /= 26) error stop print *, popcnt(z) if(popcnt(z) /= 0) error stop print *, popcnt(0) if(popcnt(0) /= 0) error stop print *, popcnt(a) if(popcnt(a) /= 19) error stop print *, popcnt(5468272828_8) if(popcnt(5468272828_8) /= 19) error stop print *, popcnt(b) if(popcnt(b) /= 48) error stop print *, popcnt(-3526282829_8) if(popcnt(-3526282829_8) /= 48) error stop print *, popcnt(c) if(popcnt(c) /= 7) error stop print *, popcnt(83983_8) if(popcnt(83983_8) /= 7) error stop print *, kind(popcnt(-501)) if(kind(popcnt(-501)) /= 4) error stop print *, kind(popcnt(y)) if(kind(popcnt(y)) /= 4) error stop print *, kind(popcnt(5468272828_8)) if(kind(popcnt(5468272828_8)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/array_op_06.f900000664000175000017500000000126615141516316024046 0ustar alastairalastairprogram array_op_06 implicit none integer, parameter :: dim = 2 integer, parameter :: n = 3 integer :: x(n, n) logical :: mask(n, n) real :: res x = reshape((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/n, n/)) mask = reshape((/.true., .false., .true., .false., .true., .false., .true., .false., .true./), (/n, n/)) res = var_mask_2_iint8_dp(x, dim, mask) print *, res if (abs(res - 5.0) > 1e-8) error stop contains function var_mask_2_iint8_dp(x, dim, mask) result(res) integer, intent(in) :: x(:,:) integer, intent(in) :: dim logical, intent(in) :: mask(:,:) real :: res real :: n(merge(size(x, 1), size(x, 2), mask=1 date_to_string end type !> TOML datatime value type type :: toml_datetime type(toml_date), allocatable :: date contains procedure, pass(rhs) :: to_string => datetime_to_string end type contains subroutine date_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_date), intent(in) :: rhs allocate(character(10) :: lhs) write(lhs, "(i0, '-', i0, '-', i0)") rhs%day, rhs%month, rhs%year end subroutine date_to_string subroutine datetime_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_datetime), intent(in) :: rhs call rhs%date%to_string(lhs) end subroutine datetime_to_string end module class_08_module program class_08_program use class_08_module implicit none ! TODO ! character(:), allocatable :: date ! type(toml_datetime) :: t_datetime ! allocate(t_datetime%date) ! t_datetime%date%year = 2023 ! t_datetime%date%month = 08 ! t_datetime%date%day = 28 ! print *, t_datetime%date ! call t_datetime%to_string(date) ! if (date /= "28-8-2023") error stop print *, "ok" end program class_08_program lfortran-lfortran-2f73434/integration_tests/bindc_01.f900000664000175000017500000000120415141516316023274 0ustar alastairalastair! Tests c_ptr, c_f_pointer, c_loc program bindc_01 use iso_c_binding, only: c_ptr, c_loc, c_f_pointer use bindc_01b, only: ret_ptr, ret_ptr_unspecified_intent, print_ptr implicit none type(c_ptr) :: cptr type(c_ptr) :: cptr1 real, pointer :: a(:) real, pointer :: a1(:) real, target :: b(3) integer :: i call ret_ptr(cptr) call c_f_pointer(cptr, a, [12]) do i = 1, size(a) a(i) = i end do call print_ptr(12, c_loc(a)) call ret_ptr_unspecified_intent(cptr1) call c_f_pointer(cptr1, a1, [12]) do i = 1, size(a1) a1(i) = i end do call print_ptr(12, c_loc(a1)) do i = 1, size(b) b(i) = 10 + i end do call print_ptr(3, c_loc(b)) end lfortran-lfortran-2f73434/integration_tests/string_37.f900000664000175000017500000000123415141516316023537 0ustar alastairalastairprogram string_37 character(5) :: string character(:), pointer :: string2 print*, max(maybe(string), 'works') if (max(maybe(string), 'works') /= 'works') error stop string2 => cast_to_string() string = string2 if (string /= "Hello") error stop contains function maybe(string) result(maybe_string) character(5) :: string character(len=len(string)) :: maybe_string end function maybe function cast_to_string() result(str) character(len=:), pointer :: str character(len=5), pointer :: str2 allocate(str2) str2 = "Hello" str => str2 end function cast_to_string end lfortran-lfortran-2f73434/integration_tests/intrinsics_374.f900000664000175000017500000000162215141516316024503 0ustar alastairalastairprogram intrinsics_370 implicit none integer :: input(6, 9) character(len=2) :: str_arr(2, 2) integer, dimension(2) :: result input = reshape([& 1, 2, 3, 4, 5, 7, 8, 9, 10, & 11, 12, 13, 14, 7, 16, 17, 18, 19, & 21, 22, 7, 24, 25, 26, 27, 28, 29, & 31, 32, 33, 34, 35, 36, 37, 38, 39, & 41, 42, 43, 44, 45, 46, 7, 48, 49, & 51, 52, 53, 54, 55, 56, 57, 58, 7], [6, 9]) str_arr = reshape(["aa", "bb", "cc", "aa"], [2, 2]) result = findloc(input, 7) print *, result if (any(result /= [6, 1])) error stop result = findloc(input, 34) print *, result if (any(result /= [1, 6])) error stop result = findloc(input, 7, back=.true.) print *, result if (any(result /= [6, 9])) error stop result = findloc(str_arr, "cc") print *, result if (any(result /= [1, 2])) error stop end program lfortran-lfortran-2f73434/integration_tests/callback_05.f900000664000175000017500000000131315141516316023756 0ustar alastairalastairmodule callback_05 implicit none contains subroutine px_call3(f, x) integer, intent(in) :: x interface subroutine f(x) integer, intent(in) :: x end subroutine end interface call f(x) end subroutine subroutine px_call2(f, x) integer, intent(in) :: x interface subroutine f(x) integer, intent(in) :: x end subroutine end interface call px_call3(f, x) end subroutine subroutine px_call1(x) integer, intent(in) :: x call px_call2(printx, x) contains subroutine printx(x) integer, intent(in) :: x print *, x end subroutine end subroutine end module callback_05 program main use callback_05 implicit none integer :: x = 5 call px_call1(x) end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_40.f900000664000175000017500000000054015141516316024407 0ustar alastairalastairprogram intrinsics_40 real(4) r4 real(8) r8 r4 = 1.521E0_4 r8 = 3.251_8 if (aint(r4) /= 1.0) error stop if (aint(r8) /= 3.0) error stop if (anint(r4) /= 2.0) error stop if (anint(r8) /= 3.0) error stop r8 = aint(r4, 8) if (aint(r4) /= 1.0) error stop r8 = anint(r4, 8) if (anint(r4) /= 2.0) error stop end program intrinsics_40 lfortran-lfortran-2f73434/integration_tests/implied_do_loops_strings.f900000664000175000017500000000102315141516316027006 0ustar alastairalastairprogram test_implied_do_loops_string implicit none integer :: i character(len=:), allocatable :: keywords(:) character(len=10) :: val character(len=5), allocatable :: fixed_str(:) keywords = [(val, i=1, 3)] if (size(keywords) /= 3) error stop "Test 1 Failed: size mismatch" fixed_str = [("test"//char(i+48), i=0, 2)] if (size(fixed_str) /= 3) error stop "Test 2 Failed: size mismatch" print *, "All tests passed!" end program test_implied_do_loops_string lfortran-lfortran-2f73434/integration_tests/enum_03.f900000664000175000017500000000050415141516316023165 0ustar alastairalastairprogram enum_03 implicit none integer :: x enum, bind(c) enumerator :: bool = 999 end enum call get_value(x) print *, x if (x /= 999) error stop contains subroutine get_value(i) integer, intent(inout) :: i i = bool end subroutine get_value end program enum_03 lfortran-lfortran-2f73434/integration_tests/character_08.f900000664000175000017500000000100415141516316024156 0ustar alastairalastairprogram test_char_kind_len implicit none character(kind=1, len=10) :: str1 character(len=10, kind=1) :: str2 character(10, 1) :: str3 character(10, kind=1) :: str4 str1 = "Hello1" str2 = "Hello2" str3 = "Hello3" str4 = "Hello4" print *, "str1 = ", str1, ", length = ", len(str1) print *, "str2 = ", str2, ", length = ", len(str2) print *, "str3 = ", str3, ", length = ", len(str3) print *, "str4 = ", str4, ", length = ", len(str4) end program test_char_kind_len lfortran-lfortran-2f73434/integration_tests/present_03.f900000664000175000017500000000037215141516316023704 0ustar alastairalastairprogram present_01 real, pointer :: tmp(:) tmp => null() call foo1(tmp) contains subroutine foo1(a) real, intent(in), optional :: a(:) ! Optional argument if (present(a)) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/string_48.f900000664000175000017500000000051215141516316023537 0ustar alastairalastairmodule strings_48_mod implicit none character(16) :: option='potential' end module program strings_48 use strings_48_mod implicit none character(60) :: value value = "val1" read(value, *) option if (option /= "val1") error stop option = "val2" if (option /= "val2") error stop end program strings_48lfortran-lfortran-2f73434/integration_tests/arrays_op_18.f900000664000175000017500000000053715141516316024234 0ustar alastairalastairprogram arrays_op_18 implicit none real, allocatable :: a(:) real :: b(10, 7) integer :: i, j allocate(a(40)) a = 5.0 b = 6.0 a = [b, a] print *, size(a), lbound(a, 1), ubound(a, 1) if( size(a) /= 110 ) error stop print *, a do i = 1, 70 if( a(i) /= 6.0 ) error stop end do do i = 71, 110 if( a(i) /= 5.0 ) error stop end do end program lfortran-lfortran-2f73434/integration_tests/parameter_13.f900000664000175000017500000000104015141516316024176 0ustar alastairalastairprogram parameter_13 implicit none integer, parameter :: N = 65535 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(*) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx logical, parameter :: l = S < 2 real(kind=merge(sp, dp, l)) :: y if (kind(y) /= sp) error stop print *, S if (abs(S - 1.9999999996170159_dp) > 1e-15_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_390.f900000664000175000017500000000050515141516316024500 0ustar alastairalastairprogram intrinsics_390 use iso_c_binding type(c_ptr) :: cptr character(len=5,kind=c_char), pointer :: sptr character(len= 6, kind=c_char), target :: cbuf cbuf = "Hello"// c_null_char cptr = c_loc(cbuf) call c_f_pointer(cptr, sptr) print *, sptr if(sptr /= "Hello") error stop end program intrinsics_390lfortran-lfortran-2f73434/integration_tests/types_07.f900000664000175000017500000000121715141516316023373 0ustar alastairalastairprogram types_07 implicit none integer, target :: x integer, pointer :: y => x real, target :: a(5) real, pointer :: b(:) => a contains subroutine f(s, s2) character(len=:), allocatable, intent(in) :: s character(:), allocatable, intent(in) :: s2 end subroutine subroutine g(s, s2) character(len=*), intent(in) :: s character(*), intent(in) :: s2 end subroutine subroutine h(s, s2) character(len=80), intent(in) :: s character(80), intent(in) :: s2 end subroutine subroutine m(s, s2) character(len=40+40), intent(in) :: s character(100-20), intent(in) :: s2 end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_234.f900000664000175000017500000000575215141516316024506 0ustar alastairalastairprogram intrinsics_234 implicit none logical :: mask(3, 4) logical :: mask_(6, 9) logical :: mask_3(3, 4, 3) logical :: mask_4(4, 5, 3, 1) logical :: res integer, dimension(2,3) :: a, b logical, dimension(2,3) :: mask2 logical, parameter :: c1 = parity([.true., .false., .true., .false.]) logical, parameter :: c2 = parity([.true., .false., .true., .false., .true., .false.]) mask = reshape([ .true., .false., .true., .false., & .true., .false., .true., .false., & .true., .false., .true., .true.], [3, 4]) mask_ = .false. mask_(1, 1) = .true. mask_(1, 2) = .true. mask_(5, 1) = .true. mask_(5, 2) = .true. mask_(6, 7) = .true. mask_(4, 8) = .true. mask_3 = .false. mask_3(1, 1, :) = .true. mask_3(1, 2, :) = .true. mask_3(3, 1, :) = .true. mask_3(2, 2, :) = .true. mask_3(2, 4, :) = .true. mask_3(3, 3, :) = .true. mask_4 = .true. mask_4(1, 1, 1, 1) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 1, 1, :) = .false. mask_4(1, 2, 1, :) = .false. mask_4(1, 2, 3, :) = .false. print *, parity(mask) if (parity(mask) .neqv. .true.) error stop print *, parity(mask_) if (parity(mask_) .neqv. .false.) error stop print *, parity(mask_3) if (parity(mask_3) .neqv. .false.) error stop print *, parity(mask, 1) if (any(parity(mask, 1)) .neqv. .true.) error stop print *, parity(mask, 2) if (any(parity(mask, 2)) .neqv. .true.) error stop print *, any(parity(mask_, 1)) if (any(parity(mask_, 1)) .neqv. .true.) error stop print *, shape(parity(mask_, 1)) print *, any(parity(mask_, 2)) if (any(parity(mask_, 2)) .neqv. .true.) error stop print *, shape(parity(mask_, 2)) print *, any(parity(mask_3, 1)) if (any(parity(mask_3, 1)) .neqv. .true.) error stop print *, shape(parity(mask_3, 1)) print *, any(parity(mask_3, 2)) if (any(parity(mask_3, 2)) .neqv. .false.) error stop print *, shape(parity(mask_3, 2)) print *, any(parity(mask_3, 3)) if (any(parity(mask_3, 3)) .neqv. .true.) error stop print *, any(parity(mask_4, 1)) if (any(parity(mask_4, 1)) .neqv. .true.) error stop print *, shape(parity(mask_4, 1)) res = parity(mask_4) if (res .neqv. .true.) error stop res = parity(mask_4) if (res .neqv. .true.) error stop a = reshape( [ 1, 2, 3, 4, 5, 6 ], [ 2, 3 ]) b = reshape( [ 0, 7, 3, 4, 5, 8 ], [ 2, 3 ]) print *, a(1,:) print *, a(2,:) print * print *, b(1,:) print *, b(2,:) print * mask2 = a.ne.b print '(3l3)', mask2(1,:) print '(3l3)', mask2(2,:) print * print *, parity(mask2) if (parity(mask2) .neqv. .true.) error stop print * print *, parity(mask2, 1) print * print *, parity(mask2, 2) print*, c1 if (c1 .neqv. .false.) error stop print*, c2 if (c2 .neqv. .true.) error stop print*, kind(c2) if (kind(c2) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_342.f900000664000175000017500000000063215141516316024476 0ustar alastairalastairprogram intrinsics_342 integer, allocatable :: i(:) integer :: ii(4,4) allocate(i(4)) i = [1, 2, 3 ,4] ! ii = spread(i, dim = 2, ncopies=4) ! Code generation error while trying to pass `i` to `lcompilers_spread` print *, spread(i, dim = 2, ncopies=4) if (any(spread(i,dim = 2, ncopies=4) /= reshape([1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4], [4, 4]))) error stop end programlfortran-lfortran-2f73434/integration_tests/transfer_09.f900000664000175000017500000000112015141516316024046 0ustar alastairalastairprogram transfer_09 integer, dimension(3) :: lhs, rhs real, dimension(3):: r1 real:: a,b,c rhs = [10, 20, 30] a = transfer(rhs(1), a) b = transfer(rhs(2), b) c = transfer(rhs(3), c) r1(1:3) = transfer(rhs, r1) lhs(1:3) = transfer(rhs, lhs) print *, "Correct Values", rhs, a, b, c print *, "Transferred Values", lhs, r1 ! Check aray transfer of same type if (lhs(1) /= rhs(1) .or. lhs(2) /= rhs(2) .or. lhs(3) /= rhs(3)) error stop !Check with scalar transfers for real type if (r1(1) /= a .or. r1(2) /= b .or. r1(3) /= c) error stop end program transfer_09lfortran-lfortran-2f73434/integration_tests/arrays_05.f900000664000175000017500000000030215141516316023520 0ustar alastairalastairprogram arrays_05 implicit none real, dimension(5) :: numbers = [1.5, 3.2, 4.5, 0.9, 7.2] integer :: i do i = 1, 5 numbers(i) = i * 2.0 end do numbers = [1.5, 3.2, 4.5, 0.9, 7.2] end program lfortran-lfortran-2f73434/integration_tests/equivalence_06.f900000664000175000017500000000072515141516316024532 0ustar alastairalastairprogram equivalence_06 use iso_c_binding, only: c_loc, c_f_pointer implicit none INTEGER, target :: IMACH(16), SMALL(2) INTEGER, pointer :: OUTPUT(:) REAL, pointer :: RMACH(:) call c_f_pointer(c_loc(imach(4)), output, [1]) call c_f_pointer(c_loc(small(1)), rmach, [1]) imach(4) = 6 if(output(1) /= 6) error stop small = 99 rmach = 5.6_8 if(small(1) /= 1085485875) error stop if(small(2) /= 99) error stop end program lfortran-lfortran-2f73434/integration_tests/select_type_12.f900000664000175000017500000000133215141516316024541 0ustar alastairalastair module container_mod type, abstract :: base end type base type, extends(base) :: child integer :: x = 42 end type child type :: container class(base), allocatable :: val end type container end module container_mod program select_type_12 use container_mod type(container) :: c type(child) :: ch integer :: t class(container), allocatable :: self allocate(self) allocate(child::self%val) select type(val => self%val) type is(child) print *, "child%x =", val%x t=val%x end select if(t /= 42) then print *, "Error: t should be 42, but is", t else print *, "Success: t is", t end if end program select_type_12lfortran-lfortran-2f73434/integration_tests/bindc_05.f900000664000175000017500000000306315141516316023305 0ustar alastairalastairmodule bindc_05_mod use iso_c_binding, only: c_int, c_ptr, c_f_pointer, c_null_ptr, c_associated implicit none interface function ax(comm_f) bind(C, name="ax") import :: c_int, c_ptr integer(c_int), value :: comm_f type(c_ptr) :: ax end function ax end interface contains subroutine MPI_Barrier(comm, ierror) integer, intent(in) :: comm integer, intent(out), optional :: ierror type(c_ptr) :: c_comm integer, pointer :: fortran_ptr ! Call the C function c_comm = ax(comm) if (.not. c_associated(c_comm)) then print *, "Error: Null pointer returned from C function" if (present(ierror)) ierror = 1 return end if ! Convert C pointer to Fortran pointer call c_f_pointer(c_comm, fortran_ptr) print *, "Fortran received value:", fortran_ptr ! Verify the value matches what was passed if (fortran_ptr /= comm) then print *, "Error: Value mismatch" if (present(ierror)) ierror = 1 else if (present(ierror)) ierror = 0 end if end subroutine MPI_Barrier end module bindc_05_mod program bindc_05 use bindc_05_mod implicit none integer, parameter :: MPI_COMM_WORLD = 42 ! Non-zero value integer :: ierr call MPI_Barrier(MPI_COMM_WORLD, ierr) if (ierr == 0) then print *, "Test passed successfully" else print *, "Test failed" error stop end if end program bindc_05 lfortran-lfortran-2f73434/integration_tests/intrinsics_382.f900000664000175000017500000000056615141516316024510 0ustar alastairalastairprogram intrinsics_382 implicit none real :: input(2) real :: output(2) input = [1, 2] call forward(input, output) if (any(output /= [1, 2])) error stop contains subroutine forward(input, output) real, intent(inout) :: input(:) real, intent(inout) :: output(:) output = pack(input, .true.) end subroutine forward end program intrinsics_382lfortran-lfortran-2f73434/integration_tests/nested_21.f900000664000175000017500000000216215141516316023505 0ustar alastairalastair! Check sync statements in do while loops ! at cycle statements for scalar and arrays module temp_nested_21 contains subroutine demo() implicit none integer :: a,c integer :: arr(2) a = 1 ! Variable c is used to not run loops indefinitely c = 1 ! Scalar checks do while(f()) if (c>10) error stop c = c + 1 if (a < 5) then a = a + 1 cycle end if if (a > 4) error stop end do print *, a if (a < 4) error stop ! Array Checks c = 1 arr(2) = 1 do while(g()) if (c>10) error stop c = c + 1 if (arr(2) < 5) then arr(2) = arr(2) + 1 cycle end if if (arr(2) > 4) error stop end do print *, arr(2) if (arr(2) < 4) error stop contains logical function f() print *, a f = (a < 4) end function f logical function g() print *, arr(2) g = (arr(2) < 4) end function g end subroutine demo end module temp_nested_21 program nested_21 use temp_nested_21 implicit none call demo() end program nested_21lfortran-lfortran-2f73434/integration_tests/polymorphic_select_type_02.f900000664000175000017500000000074615141516316027175 0ustar alastairalastairprogram polymorphic_select_type_02 integer :: a(3) = [1, 2, 3] call print_generic(a) contains subroutine print_generic(generic) class(*), intent(in) :: generic(:) select type (generic) type is (integer) if (size(generic) /= 3) error stop 1 if (any(generic /= [1, 2, 3])) error stop 2 class default error stop 3 end select end subroutine print_generic end program polymorphic_select_type_02 lfortran-lfortran-2f73434/integration_tests/file_open_01.f900000664000175000017500000000025215141516316024157 0ustar alastairalastair! Test using action parameter with OPEN statement program file_open_01 integer :: u character(:), allocatable :: action_ open(u, action=action_) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_338.f900000664000175000017500000000013215141516316024476 0ustar alastairalastairprogram intrinsics_338 use iso_fortran_env print *, compiler_options() end programlfortran-lfortran-2f73434/integration_tests/arrays_reshape_22.f900000664000175000017500000000172315141516316025236 0ustar alastairalastairprogram arrays_reshape_22 implicit none call f1() contains subroutine f1() real, allocatable :: amat(:, :) call f2(amat) ! call multiple times to make sure there is no memory corruption print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) print *, ubound(amat, 1), ubound(amat, 2) if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop if(ubound(amat, 1) /= 2 .or. ubound(amat, 2) /= 2 ) error stop end subroutine subroutine f2(amat) real, intent(out), allocatable :: amat(:, :) allocate(amat(2,2)) amat = 1.0 print *, amat amat = reshape(source=amat, shape=[2, 2]) end subroutine end program lfortran-lfortran-2f73434/integration_tests/derived_types_43.f900000664000175000017500000000102715141516316025074 0ustar alastairalastairprogram derived_types_43 implicit none type :: rp1d_derived_types_43 real, dimension(:), pointer :: f end type type :: sds_derived_types_43 integer, dimension(3) :: dims type(rp1d_derived_types_43), dimension(3) :: scales real, dimension(:), pointer :: f end type type(sds_derived_types_43) :: s allocate(s%scales(1)%f(2)) s%scales(1)%f(2) = 1.0 s%scales(1)%f(1) = 2.0 print *, s%scales(1)%f if (abs(sum(s%scales(1)%f) - 3.0) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/namelist_09.f900000664000175000017500000000234015141516316024043 0ustar alastairalastairprogram test_repeat implicit none ! Test repeat count syntax: n*value real :: arr(10) integer :: iarr(5) integer :: i namelist /repeat/ arr, iarr ! Initialize to sentinel values arr = -999.0 iarr = -999 ! Create input file with repeat counts open(unit=10, file='namelist_repeat.dat', status='replace', form='formatted') write(10, '(A)') ' &REPEAT' write(10, '(A)') ' arr = 10*3.14' write(10, '(A)') ' iarr = 5*42' write(10, '(A)') ' /' close(10) ! Read namelist with repeat counts open(unit=10, file='namelist_repeat.dat', status='old', form='formatted') read(10, nml=repeat) close(10) ! Verify all arr elements are 3.14 do i = 1, 10 if (abs(arr(i) - 3.14) > 1.0e-5) then print *, "Error: arr(", i, ") =", arr(i), "expected 3.14" error stop "Repeat count test failed for arr" end if end do ! Verify all iarr elements are 42 do i = 1, 5 if (iarr(i) /= 42) then print *, "Error: iarr(", i, ") =", iarr(i), "expected 42" error stop "Repeat count test failed for iarr" end if end do print *, "Repeat count namelist test passed!" end program test_repeat lfortran-lfortran-2f73434/integration_tests/abs_03.f900000664000175000017500000000021715141516316022767 0ustar alastairalastairprogram abs_03 implicit none integer :: x x = abs(2) print *, x if (x < 0) error stop x = abs(-2) print *, x if (x < 0) error stop end program lfortran-lfortran-2f73434/integration_tests/block_03.f900000664000175000017500000000054215141516316023315 0ustar alastairalastairprogram block_02 integer :: a a = 10 1 loop: block integer :: b a = a + 5 if (a == 15) go to 1 b = a / 2 call square(b) end block loop end program block_02 subroutine square(b) integer :: b, result result = b * b if (result /= 100) error stop print *, result end subroutine square lfortran-lfortran-2f73434/integration_tests/arrays_26.f900000664000175000017500000000024515141516316023531 0ustar alastairalastairprogram arrays_26 type :: my_struct integer :: i end type type(my_struct), allocatable :: s(:) allocate(s(1)) s(1)%i = 5 if (s(1)%i /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/where_08.f900000664000175000017500000000214115141516316023337 0ustar alastairalastairprogram where_08 implicit none logical :: l1(5) logical :: l2(5) logical, allocatable, dimension(:) :: l3 logical, allocatable, dimension(:) :: l4 integer :: b(5) l1 = [.true., .false., .true., .false., .true.] l2 = [1 < 2, 2 == 2, .true., .false., 2 >= 1] allocate(l3(5)) l3 = [.true., .false., .false., .true., .false.] allocate(l4(5)) l4 = .true. where(l1) b = 1 print *, b if (all(b /= [1, 0, 1, 0, 1])) error stop where(l2) b = 2 print *, b if (all(b /= [2, 2, 2, 0, 2])) error stop where(get_logical_array()) b = 3 print *, b if (all(b /= [3, 2, 3, 0, 3])) error stop where([.true., .false., .true., .false., .true.]) b = 4 print *, b if (all(b /= [4, 2, 4, 0, 4])) error stop where(l3) b = 5 print *, b if (all(b /= [5, 2, 4, 5, 4])) error stop where(l4) b = 6 print *, b if (all(b /= [6, 6, 6, 6, 6])) error stop contains function get_logical_array() result(value) implicit none logical :: value(5) value = [.true., .false., .true., .false., .true.] end function end program where_08lfortran-lfortran-2f73434/integration_tests/class_69.f900000664000175000017500000000121615141516316023343 0ustar alastairalastairmodule class_69_mod implicit none type :: fpm_cmd_settings integer :: verbosity end type type, extends(fpm_cmd_settings) :: fpm_new_settings integer :: version end type fpm_new_settings end module class_69_mod program class_69 use class_69_mod implicit none class(fpm_cmd_settings), allocatable :: cmd_settings allocate(fpm_new_settings :: cmd_settings) cmd_settings%verbosity = 12 select type(settings => cmd_settings) type is (fpm_new_settings) if (settings%verbosity /= 12) error stop class default error stop end select end program class_69lfortran-lfortran-2f73434/integration_tests/intrinsics_200.f900000664000175000017500000000102115141516316024460 0ustar alastairalastairprogram intrinsics_200 integer, dimension(5) :: x logical, dimension(5) :: mask x = [1, 2, 3, 4, 5] mask = [.true., .false., .true., .false., .true.] print *, median_all_mask_1_iint8_dp(x, mask) if (abs(median_all_mask_1_iint8_dp(x, mask) - 9.0) > 1e-8) error stop contains function median_all_mask_1_iint8_dp(x, mask) result(res) integer, intent(in) :: x(:) logical, intent(in) :: mask(:) real :: res integer, allocatable :: x_tmp(:) x_tmp = pack(x, mask) res = sum(x_tmp) end function median_all_mask_1_iint8_dp end program lfortran-lfortran-2f73434/integration_tests/module_function_with_nopass.f900000664000175000017500000000272015141516316027531 0ustar alastairalastairmodule modules_module_function_with_nopass implicit none private public :: calculator, SQUARE ! Expose both the type and the SQUARE function type :: calculator contains procedure, nopass :: SQUARE ! Associate SQUARE with the calculator type procedure, nopass :: AREA end type calculator contains ! Define SQUARE as a module procedure. function SQUARE(x) result(square_result) integer, optional, intent(in) :: x integer :: square_result if (present(x)) then square_result = x * x else square_result = 1 end if end function SQUARE function AREA(x, y) result(area_result) integer, optional, intent(in) :: x integer, optional, intent(in) :: y integer :: area_result if (present(x) .and. present(y)) then area_result = x * y else area_result = 1 end if end function end module modules_module_function_with_nopass program module_function_with_nopass use modules_module_function_with_nopass implicit none type(calculator) :: calc integer :: number, result, area1, area2, area3 number = 4 result = calc%SQUARE(number) if (result /= 16) error stop area1 = calc%AREA() if (area1 /= 1) error stop area2 = calc%AREA(1, 2) if (area2 /= 2) error stop area3 = calc%AREA(1) if (area3 /= 1) error stop end program module_function_with_nopass lfortran-lfortran-2f73434/integration_tests/class_11.f900000664000175000017500000000052315141516316023326 0ustar alastairalastairprogram class_11 implicit none type t_1 character(:), allocatable :: s end type t_1 type t class(t_1), allocatable :: x end type t type(t) :: type_1 allocate(type_1%x) allocate(character(4) :: type_1%x%s) type_1%x%s = "1234" if (type_1%x%s /= "1234") error stop end program class_11 lfortran-lfortran-2f73434/integration_tests/intrinsics_54.f900000664000175000017500000000045715141516316024423 0ustar alastairalastairprogram intrinsics_54 integer :: a, b, c, d, e, f a = 2 b = -3 c = 5 d = 10 e = 20 f = -30 if (max0(10,20) /= 20) error stop if (max0(3,5,4) /= 5) error stop if (max0(a,b) /= a) error stop if (max0(a,b,c) /= c) error stop if (max0(d,e,f,a,b,c) /= e) error stop end lfortran-lfortran-2f73434/integration_tests/derived_types_89.f900000664000175000017500000000066515141516316025115 0ustar alastairalastairprogram derived_types_89 implicit none type :: package_t character(len=100), allocatable :: modules_provided(:) end type package_t type(package_t) :: empty_pkg, pkg pkg = empty_pkg print *, allocated(empty_pkg % modules_provided) print *, allocated(pkg % modules_provided) if (allocated(empty_pkg % modules_provided)) error stop if (allocated(pkg % modules_provided)) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_17.f900000664000175000017500000000137615141516316025104 0ustar alastairalastairmodule derived_types_17_module_1 implicit none private public :: add, subtract type :: t_1 integer :: num = 100 end type t_1 contains function add() result(self) type(t_1) :: self self%num = self%num + self%num end function add function subtract() result(self) type(t_1) :: self self%num = self%num * self%num end function subtract end module module derived_types_17_module_2 use derived_types_17_module_1, only: subtract, add implicit none contains subroutine sub_2() print*, subtract() print*, add() end subroutine sub_2 end module program derived_types_17 use derived_types_17_module_2, only: sub_2 implicit none call sub_2() end program lfortran-lfortran-2f73434/integration_tests/class_57.f900000664000175000017500000000360415141516316023343 0ustar alastairalastairmodule class_57_mod implicit none type, abstract, public :: dumper contains procedure(to_toml), deferred :: dump_to_toml procedure, non_overridable, private :: dump_to_file generic :: dump => dump_to_file, dump_to_toml end type dumper type, extends(dumper) :: wrapper integer :: x contains procedure :: dump_to_toml => dump_x end type type :: toml_table integer :: key end type abstract interface subroutine to_toml(self, x) import dumper, toml_table class(dumper), intent(in) :: self type(toml_table), intent(inout) :: x end subroutine end interface contains ! Private target for generic subroutine dump_to_file(self, x) class(dumper), intent(inout) :: self integer, intent(in) :: x type(toml_table) ::table call self%dump(table) if (table%key /= 5) error stop end subroutine subroutine dump_x(self, x) class(wrapper), intent(in) :: self type(toml_table), intent(inout) :: x x%key = 5 end subroutine subroutine test_assign(self) class(dumper), allocatable, intent(inout) :: self self = wrapper(5) end subroutine logical function test_polymorphic_arg(self) class(dumper), intent(inout) :: self test_polymorphic_arg = .false. select type(self) type is (wrapper) self%x = 10 test_polymorphic_arg = .true. end select end function end module class_57_mod program class_57 use class_57_mod implicit none class(wrapper), allocatable :: temp class(dumper), allocatable :: temp2 type(wrapper) :: w1 logical :: l1 = .false. allocate(temp) call temp%dump(3) allocate(wrapper :: temp2) call test_assign(temp2) select type(temp2) type is (wrapper) if (temp2%x /= 5) error stop class default error stop end select l1 = test_polymorphic_arg(w1) if (l1 .neqv. .true.) error stop if (w1%x /= 10) error stop end program class_57 lfortran-lfortran-2f73434/integration_tests/array_05_transfer.f900000664000175000017500000000043515141516316025250 0ustar alastairalastairprogram array_05_transfer implicit none real :: value(5) = [1.1, 1.2, 1.3, 1.4, 1.5] integer, allocatable :: val(:) val = transfer(value, val, 5) print * , val if (all(val /= [1066192077, 1067030938, 1067869798, 1068708659, 1069547520])) error stop end program lfortran-lfortran-2f73434/integration_tests/enum_04.f900000664000175000017500000000057115141516316023172 0ustar alastairalastairmodule enum_04_mod use iso_c_binding implicit none enum, bind(c) enumerator :: red = 1, green = 2, blue = 3 end enum end module enum_04_mod program enum_04 use iso_c_binding use enum_04_mod implicit none integer(c_int) :: c c = red if (c /= 1) error stop c = green if (c /= 2) error stop c = blue if (c /= 3) error stop end program enum_04 lfortran-lfortran-2f73434/integration_tests/arrays_11.f900000664000175000017500000000114515141516316023523 0ustar alastairalastairprogram arrays_11 implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call sub(size(x), x, y) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine sub(n, a, b) integer, intent(in) :: n integer, intent(in) :: a(n) integer, intent(out) :: b(n) integer :: i do i = 1, size(a) b(i) = a(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) == b(i)) end do end function end lfortran-lfortran-2f73434/integration_tests/list_test_01_.f900000664000175000017500000000443115141516316024373 0ustar alastairalastairmodule list_test_01_mod implicit none real::eps = 1e-6 contains type(_lfortran_list(integer)) function fill_list_integer(size) result (ret) integer, intent(in):: size type(_lfortran_list(integer)) :: aarg = _lfortran_list_constant(0, 1, 2, 3, 4) integer::i do i = 0, size-1 call _lfortran_list_append(aarg, i+5) end do ret = aarg end function subroutine test_list_01 type(_lfortran_list(integer)) :: a type(_lfortran_list(real)) :: f = _lfortran_list_constant(1.0, 2.0, 3.0, 4.0, 5.0) integer::i a = fill_list_integer(10) do i = 0, 9 call _lfortran_list_append(f, real(i+6)) end do do i = 0, 14 if ( abs(_lfortran_get_item(f, i) - real(_lfortran_get_item(a, i)) - 1.0) > eps ) error stop end do do i = 0, 14 call _lfortran_set_item(f, i, _lfortran_get_item(f, i)+real(i)) end do do i = 0, 14 if ( abs(_lfortran_get_item(f, i) - real(_lfortran_get_item(a, i)) - real(i) - 1.0) > eps ) error stop end do end subroutine subroutine test_list_02() type(_lfortran_list(integer)) :: x = _lfortran_list_constant(1, 2) type(_lfortran_list(integer)) :: y integer::i do i = 3, 49 call _lfortran_list_append(x, i+29) end do do i = 0, _lfortran_len(x)-1 call _lfortran_list_append(y, _lfortran_get_item(x, i)) end do do i = 0, _lfortran_len(x)-1 if ( _lfortran_get_item(x, i) /= _lfortran_get_item(y, i) ) error stop end do end subroutine subroutine test_issue_1681 ! issue 1681 from LP type(_lfortran_list(integer)) :: a = _lfortran_list_constant(2, 3, 4) a = _lfortran_list_constant(1, 2, 3) if ( _lfortran_len(a) /= 3 .or. _lfortran_get_item(a, 0) /= 1 .or. _lfortran_get_item(a, 1) /= 2 .or. _lfortran_get_item(a,2) /= 3 ) error stop a = _lfortran_list_constant(2) if ( _lfortran_len(a) /= 1 .or. _lfortran_get_item(a, 0) /= 2 ) error stop end subroutine subroutine tests() call test_list_01() call test_list_02() ! Removed negative indexing test call test_issue_1681() end subroutine end module program test_list_01_ use list_test_01_mod implicit none call tests end program lfortran-lfortran-2f73434/integration_tests/derived_types_42.f900000664000175000017500000000117115141516316025073 0ustar alastairalastairmodule derived_types_42_mod implicit none type twoint integer :: m1 integer :: m2 end type interface twoint procedure :: reverse_constructor end interface contains function reverse_constructor(i, j) result(n) integer, intent(in) :: i, j type(twoint) :: n n%m1 = j n%m2 = i end function end module derived_types_42_mod program derived_types_42 use derived_types_42_mod implicit none type(twoint) :: ins ins = twoint(1, 2) if (ins%m1 /= 2 .or. ins%m2 /= 1) error stop end program derived_types_42 lfortran-lfortran-2f73434/integration_tests/template_interface_01.f900000664000175000017500000000545115141516316026060 0ustar alastairalastairmodule template_interface_01_m implicit none public :: test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement template sum_t(T, add, cast) require :: operator_r(T, T, T, add), cast_r(T, cast) private public :: generic_sum interface operator(+) procedure add end interface contains pure function generic_sum(arr) result(res) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = res + arr(i) end do end if end function end template contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function simple_generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) interface operator(+) procedure add end interface type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = res + arr(i) end do end if end function subroutine test_template() instantiate sum_t(integer, operator(+), cast_integer), only: generic_sum_integer => generic_sum instantiate sum_t(real, operator(+), cast_real), only: generic_sum_real => generic_sum integer :: ai(10), i, ri real :: ar(10), rr do i = 1, 10 ai(i) = i ar(i) = i end do ri = generic_sum_integer(ai) rr = generic_sum_real(ar) print *, ri print *, rr print *, simple_generic_sum{integer, operator(+), cast_integer}(ai) print *, simple_generic_sum{real, operator(+), cast_real}(ar) end subroutine end module program template_interface_01 use template_interface_01_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/allocate_24.f900000664000175000017500000000020115141516316024002 0ustar alastairalastairprogram allocate_24 integer,allocatable:: x x = 666 print "(I0)", x if (x /= 666) error stop deallocate(x) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_154.f900000664000175000017500000000021115141516316024470 0ustar alastairalastairprogram intrinsics_154 integer(8) :: n = 921092378411_8 print *, mod(n, 10_8) if (mod(n, 10_8) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/procedure_22.f900000664000175000017500000000024015141516316024207 0ustar alastairalastairprogram procedure_22 use procedure_22_mod_b type(deps_t) :: temp_dpt temp_dpt%str = "Hello " if (func(temp_dpt) /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_70.f900000664000175000017500000001035715141516316023535 0ustar alastairalastairprogram arrays_70 implicit none integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) call temp(A, A1, A2, tmp) contains subroutine temp(A, A1, A2, tmp) integer, intent(inout) :: A(:) integer, intent(inout) :: A1(:,:) integer, intent(inout) :: A2(:,:,:) integer, intent(inout) :: tmp(:,:) !!!! ArrayItem = ArrayItem A([1,2]) = A([2,1]) if (A(1) /= 2 .or. A(2) /= 1) error stop A1([1,2],1) = A1([2,1],1) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1([1,2],[2,3]) = A1([2,1],[2,3]) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],1) = A1(1,[1,2]) if (A1(1,1) /= 2 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2(1,[1,2],[1,2]) = A2([1,2],[2,1],1) if (A2(1,1,1) /= 3 .or. A2(2,1,1) /= 2 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!!! ArrayItem = ArrayConstant A([1,2]) = [5,5] if (A(1) /= 5 .or. A(2) /= 5) error stop A1([1,2],1) = [5,5] if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],[1,2]) = tmp if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2([1,2],1,1) = [5,5] if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop A2([1,2],1,[1,2]) = tmp if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 5 .or. A2(2,1,2) /= 5 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!! LHS and RHS contains common variable A = A([3,1,2,4]) if (A(1) /= 3 .or. A(2) /= 5 .or. A(3) /= 5 .or. A(4) /= 4) error stop A1 = A1(:,[3,2,1]) if (A1(1,1) /= 8 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A2 = A2(:,[2,1],:) if (A2(1,1,1) /= 4 .or. A2(2,1,1) /= 4 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 2 .or. A2(2,1,2) /= 8 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1(1,1:2) = A1(1,[2,1]) - A(1:2) if (A1(1,1) /= 2 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 3 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A1 = A1 * A1(1,1) if (A1(1,1) /= 4 .or. A1(2,1) /= 14 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 6 .or. A1(2,2) /= 10 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop A2(:,1,:) = A2(1,:,:) * A2(1,1,1) if (A2(1,1,1) /= 16 .or. A2(2,1,1) /= 20 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 8 .or. A2(2,1,2) /= 20 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1([2,1],[1,2]) = A1([1,2],[3,2]) * A1(2,1) if (A1(1,1) /= 140 .or. A1(2,1) /= 140 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 140 .or. A1(2,2) /= 84 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_29a.f900000664000175000017500000000051215141516316026573 0ustar alastairalastairmodule separate_compilation_29a_module implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine sa() targets%x = 1 end subroutine sa integer function get_a() get_a = targets%x end function get_a end module separate_compilation_29a_module lfortran-lfortran-2f73434/integration_tests/exit_02.f900000664000175000017500000000021615141516316023171 0ustar alastairalastairprogram exit_02 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit(0) end if end do end program lfortran-lfortran-2f73434/integration_tests/elemental_09.f900000664000175000017500000000515715141516316024206 0ustar alastairalastair!> test that user-defined elemental subroutines !> get broadcasted correctly module elemental_09_module implicit none contains elemental subroutine square_element(x, y) real, intent(in) :: x real, intent(out) :: y y = x * x end subroutine square_element elemental subroutine multiply_elements(x, y, z) real, intent(in) :: x real, intent(in) :: y real, intent(out) :: z z = x * y end subroutine multiply_elements end module elemental_09_module program elemental_09 use elemental_09_module implicit none real, parameter :: epsilon = 1e-7 real, dimension(5) :: arr_in1 = [1.0, 2.0, 3.0, 4.0, 5.0] real, dimension(5) :: arr_in2 = [2.0, 3.0, 4.0, 5.0, 6.0] real, dimension(5) :: arr_out call square_element(arr_in1, arr_out) print *, arr_out if (abs(arr_out(1) - 1) > epsilon ) error stop if (abs(arr_out(2) - 4) > epsilon ) error stop if (abs(arr_out(3) - 9) > epsilon ) error stop if (abs(arr_out(4) - 16) > epsilon ) error stop if (abs(arr_out(5) - 25) > epsilon ) error stop call multiply_elements(arr_in1, arr_in2, arr_out) print *, arr_out if (abs(arr_out(1) - 2) > epsilon ) error stop if (abs(arr_out(2) - 6) > epsilon ) error stop if (abs(arr_out(3) - 12) > epsilon ) error stop if (abs(arr_out(4) - 20) > epsilon ) error stop if (abs(arr_out(5) - 30) > epsilon ) error stop print *, arr_out call multiply_elements(arr_in1, 2.0, arr_out) print *, arr_out if (abs(arr_out(1) - 2) > epsilon ) error stop if (abs(arr_out(2) - 4) > epsilon ) error stop if (abs(arr_out(3) - 6) > epsilon ) error stop if (abs(arr_out(4) - 8) > epsilon ) error stop if (abs(arr_out(5) - 10) > epsilon ) error stop call multiply_elements(3.0, arr_in1, arr_out) print *, arr_out if (abs(arr_out(1) - 3) > epsilon ) error stop if (abs(arr_out(2) - 6) > epsilon ) error stop if (abs(arr_out(3) - 9) > epsilon ) error stop if (abs(arr_out(4) - 12) > epsilon ) error stop if (abs(arr_out(5) - 15) > epsilon ) error stop call sum_elements(arr_in1, arr_in2, arr_out) print *, arr_out if (abs(arr_out(1) - 3) > epsilon ) error stop if (abs(arr_out(2) - 5) > epsilon ) error stop if (abs(arr_out(3) - 7) > epsilon ) error stop if (abs(arr_out(4) - 9) > epsilon ) error stop if (abs(arr_out(5) - 11) > epsilon ) error stop contains elemental subroutine sum_elements(x, y, z) real, intent(in) :: x real, intent(in) :: y real, intent(out) :: z z = x + y end subroutine sum_elements end program elemental_09 lfortran-lfortran-2f73434/integration_tests/format_39.f900000664000175000017500000000055215141516316023525 0ustar alastairalastairprogram format_39 implicit none write(*,"(EN0.0E0)") 3.14159 write(*,"(EN0.0E0)") 0.0 write(*,"(EN0.0E0)") 10.0 write(*,"(EN0.0E0)") 3.14E+03 write(*,"(EN0.0E0)") 30.14159 write(*,"(EN0.0E0)") 391.14 write(*,"(EN0.0E0)") 3.14E+04 write(*,"(EN0.0E0)") -5.0 write(*,"(EN0.0E0)") 1.23456E-5 write(*,"(EN0.0E0)") 9.99E+10 end program format_39 lfortran-lfortran-2f73434/integration_tests/namelist_26.f900000664000175000017500000000273215141516316024047 0ustar alastairalastairprogram namelist_26 implicit none character(len=15), allocatable :: name(:) character(len=:), allocatable :: cmd, cmd2 character(len=256) :: test namelist /mylist/ cmd, name, cmd2 cmd = repeat(' ', 132) cmd2 = repeat(' ', 132) allocate(name(2)) test = '&MYLIST ' // & 'CMD="run my_project", NAME="John Doe", CMD2="extra command" /' read(test, nml=mylist) print *, 'CMD = ', trim(cmd) print *, 'NAME(1) = ', name(1) print *, 'CMD2 = ', trim(cmd2) if (trim(cmd) /= 'run my_project') then error stop 'Incorrect CMD value read' end if if (trim(name(1)) /= 'John Doe') then error stop 'Incorrect NAME(1) value read' end if if (trim(cmd2) /= 'extra command') then error stop 'Incorrect CMD2 value read' end if ! Test without using commas test = '&MYLIST ' // & 'CMD="run your_project" ' // & 'NAME="project1" ' // & 'CMD2="Command 2" /' read(test, nml=mylist) print *, 'CMD = ', trim(cmd) print *, 'NAME(1) = ', name(1) print *, 'CMD2 = ', trim(cmd2) if (trim(cmd) /= 'run your_project') then error stop 'Incorrect CMD value read in second read' end if if (trim(name(1)) /= 'project1') then error stop 'Incorrect NAME(1) value read in second read' end if if (trim(cmd2) /= 'Command 2') then error stop 'Incorrect CMD2 value read in second read' end if end program namelist_26lfortran-lfortran-2f73434/integration_tests/c_ptr_08.f900000664000175000017500000000172115141516316023337 0ustar alastairalastairprogram c_ptr_08 use iso_c_binding implicit none character(kind=c_char, len=*), parameter :: hex_str = "00FF" // c_null_char integer(c_long) :: result result = c_strtol(hex_str) print *, "Result:", result if (result /= 255_c_long) error stop contains integer(c_long) function c_strtol(string) use iso_c_binding character(kind=c_char, len=*), intent(in), target :: string interface integer(c_long) function strtol(str, endptr, base) bind(C, name="strtol") use iso_c_binding type(c_ptr), intent(in), value :: str type(c_ptr), intent(inout) :: endptr integer(c_int), intent(in), value :: base end function strtol end interface type(c_ptr) :: str1, strend str1 = c_loc(string) strend = c_null_ptr c_strtol = strtol(str1, strend, 16_c_int) end function c_strtol end program c_ptr_08 lfortran-lfortran-2f73434/integration_tests/separate_compilation_25.f900000664000175000017500000000042515141516316026431 0ustar alastairalastairprogram separate_compilation_25 use stats_corr_separate_compilation_25, only: corr implicit none real :: y(2,2) = reshape([1.0, 2.0, 3.0, 4.0], [2,2]) real :: result(2) result = corr(y) print *, result if (.not. all(result == [1.0, 4.0])) error stop end programlfortran-lfortran-2f73434/integration_tests/legacy_array_sections_11.f900000664000175000017500000000526415141516316026601 0ustar alastairalastair PROGRAM LEGACY_ARRAY_SECTIONS_11 CHARACTER TRANS INTEGER IRESID, LDA, LDB, LDX, LWORK, M, N, NRHS REAL A( 1, 1 ), B( 1, 1 ), C( 1, 1 ), WORK( 1 ), $ X( 1, 1 ) REAL SQRT17, R TRANS = 'N' IRESID = 1 M = 0 N = 1 NRHS = 1 LDA = 1 LDB = 1 LDX = 1 LWORK = 1 R = SQRT17( TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, $ C, WORK, LWORK ) IF( R.NE.0.0E0 ) STOP 1 END REAL FUNCTION SQRT17( TRANS, IRESID, M, N, NRHS, A, $ LDA, X, LDX, B, LDB, C, WORK, LWORK ) CHARACTER TRANS INTEGER IRESID, LDA, LDB, LDX, LWORK, M, N, NRHS REAL A( LDA, * ), B( LDB, * ), C( LDB, * ), $ WORK( LWORK ), X( LDX, * ) REAL ZERO, ONE PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 ) INTEGER INFO, ISCL, NCOLS, NROWS REAL ERR, NORMA, NORMB, NORMRS, SMLNUM REAL RWORK( 1 ) LOGICAL LSAME REAL SLAMCH, SLANGE EXTERNAL LSAME, SLAMCH, SLANGE EXTERNAL SGEMM, SLACPY, SLASCL, XERBLA INTRINSIC MAX, REAL SQRT17 = ZERO IF( LSAME( TRANS, 'N' ) ) THEN NROWS = M NCOLS = N ELSE IF( LSAME( TRANS, 'T' ) ) THEN NROWS = N NCOLS = M ELSE CALL XERBLA( 'SQRT17', 1 ) RETURN END IF IF( LWORK.LT.NCOLS*NRHS ) THEN CALL XERBLA( 'SQRT17', 13 ) RETURN END IF IF( M.LE.0 .OR. N.LE.0 .OR. NRHS.LE.0 ) THEN RETURN END IF NORMA = SLANGE( 'One-norm', M, N, A, LDA, RWORK ) SMLNUM = SLAMCH( 'Safe minimum' ) / SLAMCH( 'Precision' ) ISCL = 0 IF( NORMA.GT.ZERO .AND. NORMA.LT.SMLNUM ) THEN ISCL = 1 CALL SLASCL( 'General', 0, 0, NORMA, SMLNUM, M, N, A, LDA, $ INFO ) END IF CALL SLACPY( 'All', NROWS, NRHS, B, LDB, C, LDB ) CALL SGEMM( 'Transpose', TRANS, NRHS, NCOLS, NROWS, ONE, C, LDB, $ A, LDA, ZERO, WORK, NRHS ) ERR = SLANGE( 'One-norm', NRHS, NCOLS, WORK, NRHS, RWORK ) NORMB = SLANGE( 'One-norm', NROWS, NRHS, B, LDB, RWORK ) IF( NORMB.NE.ZERO ) THEN NORMRS = ERR / NORMB ELSE NORMRS = ERR END IF IF( ISCL.EQ.1 ) THEN CALL SLASCL( 'General', 0, 0, SMLNUM, NORMA, M, N, A, LDA, $ INFO ) END IF IF( NORMRS.GT.SQRT17 ) THEN SQRT17 = NORMRS END IF RETURN END lfortran-lfortran-2f73434/integration_tests/intrinsics_53.f900000664000175000017500000000032015141516316024407 0ustar alastairalastairprogram intrinsics_53 integer(4) :: n4 = 3 integer(8) :: n8 = 3 print *, repeat("a", n4) print *, repeat("a", n8) if (repeat("a", n4) /= "aaa") error stop if (repeat("a", n8) /= "aaa") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_210.f900000664000175000017500000001407415141516316024475 0ustar alastairalastairprogram intrinsics_210 use lcompilers_test_module use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer(4) :: n(40) real(dp) :: x(40) real(dp) :: expected(40) real(dp) :: expected_res(32) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(32) = bessel_jn( [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31], [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) expected_res = [ 1.1242697836494344E-156_dp, -7.0751499885966521E-155_dp, 6.6185432736853706E-155_dp, & 7.7717941781117294E-156_dp, 1.2534227302224874E-002_dp, 3.4591630672860707E-003_dp, & -6.6635959548975512E-002_dp, 6.8893572859763076E-012_dp, 1.7296961499438702E-002_dp, & -2.1516112626678387E-002_dp, 2.8947852994014139E-009_dp, 1.5735107612153680E-010_dp, & 0.15234385509729706_dp, -0.10168238671155572_dp, 0.10624777824227472_dp, 6.9944761409615891E-002_dp, & 0.17105291318716473_dp, 8.0781549836989616E-005_dp, 2.0878989572444657E-005_dp, 5.0408349875562356E-006_dp, & 1.0671913964996569E-028_dp, 1.6746487669899214E-030_dp, 2.5066961782596647E-032_dp, 3.5865372175913752E-034_dp, & 6.9929712255690990E-039_dp, 7.0335789790577674E-041_dp, 6.8007546900796684E-043_dp, 6.3118158714187534E-045_dp, & -3.3890445848758326E-002_dp, 6.2626337984015854E-003_dp, 3.5724011188705031E-002_dp, 7.5701847451948119E-003_dp] call lcompilers_test(res, expected_res) n = [0, 1, 2, 3, & 4, 5, 6, 7, & 8, 9, 10, 11, & 12, 13, 14, 15, & 16, 17, 18, 19, & 20, 21, 22, 23, & 24, 25, 26, 27, & 28, 29, 30, 31, & 32, 33, 34, 35, & 36, 37, 38, 39] x = [9.98600559790084e307_dp, 9.98800479820072e307_dp, 9.9900039985006e307_dp, 9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [1.1242697836494346E-156_dp, -7.0751499885966513E-155_dp, 6.6185432736853698E-155_dp, & 7.7717941781117305E-156_dp, 1.2534227302224872E-002_dp, 3.4591630672860703E-003_dp, & -6.6635959548975499E-002_dp, 6.8893572859763092E-012_dp, 1.7296961499438702E-002_dp, & -2.1516112626678383E-002_dp, 2.8947852994014131E-009_dp, 1.5735107612153680E-010_dp, & 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, & -6.8962897404005893E-002_dp, 0.11600081741700101_dp, -3.9325959159357701E-002_dp, -5.4809072994286029E-002_dp, & 1.5966478032830803E-002_dp, 2.6042180275774077E-007_dp, 5.3826197741831827E-008_dp, 1.0507745589842931E-008_dp, & 5.0740445951464912E-036_dp, 6.6789232767890394E-038_dp, 8.4475056518481737E-040_dp, 1.0281670110849426E-041_dp, & 5.7516289094274354E-047_dp, 4.9847818101108337E-049_dp, 4.1752109811469430E-051_dp, 3.3719895152572157E-053_dp, & 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, 0.0000000000000000_dp, & -3.5113774172006770E-002_dp, -1.2362051018001158E-002_dp, 3.1067922823692470E-002_dp, 2.5002750863701195E-002_dp] call lcompilers_test(bessel_jn(n, x), expected) y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [1.23675410E-02_sp, 0.578831732_sp, 0.246125504_sp, 1.05763575E-04_sp, & 2.68192869E-02_sp, -2.04640366E-02_sp, 8.70731674E-05_sp, 8.41663041E-06_sp, & 3.94373797E-02_sp, -0.118844219_sp, 0.100343116_sp, -0.164519981_sp, & 0.127764359_sp, 8.69522523E-03_sp, 3.02742911E-03_sp, 9.63504543E-04_sp, & 1.02301633E-21_sp, 1.98594108E-23_sp, 3.63846685E-25_sp, 6.31080674E-27_sp, & 4.41184424E-31_sp, 5.28522317E-33_sp, 6.04228548E-35_sp, 6.58917622E-37_sp, & -3.08027826E-02_sp, 1.36694657E-02_sp, 3.46039571E-02_sp, -6.74327370E-04_sp] call lcompilers_test(bessel_jn(n(1:size(y)), y), expected_y, 10.0_sp) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_157.f900000664000175000017500000000443115141516316024503 0ustar alastairalastairprogram intrinsics_157 logical, parameter :: l1 = ble(10, 5) logical, parameter :: l2 = ble(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: f = .false. logical, parameter :: ar1(4) = ble([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = ble([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, ble(10, 5) if (ble(10, 5) .neqv. .false.) error stop print*, ble(-5, 10) if (ble(-5, 10) .neqv. .false.) error stop print*, ble(-5, 5) if (ble(-5, 5) .neqv. .false.) error stop print*, ble(-5, -15) if (ble(-5, -15) .neqv. .false.) error stop print*, ble(5, 15) if (ble(5, 15) .neqv. .true.) error stop print*, ble(5, -15) if (ble(5, -15) .neqv. .true.) error stop print*, ble(0, -5) if (ble(0, -5) .neqv. .true.) error stop print*, ble(0, 5) if (ble(0, 5) .neqv. .true.) error stop print*, ble(-5, 0) if (ble(-5, 0) .neqv. .false.) error stop print*, ble(5, 0) if (ble(5, 0) .neqv. f) error stop print*, ble(k1, k2) if (ble(k1, k2) .neqv. .false.) error stop print*, ble(k3, k1) if (ble(k3, k1) .neqv. .false.) error stop print*, ble(k3, k3) if (ble(k3, k3) .neqv. .true.) error stop print*, ble(k3, k6) if (ble(k3, k6) .neqv. .false.) error stop print*, ble(k2, k4) if (ble(k2, k4) .neqv. .true.) error stop print*, ble(k2, k6) if (ble(k2, k6) .neqv. .true.) error stop print*, ble(k5, k3) if (ble(k5, k3) .neqv. .true.) error stop print*, ble(k5, k2) if (ble(k5, k2) .neqv. .true.) error stop print*, ble(k3, k5) if (ble(k3, k5) .neqv. .false.) error stop print*, ble(k2, k5) if (ble(k2, k5) .neqv. f) error stop print *, ble(arr1, 5) if (any(ble(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = ble(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end program lfortran-lfortran-2f73434/integration_tests/cond_05.f900000664000175000017500000000155415141516316023154 0ustar alastairalastairprogram cond_05 implicit none logical, pointer :: ptr_bool1, ptr_bool2 logical, target :: bool_true, bool_false complex, pointer :: ptr_complex4 complex(8), pointer :: ptr_complex8 complex, target :: complex4_1, complex4_2 complex(8), target :: complex8_1 bool_true = .true. bool_false = .false. ptr_bool1 => bool_true if (ptr_bool1 .eqv. bool_false) error stop if (ptr_bool1 .neqv. bool_true) error stop if (.not. ptr_bool1 .eqv. ptr_bool1) error stop ptr_bool1 => bool_true ptr_bool2 => bool_true if (.not. ptr_bool1 .eqv. ptr_bool2) error stop complex4_1 = (1, 2) ptr_complex4 => complex4_1 complex4_2 = (2, 3) complex8_1 = complex4_1 if (ptr_complex4 == complex4_2) error stop if (ptr_complex4 /= complex8_1) error stop if (.not. ptr_complex4 == (complex4_2 - (1,1))) error stop end program cond_05 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_13.f900000664000175000017500000000046515141516316026601 0ustar alastairalastairprogram legacy_array_sections_13 implicit none real :: work(20) work = 1.0 call process2d(work(5)) if (work(5) /= 99.0) error stop contains subroutine process2d(matrix) real, intent(inout) :: matrix(2, 2) matrix(1, 1) = 99.0 end subroutine process2d end program lfortran-lfortran-2f73434/integration_tests/submodule_09.f900000664000175000017500000000114315141516316024226 0ustar alastairalastairmodule stdlib_error_submodule_09 implicit none interface module subroutine error_stop(code) integer, intent(inout) :: code end subroutine error_stop end interface end module submodule (stdlib_error_submodule_09) f18estop_submodule_09 implicit none contains module procedure error_stop integer, parameter :: i = 3 code = i end procedure end submodule f18estop_submodule_09 program submodule_09 use stdlib_error_submodule_09 implicit none integer :: tester = 1 call error_stop(tester) print *, tester if (tester /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/interface_13.f900000664000175000017500000000125215141516316024163 0ustar alastairalastairmodule interface_13_module_1 implicit none interface operator(.mul.) module procedure multiply end interface contains integer function multiply(a, b) integer, intent(in) :: a integer, intent(in) :: b multiply = a * b end function multiply end module module interface_13_module_2 use interface_13_module_1, only: operator(.mul.) implicit none contains subroutine compute() integer :: res res = 123 .mul. 456 if (res /= 56088) error stop end subroutine compute end module program interface_13 use interface_13_module_2 implicit none call compute() end program interface_13 lfortran-lfortran-2f73434/integration_tests/openmp_65.f900000664000175000017500000000772115141516316023537 0ustar alastairalastair! Test 5: Guided Schedule program openmp_65 use omp_lib implicit none integer, parameter :: n = 1000 ! Larger n to see guided behavior integer :: i, tid, j integer :: chunk_count = 0 integer :: chunk_size_array(100) = 0 integer :: chunk_thread(100) = -1 integer :: current_pos = 1 integer :: thread_iterations(0:7) = 0 logical :: test_passed = .true. logical :: decreasing_trend = .true. integer :: last_thread = -1 integer :: current_chunk_size = 0 integer :: iterations_done = 0 call omp_set_num_threads(4) print *, "=== GUIDED Schedule Test ===" print *, "Iterations:", n, "Threads:", omp_get_max_threads() ! Track chunk sizes with guided schedule !$omp parallel private(tid) !$omp do schedule(guided) do i = 1, n tid = omp_get_thread_num() !$omp critical if (i == current_pos) then chunk_count = chunk_count + 1 chunk_thread(chunk_count) = tid ! Find chunk size by looking ahead do j = i, n if (j == n) then chunk_size_array(chunk_count) = j - i + 1 current_pos = n + 1 exit else ! This is approximate - in real guided, we can't know ! the chunk size until the chunk is complete ! For testing, we'll measure it differently end if end do end if thread_iterations(tid) = thread_iterations(tid) + 1 !$omp end critical end do !$omp end do !$omp end parallel ! Better way to measure guided chunks chunk_count = 0 current_pos = 1 ! Measure chunks by looking at work distribution !$omp parallel private(tid, i) tid = omp_get_thread_num() if (tid == 0) then ! Simulate guided algorithm do while (iterations_done < n) chunk_count = chunk_count + 1 ! Guided: chunk_size = remaining_iterations / (2 * num_threads) ! Minimum chunk size is usually 1 current_chunk_size = max(1, (n - iterations_done) / (2 * omp_get_num_threads())) chunk_size_array(chunk_count) = current_chunk_size iterations_done = iterations_done + current_chunk_size if (chunk_count >= 100) exit end do end if !$omp end parallel ! Print chunk size progression print *, "Expected guided chunk sizes (first 10):" do i = 1, min(10, chunk_count) print *,"Chunk ", i, ": size = ", chunk_size_array(i) end do ! Verify guided behavior - chunks should generally decrease do i = 2, min(chunk_count-1, 20) if (chunk_size_array(i) > chunk_size_array(i-1) * 1.5) then ! Allow some variation but not huge increases print *, "WARNING: Chunk size increased significantly at chunk", i decreasing_trend = .false. end if end do ! First chunks should be larger than last chunks if (chunk_count > 5) then if (chunk_size_array(1) < chunk_size_array(chunk_count-2) * 2) then print *, "ERROR: Guided schedule not showing expected decreasing chunk sizes!" print *, "First chunk:", chunk_size_array(1), & "Late chunk:", chunk_size_array(chunk_count-2) test_passed = .false. end if end if print *, "Thread work distribution:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_iterations(i), "iterations" end do if (.not. test_passed) then error stop "GUIDED schedule test FAILED!" end if if (.not. decreasing_trend) then print *, "WARNING: Guided chunks did not show clear decreasing trend" else print *, "Guided schedule showing expected decreasing chunk pattern" end if print *, "GUIDED schedule test completed" end program openmp_65lfortran-lfortran-2f73434/integration_tests/modules_56.f900000664000175000017500000000071715141516316023707 0ustar alastairalastairmodule modules_56_module contains logical function is_close_rsp(a) result(res) use, intrinsic :: ieee_arithmetic, only: ieee_is_nan real, intent(in) :: a res = ieee_is_nan(a) end function is_close_rsp end module program main use modules_56_module implicit none real :: a logical :: res a = 0.0 ! Initialize the variable 'a' res = is_close_rsp(a) print *, res if (res) error stop end program main lfortran-lfortran-2f73434/integration_tests/statement_04.f900000664000175000017500000000034715141516316024233 0ustar alastairalastairprogram statement integer, parameter :: wp = kind(1.e0) real(wp) :: g2 complex(wp) :: g, t real(wp) :: ABSSQ ABSSQ( t ) = real( t )**2 + aimag( t )**2 g = (3.0, 4.0) g2 = ABSSQ(g) print *, g2 end program lfortran-lfortran-2f73434/integration_tests/dealloc_05.f900000664000175000017500000000074115141516316023631 0ustar alastairalastairprogram dealloc_05 implicit none type :: base integer :: x end type type, extends(base) :: derived real :: r end type class(base), allocatable :: var allocate(derived :: var) select type(var) type is (derived) class default error stop end select deallocate(var) select type(var) type is (base) class default error stop end select end program dealloc_05 lfortran-lfortran-2f73434/integration_tests/boz_02.f900000664000175000017500000000256215141516316023020 0ustar alastairalastair!This file contains tests for BOZ, which are not yet supported in gfortran program real_boz implicit none !check DATA Assignments integer :: i real :: boz_1, matrix1(5), matrix2(2), arr1(2) integer :: arr2(2) !Check Scalar Assigment data boz_1 /b'01011101'/ !Check Multiple Assigments of Real array with BOZ Values data matrix1 / b'10', 2*o'100', 3.12, z'ABC' / !Check Data Broadcasting to all elements of array data matrix2 / 2*b'10' / !Check Implied Do loop Assignments, with real assigments along with integer assignments data (arr1(i), arr2(i), i=1,2) / 1.2, z'02', z'01', 3 / !Check Declaration Statements !Check Scalar Initializations real::a = o'10' integer::b = z'10' !Check Parameter Initializations real,parameter::c = b'01' integer,parameter::d = z'02' !Check Array Initializations real:: e(3) = [real::b'01', z'10', 3.4] integer:: f(3) = [integer::1, b'10', 4] !Check for BOZ Assignments integer :: boz_6 integer :: boz_arr_int(2) real:: boz_7 real:: boz_arr_real(2) !Check Integer Array Assignments boz_arr_int(1) = b'11' boz_arr_int(2) = 1 !Check Real Array Assignments boz_arr_real(1) = z'01' boz_arr_real(2) = 1.2 !Check Integer Scalar Assignments boz_6 = o'02' !Check Real Scalar Assignments boz_7 = z'03' print *, boz_1 print *, matrix1 print *, matrix2 print *, arr1, arr2 print *, a,b,c,d,e,f print *, boz_6, boz_7 print *, boz_arr_int, boz_arr_real end program lfortran-lfortran-2f73434/integration_tests/intrinsics_226.f900000664000175000017500000000130415141516316024474 0ustar alastairalastairprogram intrinsics_226 implicit none integer(1) :: a1(2) integer(4) :: b1(5) integer(8) :: c1(10) integer(1), parameter :: a2 = iall([1, 2, 3, 4, 5]) integer(4), parameter :: b2 = iall([3, 5, 7, 9, 11]) integer(8), parameter :: c2 = iall([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) a1 = [3, 5] b1 = [3, 5, 7, 9, 11] c1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print*, iall(a1) if (iall(a1) /= 1) error stop print*, iall(b1) if (iall(b1) /= 1) error stop print*, iall(c1) if (iall(c1) /= 0) error stop print*, a2 if (a2 /= 0) error stop print*, b2 if (b2 /= 1) error stop print*, c2 if (c2 /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_104.f900000664000175000017500000000044415141516316024473 0ustar alastairalastairprogram intrinsics_104 implicit none integer, parameter :: new_len = len(new_line('a')) integer, parameter :: new_len2 = len(adjustl('a')) print *, new_len if (new_len /= 1) error stop print*, new_len2 if (new_len2 /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_196.f900000664000175000017500000001171515141516316024511 0ustar alastairalastairprogram intrinsics_196 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(8) :: x(40) real(8) :: expected(40) real :: y(30) real :: expected_y(30) integer :: i real(dp), parameter :: res(40) = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, & 8.43782487005198_dp, 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp]) x = [3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, 8.43782487005198_dp, & 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp] expected = [0.20421621687655644_dp, -0.33171193864355270_dp, -8.3784683987487160E-002_dp, 0.27198866581429970_dp, & 9.0842803254412019E-003_dp, -0.23134340809868278_dp, 4.5606105201175973E-002_dp, 0.19306664290638995_dp, & -8.6684684328497116E-002_dp, -0.15370371403787708_dp, 1.2435438521419326E-155_dp, -2.8314187014586877E-155_dp, & -1.5668960835696801E-154_dp, -1.2962049361081139E-154_dp, 1.2232544148395820E-154_dp, -8.9027017266527920E-155_dp, & 7.4652062949806537E-156_dp, 1.0051338573860275E-155_dp, 7.9153155792012788E-155_dp, 7.0791696617318761E-155_dp, & -0.38551658341791684_dp, -0.46015216947899512_dp, -0.51843459851029450_dp, -0.55845382793597553_dp, -0.57902364849354149_dp, & -0.57972422117951550_dp, -0.56091267269977430_dp, -0.52370145724258965_dp, -0.46990557508027103_dp, -0.40196106888470001_dp, & 0.38551658341791684_dp, 0.46015216947899512_dp, 0.51843459851029450_dp, 0.55845382793597553_dp, 0.57902364849354149_dp, & 0.57972422117951550_dp, 0.56091267269977430_dp, 0.52370145724258965_dp, 0.46990557508027103_dp, 0.40196106888470001_dp] do i = 1, size(x) print *, bessel_j1(x(i)), "i = ", i if (abs(bessel_j1(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [3.3398640543782485_sp, 5.039184326269492_sp, 6.738504598160736_sp, 8.43782487005198_sp, & 10.137145141943222_sp, 11.836465413834466_sp, 13.53578568572571_sp, 15.235105957616954_sp, & 16.934426229508198_sp, 18.63374650139944_sp, & -0.8439824070371851_sp, -1.0638944422231107_sp, -1.2838064774090363_sp, -1.503718512594962_sp, & -1.7236305477808875_sp, -1.9435425829668134_sp, -2.163454618152739_sp, -2.3833666533386646_sp, & -2.60327868852459_sp, -2.823190723710516_sp, .8439824070371851_sp, 1.0638944422231107_sp, & 1.2838064774090363_sp, 1.503718512594962_sp, 1.7236305477808875_sp, 1.9435425829668134_sp, & 2.163454618152739_sp, 2.3833666533386646_sp, 2.60327868852459_sp, 2.823190723710516_sp] expected_y = [0.204216227_sp, -0.331711948_sp, -8.37847441E-02_sp, 0.271988720_sp, & 9.08430573E-03_sp, -0.231343403_sp, 4.56061028E-02_sp, 0.193066686_sp, & -8.66845325E-02_sp, -0.153703660_sp, -0.385516584_sp, -0.460152149_sp, & -0.518434584_sp, -0.558453798_sp, -0.579023659_sp, -0.579724193_sp, & -0.560912728_sp, -0.523701489_sp, -0.469905645_sp, -0.401961178_sp, & 0.385516584_sp, 0.460152149_sp, 0.518434584_sp, 0.558453798_sp, & 0.579023659_sp, 0.579724193_sp, 0.560912728_sp, 0.523701489_sp, & 0.469905645_sp, 0.401961178_sp] do i = 1, size(y) print *, bessel_j1(y(i)), "i = ", i if (abs(bessel_j1(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_class_star_01a.f900000664000175000017500000000046515141516316031006 0ustar alastairalastairmodule separate_compilation_class_star_01_mod implicit none private public :: get_value contains subroutine get_value(g) class(*), intent(out) :: g select type(g) type is (integer) g = 42 end select end subroutine get_value end module separate_compilation_class_star_01_mod lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_07.f900000664000175000017500000000174315141516316026604 0ustar alastairalastairmodule legacy_array_sections_07_module !! [order = polynomial degree + 1] interface db1ink module procedure :: db1ink_default end interface public :: db1ink contains pure subroutine db1ink_default(x) implicit none real(4), dimension(:), intent(in) :: x call check_inputs(x=x) end subroutine db1ink_default pure subroutine check_inputs(x, y) implicit none real(4), dimension(:), intent(in), optional :: x, y end subroutine check_inputs end module legacy_array_sections_07_module program legacy_array_sections_07 use legacy_array_sections_07_module implicit none real :: x(5), y(2) x = [1.0, 2.0, 3.0, 4.0, 5.0] y = [6.0, 7.0] call db1ink_default(x) print *, x if (any(x - [1.0, 2.0, 3.0, 4.0, 5.0] > 1e-6)) error stop call check_inputs(x, y) print *, y if (any(y - [6.0, 7.0] > 1e-6)) error stop end program legacy_array_sections_07lfortran-lfortran-2f73434/integration_tests/class_26.f900000664000175000017500000000040115141516316023327 0ustar alastairalastairprogram class_26 implicit none type :: other_type class(*), allocatable :: value integer :: val = 1 end type other_type type(other_type) :: other print * , other % val if (other % val /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_175.f900000664000175000017500000000051015141516316024475 0ustar alastairalastairprogram intrinsics_75 integer :: array(3, 4) logical :: mask(3, 4) integer :: s(1) array = reshape((/1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12/), shape(array)) mask = .true. mask(1, :) = .false. mask(3, 2) = .false. print *, pack(array, mask) s = shape(pack(array, mask)) print *, s if (s(1) /= 7) error stop contains end program lfortran-lfortran-2f73434/integration_tests/array_unbounded_02.f900000664000175000017500000000035715141516316025407 0ustar alastairalastairsubroutine sub(x) real :: x dimension :: x(1:*) x(1) = 4.39 end subroutine program array_unbounded_02 real :: y(10), w(10) call sub(y) print *, y(1) if (abs(y(1) - 4.39) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_01.f900000664000175000017500000000036115141516316023667 0ustar alastairalastairprogram complex_01 implicit none complex :: x = (1.0,-3.0) real, parameter :: a = 3.0, b = 4.0 complex :: y = (a, b) complex, parameter :: i_ = (0, 1) complex :: z = a + i_*b complex :: w = a+b + i_*(a-b) print *, x, y, z, w end program lfortran-lfortran-2f73434/integration_tests/class_24.f900000664000175000017500000000117015141516316023331 0ustar alastairalastairmodule class_24_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type contains subroutine test(self) class(base) :: self select type(self) type is (derived) if (self%m /= 10) error stop if (self%n /= 20) error stop end select end subroutine end module program class_24 use class_24_m implicit none class(base), allocatable :: b allocate(derived :: b) b = derived(10, 20) call test(b) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_321.f900000664000175000017500000000140415141516316024471 0ustar alastairalastairprogram intrinsics_241 character(9):: hello = " hello " character(7):: world = " world" character(6):: this = "this " character(4):: empty = " " character:: line = '' character(5), parameter :: hello1 = trim(" hello ") character(5), parameter :: world1 = trim(" world") character(4), parameter :: this1 = trim("this ") print*, hello1 if (hello1 /= " hel") error stop print*, world1 if (world1 /= " wor") error stop print*, this1 if (this1 /= "this") error stop print*, trim(hello) if (trim(hello) /= " hello") error stop print*, trim(world) if (trim(world) /= " world") error stop print*, trim(this) if (trim(this) /= "this") error stop print*, trim(empty) if (trim(empty) /= "") error stop print*, trim(line) if (trim(line) /= "") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_262.f900000664000175000017500000000233315141516316024477 0ustar alastairalastairprogram intrinsics_262 real, parameter :: a(4) = [11.012, -21.125, 31.210, -41.0] real, parameter :: b(4) = [33.9, 91.2, 37.4, 19.1] integer, parameter :: c(8) = floor([1.2, 3.3, 5.0, 6.8, -5.7, & -8.9, 0.0, -412.124]) integer, parameter :: array_size = 6 integer :: i integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) integer(kind=4) :: res_4_arr_2(8) integer :: expected(8) = [1, 3, 5, 6, -6, -9, 0, -413] print *, floor(a) if (any(floor(a) /= [11, -22, 31, -41])) error stop print *, floor(b) if (any(floor(b) /= [33, 91, 37, 19])) error stop do i = 1, size(c) print *, c(i) if (c(i) /= expected(i)) error stop end do res_4_arr = floor([real:: 1.2, 3.3, 5, 6.8, -5.7, -8.9]) print *, res_4_arr if (any(res_4_arr /= [1, 3, 5, 6, -6, -9])) error stop res_8_arr = floor([real(8) :: 1.2, 3.3, 5, 101.768, -121.321, 65.4], kind=8) print *, res_8_arr if (any(res_8_arr /= [1, 3, 5, 101, -122, 65])) error stop res_4_arr_2 = floor([1.2, 3.3, 5.0, 6.8, -5.7, -8.9, 0.0, -412.124], kind=4) print *, res_4_arr_2 if (any(res_4_arr_2 /= [1, 3, 5, 6, -6, -9, 0, -413])) error stop end program lfortran-lfortran-2f73434/integration_tests/equivalence_16.f900000664000175000017500000000126715141516316024535 0ustar alastairalastairprogram equivalence_16 ! Test EQUIVALENCE with -fdefault-integer-8 (ILP64 mode) ! Verifies descriptor fields use correct index type width implicit none integer :: iwork(10) double precision :: rwork(5) equivalence (iwork(1), rwork(1)) rwork(1) = 42.0d0 ! With ILP64, integer is 8 bytes, same as double precision. ! iwork(1) overlaps rwork(1) exactly, so reinterpreting the ! bit pattern of 42.0d0 as integer(8) must give 4631107791820423168. if (iwork(1) /= transfer(42.0d0, iwork(1))) error stop ! Write through integer view and verify via real view iwork(1) = transfer(99.0d0, iwork(1)) if (rwork(1) /= 99.0d0) error stop end program lfortran-lfortran-2f73434/integration_tests/enum_06.f900000664000175000017500000000023715141516316023173 0ustar alastairalastairmodule enum_06_mod_lower use enum_06_mod_middle end module program pp use enum_06_mod_lower print *, red if(red /= 100) error stop end programlfortran-lfortran-2f73434/integration_tests/array_op_08.f900000664000175000017500000000065715141516316024053 0ustar alastairalastairprogram test integer :: A(3) = [1,2,3] logical :: X(3) integer :: tol = 2 real :: A2(3) = [1.0,2.0,3.0] real :: tol2 = 2.0 integer :: i X = abs(A) <= max(tol, tol * maxval(abs(A))) print *, X do i = 1, 2, 3 if (X(i) .neqv. .true.) error stop end do X = abs(A2) <= max(tol2, tol2 * maxval(abs(A2))) print *, X do i = 1, 2, 3 if (X(i) .neqv. .true.) error stop end do end programlfortran-lfortran-2f73434/integration_tests/formatted_read_01.f900000664000175000017500000000151115141516316025176 0ustar alastairalastairprogram formatted_read_01 character(len=10) :: str1 character(len=15) :: str2 character(len=5) :: str3 character(len=10) :: str4 open(unit=10, file="formatted_read_input_01.txt", status="old") read(unit=10, fmt='(a10)') str1 if (trim(str1) /= "hello") then print *, "Error: str1 should be 'hello'" error stop 1 end if read(unit=10, fmt='(a10)') str2 if (trim(str2) /= "world") then print *, "Error: str2 should be 'world'" error stop 2 end if read(unit=10, fmt='(a10)') str3 if (trim(str3) /= "horty") then print *, "Error: str3 should be 'horty'" error stop 3 end if read(unit=10, fmt='(a5)') str4 if (trim(str4) /= "longe ") then print *, "Error: str4 should be 'longe'" error stop 4 end if close(10) print *, "All tests passed!" end program formatted_read_01lfortran-lfortran-2f73434/integration_tests/class_18.f900000664000175000017500000000430615141516316023340 0ustar alastairalastairmodule class_18_mod use iso_fortran_env implicit none type KeywordEnforcer end type KeywordEnforcer public :: Integer32Complex32Map public :: Integer32Complex32Pair type :: Integer32Complex32Pair integer(kind=INT32) :: first complex(kind=REAL32) :: second end type Integer32Complex32Pair type, abstract :: map_s_BaseNode end type map_s_BaseNode type, extends(map_s_BaseNode) :: map_s_Node type(map_s_Node), pointer :: parent => null() end type map_s_Node type :: map_Set private class(map_s_BaseNode), allocatable :: root contains procedure :: insert_single => map_s_insert_single generic :: insert => insert_single end type map_Set type :: Integer32Complex32Map private type(map_Set) :: tree contains procedure :: of => map_of end type Integer32Complex32Map contains subroutine map_s_insert_single(this, value, unused, is_new) class(map_Set), target, intent(inout) :: this type(Integer32Complex32Pair), intent(in) :: value integer, optional :: unused logical, optional, intent(out) :: is_new if (present(is_new)) then is_new = .true. end if if (present(unused)) then unused = 21 end if end subroutine map_s_insert_single subroutine map_of(this, key) class(Integer32Complex32Map), target, intent(inout) :: this integer(kind=INT32), intent(in) :: key type(Integer32Complex32Pair) :: p logical :: is_new1, is_new2, is_new3 integer :: unused1, unused2, unused3 p%first= key call this%tree%insert(p, is_new=is_new1) if (is_new1 .eqv. .false.) error stop call this%tree%insert(p, unused=unused1) if (unused1 /= 21) error stop call this%tree%insert(p, is_new=is_new2, unused=unused2) if (is_new2 .eqv. .false.) error stop if (unused2 /= 21) error stop call this%tree%insert(p, unused=unused3, is_new=is_new3) if (is_new3 .eqv. .false.) error stop if (unused3 /= 21) error stop end subroutine map_of end module class_18_mod program class_18 use class_18_mod implicit none type(Integer32Complex32Map) :: m call m%of(42) end program lfortran-lfortran-2f73434/integration_tests/arrays_01.f900000664000175000017500000000102715141516316023521 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) do i = 1, 3 a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 14 b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, 3 b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop end lfortran-lfortran-2f73434/integration_tests/list_test_01.f900000664000175000017500000000442115141516316024233 0ustar alastairalastairprogram lp_list_test_01 implicit none integer :: x real :: eps = 1e-6 _lfortran_list(integer) :: test_list call _lfortran_list_append(test_list, 1) call _lfortran_list_append(test_list, 10) x = _lfortran_len(test_list) if (x /= 2) error stop if (_lfortran_get_item(test_list, 1) /= 10) error stop test_list = _lfortran_list_constant(1, 2, 3, 4) if (_lfortran_get_item(test_list, 1) /= 2) error stop if (_lfortran_get_item(test_list, 2) /= 3) error stop if (_lfortran_len(test_list) /= 4) error stop call _lfortran_set_item(test_list, 0, 10) if (_lfortran_get_item(test_list, 0) /= 10) error stop call _lfortran_list_append(test_list, -50) if (_lfortran_len(test_list) /= 5) error stop call _lfortran_list_reverse(test_list) if (_lfortran_len(test_list) /= 5) error stop if (_lfortran_get_item(test_list, 0) /= -50) error stop if (_lfortran_get_item(test_list, 3) /= 2) error stop if (_lfortran_get_item(test_list, 4) /= 10) error stop call _lfortran_list_append(test_list, 1) call _lfortran_list_append(test_list, 1) if (_lfortran_list_count(test_list, 1) /= 2) error stop if (_lfortran_list_count(test_list, -50) /= 1) error stop test_list = _lfortran_concat(test_list, _lfortran_list_constant(1, 1, 1, 2)) if (_lfortran_len(test_list) /= 11) error stop if (_lfortran_pop(test_list, 0) /= -50) error stop if (_lfortran_len(test_list) /= 10) error stop type(_lfortran_list(real(4))) :: test_list_r = _lfortran_list_constant(1.0, 2.0, 3.0, 4.0) if (_lfortran_len(test_list_r) /= 4) error stop call _lfortran_list_append(test_list_r, 1.11) call _lfortran_list_append(test_list_r, -10.12) call _lfortran_list_append(test_list_r, 12.0) call _lfortran_list_append(test_list_r, -111.0) call _lfortran_list_append(test_list_r, -110.12) if (_lfortran_len(test_list_r) /= 9) error stop if (abs(_lfortran_get_item(test_list_r, 5) + 10.12) > eps) error stop if (abs(_lfortran_get_item(test_list_r, 6) - 12.0) > eps) error stop call _lfortran_set_item(test_list_r, 3, 1212.33) if (abs(_lfortran_get_item(test_list_r, 3) - 1212.33) > eps) error stop type(_lfortran_list(real)) :: test_list_r1 if (_lfortran_len(test_list_r1) /= 0) error stop ! Add other intrinsics later end program lfortran-lfortran-2f73434/integration_tests/arrays_36.f900000664000175000017500000000055715141516316023540 0ustar alastairalastairprogram arrays_36 use iso_fortran_env, only: int16 integer(int16), allocatable :: result(:) integer(int16) :: start_, end_, step_ integer(int16) :: i allocate(result(10)) start_ = 1_int16 end_ = 10_int16 result = [(i, i=start_, end_)] print *, result i = 1_int16 do while (i <= 10_int16) if (result(i) /= i) error stop i = i + 1_int16 end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_41.f900000664000175000017500000000017315141516316024412 0ustar alastairalastairprogram intrinsics_41 implicit none integer :: cnt cnt = command_argument_count() print *, cnt end program lfortran-lfortran-2f73434/integration_tests/modules_20b.f900000664000175000017500000000060715141516316024036 0ustar alastairalastairmodule modules_20b implicit none integer, public, parameter :: tfc = selected_char_kind('DEFAULT') type t character(len=1, kind=tfc) :: newline = achar(10, kind=tfc) end type t contains subroutine trim2(x) character(len=*),intent(in) :: x integer :: len_trim len_trim = 1 print *, len_trim, trim(x) end subroutine end module lfortran-lfortran-2f73434/integration_tests/allocatable_component_struct_array_01.f900000664000175000017500000000150615141516316031351 0ustar alastairalastairmodule pkg_mod implicit none type :: variant_t integer, allocatable :: executable(:) end type variant_t contains subroutine temp_func(src) type(variant_t), intent(in) :: src if (.not. allocated(src%executable)) error stop "expected allocated" end subroutine temp_func end module pkg_mod program allocatable_component_struct_array_01 use pkg_mod implicit none type(variant_t) :: variants_array(2) integer :: j allocate(variants_array(1)%executable(1)) variants_array(1)%executable(1) = 1 call temp_func(variants_array(1)) if (allocated(variants_array(2)%executable)) error stop "expected unallocated" do j = 1, size(variants_array) if (allocated(variants_array(j)%executable) .neqv. (j == 1)) error stop "allocation mismatch" end do end program allocatable_component_struct_array_01 lfortran-lfortran-2f73434/integration_tests/external_02.f900000664000175000017500000000020315141516316024036 0ustar alastairalastairsubroutine cdfpoi() implicit none external cumpoi return end subroutine program external_02 call cdfpoi() end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_10.f900000664000175000017500000000044515141516316026574 0ustar alastairalastairprogram legacy_array_sections_10 implicit none real, allocatable :: a(:) allocate(a(4)) a = [1.0, 2.0, 3.0, 4.0] call foo(a) call foo(a(2)) if (abs(a(1) - 11.0) > 1e-6) error stop if (abs(a(2) - 12.0) > 1e-6) error stop end program legacy_array_sections_10 lfortran-lfortran-2f73434/integration_tests/allocate_27.f900000664000175000017500000000053415141516316024016 0ustar alastairalastairprogram allocate_26 implicit none character(:), allocatable :: temp_file allocate(temp_file, source=get_temp_filename()) if (temp_file /= "tmp_12345.txt") error stop contains function get_temp_filename() result(fname) character(len=:), allocatable :: fname fname = "tmp_12345.txt" end function get_temp_filename end program allocate_26lfortran-lfortran-2f73434/integration_tests/class_38.f900000664000175000017500000000111315141516316023333 0ustar alastairalastairprogram class_38 type :: regex_token character(len=:), allocatable :: ccl end type regex_token type :: regex_pattern type(regex_token), dimension(2) :: pattern end type regex_pattern type(regex_pattern) :: my_pattern call temp(my_pattern%pattern) if (my_pattern%pattern(1)%ccl /= 'abc' .or. my_pattern%pattern(2)%ccl /= 'def') error stop contains subroutine temp(pattern) type(regex_token), dimension(:), intent(out) :: pattern pattern(1)%ccl = 'abc' pattern(2)%ccl = 'def' end subroutine temp end program lfortran-lfortran-2f73434/integration_tests/test_iso_c_binding.f900000664000175000017500000000051315141516316025544 0ustar alastairalastairprogram test_iso_c_binding use iso_c_binding, only: c_long, c_long_long, c_float, c_double implicit none real(c_float) :: r4 real(c_double) :: r8 integer(c_long) :: i4 integer(c_long_long) :: i8 !if (kind(r4) /= 4) error stop !if (kind(r8) /= 8) error stop !if (kind(i4) /= 4) error stop !if (kind(i8) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_14.f900000664000175000017500000000042115141516316024005 0ustar alastairalastairprogram allocate_14 implicit none type string character(:), allocatable :: str end type string type(string), allocatable :: inputs(:) inputs = [string("123"), string("456")] if ( inputs(2)%str /= "456" ) error stop end program allocate_14 lfortran-lfortran-2f73434/integration_tests/class_22.f900000664000175000017500000000143415141516316023332 0ustar alastairalastairmodule class_22_m implicit none private public :: inner_class, cast_integer, expect_pointer ! Define the inner class with some integer data type :: inner_class integer :: value end type inner_class contains function cast_integer(obj) result(x) class(inner_class), intent(in), allocatable :: obj logical :: x x = .true. end function cast_integer subroutine expect_pointer(x) type(inner_class), pointer, intent(in) :: x if (x%value /= 50) error stop end subroutine expect_pointer end module class_22_m program class_22 use class_22_m implicit none class(inner_class), allocatable :: inner_obj type(inner_class), target :: x x%value = 50 if (cast_integer(inner_obj) .neqv. .true.) error stop call expect_pointer(x) end program class_22 lfortran-lfortran-2f73434/integration_tests/derived_types_94.f900000664000175000017500000000151515141516316025104 0ustar alastairalastair! Test casting an array from C-Struct Type INTO Fortran Class {VTable +CStruct} program derived_types_94 implicit none type :: tt integer :: n end type tt type(tt), allocatable :: arr(:) allocate(arr(4)) arr(1)%n = 1 arr(2)%n = 2 arr(3)%n = 3 arr(4)%n = 4 call foo(arr) call foo2(arr) contains subroutine foo(arg) class(tt), intent(in) :: arg(:) integer :: i do i = 1, size(arg) write(*,*) "Package Name: ", arg(i)%n if(arg(i)%n /= i) error stop end do end subroutine subroutine foo2(arg) class(tt), intent(in) :: arg(4) integer :: i do i = 1, size(arg) write(*,*) "Package Name: ", arg(i)%n if(arg(i)%n /= i) error stop end do end subroutine end programlfortran-lfortran-2f73434/integration_tests/intrinsics_167.f900000664000175000017500000000333415141516316024505 0ustar alastairalastairprogram intrinsics_167 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 logical, parameter :: i1 = btest(5, 8) logical, parameter :: i2 = btest(-1_8, 5) logical, parameter :: i3 = btest(-4, 2_8) logical, parameter :: i4 = btest(-2_8, 5_8) logical, parameter :: ar1(3) = btest([5, 8, 9], [8, 5, 2]) logical(8), parameter :: ar2(3) = btest([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) logical :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 .neqv. .false.) error stop print *, i2 if (i2 .neqv. .true.) error stop print *, i3 if (i3 .neqv. .true.) error stop print *, i4 if (i4 .neqv. .true.) error stop print*, btest(5, 8) if (btest(5, 8) .neqv. .false.) error stop print*, btest(-1, 5) if (btest(-1, 5) .neqv. .true.) error stop print*, btest(a1, a2) if (btest(a1, a2) .neqv. .false.) error stop print*, btest(a3, a1) if (btest(a3, a1) .neqv. .true.) error stop print*, btest(a2, a4) if (btest(a2, a4) .neqv. .false.) error stop print*, btest(a5, a6) if (btest(a5, a6) .neqv. .true.) error stop print *, ar1 if (any(ar1 .neqv. [.false., .false., .false.])) error stop print *, ar2 if (any(ar2 .neqv. [.true., .true., .true.])) error stop print *, btest(arr1, arr1) if (any(btest(arr1, arr1) .neqv. [.false., .false., .false.])) error stop print *, btest(arr2, arr1) if (any(btest(arr2, arr1) .neqv. [.true., .true., .true.])) error stop res = btest(arr1, arr3) print *, res if (any(res .neqv. [.false., .false., .false.])) error stop end program lfortran-lfortran-2f73434/integration_tests/struct_type_04.f900000664000175000017500000000037615141516316024616 0ustar alastairalastairprogram struct_type_04 implicit none type :: stone integer :: value = 2 end type stone type(stone),dimension(:),allocatable :: s allocate(s(2)) print* , s%value print* , sum(s%value) if (sum(s%value) /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/global_array_01.f900000664000175000017500000000110015141516316024646 0ustar alastairalastairmodule global_array_module implicit none integer(4), dimension(2) :: arr = [105, 109] end module global_array_module program test_global_array use global_array_module, only: arr implicit none integer :: i integer :: s i = 1 print *, arr if (all(arr /= [105, 109])) error stop s = sum(arr) print *, s if (s /= 214) error stop print *, arr(i) if (arr(i) /= 105) error stop arr(i) = 210 print *, arr(i) if (arr(i) /= 210) error stop print *, arr if (all(arr /= [210, 109])) error stop end program test_global_array lfortran-lfortran-2f73434/integration_tests/class_04.f900000664000175000017500000000133715141516316023334 0ustar alastairalastairprogram main implicit none type :: bar_a integer :: a end type bar_a type :: foo_a type(bar_a) :: m_bar_a end type foo_a type, extends(bar_a) :: bar_b integer :: b end type bar_b type, extends(bar_b) :: bar_c integer :: c end type bar_c type, extends(foo_a) :: foo_b type(bar_b) :: m_bar_b end type foo_b type, extends(foo_b) :: foo_c type(bar_c) :: m_bar_c end type foo_c type(foo_c) :: foo foo%m_bar_a%a = -20 foo%m_bar_b%b = 9 foo%m_bar_c%c = 11 print *, foo%m_bar_a%a print *, foo%m_bar_b%b print *, foo%m_bar_c%c if( foo%m_bar_a%a + foo%m_bar_b%b + foo%m_bar_c%c /= 0 ) error stop end program mainlfortran-lfortran-2f73434/integration_tests/arrays_op_4.f900000664000175000017500000000307315141516316024145 0ustar alastairalastairprogram array_op_3 implicit none logical, allocatable :: a(:, :, :), b(:, :, :) logical, allocatable :: c(:, :, :) integer :: i, j, k, dim1 = 10, dim2 = 100, dim3 = 1 allocate(a(dim1, dim2, dim3), b(dim1, dim2, dim3), c(dim1, dim2, dim3)) do i = 1, dim1 do j = 1, dim2 do k = 1, dim3 a(i, j, k) = modulo2(i + j + k) b(i, j, k) = modulo2(i*j + j*k + k*j) end do end do end do c = a .and. b call verify(c, 0) c = a .or. b call verify(c, 1) c = a .eqv. b call verify(c, 2) c = b .neqv. a call verify(c, 3) contains logical function modulo2(x) result(r) integer, intent(in) :: x r = (x - 2*(x/2) == 1) end function modulo2 subroutine verify(c, op_code) implicit none logical, allocatable, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k logical :: x, y do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) x = modulo2(i + j + k) y = modulo2(i*j + j*k + k*j) select case(op_code) case (0) if(c(i, j, k) .neqv. (x .and. y)) error stop case (1) if(c(i, j, k) .neqv. (x .or. y)) error stop case (2) if(c(i, j, k) .neqv. (x .eqv. y)) error stop case (3) if(c(i, j, k) .neqv. (x .neqv. y)) error stop end select end do end do end do end subroutine verify end programlfortran-lfortran-2f73434/integration_tests/openmp_36.f900000664000175000017500000000020315141516316023521 0ustar alastairalastairprogram openmp_36 integer :: i, j, res = 0 do concurrent ( i =1:5, j = 1:3 ) res = res + i * j end do print *, res end programlfortran-lfortran-2f73434/integration_tests/dealloc_02.f900000664000175000017500000000034515141516316023626 0ustar alastairalastairprogram alloc_of_alloc_bug implicit none type :: et character(len=:), allocatable :: message end type type(et), allocatable :: e e = f() contains type(et) function f() f%message = "x" end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_356.f900000664000175000017500000000046715141516316024511 0ustar alastairalastairprogram intrinsics_356 implicit none integer :: m real :: A(3) m = 3 A = rand1(m) contains impure function rand1(m) result(x) implicit none integer, intent(in) :: m real :: x(max(m, 0)) call random_number(harvest=x) end function end programlfortran-lfortran-2f73434/integration_tests/intrinsics_360.f900000664000175000017500000000104215141516316024472 0ustar alastairalastairprogram intrinsics_360 implicit none real(8), dimension(2) :: dc_r = [1.3, 2.3] real :: x_r = 1.3 integer, dimension(2) :: dc_i = [1, 2] integer(8) :: x_i = 2 print *, findloc(dc_r, x_r) if (any(findloc(dc_r, x_r) /= 1)) error stop print *, findloc(dc_i, x_i) if (any(findloc(dc_i, x_i) /= 2)) error stop print *, findloc(dc_r, x_i) if (any(findloc(dc_r, x_i) /= 0)) error stop print *, findloc(dc_i, x_r) if (any(findloc(dc_i, x_r) /= 1)) error stop end program intrinsics_360 lfortran-lfortran-2f73434/integration_tests/arrays_100.f900000664000175000017500000000036015141516316023600 0ustar alastairalastairmodule arrays_100_mod character :: arr(3) = ['a', 'b', 'c'] end module program arrays_100 use arrays_100_mod if (arr(1) /= 'a') error stop if (arr(2) /= 'b') error stop if (arr(3) /= 'c') error stop print *, "All tests passed" end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_16.f900000664000175000017500000000224015141516316026450 0ustar alastairalastairmodule operator_overloading_16_mod implicit none type, abstract :: base contains procedure(is_equal_ifc), deferred :: is_equal generic :: operator(==) => is_equal end type base abstract interface logical function is_equal_ifc(a, b) import :: base class(base), intent(in) :: a, b end function is_equal_ifc end interface type, extends(base) :: derived_1 integer :: val character(len=:), allocatable :: str contains procedure :: is_equal => d1_equal end type derived_1 contains logical function d1_equal(a, b) class(derived_1), intent(in) :: a class(base), intent(in) :: b select type(b) type is (derived_1) d1_equal = a%val == b%val class default d1_equal = .false. end select end function d1_equal end module operator_overloading_16_mod program operator_overloading_16 use operator_overloading_16_mod implicit none type(derived_1) :: x, y logical :: res x%val = 42 y%val = 41 x%str = "Hello" y%str = "World" res = x == y if (res) error stop y%str = "Hello" y%val = 42 res = x == y if (.not. res) error stop end program operator_overloading_16 lfortran-lfortran-2f73434/integration_tests/read_33.f900000664000175000017500000000062715141516316023145 0ustar alastairalastairprogram read_33 implicit none integer :: ivi, jvi integer :: i1i(5) open(10, file='read_33.txt', status='replace') write(10, '(6I5)') 3, 10, 20, 30, 0, 0 close(10) open(10, file='read_33.txt', status='old') read(10, '(100I5)') ivi, (i1i(jvi), jvi=1,ivi) close(10, status='delete') if (ivi /= 3 .or. any(i1i(1:3) /= [10, 20, 30])) error stop end program read_33lfortran-lfortran-2f73434/integration_tests/data_11.f900000664000175000017500000000072715141516316023140 0ustar alastairalastairSUBROUTINE DKBVRC() INTEGER PLIM, KLIM PARAMETER ( PLIM = 28, KLIM = 100 ) INTEGER P(PLIM), C(PLIM,KLIM-1) DATA P( 1),(C( 1,I),I = 1,99)/ 31, 12, 2*9, 13, 8*12, 3*3, 12, & 2*7, 9*12, 3*3, 12, 2*7, 9*12, 3*3, 12, 2*7, 9*12, 3*3, 12, 2*7, & 8*12, 7, 3*3, 3*7, 21*3/ if( P( 1) /= 31 ) error stop if( C( 1, 1) /= 12 ) error stop if( C( 1, 2) /= 9 ) error stop if( C( 1, 99) /= 3 ) error stop END program main call DKBVRC() endlfortran-lfortran-2f73434/integration_tests/modules_30_module2.f900000664000175000017500000000213015141516316025315 0ustar alastairalastairmodule fpm_manifest_dependency_modules_30 use fpm_git_modules_30, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency_modules_30 lfortran-lfortran-2f73434/integration_tests/string_78.f900000664000175000017500000000170115141516316023543 0ustar alastairalastair! Test is specially made to handle the nesting of the concatenation operator ! as it could lead to performance issues if not handled properly. program string_78 character(:), allocatable :: ss character(10) :: str str = "HELLOWORLD" allocate(character(300) :: ss) ss = str // str // str // str // str // str // str // str // str //& & str // str // str // str // str // str // str // str //& & str // str // str // str // str // str // str // str // str // str // str // str // str print *, ss !! HELLOWROLD * 30 if(ss /= & &"HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD& &HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD& &HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLD") error stop end programlfortran-lfortran-2f73434/integration_tests/read_27.f900000664000175000017500000000047215141516316023146 0ustar alastairalastairprogram read_nan_string use, intrinsic :: ieee_arithmetic, only: ieee_is_nan implicit none character(len=3) :: nan_string real :: valu nan_string = 'NaN' read(nan_string, '(f3.3)') valu if (.not. ieee_is_nan(valu)) error stop "wrong value read" print *, 'test passed!' end program read_nan_stringlfortran-lfortran-2f73434/integration_tests/separate_compilation_19.f900000664000175000017500000000041015141516316026426 0ustar alastairalastairprogram separate_compilation_19 use mod_separate_compilation_19, only : open_hashmap_type implicit none type(open_hashmap_type) :: map integer :: key = 1 call map % map_entry( key ) print *, key if (key /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/implicit_interface_21.f900000664000175000017500000000212315141516316026052 0ustar alastairalastair! Test sequence association: passing array element D(1,J) to assumed-size dummy ! This pattern is common in legacy Fortran (e.g., LAPACK) where a 2D array column ! is passed by referencing its first element: CALL SUB(A(1, N), M) ! The callee receives a pointer to A(1,N) and accesses subsequent elements. subroutine print_sum(arr, n) implicit none real, intent(in) :: arr(*) integer, intent(in) :: n real :: s integer :: j s = 0.0 do j = 1, n s = s + arr(j) end do if (abs(s - 50.0) > 1.0e-5) error stop end subroutine program implicit_interface_21 implicit none real :: d(4, 3) integer :: i ! Initialize: column 1 = 1,2,3,4; column 2 = 11,12,13,14; column 3 = 21,22,23,24 do i = 1, 4 d(i, 1) = real(i) d(i, 2) = real(i + 10) d(i, 3) = real(i + 20) end do ! Pass D(1, 2) as start of column 2 to assumed-size dummy ! Sequence association: the subroutine sees arr(1)=11, arr(2)=12, arr(3)=13, arr(4)=14 ! Sum should be 11+12+13+14 = 50 call print_sum(d(1, 2), 4) print *, "PASSED" end program lfortran-lfortran-2f73434/integration_tests/modules_57.f900000664000175000017500000000031215141516316023677 0ustar alastairalastairmodule module_modules_57 complex :: c = (3.0, 4.0) end module module_modules_57 program modules_57 use module_modules_57 print *, abs(c) if (abs(abs(c) - 5.0) > 1e-8) error stop end program modules_57 lfortran-lfortran-2f73434/integration_tests/openmp_07.f900000664000175000017500000000121615141516316023524 0ustar alastairalastairsubroutine static_counter(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * 1 end do !$omp end do ! the following condition shall be true almost always if (local_ctr > ( n / omp_get_max_threads()) + 5) error stop !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_07 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call static_counter(n, ctr) print *, ctr if (ctr /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_34.f900000664000175000017500000000132615141516316025076 0ustar alastairalastairmodule derived_types_34_my_mod type :: my_type sequence integer :: a end type interface read(formatted) module procedure :: read_formatted end interface contains subroutine read_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(inout) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg mt%a = 125 end subroutine end module program derived_types_34 use derived_types_34_my_mod, only: my_type, read(formatted) implicit none print *, "Ok" end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops3.f900000664000175000017500000000077615141516316025336 0ustar alastairalastairprogram implied_do_loop3 integer::i,j,k real:: a(3) = (/(j*3,j=1,3)/) real:: b(3) = (/(j*2,j=1,3)/) ! implied do loop print *,"Loop 1" print *, ( i, ( i*j, j = 1, 3), i = 1, 3) ! nested implied do loop (double) print *,"Loop 2" print*, ((a(i)*b(j), j=1, 2), i=1, 3) print *,"Loop 3" print*, ((a(i)*b(j), i=1, 3), j=1, 2) ! nested implied do loop (triple) print *,"Loop4" print*, (i,(i+j,(i+j+k,k=1,4),j=1,2),i=1,3) print *,"Loop5" print*, (i,(i*j,((i*j)+k,k=1,4),j=1,2),i=1,3) end programlfortran-lfortran-2f73434/integration_tests/class_21.f900000664000175000017500000000176215141516316023335 0ustar alastairalastairmodule class_21_mod type :: val_type integer :: origin = 3 end type end module program class_21 use class_21_mod integer :: stat class(val_type), allocatable :: val class(val_type), pointer :: val2 logical :: temp = .false. type(val_type), parameter :: val_par = val_type() type(val_type) :: tmp allocate(val) stat = merge(val%origin, stat, .true.) tmp = val_type(merge(val%origin - 1, stat, any([stat, val%origin] /= 0))) if (stat /= 3) error stop stat = merge(val_par%origin, stat - 1, temp) if (stat /= 2) error stop if (tmp%origin /= 2) error stop call sub1() call sub3(val2) if (val2%origin /= 2) error stop contains subroutine sub1() call sub2(val_par%origin) end subroutine subroutine sub2(x) integer :: x if (x /= 3) error stop end subroutine subroutine sub3(x) class(val_type), pointer :: x allocate(x) x%origin = 2 end subroutine end program lfortran-lfortran-2f73434/integration_tests/interface_10.f900000664000175000017500000000060115141516316024155 0ustar alastairalastairmodule interface_10_m interface chars module procedure identity end interface contains subroutine identity(x, y) character, intent(in) :: x character(kind=1), intent(out) :: y y = x end subroutine end module program interface_10 use interface_10_m character :: x, y x = 'A' call chars(x, y) print *, x end program lfortran-lfortran-2f73434/integration_tests/format_09.f900000664000175000017500000000073015141516316023520 0ustar alastairalastairprogram format_09 implicit none integer :: a(5),b(5),c(10) integer, parameter :: dp=kind(0d0) real(dp) :: d(5) a = [117,123,124,126,129] b = [1,2,3,4,5] c = 1 d = [1._dp,1._dp,1._dp,1._dp,1._dp] print '(6(i6))', c print 10, "hello", a ,"world", b 10 format(a,i10,i4,i5,i6,i7) print 20, 'String:', 3.1415926d0, & 'Integer:', 42, & 'Array:', d 20 format(5x,a,d15.7//,5x,a,16x,i10//,5x,a//(5x,3d15.7)) end program lfortran-lfortran-2f73434/integration_tests/format_10.f900000664000175000017500000000045715141516316023516 0ustar alastairalastairprogram format_10 implicit none integer :: n, i integer, parameter :: grid_size = 3 real :: h(grid_size) character(*), parameter :: fmt = '(i0,*(1x,es15.8e2))' h = 1 n = 3 print fmt, n, h do i = 1, grid_size if (abs(h(i) - 1.0) > 1e-9) error stop end do if (n /= 3) error stop end program format_10 lfortran-lfortran-2f73434/integration_tests/enum_05.f900000664000175000017500000000062215141516316023170 0ustar alastairalastairprogram enum_05 implicit none integer :: enum_var1, enum_var2 enum, bind(c) enumerator :: CAPS_and_small = 50 enumerator :: all_small = 100 end enum ! Assign enum values to variables enum_var1 = all_small enum_var2 = CAPS_and_small print *, enum_var1, enum_var2 if (enum_var1 /= 100) error stop if (enum_var2 /= 50) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_310.f900000664000175000017500000000132115141516316024465 0ustar alastairalastairprogram intrinsics_310 use iso_fortran_env, only: int8, int16, int32, int64, real32, real64 implicit none integer(int8), parameter :: i1 = digits(127_int8) integer(int16), parameter :: i2 = digits(32_int16) integer(int32), parameter :: i4 = digits(21_int32) integer(int64), parameter :: i8 = digits(9223_int64) integer, parameter :: r4 = digits(1.0_real32) integer, parameter :: r8 = digits(1.0_real64) print *, i1 if (i1 /= 7) error stop print *, i2 if (i2 /= 15) error stop print *, i4 if (i4 /= 31) error stop print *, i8 if (i8 /= 63) error stop print *, r4 if (r4 /= 24) error stop print *, r8 if (r8 /= 53) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_07b.f900000664000175000017500000000130015141516316026564 0ustar alastairalastairmodule separate_compilation_07b_mpi implicit none interface MPI_Init module procedure MPI_Init_proc end interface MPI_Init contains subroutine MPI_Init_proc(ierr) use separate_compilation_07a_mpi_c_bindings, only: c_mpi_init use iso_c_binding, only : c_int integer, optional, intent(out) :: ierr integer :: local_ierr if (present(ierr)) then call c_mpi_init(ierr) else call c_mpi_init(local_ierr) if (local_ierr /= 5) then print *, "MPI_Init failed with error code: ", local_ierr end if end if end subroutine end module separate_compilation_07b_mpi lfortran-lfortran-2f73434/integration_tests/modules_19.f900000664000175000017500000000125715141516316023706 0ustar alastairalastairprogram modules_19 use modules_19b implicit none character(*), parameter :: s1 = " A B ", s2 = " " if (len_trim(s1) /= 4) error stop if (len_trim(s2) /= 0) error stop if (len_trim(" ") /= 0) error stop if (len_trim("") /= 0) error stop if (len_trim("xx") /= 2) error stop if (trim(s1) /= " A B") error stop if (trim(s2) /= "") error stop if (trim(" ") /= "") error stop if (trim("") /= "") error stop if (trim("xx") /= "xx") error stop if (len(trim(s1)) /= 4) error stop if (len(trim(s2)) /= 0) error stop if (len(trim(" ")) /= 0) error stop if (len(trim("")) /= 0) error stop if (len(trim("xx")) /= 2) error stop print *, trim("xx ") print *, len(trim("xx ")) end program lfortran-lfortran-2f73434/integration_tests/equivalence_14.f900000664000175000017500000000214115141516316024523 0ustar alastairalastairprogram equivalence_14 implicit none call log_equiv() call comp_equiv_8913() contains subroutine log_equiv() logical :: la(2) logical :: l1 equivalence (la(1), l1) l1 = .true. la(2) = .false. if (.not. la(1)) error stop "la(1) should be true (equivalenced to l1)" if (.not. l1) error stop "l1 should be true" if (la(2)) error stop "la(2) should be false" la(1) = .false. if (l1) error stop "l1 should be false after la(1) change" end subroutine subroutine comp_equiv_8913() implicit none complex :: c1 real :: r1(6) equivalence (c1, r1(1)) r1 = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] if (abs(real(c1) - 1.0) > 1e-6) error stop "real(c1) should be 1.0" if (abs(aimag(c1) - 2.0) > 1e-6) error stop "aimag(c1) should be 2.0" c1 = (7.0, 8.0) if (abs(r1(1) - 7.0) > 1e-6) error stop "r1(1) should be 7.0 after c1 change" if (abs(r1(2) - 8.0) > 1e-6) error stop "r1(2) should be 8.0 after c1 change" if (abs(r1(3) - 3.0) > 1e-6) error stop "r1(3) should still be 3.0" end subroutine end program equivalence_14 lfortran-lfortran-2f73434/integration_tests/case_05.f900000664000175000017500000000074215141516316023142 0ustar alastairalastairprogram case_05 implicit none ! local variable declaration character :: grade = 'B' select case (grade) case ('A') print*, "Excellent!" case ('B') case ('C') print*, "Well done" case ('D') print*, "You passed" case ('F') print*, "Better try again" case default print*, "Invalid grade" end select print*, "Your grade is ", grade end program case_05lfortran-lfortran-2f73434/integration_tests/intrinsics_156.f900000664000175000017500000000443215141516316024503 0ustar alastairalastairprogram intrinsics_156 logical, parameter :: l1 = blt(10, 5) logical, parameter :: l2 = blt(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: f = .false. logical, parameter :: ar1(4) = blt([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = blt([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .false.) error stop print *, l2 if (l2 .neqv. .true.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, blt(10, 5) if (blt(10, 5) .neqv. .false.) error stop print*, blt(-5, 10) if (blt(-5, 10) .neqv. .false.) error stop print*, blt(-5, 5) if (blt(-5, 5) .neqv. .false.) error stop print*, blt(-5, -15) if (blt(-5, -15) .neqv. .false.) error stop print*, blt(5, 15) if (blt(5, 15) .neqv. .true.) error stop print*, blt(5, -15) if (blt(5, -15) .neqv. .true.) error stop print*, blt(0, -5) if (blt(0, -5) .neqv. .true.) error stop print*, blt(0, 5) if (blt(0, 5) .neqv. .true.) error stop print*, blt(-5, 0) if (blt(-5, 0) .neqv. .false.) error stop print*, blt(5, 0) if (blt(5, 0) .neqv. f) error stop print*, blt(k1, k2) if (blt(k1, k2) .neqv. .false.) error stop print*, blt(k3, k1) if (blt(k3, k1) .neqv. .false.) error stop print*, blt(k3, k3) if (blt(k3, k3) .neqv. .false.) error stop print*, blt(k3, k6) if (blt(k3, k6) .neqv. .false.) error stop print*, blt(k2, k4) if (blt(k2, k4) .neqv. .true.) error stop print*, blt(k2, k6) if (blt(k2, k6) .neqv. .true.) error stop print*, blt(k5, k3) if (blt(k5, k3) .neqv. .true.) error stop print*, blt(k5, k2) if (blt(k5, k2) .neqv. .true.) error stop print*, blt(k3, k5) if (blt(k3, k5) .neqv. .false.) error stop print*, blt(k2, k5) if (blt(k2, k5) .neqv. f) error stop print *, blt(arr1, 5) if (any(blt(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = blt(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .true.) error stop end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_04.f900000664000175000017500000000023215141516316026571 0ustar alastairalastairprogram legacy_array_sections_04 real :: afb(4) external :: sub afb = [ 1., 2., 3., 4. ] call sub(afb( 2 )) call sub(afb) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_165.f900000664000175000017500000000076515141516316024510 0ustar alastairalastairfunction temp(x, dim) result(res) real, intent(in) :: x(:) integer, intent(in) :: dim real :: res res = sum(x, 1) end function program intrinsics_165 real :: a(4) interface function temp(x, dim) result(res) real, intent(in) :: x(:) integer, intent(in) :: dim real :: res end function end interface a = [1.0, 2.0, 3.0, 4.0] print *, temp(a, 1) if (abs(temp(a, 1) - sum(a, 1)) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_331.f900000664000175000017500000000151715141516316024477 0ustar alastairalastairsubroutine shift_allocatable_array () real(4), dimension(:), allocatable :: dc allocate (dc(2)) dc = [1, 2] print *, cshift(dc,-1) deallocate(dc) return end program intrinsics_331 implicit none real :: arr1(2) = [1., 2.] real :: arr2(2) call shift_elemements(2, arr1, arr2) print *, arr2 if (any(arr2 /= [2., 1.])) error stop ! TODO: this causes segmentation fault currently ! call shift_allocatable_array() contains ! shifts the elements present in 'in_arr' by one index ! and outputs it in 'out_arr' subroutine shift_elemements(nc, in_arr, out_arr) implicit none integer, intent(in) :: nc real, dimension(nc), intent(in) :: in_arr real, dimension(nc), intent(out) :: out_arr out_arr = cshift(in_arr, shift=1) end end program lfortran-lfortran-2f73434/integration_tests/string_65.f900000664000175000017500000000111615141516316023537 0ustar alastairalastairmodule string_65_mod contains function foo(probs) result(ret) logical :: ret character(len=64), intent(in), optional :: probs(:) if(present(probs)) then ret = all(probs == "HelloWorld!") else ret = .false. end if end function end module program test use string_65_mod character(64) :: char_arr(10) if(foo() .neqv. .false.) error stop char_arr = "HelloWorld!" if(foo(char_arr) .neqv. .true.) error stop char_arr = "whatever" if(foo(char_arr) .neqv. .false.) error stop end program testlfortran-lfortran-2f73434/integration_tests/procedure_20.f900000664000175000017500000000237215141516316024215 0ustar alastairalastairmodule procedure_20_mod1 implicit none public cauchy interface cauchy module procedure cauchy_sngl end interface cauchy contains subroutine cauchy_sngl(f, i) interface function f(z) result(r) integer r complex, intent(in) :: z end function f end interface integer, intent(out) :: i integer, parameter :: n = 2 i = n * f((1, 2)) end subroutine cauchy_sngl end module procedure_20_mod1 module procedure_20_mod2 use procedure_20_mod1 implicit none contains subroutine wind0_sngl(i, f) interface function f(z) result(r) integer r complex, intent(in) :: z end function f end interface integer, intent(out) :: i call cauchy(f, i) end subroutine wind0_sngl end module procedure_20_mod2 program procedure_20 use procedure_20_mod2 implicit none integer :: i call wind0_sngl(i, test_function) print *, "i: ", i if (i /= 10) error stop contains function test_function(z) result(r) complex, intent(in) :: z integer :: r r = 5 end function test_function end program procedure_20 lfortran-lfortran-2f73434/integration_tests/string_50.f900000664000175000017500000000047115141516316023534 0ustar alastairalastair! Test using kind=8 with character allocation program string_50 character(:), allocatable :: ret integer(8) :: i i = 10 allocate(character(i) :: ret) print *, len(ret) if(len(ret) /= 10) error stop ret = "Hello" print *, len(ret) if(len(ret) /= 5 ) error stop end program lfortran-lfortran-2f73434/integration_tests/equivalence_15.f900000664000175000017500000000446615141516316024540 0ustar alastairalastairprogram equivalence_15 implicit none ! Test 1: Integer arrays with offset 3 integer :: ia1(4), ia2(4) equivalence (ia1, ia2(3)) ! Test 2: Real arrays with offset 4 real :: r1(2), r2(6) equivalence (r1, r2(4)) ! Test 3: Complex arrays with offset 2 complex :: c1(2), c2(3) equivalence (c1, c2(2)) ! Test 4: Logical arrays with offset 3 logical :: l1(2), l2(4) equivalence (l1, l2(3)) ! Test 5: Different size arrays with offset 2 integer :: arr1(3), arr2(5) equivalence (arr1, arr2(2)) ! Test 1: Integer equivalence ia1 = [11, 12, 13, 14] ia2 = [1, 2, 3, 4] if (ia1(1) /= 3) error stop "Test 1: ia1(1) should be 3" if (ia1(2) /= 4) error stop "Test 1: ia1(2) should be 4" if (ia1(3) /= 13) error stop "Test 1: ia1(3) should be 13" if (ia1(4) /= 14) error stop "Test 1: ia1(4) should be 14" if (ia2(1) /= 1) error stop "Test 1: ia2(1) should be 1" if (ia2(3) /= 3) error stop "Test 1: ia2(3) should be 3" ! Test 2: Real equivalence r1 = [1.5, 2.5] r2 = [10.0, 20.0, 30.0, 40.0, 50.0, 60.0] if (abs(r1(1) - 40.0) > 1.0e-6) error stop "Test 2: r1(1) should be 40.0" if (abs(r1(2) - 50.0) > 1.0e-6) error stop "Test 2: r1(2) should be 50.0" if (abs(r2(4) - 40.0) > 1.0e-6) error stop "Test 2: r2(4) should be 40.0" ! Test 3: Complex equivalence c1 = [(1.0, 2.0), (3.0, 4.0)] c2 = [(10.0, 20.0), (30.0, 40.0), (50.0, 60.0)] if (abs(real(c1(1)) - 30.0) > 1.0e-6) error stop "Test 3: c1(1) real should be 30.0" if (abs(aimag(c1(1)) - 40.0) > 1.0e-6) error stop "Test 3: c1(1) imag should be 40.0" ! Test 4: Logical equivalence l1 = [.true., .false.] l2 = [.false., .false., .true., .true.] if (.not. l1(1)) error stop "Test 4: l1(1) should be true" if (.not. l1(2)) error stop "Test 4: l1(2) should be true" if (.not. l2(3)) error stop "Test 4: l2(3) should be true" ! Test 5: Different sizes arr1 = [100, 200, 300] arr2 = [10, 20, 30, 40, 50] if (arr1(1) /= 20) error stop "Test 5: arr1(1) should be 20" if (arr1(2) /= 30) error stop "Test 5: arr1(2) should be 30" if (arr1(3) /= 40) error stop "Test 5: arr1(3) should be 40" if (arr2(2) /= 20) error stop "Test 5: arr2(2) should be 20" end program equivalence_15 lfortran-lfortran-2f73434/integration_tests/associate_23.f900000664000175000017500000000151715141516316024203 0ustar alastairalastairprogram pointer_lhs_section_bug implicit none real, target :: arr(6) real, pointer :: mat(:), mat1(:) integer :: n n = 6 arr = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] mat(1:n-3) => arr print *, "Test 1: mat(1:n-3) => arr" print *, " mat:", mat print *, " lbound:", lbound(mat) print *, " ubound:", ubound(mat) if (any(mat /= [1.0, 2.0, 3.0])) error stop if (any(lbound(mat) /= 1)) error stop if (any(ubound(mat) /= 3)) error stop mat1(1+2:n+2) => arr print *, "Test 2: mat1(1+2:n+2) => arr" print *, " mat1:", mat1 print *, " lbound:", lbound(mat1) print *, " ubound:", ubound(mat1) if (any(mat1 /= [1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) error stop if (any(lbound(mat1) /= 3)) error stop if (any(ubound(mat1) /= 8)) error stop end program pointer_lhs_section_buglfortran-lfortran-2f73434/integration_tests/intrinsics_206.f900000664000175000017500000000174415141516316024502 0ustar alastairalastairprogram intrinsics_206 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop print *, poppar(z) if(poppar(z) /= 0) error stop print *, poppar(0) if(poppar(0) /= 0) error stop print *, poppar(a) if(poppar(a) /= 1) error stop print *, poppar(5468272828_dp) if(poppar(5468272828_dp) /= 1) error stop print *, poppar(b) if(poppar(b) /= 0) error stop print *, poppar(-3526282829_dp) if(poppar(-3526282829_dp) /= 0) error stop print *, poppar(c) if(poppar(c) /= 1) error stop print *, poppar(83983_dp) if(poppar(83983_dp) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_29.f900000664000175000017500000000070315141516316025242 0ustar alastairalastairprogram arrays_reshape_29 implicit none integer, parameter :: w(4) = [1, 2, 3, 4] real, parameter :: x(4) = w integer, parameter :: y(4) = x real :: b(2, 2) = reshape(y, [2, 2]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_29 lfortran-lfortran-2f73434/integration_tests/attr_dim_02.f900000664000175000017500000000012115141516316024016 0ustar alastairalastairprogram attr_dim_02 dimension array(3) double precision array end programlfortran-lfortran-2f73434/integration_tests/arrays_52.f900000664000175000017500000000134515141516316023532 0ustar alastairalastair! ! Check that lcompilers_get_i() returns mutated value of i not just hard coded value of 4 program arrays_52 implicit none integer(4), dimension(11) :: cs integer(4), save :: nx = 4 cs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] call test_1(cs) nx = 10 call test_2(cs) contains subroutine test_1(x) integer(4), dimension(nx), intent(in) :: x print *, "Size of array x : ", size(x) if (size(x) /= 4) error stop end subroutine test_1 subroutine test_2(x) integer(4), dimension(nx), intent(in) :: x print *, "Size of array x : ", size(x) if (size(x) /= 10) error stop end subroutine test_2 end program arrays_52 lfortran-lfortran-2f73434/integration_tests/functions_32.f900000664000175000017500000000271015141516316024234 0ustar alastairalastairmodule function_32_mod contains function matprod(x, y) result(z) real(8), intent(in) :: x(:, :) real(8), intent(in) :: y(:, :) real(8) :: z(size(x, 1), size(y, 2)) integer :: i, j z = 1.0_8 end function matprod function return_type_check(x) result(z) real(8), intent(in) :: x(:, :) real(8) :: z(size(x)) z = 1.0_8 end function end module program function_32 use function_32_mod real(8) :: x(5,2) integer :: iact(2) integer :: nact real(8) :: full_size(10) iact = [2,1] nact = -1 full_size = return_type_check(x(:,iact)) + 1.0_8 if(any(full_size /= 2.0_8)) error stop x = matprod(x(:,iact), x(:, iact)) + 1.0_8 if(any(x /= 2.0_8)) error stop call func(x, iact, nact) contains subroutine func(x, iact, nact) real(8), intent(in) :: x(:,:) integer, intent(inout) :: iact(:) integer, intent(inout) :: nact real(8) :: bmat(2, 2 + size(x,1)) real(8) :: yzmat_c(2, size(x,2)) real(8) :: tmp_x(size(x,1) * size(x,2)) integer :: npt npt = size(x,1) bmat(:, 1:npt) = matprod(yzmat_c, transpose(x)) if(any(bmat(:,1:npt) /= 1.0_8)) error stop tmp_x = return_type_check(x(:,iact)) + 1.0_8 if(any(tmp_x /= 2.0_8)) error stop yzmat_c = matprod(x(iact, :), x(:, iact)) + 1.0_8 if(any(yzmat_c /= 2.0_8)) error stop nact = 2 bmat(:, 1:nact) = -matprod(yzmat_c, x(:, 1:nact)) if(any(bmat(:,1:nact) /= -1.0_8)) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/complex_24.f900000664000175000017500000000046115141516316023675 0ustar alastairalastairprogram complex_24 complex(4) :: d(2,1) real (4) :: r(2,1) d = cmplx(1, 1) * reshape([1, 2], [2, 1]) print *, d if (abs(d(1, 1) - (1.00000000e+00, 1.00000000e+00)) > 1.0e-6) error stop if (abs(d(2, 1) - (2.00000000e+00, 2.00000000e+00)) > 1.0e-6) error stop end program complex_24 lfortran-lfortran-2f73434/integration_tests/openmp_35.f900000664000175000017500000000303315141516316023524 0ustar alastairalastairsubroutine operations(n, ctr, sum_v1, sum_v2,sum_v3) use omp_lib implicit none integer, intent(in) :: n double precision, intent(inout) :: ctr double precision, intent(inout) :: sum_v1, sum_v2, sum_v3 integer :: local_ctr double precision :: local_sum_v1, local_sum_v2,local_sum_v3 integer :: i local_ctr = 0 local_sum_v1 = 0.0 local_sum_v2 = 1.0 local_sum_v3 = 0.0 !$omp parallel private(i) reduction(+:local_ctr, local_sum_v1, local_sum_v3) reduction(*:local_sum_v2) !$omp do do i = 1, n local_ctr = local_ctr + 1 ! Counting increment local_sum_v2 = local_sum_v2 * i ! Sample multiplication operation for v2 local_sum_v1 = local_sum_v1 + i ! Sample sum operation for v1 local_sum_v3 = local_sum_v3 - i ! Sample subtraction operation for v3 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr sum_v1 = sum_v1 + local_sum_v1 sum_v2 = sum_v2 * local_sum_v2 sum_v3 = sum_v3 + local_sum_v3 end subroutine program openmp_35 use omp_lib integer, parameter :: n = 16 double precision :: ctr, sum_v1, sum_v2, sum_v3 call omp_set_num_threads(8) ctr = 0.0 sum_v1 = 0.0 sum_v2 = 1.0 ! Initializing for multiplicative reduction sum_v3 = 0.0 call operations(n, ctr, sum_v1, sum_v2,sum_v3) print *, "Total count: ", ctr print *, "Sum of v1: ", sum_v1 print *, "Product result for v2: ", sum_v2 print *, "Difference result for v3: ", sum_v3 end programlfortran-lfortran-2f73434/integration_tests/template_02.f900000664000175000017500000000236215141516316024037 0ustar alastairalastairmodule template_02_m implicit none requirement eq(t, ne) type, deferred :: t function ne(lhs, rhs) type(t), intent(in) :: lhs, rhs logical :: ne end function end requirement template change_positions_tmpl(t, ne) require :: eq(t, ne) private public :: change_positions_t contains function change_positions_t(vec) result(mask) type(t), intent(in) :: vec(:) integer, allocatable :: pos(:), mask(:) integer :: i, j, n n = size(vec) allocate (pos(n)) if (n < 1) return pos = 0 pos(1) = 1 j = 1 do i = 2,n if (ne(vec(i), vec(i-1))) then j = j+1 pos(j) = i end if end do allocate(mask(j)) do i = 1,j mask(i) = pos(i) end do end function end template end module program template_02 use template_02_m implicit none instantiate change_positions_tmpl(integer, operator(/=)), & only: change_positions_int => change_positions_t instantiate change_positions_tmpl(character, operator(/=)), & only: change_positions_chr => change_positions_t print *, change_positions_int([3, 3, 6, 2, 2, 2, 1]) print *, change_positions_chr(["a", "a", "b", "p", "p", "p", "o"]) end program lfortran-lfortran-2f73434/integration_tests/select_rank_01.f900000664000175000017500000000134615141516316024516 0ustar alastairalastair program select_rank_test implicit none integer :: b(2) = [1,2] integer :: c(2,2) = reshape([1,2,3,4],[2,2]) integer :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) integer, dimension(..), intent(in) :: x integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop rank(1) if (expected /= 1) error stop rank(2) if (expected /= 2) error stop rank(3) if (expected /= 3) error stop end select end subroutine check end program select_rank_test lfortran-lfortran-2f73434/integration_tests/intrinsics_116.f900000664000175000017500000000026015141516316024472 0ustar alastairalastairprogram intrinsics_116 print *, atan2( y = 0.5e0_4, x = 1.e0_4 ) print *, atan2( 0.5e0_4, x = 1.e0_4 ) print *, atan2( 0.5e0_4, 1.e0_4 ) end program intrinsics_116 lfortran-lfortran-2f73434/integration_tests/int_02.f900000664000175000017500000000027215141516316023014 0ustar alastairalastairprogram intrinsics_15 real, parameter :: x1 = 3.3 integer, parameter :: x2 = 7 integer, parameter :: y1 = int(x1) integer, parameter :: y2 = int(x2) print*, y1, y2 end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_16.f900000664000175000017500000000260515141516316025241 0ustar alastairalastairprogram arrays_reshape_16 implicit none integer, allocatable :: array_const_1(:, :) integer :: i23_shape(2) = [4, 2] integer :: i23_shape_e(2) allocate(array_const_1(2, 4)) array_const_1 = reshape([-14, 3, 0, -2, 19, 1, 20, 21], [2, 4]) print *, array_const_1(1, :) print *, array_const_1(2, :) array_const_1 = reshape(array_const_1, i23_shape) print *, shape(array_const_1) print *, lbound(array_const_1, 1), ubound(array_const_1, 1) print *, lbound(array_const_1, 2), ubound(array_const_1, 2) print *, size(array_const_1, 1), size(array_const_1, 2) if( lbound(array_const_1, 1) /= 1 ) error stop if( ubound(array_const_1, 1) /= 4 ) error stop if( lbound(array_const_1, 2) /= 1 ) error stop if( ubound(array_const_1, 2) /= 2 ) error stop if( size(array_const_1, 1) /= 4 ) error stop if( size(array_const_1, 2) /= 2 ) error stop i23_shape_e = shape(array_const_1) if( i23_shape_e(1) /= 4 ) error stop if( i23_shape_e(2) /= 2 ) error stop print *, array_const_1(1, :) print *, array_const_1(2, :) print *, array_const_1(3, :) print *, array_const_1(4, :) if( array_const_1(1, 1) /= -14 ) error stop if( array_const_1(1, 2) /= 19 ) error stop if( array_const_1(2, 1) /= 3 ) error stop if( array_const_1(2, 2) /= 1 ) error stop if( array_const_1(3, 1) /= 0 ) error stop if( array_const_1(3, 2) /= 20 ) error stop if( array_const_1(4, 1) /= -2 ) error stop if( array_const_1(4, 2) /= 21 ) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_43.f900000664000175000017500000000171215141516316023530 0ustar alastairalastairprogram arrays_43 integer(8), parameter :: a(4) = [-10, 2, 3, 4] real(8), parameter :: x(4) = [-1.0, 2.0, -3.0, 4.0] logical(4):: b(4), c(4), d(4), e(4) b = a > 0 print*, a > 0 if (b(1) .neqv. .false. ) error stop if (b(2) .neqv. .true. ) error stop if (b(3) .neqv. .true. ) error stop if (b(4) .neqv. .true. ) error stop c = a < 0 print*, a < 0 if (c(1) .neqv. .true. ) error stop if (c(2) .neqv. .false. ) error stop if (c(3) .neqv. .false. ) error stop if (c(4) .neqv. .false. ) error stop d = x > 0.0 print*, x > 0.0 if (d(1) .neqv. .false. ) error stop if (d(2) .neqv. .true. ) error stop if (d(3) .neqv. .false. ) error stop if (d(4) .neqv. .true. ) error stop e = x < 0.0 print*, x < 0.0 if (e(1) .neqv. .true. ) error stop if (e(2) .neqv. .false. ) error stop if (e(3) .neqv. .true. ) error stop if (e(4) .neqv. .false. ) error stop end program lfortran-lfortran-2f73434/integration_tests/union_test_02.f900000664000175000017500000000152215141516316024410 0ustar alastairalastairmodule lp_union_test_02_mod implicit none _lfortran_union_type :: test_type integer :: x real :: y end _lfortran_union_type _lfortran_union_type :: test_type1 integer :: x integer(kind=8) :: y end _lfortran_union_type end module program lp_union_test_02 use lp_union_test_02_mod implicit none real ::eps = 1e-6, x integer :: y, z type(test_type) :: test_union type(test_type1) :: test_union1 ! Memory value of pi test_union%x = 1078530011 ! Doesn't currently support direct operations x = test_union%y if ( abs(x - 3.141593) > eps ) error stop test_union1%x = 121222 y = test_union1%x z = int(test_union1%y) ! FIX: hack work around if ( abs(y-z) > eps ) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_06.f900000664000175000017500000000061015141516316023523 0ustar alastairalastairprogram arrays_06 implicit none integer, dimension(3, 3, 3) :: A integer :: i, j, k integer, dimension(6) :: x j = 4 x = [(i*2, i = 1, 6)] print *, x x = [(i+1, i*2, i = 1, 3)] print *, x x = [(i+1, i**2, i*2, i = 1, 2)] print *, x x = [(2*i, 3*i, 4*i, i+1, i**2, i*2, i = 2, 2)] print *, x A = 3.0 + 4 print *, A ! print '("Matrix A"/(10F8.2))', ((A(i, j), i = 1, 2), j = 1, 2) end program lfortran-lfortran-2f73434/integration_tests/statement_03.f900000664000175000017500000000020315141516316024221 0ustar alastairalastairsubroutine cumchn() intrinsic dble dg(i) = 2.0D0*dble(i) end subroutine program statement_03 call cumchn() end program lfortran-lfortran-2f73434/integration_tests/complex_07.f900000664000175000017500000000226115141516316023676 0ustar alastairalastairprogram complex_07 implicit none integer, parameter :: real_part = 42 real, parameter :: img_part = 3.14 complex :: x = cmplx(real_part) complex :: y = cmplx(img_part) complex :: z = cmplx(real_part, img_part) double complex :: c1, x2, y2, z2 integer :: i = 42 real :: x1 = 3.14 complex :: z1 z1 = cmplx(i, x1) c1 = (12, 24) print *, c1 x2 = dcmplx(real_part) y2 = dcmplx(img_part) z2 = dcmplx(real_part, img_part) if (abs(x - (real_part, 0)) > 1e-5) error stop if (abs(y - (img_part, 0)) > 1e-5) error stop if (abs(z - (real_part, img_part)) > 1e-5) error stop if (abs(x2 - (real_part, 0)) > 1e-5) error stop if (abs(y2 - (img_part, 0)) > 1e-5) error stop if (abs(z2 - (real_part, img_part)) > 1e-5) error stop print *, dcmplx(i) if (abs(dcmplx(i) - (42.000000,0.000000)) > 1e-5) error stop print *, dcmplx(x1) if (abs(dcmplx(x1) - (3.140000,0.000000)) > 1e-5) error stop print *, dcmplx(z1) if (abs(dcmplx(z1) - (42.000000,3.140000)) > 1e-5) error stop print *, dcmplx(x1, i) if (abs(dcmplx(x1, i) - (3.140000,42.000000)) > 1e-5) error stop print *, x, y, z end program lfortran-lfortran-2f73434/integration_tests/warning_realstar.f900000664000175000017500000000007715141516316025266 0ustar alastairalastairprogram warning_realstar real*4 x real*8 y end program lfortran-lfortran-2f73434/integration_tests/derived_types_92.f900000664000175000017500000000173615141516316025107 0ustar alastairalastairprogram derived_types_92 implicit none type :: package_t integer :: num character(:),allocatable :: str end type package_t class(package_t), allocatable :: instance(:) allocate(instance(1)) instance(1)%num = 1 instance(1)%str = "Hi" print *, instance(1)%num if(instance(1)%num /= 1) error stop print *, instance(1)%str if(instance(1)%str /= "Hi") error stop call foo(instance) call foo2(instance) contains subroutine foo(arg) class(package_t), allocatable :: arg(:) print *, arg(1)%num if(arg(1)%num /= 1) error stop print *, arg(1)%str if(arg(1)%str /= "Hi") error stop arg(1)%num = 10 arg(1)%str = "bye" end subroutine subroutine foo2(arg) class(package_t):: arg(:) print *, arg(1)%num if(arg(1)%num /= 10) error stop print *, arg(1)%str if(arg(1)%str /= "bye") error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/template_field.f900000664000175000017500000000414315141516316024700 0ustar alastairalastairmodule field_m !! field is a unit_ring that also has a division or inverse operation use unit_ring_m, only: unit_ring implicit none private public :: & field_only_division, & field_only_inverse, & field, & derive_field_from_division, & derive_field_from_inverse requirement field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient end function end requirement requirement field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse end function end requirement requirement field(T, plus, zero, mult, one, minus, negate, divide, invert) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) end requirement template derive_field_from_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) private public :: invert contains elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse inverse = divide(one(), x) end function end template template derive_field_from_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) private public :: divide contains elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient quotient = mult(x, invert(y)) end function end template end module lfortran-lfortran-2f73434/integration_tests/derived_type_with_default_init.f900000664000175000017500000000134515141516316030170 0ustar alastairalastairmodule module_derived_type_with_default_init public :: myType, global_myType type :: myType private logical :: a = .true. integer :: i = 2 contains private procedure, public, pass(self) :: config end type myType type(myType) :: global_myType contains subroutine config(self) class(myType), intent(in) :: self if (self % a .neqv. .true.) error stop if (self % i .ne. 2) error stop end subroutine config end module module_derived_type_with_default_init program derived_type_with_default_init use module_derived_type_with_default_init, global => global_myType call global % config() end program derived_type_with_default_initlfortran-lfortran-2f73434/integration_tests/format_35.f900000664000175000017500000000037315141516316023522 0ustar alastairalastairprogram format_35 implicit none character fmt*10, line*80, letters*26 integer i letters = 'abcdefghijklmnopqrstuvwxyz' fmt = '(99(1X,A))' write(line,fmt) (letters(i:i), i=1,26) print "(A)", trim(line) end program format_35 lfortran-lfortran-2f73434/integration_tests/types_06.f900000664000175000017500000000121515141516316023370 0ustar alastairalastairprogram types_06 implicit none real :: r integer :: i r = 2 i = 2 if (i < i) error stop if (r < r) error stop if (r < i) error stop if (i < r) error stop if (i > i) error stop if (r > r) error stop if (r > i) error stop if (i > r) error stop if (i /= i) error stop if (r /= r) error stop if (r /= i) error stop if (i /= r) error stop if (i+1 <= i) error stop if (r+1 <= r) error stop if (r+1 <= i) error stop if (i+1 <= r) error stop if (i >= i+1) error stop if (r >= r+1) error stop if (r >= i+1) error stop if (i >= r+1) error stop if (i == i+1) error stop if (r == r+1) error stop if (r == i+1) error stop if (i == r+1) error stop end program lfortran-lfortran-2f73434/integration_tests/file_08.txt0000664000175000017500000000023515141516316023367 0ustar alastairalastair 1.0000000000000000 2.0000000000000000 3.0000000000000000 4.0000000000000000 5.0000000000000000 6.0000000000000000 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_01.f900000664000175000017500000000056315141516316026575 0ustar alastairalastairsubroutine a(w) double precision :: w(5) integer icon icon = 2 call b(w(icon)) return end subroutine b(con) double precision :: con(*) con(4) = -4.83D0 con(3) = 3.14D0 return end program legacy_array_sections_01 double precision :: w(5) w = 1.39D0 call a(w) print *, w if (abs(w(5) - (-4.83D0)) > 1d-8) error stop if (abs(w(4) - 3.14D0) > 1d-10) error stop end program lfortran-lfortran-2f73434/integration_tests/read_25.f900000664000175000017500000000057115141516316023144 0ustar alastairalastairprogram read_25 implicit none character(8) :: string = 'abcd', newstring = 'ABCD' character(8):: newstring2 = 'ABCD' read(string, "(A)") newstring(5:8) read(string(1:4),"(A)") newstring2 print "(A)", newstring print "(A)", newstring2 if (newstring /= 'ABCDabcd') error stop if (newstring2 /= 'abcd') error stop end program read_25lfortran-lfortran-2f73434/integration_tests/subroutines_03.f900000664000175000017500000000073515141516316024611 0ustar alastairalastairprogram subroutines_03 implicit none integer :: i, j, k, l i = 1 j = 1 k = 1 l = 1 call f(i, j, k, l) print *, j if (j /= 4) error stop call f(i, j, d=l, c=k) print *, j if (j /= 4) error stop call f(a=i, b=j, d=l, c=k) print *, j if (j /= 4) error stop call f(b=j, a=i, c=k, d=l) print *, j if (j /= 4) error stop contains subroutine f(a, b, c, d) integer, intent(in) :: a, c, d integer, intent(out) :: b b = a + 1 + c + d end subroutine end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_02b.f900000664000175000017500000000046715141516316026574 0ustar alastairalastairmodule separate_compilation_02_module contains subroutine m_sub print *, "m_sub" end subroutine m_sub end module separate_compilation_02_module subroutine sub print *, "sub" end subroutine sub integer function fn() use separate_compilation_02_module call m_sub fn = 19 end function fn lfortran-lfortran-2f73434/integration_tests/arrays_11_size.f900000664000175000017500000000056515141516316024562 0ustar alastairalastairmodule mod_arrays_11_size contains subroutine sub(xx) real, intent(in) :: xx(:) real :: buggy(count(xx > 0.0)) print * , size(buggy) if (size(buggy) /= 3) error stop end subroutine sub end module mod_arrays_11_size program arrays_11_size use mod_arrays_11_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] call sub(xx) end program arrays_11_size lfortran-lfortran-2f73434/integration_tests/format_27.f900000664000175000017500000000034015141516316023515 0ustar alastairalastairprogram format_27 write(*,"(EN0.0E0)") 3.14159 write(*,"(EN0.0E0)") 3.14 write(*,"(EN0.0E0)") 3.14E+03 write(*,"(EN0.0E0)") 30.14159 write(*,"(EN0.0E0)") 391.14 write(*,"(EN0.0E0)") 3.14E+04 end program format_27lfortran-lfortran-2f73434/integration_tests/class_78.f900000664000175000017500000000402315141516316023342 0ustar alastairalastairmodule class_78_module public :: fpm_registry_settings, fpm_global_settings type :: fpm_global_settings type(fpm_registry_settings), allocatable :: registry_settings end type type :: fpm_registry_settings integer :: tag = 0 end type end module class_78_module program class_78 use class_78_module implicit none type(fpm_global_settings) :: global_settings type(fpm_registry_settings) :: tmp logical :: ok if (allocated(global_settings%registry_settings)) then print *, "FAIL: registry_settings should start unallocated." stop 1 else print *, "PASS: registry_settings initially unallocated." end if allocate(global_settings%registry_settings) if (.not. allocated(global_settings%registry_settings)) then print *, "FAIL: allocation failed." stop 1 else print *, "PASS: allocation succeeded." end if tmp%tag = 42 global_settings%registry_settings = tmp if (global_settings%registry_settings%tag /= 42) then print *, "FAIL: assignment into allocatable component did not propagate value." stop 1 else print *, "PASS: assignment propagated correctly." end if call validate_settings(global_settings, ok) if (.not. ok) then print *, "FAIL: validate_settings detected incorrect state." stop 1 else print *, "PASS: validate_settings confirmed correct state." end if deallocate(global_settings%registry_settings) if (allocated(global_settings%registry_settings)) then print *, "FAIL: deallocation failed." stop 1 else print *, "PASS: deallocation succeeded." end if contains subroutine validate_settings(gs, ok) type(fpm_global_settings), intent(in) :: gs logical, intent(out) :: ok ok = .true. if (.not. allocated(gs%registry_settings)) ok = .false. if (gs%registry_settings%tag /= 42) ok = .false. end subroutine validate_settings end program class_78 lfortran-lfortran-2f73434/integration_tests/derived_types_88.f900000664000175000017500000000157015141516316025110 0ustar alastairalastairmodule derived_types_88_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: compile_command_t character(:), allocatable :: directory type(string_t), allocatable :: str_arr(:) end type compile_command_t contains subroutine cct_new(cc) type(compile_command_t), intent(inout) :: cc call cct_inside() contains subroutine cct_inside() if (cc%directory /= "Home") error stop if (cc%str_arr(1)%s /= "Hello") error stop if (cc%str_arr(2)%s /= "World") error stop end subroutine end subroutine end module derived_types_88_mod program derived_types_88 use derived_types_88_mod type(compile_command_t) :: cc cc%directory = "Home" cc%str_arr = [string_t("Hello"), string_t("World")] call cct_new(cc) end programlfortran-lfortran-2f73434/integration_tests/sin_01.f900000664000175000017500000000040515141516316023010 0ustar alastairalastairprogram sin_01 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x, y, r1, r2 x = sin(1.5_dp) if (abs(x - 0.997494996_dp) > 1e-5_dp) error stop y = 10.5_dp r1 = dsin(x) r2 = -0.87969575997167_dp if (dabs(r1-r2) > 1e15_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_269.f900000664000175000017500000001155515141516316024514 0ustar alastairalastairprogram intrinsics_269 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = acos([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = acos([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [2.2500188380589141_dp, 2.1144352537866755_dp, 1.8677118371228034_dp, & 0.89157381553087900_dp, 1.0271573998031178_dp, 1.2738808164669899_dp, 0.0000000000000000_dp, & 0.59283005557227886_dp, 0.30874327684982894_dp, 1.8148377145860481_dp] expected_y = [2.25001884_sp, 2.11443520_sp, 1.86771178_sp, & 0.891573846_sp, 1.02715743_sp, 1.27388084_sp, 0.00000000_sp, & 0.592830062_sp, 0.308743358_sp, 1.81483769_sp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] res_x = acos(arg_x) res_y = acos(arg_y) expected_res_x = [2.3174990949497780_dp, 2.1455629489588066_dp, 1.8722571937442951_dp, & 0.82409355863454103_dp, 0.99602970463098672_dp, 1.2693354598454980_dp, 0.96332095907306292_dp, & 1.4927508492754979_dp, 1.3056473413839662_dp, 1.8173273965123287_dp, & 2.3864340230054486_dp, 0.96332095907306292_dp, 1.4927508492754979_dp, 1.3056473413839662_dp, & 1.8173273965123287_dp] expected_res_y = [2.31749892_sp, 2.14556289_sp, 1.87225723_sp, & 0.824093640_sp, 0.996029735_sp, 1.26933551_sp, 0.963320911_sp, & 1.49275088_sp, 1.30564737_sp, 1.81732738_sp, 2.38643408_sp, & 0.963320911_sp, 1.49275088_sp, 1.30564737_sp, & 1.81732738_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, acos(a) if (abs(acos(a)) - 1.0264977928984282_dp > 1e-12) error stop print *, acos(0.5178181202_dp) if (abs(acos(0.5178181202_dp) - 1.0264977928984282_dp) > 1e-12) error stop print *, acos(b) if (acos(b) - (1.64367688_sp) > 1e-5) error stop print *, acos(-0.072816_sp) if (acos(-0.072816_sp) - (1.64367688_sp) > 1e-5) error stop print *, acos(c) if (acos(c) - (2.1150948606913649_dp) > 1e-12) error stop print *, acos(-0.5178181202_dp) if (acos(-0.5178181202_dp) - (2.1150948606913649_dp) > 1e-12) error stop print *, acos(d) if (acos(d) - (1.49791586_sp) > 1e-5) error stop print *, acos(0.072816_sp) if (acos(0.072816_sp) - (1.49791586_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, acos(a) if (abs(acos(a) - (1.8461915525880368_dp)) > 1e-12) error stop print *, acos(-0.271927291_dp) if (abs(acos(-0.271927291_dp) - (1.8461915525880368_dp)) > 1e-12) error stop print *, acos(b) if (acos(b) - (2.26304889_sp) > 1e-5) error stop print *, acos(-0.6382728_sp) if (acos(-0.6382728_sp) - (2.26304889_sp) > 1e-5) error stop print *, acos(c) if (acos(c) - (1.2954011010017565_dp) > 1e-12) error stop print *, acos(0.271927291_dp) if (acos(0.271927291_dp) - (1.2954011010017565_dp) > 1e-12) error stop print *, acos(d) if (acos(d) - (0.878543794_sp) > 1e-5) error stop print *, acos(0.6382728_sp) if (acos(0.6382728_sp) - (0.878543794_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/format_59.f900000664000175000017500000000075415141516316023533 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/4056 ! Format string variable with trailing spaces (character(12)) ! Exact MRE from issue comment (corrected version with character(12)) program format_59 implicit none character(12) :: fmt = "(2(1X,A))" character(80) :: output print "(A)", 'fmt = "' // fmt // '"' print fmt, 'Hello', 'world!' write(output, fmt) 'Hello', 'world!' if (trim(adjustl(output)) /= 'Hello world!') error stop end program format_59 lfortran-lfortran-2f73434/integration_tests/read_34.f900000664000175000017500000000073115141516316023142 0ustar alastairalastairprogram read_fmt_tabs implicit none character(*), parameter :: infmt = '(I6, T1, I6, TL6, I6, TL9, I6, t1, tr2, i3)' integer :: i, ia(5) integer :: iounit open (newunit=iounit, file='fort.data', form='formatted') write (iounit,'(a)') '12345' rewind (iounit) ia = -42 read (iounit, infmt) (ia(i), i=1, 5) if (.not. all(ia(1:4) == 12345)) error stop if (ia(5) /= 345) error stop close (iounit) print *, "all tests passed" end program read_fmt_tabs lfortran-lfortran-2f73434/integration_tests/implicit_interface_04.f900000664000175000017500000000075415141516316026063 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b, n) contains subroutine driver(fnc, arr, m) integer, intent(in) :: m, arr(m) print *, abs(-1.0) call fnc(arr, m, arr(3)) end subroutine subroutine implicit_interface_check(arr1, m, c) integer, intent(in) :: m, arr1(m), c if (m /= 3) error stop if (c /= 30) error stop if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/cpp_pre_02.f900000664000175000017500000000012315141516316023645 0ustar alastairalastairprogram cpp_pre_02 /*/ this should be ignored */ print *, "hi" end program lfortran-lfortran-2f73434/integration_tests/recursion_01.f900000664000175000017500000000066415141516316024237 0ustar alastairalastairmodule recursion_01 integer:: n integer:: x = 0 contains recursive subroutine sub1(x) integer,intent(inout):: x if (x < n) then x = x + 1 print *, 'x = ', x call sub2() call sub1(x) end if contains subroutine sub2() x = x + 1 print *, x call sub1(x) end subroutine sub2 end subroutine sub1 end module recursion_01 program main use recursion_01 n = 10 call sub1(x) end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_74.f900000664000175000017500000000063115141516316024417 0ustar alastairalastairprogram intrinsics_74 implicit none real :: x(1,2) x = 0 print *, x ! 0.0 floating point number is exact, we can compare it directly in here, ! this makes the test robust, since we do not know what random number we get (can be very small) if (x(1,1) /= 0.0) error stop if (x(1,2) /= 0.0) error stop call random_number(x(1,2)) print *, x if (x(1,1) /= 0.0) error stop if (x(1,2) == 0.0) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_51.f900000664000175000017500000000410015141516316024405 0ustar alastairalastairprogram intrinsics_51 implicit none real :: x = 1.0 real, allocatable :: a(:, :), dr(:), er(:) real :: b(2, 2, 2), cr(5) integer :: i, j, k allocate(a(3, 2), dr(10), er(13)) do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) do k = lbound(b, 3), ubound(b, 3) b(i, j, k) = 4*i - 5*j - 6*k end do end do end do do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) a(i, j) = 4*i + 5*j end do end do print *, [1., 2., 3., 4., 5.] print *, "basic", sin([1., 2., 3., 4., 5.]) print *, [[1., 2., 3.], [4., 5.]] cr = sin([[1., 2., 3.], [4., 5.]]) print *, "cr: ", cr do i = lbound(cr, 1), ubound(cr, 1) if( abs(cr(i) - sin(real(i))) > 1e-6 ) error stop end do print *, [[1., 2., 3.], a, 5.] dr = sin([[1., 2., 3.], a, 5.]) print *, "dr.1: ", dr do i = 1, 3 if( abs(dr(i) - sin(real(i))) > 1e-6 ) error stop end do k = 4 do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(dr(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(dr(k) - sin(5.)) > 1e-6 ) error stop print *, [[1., 2., b(:, 1, :)], a, 5.] er = sin([[1., 2., b(:, 1, :)], a, 5.]) print *, "er: ", er do i = 1, 2 if( abs(er(i) - sin(real(i))) > 1e-6 ) error stop end do k = 3 do j = lbound(b, 3), ubound(b, 3) do i = lbound(b, 1), ubound(b, 1) if( abs(er(k) - sin(real(4*i - 5 - 6*j))) > 1e-6 ) error stop k = k + 1 end do end do do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(er(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(er(k) - sin(5.)) > 1e-6 ) error stop print *, [[1., 2., x], a, 5.] dr = sin([[1., 2., x], a, 5.]) print *, "dr.2: ", dr do i = 1, 2 if( abs(dr(i) - sin(real(i))) > 1e-6 ) error stop end do if( abs(dr(3) - sin(x)) > 1e-6 ) error stop k = 4 do j = lbound(a, 2), ubound(a, 2) do i = lbound(a, 1), ubound(a, 1) if( abs(dr(k) - sin(real(4*i + 5*j))) > 1e-6 ) error stop k = k + 1 end do end do if( abs(dr(k) - sin(5.)) > 1e-6 ) error stop end program lfortran-lfortran-2f73434/integration_tests/ilp64_file_ops_01.f900000664000175000017500000000115615141516316025041 0ustar alastairalastair! Test: file I/O operations with -fdefault-integer-8 (ILP64 mode) ! Fixes #9772 program ilp64_file_ops_01 implicit none integer :: u character(len=10) :: line u = 10 open(u, file="/tmp/test_ilp64_file_ops.txt", status="replace") write(u, '(A)') "line1" write(u, '(A)') "line2" ! Test rewind rewind(u) read(u, '(A)') line if (trim(line) /= "line1") error stop "rewind failed" ! Test backspace backspace(u) read(u, '(A)') line if (trim(line) /= "line1") error stop "backspace failed" ! Test flush flush(u) close(u) print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/arrays_97.f900000664000175000017500000000226715141516316023547 0ustar alastairalastairmodule arrays_97_tomlf_diagnostic implicit none type toml_label integer :: level end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label(:) end type toml_diagnostic interface toml_label module procedure new_label end interface toml_label type :: toml_token integer :: kind end type toml_token interface toml_diagnostic module procedure new_diagnostic end interface toml_diagnostic contains pure function new_label(level) result(new) integer, intent(in) :: level type(toml_label) :: new end function new_label pure function new_diagnostic(label) result(new) type(toml_label), intent(in), optional :: label(:) type(toml_diagnostic) :: new end function end module program arrays_97 use arrays_97_tomlf_diagnostic implicit none type(toml_diagnostic), allocatable :: diagnostic call syntax_error(diagnostic) contains subroutine syntax_error(diagnostic) type(toml_diagnostic), allocatable, intent(out) :: diagnostic allocate(diagnostic) diagnostic = toml_diagnostic([toml_label(1)]) print *, "Success!" end subroutine end programlfortran-lfortran-2f73434/integration_tests/transfer_03.f900000664000175000017500000000154615141516316024054 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_03 use iso_fortran_env, only: int16, int8, int32, int64 contains ! pure module function int8_water_hash( key ) result(hash_code) ! integer(int32) :: hash_code ! integer(int8), intent(in) :: key(:) ! end function int8_water_hash subroutine int16_water_hash( key ) integer(int16), intent(in) :: key(:) print *, transfer( key, 0_int8, size(key, kind=int64) ) ! TODO: values diverge with GFortran, PR intends to fix code generation error ! hash_code = int8_water_hash( transfer( key, 0_int8, size(key, kind=int64) ) ) end subroutine int16_water_hash end module stdlib_hash_32bit_water_transfer_03 program transfer_03 use stdlib_hash_32bit_water_transfer_03 integer(int16) :: key(10) key = 9 call int16_water_hash(key) end program lfortran-lfortran-2f73434/integration_tests/submodule_01.f900000664000175000017500000000442715141516316024226 0ustar alastairalastair! Submodules test, taken from: ! https://www.ibm.com/docs/en/xl-fortran-aix/15.1.3?topic=techniques-submodules-fortran-2008 MODULE m1 TYPE Base INTEGER :: i END TYPE INTERFACE MODULE SUBROUTINE sub1(i, b) ! Module procedure interface body for sub1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b END SUBROUTINE END INTERFACE END MODULE MODULE m2 USE m1 ! Use association of module m1 INTERFACE REAL MODULE FUNCTION func1() ! Module procedure interface body for func1 END FUNCTION MODULE FUNCTION func2(b) ! Module procedure interface body for func2 TYPE(Base) :: b TYPE(Base) :: func2 END FUNCTION END INTERFACE END MODULE MODULE m4 USE m1 ! Use association of module m1 TYPE, EXTENDS(Base) :: NewType REAL :: j END TYPE END MODULE SUBMODULE (m1) m1sub USE m4 ! Use association of module m4 CONTAINS MODULE SUBROUTINE sub1(i, b) ! Implementation of sub1 declared in m1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b PRINT *, "sub1", i, b END SUBROUTINE END SUBMODULE SUBMODULE (m2) m2sub CONTAINS REAL MODULE FUNCTION func1() ! Implementation of func1 declared in m2 func1 = 20 END FUNCTION END SUBMODULE SUBMODULE (m2:m2sub) m2sub2 CONTAINS MODULE FUNCTION func2(b) ! Implementation of func2 declared in m2 TYPE(Base) :: b TYPE(Base) :: func2 func2 = b END FUNCTION END SUBMODULE MODULE m3 INTERFACE SUBROUTINE interfaceSub1(i, b) USE m1 INTEGER, INTENT(IN) :: i TYPE(Base), INTENT(IN) :: b END SUBROUTINE REAL FUNCTION interfaceFunc1() END FUNCTION FUNCTION interfaceFunc2(b) USE m1 TYPE(Base) :: b TYPE(Base) :: interfaceFunc2 END FUNCTION END INTERFACE TYPE Container PROCEDURE(interfaceSub1), NOPASS, POINTER :: pp1 PROCEDURE(interfaceFunc1), NOPASS, POINTER :: pp2 PROCEDURE(interfaceFunc2), NOPASS, POINTER :: pp3 END TYPE END MODULE PROGRAM example USE m1 USE m2 USE m3 TYPE(Container) :: c1 c1%pp1 => sub1 c1%pp2 => func1 c1%pp3 => func2 CALL c1%pp1(10, Base(11)) PRINT *, "func1", int(c1%pp2()) PRINT *, "func2", c1%pp3(Base(5)) END PROGRAM lfortran-lfortran-2f73434/integration_tests/allocate_12.f900000664000175000017500000000153715141516316024014 0ustar alastairalastairmodule A implicit none type D integer :: member end type type E type(D), allocatable :: ds(:) end type type F type(E), allocatable :: es(:) end type contains function get_ds() result(ds) type(D), allocatable :: ds(:) ds = [D(1), D(2), D(3)] end function subroutine new_ds(self) type(F), intent(inout) :: self if( .not. allocated(self%es) ) error stop self%es(2)%ds = get_ds() end subroutine end module program allocate_12 use A implicit none type(F) :: fobj(2) allocate(fobj(2)%es(3)) if(.not. allocated(fobj(2)%es)) error stop if( allocated(fobj(1)%es) ) error stop call new_ds(fobj(2)) print *, fobj(2)%es(2)%ds if( fobj(2)%es(2)%ds(1)%member /= 1 ) error stop if( fobj(2)%es(2)%ds(2)%member /= 2 ) error stop if( fobj(2)%es(2)%ds(3)%member /= 3 ) error stop if( any(fobj(2)%es(2)%ds(:)%member /= (/1, 2, 3/)) ) error stop end program lfortran-lfortran-2f73434/integration_tests/include_02.f900000664000175000017500000000027515141516316023650 0ustar alastairalastairprogram include_02 integer :: included, include(2) included = 10 include = 10 print *, included, include(1), include(2) include(1) = 3 print *, included, include(1), include(2) end program lfortran-lfortran-2f73434/integration_tests/template_semigroup.f900000664000175000017500000000352315141516316025630 0ustar alastairalastairmodule semigroup_m implicit none private public :: semigroup, extended_semigroup, derive_extended_semigroup requirement semigroup(T, combine) type, deferred :: T elemental function combine(x, y) result(combined) type(T), intent(in) :: x, y type(T) :: combined end function end requirement requirement extended_semigroup(T, combine, sconcat, stimes) require :: semigroup(T, combine) pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) !! Must contain at least one element type(T) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated end function end requirement template derive_extended_semigroup(T, combine) require :: semigroup(T, combine) private public :: sconcat, stimes contains pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else error stop "Attempted to sconcat empty list" end if end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated integer :: i if (n < 1) error stop "n must be > 0" repeated = a do i = 2, n repeated = combine(repeated, a) end do end function end template end module lfortran-lfortran-2f73434/integration_tests/arrays_01_size.f900000664000175000017500000000130115141516316024546 0ustar alastairalastairprogram arrays_01 implicit none integer :: i, a(3), b(4) integer :: size_a integer :: size_b size_a = size(a, kind=4) size_b = size(b, dim=1, kind=4) if (size_a /= 3) error stop if (size_b /= 4) error stop do i = 1, size_a a(i) = i+10 end do if (a(1) /= 11) error stop if (a(2) /= 12) error stop if (a(3) /= 13) error stop do i = 11, 10 + size_b b(i-10) = i end do if (b(1) /= 11) error stop if (b(2) /= 12) error stop if (b(3) /= 13) error stop if (b(4) /= 14) error stop do i = 1, size_a b(i) = a(i)-10 end do if (b(1) /= 1) error stop if (b(2) /= 2) error stop if (b(3) /= 3) error stop b(4) = b(1)+b(2)+b(3)+a(1) if (b(4) /= 17) error stop b(4) = a(1) if (b(4) /= 11) error stop end lfortran-lfortran-2f73434/integration_tests/parameter_05.f900000664000175000017500000000025415141516316024205 0ustar alastairalastairprogram paramter_05 implicit none integer, parameter :: x = 5.0 real, parameter :: y = 5 real(kind=8), parameter :: z = 5 print*, x,y,z end program paramter_05 lfortran-lfortran-2f73434/integration_tests/entry_01.f900000664000175000017500000000031215141516316023355 0ustar alastairalastairSUBROUTINE dzror() print *, "in dzror" ENTRY dstzr() print *, "in dztzr" RETURN END program main print *, "Call dzror" call dzror() print *, "Call dstzr" call dstzr() end program lfortran-lfortran-2f73434/integration_tests/elemental_07.f900000664000175000017500000000074315141516316024200 0ustar alastairalastairprogram elemental_07 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(-5:4) end type type(vector) :: a, b, c do i = -5, 4 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = -5, 4 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-lfortran-2f73434/integration_tests/modules_33.f900000664000175000017500000000027615141516316023702 0ustar alastairalastairmodule fpm_cmd_install use fpm_modules_33, only : build_model implicit none end module fpm_cmd_install program modules_33 implicit none print *, "running modules_33 program" end program lfortran-lfortran-2f73434/integration_tests/multi_file_member_access_02_mod.f900000664000175000017500000000036115141516316030061 0ustar alastairalastairmodule jtypes implicit none contains subroutine dummy(message, line) character(len=*), intent(in), optional :: message integer, intent(in), optional :: line if (present(line)) error stop 1 end subroutine end module jtypes lfortran-lfortran-2f73434/integration_tests/format_25.f900000664000175000017500000000023015141516316023511 0ustar alastairalastairprogram format_25 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0E0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 end program lfortran-lfortran-2f73434/integration_tests/nested_06.f900000664000175000017500000000042715141516316023512 0ustar alastairalastairmodule nested_06_a implicit none contains subroutine b(x) real :: x print *, "b()" call c() contains subroutine c() print *, 5 print *, x end subroutine c end subroutine b end module program nested_06 use nested_06_a, only: b implicit none call b(6.0) end lfortran-lfortran-2f73434/integration_tests/doloop_03.f900000664000175000017500000000076715141516316023530 0ustar alastairalastairprogram doloop_03 implicit none integer :: i, j j = 0 do i = 1, 10 j = j + i if (i == 3) then continue end if if (i == 2) exit end do if (j /= 3) error stop print *, j j = 0 do i = 1, 10 if (i == 2) exit j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 10 if (i == 2) cycle j = j + i end do if (j /= 53) error stop print *, j end program lfortran-lfortran-2f73434/integration_tests/intrinsics_95.f900000664000175000017500000000014015141516316024415 0ustar alastairalastairprogram intrinsics_95 implicit none if (sign(1.0, -2.0) /= -1.0) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_164.f900000664000175000017500000000321315141516316024476 0ustar alastairalastairprogram intrinsics_164 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = iand(5, 8) integer, parameter :: i2 = iand(-1, 5) integer, parameter :: i3 = iand(-4_8, 2_8) integer(8), parameter :: i4 = iand(-2_8, 5_8) integer, parameter :: ar1(3) = iand([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = iand([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 0) error stop print *, i2 if (i2 /= 5) error stop print *, i3 if (i3 /= 0) error stop print *, i4 if (i4 /= 4) error stop print*, iand(5, 8) if (iand(5, 8) /= 0) error stop print*, iand(-1, 5) if (iand(-1, 5) /= 5) error stop print*, iand(8, -4) if (iand(8, -4) /= 8) error stop print*, iand(-2, -5) if (iand(-2, -5) /= -6) error stop print*, iand(a1, a2) if (iand(a1, a2) /= 0) error stop print*, iand(a3, a4) if (iand(a3, a4) /= -4) error stop print*, iand(a2, a5) if (iand(a2, a5) /= 8) error stop print*, iand(a5, a6) if (iand(a5, a6) /= -6) error stop print *, ar1 if (any(ar1 /= [0, 0, 0])) error stop print *, ar2 if (any(ar2 /= [5, 8, 0])) error stop print *, iand(arr1, arr3) if (any(iand(arr1, arr3) /= [0, 0, 0])) error stop print *, iand(arr2, arr2) if (any(iand(arr2, arr2) /= [-1, -5, -10])) error stop res = iand(arr1, arr3) print *, res if (any(res /= [0, 0, 0])) error stop end program lfortran-lfortran-2f73434/integration_tests/select_label_01.f900000664000175000017500000000057015141516316024640 0ustar alastairalastairprogram select_label_01 implicit none integer :: choice choice = 2 SELECT_BLOCK: select case (choice) case (1) case default INNER: block choice = 3 exit SELECT_BLOCK choice = 4 end block INNER end select SELECT_BLOCK print *, "Choice is: ", choice if (choice /= 3) error stop end program select_label_01 lfortran-lfortran-2f73434/integration_tests/modules_63_module.f900000664000175000017500000000040515141516316025244 0ustar alastairalastairmodule mre_read_string_fmt_mod contains subroutine temp() character(len=:), allocatable :: str str = "'control char "//achar(0)//"','normal literal'" if (len(str) /= 33) error stop end subroutine temp end module mre_read_string_fmt_mod lfortran-lfortran-2f73434/integration_tests/format_38.f900000664000175000017500000000137415141516316023527 0ustar alastairalastairprogram format_38 implicit none real :: value character(len=20) :: output value = 42.43 write(output, '(1p, f10.3)') value if (output /= " 424.300 ") error stop write(output, '(-1p, f10.3)') value if (output /= " 4.243 ") error stop write(output, '(+2p, f10.3)') value if (output /= " 4243.000 ") error stop write(output, '(+0p, f10.3)') value if (output /= " 42.430 ") error stop write(output, '(+1p, f10.3)') value if (output /= " 424.300 ") error stop ! Test format statement with + sign write(output, 100) value if (output /= " 424.300 ") error stop 100 format (+1p, f10.3) print *, "All tests passed" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_02.f900000664000175000017500000000056615141516316024415 0ustar alastairalastairprogram intrinsics_02 real :: x = sin(1.5) real(8) :: y y = sin(1.5) print *, x, y if (abs(x - 0.997494996) > 1.e-6) error stop if (abs(sin(x) - 0.840114892) > 1.e-6) error stop if (abs(y - 0.997494995) > 1e-7) error stop if (abs(sin(sin(1.5) + sin(0.5+sin(0.5))) - 0.967188418) > 1e-7) error stop if (abs(sin(sin(y) + sin(x+sin(x))) - 0.97276188) > 1e-7) error stop end lfortran-lfortran-2f73434/integration_tests/private1.f900000664000175000017500000000046715141516316023462 0ustar alastairalastairmodule foo1 private end module module foo2 real :: y = 2 contains subroutine f() y = 3.0 end subroutine f end module program test use foo2 print *, y if( abs(y - 2.0) > 1e-12 ) error stop call f() print *, y if( abs(y - 3.0) > 1e-12 ) error stop end program lfortran-lfortran-2f73434/integration_tests/select_type_02.f900000664000175000017500000000204015141516316024535 0ustar alastairalastairmodule derived_type_collection implicit none type point real :: x, y end type point end module derived_type_collection program select_type_02 use derived_type_collection implicit none type, extends(point) :: point_3d real :: z end type point_3d type, extends(point) :: color_point integer :: color end type color_point type(point), target :: p type(point_3d), target :: p3d type(color_point), target :: cp class(point), pointer :: p_or_cp p%x = 1.0 p%y = 2.0 p3d%x = 3.0 p3d%y = 4.0 p3d%z = 5.0 cp%x = 6.0 cp%y = 7.0 cp%color = 8 p_or_cp => cp select type ( an => p_or_cp ) class is ( point ) print *, "point: ", an%x, an%y type is ( color_point ) print *, "color_point: ", an%x, an%y, an%color end select ! select type ( an => p_or_cp ) ! class is ( point ) ! print *, "point: ", an%x, an%y ! type is ( point_3d ) ! print *, "point3d: ", an%x, an%y, an%z ! end select end program select_type_02 lfortran-lfortran-2f73434/integration_tests/arrays_op_19.f900000664000175000017500000000066715141516316024241 0ustar alastairalastairprogram array_op_19 implicit none real :: x(10, 10), sx(10, 10) x = 2.0 sx = softmax(x) print *, sx if( any(abs(sx - 0.1) > 1e-6) ) error stop contains function softmax(x) result(y) real, intent(in) :: x(:, :) real :: y(size(x, 1), size(x, 2)) integer :: i real :: s do i = 1, size(x, 2) y(:, i) = exp(x(:, i) - maxval(x(:, i))) y(:, i) = y(:, i) / sum(y(:, i)) end do end function end program lfortran-lfortran-2f73434/integration_tests/read_01.f900000664000175000017500000000260615141516316023137 0ustar alastairalastairprogram read_01 character(len=2), target :: str = "42" character(len=2) :: c integer :: i32 integer(8) :: i64 real :: f32 real(8) :: f64 integer, save, dimension(3) :: i32_arr_size3 = [-1,-1,-1] character(20) :: key character(5) :: val character(len=:), allocatable :: al_val character(len=:), allocatable :: al_str character(len=:), pointer :: str_ptr read(str, *) c print *, c if (c /= "42") error stop read(str, *) i32 print *, i32 if (i32 /= 42) error stop read(str, *) i64 print *, i64 if (i64 /= 42) error stop read(str, *) f32 print *, f32 if (f32 /= 42.0) error stop read(str, *) f64 print *, f64 if (f64 /= 42.0) error stop allocate(character(len=2) :: al_str) val = "ab" read(val, *) al_str print *, al_str if (al_str /= "ab") error stop allocate(character(len=2) :: al_val) str = "cd" read(str, *) al_val print *, al_val if (al_val /= "cd") error stop print *, str str = "72" key = "int_read" select case(key) case ("int_read") read(str, *) i32 case ("int_arr_size3_read") read(str, *) i32_arr_size3 end select print *, i32 if (i32 /= 72) error stop str = "20" str_ptr => str read(str_ptr, *) i32 print *, i32 if (i32 /= 20) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_230.f900000664000175000017500000000612115141516316024471 0ustar alastairalastairprogram intrinsic_230 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 implicit none real(dp), parameter :: res0_j0(2) = bessel_j0([3.3398640543782485_dp, 3.3398640543782485_dp]) real(dp), parameter :: res0_j1(2) = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_jn(2) = bessel_jn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_y0(2) = bessel_y0([3.3398640543782485_dp, 3.3398640543782485_dp]) real(dp), parameter :: res0_y1(2) = bessel_y1([3.3398640543782485_dp, 5.039184326269492_dp]) real(dp), parameter :: res0_yn(2) = bessel_yn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) real(dp) :: res1_j0(2) real(dp) :: res1_j1(2) real(dp) :: res1_jn(2) real(dp) :: res1_y0(2) real(dp) :: res1_y1(2) real(dp) :: res1_yn(2) res1_j0 = bessel_j0([3.3398640543782485_dp, 3.3398640543782485_dp]) res1_j1 = bessel_j1([3.3398640543782485_dp, 5.039184326269492_dp]) res1_jn = bessel_jn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) res1_y0 = bessel_y0([3.3398640543782485_dp, 3.3398640543782485_dp]) res1_y1 = bessel_y1([3.3398640543782485_dp, 5.039184326269492_dp]) res1_yn = bessel_yn(1, [3.3398640543782485_dp, 5.039184326269492_dp]) print*, res0_j0 if (abs(res0_j0(1) - (-0.35276533724012676)) > 1e-6) error stop if (abs(res0_j0(2) - (-0.35276533724012676)) > 1e-6) error stop print*, res0_j1 if (abs(res0_j1(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res0_j1(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res0_jn if (abs(res0_jn(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res0_jn(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res0_y0 if (abs(res0_y0(1) - 0.25351438512601238) > 1e-6) error stop if (abs(res0_y0(2) - 0.25351438512601238) > 1e-6) error stop print*, res0_y1 if (abs(res0_y1(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res0_y1(2) - 0.13456148643731775) > 1e-6) error stop print*, res0_yn if (abs(res0_yn(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res0_yn(2) - 0.13456148643731775) > 1e-6) error stop print*, res1_j0 if (abs(res1_j0(1) - (-0.35276533724012676)) > 1e-6) error stop if (abs(res1_j0(2) - (-0.35276533724012676)) > 1e-6) error stop print*, res1_j1 if (abs(res1_j1(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res1_j1(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res1_jn if (abs(res1_jn(1) - 0.20421621687655642) > 1e-6) error stop if (abs(res1_jn(2) - (-0.33171193864355270)) > 1e-6) error stop print*, res1_y0 if (abs(res1_y0(1) - 0.25351438512601238) > 1e-6) error stop if (abs(res1_y0(2) - 0.25351438512601238) > 1e-6) error stop print*, res1_y1 if (abs(res1_y1(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res1_y1(2) - 0.13456148643731775) > 1e-6) error stop print*, res1_yn if (abs(res1_yn(1) - 0.39357815895597936) > 1e-6) error stop if (abs(res1_yn(2) - 0.13456148643731775) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/variables_01.f900000664000175000017500000000072215141516316024171 0ustar alastairalastairprogram variables_01 implicit none integer :: x, y x = 2 y = 3 if (x /= 2) error stop if (y /= 3) error stop x = y if (x /= 3) error stop if (y /= 3) error stop y = 1 if (y == 1) x = 1 if (y /= 1) x = 2 if (x /= 1) error stop y = 2 if (y == 1) x = 1 if (y /= 1) x = 2 if (x /= 2) error stop x = 2 y = 1 if (y == 1) x = x + 1 if (y /= 1) x = x - 1 if (x /= 3) error stop x = 2 y = 2 if (y == 1) x = x + 1 if (y /= 1) x = x - 1 if (x /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/associate_12.f900000664000175000017500000000563715141516316024210 0ustar alastairalastairprogram associate_12 implicit none complex, target :: my_complex_one_dim(2) complex, pointer :: my_complex_one_dim_mirror(:) real, pointer :: my_complex_one_dim_re(:) real, pointer :: my_complex_one_dim_im(:) complex, target :: my_complex(2, 3) complex, pointer :: my_complex_mirror(:, :) real, pointer :: my_complex_re(:, :) real, pointer :: my_complex_im(:, :) my_complex_one_dim(1) = (2, 5) my_complex_one_dim(2) = (-2, -5) my_complex_one_dim_mirror => my_complex_one_dim print *, my_complex_one_dim_mirror(1), my_complex_one_dim_mirror(2) if (abs(my_complex_one_dim_mirror(1) - (2, 5)) > 1e-5) error stop if (abs(my_complex_one_dim_mirror(2) - (-2, -5)) > 1e-5) error stop my_complex_one_dim_re => my_complex_one_dim%re print *, my_complex_one_dim_re(1), my_complex_one_dim_re(2) if (abs(my_complex_one_dim_re(1) - 2) > 1e-5) error stop if (abs(my_complex_one_dim_re(2) - (-2)) > 1e-5) error stop my_complex_one_dim_im => my_complex_one_dim%im print *, my_complex_one_dim_im(1), my_complex_one_dim_im(2) if (abs(my_complex_one_dim_im(1) - 5) > 1e-5) error stop if (abs(my_complex_one_dim_im(2) - (-5)) > 1e-5) error stop my_complex = reshape([(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12)], [2, 3]) my_complex_mirror => my_complex print *, my_complex_mirror(1, 1), my_complex_mirror(1, 2), my_complex_mirror(1, 3) print *, my_complex_mirror(2, 1), my_complex_mirror(2, 2), my_complex_mirror(2, 3) if (abs(my_complex_mirror(1, 1) - (1, 2)) > 1e-5) error stop if (abs(my_complex_mirror(1, 2) - (5, 6)) > 1e-5) error stop if (abs(my_complex_mirror(1, 3) - (9, 10)) > 1e-5) error stop if (abs(my_complex_mirror(2, 1) - (3, 4)) > 1e-5) error stop if (abs(my_complex_mirror(2, 2) - (7, 8)) > 1e-5) error stop if (abs(my_complex_mirror(2, 3) - (11, 12)) > 1e-5) error stop my_complex_re => my_complex%re print *, my_complex_re(1, 1), my_complex_re(1, 2), my_complex_re(1, 3) print *, my_complex_re(2, 1), my_complex_re(2, 2), my_complex_re(2, 3) if (abs(my_complex_re(1, 1) - 1) > 1e-5) error stop if (abs(my_complex_re(1, 2) - 5) > 1e-5) error stop if (abs(my_complex_re(1, 3) - 9) > 1e-5) error stop if (abs(my_complex_re(2, 1) - 3) > 1e-5) error stop if (abs(my_complex_re(2, 2) - 7) > 1e-5) error stop if (abs(my_complex_re(2, 3) - 11) > 1e-5) error stop my_complex_im => my_complex%im print *, my_complex_im(1, 1), my_complex_im(1, 2), my_complex_im(1, 3) print *, my_complex_im(2, 1), my_complex_im(2, 2), my_complex_im(2, 3) if (abs(my_complex_im(1, 1) - 2) > 1e-5) error stop if (abs(my_complex_im(1, 2) - 6) > 1e-5) error stop if (abs(my_complex_im(1, 3) - 10) > 1e-5) error stop if (abs(my_complex_im(2, 1) - 4) > 1e-5) error stop if (abs(my_complex_im(2, 2) - 8) > 1e-5) error stop if (abs(my_complex_im(2, 3) - 12) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_56.f900000664000175000017500000000341715141516316024424 0ustar alastairalastairprogram intrinsics_56 implicit none logical :: m1(5, 10), m2(5, 10), m integer :: a1(5, 10), b1(5, 10) integer, allocatable :: a2(:, :) real :: a4(5, 10), b2(5, 10) real, allocatable :: a3(:, :) complex, allocatable :: a5(:, :), a6(:, :), b3(:, :) character(len=5) :: a7(5, 10) character(len=5), allocatable :: a8(:, :) character(len=5) :: b4(5, 10) integer :: i, j m = .true. do i = 1, 5 do j = 1, 10 m1(i, j) = m m2(i, j) = .not. m m = .not. m end do end do allocate(a2(5, 10)) a1 = 1 a2 = 2 b1 = merge(a1, a2, m1) m = .true. do i = 1, 5 do j = 1, 10 print *, b1(i, j) if( m ) then if( b1(i, j) /= a1(i, j) ) error stop else if( b1(i, j) /= a2(i, j) ) error stop end if m = .not. m end do end do allocate(a3(5, 10)) a3 = 3.0 a4 = 4.0 b2 = merge(a3, a4, m2) m = .false. do i = 1, 5 do j = 1, 10 print *, b2(i, j) if( m ) then if( b2(i, j) /= a3(i, j) ) error stop else if( b2(i, j) /= a4(i, j) ) error stop end if m = .not. m end do end do allocate(a5(5, 10), a6(5, 10), b3(5, 10)) a5 = (5.0, 6.0) a6 = (7.0, 8.0) b3 = merge(a5, a6, m1) m = .true. do i = 1, 5 do j = 1, 10 print *, b3(i, j) if( m ) then if( b3(i, j) /= a5(i, j) ) error stop else if( b3(i, j) /= a6(i, j) ) error stop end if m = .not. m end do end do allocate(a8(5, 10)) a7 = "a7" a8 = "a8" b4 = merge(a7, a8, m2) m = .false. do i = 1, 5 do j = 1, 10 print *, b4(i, j) if( m ) then if( b4(i, j) /= a7(i, j) ) error stop else if( b4(i, j) /= a8(i, j) ) error stop end if m = .not. m end do end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_316.f900000664000175000017500000000061215141516316024475 0ustar alastairalastairprogram intrinsics_316 real :: x(2) x = [1.2, 2.3] print *, max(0., x) if (any(abs(max(0., x) - [1.2, 2.3]) > 1e-5)) error stop print *, max([0., 1.], x) if (any(abs(max([0., 1.], x) - [1.2, 2.3]) > 1e-5)) error stop print *, min(0., x) if (any(abs(min(0., x) - [0.0, 0.0]) > 1e-5)) error stop print *, min([0., 1.], x) if (any(abs(min([0., 1.], x) - [0.0, 1.0]) > 1e-5)) error stop end programlfortran-lfortran-2f73434/integration_tests/allocate_23.f900000664000175000017500000000124115141516316024006 0ustar alastairalastairprogram allocate_23 implicit none type :: base integer :: x = 100 end type type, extends(base) :: derived integer :: y = 200 end type type(base), allocatable :: a1, a2 type(derived), allocatable :: d1 class(base), allocatable :: c1 ! type -> type allocate(a1) a1%x = 11 allocate(a2, source=a1) if (a2%x /= 11) error stop ! type -> class allocate(d1) d1%x = 22 d1%y = 44 allocate(c1, source=d1) select type(c1) type is (derived) if (c1%x /= 22 .or. c1%y /= 44) error stop class default error stop end select end program allocate_23 lfortran-lfortran-2f73434/integration_tests/save_06.f900000664000175000017500000000045315141516316023165 0ustar alastairalastairsubroutine idd_random_transf_init(value) implicit none real(8), intent(in) :: value save if( value /= 42.0d0) error stop return end program save_06 implicit none real(8) :: initialValue initialValue = 42.0d0 call idd_random_transf_init(initialValue) end program lfortran-lfortran-2f73434/integration_tests/class_64.f900000664000175000017500000000203515141516316023336 0ustar alastairalastairmodule class_64_mod_1 type, abstract :: toml_value integer :: x = 0 contains procedure :: accept end type toml_value contains subroutine accept(self) class(toml_value), intent(inout) :: self self%x = self%x + 1 end subroutine accept end module module class_64_mod_2 use class_64_mod_1 type, extends(toml_value) :: toml_keyval end type toml_keyval contains subroutine temp(visitor, l1) class(toml_value), intent(inout), target :: visitor class(toml_value), pointer :: ptr logical :: l1 ptr => visitor if (l1) then select type(ptr) class is(toml_keyval) call ptr%accept() end select end if select type(ptr) class is(toml_keyval) call ptr%accept() end select end subroutine end module class_64_mod_2 program class_64 use class_64_mod_2 type(toml_keyval) :: key call temp(key, .true.) if (key%x /= 2) error stop call temp(key, .false.) if (key%x /= 3) error stop end program class_64 lfortran-lfortran-2f73434/integration_tests/expr_18.f900000664000175000017500000000017315141516316023207 0ustar alastairalastairprogram expr_18 complex, parameter :: x = 123 print *, x if (abs(x - (123, 0)) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/block_data_complex.f900000664000175000017500000000055515141516316025537 0ustar alastairalastairprogram bd_test implicit none complex :: axvc common /blk9/ axvc if (abs(real(axvc) - 234.23) > 0.01) error stop "Real part incorrect" if (abs(aimag(axvc) - 34.9) > 0.01) error stop "Imaginary part incorrect" print *, "AXVC from MAIN =", axvc print*,"Test Passed" end program block data complex :: axvc common /blk9/ axvc data axvc /(234.23, 34.9)/ end block data lfortran-lfortran-2f73434/integration_tests/parameter_12.f900000664000175000017500000000036115141516316024202 0ustar alastairalastairprogram parameter_12 implicit none integer :: i real, dimension(3), parameter :: a = [(i, i = 1, 3)] print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 3.0) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/file_22_data.txt0000664000175000017500000000001515141516316024350 0ustar alastairalastairHello, world!lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_02.f900000664000175000017500000000100115141516316026040 0ustar alastairalastairprogram main implicit none real :: data_x(3) = [1.0, 2.0, 3.0] call find_fit(data_x, expr) if ( abs(data_x(1) - 1.0) > 1e-16 ) error stop if ( abs(data_x(2) - 2.0) > 1e-16 ) error stop if ( abs(data_x(3) - 3.0) > 1e-16 ) error stop print *, data_x contains subroutine find_fit(data_x, expr) real, intent(in) :: data_x(:) interface function expr() result(z) real :: z end function expr end interface end subroutine find_fit function expr() result(y) real :: y end function expr end program main lfortran-lfortran-2f73434/integration_tests/array_section_12.f900000664000175000017500000000132715141516316025067 0ustar alastairalastairprogram array_section_12 use, intrinsic :: iso_fortran_env, only: wp => real64 implicit none real(wp) :: default_colors(3, 5) real(wp) :: plot_color(3) integer :: i do i = 1, 5 default_colors(:, i) = [real(i, wp), real(i + 10, wp), real(i + 20, wp)] end do call pick_color(default_colors, 4, plot_color) if (any(abs(plot_color - [4.0_wp, 14.0_wp, 24.0_wp]) > 1e-12_wp)) error stop print *, "PASS" contains subroutine pick_color(colors, idx, out_color) real(wp), intent(in) :: colors(:,:) integer, intent(in) :: idx real(wp), intent(out) :: out_color(3) out_color = colors(:, idx) end subroutine pick_color end program array_section_12 lfortran-lfortran-2f73434/integration_tests/allocated_05.f900000664000175000017500000000064615141516316024162 0ustar alastairalastairmodule node_mod type :: dependency_config_t integer, allocatable :: arr(:) end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t end type dependency_node_t end module node_mod program demo use node_mod implicit none type(dependency_node_t), allocatable :: a, b allocate(a, b) b = a print *, allocated(b%arr) if (allocated(b%arr)) error stop end program demo lfortran-lfortran-2f73434/integration_tests/bits_06.f900000664000175000017500000000067515141516316023176 0ustar alastairalastairprogram bits_06 implicit none integer(1) :: int1 = 1 integer(2) :: int2 = 4 integer(4) :: int4 = 41 integer(8) :: int8 = 411 integer :: size1, size2, size4, size8 size1 = bit_size(int1) print *, size1 if (size1 /= 8) error stop size2 = bit_size(int2) print *, size2 if (size2 /= 16) error stop size4 = bit_size(int4) print *, size4 if (size4 /= 32) error stop size8 = bit_size(int8) print *, size8 if (size8 /= 64) error stop end program lfortran-lfortran-2f73434/integration_tests/select_type_06.f900000664000175000017500000000140215141516316024542 0ustar alastairalastairprogram select_type_06_m implicit none type :: string_value character(len=:), allocatable :: raw end type type, extends(string_value) :: toml_keyval character(len=20) :: key = "example" end type class(string_value), allocatable :: val ! Polymorphic variable logical :: defer(2) defer = .false. allocate(val) select type(val) type is(string_value) val%raw = "Hello, Fortran!" end select if (val%raw /= "Hello, Fortran!") error stop deallocate(val) allocate(toml_keyval :: val) select type(val) class is(toml_keyval) defer(1) = .true. if (val%key /= "example") error stop end select if (any(defer .neqv. [.true., .false.])) error stop end program lfortran-lfortran-2f73434/integration_tests/dict_test_07_.f900000664000175000017500000000213715141516316024352 0ustar alastairalastairmodule dict_test_07_mod implicit none contains function fill_smalltocapital() result(smalltocaps) type(_lfortran_dict(character(len=:), character(len=:))) :: smalltocaps smalltocaps = _lfortran_dict_constant( & "a", "A", "b", "B", "c", "C", "d", "D", "e", "E", & "f", "F", "g", "G", "h", "H", "i", "I", "j", "J", & "k", "K", "l", "L", "m", "M", "n", "N", "o", "O", & "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", & "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z") end function subroutine test_dict() type(_lfortran_dict(character(len=:), character(len=:))) :: smalltocaps integer :: i character(len=1) :: key, expected smalltocaps = fill_smalltocapital() if (_lfortran_len(smalltocaps) /= 26) error stop do i = 97, 97 + 25 key = achar(i) expected = achar(i - 32) if (_lfortran_get_item(smalltocaps, key) /= expected) error stop end do end subroutine end module program test_dict_07 use dict_test_07_mod implicit none call test_dict() end program lfortran-lfortran-2f73434/integration_tests/data_implied_do_03.f900000664000175000017500000000061015141516316025315 0ustar alastairalastairsubroutine sub() real :: a(5) integer :: i DATA (a(i),i=1,5) /1.0, 2.0, 3*0.0/ print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 0.0) > 1e-8) error stop if (abs(a(4) - 0.0) > 1e-8) error stop if (abs(a(5) - 0.0) > 1e-8) error stop end subroutine program data_implied_do_03 call sub() end program lfortran-lfortran-2f73434/integration_tests/bindc_03c.c0000664000175000017500000000037415141516316023274 0ustar alastairalastair#include void execute_function( void (*func)() ) { printf("Executing function in C\n"); func(); } void execute_function_with_arg( void (*func)(int *), int* arg ) { printf("Executing function with arg in C\n"); func(arg); } lfortran-lfortran-2f73434/integration_tests/nested_03.f900000664000175000017500000000043015141516316023501 0ustar alastairalastairmodule nested_03_a implicit none contains subroutine b() real :: x x = 6 print *, "b()" call c() contains subroutine c() print *, 5 print *, x end subroutine c end subroutine b end module program nested_03 use nested_03_a, only: b implicit none call b() end lfortran-lfortran-2f73434/integration_tests/intrinsics_59.f900000664000175000017500000000043515141516316024424 0ustar alastairalastairprogram test_maxval implicit none type :: model_t integer, allocatable :: byte_encoder(:) end type type(model_t) :: m allocate(m%byte_encoder(5)) m%byte_encoder = 5 m%byte_encoder(2) = 14 print *, maxval(m%byte_encoder) if (maxval(m%byte_encoder) /= 14) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_06.f900000664000175000017500000000153315141516316024237 0ustar alastairalastairmodule functions_06_m implicit none contains function trim_wrapper(s) result(r) character(len=*) :: s character(len=len(s)) :: r r = trim(s) end function function int_return(s) result(r) character(len=*) :: s integer :: r(len(s)) integer :: i do i = 1, len(s) r(i) = 2 end do end function function real_return(s) result(r) character(len=*) :: s real :: r(len(s)) integer :: i do i = 1, len(s) r(i) = 2.0 end do end function end module program functions_06 use :: functions_06_m, only: trim_wrapper, int_return, real_return implicit none character(len=5) :: string = " abc" print *, trim_wrapper(string) print *, int_return(string) print *, real_return(string) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_37.f900000664000175000017500000000147115141516316024421 0ustar alastairalastairprogram intrinsics_37 real(8) :: tsource(2, 3), fsource(2, 3), ar1(2, 3), ar2(2, 3) logical :: mask(2, 3) real(8) :: real_mask(2, 3) integer :: i, j tsource(1, 1) = 1 tsource(1, 2) = 4 tsource(1, 3) = 2 tsource(2, 1) = 5 tsource(2, 2) = 3 tsource(2, 3) = 6 fsource(1, 1) = 7 fsource(1, 2) = 0 fsource(1, 3) = 8 fsource(2, 1) = -1 fsource(2, 2) = 9 fsource(2, 3) = -2 mask(1, 1) = .true. mask(1, 2) = .false. mask(1, 3) = .false. mask(2, 1) = .true. mask(2, 2) = .true. mask(2, 3) = .false. do i = 1, ubound(mask, 1) do j = 1, ubound(mask, 2) if( mask(i, j) ) then real_mask(i, j) = 1.0_8 else real_mask(i, j) = 0.0_8 end if end do end do ar1 = merge(tsource, fsource, mask) ar2 = tsource * real_mask + fsource * (1.0_4 - real_mask) print *, ar1 - ar2 end programlfortran-lfortran-2f73434/integration_tests/associate_24.f900000664000175000017500000000144615141516316024205 0ustar alastairalastairprogram mre implicit none type :: line_token integer :: first, second end type type(line_token), allocatable :: token(:) integer :: shift(4) allocate(token(4)) token%first = [1, 2, 3, 4] associate(first => token%first) shift = first - 1 first = first + 1 end associate ! Check that shift = first - 1 worked (original values were 1,2,3,4) if (shift(1) /= 0) error stop if (shift(2) /= 1) error stop if (shift(3) /= 2) error stop if (shift(4) /= 3) error stop ! Check that first = first + 1 modified the original array if (token(1)%first /= 2) error stop if (token(2)%first /= 3) error stop if (token(3)%first /= 4) error stop if (token(4)%first /= 5) error stop print *, "PASSED" end program mre lfortran-lfortran-2f73434/integration_tests/intrinsics_103.f900000664000175000017500000000044615141516316024474 0ustar alastairalastairprogram intrinsics_103 implicit none character(len=*), parameter :: magic_number = char(60 + 5) character(len=*), parameter :: magic_number2 = char(int(z"41")) print *, magic_number print *, magic_number2 if (magic_number /= "A") error stop if (magic_number2 /= "A") error stop end program lfortran-lfortran-2f73434/integration_tests/include_01.f900000664000175000017500000000015215141516316023641 0ustar alastairalastairinclude 'include_01/a.f90' program include_01 call a() print *, "From Main" end program include_01 lfortran-lfortran-2f73434/integration_tests/functions_27.f900000664000175000017500000000103315141516316024235 0ustar alastairalastairmodule functions_27_mod contains function func_arr3() result(ret_arr) integer,allocatable :: ret_arr(:) print *, allocated(ret_arr) ! ret_arr should always be not allocated by the begining of the function call. if(allocated(ret_arr) .eqv. .true.) error stop allocate(ret_arr(1)) end function end module program functions_27 use functions_27_mod implicit none integer, allocatable :: inp(:) integer :: i do i= 1, 3 inp = func_arr3() end do end program lfortran-lfortran-2f73434/integration_tests/elemental_12.f900000664000175000017500000001113415141516316024170 0ustar alastairalastairprogram elemental_12 implicit none real, dimension(2, 3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(2, 3) :: result_2param real, dimension(2, 3) :: result_3param array_param = reshape([ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], shape(array_param)) scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_2param(1, 1) - expected_ans(1, 1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = reshape([2.0, 6.0, 12.0, 20.0, 30.0, 42.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = reshape([2.0, 5.0, 10.0, 17.0, 26.0, 37.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_3param(1, 1) - expected_ans(1, 1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_12 lfortran-lfortran-2f73434/integration_tests/allocate_32.f900000664000175000017500000000202315141516316024005 0ustar alastairalastairprogram allocate_32 implicit none type :: item_t character(len=:), allocatable :: name integer :: value end type item_t type(item_t), allocatable :: items(:) integer :: i allocate(items(3)) do i = 1, 3 allocate(character(len=10) :: items(i)%name) items(i)%name = "item" // char(48 + i) items(i)%value = i * 10 end do print *, "Before: size =", size(items) do i = 1, size(items) print *, " items(", i, ")%name =", trim(items(i)%name), & ", value =", items(i)%value end do items = items(2:3) print *, "After: size =", size(items) do i = 1, size(items) print *, " items(", i, ")%name =", trim(items(i)%name), & ", value =", items(i)%value end do if (size(items) /= 2) error stop "Expected size 2" if (items(1)%value /= 20) error stop "Expected items(1)%value = 20" if (items(2)%value /= 30) error stop "Expected items(2)%value = 30" print *, "PASS" end program allocate_32 lfortran-lfortran-2f73434/integration_tests/intrinsics_61.f900000664000175000017500000000171715141516316024421 0ustar alastairalastairprogram intrinsics_61 implicit none integer(1) :: x integer(2) :: y integer(4) :: z integer(8) :: w character(1), parameter :: c1 = char(32) character(1), parameter :: c2 = char(57, 4) character(1), parameter :: ar1(4) = char([32, 57, 56, 67]) ! character(1), parameter :: ar2(4) = char([32, 57, 56, 67], 4) !Does not work #4566 integer :: arr1(4) = [32, 55, 87, 90] print *, c1 if (c1 /= ' ') error stop print *, c2 if (c2 /= '9') error stop print *, ar1 if (any(ar1 /= [' ', '9', '8', 'C'])) error stop ! print *, ar2 ! if (any(ar2 /= [' ', '9', '8', 'C'])) error stop print *, char(arr1) if (any(char(arr1) /= [' ', '7', 'W', 'Z'])) error stop x = 97 y = 47 z = 56 w = 67 print *, char(x), char(y), char(z), char(w) if (char(x) /= 'a') error stop if (char(y) /= '/') error stop if (char(z) /= '8') error stop if (char(w) /= 'C') error stop end program lfortran-lfortran-2f73434/integration_tests/if_03.f900000664000175000017500000000006715141516316022623 0ustar alastairalastairprogram if_03 implicit none if (1 == 1) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_236.f900000664000175000017500000000075315141516316024504 0ustar alastairalastairprogram intrinsics_236 implicit none integer,parameter:: ik1 = selected_int_kind(1) print "(A,I0)", & 'ik1 = ',ik1,& 'kind(bit_size(1_ik1)) = ',kind(bit_size(1_ik1)), & 'kind(huge(1_ik1)) = ',kind(huge(1_ik1)),& 'huge(1_ik1) = ',huge(1_ik1) if (1_ik1 /= 1) error stop if (kind(bit_size(1_ik1)) /= 1) error stop if (kind(huge(1_ik1)) /= 1) error stop if (huge(1_ik1) /= 127) error stop end program lfortran-lfortran-2f73434/integration_tests/select_rank_10.f900000664000175000017500000000151115141516316024510 0ustar alastairalastairprogram select_rank_10 implicit none integer :: a(3) = [1, 2, 3] real :: b(2,2) = reshape([1.0, 2.0, 3.0, 4.0], [2,2]) call check(a) call check(b) contains subroutine check(x) class(*), intent(in) :: x(..) select rank (x) rank (1) print *, "Rank-1 array" select type (x) type is (integer) print *, "Integer" print *, x type is (real) error stop end select rank (2) print *, "Rank-2 array" select type (x) type is (integer) error stop type is (real) print *, "Real" print *, x end select end select end subroutine check end program select_rank_10 lfortran-lfortran-2f73434/integration_tests/implicit_interface_12.f900000664000175000017500000000042215141516316026052 0ustar alastairalastairmodule implicit_interface_12_module contains function f() implicit integer(8) (f) f = 1 end function f end program main use implicit_interface_12_module integer(8) :: i i = f() if (i /= 1) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/line_continuation_04.f900000664000175000017500000000133515141516316025746 0ustar alastairalastairprogram line_continuation_04 implicit none integer :: result, a, b, c character(len=20) :: textblock textblock = '&!' print *, textblock if (textblock /= "&!") error stop textblock = "apple& !apple " print *, textblock if (textblock /= "apple") error stop ! textblock = "apple'&!apple" ! if (textblock /= "apple'&!apple") error stop a = 1 b = 2 c = 3 ! the below line doesn't have &! in a string ! hence, everything after ! is treated as a ! comment result = a + b +&!addition here c print *, result if (result /= 6) error stop textblock = "& !" print *, textblock if (textblock /= "& !") error stop end program line_continuation_04 lfortran-lfortran-2f73434/integration_tests/optional_07.f900000664000175000017500000000114215141516316024051 0ustar alastairalastairprogram optional_07 ! Test for issue #9561: absent optional array arguments passed through nested calls implicit none integer :: x(666) call outer( x(:) ) contains subroutine outer( x, opt ) integer, intent(inout) :: x(:) integer, intent(in), optional :: opt(:) call inner( x(:), opt ) end subroutine outer subroutine inner( x, opt ) integer, intent(inout) :: x(:) integer, intent(in), optional :: opt(size(x)) print *,'opt present?',present(opt) if (present(opt)) error stop "Expected opt to be absent" end subroutine inner end program optional_07 lfortran-lfortran-2f73434/integration_tests/stop_03.f900000664000175000017500000000005215141516316023204 0ustar alastairalastairprogram stop_03 stop "hi" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_411.f900000664000175000017500000000132415141516316024472 0ustar alastairalastairmodule asciimod implicit none public iascii contains pure function iascii( string) character,intent(in):: string*(*) integer iascii(len(string)) iascii = iachar(transfer(string,(/'A'/))) end function iascii end module asciimod program intrinsics_411 use asciimod, only: iascii implicit none integer :: result(1), expected(1) integer :: result3(3), expected3(3) result = iascii('a') expected = (/97/) if (any(result /= expected)) error stop "iascii('a') failed" result3 = iascii('abc') expected3 = (/97, 98, 99/) if (any(result3 /= expected3)) error stop "iascii('abc') failed" if (size(iascii('')) /= 0) error stop "iascii('') size failed" end program intrinsics_411 lfortran-lfortran-2f73434/integration_tests/procedure_15.f900000664000175000017500000000220615141516316024215 0ustar alastairalastairmodule nested_context interface subroutine lcompilers_OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine lcompilers_OBJCON end interface procedure(lcompilers_OBJCON), pointer :: lcompilers_calcfc end module nested_context module cobylb_mod_procedure_15 use nested_context, only: lcompilers_calcfc contains subroutine cobylb(calcfc) implicit none interface subroutine OBJCON(x) implicit none real, intent(in) :: x(:) end subroutine OBJCON end interface procedure(OBJCON) :: calcfc lcompilers_calcfc => calcfc call calcfc_internal([1.0, 2.0]) contains subroutine calcfc_internal(x_internal) use nested_context, only: lcompilers_calcfc implicit none real, intent(in) :: x_internal(:) call lcompilers_calcfc(x_internal) end subroutine calcfc_internal end subroutine cobylb end module cobylb_mod_procedure_15 program procedure_15 use cobylb_mod_procedure_15 implicit none call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x(:) print *, x if ( abs(sum(x) - 3.0) > 1e-8 ) error stop end subroutine end program procedure_15 lfortran-lfortran-2f73434/integration_tests/read_30.f900000664000175000017500000000255415141516316023143 0ustar alastairalastairprogram read_30 implicit none integer :: io_w, io_r, stat integer :: filesize character(len=:), allocatable :: buffer character(len=*), parameter :: toml_text = & 'name = "core_lib"' // new_line('a') open(newunit=io_w, file="config.toml", access="stream", & form="unformatted", status="replace", iostat=stat) if (stat /= 0) error stop "open(write) failed" write(io_w, iostat=stat) toml_text if (stat /= 0) error stop "write failed" close(io_w) open(newunit=io_r, file="config.toml", access="stream", & form="unformatted", position="append", status="old", iostat=stat) if (stat /= 0) error stop "open(read) failed" inquire(unit=io_r, size=filesize) if (filesize <= 1) error stop "config.toml too small" allocate(character(len=filesize) :: buffer) buffer(filesize:filesize) = "?" read(io_r, pos=1, iostat=stat) buffer(:filesize-1) if (stat /= 0) error stop "stream read failed" close(io_r, status='delete') if (index(buffer, 'name') == 0) then error stop "expected key 'name' not found" end if if (buffer(filesize:filesize) /= "?") then error stop "buffer overflow detected" end if print *, "CONFIG CONTENT:" print *, trim(buffer) if (trim(buffer) /= 'name = "core_lib"?') error stop "config content mismatch" end program read_30 lfortran-lfortran-2f73434/integration_tests/parameter_15.f900000664000175000017500000000107715141516316024212 0ustar alastairalastairprogram parameter_15 implicit none integer i1 real r1 integer(8) i2 real(8) r2 parameter (i1=1_8) parameter (r1=1.0D+0) parameter (i2=1) parameter (r2=1.0) print *, i1, kind(i1) if (i1 /= 1) error stop if (kind(i1) /= 4) error stop print *, r1, kind(r1) if ((r1 - 1.0) > 1e-6) error stop if (kind(r1) /= 4) error stop print *, i2, kind(i2) if (i2 /= 1) error stop if (kind(i2) /= 8) error stop print *, r2, kind(r2) if ((r2 - 1.0) > 1e-6) error stop if (kind(r2) /= 8) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_101.f900000664000175000017500000000056715141516316024476 0ustar alastairalastairprogram intrinsics_101 implicit none character(len=5) :: s1 character(len=10) :: s2 s1 = "242" s2 = repeat(s1, 2) print *, repeat("hello", 0) if (repeat("hello", 0) /= "") error stop print *, repeat("hello", 2) if (repeat("hello", 2) /= "hellohello") error stop print *, '-', s2, '-' if (s2 /= "242 242 ") error stop end program lfortran-lfortran-2f73434/integration_tests/present_04.f900000664000175000017500000000112115141516316023676 0ustar alastairalastairmodule present_04_mod implicit none integer, save :: called = 0 contains subroutine s(f) implicit none external :: f optional :: f if (present(f)) call f() end subroutine s end module present_04_mod program present_04 use present_04_mod, only: called, s implicit none external :: f called = 0 call s() if (called /= 0) error stop call s(f) if (called /= 1) error stop end program present_04 subroutine f() use present_04_mod, only: called implicit none called = called + 1 end subroutine f lfortran-lfortran-2f73434/integration_tests/intrinsics_302.f900000664000175000017500000000052115141516316024467 0ustar alastairalastairprogram intrinsics_302 implicit none integer :: x(4) = [1,2,3,4] print *, is_contiguous([1,2,3,4]) if (.not. is_contiguous([1,2,3,4])) error stop print *, is_contiguous(x) if (.not. is_contiguous(x)) error stop print *, is_contiguous(x(::2)) if (is_contiguous(x(::2))) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_16.f900000664000175000017500000000027415141516316026063 0ustar alastairalastairprogram implicit_interface_16 implicit none real :: v(4) logical, external :: sisnan v = [1.0, 2.0, 3.0, 4.0] print *, sisnan( v( 1 ) ) if( sisnan( v( 1 ) ) ) error stop end program lfortran-lfortran-2f73434/integration_tests/nested_namelist_01.f900000664000175000017500000000065115141516316025400 0ustar alastairalastairmodule nested_namelist_01_mod contains subroutine outer() integer :: i real :: x namelist /nml/ i, x i = 2 x = 3.0 call inner() contains subroutine inner() write (*, nml=nml) end subroutine inner end subroutine outer end module program nested_namelist_01 use nested_namelist_01_mod implicit none call outer() end program lfortran-lfortran-2f73434/integration_tests/class_53.f900000664000175000017500000000132415141516316023334 0ustar alastairalastairmodule class_53_m type, abstract :: AbsType integer :: m = 0 end type AbsType type, extends(AbsType) :: MyType end type MyType interface MyType procedure :: init end interface MyType type :: Wrapper class(AbsType), allocatable :: obj contains procedure :: client end type Wrapper contains function init() result(self) type(MyType) :: self self%m = 44 end function init subroutine client(self) class(Wrapper), intent(inout) :: self self%obj = MyType() if (self%obj%m /= 44) error stop end subroutine client end module class_53_m program class_53 use class_53_m type(Wrapper) :: w call w%client() end program lfortran-lfortran-2f73434/integration_tests/functions_39.f900000664000175000017500000000035415141516316024245 0ustar alastairalastairprogram functions_39 integer :: y = 30 print *, f(y) print *, y if( y /= 60 ) error stop if( f(y) /= 360 ) error stop contains integer function f(x) result(r) integer, intent(out) :: x x = 2 * x r = 3 * x end function end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops5.f900000664000175000017500000000065615141516316025335 0ustar alastairalastairMODULE module_implied_do_loops5 INTEGER, DIMENSION(5) :: fixup_counter INTEGER :: n END MODULE module_implied_do_loops5 PROGRAM implied_do_loops5 USE module_implied_do_loops5 IMPLICIT NONE INTEGER, DIMENSION(5) :: result_array PRINT *, (fixup_counter(n) + n, n = 1, 5) result_array = [(fixup_counter(n) + n, n = 1, 5)] if (all(result_array /= [1, 2, 3, 4, 5])) ERROR STOP END PROGRAM implied_do_loops5 lfortran-lfortran-2f73434/integration_tests/arrays_50.f900000664000175000017500000000011515141516316023522 0ustar alastairalastairprogram arrays_50 use arrays_50_mod_a call fdf() end program arrays_50 lfortran-lfortran-2f73434/integration_tests/separate_compilation_09.f900000664000175000017500000000036315141516316026434 0ustar alastairalastairprogram separate_compilatio_09 use mpi_separate_compilation_09b integer :: comm_f comm_f = 1000 print *, handle_mpi_comm_f2c(comm_f) if ( handle_mpi_comm_f2c(comm_f) /= 412 ) error stop end program separate_compilatio_09 lfortran-lfortran-2f73434/integration_tests/implicit_argument_casting_02.f900000664000175000017500000000037015141516316027445 0ustar alastairalastairsubroutine idz_realcomp(n, a) implicit none integer n real a(n) a = 12.5d0 end subroutine program main implicit none complex :: w(5) call idz_realcomp(10, w(1)) print *, w if (abs(real(w(1)) - 12.5) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/read_03_data.txt0000664000175000017500000000002415141516316024343 0ustar alastairalastair123456789 987654321 lfortran-lfortran-2f73434/integration_tests/program_cmake_02.f900000664000175000017500000000035115141516316025027 0ustar alastairalastair! This is a test program that CMake uses to check that the Fortran compiler can ! compile Fortran 90 code. PROGRAM TESTFortran90 integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do END PROGRAM TESTFortran90 lfortran-lfortran-2f73434/integration_tests/arrays_07_size.f900000664000175000017500000000054615141516316024566 0ustar alastairalastairprogram arrays_07_size integer :: y = 2 call temp(y) contains subroutine temp(x) integer, intent(inout) :: x integer :: keep(x) keep = [1,2] x = 1 print * , size(keep) print * , keep if (size(keep) /= 2) error stop if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/associate_07.f900000664000175000017500000000103115141516316024174 0ustar alastairalastairprogram associate_07 integer, pointer :: p1 => null() real(8), pointer :: p2(:, :) => null() complex(4), pointer :: p3(:, :) => null() integer, target :: t1 = 2 real(8), target :: t2(2, 3) complex(4), target :: t3(2, 4) p1 => t1 p2 => t2 if( .not. associated(p1) ) error stop if( .not. associated(p2) ) error stop if( .not. associated(p1, t1) ) error stop if( .not. associated(p2, t2) ) error stop if( associated(p3) ) error stop if( associated(p3, t3) ) error stop end program lfortran-lfortran-2f73434/integration_tests/common_22.f900000664000175000017500000000223615141516316023516 0ustar alastairalastair! Test: Multiple independent COMMON blocks in same program unit (F2018 8.10.3) ! Verifies that different named COMMON blocks have independent storage. ! Modifications to one block should not affect variables in another block. program common_22 implicit none integer :: a1, a2 real :: b1, b2 common/blk1/a1, a2 common/blk2/b1, b2 a1 = 10 a2 = 20 b1 = 1.5 b2 = 2.5 call sub_access_both() call sub_verify_independence() print *, "PASS: common_22" end program subroutine sub_access_both() implicit none integer :: x1, x2 real :: y1, y2 common/blk1/x1, x2 common/blk2/y1, y2 ! Verify both blocks accessible if (x1 /= 10) error stop "x1 should be 10" if (x2 /= 20) error stop "x2 should be 20" if (abs(y1 - 1.5) > 0.001) error stop "y1 should be 1.5" if (abs(y2 - 2.5) > 0.001) error stop "y2 should be 2.5" ! Modify both blocks x1 = 100 y1 = 10.5 end subroutine subroutine sub_verify_independence() implicit none ! Access only blk1 - should not affect blk2 integer :: p, q common/blk1/p, q if (p /= 100) error stop "p should be 100" p = 999 end subroutine lfortran-lfortran-2f73434/integration_tests/bin_op_real_dp.f900000664000175000017500000000027015141516316024653 0ustar alastairalastairprogram bin_op_real_dp real(4) :: zero real(8) :: v, u real :: x zero = 1.0_4/7 u = 1.0_4/7 v = 1.0_8/7 x = 1.0_4/7 print *, zero, v, x, u end programlfortran-lfortran-2f73434/integration_tests/intrinsics_87.f900000664000175000017500000000060515141516316024424 0ustar alastairalastairprogram intrinsics_87 implicit none integer, allocatable :: C(:, :) complex(4) :: arr(3) allocate(C(5, 10)) C = -10 C = abs(C) print *, C if (any(C /= 10)) error stop ! test if 'abs' of complex array results in a real array arr = [(3, 4), (5, 6), (7, 8)] print *, sum(abs(arr)) if (sum(abs(arr)) - 23.4403954 > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/file_19.f900000664000175000017500000000052715141516316023154 0ustar alastairalastairprogram file_19 implicit none character(len=25) :: buffer integer :: chunk, iostat open(11, file="file_19_data.txt") read(11, '(a)', iostat=iostat, size=chunk, advance='no') buffer print *, buffer if (buffer /= " Hi this is 1st line!") error stop print *, chunk if (chunk /= 21) error stop end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_12.f900000664000175000017500000000242115141516316026572 0ustar alastairalastair! Test for double-free bug when passing allocatable array element to ! assumed-size array in a loop. This pattern is common in LAPACK where ! routines like SGEBRD call SGEBD2 with A(I,I) as the start of a submatrix. ! ! The bug manifests as "double free detected" at program exit when ! --legacy-array-sections flag is used. ! ! Related to LAPACK XERBLA errors where wrong routines appear to call ! XERBLA with incorrect parameters. program legacy_array_sections_12 implicit none real, allocatable :: a(:,:) integer :: i, info allocate(a(10, 10)) a = 1.0 ! This loop triggers the double-free bug do i = 1, 3 call check_subarray(10-i+1, a(i, i), 10, info) if (info /= 0) error stop end do deallocate(a) print *, "PASSED: No double-free" end program subroutine check_subarray(m, a, lda, info) ! Subroutine with assumed-size array, like LAPACK SGEBD2 implicit none integer, intent(in) :: m, lda real, intent(inout) :: a(lda, *) integer, intent(out) :: info ! Check LDA like LAPACK does info = 0 if (m < 0) then info = -1 else if (lda < max(1, m)) then info = -3 end if if (info /= 0) return ! Access array to ensure it is valid a(1, 1) = a(1, 1) + 0.1 end subroutine lfortran-lfortran-2f73434/integration_tests/intrinsics_283.f900000664000175000017500000001172115141516316024503 0ustar alastairalastairprogram intrinsics_283 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = asinh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = asinh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.59284540422070708_dp, -0.49659053010574444_dp, -0.28855116339769732_dp, & 0.59284540422070708_dp, 0.49659053010574444_dp, 0.28855116339769732_dp, 0.88137358701954305_dp, & 0.75543292593861289_dp, 0.84754059979088248_dp, -0.23933478027454286_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.592845380_sp, -0.496590495_sp, -0.288551152_sp, & 0.592845380_sp, 0.496590495_sp, 0.288551152_sp, 0.881373584_sp, & 0.755432904_sp, 0.847540557_sp, -0.239334792_sp] res_x = asinh(arg_x) res_y = asinh(arg_y) expected_res_x = [-0.63556192753734742_dp, -0.51989929786720857_dp, -0.29271739145984588_dp, & 0.63556192754067098_dp, 0.51989929786720857_dp, 0.29271739145984588_dp, 0.54362221755279683_dp, & 7.7887497072915673E-002_dp, 0.25914283865915849_dp, -0.24168173285755049_dp, -0.67558582147651625_dp, & 0.54362221755279683_dp, 7.7887497072915673E-002_dp, 0.25914283865915849_dp, -0.24168173285755049_dp] expected_res_y = [-0.635561883_sp, -0.519899249_sp, -0.292717397_sp, & 0.635561883_sp, 0.519899249_sp, 0.292717397_sp, 0.543622255_sp, & 7.78874755E-02_sp, 0.259142816_sp, -0.241681740_sp, -0.675585806_sp, & 0.543622255_sp, 7.78874755E-02_sp, 0.259142816_sp, -0.241681740_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, asinh(a) if (abs(asinh(a)) - 0.49709178005922866_dp > 1e-12) error stop print *, asinh(0.5178181202_dp) if (abs(asinh(0.5178181202_dp) - 0.49709178005922866_dp) > 1e-12) error stop print *, asinh(b) if (asinh(b) - (-7.27518052E-02_sp) > 1e-5) error stop print *, asinh(-0.072816_sp) if (asinh(-0.072816_sp) - (-7.27518052E-02_sp) > 1e-5) error stop print *, asinh(c) if (asinh(c) - (-0.49709178005922866_dp) > 1e-12) error stop print *, asinh(-0.5178181202_dp) if (asinh(-0.5178181202_dp) - (-0.49709178005922866_dp) > 1e-12) error stop print *, asinh(d) if (asinh(d) - (7.27518052E-02_sp) > 1e-5) error stop print *, asinh(0.072816_sp) if (asinh(0.072816_sp) - (7.27518052E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, asinh(a) if (abs(asinh(a) - (-0.26868287761696719_dp)) > 1e-12) error stop print *, asinh(-0.271927291_dp) if (abs(asinh(-0.271927291_dp) - (-0.26868287761696719_dp)) > 1e-12) error stop print *, asinh(b) if (asinh(b) - (-0.601365387_sp) > 1e-5) error stop print *, asinh(-0.6382728_sp) if (asinh(-0.6382728_sp) - (-0.601365387_sp) > 1e-5) error stop print *, asinh(c) if (asinh(c) - (0.26868287761696719_dp) > 1e-12) error stop print *, asinh(0.271927291_dp) if (asinh(0.271927291_dp) - (0.26868287761696719_dp) > 1e-12) error stop print *, asinh(d) if (asinh(d) - (0.601365387_sp) > 1e-5) error stop print *, asinh(0.6382728_sp) if (asinh(0.6382728_sp) - (0.601365387_sp) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_51.f900000664000175000017500000000165115141516316025076 0ustar alastairalastairmodule bit_type_51 implicit none type, abstract :: bitset_type integer :: flag contains procedure(from_string_abstract), deferred, pass(self) :: from_string end type bitset_type type, extends(bitset_type) :: bitset_large contains procedure, pass(self) :: from_string => from_string_large end type bitset_large abstract interface subroutine from_string_abstract(self) import :: bitset_type class(bitset_type), intent(out) :: self end subroutine from_string_abstract end interface contains subroutine from_string_large(self) class(bitset_large), intent(out) :: self if (self%flag /= 1) error stop end subroutine from_string_large end module program derived_types_51 use bit_type_51 implicit none type(bitset_large) :: b b%flag = 1 call b%from_string() end program derived_types_51 lfortran-lfortran-2f73434/integration_tests/logical2.f900000664000175000017500000000047015141516316023415 0ustar alastairalastairprogram logical2 ! this program checks logical operators implicit none ! variable declaration logical :: a, b ! assigning values a = .true. b = .false. if (a .and. b) then print *, "Line 1 - Condition is true" else print *, "Line 1 - Condition is false" end if end program logical2 lfortran-lfortran-2f73434/integration_tests/modules_24.f900000664000175000017500000000177015141516316023702 0ustar alastairalastairmodule tomlf_de_tokenizer_24 implicit none type :: toml_table logical :: inline = .false. end type toml_table type, abstract :: toml_tokenizer type(toml_table), pointer :: current => null() end type toml_tokenizer type, extends(toml_tokenizer) :: toml_tokenizer_ end type toml_tokenizer_ contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de type(toml_table), pointer :: table nullify(table) de%current => table end subroutine parse_select end module tomlf_de_tokenizer_24 program modules_24 use tomlf_de_tokenizer_24 implicit none type(toml_tokenizer_), target :: tokenizer class(toml_tokenizer), pointer :: tokenizer_ptr tokenizer_ptr => tokenizer call parse_select(tokenizer) ! TODO: Uncomment and fix the ASR verify pass ! error. Struct() is pointing to tomlf_de_tokenizer's ! toml_table but it should instead point to the imported ! toml_table ! print *, tokenizer%current end program lfortran-lfortran-2f73434/integration_tests/namelist_14.f900000664000175000017500000000411215141516316024036 0ustar alastairalastairprogram test_char_arrays implicit none character(len=20) :: names(5) character(len=10) :: codes(3) integer :: i namelist /strings/ names, codes ! Initialize names(1) = 'Alice' names(2) = 'Bob' names(3) = 'Charlie' names(4) = 'Diana' names(5) = 'Eve' codes(1) = 'ABC' codes(2) = 'DEF' codes(3) = 'GHI' ! Write open(10, file='strings.dat', status='replace', form='formatted') write(10, nml=strings) close(10) ! Reset names = '' codes = '' ! Read open(10, file='strings.dat', status='old', form='formatted') read(10, nml=strings) close(10) ! Verify if (trim(names(1)) /= 'Alice') then print *, "Error: names(1) =", trim(names(1)), "expected Alice" error stop "Test failed for names(1)" end if if (trim(names(3)) /= 'Charlie') then print *, "Error: names(3) =", trim(names(3)), "expected Charlie" error stop "Test failed for names(3)" end if if (trim(codes(2)) /= 'DEF') then print *, "Error: codes(2) =", trim(codes(2)), "expected DEF" error stop "Test failed for codes(2)" end if ! Verify all names if (trim(names(2)) /= 'Bob') then print *, "Error: names(2) =", trim(names(2)), "expected Bob" error stop "Test failed for names(2)" end if if (trim(names(4)) /= 'Diana') then print *, "Error: names(4) =", trim(names(4)), "expected Diana" error stop "Test failed for names(4)" end if if (trim(names(5)) /= 'Eve') then print *, "Error: names(5) =", trim(names(5)), "expected Eve" error stop "Test failed for names(5)" end if ! Verify all codes if (trim(codes(1)) /= 'ABC') then print *, "Error: codes(1) =", trim(codes(1)), "expected ABC" error stop "Test failed for codes(1)" end if if (trim(codes(3)) /= 'GHI') then print *, "Error: codes(3) =", trim(codes(3)), "expected GHI" error stop "Test failed for codes(3)" end if print *, "Character array namelist test passed!" end program test_char_arrays lfortran-lfortran-2f73434/integration_tests/class_19.f900000664000175000017500000000107615141516316023342 0ustar alastairalastairmodule class_19_mod implicit none type :: toml_value contains procedure :: destroy end type type :: toml_node class(toml_value), allocatable :: val end type toml_node contains subroutine destroy(self, val) class(toml_value), intent(inout) :: self integer, intent(in) :: val print *, "Destroying toml_value" if (val /= 42) error stop end subroutine end module program class_19 use class_19_mod implicit none type(toml_node) :: tmp allocate(tmp%val) call tmp%val%destroy(42) end program class_19 lfortran-lfortran-2f73434/integration_tests/lapack_09.f900000664000175000017500000000063615141516316023470 0ustar alastairalastair! MRE: COMMON block scalar passed to external subroutine argument. ! Reduced from LAPACK BLAS testing sources with COMMON blocks. program lapack_09 implicit none integer :: n common /combla/ n external :: bar n = 41 call bar(n) if (n /= 42) error stop print *, 'PASS' end program subroutine bar(n) implicit none integer, intent(inout) :: n n = n + 1 end subroutine lfortran-lfortran-2f73434/integration_tests/modules_18b.f900000664000175000017500000000366715141516316024056 0ustar alastairalastairmodule modules_18b use iso_c_binding, only: c_int, c_long_long, c_float, c_double implicit none contains integer function f(a, b) result(r) integer, intent(in) :: a real, intent(in) :: b interface ! int f_int_float_value(int a, float b) integer(c_int) function f_int_float_value(a, b) result(r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b end function end interface r = f_int_float_value(a, b) end function subroutine g(a, b, r) integer, intent(in) :: a real, intent(in) :: b integer, intent(out) :: r interface ! void sub_int_float_value(int a, float b, int *r) subroutine sub_int_float_value(a, b, r) bind(c) import :: c_int, c_float integer(c_int), value, intent(in) :: a real(c_float), value, intent(in) :: b integer(c_int), intent(out) :: r end subroutine end interface call sub_int_float_value(a, b, r) end subroutine integer(c_int) function fortran_i32(i) result(r) bind(c) integer(c_int), intent(in) :: i r = i + 2 end function integer(c_int) function fortran_i32_value(i) result(r) bind(c) integer(c_int), value, intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64(i) result(r) bind(c) integer(c_long_long), intent(in) :: i r = i + 2 end function integer(c_long_long) function fortran_i64_value(i) result(r) bind(c) integer(c_long_long), value, intent(in) :: i r = i + 2 end function real(c_float) function fortran_f32(i) result(r) bind(c) real(c_float), intent(in) :: i r = i + 2.3_c_float end function real(c_float) function fortran_f32_value(i) result(r) bind(c) real(c_float), value, intent(in) :: i r = i + 2.3_c_float end function real(c_double) function fortran_f64(i) result(r) bind(c) real(c_double), intent(in) :: i r = i + 2.3_c_double end function real(c_double) function fortran_f64_value(i) result(r) bind(c) real(c_double), value, intent(in) :: i r = i + 2.3_c_double end function end module lfortran-lfortran-2f73434/integration_tests/template_monoid.f900000664000175000017500000000264015141516316025102 0ustar alastairalastairmodule monoid_m use semigroup_m, only: semigroup, extended_semigroup, derive_extended_semigroup implicit none private public :: monoid, extended_monoid, derive_extended_monoid requirement monoid(T, combine, empty) require :: semigroup(T, combine) pure function empty() type(T) :: empty end function end requirement requirement extended_monoid(T, combine, sconcat, stimes, empty, mconcat) require :: extended_semigroup(T, combine, sconcat, stimes) require :: monoid(T, combine, empty) pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined end function end requirement template derive_extended_monoid(T, combine, empty) require :: monoid(T, combine, empty) private public :: stimes, mconcat instantiate derive_extended_semigroup(T, combine), only: stimes contains pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else combined = empty() end if end function end template end module lfortran-lfortran-2f73434/integration_tests/modules_18.f900000664000175000017500000000037315141516316023703 0ustar alastairalastairprogram modules_18 use iso_fortran_env, only: sp=>real32 use modules_18b, only: f, g implicit none integer :: i, a real(sp) :: r32 a = 3 r32 = 5 i = f(a, r32) print *, i if (i /= 8) error stop call g(a, r32, i) print *, i if (i /= 8) error stop end lfortran-lfortran-2f73434/integration_tests/attr_dim_03.f900000664000175000017500000000026515141516316024030 0ustar alastairalastairsubroutine sub (array) dimension array(*) double precision array end subroutine program attr_dim_03 double precision , dimension(3) :: arr call sub(arr) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_109.f900000664000175000017500000000116515141516316024501 0ustar alastairalastairprogram intrinsics_109 integer, parameter :: N = 2 real :: A(N, N), B(N, N), C(N, N), D(N,N), E(N,N) ! Initialize matrices A and B as 2x2 identity matrices A = reshape([1.0, 0.0, 0.0, 1.0], shape(A)) B = reshape([1.0, 0.0, 0.0, 1.0], shape(B)) ! Perform matrix multiplication: C = A * B C = matmul( matrix_a = A, matrix_b = B ) D = matmul( A, matrix_b = B ) E = matmul( A, B ) ! Print the matrices print *, "Matrix A (2x2 identity matrix):" print *, A print *, "Matrix B (2x2 identity matrix):" print *, B print *, "Matrix C (result of A * B):" print *, C end lfortran-lfortran-2f73434/integration_tests/functions_13.f900000664000175000017500000000166215141516316024240 0ustar alastairalastairmodule test_scan_module implicit none contains subroutine test_scan_intrinsic() if( scan("fortran", "ao") /= 2 ) error stop ! 2, found 'o' if( scan("fortran", "ao", .true.) /= 6 ) error stop ! 6, found 'a' if( scan("fortran", "c++") /= 0 ) error stop ! 0, found none end subroutine end module program test_scan_verify use test_scan_module, only: test_scan_intrinsic implicit none call test_scan_intrinsic() print *, test_verify_intrinsic() contains logical function test_verify_intrinsic() result(r) if( verify("fortran", "ao") /= 1) error stop ! 1, found 'f' if( verify("fortran", "foo") /= 3) error stop ! 3, found 'r' if( verify("fortran", "c++") /= 1) error stop ! 1, found 'f' if( verify("fortran", "c++", .true.) /= 7 ) error stop ! 7, found 'n' if( verify("fortran", "fortran") /= 0) error stop ! 0' found none r = .true. end function end program lfortran-lfortran-2f73434/integration_tests/modules_51.f900000664000175000017500000000037215141516316023677 0ustar alastairalastairmodule modules_51_module public :: a end module subroutine sub() use modules_51_module if (abs(a - 2.0) > 1e-8) error stop print *, a end subroutine program modules_51 use modules_51_module a = 2 call sub() end program lfortran-lfortran-2f73434/integration_tests/product_02.f900000664000175000017500000000042315141516316023700 0ustar alastairalastairprogram product_02 integer :: i, j integer(8) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = i + j end do end do xdiff = abs(product(x) - 12192768000_8) print *, xdiff if( xdiff /= 0_8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_141.f900000664000175000017500000000350115141516316024471 0ustar alastairalastairprogram intrinsic_141 implicit none real :: x = 178.1387e-4 integer :: i = 5 real :: y = -186.3245e-4 integer :: j = 3 real, parameter :: x1 = scale(11.0, 2) real(8), parameter :: y1 = scale(-11.0_8, 2) real(8), parameter :: z1 = scale(11.0, 2_8) real, parameter ::ar1(3) = scale([1.0, 21.0, 13.0], 2) real(8), parameter :: ar2(3) = scale([1.0_8, 2.0_8, 3.0_8], 2) real(8), parameter :: ar3(3) = scale([1.0, 2.0, 3.0], 2_8) real :: arr1(3) = [1.0, 21.0, 13.0] real(8) :: arr2(3) = [1.0_8, 2.0_8, 3.0_8] integer :: arr3(3) = [1, 2, 3] print *, scale(arr1, arr3) if (any(abs(scale(arr1, arr3) - [2.00000000e+00, 84.0000000, 104.000000]) > 1e-7)) error stop print *, scale(arr2, 2) if (any(abs(scale(arr2, 2) - [4.00000000e+00, 8.00000000, 12.0000000]) > 1e-7)) error stop print *, x1 if (abs(x1 - 4.40000000e+01) > 1e-7) error stop print *, y1 if (abs(y1 - (-4.40000000000000000e+01)) > 1e-7) error stop print *, z1 if (abs(z1 - 4.40000000000000000e+01) > 1e-7) error stop print *, ar1 if (any(abs(ar1 - [4.00000000e+00, 8.40000000e+01, 5.20000000e+01]) > 1e-7)) error stop print *, ar2 if (any(abs(ar2 - [4.00000000000000000e+00, 8.00000000000000000e+00, 1.20000000000000000e+01]) > 1e-7)) error stop print *, ar3 if (any(abs(ar3 - [4.00000000000000000e+00, 8.00000000000000000e+00, 1.20000000000000000e+01]) > 1e-7)) error stop print *, scale(y,j) if (abs(scale(y, j) - (-1.49059594e-01)) > 1e-7) error stop print *, scale(-186.3245e-4,3) if (abs(scale(-186.3245e-4,3) - (-1.49059594e-01)) > 1e-7) error stop print *, scale(x,i) if (abs(scale(x, i) - 5.70043862e-01) > 1e-7) error stop print *, scale(178.1387e-4,5) if (abs(scale(178.1387e-4, 5) - 5.70043862e-01) > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/reserved_03.f900000664000175000017500000000036015141516316024040 0ustar alastairalastairprogram reserved_03 implicit none integer endsubroutine call integer if (endsubroutine /= 1) error stop contains subroutine integer integer subroutine subroutine = 1 endsubroutine & = subroutine/subroutine endsubroutine & ; end program lfortran-lfortran-2f73434/integration_tests/bin_op_real_01.f900000664000175000017500000000057115141516316024474 0ustar alastairalastairprogram bin_op_real_01 implicit none real :: R(4), V(4) R = 23 V = 9 print *, func(R, V) if (func(R, V) /= 39304) error stop if (((sum(R) - 9.16E-04) > -1e-8)) error stop contains integer function func(R, V) result(i) real, intent(inout) :: R(:), V(:) i = (34**3) R = -(R-V)/i end function end program bin_op_real_01 lfortran-lfortran-2f73434/integration_tests/class_52.f900000664000175000017500000000075715141516316023344 0ustar alastairalastairmodule class_52_m type, abstract :: AbsType integer :: n = 10 end type AbsType type, extends(AbsType) :: MyType end type MyType interface MyType procedure :: init end interface MyType contains function init() result(self) type(MyType) :: self self%n = 44 end function init end module class_52_m program class_52 use class_52_m class(AbsType), allocatable :: obj obj = MyType() if (obj%n /= 44) error stop end program class_52 lfortran-lfortran-2f73434/integration_tests/elemental_03.f900000664000175000017500000000106715141516316024174 0ustar alastairalastairprogram elemental_03 real :: x(2) = [1, 2], y(2) = [1.0, 2.1] logical :: close(2) close = is_close(x, y, 1e-9) print *, close if (.not. close(1)) error stop if (close(2)) error stop close = is_close(x, y) print *, close if (.not. close(1)) error stop if (close(2)) error stop contains elemental logical function is_close(a, b, rel_tol) result(close) real, intent(in) :: a, b real, intent(in), optional :: rel_tol if (present(rel_tol)) then close = abs(a - b) <= rel_tol else close = abs(a - b) <= 1e-9 end if end function is_close end program elemental_03 lfortran-lfortran-2f73434/integration_tests/intrinsics_36.f900000664000175000017500000000177315141516316024425 0ustar alastairalastairprogram intrinsics_36 implicit none character(len=25) :: empty = adjustl('') character(len=25) :: all_spaces = adjustl(' ') character(len=25) :: simple = adjustl('gfortran') character(len=25) :: space_at_start = adjustl(' gfortran') character(len=25) :: space_at_end = adjustl('gfortran ') character(len=25) :: space_in_between = adjustl(' g for tran ') character(len=25) :: spaces_with_symbols = adjustl(' # gfor* t $ ran & ') print *, empty if (empty /= '') error stop print *, all_spaces if (all_spaces /= ' ') error stop print *, simple if (simple /= 'gfortran') error stop print *, space_at_start if (space_at_start /= 'gfortran ') error stop print *, space_at_end if (space_at_end /= 'gfortran ') error stop print *, space_in_between if (space_in_between /= 'g for tran ') error stop print *, spaces_with_symbols if (spaces_with_symbols /= '# gfor* t $ ran & ') error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_60.f900000664000175000017500000000063215141516316024413 0ustar alastairalastairprogram intrinsics_60 character :: c, d, e, f open(11, file="intrinsics_60_data.txt", form="formatted", access="stream", status="old") read(11, *) c, d, e, f print *, c, d, e, f print *, iachar(c), iachar(d), iachar(e), iachar(f) if (iachar(c) /= 97) error stop if (iachar(d) /= 90) error stop if (iachar(e) /= 195) error stop if (iachar(f) /= 194) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_130.f900000664000175000017500000000245415141516316024475 0ustar alastairalastairprogram intrinsics_130 integer(4) :: x, y1, y2, y3 integer(1) :: i1 = 7_1 integer(2) :: i2 = 7_2 integer(4) :: i4 = 7_4 integer(8) :: i8 = 7_8 x = 10 y1 = 2 y2 = 0 y3 = -2 print*, ishft(10_4, 2) print*, ishft(10_4, 0) print*, ishft(10_4, -2) print*, ishft(x, y1) if (ishft(x, y1) /= 40) error stop print*, ishft(x, y2) if (ishft(x, y2) /= 10) error stop print*, ishft(x, y3) if (ishft(x, y3) /= 2) error stop i8 = ishft(i1, 2_1) if (i8 /= 28) error stop i8 = ishft(i2, 2) if (i8 /= 28) error stop i8 = ishft(i4, 2_1) if (i8 /= 28) error stop i8 = ishft(i8, 2) if (i8 /= 112) error stop i4 = ishft(i1, 2) if (i4 /= 28) error stop i4 = ishft(i2, 2_1) if (i4 /= 28) error stop i4 = ishft(i4, 2) if (i4 /= 112) error stop i4 = ishft(i8, 2_2) if (i4 /= 448) error stop i2 = ishft(i1, 2) if (i2 /= 28) error stop i2 = ishft(i2, 2) if (i2 /= 112) error stop i2 = ishft(i4, 2_4) if (i2 /= 1792) error stop i2 = ishft(i8, 2) if (i2 /= 448) error stop i1 = ishft(i1, 2) if (i1 /= 28) error stop i1 = ishft(i2, 2_2) if (i1 /= 0) error stop i1 = ishft(i4, 2) if (i1 /= 0) error stop i1 = ishft(i8, 2_2) if (i1 /= -64) error stop endlfortran-lfortran-2f73434/integration_tests/intrinsics_185.f900000664000175000017500000000517615141516316024513 0ustar alastairalastairprogram intrinsics_185 implicit none character(7) :: fortran = "FORTRAN" character(2) :: af = "AF" character(3) :: foo = "FOO" character(3) :: c_plus_plus = "C++" character(6) :: fortr = "FORTR" character(1) :: n = "N" integer :: arr2(2) character(len=5) :: string = "hello" character(len=1) :: set(2) = ["l", "h"] integer, parameter :: i1 = verify("FORTRAN", "AF", .true., 4) integer, parameter :: i2 = verify("FORTRAN", "FOO", kind = 8) integer, parameter :: i3 = verify("FORTRAN", "C++", .true.) integer, parameter :: i4 = verify("FORTR", "N") integer, parameter :: i5 = verify("FORTRAN", "FORTRAN", .true.) integer, parameter :: ar1(2) = verify(["FORTRAN", "GORTRAN"], ["FO", "GR"]) integer, parameter :: ar2(2) = verify(["FORTRAN", "GORTRAN"], ["FN", "NA"], .TRUE.) print*, i1 if (i1 /= 7) error stop print*, i2 if (i2 /= 3_8) error stop print*, i3 if (i3 /= 7) error stop print*, i4 if (i4 /= 1) error stop print*, i5 if (i5 /= 0) error stop print*, ar1 if (any(ar1 /= [3, 2])) error stop print*, ar2 if (any(ar2 /= [6, 5])) error stop print*, verify("FORTRAN", "AF", .true., 4) if ( verify("FORTRAN", "AF", .true., 4) /= 7 ) error stop print*, verify("FORTRAN", "FOO", kind = 8) if ( verify("FORTRAN", "FOO", kind = 8) /= 3_8 ) error stop print*, verify("FORTRAN", "C++", .true.) if ( verify("FORTRAN", "C++", .true.) /= 7 ) error stop print*, verify("FORTR", "N") if ( verify("FORTR", "N") /= 1 ) error stop print*, verify("FORTRAN", "FORTRAN", .true.) if ( verify("FORTRAN", "FORTRAN", .true.) /= 0 ) error stop print*, verify(fortran, af, kind = 4) if ( verify(fortran, af, kind = 4) /= 2_4 ) error stop print*, verify(fortran, foo, .true.) if ( verify(fortran, foo, .true.) /= 7 ) error stop print*, verify(fortran, c_plus_plus) if ( verify(fortran, c_plus_plus) /= 1 ) error stop print*, verify(fortr, n, .true., 8) if ( verify(fortr, n, .true., 8) /= 6_8 ) error stop print*, verify(fortran, fortran) if ( verify(fortran, fortran) /= 0 ) error stop ! make sure that broadcasting is done correctly for `verify` arr2 = verify(["FORTRAN", "GORTRAN"], ["FO", "GR"]) print*, arr2 if (any(arr2 /= [3, 2])) error stop arr2 = verify(["FORTRAN", "GORTRAN"], ["FN", "NA"], .TRUE.) print*, arr2 if (any(arr2 /= [6, 5])) error stop arr2 = verify(string, set) print*, arr2 if (any(arr2 /= [1, 2])) error stop arr2 = verify(string, set, .TRUE., 4) print*, arr2 if (any(arr2 /= [5, 5])) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_04.f900000664000175000017500000000077215141516316023527 0ustar alastairalastairsubroutine omp_func(n) use omp_lib implicit none integer, intent(in) :: n integer :: i !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" print *, "i = ", i, "from thread = ", omp_get_thread_num() if (omp_get_thread_num() > 4) error stop end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 10) error stop end subroutine program openmp_04 use omp_lib integer :: n = 10 call omp_set_num_threads(4) call omp_func(n) print *, "Done for n = ", n end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops18.f900000664000175000017500000000176615141516316025424 0ustar alastairalastairprogram implied_do_loops18 implicit none type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: file_names(:) logical, allocatable :: is_source(:) integer :: i allocate(file_names(3)) file_names(1)%s = "main.f90" file_names(2)%s = ".gitignore" file_names(3)%s = "utils.f90" i = 100 is_source = [(is_hidden_file(basename(file_names(i)%s)), i = 1, size(file_names))] do i = 1, size(is_source) print *, trim(file_names(i)%s), " -> ", is_source(i) end do if (any(is_source .neqv. [.false., .true., .false.])) error stop contains function basename(path) result(tmp) character(len=*), intent(in) :: path character(len=:), allocatable :: tmp tmp = path end function basename logical function is_hidden_file(name) character(len=*), intent(in) :: name is_hidden_file = (len(name) > 0 .and. name(1:1) == ".") end function is_hidden_file end program implied_do_loops18 lfortran-lfortran-2f73434/integration_tests/arrays_56.f900000664000175000017500000000073715141516316023542 0ustar alastairalastairprogram arrays_56 implicit none integer, parameter :: N = 10 real :: x(N), y(N) x = 3 y = 4 call f(g(g(x(:4)-y(:4))**2), 3.0) contains subroutine f(A, correct) real, intent(in) :: A(:) real, intent(in) :: correct print *, A if( any(A /= correct) ) error stop end subroutine function g(A) result(r) real, intent(in) :: A(:) real :: r(size(A)) r = A+2 end function end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_06.f900000664000175000017500000000031015141516316026421 0ustar alastairalastairprogram separate_compilation_06 use separate_compilation_06b_module real :: R(4), Rp(4), rho(4) real :: V(4) R = 124.125 Rp = 0.125 rho = 0.1253512 V = rpoisson_outward_pc(R, Rp, rho) end program lfortran-lfortran-2f73434/integration_tests/goto_03.f900000664000175000017500000000040115141516316023165 0ustar alastairalastairprogram goto_03 implicit none integer :: a, n n = 2 a = 10 go to (1, 2, 3), n 1 a = a + 10 2 a = a + 20 3 a = a + 30 if(a /= 60) error stop assign 30 to n go to n, (10, 20, 30) 10 a = a * a 20 a = a + a 30 a = a - a if(a /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/class_82.f900000664000175000017500000000217215141516316023340 0ustar alastairalastairprogram class_82 implicit none class(*), allocatable :: xi, xr, xl integer :: i real :: r logical :: l ! Test integer binary operations allocate(xi, source=5) select type (xi) type is (integer) i = xi * 2 print *, i, xi if (i /= 10) error stop "Integer multiply failed" i = xi + 3 print *, i, xi if (i /= 8) error stop "Integer add failed" end select ! Test real binary operations allocate(xr, source=3.0) select type (xr) type is (real) r = xr * 2.0 print *, r, xr if (abs(r - 6.0) > 1e-5) error stop "Real multiply failed" r = xr + 1.5 print *, r, xr if (abs(r - 4.5) > 1e-5) error stop "Real add failed" end select ! Test logical binary operations allocate(xl, source=.true.) select type (xl) type is (logical) l = xl .and. .false. print *, l, xl if (l) error stop "Logical AND failed" l = xl .or. .false. print *, l, xl if (.not. l) error stop "Logical OR failed" end select print *, "PASSED" end program class_82 lfortran-lfortran-2f73434/integration_tests/bindc_05c.c0000664000175000017500000000051215141516316023270 0ustar alastairalastair#include #include void* ax(int comm_f) { int* p = (int*) malloc(sizeof(int)); if (p == NULL) { fprintf(stderr, "Memory allocation failed\n"); return NULL; } *p = comm_f; printf("C function received: %d, returning pointer: %p\n", comm_f, (void*) p); return (void*) p; }lfortran-lfortran-2f73434/integration_tests/string_74.f900000664000175000017500000000052115141516316023536 0ustar alastairalastair ! This tests the speed of assigning substrings of a string to another string. ! It used to fill the memory and kills the process. program string_74 character(100000) :: str character(100000) :: str_2 integer :: i str = "whatever" do i =1 , 100000 str_2 = str_2(1:i) end do end program string_74lfortran-lfortran-2f73434/integration_tests/types_real_array_to_complex_array_cast.f900000664000175000017500000000043715141516316031732 0ustar alastairalastairprogram types_real_array_to_complex_array_cast integer, parameter :: dp = kind(0.d0) complex(dp) :: D(3) = [1.0_dp, 2.0_dp, 3.0_dp] if (any(D /= [(1.0_dp, 0.0_dp), & (2.0_dp, 0.0_dp), & (3.0_dp, 0.0_dp)])) & error stop end program lfortran-lfortran-2f73434/integration_tests/modules_12.f900000664000175000017500000000023615141516316023673 0ustar alastairalastairmodule module_12 implicit none integer :: A(5) end module program prog_module_12 use module_12 implicit none A(5) = 5 if (A(5) /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_36.f900000664000175000017500000000362215141516316024017 0ustar alastairalastairmodule allocate_36_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t type :: preprocess_config_t type(string_t), allocatable :: macros(:) end type preprocess_config_t contains subroutine new(self, macros) type(preprocess_config_t), intent(inout) :: self type(string_t), intent(in) :: macros(:) ! Defensive checks if (allocated(self%macros)) then print *, "Deallocating existing macros" deallocate(self%macros) end if if (allocated(self%macros)) then error stop "ERROR: self%macros still allocated after deallocate" end if allocate(self%macros, source=macros) if (.not. allocated(self%macros)) then error stop "ERROR: allocation of self%macros failed" end if if (size(self%macros) /= size(macros)) then error stop "ERROR: size mismatch after allocate(source=)" end if end subroutine new end module allocate_36_mod program allocate_36 use allocate_36_mod implicit none type(preprocess_config_t) :: cpp_config ! First initialization call new(cpp_config, [ & string_t('SOME_FEATURE'), & string_t('SIMPLE_MACRO') ]) if (.not. allocated(cpp_config%macros)) then error stop "ERROR: macros not allocated after first call" end if if (size(cpp_config%macros) /= 2) then error stop "ERROR: wrong size after first call" end if ! Second re-initialization call new(cpp_config, [ string_t('FIFTH_FEATURE') ]) if (.not. allocated(cpp_config%macros)) then error stop "ERROR: macros not allocated after second call" end if if (size(cpp_config%macros) /= 1) then error stop "ERROR: wrong size after second call" end if print *, "OK: MRE completed successfully" end program allocate_36 lfortran-lfortran-2f73434/integration_tests/namelist_12.f900000664000175000017500000001007015141516316024034 0ustar alastairalastairprogram test_iostat implicit none integer :: arr(10) real :: val integer :: iostat_val integer :: i namelist /test/ arr, val ! Test 1: Successful read (iostat = 0) arr = -999 val = -999.0 open(unit=10, file='namelist_iostat_success.dat', status='replace', form='formatted') write(10, '(A)') ' &TEST' write(10, '(A)') ' arr = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10' write(10, '(A)') ' val = 42.5' write(10, '(A)') ' /' close(10) open(unit=10, file='namelist_iostat_success.dat', status='old', form='formatted') read(10, nml=test, iostat=iostat_val) close(10) if (iostat_val /= 0) then print *, "Error: Expected iostat=0 for successful read, got", iostat_val error stop "Test 1 failed" end if if (arr(5) /= 5 .or. abs(val - 42.5) > 1.0e-5) then print *, "Error: Data read incorrectly" error stop "Test 1 failed - data mismatch" end if print *, "Test 1 passed: Successful read with iostat=0" ! Test 2: Array index out of bounds (iostat = 5015) arr = -999 open(unit=20, file='namelist_iostat_bounds.dat', status='replace', form='formatted') write(20, '(A)') ' &TEST' write(20, '(A)') ' arr(20) = 99' ! Index 20 is out of bounds (array size is 10) write(20, '(A)') ' /' flush(20) close(20) open(unit=20, file='namelist_iostat_bounds.dat', status='old', form='formatted') read(20, nml=test, iostat=iostat_val) close(20) #ifdef __LFORTRAN__ if (iostat_val /= 5015) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5015 for bounds error, got", iostat_val error stop "Test 2 failed" end if print *, "Test 2 passed: Bounds error detected with iostat=5015, got", iostat_val ! Test 3: Repeat count overflow (iostat = 5015) arr = -999 open(unit=30, file='namelist_iostat_repeat.dat', status='replace', form='formatted') write(30, '(A)') ' &TEST' write(30, '(A)') ' arr = 15*1' ! Repeat count 15 exceeds array size 10 write(30, '(A)') ' /' flush(30) close(30) open(unit=30, file='namelist_iostat_repeat.dat', status='old', form='formatted') read(30, nml=test, iostat=iostat_val) close(30) #ifdef __LFORTRAN__ if (iostat_val /= 5015) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5015 for repeat overflow, got", iostat_val error stop "Test 3 failed" end if print *, "Test 3 passed: Repeat count overflow detected with iostat=5015, got", iostat_val ! Test 4: Unknown variable (iostat = 5012) arr = -999 open(unit=40, file='namelist_iostat_unknown.dat', status='replace', form='formatted') write(40, '(A)') ' &TEST' write(40, '(A)') ' unknown_var = 123' write(40, '(A)') ' /' flush(40) close(40) open(unit=40, file='namelist_iostat_unknown.dat', status='old', form='formatted') read(40, nml=test, iostat=iostat_val) close(40) #ifdef __LFORTRAN__ if (iostat_val /= 5012) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5012 for unknown variable, got", iostat_val error stop "Test 4 failed" end if print *, "Test 4 passed: Unknown variable detected with iostat=5012, got", iostat_val ! Test 5: Group not found (iostat = 5010) arr = -999 open(unit=50, file='namelist_iostat_notfound.dat', status='replace', form='formatted') write(50, '(A)') ' &WRONG_GROUP' write(50, '(A)') ' arr = 1, 2, 3' write(50, '(A)') ' /' flush(50) close(50) open(unit=50, file='namelist_iostat_notfound.dat', status='old', form='formatted') read(50, nml=test, iostat=iostat_val) close(50) #ifdef __LFORTRAN__ if (iostat_val /= 5010) then #else if (iostat_val == 0) then #endif print *, "Error: Expected iostat=5010 for group not found, got", iostat_val error stop "Test 5 failed" end if print *, "Test 5 passed: Group not found detected with iostat=5010, got", iostat_val print *, "All IOSTAT error handling tests passed!" end program test_iostat lfortran-lfortran-2f73434/integration_tests/line_continuation_05.f900000664000175000017500000000077615141516316025757 0ustar alastairalastairprogram main implicit none character(len=28),allocatable :: textblock(:) integer :: i, n n = 7 allocate(textblock(n)) textblock = [character(len=28) :: & '!'//repeat(' ', 27), & 's=&'//repeat(' ', 24), & '& !'//repeat(' ', 24), & ' & ! 225'//repeat(' ', 19), & '( 0.0,-1.0 ) ! 270'//repeat(' ', 13), & ' do i=1,size(vals)'//repeat(' ', 3), & ''//repeat(' ', 28) ] do i = 1, n print *, textblock(i) end do deallocate(textblock) end program main lfortran-lfortran-2f73434/integration_tests/allocate_38.f900000664000175000017500000000064715141516316024025 0ustar alastairalastairprogram allocate_38 implicit none character(len=:), allocatable :: a(:) a = sg() if (a(1) /= "hello" .or. a(2) /= "world") error stop "sg() returned wrong values" contains function sg() result(res) character(len=:), allocatable :: res(:) character(len=5), parameter :: unnamed(2) = ["hello", "world"] allocate(res, source=unnamed) end function sg end program allocate_38 lfortran-lfortran-2f73434/integration_tests/openmp_bindc_03.f900000664000175000017500000000662015141516316024663 0ustar alastairalastairmodule bindc_03_thread_data_module use, intrinsic :: iso_c_binding type, bind(C) :: thread_data integer(c_int) :: n type(c_ptr) :: a end type thread_data end module bindc_03_thread_data_module module module_openmp_bindc_03 use iso_c_binding implicit none interface subroutine GOMP_parallel (fn, data, num_threads, flags) bind (C, name="GOMP_parallel") import :: c_funptr, c_ptr, c_int type(c_funptr), value :: fn type(c_ptr), value :: data integer(c_int), value :: num_threads integer(c_int), value :: flags end subroutine subroutine GOMP_barrier() bind(C, name="GOMP_barrier") end subroutine subroutine GOMP_critical_start() bind(C, name="GOMP_critical_start") end subroutine subroutine GOMP_critical_end() bind(C, name="GOMP_critical_end") end subroutine function omp_get_max_threads() bind(c, name="omp_get_max_threads") import :: c_int integer(c_int) :: omp_get_max_threads end function omp_get_max_threads function omp_get_thread_num() bind(c, name="omp_get_thread_num") import :: c_int integer(c_int) :: omp_get_thread_num end function omp_get_thread_num subroutine omp_set_num_threads(n) bind(c, name="omp_set_num_threads") import :: c_int integer(c_int), value :: n end subroutine omp_set_num_threads subroutine GOMP_atomic_start() bind(C, name="GOMP_atomic_start") end subroutine subroutine GOMP_atomic_end() bind(C, name="GOMP_atomic_end") end subroutine end interface end module subroutine lcompilers_initialise_array(data) bind(C) use bindc_03_thread_data_module use iso_c_binding use module_openmp_bindc_03 implicit none type(c_ptr), value :: data type(thread_data), pointer :: tdata real(c_float), pointer :: a(:) integer(c_int) :: i, n, num_threads, chunk, leftovers, thread_num, start, end call c_f_pointer(data, tdata) n = tdata%n call c_f_pointer(tdata%a, a, [n]) num_threads = omp_get_max_threads() chunk = n / num_threads leftovers = mod(n, num_threads) thread_num = omp_get_thread_num() start = chunk * thread_num if (thread_num < leftovers) then start = start + thread_num else start = start + leftovers end if end = start + chunk if (thread_num < leftovers) then end = end + 1 end if do i = start + 1, end ! print *, "Thread ", thread_num, " is processing element ", i a(i) = 12.91 end do call GOMP_barrier() end subroutine subroutine initialize_array(n, a) use bindc_03_thread_data_module use module_openmp_bindc_03 implicit none interface subroutine lcompilers_initialise_array(data) bind(C) use iso_c_binding type(c_ptr), value :: data end subroutine end interface integer(c_int), intent(in) :: n real(c_float), dimension(:), intent(inout), pointer :: a type(thread_data), target :: data type(c_ptr) :: tdata data%n = n allocate(a(data%n)) data%a = c_loc(a) tdata = c_loc(data) call GOMP_parallel(c_funloc(lcompilers_initialise_array), tdata, 0, 0) end subroutine program openmp_bindc_03 use omp_lib use module_openmp_bindc_03 use bindc_03_thread_data_module implicit none interface subroutine initialize_array(n, a) use iso_c_binding integer(c_int), intent(in) :: n real(c_float), intent(inout), dimension(:), pointer :: a end subroutine end interface integer(c_int) :: n = 1000000 real(c_float), dimension(:), pointer :: a call omp_set_num_threads(4) call initialize_array(n, a) print *, "Done" print *, "a[1] = ", a(1) print * , "a[1000000] = ", a(1000000) if (abs(a(1) - 12.91) > 1e-8) error stop if (abs(a(1000000) - 12.91) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/file_open_05.f900000664000175000017500000000022515141516316024163 0ustar alastairalastairprogram file_open_5 use iso_fortran_env, only: output_unit open(output_unit, encoding="UTF-8") print *, "Hello" end program file_open_5 lfortran-lfortran-2f73434/integration_tests/array_bound_5.f900000664000175000017500000000075415141516316024457 0ustar alastairalastairprogram array_bound_5 implicit none real :: arr(10, 20) call test_assumed_size_bounds(arr) contains subroutine test_assumed_size_bounds(a) real :: a(10, *) ! lbound/ubound on non-last dimensions are valid for assumed-size arrays if (lbound(a, 1) /= 1) error stop if (ubound(a, 1) /= 10) error stop if (lbound(a, 2) /= 1) error stop ! ubound(a, 2) would be an error - last dim is assumed-size print *, "OK: assumed-size array bounds" end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_207.f900000664000175000017500000000710615141516316024501 0ustar alastairalastairprogram intrinsics_207 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: x real :: x4 real(8) :: x8 complex(8) :: z8 print*, dacosh(1.0_dp) if( abs(dacosh(1.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, dacos(1.0_dp) if( abs(dacos(1.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, dasin(1.0_8) if (abs(dasin(1.0_8) - 1.570796326794896_sp) > 10e-5 ) error stop print*, dasinh(1.0_8) if (abs(dasinh(1.0_8) - 0.881373587019543_sp) > 10e-5 ) error stop print*, datanh(0.0_dp) if (abs(datanh(0.0_dp) - 0.0_dp) > 10e-5 ) error stop print*, isign(1, 1) if (isign(1, 1) /= 1) error stop print*, alog(1.0) if (abs(alog(1.0) - 0.0) > 10e-5 ) error stop print*, alog10(1.0) if (abs(alog10(1.0) - 0.0) > 10e-5 ) error stop print*, imagpart((1.0_8, 2.0_8)) if (abs(imagpart((1.0_8, 2.0_8)) - 2.0_8) > 10e-5 ) error stop print*, dint(1.0_8) if (abs(dint(1.0_8) - 1.0_8) > 10e-5 ) error stop print*, dnint(1.0_8) if (abs(dnint(1.0_8) - 1.0_8) > 10e-5 ) error stop print*, dbesj0(1.0_8) if (abs(dbesj0(1.0_8) - 0.765197686557967_sp) > 10e-5 ) error stop print*, dbesj1(1.0_8) if (abs(dbesj1(1.0_8) - 0.440050585744933_sp) > 10e-5 ) error stop print*, dbesy0(1.0_8) if (abs(dbesy0(1.0_8) - 0.088256964215676_sp) > 10e-5 ) error stop print*, dbesy1(1.0_8) if (abs(dbesy1(1.0_8) - (-7.81212821300288685e-01_sp)) > 10e-5 ) error stop print*, idim(1, 1) if (idim(1, 1) /= 0) error stop print*, ddim(1.0_8, 1.0_8) if (abs(ddim(1.0_8, 1.0_8) - 0.0_8) > 10e-5 ) error stop print*, dconjg((1.0_8, 2.0_8)) if (abs(dconjg((1.0_8, 2.0_8)) - (1.0_8, -2.0_8)) > 10e-5 ) error stop print*, amod(1.0, 1.0) if (amod(1.0, 1.0) /= 0.0) error stop print*, dmod(1.0_8, 1.0_8) if (abs(dmod(1.0_8, 1.0_8) - 0.0_8) > 10e-5 ) error stop x4 = 1.0 x8 = 1.0_dp print*, dacosh(x8) if (abs(dacosh(x8) - 0.0) > 10e-5 ) error stop print*, dacos(x8) if (abs(dacos(x8) - 0.0_dp) > 10e-5 ) error stop print*, dasin(x8) if (abs(dasin(x8) - 1.570796326794896_sp) > 10e-5 ) error stop print*, dasinh(x8) if (abs(dasinh(x8) - 0.881373587019543_sp) > 10e-5 ) error stop x8 = 0.0_dp print*, datanh(x8) if (abs(datanh(x8) - 0.0_sp) > 10e-5 ) error stop x = 1 print*, isign(x, x) if (isign(x, x) /= 1) error stop print*, alog(x4) if (abs(alog(x4) - 0.0) > 10e-5 ) error stop print*, alog10(x4) if (abs(alog10(x4) - 0.0) > 10e-5 ) error stop z8 = (1.0_dp, 2.0_dp) print*, imagpart(z8) if (abs(imagpart(z8) - 2.0) > 10e-5 ) error stop x8 = 1.0_dp print*, dint(x8) if (abs(dint(x8) - 1.0) > 10e-5 ) error stop print*, dnint(x8) if (abs(dnint(x8) - 1.0) > 10e-5 ) error stop print*, dbesj0(x8) if (abs(dbesj0(x8) - 0.765197686557967) > 10e-5 ) error stop print*, dbesj1(x8) if (abs(dbesj1(x8) - 0.440050585744933) > 10e-5 ) error stop print*, dbesy0(x8) if (abs(dbesy0(x8) - 0.088256964215676) > 10e-5 ) error stop print*, dbesy1(x8) if (abs(dbesy1(x8) - (-7.81212821300288685e-01)) > 10e-5 ) error stop print*, idim(x, x) if (idim(x, x) /= 0) error stop print*, ddim(x8, x8) if (abs(ddim(x8, x8) - 0.0) > 10e-5 ) error stop print*, dconjg(z8) if (abs(dconjg(z8) - (1.0_dp, -2.0_dp)) > 10e-5 ) error stop print*, amod(x4, x4) if (amod(x4, x4) /= 0.0) error stop print*, dmod(x8, x8) if (abs(dmod(x8, x8) - 0.0) > 10e-5 ) error stop end program lfortran-lfortran-2f73434/integration_tests/hashmap_nested_dealloc_derived_pointer.f900000664000175000017500000000173415141516316031635 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer implicit none type :: open_map_entry_type integer :: slots end type open_map_entry_type type :: open_map_entry_pool type(open_map_entry_type), allocatable :: more_map_entries(:) end type open_map_entry_pool type :: open_hashmap_type type(open_map_entry_pool), pointer :: cache => null() end type open_hashmap_type end module stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer program hashmap_nested_dealloc_derived_pointer use stdlib_hashmaps_hashmap_nested_dealloc_derived_pointer implicit none type(open_hashmap_type) :: map type(open_map_entry_pool), pointer :: map_entry_pool_head allocate(map_entry_pool_head) allocate(map_entry_pool_head % more_map_entries(10)) do while(associated(map % cache)) deallocate( map_entry_pool_head % more_map_entries ) end do end program hashmap_nested_dealloc_derived_pointerlfortran-lfortran-2f73434/integration_tests/implicit_interface_01.f900000664000175000017500000000117615141516316026057 0ustar alastairalastairprogram main integer, dimension(2, 4) :: a integer :: b(2) = [10, 20] integer :: m = 4, i, j, n = 2 do 20 j = 1, n do 10 i = 1, m a(j, i) = i*j 10 continue 20 continue call driver(implicit_interface_check, a, b, a(1, m), n, m) contains subroutine driver(fnc, arr, b, c, n, m) integer, intent(in) :: n, m, c, b(n), arr(n, m) call fnc(arr(1, m), b, c, n, m) end subroutine subroutine implicit_interface_check(arr_e, b, c, n, m) integer, intent(in) :: n, m, b(n), c, arr_e if (arr_e /= m) error stop if (b(1) /= 10) error stop if (b(2) /= 20) error stop if (c /= m) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_133.f900000664000175000017500000000464415141516316024503 0ustar alastairalastairprogram intrinsics_133 real :: x = 5.8 real :: y = 6.0 integer, parameter :: array_size = 3 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) res_4 = Ceiling(x) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(x, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(x, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = Ceiling(y) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(y, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(y, 4) print *, res_4 if (res_4 /= 6) error stop res_4 = Ceiling(5.8) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(5.8, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(6.00, 8) print *, res_4 if (res_4 /= 6) error stop res_8 = Ceiling(6.00, 8) print *, res_8 if (res_8 /= 6) error stop res_4 = Ceiling(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = Ceiling(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = Ceiling(-412.124) print *, res_4 if (res_4 /= -412) error stop res_8 = Ceiling(-412.124, 8) print *, res_8 if (res_8 /= -412) error stop res_4 = Ceiling(-412.00) print *, res_4 if (res_4 /= -412) error stop res_8 = Ceiling(-412.00, 8) print *, res_8 if (res_8 /= -412) error stop ! Compile time broadcasting res_4_arr = Ceiling([real :: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 2) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 4) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop ! Compile time broadcasting res_4_arr = Ceiling([real :: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 2) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 4) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop res_8_arr = Ceiling([real(8) :: 1.2, 3.3, 5], kind=8) print *, res_8_arr(1) if (res_8_arr(1) /= 2) error stop if (kind(res_8_arr(1)) /= 8) error stop print *, res_8_arr(2) if (res_8_arr(2) /= 4) error stop if (kind(res_8_arr(2)) /= 8) error stop print *, res_8_arr(3) if (res_8_arr(3) /= 5) error stop if (kind(res_8_arr(3)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_19b.f900000664000175000017500000000010415141516316026220 0ustar alastairalastairinteger function ifunc(i) integer :: i ifunc = i * 912 end function lfortran-lfortran-2f73434/integration_tests/functions_26.f900000664000175000017500000000064715141516316024246 0ustar alastairalastairmodule functions_26_mod type tt contains procedure :: eee end type tt contains function eee(self) result(arr) class(tt) :: self integer, allocatable :: arr(:) allocate(arr(3)) arr = [1,2,3] end function end module functions_26_mod program functions_26 use functions_26_mod type(tt) :: sstruct print *, sstruct%eee() end program functions_26lfortran-lfortran-2f73434/integration_tests/string_70.f900000664000175000017500000000045015141516316023533 0ustar alastairalastair! Refer to ./doc/src/string_allocation.md program string_70 implicit none character(:), allocatable :: STR allocate(character(0) :: STR) if(.not. allocated(STR)) error stop if(len(STR) /= 0) error stop deallocate(STR) if(allocated(STR)) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_341.f900000664000175000017500000000037015141516316024474 0ustar alastairalastairprogram intrinsics_341 print *, trailz(0_8) if (trailz(0_8) /= 64) error stop if (kind(trailz(0_8)) /= 4) error stop print *, trailz(5_8) if (trailz(5_8) /= 0) error stop if (kind(trailz(5_8)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/data_implied_do_05.f900000664000175000017500000000165615141516316025332 0ustar alastairalastairprogram data_implied_do_05 implicit none integer :: a(2, 3) integer :: b(2, 3) integer :: i, j ! Nested implied do loop: inner loop varies i, outer loop varies j ! Order: (1,1)=1, (2,1)=2, (1,2)=3, (2,2)=4, (1,3)=5, (2,3)=6 data ((a(i,j),i=1,2),j=1,3) / 1, 2, 3, 4, 5, 6 / ! Nested implied do loop: inner loop varies j, outer loop varies i ! Order: (1,1)=1, (1,2)=2, (1,3)=3, (2,1)=4, (2,2)=5, (2,3)=6 data ((b(i,j),j=1,3),i=1,2) / 1, 2, 3, 4, 5, 6 / ! Verify a if (a(1,1) /= 1) error stop if (a(2,1) /= 2) error stop if (a(1,2) /= 3) error stop if (a(2,2) /= 4) error stop if (a(1,3) /= 5) error stop if (a(2,3) /= 6) error stop ! Verify b if (b(1,1) /= 1) error stop if (b(1,2) /= 2) error stop if (b(1,3) /= 3) error stop if (b(2,1) /= 4) error stop if (b(2,2) /= 5) error stop if (b(2,3) /= 6) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/derived_types_41.f900000664000175000017500000000074715141516316025102 0ustar alastairalastairmodule derived_types_41_mod implicit none type :: mytype integer :: a(2) integer :: b integer :: c(2) end type mytype type(mytype) :: mytype_instance = mytype([1, 2], 3, [4, 5]) end module derived_types_41_mod program derived_types_41 use derived_types_41_mod if (any(mytype_instance%a /= [1, 2])) error stop if (mytype_instance%b /= 3) error stop if (any(mytype_instance%c /= [4, 5])) error stop end program derived_types_41 lfortran-lfortran-2f73434/integration_tests/submodule_13.f900000664000175000017500000000362215141516316024225 0ustar alastairalastairmodule submodule_13_mod implicit none private public :: string_t public :: operator(.separatedBy.) type string_t private character(len=:), allocatable :: string_ contains procedure :: bracket end type string_t interface string_t elemental module function from_default_integer(i) result(string) implicit none integer, intent(in) :: i type(string_t) :: string end function from_default_integer end interface interface elemental module function bracket(self, opening, closing) result(bracketed_self) implicit none class(string_t), intent(in) :: self character(len=*), intent(in), optional :: opening, closing type(string_t) :: bracketed_self end function bracket end interface contains elemental module function bracket(self, opening, closing) result(bracketed_self) class(string_t), intent(in) :: self character(len=*), intent(in), optional :: opening, closing type(string_t) :: bracketed_self if (present(opening) .and. present(closing)) then bracketed_self%string_ = opening // self%string_ // closing else bracketed_self%string_ = self%string_ end if end function bracket end module submodule_13_mod program submodule_13 use submodule_13_mod, only : string_t implicit none contains pure function markdown_table(row_header, column_header, body_cells, side_borders) result(lines) integer, parameter :: first_body_row = 3 type(string_t), intent(in) :: row_header(first_body_row:), column_header(:), body_cells(first_body_row:,:) logical, intent(in) :: side_borders character(len=1), parameter :: column_separator = "|" integer, parameter :: num_rule_lines = 1 type(string_t) :: lines(size(body_cells,1) + num_rule_lines) if (side_borders) lines = lines%bracket(column_separator) end function markdown_table end program submodule_13 lfortran-lfortran-2f73434/integration_tests/arithmetic_if_04.f900000664000175000017500000000152315141516316025033 0ustar alastairalastairprogram arithmetic_if_04 integer, parameter :: dp = kind(0.d0) real(dp) :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-lfortran-2f73434/integration_tests/array_slice_02.f900000664000175000017500000000135315141516316024520 0ustar alastairalastairprogram array_slice_02 implicit none integer(1) :: decoder_txt(10) = (/97, 98, 99, 65, 66, 100, 67, 69, 70, 71/) integer :: start, end character(:), allocatable :: txt start = 3 end = 8 if( lbound(decoder_txt(start:end), 1) /= 1 ) error stop if( ubound(decoder_txt(start:end), 1) /= end - start + 1 ) error stop txt = c2s(decoder_txt(start:end)) print *, txt if( txt /= 'cABdCE' ) error stop contains function c2s(x) result(y) integer(1), intent(in) :: x(:) character(:), allocatable :: y integer :: i print *, lbound(x, 1), ubound(x, 1), size(x) if( lbound(x, 1) /= 1 ) error stop if( ubound(x, 1) /= size(x) ) error stop allocate(character(size(x)) :: y) do i = 1, size(x) y(i:i) = char(int(x(i), 4)) end do end function end program lfortran-lfortran-2f73434/integration_tests/select_rank_02.f900000664000175000017500000000132315141516316024512 0ustar alastairalastair program select_rank_test implicit none real :: b(2) = [1,2] real :: c(2,2) = reshape([1,2,3,4],[2,2]) real :: d(2,2,2) = reshape([1,2,3,4,5,6,7,8],[2,2,2]) call check(b, 1) call check(c, 2) call check(d, 3) contains subroutine check(x, expected) real, intent(in) :: x(..) integer, intent(in) :: expected select rank(x) rank(0) if (expected /= 0) error stop rank(1) if (expected /= 1) error stop rank(2) if (expected /= 2) error stop rank default if (expected /= 3) error stop end select end subroutine check end program select_rank_testlfortran-lfortran-2f73434/integration_tests/common_15.f900000664000175000017500000000127615141516316023523 0ustar alastairalastair! Test: COMMON block with different variable names across units ! This is the simple case - same layout, different names program common_15 implicit none integer :: infot, noutc common /infoc/ infot, noutc noutc = 6 infot = 42 call sub1() if (infot /= 100) error stop "infot should be 100" print *, "PASS: common_15" end program subroutine sub1() implicit none ! Same COMMON block but different variable name (NOUT vs NOUTC) ! Both refer to the same storage location integer :: infot, nout common /infoc/ infot, nout if (nout /= 6) error stop "nout should be 6" if (infot /= 42) error stop "infot should be 42" infot = 100 end subroutine lfortran-lfortran-2f73434/integration_tests/parameter_02.f900000664000175000017500000000042215141516316024177 0ustar alastairalastairsubroutine a_proc implicit none integer :: i parameter(i = 1) print *, i end subroutine a_proc module parameter_02_a implicit none integer :: i parameter(i = 2) end module program parameter_02 use parameter_02_a, only: i implicit none call a_proc() print *, i end program lfortran-lfortran-2f73434/integration_tests/intrinsics_218.f900000664000175000017500000000064415141516316024503 0ustar alastairalastairprogram intrinsics_218 implicit none integer, parameter :: new_len = len(new_line('a')) character(len=*), parameter :: str = new_line('') print *, new_len if (new_len /= 1) error stop print*, "Hello, World!", new_line('a') call temp(str) contains subroutine temp(str) character(len=*) :: str print *, len(str) if(len(str) /= 1) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/include_01/0000775000175000017500000000000015141516316023323 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/include_01/nested/0000775000175000017500000000000015141516316024605 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/include_01/nested/b.f900000664000175000017500000000005515141516316025346 0ustar alastairalastairprint *, "From B" include "include_01/c.f90" lfortran-lfortran-2f73434/integration_tests/include_01/a.f900000664000175000017500000000013015141516316024055 0ustar alastairalastairsubroutine a() include "include_01/nested/b.f90" print *, "From A" end subroutine lfortran-lfortran-2f73434/integration_tests/include_01/c.f900000664000175000017500000000002215141516316024057 0ustar alastairalastairprint *, "From C" lfortran-lfortran-2f73434/integration_tests/format_52.f900000664000175000017500000000075215141516316023522 0ustar alastairalastairprogram format_52 implicit none integer :: i character(2) :: which(2) = ['st','nd'] character(10) :: output print "(I0,A,I0,A)", 1, which(1), 2, which(2) write(output, "(I0,A,I0,A)") 1, which(1), 2, which(2) if (trim(output) /= "1st2nd") error stop "Format reuse failed" write(output, "(I0,A)") 1, which(1) if (trim(output) /= "1st") error stop "Single format failed" print "(I0,A)", (i, which(i), i = 1, 2) end program format_52 lfortran-lfortran-2f73434/integration_tests/intrinsics_128.f900000664000175000017500000000123615141516316024501 0ustar alastairalastairprogram intrinsics_128 implicit none double precision :: x integer, parameter :: x1 = idint(4.23_8) integer, parameter :: y1 = idint(123.41_8) integer, parameter :: ar1(3) = idint([1.0_8, 2.11_8, -31.0_8]) real(8) :: arr1(3) = [1.0_8, 2.11_8, -31.0_8] print *, x1 if (x1 /= 4) error stop print *, y1 if (y1 /= 123) error stop print *, ar1 if (any(ar1 /= [1, 2, -31])) error stop print *, idint(arr1) if (any(idint(arr1) /= [1, 2, -31])) error stop x = 4.23 print *, idint(x) if( .not. idint(x) == 4 ) error stop print *, idint(4.23D0) if( .not. idint(4.23D0) == 4 ) error stop end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_05_module1.f900000664000175000017500000000142315141516316030076 0ustar alastairalastairmodule operator_overloading_05_module1 type :: string_type character(len=:), allocatable :: raw end type string_type interface assignment(=) module procedure :: assign_string_type end interface assignment(=) interface operator(>=) module procedure :: gt_string_type end interface operator(>=) contains pure subroutine assign_string_type(lhs, rhs) type(string_type), intent(inout) :: lhs type(string_type), intent(in) :: rhs lhs%raw = rhs%raw end subroutine assign_string_type pure function gt_string_type(lhs, rhs) result(r) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs logical :: r r = .true. end function gt_string_type end modulelfortran-lfortran-2f73434/integration_tests/complex_dp.f900000664000175000017500000000026715141516316024057 0ustar alastairalastairprogram complex_dp complex(4) :: zero complex(8) :: v complex :: x zero = 0.0_4 v = (1.05_4, 1.05_4) x = (1.05_4, 1.05_8) print *, v, x, zero end programlfortran-lfortran-2f73434/integration_tests/generic_name_02.f900000664000175000017500000000025515141516316024637 0ustar alastairalastairprogram generic_name_02 call p("abc") contains subroutine p(a) Class(*), intent(in) :: a print *, "Hello World" end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_19.f900000664000175000017500000000027515141516316023536 0ustar alastairalastairprogram print_array integer :: xarr(3) xarr(1) = 1 xarr(2) = 2 xarr(3) = 3 call f(3, xarr) contains subroutine f(n, x) integer :: n, x(n) print *, x end subroutine end program lfortran-lfortran-2f73434/integration_tests/interface_02.f900000664000175000017500000000062115141516316024160 0ustar alastairalastairmodule interface_02_mod implicit none interface subroutine a1(a) integer, intent(inout) :: a end subroutine end interface interface subroutine a2(a) integer, intent(inout) :: a end subroutine subroutine a3(a) real, intent(inout) :: a end subroutine endinterface end module program interface_02 use interface_02_mod, only: a1, a2, a3 implicit none end program lfortran-lfortran-2f73434/integration_tests/array_section_02.f900000664000175000017500000000070215141516316025062 0ustar alastairalastairprogram expr2 implicit none integer :: r(4), i, tmp r = 17 r(:2) = func(r(:3)) tmp = 2 do i = 1, size(r) if (i > 2) tmp = 1 if (r(i) /= tmp * 17) error stop end do contains function func(input) result(output) integer, intent(inout) :: input(:) integer :: output(size(input)-1) output = 2*input(:2) if (size(output) /= 2) error stop end function func end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_14.f900000664000175000017500000000446315141516316025243 0ustar alastairalastairprogram array_reshape_14 implicit none integer :: i23(2, 3) = reshape([-14, 3, 0, -2, 19, 1], [2, 3]) print *, i23 call test_reshape_with_argument() contains subroutine test_nd_to_1d(a) real(8), intent(in) :: a(:, :) integer :: i, j, k, l real(8) :: eps real(8) :: b(256) integer :: newshape(1) real(8) :: c(16, 16, 16) real(8) :: d(4096) integer :: newshape1(1) eps = 1e-12 newshape(1) = 256 b = reshape(a, newshape) do k = 1, 256 i = (k - 1)/16 j = (k - 1) - i*16 if (abs(b(k) - i - j - 0.5) > eps) error stop end do do i = 1, 16 do j = 1, 16 do k = 1, 16 c(i, j, k) = (i - 1) + (j - 1) + (k - 1) + 0.5 end do end do end do newshape1(1) = 4096 d = reshape(c, newshape1) do l = 1, 4096 i = (l - 1)/256 j = ((l - 1) - i*256)/16 k = ((l - 1) - i*256 - j*16) if (abs(d(l) - i - j - k - 0.5) > eps) error stop end do end subroutine subroutine test_1d_to_nd(d) real(8) :: d(:) integer :: i, j, k, l real(8) :: eps real(8) :: b(256) real(8) :: a(16, 16) integer :: newshape(2) real(8) :: c(16, 16, 16) integer :: newshape1(3) eps = 1e-12 do k = 1, 256 i = (k - 1)/16 j = (k - 1) - i*16 b(k) = i + j + 0.5 end do newshape(1) = 16 newshape(2) = 16 a = reshape(b, newshape) do i = 1, 16 do j = 1, 16 if (abs(a(i, j) - (i - 1) - (j - 1) - 0.5) > eps) error stop end do end do newshape1(1) = 16 newshape1(2) = 16 newshape1(3) = 16 c = reshape(d, newshape1) do i = 1, 16 do j = 1, 16 do k = 1, 16 if (abs(c(i, j, k) - (i - 1) - (j - 1) - (k - 1) - 0.5) > eps) error stop end do end do end do end subroutine subroutine test_reshape_with_argument() integer :: i, j, k, l real(8) :: a(16, 16) real(8) :: d(4096) do i = 1, 16 do j = 1, 16 a(i, j) = (i - 1) + (j - 1) + 0.5 end do end do call test_nd_to_1d(a) do l = 1, 4096 i = (l - 1)/256 j = ((l - 1) - i*256)/16 k = ((l - 1) - i*256 - j*16) d(l) = i + j + k + 0.5 end do call test_1d_to_nd(d) end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_112.f900000664000175000017500000000037715141516316024477 0ustar alastairalastairprogram intrinsics_112 integer :: a, b, result a = 10 b = 7 if ( .not. max0( a1 = a, a2 = b ) == 10 ) error stop if ( .not. max0( a, a2 = b ) == 10 ) error stop if ( .not. max0( a, b ) == 10 ) error stop end program intrinsics_112 lfortran-lfortran-2f73434/integration_tests/intrinsics_394.f900000664000175000017500000000176415141516316024514 0ustar alastairalastairprogram intrinsics_394 implicit none character(len=:), allocatable :: dir, cmd integer :: stat call check_dir_exists("fortran_scratch") call check_dir_exists("fortran_scratch2") contains subroutine check_dir_exists(dirname) character(len=*), intent(in) :: dirname character(len=:), allocatable :: local_cmd integer :: exitstat, cmdstat ! Build the test command local_cmd = "test -d " // trim(dirname) ! Execute and capture exit status cmdstat = -999 call execute_command_line(local_cmd, exitstat=exitstat, cmdstat=cmdstat) ! Print robust diagnostic info print *, cmdstat if (cmdstat /= 0) error stop "cmdstat should be zero when the command runs" if (exitstat == 0) then print *, "Directory exists: ", trim(dirname) else print *, "Directory does NOT exist: ", trim(dirname) end if end subroutine check_dir_exists end program intrinsics_394 lfortran-lfortran-2f73434/integration_tests/intrinsics_88.f900000664000175000017500000000425115141516316024426 0ustar alastairalastairprogram intrinsics_88 implicit none integer, parameter :: x1 = min(1, 2) integer(8), parameter :: x2 = min(1_8, 2_8) real, parameter :: x3 = min(1.0, 2.0) real(8), parameter :: x4 = min(1.0_8, 2.0_8) character(len=10), parameter :: x5 = min("str", "string") integer, parameter :: ar1(3) = min([1, 12, 3], [4, 5, 6]) integer(8), parameter :: ar2(3) = min([1_8, 12_8, 3_8], [4_8, 5_8, 6_8]) real, parameter :: ar3(3) = min([1.0, 12.0, 3.0], [4.0, 5.0, 6.0]) real(8), parameter :: ar4(3) = min([1.0_8, 12.0_8, 3.0_8], [4.0_8, 5.0_8, 6.0_8]) ! character(len=10), parameter :: ar5(3) = min(["str1", "str2", "char"], ["!str#$", "xtring", "charac"]) ! Does not work - #4582 integer :: i1, i2 integer(8) :: i3, i4 real :: r1, r2 real(8) :: r3, r4 character(len=10) :: string_var, string_var2, string_var3 i1 = 123 i2 = 456 i3 = 123_8 i4 = 456_8 r1 = 123.0 r2 = 456.0 r3 = 123.0_8 r4 = 456.0_8 string_var = "str" string_var2 = "string" string_var3 = "character" print *, x1 if (x1 /= 1) error stop print *, x2 if (x2 /= 1_8) error stop print *, x3 if (x3 /= 1.0) error stop print *, x4 if (x4 /= 1.0_8) error stop print *, x5 if (x5 /= "str") error stop print *, ar1 if (any(ar1 /= [1, 5, 3])) error stop print *, ar2 if (any(ar2 /= [1_8, 5_8, 3_8])) error stop print *, ar3 if (any(ar3 /= [1.0, 5.0, 3.0])) error stop print *, ar4 if (any(ar4 /= [1.0_8, 5.0_8, 3.0_8])) error stop ! print *, ar5 ! if (any(ar5 /= ["str1", "string", "charac"])) error stop print *, min(i1, i2) if (min(i1, i2) /= i1) error stop print *, min(i3, i4) if (min(i3, i4) /= i3) error stop print *, min(r1, r2) if (min(r1, r2) /= r1) error stop print *, min(r3, r4) if (min(r3, r4) /= r3) error stop print*, min("str", "character") if (min("str", "character") /= "character") error stop print*, min(string_var, string_var2) if (min(string_var, string_var2) /= string_var) error stop print*, min(string_var3, string_var2) if (min(string_var3, string_var2) /= string_var3) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_34_module1.f900000664000175000017500000000043615141516316025327 0ustar alastairalastairmodule fpm_manifest_package_modules_34 use fpm_versioning_modules_34, only : version_t implicit none type :: package_config_t character(len=:), allocatable :: name type(version_t) :: version end type package_config_t end module fpm_manifest_package_modules_34 lfortran-lfortran-2f73434/integration_tests/elemental_15.f900000664000175000017500000000072015141516316024172 0ustar alastairalastairmodule elemental_15_mod implicit none type :: t integer :: v contains procedure, pass :: neq generic :: operator(/=) => neq end type contains elemental logical function neq(a,b) class(t), intent(in) :: a, b neq = a%v /= b%v end end module program elemental_15 use elemental_15_mod type(t) :: a(2) = [t(1), t(2)], b(2) = [t(1), t(2)] if (any(a /= b)) error stop a(1)%v = 2 if (.not. any(a /= b)) error stop end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_12.f900000664000175000017500000000114015141516316026045 0ustar alastairalastairmodule pass_array_by_data_12_mod implicit none type :: downloader_t contains procedure, nopass :: upload_form end type downloader_t contains subroutine upload_form(form_data) integer, intent(inout) :: form_data(:) integer :: i do i = 1, size(form_data) form_data(i) = i end do end subroutine upload_form end module pass_array_by_data_12_mod program pass_array_by_data_12 use pass_array_by_data_12_mod implicit none type(downloader_t) :: d integer :: arr(5) call d%upload_form(arr) if (any(arr /= [1,2,3,4,5])) error stop end program pass_array_by_data_12lfortran-lfortran-2f73434/integration_tests/arrays_27.f900000664000175000017500000000057115141516316023534 0ustar alastairalastairprogram arrays_27 implicit none integer :: x(3) = [1, 2, 3] integer :: m = 3 call f(3, x) call f(m, x) contains subroutine f(n, x) integer, intent(in) :: x(n) integer :: n if (n /= 3) error stop if (x(1) /= 1) error stop if (x(3) /= 3) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/compiler_version_02.f900000664000175000017500000000020115141516316025571 0ustar alastairalastairprogram compiler_version_02 use, intrinsic :: iso_fortran_env, only: compiler_version print*, compiler_version() end program lfortran-lfortran-2f73434/integration_tests/string_43.f900000664000175000017500000000065215141516316023537 0ustar alastairalastairprogram string_43 character(len=2) :: textblock(3) textblock = f() print*, "lf"//textblock contains function f() result(textblock) character(len=256), allocatable :: textblock(:) allocate(textblock(2)) textblock(1) = "lf" textblock(2) = "gf" textblock=[character(len=len(textblock)+1) :: ' ',textblock] textblock=' '//textblock end function end program lfortran-lfortran-2f73434/integration_tests/associate_17.f900000664000175000017500000000165215141516316024206 0ustar alastairalastairmodule stdlib_hashmaps_associate_17 implicit none type :: open_map_entry_type integer(4) :: inmap end type open_map_entry_type type open_map_entry_ptr type(open_map_entry_type), pointer :: target => null() end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps_associate_17 program associate_17 use stdlib_hashmaps_associate_17 implicit none type(open_hashmap_type) :: map integer(4) :: inmap = 1 type(open_map_entry_type), pointer :: temp => null() allocate(map % inverse(1)) allocate(map % inverse(1) % target) temp => map % inverse(1) % target temp % inmap = 42 associate( target => map % inverse(inmap) % target ) print *, target % inmap if (target % inmap /= 42) error stop end associate end program lfortran-lfortran-2f73434/integration_tests/derived_types_09b.f900000664000175000017500000000025515141516316025242 0ustar alastairalastairmodule derived_types_09b use derived_types_09c, only: data_t contains integer function f(d) type(data_t), intent(inout) :: d real :: A(size(d%A)) end function end module lfortran-lfortran-2f73434/integration_tests/nested_struct_proc_01.f900000664000175000017500000000414315141516316026133 0ustar alastairalastairmodule gFTL2_Integer32Complex32OrderedMap use iso_fortran_env implicit none integer, parameter :: I32 = int32 integer, parameter :: R32 = real32 type :: omap_I_Set contains end type omap_I_Set type :: omap_Map private type(omap_I_Set) :: tree complex(kind=R32) :: stored_value ! Module-level target contains procedure :: at_rc => omap_I_at_rc generic :: at => at_rc end type omap_Map type :: Integer32Complex32OrderedMap private type(omap_Map) :: map contains procedure :: insert_key_value => omap_insert_key_value generic :: insert => insert_key_value end type Integer32Complex32OrderedMap contains function omap_I_at_rc(this, key, rc) result(res) class(omap_Map), target, intent(in) :: this integer(kind=I32), intent(in) :: key integer, intent(out) :: rc complex(kind=R32), pointer :: res res => this%stored_value ! Point to module-level target rc = 0 end function omap_I_at_rc recursive subroutine omap_insert_key_value(this, key, value) class(Integer32Complex32OrderedMap), intent(inout) :: this integer(kind=I32), intent(in) :: key complex(kind=R32), intent(in) :: value integer :: status complex(kind=R32), pointer :: tmp real, parameter :: tol = 1.0e-6 ! Tolerance for comparison this%map%stored_value = value ! Store the value tmp => this%map%at(key, rc=status) ! print *, "Real:", real(tmp), "Imag:", aimag(tmp), "Status:", status if (abs(real(tmp) - real(value)) > tol .or. abs(aimag(tmp) - aimag(value)) > tol) then print *, "Test failed: tmp does not match value" error stop end if end subroutine omap_insert_key_value end module gFTL2_Integer32Complex32OrderedMap program nested_struct_proc_01 use gFTL2_Integer32Complex32OrderedMap implicit none type(Integer32Complex32OrderedMap) :: my_map integer(kind=I32) :: key complex(kind=R32) :: value key = 10 value = (2.0_R32, 4.0_R32) call my_map%insert(key, value) print *, "Test passed" end program nested_struct_proc_01lfortran-lfortran-2f73434/integration_tests/doloop_09.f900000664000175000017500000000063515141516316023530 0ustar alastairalastairmodule doloop_09_mod contains subroutine f() integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j call g() contains subroutine g() integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j end subroutine end subroutine end module program doloop_09 use doloop_09_mod, only: f call f() end program lfortran-lfortran-2f73434/integration_tests/select_rank_04.f900000664000175000017500000000060715141516316024520 0ustar alastairalastairprogram select_rank_04 implicit none integer :: a(2) = [4, 2] call check(a) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) select rank(x) rank (1) print *, x rank (2) print *, x end select end subroutine check end program select_rank_04lfortran-lfortran-2f73434/integration_tests/data_16.f900000664000175000017500000000030515141516316023135 0ustar alastairalastairmodule data_16_module public :: pi data pi /3.14/ end module program data_16 use data_16_module print *, "pi: ", pi if (abs(pi - 3.14) > 1.0e-6) error stop end program data_16 lfortran-lfortran-2f73434/integration_tests/format_02.f900000664000175000017500000000022015141516316023503 0ustar alastairalastair program format_02 implicit none integer :: i6, format(3) i6 = 2 format(i6) = 3 1 format(i6) end program lfortran-lfortran-2f73434/integration_tests/flush_03.f900000664000175000017500000000022315141516316023340 0ustar alastairalastairprogram flush_03 use iso_fortran_env implicit none FLUSH(INPUT_UNIT) FLUSH(OUTPUT_UNIT) FLUSH(ERROR_UNIT) end program flush_03 lfortran-lfortran-2f73434/integration_tests/optional_05.f900000664000175000017500000000167615141516316024063 0ustar alastairalastairmodule optional_05_mod logical :: opt_present, opt_alloc_present contains subroutine opt(i) integer, optional, intent(in) :: i print *, 'Present in opt: ', present(i) opt_present = present(i) end subroutine opt subroutine opt_alloc(i) integer, allocatable, optional, intent(in) :: i print *, 'Present in opt_alloc: ', present(i) opt_alloc_present = present(i) call opt(i) end subroutine opt_alloc end module program optional_05 use optional_05_mod integer, allocatable :: i opt_present = .false. opt_alloc_present = .false. #ifndef __GFORTRAN__ call opt_alloc() #endif if (opt_alloc_present .neqv. .false.) error stop if (opt_present .neqv. .false.) error stop call opt_alloc(i) if (opt_alloc_present .neqv. .true.) error stop if (opt_present .neqv. .false.) error stop allocate(i) call opt_alloc(i) if (opt_alloc_present .neqv. .true.) error stop if (opt_present .neqv. .true.) error stop end program lfortran-lfortran-2f73434/integration_tests/data_03.f900000664000175000017500000000147015141516316023135 0ustar alastairalastairprogram data_03 integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b, p integer, dimension(4) :: arr data arr(1), arr(2), arr(3), arr(4) /1, 2, 3, 4/ print *, x, y, z if (x /= 1) error stop if (arr(1) /= 1) error stop if (arr(2) /= 2) error stop if (arr(3) /= 3) error stop if (arr(4) /= 4) error stop if (abs(y-2.0) > 1e-5) error stop if (abs(z-3.0) > 1e-5) error stop if (abs(c1(1)-0.0) > 1e-5) error stop if (abs(c1(2)-0.22) > 1e-5) then error stop data x, td, b /1, 4, 3/ end if if (abs(c1(4)+0.21) > 1e-5) error stop if (abs(bf1-0.8) > 1e-5) then data y, z /2.0, 3.0/ error stop end if if (abs(xx90-0.55) > 1e-5) error stop if (abs(xx95-0.62) > 1e-5) error stop data c1 /0.0, 0.22, -0.14, -0.21/ p = b ** (td-1) if (abs(p-27.0) > 1e-5) error stop data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ end program lfortran-lfortran-2f73434/integration_tests/intrinsics_227.f900000664000175000017500000000174015141516316024501 0ustar alastairalastairprogram intrinsics_227 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: x1(3) = [1.0, 2.0, 3.0] real(dp), parameter :: x2(5) = [5.0, 7.0, 11.0, 13.0, 17.0] real(dp), parameter :: x = norm2([1.0, 2.0, 3.0, 4.0, 5.0]) real(sp), parameter :: y = norm2([5.0, 7.0, 11.0, 13.0, 17.0]) real(sp) :: y1(5) = [5.0, 7.0, 11.0, 13.0, 17.0] real(dp) :: y2(10) = [14.0, 21.0, 33.0, 39.0, 51.0, 5.0, 7.0, 11.0, 13.0, 17.0] print*, norm2(x1) if (abs(norm2(x1) - 3.7416573867739413_sp) > 1e-6 ) error stop print*, norm2(x2) if (abs(norm2(x2) - 25.553864678361276_dp) > 1e-12 ) error stop print*, norm2(y1) if (abs(norm2(y1) - 25.5538654_sp) > 1e-6 ) error stop print*, norm2(y2) if (abs(norm2(y2) - 80.628778981204974_dp) > 1e-12 ) error stop print*, x if (abs(x - 7.4161982536315918_dp) > 1e-12 ) error stop print*, y if (abs(y - 25.5538654_sp) > 1e-6 ) error stop end programlfortran-lfortran-2f73434/integration_tests/class_77.f900000664000175000017500000000155015141516316023343 0ustar alastairalastairmodule class_77_mod implicit none type :: toml_value integer, allocatable :: x(:) end type toml_value type, extends(toml_value) :: toml_table class(toml_value), allocatable :: table_key end type toml_table end module class_77_mod program class_77 use class_77_mod implicit none type(toml_table), allocatable :: table class(toml_value), allocatable :: value allocate(table) allocate(toml_table :: table%table_key) allocate(table%table_key%x(5)) table%table_key%x = [1,2,3,4,5] value = table select type(value) type is (toml_table) print *, allocated(value%table_key), value%table_key%x if (.not. allocated(value%table_key)) error stop if (any(value%table_key%x /= [1,2,3,4,5])) error stop class default error stop end select end program class_77 lfortran-lfortran-2f73434/integration_tests/simd_02.f900000664000175000017500000000054015141516316023154 0ustar alastairalastairprogram simd_02 !LF$ attributes simd :: A, B, res real :: A(4), B(4), C(8), res(4) C = [3.14, 7.25, 0.98, 5.67, 2.35, 9.42, 6.11, 1.99] A = C(:4) B = C(5:) res = A + B * A C(:4) = res res = A * B C(5:) = res print *, C print *, sum(C) if (abs(sum(C) - 202.930176) > 1e-5 ) error stop end program simd_02 lfortran-lfortran-2f73434/integration_tests/string_07.f900000664000175000017500000000126015141516316023533 0ustar alastairalastairmodule string_07_mod implicit none contains integer pure function some_fn(a) result(r) integer, intent(in) :: a r = a end function end module program string_07 use string_07_mod implicit none print *, f1(3) if (len(f1(3)) /= 3) error stop print *, f1(7) if (len(f1(7)) /= 7) error stop print *, f2(3) if (len(f2(3)) /= 3) error stop print *, f2(7) if (len(f2(7)) /= 7) error stop contains function f1(n) result(r) integer, intent(in) :: n character(len=n) :: r integer :: i do i = 1, n r(i:i) = "a" end do end function function f2(n) result(r) integer, intent(in) :: n character(len=some_fn(n)) :: r integer :: i do i = 1, n r(i:i) = "a" end do end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_314.f900000664000175000017500000000015715141516316024477 0ustar alastairalastairprogram intrinsics_314 print *, dshiftl( z"A", 10, 5) if (dshiftl( z"A", 10, 5) /= 320) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_26a.f900000664000175000017500000000113115141516316026566 0ustar alastairalastairmodule quadrature_separate_compilation_26 implicit none interface gauss_legendre pure module subroutine gauss_legendre_fp64 (i) integer, intent(inout) :: i end subroutine end interface gauss_legendre end module quadrature_separate_compilation_26 module specialfunctions_separate_compilation_26 implicit none interface legendre pure elemental module function legendre_fp64(n) result(leg) integer, intent(in) :: n integer :: leg end function end interface end module specialfunctions_separate_compilation_26lfortran-lfortran-2f73434/integration_tests/implicit_argument_casting_03.f900000664000175000017500000000116015141516316027444 0ustar alastairalastair! Test function argument type mismatch with implicit interface ! When calling an external function with integer(8) argument where it expects ! integer(4), the value should be converted when --implicit-argument-casting is set program functions_54 implicit none integer(8) :: n8 integer(4) :: result integer(4), external :: external_test_func n8 = 5 result = external_test_func(n8) ! Passing integer(8) to function expecting integer(4) if (result /= 10) error stop end program integer(4) function external_test_func(n) integer(4), intent(in) :: n external_test_func = n * 2 end function lfortran-lfortran-2f73434/integration_tests/array_op_04.f900000664000175000017500000000077515141516316024050 0ustar alastairalastairmodule module_array_op_04 contains subroutine find_fit(expr) real :: y(1) interface function expr() result(y) real :: y(1) end function expr end interface y = expr() if (abs(y(1) - 1.0) > 1e-7) error stop print *, y end subroutine find_fit end module module_array_op_04 program example_primes use module_array_op_04, only: find_fit implicit none call find_fit(expression) contains function expression() result(y) real :: y(1) y = 1.0 end function expression end program example_primes lfortran-lfortran-2f73434/integration_tests/lapack_01.f900000664000175000017500000000277115141516316023462 0ustar alastairalastairsubroutine dpttrf(n, d, e, info) integer :: n, info double precision :: d( * ), e( * ) double precision :: zero parameter( zero = 0.0d+0 ) integer :: i, i4 double precision :: ei intrinsic :: mod info = 0 if( n.eq.0 ) return i4 = mod( n-1, 4 ) do 10 i = 1, i4 if( d( i ).le.zero ) then info = i go to 30 end if ei = e( i ) e( i ) = ei / d( i ) d( i+1 ) = d( i+1 ) - e( i )*ei 10 continue do 20 i = i4 + 1, n - 4, 4 if( d( i ).le.zero ) then info = i go to 30 end if ei = e( i ) e( i ) = ei / d( i ) d( i+1 ) = d( i+1 ) - e( i )*ei if( d( i+1 ).le.zero ) then info = i + 1 go to 30 end if ei = e( i+1 ) e( i+1 ) = ei / d( i+1 ) d( i+2 ) = d( i+2 ) - e( i+1 )*ei if( d( i+2 ).le.zero ) then info = i + 2 go to 30 end if ei = e( i+2 ) e( i+2 ) = ei / d( i+2 ) d( i+3 ) = d( i+3 ) - e( i+2 )*ei if( d( i+3 ).le.zero ) then info = i + 3 go to 30 end if ei = e( i+3 ) e( i+3 ) = ei / d( i+3 ) d( i+4 ) = d( i+4 ) - e( i+3 )*ei 20 continue if( d( n ).le.zero ) info = n 30 continue return end subroutine program lapack_01 integer :: n = 3, info double precision :: d(3), e(2) d = [4, 5, 6] e = [1, 2] call dpttrf(n, d, e, info) print *, "sum(d): ", sum(d) if ( abs(sum(d) - 13.907894736842106) > 1e-6 ) error stop print *, "sum(e): ", sum(e) if ( abs(sum(e) - 0.67105263157894735) > 1e-7 ) error stop print *, "info: ", info if ( info /= 0 ) error stop end programlfortran-lfortran-2f73434/integration_tests/tuple_test_nested_.f900000664000175000017500000000533515141516316025617 0ustar alastairalastairprogram test_tuple_nested implicit none call tuple_nested() contains subroutine tuple_nested() _lfortran_tuple(integer, integer) :: t1 _lfortran_tuple(integer, integer) :: t2 _lfortran_tuple(_lfortran_tuple(integer, integer),_lfortran_tuple(integer, integer), & _lfortran_tuple(integer, integer),_lfortran_tuple(integer, integer)) :: t3 _lfortran_tuple(integer, real, character(len=:)) :: t4 _lfortran_tuple(_lfortran_tuple(integer, real, character(len=:)), integer) :: t5 _lfortran_tuple(_lfortran_tuple(_lfortran_tuple(integer, & real, character(len=:)), integer), real) :: t6 _lfortran_tuple(_lfortran_tuple(integer, integer), & _lfortran_tuple(_lfortran_list(integer), _lfortran_list(character(len=:)))) :: t7 _lfortran_list(_lfortran_tuple(integer, real, _lfortran_tuple(real, integer))) :: l1 integer:: i character(len=:), allocatable :: s t1 = _lfortran_tuple_constant(-1, -2) t2 = _lfortran_tuple_constant(-3, -4) t3 = _lfortran_tuple_constant(t1, t2, t1, t2) if ( .not. (_lfortran_eq(_lfortran_get_item(t3, 0), t1) .and. _lfortran_eq(_lfortran_get_item(t3, 1), t2))) error stop if ( .not. (_lfortran_eq(_lfortran_get_item(t3, 2), t1) .and. _lfortran_eq(_lfortran_get_item(t3, 3), t2))) error stop t4 = _lfortran_tuple_constant(1, 2.0, "abc") t5 = _lfortran_tuple_constant(t4, 3) if ( .not. _lfortran_eq(_lfortran_tuple_constant(_lfortran_tuple_constant(1, 2.0, "abc"), 3), t5) ) error stop t6 = _lfortran_tuple_constant(t5, 4.0) if ( .not. _lfortran_eq(_lfortran_tuple_constant(_lfortran_tuple_constant(t4, 3), 4.0), t6) ) error stop do i=0, 4 call _lfortran_list_append(l1, _lfortran_tuple_constant(i, real(i+1), _lfortran_tuple_constant(real(i+2), i+3))) end do do i=0, 4 if ( .not. _lfortran_eq(_lfortran_get_item(l1, i), & _lfortran_tuple_constant(i, real(i+1), _lfortran_tuple_constant(real(i+2), i+3))) ) error stop end do i = 3 s = "a" t7 = _lfortran_tuple_constant(t1, _lfortran_tuple_constant(_lfortran_list_constant(i, i+1, i+2), & _lfortran_list_constant(s, repeat(s, 2), repeat(s, 3)))) if ( .not. _lfortran_eq(t7, _lfortran_tuple_constant(_lfortran_tuple_constant(-1, -2), _lfortran_tuple_constant( & _lfortran_list_constant(3, 4, 5), _lfortran_list_constant('a', 'aa', 'aaa')))) ) error stop end subroutine end program test_tuple_nested lfortran-lfortran-2f73434/integration_tests/if_02.f900000664000175000017500000000006715141516316022622 0ustar alastairalastairprogram if_02 implicit none if (.true.) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_315.f900000664000175000017500000000471515141516316024504 0ustar alastairalastairprogram intrinsics_315 integer (kind = 4):: a1 = 2147483647 integer (kind = 8):: a2 = 2147483648_8 integer (kind = 4):: b1 = 0_4 integer (kind = 8) :: b2 = 2147483648_8 logical :: c = .TRUE. real(kind = 4) :: r1 = 1.0_4 real(kind = 8) :: r2 = 3.4028234663852886e+40_8 real(kind = 4) :: p1 = 1.0_4 real(kind = 8) :: p2 = 3.4028234663852886e+40_8 print *, OUT_OF_RANGE(2147483648_8, 0_4, .TRUE.) if (OUT_OF_RANGE(2147483648_8, 0_4, .TRUE.) .neqv. .true.) error stop print *, OUT_OF_RANGE(6372_4, 2147483648_8, .TRUE.) if (OUT_OF_RANGE(6372_4, 2147483648_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(6372_4, 2147_4, .TRUE.) if (OUT_OF_RANGE(6372_4, 2147_4, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(2147483648_8, 9223372036854775807_8, .TRUE.) if (OUT_OF_RANGE(2147483648_8, 9223372036854775807_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(a2, b1, c) if (OUT_OF_RANGE(a2, b1, c) .neqv. .true.) error stop print *, OUT_OF_RANGE(a1, b2, c) if (OUT_OF_RANGE(a1, b2, c) .neqv. .false.) error stop a1 = 6372 a2 = 2147483648_8 b1 = 2147_4 b2 = 9223372036854775807_8 print *, OUT_OF_RANGE(a1, b1, c) if (OUT_OF_RANGE(a1, b1, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(a1, b2, c) if (OUT_OF_RANGE(a1, b2, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(3.4028234663852886e+40_8, 1.0_4, .TRUE.) if (OUT_OF_RANGE(3.4028234663852886e+40_8, 1.0_4, .TRUE.) .neqv. .true.) error stop print *, OUT_OF_RANGE(1.0_4, 3.4028234663852886e+40_8, .TRUE.) if (OUT_OF_RANGE(1.0_4, 3.4028234663852886e+40_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(3.4028235e+35_4, 1.0_4, .TRUE.) if (OUT_OF_RANGE(3.4028235e+35_4, 1.0_4, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(1.7976931348623158e+308_8, 2.0_8, .TRUE.) if (OUT_OF_RANGE(1.7976931348623158e+308_8, 2.0_8, .TRUE.) .neqv. .false.) error stop print *, OUT_OF_RANGE(r2, p1, c) if (OUT_OF_RANGE(r2, p1, c) .neqv. .true.) error stop print *, OUT_OF_RANGE(r2, p2, c) if (OUT_OF_RANGE(r2, p2, c) .neqv. .false.) error stop r1 = 1.0_4 r2 = 1.7976931348623158e+308_8 p1 = 2.0_4 p2 = 3.4028235e+38_4 print *, OUT_OF_RANGE(r1, p1, c) if (OUT_OF_RANGE(r1, p1, c) .neqv. .false.) error stop print *, OUT_OF_RANGE(r2, p2, c) if (OUT_OF_RANGE(r2, p2, c) .neqv. .false.) error stop end program lfortran-lfortran-2f73434/integration_tests/entry_10.f900000664000175000017500000000106015141516316023356 0ustar alastairalastairSUBROUTINE dinvr(x) IMPLICIT NONE DOUBLE PRECISION x DOUBLE PRECISION big,small,zx,zy,zz, zsmall, zbig LOGICAL qcond INTRINSIC abs,max,min LOGICAL qxmon SAVE qxmon(zx,zy,zz) = zx .LE. zy .AND. zy .LE. zz qcond = .NOT. qxmon(small,x,big) print *, "small = ", small print *, "x = ", x print *, "big = ", big print *, 'qcond = ', qcond IF (qcond) error stop entry distinv(zsmall, zbig) small = -1.6d0 big = 1.9d0 return end subroutine program entry_10 implicit none double precision :: x x = 0.5d0 call distinv(0.0d0, 1.0d0) call dinvr(x) end program lfortran-lfortran-2f73434/integration_tests/modules_22.f900000664000175000017500000000007315141516316023673 0ustar alastairalastairprogram modules_22 use modules_22_module implicit none end lfortran-lfortran-2f73434/integration_tests/string_52.f900000664000175000017500000000035215141516316023534 0ustar alastairalastair module string_52_mod contains subroutine sub(x, char) integer :: x character(x),optional :: char end subroutine end module program string_52 use string_52_mod call sub(10) end program lfortran-lfortran-2f73434/integration_tests/custom_operator_05.f900000664000175000017500000000215115141516316025450 0ustar alastairalastairmodule custom_operator_05_a implicit none public :: string_t type string_t character(len=:), allocatable :: string_ contains generic :: operator(//) => string_t_cat_string_t procedure, private :: string_t_cat_string_t end type contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_05_a module custom_operator_05_b use custom_operator_05_a implicit none contains subroutine test_concat type(string_t) :: str str = from_characters("a") // from_characters("b") end subroutine test_concat end module custom_operator_05_b program custom_operator_05 use custom_operator_05_b implicit none call test_concat() end program custom_operator_05 lfortran-lfortran-2f73434/integration_tests/functions_47.f900000664000175000017500000000111015141516316024233 0ustar alastairalastair! Test automatic reallocation of allocatable array of strings (string length is fixed) program functions_47 call sub() contains subroutine sub() character(10) :: string character(len=1), allocatable :: chars(:) chars = foo2([1, 1, 1]) ! <<<< Test automatic reallocation if(all(chars /= 'a')) error stop if(len(chars(1:1)) /= 1) error stop end subroutine elemental function foo2(pos) result(character_string) integer, intent(in) :: pos character(len=1) :: character_string character_string = 'a' end function end program lfortran-lfortran-2f73434/integration_tests/format_43.f900000664000175000017500000000027215141516316023517 0ustar alastairalastairprogram format_43 implicit none write(*, '('' Matrix types:'')') write(*, '(''Hello World'')') write(*, '('' Leading space'')') write(*, 100) 100 format(' This is a test') end program lfortran-lfortran-2f73434/integration_tests/subroutines_02.f900000664000175000017500000000122415141516316024602 0ustar alastairalastairprogram subroutines_02 implicit none integer :: i, j i = 1 j = 1 call f(i, j) print *, i, j if (i /= 1) error stop if (j /= 2) error stop call g(i, j) print *, i, j if (i /= 1) error stop if (j /= 0) error stop call h(i, j) print *, i, j if (i /= 1) error stop if (j /= 0) error stop contains subroutine f(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a + 1 end subroutine subroutine g(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a - 1 end subroutine subroutine h(a, b) integer, intent(in) :: a integer, intent(out) :: b call g(a, b) end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_366.f900000664000175000017500000000201015141516316024474 0ustar alastairalastairprogram intrinsics_366 implicit none integer :: x, v, ntz, y, i integer, parameter :: ITRLim = 80 ! Testing Collatz sequence using bit intrinsics ! Example1: using shiftl and ibclr x = 37 do i = 1, ITRLim if (btest(x, 0)) then ! odd v = shiftl(x, 2) - ibclr(x, 0) ! v = 4*x - (x-1) else v = x end if ntz = trailz(v) y = shiftr(v, ntz) print '(3i8)', x, v, y x = y if (x == 1) exit end do if (v /= 16) error stop if (y /= 1) error stop ! Example2: using simple 3x + 1 x = 37 do i = 1, ITRLim if (btest(x, 0)) then ! odd v = 3 * x + 1 else v = x end if ntz = trailz(v) y = shiftr(v, ntz) print '(3i8, 4x, i2)', x, v, y, ntz x = y if (x == 1) exit end do if (v /= 16) error stop if (y /= 1) error stop if (ntz /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/cmd_01.f900000664000175000017500000000036715141516316022771 0ustar alastairalastairprogram test_get_command_argument implicit none integer :: i = 0, count character(len=32) :: arg count = command_argument_count() print *, "count: ", count call get_command_argument(i, arg) print *, trim(arg) end program lfortran-lfortran-2f73434/integration_tests/elemental_16.f900000664000175000017500000000176315141516316024203 0ustar alastairalastairmodule elemental_16_mymod implicit none private public :: sub_1d, sub_elemental contains pure subroutine sub_1d(xout, xin1, xin2) real, intent(out) :: xout(:) real, intent(in) :: xin1, xin2 xout = 1.234*(xin2 - xin1) + xin1 end subroutine sub_1d pure elemental subroutine sub_elemental(xout, xin1, xin2) real, intent(out) :: xout real, intent(in) :: xin1, xin2 xout = 1.234*(xin2 - xin1) + xin1 end subroutine sub_elemental end module program main use, non_intrinsic :: elemental_16_mymod, only: sub_1d, sub_elemental implicit none integer, parameter :: n = 3 real :: v(n) v = -1.0 write(*,*) 'v: ',v call sub_1d(v, 0.0, 1.0) write(*,*) 'v: ',v if (.not. all(abs(v - 1.234) < 1e-5)) error stop v = -1.0 write(*,*) 'v: ',v call sub_elemental(v, 0.0, 1.0) write(*,*) 'v: ',v if (.not. all(abs(v - 1.234) < 1e-5)) error stop end program main lfortran-lfortran-2f73434/integration_tests/allocate_11.f900000664000175000017500000000076615141516316024016 0ustar alastairalastairmodule A_allocate_11 implicit none contains function dg() real(kind=8), allocatable :: dg(:) integer :: i, ierr allocate(dg(10)) dg = 10.0_8 end function dg function rg() real, allocatable :: rg(:) allocate(rg(10)) ! TODO: Should happen automatically rg = real(dg()) end function rg end module program allocate_11 use A_allocate_11 implicit none real, allocatable :: rg_result(:) rg_result = rg() print *, rg_result if( any(rg_result /= 10) ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_22.f900000664000175000017500000000206715141516316024415 0ustar alastairalastairprogram intrinsics_22 ! Test min/max intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = min(-5., 3.), & s1b = max(-5., 3.) real(dp), parameter :: & d1 = min(-5._dp, 3._dp), & d1b = max(-5._dp, 3._dp) integer, parameter :: & j1 = min(-5, 3), & j1b = max(-5, 3) real :: x1, x2 real(dp) :: y1, y2, p1, p2 integer :: i1, i2 i1 = -5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; p1 = 5.0; p2 = 23.0; print *, min(-5., 3.), min(-5._dp, 3._dp), min(x1, x2), min(y1, y2), s1, d1 print *, max(-5., 3.), max(-5._dp, 3._dp), max(x1, x2), max(y1, y2), s1b, d1b print *, min(-5, 3), min(i1, i2), j1 print *, max(-5, 3), max(i1, i2), j1b if (abs(dmin1(p1, p2) - 5.0) > 1e-5) error stop if (abs(dmax1(p1, p2) - 23.0) > 1e-5) error stop if (abs(dmin1(12.0, -13.0) + 13.0) > 1e-5) error stop if (abs(dmax1(10.5, 12424.0) - 12424.0) > 1e-5) error stop if (abs(dmax1(0.0, -2.24) - 0.0) > 1e-5) error stop if (abs(dmin1(-12.3, 0.0) + 12.3) > 1e-5) error stop end lfortran-lfortran-2f73434/integration_tests/derived_types_32.f900000664000175000017500000000121315141516316025067 0ustar alastairalastairmodule testdrive_derived_types_32 implicit none private public :: real_dp_to_string contains pure function real_dp_to_string(val) result(string) real(8), intent(in) :: val character(len=:), allocatable :: string integer, parameter :: buffer_len = 128 character(len=buffer_len) :: buffer write(buffer, '(g0)') val string = trim(buffer) end function real_dp_to_string end module testdrive_derived_types_32 program main use testdrive_derived_types_32 implicit none real(8) :: value value = 10.0 print *, real_dp_to_string(value) if( real_dp_to_string(value) /= "10.000000000000000" ) error stop end program lfortran-lfortran-2f73434/integration_tests/class_86.f900000664000175000017500000000132115141516316023337 0ustar alastairalastairmodule class_86_mod type :: downloader_t integer, allocatable :: arr(:) contains procedure, nopass :: upload_form end type downloader_t contains subroutine upload_form(strs) integer, dimension(:), intent(in) :: strs end subroutine upload_form subroutine get_from_registry(downloader_) class(downloader_t), intent(inout) :: downloader_ integer :: i allocate(downloader_%arr(10)) downloader_%arr = [(i, i=1,10)] end subroutine get_from_registry end module class_86_mod program class_86 use class_86_mod implicit none type(downloader_t) :: dl integer :: i call get_from_registry(dl) if (any(dl%arr /= [(i, i=1,10)])) error stop end program class_86 lfortran-lfortran-2f73434/integration_tests/print_arr_04.f900000664000175000017500000000016015141516316024220 0ustar alastairalastairprogram expr2 implicit none integer :: _arr(1) = [89] if (_arr(1) /= 89) error stop print *, _arr end program lfortran-lfortran-2f73434/integration_tests/module_function_without_nopass.f900000664000175000017500000000326415141516316030265 0ustar alastairalastair!> This test file makes sure that optional arguments !> are passed correctly for StructMethodDeclaration with/without nopass module modules_module_function_without_nopass implicit none private public :: calculator, SQUARE ! Expose both the type and the SQUARE function type :: calculator contains procedure :: SQUARE ! Associate SQUARE with the calculator type procedure :: AREA end type calculator contains ! Define SQUARE as a module procedure. function SQUARE(this, x) result(square_result) class(calculator), intent(in) :: this integer, optional, intent(in) :: x integer :: square_result if (present(x)) then square_result = x * x else square_result = 1 end if end function SQUARE function AREA(this, x, y) result(area_result) class(calculator), intent(in) :: this integer, optional, intent(in) :: x integer, optional, intent(in) :: y integer :: area_result if (present(x) .and. present(y)) then area_result = x * y else area_result = 1 end if end function end module modules_module_function_without_nopass program module_function_without_nopass use modules_module_function_without_nopass implicit none type(calculator) :: calc integer :: number, result, area1, area2, area3 number = 4 result = calc%SQUARE(number) if (result /= 16) error stop area1 = calc%AREA() if (area1 /= 1) error stop area2 = calc%AREA(1, 2) if (area2 /= 2) error stop area3 = calc%AREA(1) if (area3 /= 1) error stop end program module_function_without_nopass lfortran-lfortran-2f73434/integration_tests/cos_01.f900000664000175000017500000000027215141516316023005 0ustar alastairalastairprogram cos_01 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x x = cos(1.5_dp) print *, x if (abs(x - 7.07372016677029064e-02_dp) > 1e-16_dp) error stop end program lfortran-lfortran-2f73434/integration_tests/class_37.f900000664000175000017500000000117315141516316023340 0ustar alastairalastairmodule stdlib_hashmap_wrappers_class_37 implicit none type :: other_type class(*), allocatable :: value end type other_type end module stdlib_hashmap_wrappers_class_37 program class_37 use stdlib_hashmap_wrappers_class_37 implicit none type(other_type) :: other integer :: val = 1 call get_other_open_data( other, val ) print *, val if (val /= 2) error stop contains subroutine get_other_open_data( other, val ) type(other_type), intent(out) :: other integer,intent(inout) :: val val = 2 end subroutine get_other_open_data end programlfortran-lfortran-2f73434/integration_tests/modules_03.f900000664000175000017500000000476315141516316023704 0ustar alastairalastairmodule types implicit none private public dp integer, parameter :: dp = kind(0.d0) end module module constants ! Some constants use types, only: dp implicit none private public pi, e_, i_, bohr2ang, ang2bohr, Ha2eV, kB, K2au, density2gcm3, u2au, & s2au, kJmol2Ha ! Constants contain more digits than double precision, so that ! they are rounded correctly. Single letter constants contain underscore so ! that they do not clash with user variables ("e" and "i" are frequently used as ! loop variables) real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp real(dp), parameter :: e_ = 2.7182818284590452353602874713527_dp complex(dp), parameter :: i_ = (0, 1) real(dp), parameter :: Na = 6.02214129e23_dp ! Avogadro constant ! Standard uncertainty 0.00000027 (Source: 2010 CODATA) real(dp), parameter :: Ha2eV = 27.21138505_dp ! 1 Ha = (1 * Ha2eV) eV ! Standard uncertainty is 0.00000060 eV (Source: 2010 CODATA) real(dp), parameter :: J2Ha = 2.29371248e17_dp ! 1 J = (1 * J2Ha) Ha ! Standard uncertainty is 0.00000010 eV (Source: 2010 CODATA) ! Reduced Planck constant real(dp), parameter :: hbar = 1.054571726e-34_dp ! [J s] ! Standard uncertainty is 0.000000047 eV (Source: 2010 CODATA) ! Covert Ha to cm^{-1} (energy equivalent) ! 1 Ha = (1 * Ha2invcm) cm^{-1} real(dp), parameter :: Ha2invcm = 219474.6313708_dp ! Standard uncertainty is 0.0000011 cm^{-1} (Source: 2010 CODATA) real(dp), parameter :: kB = 1.3806488e-23_dp ! Boltzmann constant [J/K] ! Standard uncertainty is 0.0000013 J/K (Source: 2010 CODATA) real(dp), parameter :: me = 9.10938291e-31_dp ! electron rest mass [kg] ! Standard uncertainty is 0.00000040 eV (Source: 2010 CODATA) ! Converts K to a.u.: real(dp), parameter :: K2au = J2Ha*kB ! 1 K = (1 * K2au) a.u. ! Conversion between Bohr (Hartree atomic units) and Angstrom real(dp), parameter :: bohr2ang = 0.529177249_dp real(dp), parameter :: ang2bohr = 1 / bohr2ang ! Converts eV to kcal/mol, it is assumed, that the number in eV is given per ! molecule. 1 eV = (1 * eV2kcalmol) kcal/mol real(dp), parameter :: kcalmol2kJmol = 4.184_dp real(dp), parameter :: kJmol2Ha = 1000 * J2Ha / Na ! Converts density from a.u. to g/cm^3 real(dp), parameter :: density2gcm3 = me*1e3_dp / (bohr2ang*1e-8_dp)**3 ! Converts u (atomic mass unit) to a.u. real(dp), parameter :: u2au = 1 / (Na * me * 1e3_dp) ! Converts s to a.u. real(dp), parameter :: s2au = 1 / (J2Ha*hbar) end module program modules_03 use constants, only: Ha2eV print *, Ha2eV end program lfortran-lfortran-2f73434/integration_tests/openmp_66.f900000664000175000017500000000114315141516316023530 0ustar alastairalastairprogram openmp_66 implicit none integer, parameter :: N = 100 integer :: i, sum_expected, sum_actual sum_actual = 0 sum_expected = (N*(N+1)) / 2 ! sum from 1 to N !$omp parallel do private(i) do i = 1, N !$omp atomic sum_actual = sum_actual + i !$omp end atomic end do !$omp end parallel do if (sum_actual /= sum_expected) then print *, 'Error: Incorrect result from atomic addition.' print *, 'Expected:', sum_expected, ' Got:', sum_actual error stop else print *, 'Test passed: atomic addition is correct. Sum =', sum_actual end if end program openmp_66lfortran-lfortran-2f73434/integration_tests/modules_05.f900000664000175000017500000000035515141516316023677 0ustar alastairalastairmodule modules_05_mod implicit none private integer, parameter, public :: a = 5 integer, parameter :: b = 6 integer, parameter :: c = 7 public :: c end module program modules_05 use modules_05_mod, only: a, c print *, a, c end program lfortran-lfortran-2f73434/integration_tests/string_49.f900000664000175000017500000000114315141516316023541 0ustar alastairalastairmodule string_49_mod implicit none private character(len=128) :: str = '' public getopt, str contains subroutine getopt() character(len=10) :: status if (str(1:1) == '-') error stop if (str(1:128) == '-') error stop end subroutine getopt end module string_49_mod program string_49 use string_49_mod character(len=10) :: status character(len=128) :: str2 = '' call getopt() if (str(1:1) == '-') error stop if (str2(1:1) == '-') error stop if (str(1:128) == '-') error stop if (str2(1:128) == '-') error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_29.f900000664000175000017500000000075515141516316023542 0ustar alastairalastairprogram arrays_29 real :: B(10, 2), rescol1, rescol2 B(:, 1) = 1 B(:, 2) = 2 rescol1 = mysum(size(B, 1), B(:, 1)) print *, rescol1 if( rescol1 /= 10.0 ) error stop rescol2 = mysum(size(B, 1), B(:, 2)) print *, rescol2 if( mysum(size(B, 1), B(:, 2)) /= 20.0 ) error stop contains real function mysum(n, A) result(r) integer, intent(in) :: n real, intent(in) :: A(n) integer :: i r = 0 do i = 1, size(A) r = r + A(i) end do end function end program lfortran-lfortran-2f73434/integration_tests/test_iso_fortran_env.f900000664000175000017500000000071115141516316026153 0ustar alastairalastairprogram test_iso_fortran_env use iso_fortran_env, only: int32, int64, real32, real64 implicit none real(real32) :: r4 real(real64) :: r8 integer(int32) :: i4 integer(int64) :: i8 real(real32), parameter :: r4p = 1._real32 integer(int32), parameter :: i4p = 1_int32 r4 = 1._real32 r8 = 1._real64 i4 = 1_int32 i8 = 1_int64 !if (kind(r4) /= 4) error stop !if (kind(r8) /= 8) error stop !if (kind(i4) /= 4) error stop !if (kind(i8) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/assign_to1.f900000664000175000017500000000012315141516316023763 0ustar alastairalastairprogram main 1000 if (0<1) assign 15 to k 100 goto k 15 print *, "run" end program lfortran-lfortran-2f73434/integration_tests/functions_18.f900000664000175000017500000000074515141516316024246 0ustar alastairalastairprogram functions_18 implicit none type t integer, pointer :: x(:) end type t type(t) :: type_1 integer, target :: x_global(3) x_global = 124 allocate(type_1%x(3)) type_1%x => x_global print*, sub(type_1%x) contains function sub(x) integer, intent(in) :: x(:) integer :: sub(size(x)), i sub = x do i = 1, size(sub) if (sub(i) /= 124) error stop end do end function sub end program lfortran-lfortran-2f73434/integration_tests/template_add_02.f900000664000175000017500000000242115141516316024643 0ustar alastairalastairmodule template_add_02_m implicit none private public :: add_t, test_template requirement r(t, f) type, deferred :: t function f(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z end function end requirement template add_t(t, f) require :: r(t, f) private public :: add_generic contains function add_generic(x, y) result(z) type(t), intent(in) :: x, y type(t) :: z z = f(x, y) end function end template interface operator (+) module procedure func_arg_real end interface contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic real :: x, y x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_add_02 use template_add_02_m implicit none call test_template() end program lfortran-lfortran-2f73434/integration_tests/string_39.f900000664000175000017500000000022715141516316023542 0ustar alastairalastairprogram string_39 implicit none character(len=8) :: s s = "lfortran" print*, "s:", s(+(1+1):4) if (s(+(1+1):4) /= "for") error stop end program lfortran-lfortran-2f73434/integration_tests/modules_34_module1a.f900000664000175000017500000000125315141516316025466 0ustar alastairalastairmodule fpm_versioning_modules_34 implicit none type :: version_t integer, allocatable :: num(:) contains procedure :: to_string end type version_t interface char module procedure :: as_string end interface char contains subroutine to_string(self, string) class(version_t), intent(in) :: self character(len=:), allocatable, intent(out) :: string end subroutine to_string function as_string(self) result(string) class(version_t), intent(in) :: self character(len=:), allocatable :: string call self%to_string(string) end function as_string end module fpm_versioning_modules_34 lfortran-lfortran-2f73434/integration_tests/intrinsics_01.f900000664000175000017500000000100015141516316024374 0ustar alastairalastairprogram intrinsics_01 integer, parameter :: dp = kind(0.d0) real(dp) :: a, b, c(4) integer :: i a = 1.1_dp b = 1.2_dp if (b-a > 0.2_dp) error stop if (abs(b-a) > 0.2_dp) error stop if (abs(a-b) > 0.2_dp) error stop a = 4._dp if (abs(sqrt(a)-2._dp) > 1e-12_dp) error stop a = 4._dp if (abs(log(a)-1.3862943611198906_dp) > 1e-12_dp) error stop c(1) = -1._dp c(2) = -1._dp c(3) = -1._dp c(4) = -1._dp call random_number(c) do i = 1, 4 if (c(i) < 0._dp) error stop if (c(i) > 1._dp) error stop end do end lfortran-lfortran-2f73434/integration_tests/intrinsics_327.f900000664000175000017500000000127315141516316024503 0ustar alastairalastairprogram intrinsics_327 real :: A(2,3) = reshape([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [2, 3]) real, allocatable :: B(:, :) allocate(B(3, 2)) call wrapper_transpose(A, B) print *, B(1, 1) if (B(1, 1) /= 1.0) error stop print *, B(1, 2) if (B(1, 2) /= 2.0) error stop print *, B(2, 1) if (B(2, 1) /= 3.0) error stop print *, B(2, 2) if (B(2, 2) /= 4.0) error stop print *, B(3, 1) if (B(3, 1) /= 5.0) error stop print *, B(3, 2) if (B(3, 2) /= 6.0) error stop contains subroutine wrapper_transpose(M, N) real, intent(in) :: M(:, :) real, intent(out) :: N(:, :) N = transpose(M) end subroutine end program lfortran-lfortran-2f73434/integration_tests/complex_solutions.f900000664000175000017500000000172515141516316025513 0ustar alastairalastairprogram complex_solutions ! print some complex solutions to the equation: 1**x = rhs. use, intrinsic :: iso_fortran_env, only: wp=>real64 implicit none complex(wp) :: z1, arg, x real(wp), parameter :: rhs = 4.0_wp, twopi = 8 * atan(1.0_wp), lnrhs = log(rhs), tol = 1.0e-12_wp integer :: k character(*), parameter :: cfmth='("Complex solutions to 1**x=",g0.4/a2,*(4x,a11,5x))', & & cfmt='(i2,*(" (",es0.2,",",es0.2,")":))' write(*,cfmth) rhs, 'k', 'arg=i2Pik', 'exp(arg)', 'x', 'exp(arg)**x', 'exp(arg*x)' do k = 1, 10 arg = cmplx(0.0_wp, twopi * k, kind=wp) z1 = exp(arg) x = cmplx(0.0_wp, -lnrhs/(twopi*k), kind=wp) ! Check for correctness: if (abs(real(exp(arg*x)) - rhs) > tol .or. abs(aimag(exp(arg*x))) > tol) then print *, "Integration test failed for k=", k error stop 1 end if write(*,cfmt) k, arg, z1, x, z1**x, exp(arg*x) end do end program complex_solutions lfortran-lfortran-2f73434/integration_tests/format_04.f900000664000175000017500000000213415141516316023513 0ustar alastairalastairprogram format_04 real :: a,b,c,d double precision :: r,s,t integer :: f real(8) :: p,q a = 123.456 b = 123.45678 c = 12.34 d = 123.45 f = 12345 r = 12345678 s = 23.5678 t = 0.345678 p = 2.0d0 q = 0.0d0 print *, "ok", "b" print '(a,a)', "ok", "b" print '("Success!",/,10X,A6,"World!")',"Hello 123" print '(4a4)',"dancing","in","the","moonlight" print '(A2,4(2X,A),I3)',"ab", "cdef", "ghi", "jkl","qwerty",12 print '(i3,i10.5,/i6.6,2x,i3)' , 123,456,12345,6789 print '(d10.2,d15.6,d010.2,2x,d7.2)', 123.456, -123.45678, 12.34, -123.45 print '(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2)', -a, b, -c, d print '(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2)', -a, b, -c, d print "(12(i3))", 1,2,3,4,5,6,7,8,9,10,11,12 print "(4(i3),' hello')", 1,2,3,4,5,6,7,8,9,10,11,12,13,14 print '(i0)', f, -f print '(d12.5,1x,d0.1,1x,d0.2)',a,b,c print '(d12.5,1x,d0.1,1x,d0.2)',-a,-b,-c print '("Hello")' print '( F13.3,1X,F9.6,1X, F0.2 )', r, s, t print '( F13.3,1X,F9.6,1X, F0.2 )', -r, -s, -t print '(1PE13.6)', p, q print '(F30.25)', 12345e-25 print '("x:", F4.2, " y:", ES7.1)', 1.123, 4.456 print '("x:", ES10.2)', 0.999, 0.1 end program lfortran-lfortran-2f73434/integration_tests/openmp_06.f900000664000175000017500000000201315141516316023517 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 0 !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1 end do !$omp end do ! the following condition shall be true almost always ! if (local_ctr > ( n / omp_get_max_threads()) + 5) error stop ! TODO: fix this, it was previously wrong in LFortran. ! With this PR, we get correct ASR and thus error stop is triggered, previously the ASR node was before ! the parallel region and thus the error stop was not triggered. ! To fix this we need to parallelize the if statement, which is not supported yet. ! Refer: https://github.com/lfortran/lfortran/issues/4147 to fix it !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_28b.f900000664000175000017500000000031015141516316026567 0ustar alastairalastair! Common block with CHARACTER - reader subroutine subroutine print_name() implicit none character(32) :: srnamt common /srnamc/ srnamt if (srnamt /= 'HELLO') error stop end subroutine lfortran-lfortran-2f73434/integration_tests/present_01.f900000664000175000017500000000054315141516316023702 0ustar alastairalastairmodule present_01_module implicit none contains subroutine foo1(a) real, intent(in), optional :: a(:) call foo2(a) end subroutine subroutine foo2(a) real, intent(in), optional :: a(..) if (present(a)) error stop end subroutine end module program present_01 use present_01_module implicit none call foo1() end lfortran-lfortran-2f73434/integration_tests/interface_20.f900000664000175000017500000000077515141516316024172 0ustar alastairalastairmodule mod_interface_20 implicit none interface free_map_entry_pool module procedure free_map_entry_pool end interface free_map_entry_pool contains subroutine free_map_entry_pool(pool) integer, intent(inout) :: pool pool = 3 end subroutine free_map_entry_pool end module mod_interface_20 program interface_20 use mod_interface_20 implicit none integer :: i = 1 call free_map_entry_pool(i) print *, i if (i /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/test_ieee_int.f900000664000175000017500000000316215141516316024542 0ustar alastairalastair! Test ieee_int function program test_ieee_int use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp real(real64) :: x_dp integer :: i print *, "Testing ieee_int..." ! Test 1: Convert 3.2 to integer (should round to 3) x_sp = 3.2_real32 i = ieee_int(x_sp) print *, "ieee_int(3.2) = ", i if (i /= 3) error stop "3.2 should convert to 3" ! Test 2: Convert 3.7 to integer (should round to 4) x_sp = 3.7_real32 i = ieee_int(x_sp) print *, "ieee_int(3.7) = ", i if (i /= 4) error stop "3.7 should convert to 4" ! Test 3: Negative number x_sp = -2.3_real32 i = ieee_int(x_sp) print *, "ieee_int(-2.3) = ", i if (i /= -2) error stop "-2.3 should convert to -2" ! Test 4: Negative number rounding x_sp = -2.7_real32 i = ieee_int(x_sp) print *, "ieee_int(-2.7) = ", i if (i /= -3) error stop "-2.7 should convert to -3" ! Test 5: Zero x_sp = 0.0_real32 i = ieee_int(x_sp) print *, "ieee_int(0.0) = ", i if (i /= 0) error stop "0.0 should convert to 0" ! Test 6: Double precision x_dp = 9.4_real64 i = ieee_int(x_dp) print *, "ieee_int(9.4d0) = ", i if (i /= 9) error stop "9.4d0 should convert to 9" ! Test 7: Large value (uses default rounding mode - round to nearest) x_sp = 100.4_real32 i = ieee_int(x_sp) print *, "ieee_int(100.4) = ", i if (i /= 100) error stop "100.4 should convert to 100" print *, "All ieee_int tests passed!" end program test_ieee_int lfortran-lfortran-2f73434/integration_tests/intrinsics_132.f900000664000175000017500000000404715141516316024477 0ustar alastairalastairprogram intrinsics_132 real :: x = 5.8 integer, parameter :: array_size = 3 integer(kind = 4) :: res_4 integer(kind = 8) :: res_8 integer :: test_kind integer(kind=4) :: res_4_arr(array_size) integer(kind=8) :: res_8_arr(array_size) res_4 = floor(x) print *, res_4 if (res_4 /= 5) error stop res_8 = floor(x, 8) print *, res_8 if (res_8 /= 5) error stop res_4 = floor(x, 4) print *, res_4 if (res_4 /= 5) error stop res_4 = floor(5.8) print *, res_4 if (res_4 /= 5) error stop res_8 = floor(5.8, 8) print *, res_8 if (res_8 /= 5) error stop res_4 = floor(0.0) print *, res_4 if (res_4 /= 0) error stop res_8 = floor(0.0, 8) print *, res_8 if (res_8 /= 0) error stop res_4 = floor(-412.124) print *, res_4 if (res_4 /= -413) error stop res_8 = floor(-412.124, 8) print *, res_8 if (res_8 /= -413) error stop test_kind = kind(floor(x,4)) print *, test_kind if (test_kind /= 4) error stop test_kind = kind(floor(x,8)) print *, test_kind if (test_kind /= 8) error stop test_kind = kind(floor(5.0,4)) print *, test_kind if (test_kind /= 4) error stop test_kind = kind(floor(5.0,8)) print *, test_kind if (test_kind /= 8) error stop test_kind = kind(floor(0.0)) print *, test_kind if (test_kind /= 4) error stop ! Compile time broadcasting res_4_arr = floor([real:: 1.2, 3.3, 5]) print *, res_4_arr(1) if (res_4_arr(1) /= 1) error stop print *, res_4_arr(2) if (res_4_arr(2) /= 3) error stop print *, res_4_arr(3) if (res_4_arr(3) /= 5) error stop res_8_arr = floor([real(8) :: 1.2, 3.3, 5], kind=8) print *, res_8_arr(1) if (res_8_arr(1) /= 1) error stop if (kind(res_8_arr(1)) /= 8) error stop print *, res_8_arr(2) if (res_8_arr(2) /= 3) error stop if (kind(res_8_arr(2)) /= 8) error stop print *, res_8_arr(3) if (res_8_arr(3) /= 5) error stop if (kind(res_8_arr(3)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/file_31.f900000664000175000017500000000172515141516316023147 0ustar alastairalastairprogram file_31 use iso_fortran_env, only: int16 integer(int16), allocatable :: d(:,:) integer(int16), allocatable :: a(:) integer :: i, ios, s, j allocate(d(3,3)) allocate(a(3)) ! open a file and read data into the array open(unit=s, file='file_31_data.txt', status='old', action='read', iostat=ios) if (ios /= 0) then print *, "Error opening file" stop end if read(s, *, iostat=ios) a if (ios /= 0) then print *, "Error reading data" stop end if do i = 1, 3 do j = 1, 3 read(s, *, iostat=ios) d(i, j) if (ios /= 0) then print *, "Error reading data" stop end if end do end do close(s) print *, "Loaded data:" do i = 1, 2 print *, d(i, :) end do print *, sum(d) if ( sum(d) /= 1440 ) error stop print *, sum(a) if ( sum(a) /= 60 ) error stop end program file_31 lfortran-lfortran-2f73434/integration_tests/expr_05.f900000664000175000017500000000232315141516316023202 0ustar alastairalastairprogram expr_05 ! Test parantheses in expressions implicit none integer :: x, a, b, c logical :: l a = 3 b = 4 c = 5 x = 2*3 x = -2*3 x = 2*(-3) x = -2*(-3) x = (-2)*(-3) x = -2**3 x = -(2**3) x = -(2*3) x = 2**(-3) x = a x = (a) x = a*b x = -a*b x = -(a*b) x = a*(-b) x = (-a)*(-b) x = a*b*c x = -a*b*c x = a*(-b)*c x = a*b*(-c) x = (-a)*(-b)*(-c) x = 3+4*5 x = (3+4)*5 x = a*(b + 5*(c - b)) x = (3-2*a*b)*5 x = (-2*a*b+3)*5 x = (-2*a*b+3*b*a)*5 x = (-2*(a/b)+(a+(-b))**2)*5 x = (+2*a*b+3)*5 x = a**2 + 2*a*b + b**2 x = (a + b)*(a - b) x = (a + b)**2 x = (a + b)*(a**2 - a*b + b**2) x = (a - b)*(a + b)*(a**2 + b**2) x = 1/(a*b) x = 1/a*b x = (1/a)*b x = 1/(a*b+1) x = 1/a*b+1 x = (1/a)*b+1 x = 2-(-2) x = a-(-b-c) x = a-(-2*b) x = c-(-2/b) x = a-(2+3+4) x = a+(2+3+4) x = 2*a+a*b-(a*b+2*a) x = 2*a+a*b-(a*b-2*a) x = a-(b-(c-1)) x = a-b x= a-(b-c) x= a-b-c x = -(a-(-b+(-b-(-b*b)))) x = -(3+5) x = -(a+5) l = x**3*4+a <= 4 .or. x<5 .and. x<6 .eqv. .true. .or. .not. .false. .and..true. l = l .or. l .and. l l = (l .or. l) .and. l l = l .and. l .or. l l = l .and. (l .or. l) l = l .or. .not. l .and. l l = l .or. l .and. .not. l l = l .and. l .or. .not. l l = l .and. .not. l .or. l l = l .and. .not. (l .or. l) end program lfortran-lfortran-2f73434/integration_tests/functions_16.f900000664000175000017500000000510015141516316024232 0ustar alastairalastairmodule tomlf_utils_sort implicit none type :: toml_key character(len=:), allocatable :: key end type toml_key interface sort module procedure :: sort_keys end interface abstract interface pure function compare_less(lhs, rhs) result(less) import :: toml_key type(toml_key), intent (in) :: lhs type(toml_key), intent (in) :: rhs logical :: less end function compare_less end interface contains pure subroutine sort_keys(list, idx, compare) type(toml_key), intent(inout) :: list(:) integer, intent(out), optional :: idx(:) procedure(compare_less), optional :: compare integer :: low, high, i type(toml_key), allocatable :: sorted(:) integer, allocatable :: indexarray(:) low = 1 high = size(list) sorted = list allocate(indexarray(high), source=[(i, i=low, high)]) if (present(compare)) then call quicksort(sorted, indexarray, low, high, compare) else call quicksort(sorted, indexarray, low, high, compare_keys_less) end if do i = low, high list(i) = sorted(indexarray(i)) end do if (present(idx)) then idx = indexarray end if end subroutine sort_keys pure recursive subroutine quicksort(list, idx, low, high, less) type(toml_key), intent(inout) :: list(:) integer, intent(inout) :: idx(:) integer, intent(in) :: low, high procedure(compare_less) :: less integer :: i, last integer :: pivot if (low < high) then call swap(idx(low), idx((low + high)/2)) last = low do i = low + 1, high if (less(list(idx(i)), list(idx(low)))) then last = last + 1 call swap(idx(last), idx(i)) end if end do call swap(idx(low), idx(last)) pivot = last call quicksort(list, idx, low, pivot - 1, less) call quicksort(list, idx, pivot + 1, high, less) end if end subroutine quicksort pure subroutine swap(lhs, rhs) integer, intent(inout) :: lhs integer, intent(inout) :: rhs integer :: tmp tmp = lhs lhs = rhs rhs = tmp end subroutine swap pure function compare_keys_less(lhs, rhs) result(less) type(toml_key), intent (in) :: lhs type(toml_key), intent (in) :: rhs logical :: less less = lhs%key < rhs%key end function compare_keys_less end module tomlf_utils_sort program functions_16 print *, "running functions_16 program" end program lfortran-lfortran-2f73434/integration_tests/select_type_18.f900000664000175000017500000000061115141516316024546 0ustar alastairalastairprogram select_type_18 implicit none logical, target :: l(3) class(*), pointer :: generic(:) logical, pointer :: p(:) l = [.true., .false., .true.] generic => l select type (generic) type is (logical) p => generic if (count(p) /= 2) error stop class default error stop end select print *, "ok" end program select_type_18 lfortran-lfortran-2f73434/integration_tests/minpack_02.f900000664000175000017500000000074515141516316023651 0ustar alastairalastairmodule minpack_02_testmod_der1 implicit none integer, parameter :: dp=kind(0d0) contains subroutine check_deriv(x, fvec, fjac) real(dp), intent(in) :: x(:) real(dp), intent(out) :: fvec(:), fjac(:,:) real(dp) :: xp(size(x)), fvecp(size(fvec)), err(size(fvec)) end subroutine end module program minpack_test use minpack_02_testmod_der1, only: dp, check_deriv implicit none real(dp) :: x1(10), fvec1(20), fjac1(30, 40) call check_deriv(x1, fvec1, fjac1) end program minpack_test lfortran-lfortran-2f73434/integration_tests/do_loop_05.f900000664000175000017500000000023415141516316023656 0ustar alastairalastairprogram do_loop_05 integer :: a, b, res b = 5 res = 0 do 1 a = b, 1, -b res = res + a 1 continue print *, res if ( res /= 5 ) error stop end program lfortran-lfortran-2f73434/integration_tests/sum_02.f900000664000175000017500000000036015141516316023024 0ustar alastairalastairprogram sum_02 integer :: x(5, 10), xdiff, i, j do i = 1, 5 do j = 1, 10 x(i, j) = i + j end do end do xdiff = abs(sum(x) - 425) print *, xdiff if( xdiff /= 0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/where_05.f900000664000175000017500000000126215141516316023337 0ustar alastairalastairprogram main use iso_fortran_env, only: wp => real64 implicit none call compare_solutions() contains subroutine compare_solutions() implicit none double precision :: reldiff(2) double precision :: absdiff reldiff = 0.0_wp absdiff = 0.5_wp where (solution() /= 0.0_wp) reldiff = absdiff / abs(solution()) if (abs(reldiff(1) - 5.0_wp) > 1e-7) error stop if (abs(reldiff(2) - 5.0_wp) > 1e-7) error stop print *, reldiff end subroutine compare_solutions pure function solution() result(x) implicit none double precision :: x(2) x = [0.10_wp,0.10_wp] end function solution end program main lfortran-lfortran-2f73434/integration_tests/subroutines_07.f900000664000175000017500000000077415141516316024620 0ustar alastairalastairmodule subroutines_07_mod interface f_int procedure f end interface contains subroutine f(a, b, c, d, kind) integer, intent(in) :: a, d, c integer, intent(in), optional :: kind integer, intent(out) :: b b = a + 1 + c + d end subroutine end module program subroutines_07 use subroutines_07_mod implicit none integer :: i, j, k, l i = 1 j = 1 k = 1 l = 1 call f_int(i, j, k, l) if (j /= 4) error stop end programlfortran-lfortran-2f73434/integration_tests/cycle_and_exit3.f900000664000175000017500000000053615141516316024761 0ustar alastairalastairprogram loop_and_block integer :: i l1 : do i = 1, 10 print *, "l1", i b1 : block if (i > 2) then exit l1 end if end block b1 if (i > 2) then print *, "error l1" end if end do l1 if (i == 3) then print *, "pass" end if end programlfortran-lfortran-2f73434/integration_tests/conv_complex2real.f900000664000175000017500000000015215141516316025340 0ustar alastairalastairprogram conv_complex2real complex Z real x Z = (3.0, 4.0) X=DBLE(Z) if (abs(X-3.0) > 1e-5) error stop end lfortran-lfortran-2f73434/integration_tests/template_array_04.f900000664000175000017500000000215015141516316025232 0ustar alastairalastairmodule reverse_m implicit none private public :: reverse_tmpl, test_reverse requirement default_behavior(t) type, deferred :: t end requirement template reverse_tmpl(t) require :: default_behavior(t) private public :: reverse contains subroutine swap(x, y) type(t), intent(inout) :: x, y type(t) :: tmp tmp = x x = y y = tmp end subroutine subroutine reverse(arr) type(t), intent(inout) :: arr(:) integer :: i, j do i = 1, size(arr)/2 j = size(arr)+1-i call swap(arr(i), arr(j)) end do end subroutine end template contains subroutine test_reverse() instantiate reverse_tmpl(integer), & only: ireverse => reverse integer :: a(5) a = [1,2,3,4,5] call ireverse(a) print *, a if (a(1) /= 5) error stop if (a(5) /= 1) error stop end subroutine end module program main use reverse_m call test_reverse() end program lfortran-lfortran-2f73434/integration_tests/subroutines_15.f900000664000175000017500000000075715141516316024620 0ustar alastairalastairmodule subroutines_15_module contains subroutine cb(a,x) implicit none integer, intent(in) :: a integer, intent(in), optional :: x(:) end subroutine cb end module subroutines_15_module program subroutines_15 use subroutines_15_module call temp(cb) contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back integer :: a call call_back(a) end subroutine temp end program subroutines_15 lfortran-lfortran-2f73434/integration_tests/class_70.f900000664000175000017500000000073115141516316023334 0ustar alastairalastairprogram class_70 type :: temp_type integer :: x end type class(*), allocatable :: a, b, c allocate(a, source=temp_type(3)) allocate(b, source=temp_type(5)) ! c = b !! Handle allocation in `check_and_allocate_scalar` in llvm ! select type (c) ! type is (temp_type) ! if (c%x /= 5) error stop ! end select b = a select type (b) type is (temp_type) if (b%x /= 3) error stop end select end programlfortran-lfortran-2f73434/integration_tests/namelist_22.f900000664000175000017500000000076715141516316024051 0ustar alastairalastairprogram namelist_22 character(len=1), allocatable :: a(:) character(len=200) :: buf integer :: u, ios logical :: found namelist /n/ a allocate(a(1)) a(1) = "x" open(newunit=u, status="scratch", action="readwrite") write(u, nml=n) rewind(u) found = .false. do read(u, "(A)", iostat=ios) buf if (ios /= 0) exit if (index(buf, "x") /= 0) found = .true. end do close(u) if (.not. found) error stop end program namelist_22 lfortran-lfortran-2f73434/integration_tests/intrinsics_268.f900000664000175000017500000001171615141516316024512 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = asin([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = asin([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.67922251126401767_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 1.5707963267948966_dp, & 0.97796627122261770_dp, 1.2620530499450677_dp, -0.24404138779115148_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 1.57079637_sp, & 0.977966249_sp, 1.26205301_sp, -0.244041398_sp] res_x = asin(arg_x) res_y = asin(arg_y) expected_res_x = [-0.84309112198096470_dp, -0.61231892714946035_dp, -0.30622442822953339_dp, & 0.84309112198919456_dp, 0.61231892714946035_dp, 0.30622442822953339_dp, 0.65287843094856091_dp, & 7.8124925903421710E-002_dp, 0.26835843496713735_dp, -0.24909920725508472_dp, & -0.95383054718869975_dp, 0.65287843094856091_dp, 7.8124925903421710E-002_dp, & 0.26835843496713735_dp, -0.24909920725508472_dp] expected_res_y = [-0.843091071_sp, -0.612318873_sp, -0.306224436_sp, & 0.843091071_sp, 0.612318873_sp, 0.306224436_sp, 0.652878463_sp, & 7.81249031E-02_sp, 0.268358380_sp, -0.249099225_sp, & -0.953830540_sp, 0.652878463_sp, 7.81249031E-02_sp, 0.268358380_sp, -0.249099225_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, asin(res_x(i)) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, asin(res_y(i)) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, asin(a) if (abs(asin(a)) - 0.54429853389646843_dp > 1e-12) error stop print *, asin(0.5178181202_dp) if (abs(asin(0.5178181202_dp) - 0.54429853389646843_dp) > 1e-12) error stop print *, asin(b) if (asin(b) - (-7.28804991E-02_sp) > 1e-5) error stop print *, asin(-0.072816_sp) if (asin(-0.072816_sp) - (-7.28804991E-02_sp) > 1e-5) error stop print *, asin(c) if (asin(c) - (-5.44298533896468428e-01_dp) > 1e-12) error stop print *, asin(-0.5178181202_dp) if (asin(-0.5178181202_dp) - (-5.44298533896468428e-01_dp) > 1e-12) error stop print *, asin(d) if (asin(d) - (7.28804991E-02_sp) > 1e-5) error stop print *, asin(0.072816_sp) if (asin(0.072816_sp) - (7.28804991E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, asin(a) if (abs(asin(a) - (-0.27539522579314013_dp)) > 1e-12) error stop print *, asin(-0.271927291_dp) if (abs(asin(-0.271927291_dp) - (-0.27539522579314013_dp)) > 1e-12) error stop print *, asin(b) if (asin(b) - (-0.692252517_sp) > 1e-5) error stop print *, asin(-0.6382728_sp) if (asin(-0.6382728_sp) - (-0.692252517_sp) > 1e-5) error stop print *, asin(c) if (asin(c) - (0.27539522579314013_dp) > 1e-12) error stop print *, asin(0.271927291_dp) if (asin(0.271927291_dp) - (0.27539522579314013_dp) > 1e-12) error stop print *, asin(d) if (asin(d) - (0.692252517_sp) > 1e-5) error stop print *, asin(0.6382728_sp) if (asin(0.6382728_sp) - (0.692252517_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/struct_type_06.f900000664000175000017500000000103115141516316024605 0ustar alastairalastairmodule stdlib_string_type_struct_type_06 contains elemental subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy associate(dummy => dummy); end associate end subroutine unused_dummy_argument end module stdlib_string_type_struct_type_06 program struct_type_06 use stdlib_string_type_struct_type_06 implicit none call unused_dummy_argument(42) call unused_dummy_argument("Hello, World!") call unused_dummy_argument([1, 2, 3, 4, 5]) print *, "Program end!" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_219.f900000664000175000017500000000023715141516316024502 0ustar alastairalastairprogram intrinsics_219 integer :: x = sum([1, 2, 3]) integer, parameter :: y = sum([1, 2, 3]) if (x /= 6) error stop if (y /= 6) error stop endlfortran-lfortran-2f73434/integration_tests/character_parameter_padding_trimming.f900000664000175000017500000000343715141516316031317 0ustar alastairalastair!> These tests make sure that for constant(i.e. parameter) character string (or array) !> * padding (when LHS length is higher) !> * trimming (when LHS length is lower) program character_parameter_padding_trimming !> initializate variables to test correct padding of ' ' to the end of character string character(len=8), parameter :: x_pad = "apple" !> char length on right is 5 character(len=10), parameter :: y_pad = "Ball" !> char length on right is 4 character(len=30), parameter :: z_pad = x_pad // y_pad // x_pad !> char length on right is 26 character(len=32), parameter :: input = "reversed" !> char length on right is 8 character(len=4), parameter :: p_pad(3) = "2" !> char length on right is 1 !> initializate variables to test correct trimming of ' ' to the end of character string character(len=2), parameter :: x_trim = "apple" !> char length on right is 5 character(len=3), parameter :: y_trim = "Ball" !> char length on right is 4 character(len=5), parameter :: z_trim = x_trim // y_trim // x_trim !> char length on right is 26 character(len=2), parameter :: input_trim = "reversed" !> char length on right is 8 character(len=1), parameter :: p_trim(3) = "25" !> char length on right is 2 !> tests to assert padding is done correctly if (len(x_pad) /= 8) error stop if (len(y_pad) /= 10) error stop if (len(z_pad) /= 30) error stop if (len(p_pad(1)) /= 4) error stop if (len(p_pad(2)) /= 4) error stop if (len(p_pad(3)) /= 4) error stop !> tests to assert trimming is done correctly if (len(x_trim) /= 2) error stop if (len(y_trim) /= 3) error stop if (len(z_trim) /= 5) error stop if (len(p_trim(1)) /= 1) error stop if (len(p_trim(2)) /= 1) error stop if (len(p_trim(3)) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_10.f900000664000175000017500000000057615141516316023700 0ustar alastairalastairmodule modules_10_b implicit none private public b contains integer function b() b = 5 end function end module module modules_10_a use modules_10_b, only: b implicit none private public a contains integer function a() a = 3 + b() end function end module program modules_10 use modules_10_a, only: a implicit none if (a() /= 8) error stop print *, "OK" end lfortran-lfortran-2f73434/integration_tests/separate_compilation_16a.f900000664000175000017500000000037715141516316026600 0ustar alastairalastairmodule mod_separate_compilation_16 implicit none interface module subroutine map_open_entry(key) integer, intent(inout) :: key end subroutine map_open_entry end interface end module mod_separate_compilation_16lfortran-lfortran-2f73434/integration_tests/openmp_64.f900000664000175000017500000000501615141516316023531 0ustar alastairalastairprogram openmp_64 use omp_lib implicit none integer, parameter :: n = 100 integer :: i, tid, j real :: delay integer :: thread_iterations(0:7) = 0 integer :: iteration_order(n) integer :: order_counter integer :: consecutive_count, max_consecutive real :: work_array(n) call omp_set_num_threads(4) order_counter = 0 print *, "=== DYNAMIC Schedule Test ===" ! Dynamic schedule should NOT give contiguous blocks to threads !$omp parallel do schedule(dynamic, 1) private(tid, delay) do i = 1, n tid = omp_get_thread_num() ! Simulate varying work to see dynamic behavior if (mod(i, 10) == 0) then ! Some iterations take longer delay = 0.0 do j = 1, 1000 delay = delay + sin(real(j)) end do work_array(i) = delay end if !$omp critical thread_iterations(tid) = thread_iterations(tid) + 1 order_counter = order_counter + 1 iteration_order(order_counter) = tid !$omp end critical end do !$omp end parallel do ! Analyze dynamic behavior print *, "Thread iteration counts:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_iterations(i), "iterations" end do ! Check that work is not always in large contiguous blocks ! Dynamic with chunk=1 should interleave frequently max_consecutive = 0 consecutive_count = 1 do i = 2, n if (iteration_order(i) == iteration_order(i-1)) then consecutive_count = consecutive_count + 1 else if (consecutive_count > max_consecutive) then max_consecutive = consecutive_count end if consecutive_count = 1 end if end do print *, "Maximum consecutive iterations by same thread:", max_consecutive ! With dynamic(1), we shouldn't see very large consecutive blocks if (max_consecutive > 10) then print *, "WARNING: Dynamic schedule showing large consecutive blocks" print *, "This might indicate dynamic scheduling is not working properly" end if ! Check work distribution variation ! Dynamic should show more variation than static if (maxval(thread_iterations(0:3)) - minval(thread_iterations(0:3)) < 2) then print *, "WARNING: Work distribution too uniform for dynamic schedule" end if print *, "DYNAMIC schedule test completed" end program openmp_64lfortran-lfortran-2f73434/integration_tests/implicit_interface_24.f900000664000175000017500000000274015141516316026062 0ustar alastairalastair! Test that call argument alloca reuse works correctly ! This test verifies that expression arguments to implicit interface calls ! are handled correctly when allocas are reused across multiple calls program implicit_interface_24 implicit none integer :: result, x, y x = 10 y = 20 result = 0 ! Test 1: Multiple calls with expression arguments of same type ! The allocas for x+1, x+2, x+3 should be reused call ext_sub1(x + 1, result) if (result /= 11) error stop "Test 1a failed" call ext_sub1(x + 2, result) if (result /= 12) error stop "Test 1b failed" call ext_sub1(x + 3, result) if (result /= 13) error stop "Test 1c failed" ! Test 2: Call with multiple expression arguments ! Should use separate allocas within the same call, but reuse across calls call ext_sub2(x + 1, y + 1, result) if (result /= 32) error stop "Test 2a failed" call ext_sub2(x + 2, y + 2, result) if (result /= 34) error stop "Test 2b failed" ! Test 3: Mix of variable and expression arguments call ext_sub2(x, y + 5, result) if (result /= 35) error stop "Test 3a failed" call ext_sub2(x + 5, y, result) if (result /= 35) error stop "Test 3b failed" print *, "All tests passed" end program subroutine ext_sub1(a, r) integer, intent(in) :: a integer, intent(out) :: r r = a end subroutine subroutine ext_sub2(a, b, r) integer, intent(in) :: a, b integer, intent(out) :: r r = a + b end subroutine lfortran-lfortran-2f73434/integration_tests/elemental_01.f900000664000175000017500000000102015141516316024157 0ustar alastairalastairprogram elemental_01 real :: x(4) print *, arg([(0.0, 1.0), (1.0, 0.0), (0.0, -1.0), (-1.0, 0.0)]) x = arg([(0.0, 1.0), (1.0, 0.0), (0.0, -1.0), (-1.0, 0.0)]) if (abs(x(1) - 1.57079637) > 1e-6) error stop if (abs(x(2) - 0.0) > 1e-6) error stop if (abs(x(3) + 1.57079637) > 1e-6) error stop if (abs(x(4) - 3.14159274) > 1e-6) error stop contains elemental function arg(z) result(result) complex, intent(in) :: z real :: result result = atan2(aimag(z), real(z)) end function arg end program elemental_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_57.f900000664000175000017500000000221015141516316024413 0ustar alastairalastairprogram intrinsics_57 implicit none character(len=:), allocatable :: shorts(:) character(len=:), allocatable :: long integer :: a(10), i, res(10) logical :: m do i = 1, 10 a(i) = i end do allocate(character(len=6) :: shorts(10)) allocate(character(len=5) :: long) shorts(1:10:2) = "shorts" shorts(2:10:2) = "long" long = "long" print *, shorts print *, long print *, merge(1, a, shorts == long) res = merge(2, a, shorts == long) m = .false. do i = 1, 10 if( m ) then if( res(i) /= 2 ) error stop else if( res(i) /= a(i) ) error stop end if m = .not. m end do print *, merge(a, 0, shorts == long) res = merge(a, 3, shorts == long) m = .true. do i = 1, 10 if( m ) then if( res(i) /= 3 ) error stop else if( res(i) /= a(i) ) error stop end if m = .not. m end do print *, merge(1, 0, shorts == long) res = merge(1, 0, shorts == long) m = .false. do i = 1, 10 if( m ) then if( res(i) /= 1 ) error stop else if( res(i) /= 0 ) error stop end if m = .not. m end do print*, merge("ab", "ok", .true.) if (merge("ab", "ok", .true.) /= "ab") error stop end program lfortran-lfortran-2f73434/integration_tests/test_ieee_is_finite.f900000664000175000017500000000510015141516316025713 0ustar alastairalastair! Test ieee_is_finite function program test_ieee_is_finite use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, inf_sp, nan_sp, tmp_sp real(real64) :: x_dp logical :: result print *, "Testing ieee_is_finite..." tmp_sp = 1.0_real32 ! Test 1: Normal finite value x_sp = 1.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(1.0) = ", result if (.not. result) error stop "1.0 should be finite" ! Test 2: Negative finite value x_sp = -100.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(-100.0) = ", result if (.not. result) error stop "-100.0 should be finite" ! Test 3: Zero (finite) x_sp = 0.0_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(0.0) = ", result if (.not. result) error stop "0.0 should be finite" ! Test 4: Large but finite value x_sp = huge(tmp_sp) * 0.5_real32 result = ieee_is_finite(x_sp) print *, "ieee_is_finite(large) = ", result if (.not. result) error stop "Large value should be finite" ! Test 5: Tiny but finite value x_sp = tiny(tmp_sp) result = ieee_is_finite(x_sp) print *, "ieee_is_finite(tiny) = ", result if (.not. result) error stop "Tiny value should be finite" ! Test 6: Positive infinity (not finite) inf_sp = ieee_value(tmp_sp, ieee_positive_inf) result = ieee_is_finite(inf_sp) print *, "ieee_is_finite(+inf) = ", result if (result) error stop "+inf should not be finite" ! Test 7: Negative infinity (not finite) inf_sp = ieee_value(tmp_sp, ieee_negative_inf) result = ieee_is_finite(inf_sp) print *, "ieee_is_finite(-inf) = ", result if (result) error stop "-inf should not be finite" ! Test 8: NaN (not finite) nan_sp = ieee_value(tmp_sp, ieee_quiet_nan) result = ieee_is_finite(nan_sp) print *, "ieee_is_finite(NaN) = ", result if (result) error stop "NaN should not be finite" ! Test 9: Double precision finite x_dp = 3.14159_real64 result = ieee_is_finite(x_dp) print *, "ieee_is_finite(3.14159d0) = ", result if (.not. result) error stop "3.14159d0 should be finite" ! Test 10: Denormal (finite) x_sp = ieee_value(tmp_sp, ieee_positive_denormal) result = ieee_is_finite(x_sp) print *, "ieee_is_finite(denormal) = ", result if (.not. result) error stop "Denormal should be finite" print *, "All ieee_is_finite tests passed!" end program test_ieee_is_finite lfortran-lfortran-2f73434/integration_tests/pointer_01.f900000664000175000017500000000357515141516316023712 0ustar alastairalastairprogram pointer_01 implicit none integer, dimension(:), pointer :: int_ptr logical, dimension(:), pointer :: logical_ptr real, dimension(:, :), pointer :: real_ptr integer :: i nullify(int_ptr) print *, associated(int_ptr) if (associated(int_ptr) .neqv. .false.) error stop allocate(int_ptr(3)) int_ptr = [1, 2, 3] print *, int_ptr print *, associated(int_ptr) if (associated(int_ptr) .neqv. .true.) error stop if (product(int_ptr) == 6) then nullify(int_ptr) allocate(int_ptr(5)) int_ptr = (/ (i, i=1, 5)/) print *, int_ptr if (size(int_ptr) /= 5) error stop end if nullify(logical_ptr) print *, associated(logical_ptr) if (associated(logical_ptr) .neqv. .false.) error stop allocate(logical_ptr(5)) logical_ptr = [.true., .false., .true., .false., .false.] print *, logical_ptr print *, associated(logical_ptr) if (associated(logical_ptr) .neqv. .true.) error stop if (size(logical_ptr) == 5) then nullify(logical_ptr) allocate(logical_ptr(2)) logical_ptr = .true. print *, logical_ptr if (all(logical_ptr .neqv. [.true., .true.])) error stop end if nullify(real_ptr) print *, associated(real_ptr) if (associated(real_ptr) .neqv. .false.) error stop allocate(real_ptr(2, 2)) real_ptr = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) print *, real_ptr print *, associated(real_ptr) if (associated(real_ptr) .neqv. .true.) error stop if (sum(real_ptr) /= 11.0) then nullify(real_ptr) end if ! Uncomment after fixing #4506 ! call sub ! contains ! subroutine sub ! nullify(int_ptr) ! print *, associated(int_ptr) ! allocate(int_ptr(2)) ! int_ptr = [1, 2] ! print *, int_ptr ! print *, associated(int_ptr) ! end subroutine sub end program pointer_01 lfortran-lfortran-2f73434/integration_tests/include_03/0000775000175000017500000000000015141516316023325 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/include_03/i.inc0000664000175000017500000000003415141516316024245 0ustar alastairalastairinteger, parameter :: i = 4 lfortran-lfortran-2f73434/integration_tests/elemental_08.f900000664000175000017500000000074315141516316024201 0ustar alastairalastairprogram elemental_08 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(5:15) end type type(vector) :: a, b, c do i = 5, 15 a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 5, 15 if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-lfortran-2f73434/integration_tests/subroutines_18.f900000664000175000017500000000046215141516316024614 0ustar alastairalastairprogram subroutines_18 procedure(OBJ), pointer :: proc_ptr call sub(proc_ptr) contains subroutine OBJ() print *, "hello" end subroutine subroutine sub(calfun) procedure(OBJ), pointer , intent(inout) :: calfun calfun => OBJ call calfun end subroutine end programlfortran-lfortran-2f73434/integration_tests/bindc6.f900000664000175000017500000000102615141516316023064 0ustar alastairalastairprogram bindc6 use iso_c_binding, only: c_double implicit none real(c_double) :: arr(3) real(c_double) :: result interface function sum_arr(a, n) bind(c) import :: c_double real(c_double), intent(in) :: a(*) integer, value :: n real(c_double) :: sum_arr end function end interface arr = [1.0d0, 2.0d0, 3.0d0] result = sum_arr(arr, 3) if (abs(result - 6.0d0) > 1.0d-10) error stop "sum should be 6.0" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/nested_14.f900000664000175000017500000000113415141516316023505 0ustar alastairalastairmodule nested_14_mod contains subroutine temp() integer :: col_width character(len=5) :: x(2) col_width = 5 call temp_nested(x) if (x(1) /= "hello" .or. x(2) /= "world") error stop contains subroutine temp_nested(basename) character(len=*), intent(inout) :: basename(:) character(len=col_width) :: tmp(2) tmp(1) = "hello" tmp(2) = "world" basename = tmp end subroutine end subroutine end module program nested_14 use nested_14_mod call temp() end program nested_14lfortran-lfortran-2f73434/integration_tests/operator_overloading_07.f900000664000175000017500000000267015141516316026457 0ustar alastairalastair! Overloading the assignment operator `=` with a function call that would be handled by ! `subroutine_from_function` pass. So we need to make sure that the pass ! actually replaces the function call in the overloaded expression. module operator_overloading_07_mod1 implicit none interface assignment(=) module procedure :: assign_string_char end interface assignment(=) type string_type character(:), allocatable :: raw end type contains subroutine assign_string_char(lhs, rhs) type(string_type), intent(inout) :: lhs character(len=*), intent(in) :: rhs lhs%raw = rhs end subroutine assign_string_char end module operator_overloading_07_mod1 module operator_overloading_07_mod2 use operator_overloading_07_mod1 implicit none type(string_type) :: instance contains function func() result(ret_arr) character(:), allocatable :: ret_arr allocate(character(15) :: ret_arr) ret_arr = "Hello World!" end function subroutine ff() character(:), allocatable :: inp instance = func() ! pass `subroutine_from_function` takes action here. It must handle the overloading of `=`. print *, instance%raw if(instance%raw /= "Hello World!") error stop end subroutine ff end module program operator_overloading_07 use operator_overloading_07_mod2, only : ff implicit none call ff() end program lfortran-lfortran-2f73434/integration_tests/struct_type_07.f900000664000175000017500000000102715141516316024613 0ustar alastairalastairmodule struct_type_07_m implicit none type :: t real :: a end type t contains function f() result(res) type(t) :: res(2,2) res%a = reshape([1.0,2.0,3.0,4.0],[2,2]) end function f end module struct_type_07_m program struct_type_07 use struct_type_07_m implicit none type(t) :: result(2,2) result = f() if (result(1,1)%a /= 1.0) stop 1 if (result(2,1)%a /= 2.0) stop 2 if (result(1,2)%a /= 3.0) stop 3 if (result(2,2)%a /= 4.0) stop 4 print *, "Test passed!" end program struct_type_07 lfortran-lfortran-2f73434/integration_tests/simd_01.f900000664000175000017500000000017715141516316023161 0ustar alastairalastairprogram simd_01 !LF$ attributes simd :: A, B, C real :: A(8), B(8), C(8) A = 1 B = 2 C = A + B end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_03.f900000664000175000017500000000103315141516316026051 0ustar alastairalastairprogram main integer :: b(3) = [10, 20, 30] integer :: n = 3 call driver(implicit_interface_check, b, n) contains subroutine driver(fnc, arr, m) integer, intent(in) :: m, arr(m) ! This fixes the array length issue (BindC changes) print *, abs(-1.0) ! This loads the runtime library call fnc(arr, m) end subroutine subroutine implicit_interface_check(arr1, m) integer, intent(in) :: m, arr1(m) if (m /= 3) error stop if (arr1(1) /= 10) error stop if (arr1(2) /= 20) error stop if (arr1(3) /= 30) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_44.f900000664000175000017500000000104715141516316024416 0ustar alastairalastairprogram intrinsics_44 implicit none integer, dimension(5):: a = [1, 2, 3, 4, 5] integer, dimension(3,3) :: b = reshape( [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 3, 3 ]) print '(5i3)', a a = cshift(a, shift = 2) print '(5i3)', a a = cshift(a, shift = 1) print '(5i3)', a if(any(a /= [ 4, 5, 1, 2, 3 ])) error stop print * b = cshift(b, shift = 2, dim = 2) print '(3i3)', b(1,:) print '(3i3)', b(2,:) print '(3i3)', b(3,:) if(any(b /= reshape( [ 7, 8, 9, 1, 2, 3, 4, 5, 6 ], [ 3, 3 ]))) error stop end program lfortran-lfortran-2f73434/integration_tests/interop/0000775000175000017500000000000015141516316023060 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/interop/mod2.sh0000775000175000017500000000037315141516316024263 0ustar alastairalastair#!/usr/bin/env bash set -ex FC=gfortran #FC=ifort $FC -o mod2.o -c mod2.f90 $FC -o test_mod2.o -c test_mod2.f90 $FC -o gfort_interop.o -c gfort_interop.f90 $FC -o test_mod2 test_mod2.o mod2.o gfort_interop.o -L. -lmod1 -Wl,-rpath -Wl,. ./test_mod2 lfortran-lfortran-2f73434/integration_tests/interop/test_mod2.f900000664000175000017500000000101415141516316025274 0ustar alastairalastairprogram test_mod2 use mod2, only: f1, f2, f3, f4, f2b, f3b implicit none integer :: x call assert(f1(1, 2) == 3) call assert(f2(3, [1, 2, 3]) == 6) call assert(f2b([1, 2, 3]) == 6) call assert(f3(2, 3, reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) x = 0 call assert(f4(1, x) == 0) call assert(x == 1) contains subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-lfortran-2f73434/integration_tests/interop/cxxwrap.py0000664000175000017500000000411315141516316025125 0ustar alastairalastair""" Install Python wrappers to Clang: conda install -c conda-forge python-clang """ from clang.cindex import Index, CursorKind, TypeKind import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) index = Index.create() tu = index.parse("a.h") def process(node): unit = make_translation_unit() module = translation_unit_make_module(unit, "cxx_wrapper") for child in node.get_children(): if child.kind == CursorKind.FUNCTION_DECL: process_function(module.symtab, child) else: print(child.kind.name, child.spelling, child.location) #import IPython; IPython.embed() verify_asr(unit) return unit def process_type(t): if t.kind == TypeKind.FUNCTIONPROTO: result = process_type(t.get_result()) args = [] for arg in t.argument_types(): args.append(process_type(arg)) return "result(%s), args(%s)" % (result, ", ".join(args)) elif t.kind == TypeKind.POINTER: pointee = process_type(t.get_pointee()) return "pointer(%s)" % pointee elif t.kind == TypeKind.INT: return "int" else: print(t.spelling) raise Exception("Type not supported") def process_function(scope, node): types = process_type(node.type) arg_names = [] for arg in node.get_arguments(): arg_names.append(arg.spelling) type = make_type_integer() return_var = asr.VariableOld(name=node.spelling, type=type) f = scope_add_function(scope, node.spelling, args=arg_names, return_var=return_var) for a in f.args: a.intent = "in" f.bind = asr.Bind(lang="c", name=node.spelling) u = process(tu.cursor) a = asr_to_ast(u) s = ast_to_src(a) print(s) lfortran-lfortran-2f73434/integration_tests/interop/mod2.h0000664000175000017500000000064315141516316024075 0ustar alastairalastair#ifndef MOD2_H #define MOD2_H extern "C" { int32_t __mod1_MOD_f1(int32_t *a, int32_t *b); int32_t __mod1_MOD_f2(int32_t *n, int32_t *a); int32_t __mod1_MOD_f2b(descriptor<1, int32_t> *a); int32_t __mod1_MOD_f3(int32_t *n, int32_t *m, int32_t *a); int32_t __mod1_MOD_f3b(descriptor<2, int32_t> *a); int32_t __mod1_MOD_f4(int32_t *a, int32_t *b); int32_t __mod1_MOD_f5b(descriptor<2, int32_t> *a); } #endif // MOD2_H lfortran-lfortran-2f73434/integration_tests/interop/a.h0000664000175000017500000000011515141516316023446 0ustar alastairalastair#ifndef A_H #define A_H int f1(int a, int b); int f2(int x, int y); #endif lfortran-lfortran-2f73434/integration_tests/interop/test_fortran.f900000664000175000017500000000224215141516316026112 0ustar alastairalastairprogram test_fortran implicit none integer :: a(3) a = [1, 2, 3] call assert(f2b(a) == 6) call assert(f2b([1, 2, 3, 4, 5, 6]) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) contains integer function f2b(a) result(r) use gfort_interop, only: c_desc integer, intent(in) :: a(:) interface integer(c_int) function f2b_c_wrapper(a) bind(c, name="__mod1_MOD_f2b") use iso_c_binding, only: c_int use gfort_interop, only: c_desc1_t type(c_desc1_t), intent(in) :: a end function end interface r = f2b_c_wrapper(c_desc(a)) end function integer function f3b(a) result(r) use gfort_interop, only: c_desc integer, intent(in) :: a(:,:) interface integer(c_int) function f3b_c_wrapper(a) bind(c, name="__mod1_MOD_f3b") use iso_c_binding, only: c_int use gfort_interop, only: c_desc2_t type(c_desc2_t), intent(in) :: a end function end interface r = f3b_c_wrapper(c_desc(a)) end function subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-lfortran-2f73434/integration_tests/interop/test_cpp.cpp0000664000175000017500000000500715141516316025407 0ustar alastairalastair// ptrdiff_t, size_t #include // int32_t #include #include #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include struct descriptor_dimension { ptrdiff_t stride; ptrdiff_t lower_bound; ptrdiff_t upper_bound; }; template struct descriptor { Type *base_addr; size_t offset; ptrdiff_t dtype; descriptor_dimension dim[Rank]; }; template descriptor c_desc(Type *array_ptr, const std::vector> &dims) { descriptor a; a.base_addr = array_ptr; a.offset = 0; for (int n=0; n < Rank; n++) { a.dim[n].lower_bound = dims[n].first; a.dim[n].upper_bound = dims[n].second; if (n == 0) { a.dim[n].stride = 1; } else { a.dim[n].stride = (a.dim[n-1].upper_bound - a.dim[n-1].lower_bound + 1) * a.dim[n-1].stride; } a.offset = a.offset - a.dim[n].lower_bound * a.dim[n].stride; } a.dtype = Rank; // 1 is INTEGER element type a.dtype |= (1 << 3); // sizeof(Type) is the size of INTEGER a.dtype |= (sizeof(Type) << 6); return a; } #include "mod2.h" TEST_CASE("f1") { int a = 1; int b = 2; CHECK(__mod1_MOD_f1(&a, &b) == 3); } TEST_CASE("f2") { int n = 3; std::vector data(3); data[0] = 1; data[1] = 2; data[2] = 3; CHECK(__mod1_MOD_f2(&n, &data[0]) == 6); } TEST_CASE("f2b") { std::vector data(3); data[0] = 1; data[1] = 2; data[2] = 3; descriptor<1, int32_t> a = c_desc<1, int32_t>(&data[0], {{1, 3}}); CHECK(__mod1_MOD_f2b(&a) == 6); } TEST_CASE("f3") { std::vector data(6); data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; int n = 2; int m = 3; CHECK(__mod1_MOD_f3(&n, &m, &data[0]) == 21); } TEST_CASE("f3b") { std::vector data = {1, 2, 3, 4, 5, 6}; descriptor<2, int32_t> a = c_desc<2, int32_t>(&data[0], {{1, 2}, {1, 3}}); CHECK(__mod1_MOD_f3b(&a) == 21); } TEST_CASE("f4") { int a = 1; int b = 0; CHECK(__mod1_MOD_f4(&a, &b) == 0); CHECK(b == 1); } TEST_CASE("f5b") { std::vector data(6); data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; descriptor<2, int32_t> a = c_desc<2, int32_t>(&data[0], {{1, 2}, {1, 3}}); CHECK(__mod1_MOD_f5b(&a) == 9); } lfortran-lfortran-2f73434/integration_tests/interop/test_mod1.f900000664000175000017500000000101415141516316025273 0ustar alastairalastairprogram test_mod1 use mod1, only: f1, f2, f3, f4, f2b, f3b implicit none integer :: x call assert(f1(1, 2) == 3) call assert(f2(3, [1, 2, 3]) == 6) call assert(f2b([1, 2, 3]) == 6) call assert(f3(2, 3, reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) call assert(f3b(reshape([1, 2, 3, 4, 5, 6], [2,3])) == 21) x = 0 call assert(f4(1, x) == 0) call assert(x == 1) contains subroutine assert(condition) logical, intent(in) :: condition if (.not. condition) error stop "Assert failed." end subroutine end program lfortran-lfortran-2f73434/integration_tests/interop/wrap2.py0000664000175000017500000001455615141516316024500 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `lfortran.adapters.gfortran.mod` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.adapters.gfortran.mod import mod_to_asr from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) class NodeTransformer(asr.NodeTransformerBase): def visit_scope(self, symtab, parent=None): new_symtab = Scope(parent) self._lookup = 2 self._scope = new_symtab for s, sym in symtab.symbols.items(): new_symtab.symbols[s] = self.visit(sym) self._lookup = 0 return new_symtab def visit_sequence(self, seq): r = [] if seq is not None: for node in seq: r.append(self.visit(node)) return r def visit_object(self, o): if isinstance(o, Scope): return self.visit_scope(o) elif isinstance(o, list): return self.visit_sequence(o) elif isinstance(o, (str, int)) or o is None: return o else: print(type(o)) raise NotImplementedError() def visit_Function(self, node): name = self.visit_object(node.name) symtab = self.visit_object(node.symtab) self._lookup = 1 self._scope = symtab args = self.visit_sequence(node.args) body = self.visit_sequence(node.body) return_var = self.visit(node.return_var) self._lookup = 0 if node.bind: bind = self.visit(node.bind) else: bind = None return asr.Function(name=name, args=args, body=body, bind=bind, return_var=return_var, symtab=symtab) def visit_VariableOld(self, node): if self._lookup == 1: return self._scope.resolve(node.name) elif self._lookup == 2: v = self._scope.resolve(node.name, raise_exception=False) if v: return v name = self.visit_object(node.name) intent = self.visit_object(node.intent) dummy = self.visit_object(node.dummy) type = self.visit(node.type) return asr.VariableOld(name=name, intent=intent, dummy=dummy, type=type) class WrapperVisitor(NodeTransformer): def visit_Module(self, node): name = "mod2" #node.name + "_wrapper" self._modname = node.name symtab = self.visit_scope(node.symtab) return asr.Module(name=name, symtab=symtab) def visit_Function(self, node): name = self.visit_object(node.name) symtab = self.visit_object(node.symtab) self._lookup = 1 self._scope = symtab args = self.visit_sequence(node.args) body = self.visit_sequence(node.body) self._lookup = 0 if node.bind: bind = self.visit(node.bind) else: bind = None tmp = asr.VariableOld(name="a", type=make_type_integer()) f = asr.Function(name=name, args=args, body=body, bind=bind, symtab=symtab, return_var=tmp) return_var = function_make_var(f, name="r", type=self.visit(node.return_var.type)) return_var.dummy = True f.return_var = return_var cname = node.name + "_c_wrapper" mangled_name = '__' + self._modname + '_MOD_' + node.name.lower() bind = asr.Bind(lang="c", name=mangled_name) cargs = [] args2 = [] type1 = make_type_integer() type1.dims = [asr.dimension(asr.Num(n=1, type=make_type_integer()))] type2 = make_type_integer() type2.dims = [ asr.dimension(asr.Num(n=1, type=make_type_integer())), asr.dimension(asr.Num(n=1, type=make_type_integer())) ] c_desc1 = scope_add_function( symtab, "c_desc1_int32", args=[ asr.VariableOld( name="A", intent="in", type=type1 ) ], return_var=asr.VariableOld( name="c_desc1_int32", type=asr.Derived(name="c_desc1_t") ), module = "gfort_interop" ) c_desc2 = scope_add_function( symtab, "c_desc2_int32", args=[ asr.VariableOld( name="A", intent="in", type=type2 ) ], return_var=asr.VariableOld( name="c_desc2_int32", type=asr.Derived(name="c_desc2_t") ), module = "gfort_interop" ) for arg in node.args: type = self.visit(arg.type) if array_is_assumed_shape(type): if len(type.dims) == 1: dname = "c_desc1_t" fname = c_desc1 elif len(type.dims) == 2: dname = "c_desc2_t" fname = c_desc2 else: raise NotImplementedError("Too many dimensions") type = asr.Derived(name=dname, module="gfort_interop") args2.append(asr.FuncCall(func=fname, args=[arg], keywords=[], type=type)) else: args2.append(arg) cargs.append(asr.VariableOld( name=arg.name, intent=arg.intent, type=type, )) fw = scope_add_function(symtab, cname, args=cargs, return_var=cname) fw.bind = bind body = [ asr.Assignment(return_var, asr.FuncCall(func=fw, args=args2, keywords=[], type=fw.return_var.type) ) ] f.body = body return f def create_wrapper(u): v = WrapperVisitor() u2 = v.visit(u) verify_asr(u2) return u2 u = mod_to_asr("mod1.mod") a = asr_to_ast(u) s = ast_to_src(a) #print(s) u2 = create_wrapper(u) a = asr_to_ast(u2) s = ast_to_src(a) #print("-"*80) print(s) lfortran-lfortran-2f73434/integration_tests/interop/mod1.f900000664000175000017500000000143615141516316024244 0ustar alastairalastairmodule mod1 implicit none private public f1, f2, f3, f4, f2b, f3b, f5b contains integer function f1(a, b) result(r) integer, intent(in) :: a, b r = a + b end function integer function f2(n, a) result(r) integer, intent(in) :: n, a(n) r = sum(a) end function integer function f3(n, m, a) result(r) integer, intent(in) :: n, m, a(n,m) r = sum(a) end function integer function f2b(a) result(r) integer, intent(in) :: a(:) r = sum(a) end function integer function f3b(a) result(r) integer, intent(in) :: a(:,:) r = sum(a) end function integer function f4(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a f4 = 0 end function integer function f5b(a) result(r) integer, intent(in) :: a(:,:) integer :: i r = 0 do i = 1, size(a, 2) r = r + a(1, i) end do end function end module lfortran-lfortran-2f73434/integration_tests/interop/run.sh0000775000175000017500000000067015141516316024226 0ustar alastairalastair#!/usr/bin/env bash set -ex FFLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace" cmake \ -DBUILD_SHARED_LIBS=yes \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_Fortran_FLAGS_DEBUG="$FFLAGS_DEBUG" \ . make ctest python wrap.py > mod2.f90 ./mod2.sh python wrap2.py > mod2.f90 ./mod2.sh python wrap_cpp.py > mod2.h make python cxxwrap.py > cxx_wrapper.f90 gfortran -c cxx_wrapper.f90 -o cxx_wrapper.o lfortran-lfortran-2f73434/integration_tests/interop/CMakeLists.txt0000664000175000017500000000246515141516316025627 0ustar alastairalastaircmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(interop C CXX Fortran) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (Debug, Release)" FORCE) endif () enable_testing() add_library(mod1 mod1.f90) add_executable(test_mod1 test_mod1.f90) target_link_libraries(test_mod1 mod1) add_test(test_mod1 ${CURRENT_BINARY_DIR}/test_mod1) add_executable(test_cpp test_cpp.cpp) target_link_libraries(test_cpp mod1) target_include_directories(test_cpp BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src) add_test(test_cpp ${CURRENT_BINARY_DIR}/test_cpp) add_executable(test_fortran test_fortran.f90 gfort_interop.f90) target_link_libraries(test_fortran mod1) add_test(test_fortran ${CURRENT_BINARY_DIR}/test_fortran) message("\n") message("Configuration results") message("---------------------") message("Fortran compiler: ${CMAKE_Fortran_COMPILER}") message("C++ compiler : ${CMAKE_CXX_COMPILER}") message("C compiler : ${CMAKE_C_COMPILER}") message("Build type: ${CMAKE_BUILD_TYPE}") string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) message("Fortran compiler flags: ${CMAKE_Fortran_FLAGS_${BTYPE}}") message("C++ compiler flags : ${CMAKE_CXX_FLAGS_${BTYPE}}") message("C compiler flags : ${CMAKE_C_FLAGS_${BTYPE}}") message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") lfortran-lfortran-2f73434/integration_tests/interop/wrap.py0000664000175000017500000002156515141516316024414 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `gfort_mod_parser.py` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.ast import ast from lfortran.ast.ast_to_src import ast_to_src import lfortran.adapters.gfortran.mod as gp class Type(object): pass class Intrinsic(Type): __slots__ = ["kind"] def __init__(self, kind=None): #super(Intrinsic, self).__init__() self.kind = kind class Integer(Intrinsic): def __str__(self): return "integer" class Real(Intrinsic): def __str__(self): return "real" class Complex(Intrinsic): def __repr__(self): return "Complex()" class String(Intrinsic): def __repr__(self): return "String()" class Logical(Intrinsic): def __repr__(self): return "Logical()" class Derived(Type): def __repr__(self): return "Derived()" class Array(Type): __slots__ = ["type", "ndim", "atype", "bounds"] class Arg: __slots__ = ["name", "intent", "type", "symtab", "symidx"] def get_decl(self): s = "%s, intent(%s) :: %s" % (self.type, self.intent, self.name) return s def tofortran_arg(self): return ast.arg(self.name) def tofortran_bound(self, b): if isinstance(b, gp.Integer): if b.i == 1: return "" else: return str(b.i) elif isinstance(b, gp.VarIdx): return self.symtab[b.idx].name print(b) raise NotImplementedError("Unsupported bound type") # TODO: generate ASR in these functions. The ASR will then get converted # to AST and to Fortran code. This will simplify all the declaration code # below, which is implicit in the ASR's symbol table. def tofortran_decl(self): attrs = [ ast.Attribute(name="intent", args=[ast.attribute_arg(arg=self.intent)]), ] if isinstance(self.type, Array): stype = str(self.type.type) args = [] for i in range(self.type.ndim): if self.type.atype == "explicit_shape": s = self.tofortran_bound(self.type.bounds[i][0]) if s != "": s += ":" s += self.tofortran_bound(self.type.bounds[i][1]) args.append(s) elif self.type.atype == "assumed_shape": s = self.tofortran_bound(self.type.bounds[i][0]) s += ":" args.append(s) else: assert False args = [ast.attribute_arg(arg=x) for x in args] attrs.append(ast.Attribute(name="dimension", args=args)) else: stype = str(self.type) decl = ast.decl(sym=self.name, sym_type=stype, dims=[], attrs=attrs) return ast.Declaration(vars=[decl], lineno=1, col_offset=1) def tofortran_cdecl(self): attrs = [ ast.Attribute(name="intent", args=[ast.attribute_arg(arg=self.intent)]), ] if isinstance(self.type, Array): args = [] if self.type.atype == "assumed_shape": if self.type.ndim == 1: stype = "type(c_desc1_t)" elif self.type.ndim == 2: stype = "type(c_desc2_t)" else: raise NotImplementedError("Assumed shape dim") else: stype = str(self.type.type) for i in range(self.type.ndim): if self.type.atype == "explicit_shape": s = self.tofortran_bound(self.type.bounds[i][0]) if s != "": s += ":" s += self.tofortran_bound(self.type.bounds[i][1]) args.append(s) else: assert False args = [ast.attribute_arg(arg=x) for x in args] attrs.append(ast.Attribute(name="dimension", args=args)) else: stype = str(self.type) decl = ast.decl(sym=self.name, sym_type=stype, dims=[], attrs=attrs) return ast.Declaration(vars=[decl], lineno=1, col_offset=1) class Function: __slots__ = ["name", "args", "return_type", "mangled_name"] def tofortran_impl(self): args = [x.tofortran_arg() for x in self.args] args_decl = [x.tofortran_decl() for x in self.args] iface_decl = [ ast.Interface2(name="x", procs=[self.tofortran_iface()], lineno=1, col_offset=1) ] return_var = ast.Name(id="r", lineno=1, col_offset=1) cname = self.name + "_c_wrapper" cargs = [] for x in self.args: a = ast.Name(id=x.name, lineno=1, col_offset=1) if isinstance(x.type, Array) and x.type.atype == "assumed_shape": cargs.append( ast.FuncCallOrArray( func="c_desc", args=[a], keywords=[], lineno=1, col_offset=1 ) ) else: cargs.append(a) body = [ ast.Assignment( target=return_var, value=ast.FuncCallOrArray( func=cname, args=cargs, keywords=[], lineno=1, col_offset=1 ), lineno=1, col_offset=1 ) ] return ast.Function(name=self.name, args=args, return_type=str(self.return_type), return_var=return_var, bind=None, use=[], decl=args_decl+iface_decl, body=body, contains=[], lineno=1, col_offset=1) def tofortran_iface(self): args = [x.tofortran_arg() for x in self.args] args_decl = [x.tofortran_cdecl() for x in self.args] use = [ ast.Use(module="gfort_interop", symbols=[ ast.UseSymbol(sym="c_desc1_t", rename=None), ast.UseSymbol(sym="c_desc2_t", rename=None), ], lineno=1, col_offset=1) ] cname = self.name + "_c_wrapper" bind_args = [ast.keyword(arg=None, value=ast.Name(id="c", lineno=1, col_offset=1)), ast.keyword(arg="name", value=ast.Str(s=self.mangled_name, lineno=1, col_offset=1))] bind = ast.Bind(args=bind_args) return ast.Function(name=cname, args=args, return_type=str(self.return_type), return_var=None, bind=bind, use=use, decl=args_decl, body=[], contains=[], lineno=1, col_offset=1) class Module: __slots__ = ["name", "contains"] def tofortran(self): contains = [x.tofortran_impl() for x in self.contains] use = [ ast.Use(module="gfort_interop", symbols=[ ast.UseSymbol(sym="c_desc", rename=None), ], lineno=1, col_offset=1) ] return ast.Module(name=self.name, use=use, decl=[], contains=contains) def convert_arg(table, idx): arg = table[idx] a = Arg() assert isinstance(arg.name, str) a.name = arg.name assert isinstance(arg.intent, str) a.intent = arg.intent assert isinstance(table, dict) a.symtab = table assert isinstance(idx, int) a.symidx = idx assert isinstance(arg.type, str) type_ = arg.type if arg.bounds: ar = Array() ar.type = type_ ar.ndim = len(arg.bounds) if arg.bounds[0][1] is None: ar.atype = "assumed_shape" else: ar.atype = "explicit_shape" ar.bounds = arg.bounds a.type = ar else: a.type = type_ return a def convert_function(table, f): assert isinstance(f, gp.Procedure) fn = Function() assert isinstance(f.name, str) fn.name = f.name assert isinstance(f.type, str) fn.return_type = f.type fn.mangled_name = '__' + f.mod + '_MOD_' + f.name.lower() args = [] for arg in f.args: assert isinstance(arg, gp.VarIdx) args.append(convert_arg(table, arg.idx)) fn.args = args return fn def convert_module(table, public_symbols): m = Module() contains = [] module_name = None for sym in public_symbols: s = table[sym.idx.idx] if isinstance(s, gp.Module): # Skip modules if they are listed in public symbols continue assert isinstance(s, gp.Procedure) if module_name: assert module_name == s.mod else: module_name = s.mod contains.append(convert_function(table, s)) m.name = module_name m.contains = contains return m version, orig_file, table, public_symbols = gp.load_module("mod1.mod") m = convert_module(table, public_symbols) a = m.tofortran() a.name = "mod2" s = ast_to_src(a) print(s) lfortran-lfortran-2f73434/integration_tests/interop/wrap_cpp.py0000664000175000017500000000641615141516316025254 0ustar alastairalastair""" # Design This file converts from a GFortran module file representation (documented in the `lfortran.adapters.gfortran.mod` module) to an Abstract Semantic Representation (ASR). """ # TODO: move this into the lfortran package itself import sys sys.path.append("../..") from lfortran.asr import asr from lfortran.asr.asr_check import verify_asr from lfortran.asr.asr_to_ast import asr_to_ast from lfortran.ast.ast_to_src import ast_to_src from lfortran.adapters.gfortran.mod import mod_to_asr from lfortran.asr.builder import (make_translation_unit, translation_unit_make_module, scope_add_function, make_type_integer, make_type_real, type_eq, make_binop, scope_add_symbol, Scope, function_make_var, array_is_assumed_shape) class WrapperVisitor(asr.ASTVisitor): def visit_TranslationUnit(self, node): out = "" for s in node.global_scope.symbols: sym = node.global_scope.symbols[s] out += self.visit(sym) return out def visit_Module(self, node): name = "mod2" out = """\ #ifndef MOD2_H #define MOD2_H extern "C" { """ out += self.visit_scope(node.symtab) out += """\ } #endif // MOD2_H """ return out def visit_scope(self, symtab, parent=None): out = "" for s, sym in symtab.symbols.items(): out += self.visit(sym) return out def visit_object(self, o): if isinstance(o, Scope): return self.visit_scope(o) elif isinstance(o, list): return self.visit_sequence(o) elif isinstance(o, (str, int)) or o is None: return o else: print(type(o)) raise NotImplementedError() def visit_Function(self, node): name = self.visit_object(node.name) args2 = [] for arg in node.args: #type = self.visit(arg.type) #if array_is_assumed_shape(type): # if len(type.dims) == 1: # dname = "c_desc1_t" # elif len(type.dims) == 2: # dname = "c_desc2_t" # else: # raise NotImplementedError("Too many dimensions") # args2.append(dname) #else: # args2.append(arg) n = len(arg.type.dims) if n == 0: args2.append("int32_t *%s" % arg.name) else: if array_is_assumed_shape(arg.type): args2.append("descriptor<%s, int32_t> *%s" % (n, arg.name)) else: args2.append("int32_t *%s" % arg.name) #symtab = self.visit_object(node.symtab) #self._lookup = 1 #self._scope = symtab #args = self.visit_sequence(node.args) #body = self.visit_sequence(node.body) #return_var = self.visit(node.return_var) #self._lookup = 0 #if node.bind: # bind = self.visit(node.bind) #else: # bind = None return "int32_t __mod1_MOD_%s(%s);\n" % (name, ", ".join(args2)) #return asr.Function(name=name, args=args, body=body, bind=bind, return_var=return_var, symtab=symtab) def create_wrapper(u): v = WrapperVisitor() u2 = v.visit(u) return u2 u = mod_to_asr("mod1.mod") u2 = create_wrapper(u) print(u2) lfortran-lfortran-2f73434/integration_tests/interop/gfort_interop.f900000664000175000017500000000464715141516316026274 0ustar alastairalastairmodule gfort_interop use iso_c_binding, only: c_int, c_loc, c_ptr, c_ptrdiff_t, c_size_t, c_int32_t implicit none type, bind(c) :: descriptor_dimension integer(c_ptrdiff_t) :: stride integer(c_ptrdiff_t) :: lower_bound integer(c_ptrdiff_t) :: upper_bound end type type, bind(c) :: c_desc1_t type(c_ptr) :: base_addr integer(c_size_t) :: offset integer(c_ptrdiff_t) :: dtype type(descriptor_dimension) :: dim(1) end type type, bind(c) :: c_desc2_t type(c_ptr) :: base_addr integer(c_size_t) :: offset integer(c_ptrdiff_t) :: dtype type(descriptor_dimension) :: dim(2) end type interface c_desc module procedure c_desc1_int32 module procedure c_desc2_int32 end interface integer, parameter :: INTEGER_ELEMENT_TYPE = 1 integer, parameter :: LOGICAL_ELEMENT_TYPE = 2 integer, parameter :: REAL_ELEMENT_TYPE = 3 integer, parameter :: COMPLEX_ELEMENT_TYPE = 4 integer, parameter :: DERIVED_TYPE_ELEMENT_TYPE = 5 integer, parameter :: CHARACTER_ELEMENT_TYPE = 6 integer, parameter :: c_int8_t_size = 1 integer, parameter :: c_int16_t_size = 2 integer, parameter :: c_int32_t_size = 4 integer, parameter :: c_int64_t_size = 8 integer, parameter :: c_int128_t_size = 16 contains type(c_desc1_t) function c_desc1_int32(A) result(desc) integer(c_int32_t), intent(in), target :: A(:) desc%base_addr = c_loc(A(1)) desc%dim(1)%stride = 1 ! A must be contiguous desc%dim(1)%lower_bound = lbound(A,1) desc%dim(1)%upper_bound = ubound(A,1) desc%dtype = size(shape(A)) ! Dimension desc%dtype = ior(desc%dtype, lshift(INTEGER_ELEMENT_TYPE, 3)) desc%dtype = ior(desc%dtype, lshift(c_int32_t_size, 6)) desc%offset = -(desc%dim(1)%lower_bound * desc%dim(1)%stride) end function type(c_desc2_t) function c_desc2_int32(A) result(desc) integer(c_int32_t), intent(in), target :: A(:,:) integer :: n, dim dim = size(shape(A)) desc%base_addr = c_loc(A(1,1)) desc%offset = 0 do n = 1, dim if (n == 1) then desc%dim(n)%stride = 1 else desc%dim(n)%stride = & (desc%dim(n-1)%upper_bound - desc%dim(n-1)%lower_bound + 1) & * desc%dim(n-1)%stride end if desc%dim(n)%lower_bound = lbound(A,n) desc%dim(n)%upper_bound = ubound(A,n) desc%offset = desc%offset & - desc%dim(n)%lower_bound * desc%dim(n)%stride end do desc%dtype = dim desc%dtype = ior(desc%dtype, lshift(INTEGER_ELEMENT_TYPE, 3)) desc%dtype = ior(desc%dtype, lshift(c_int32_t_size, 6)) end function end module lfortran-lfortran-2f73434/integration_tests/intrinsics_223.f900000664000175000017500000000364215141516316024500 0ustar alastairalastairprogram intrinsics_223 use iso_fortran_env, only: dp=>real64, sp=>real32 implicit none real(4) :: x1 = 1.0_4, x2 = 42.0_4 real(8) :: y1 = 1.0_8, y2 = 42.0_8 real :: s1 = 1.0_4, s2 = -1.0_4 real(4), parameter :: x3 = 1.0_sp, x4 = 42.0_sp real(8), parameter :: y3 = 1.0_dp, y4 = 42.0_dp real, parameter :: s3 = 1.0, s4 = -1.0 print*, nearest(x1, s1) if (abs(nearest(x1, s1) - 1.00000012_sp) > 1e-6) error stop print*, nearest(y1, s1) if (abs(nearest(y1, s1) - 1.0000000000000002_dp) > 1e-12) error stop print*, nearest(x2, s1) if (abs(nearest(x2, s1) - 42.0000038_sp) > 1e-6) error stop print*, nearest(y2, s1) if (abs(nearest(y2, s1) - 42.000000000000007_dp) > 1e-12) error stop print*, nearest(x1, s2) if (abs(nearest(x1, s2) - 0.999999940_sp) > 1e-6) error stop print*, nearest(y1, s2) if (abs(nearest(y1, s2) - 0.99999999999999989_dp) > 1e-12) error stop print*, nearest(x2, s2) if (abs(nearest(x2, s2) - 41.9999962_sp) > 1e-6) error stop print*, nearest(y2, s2) if (abs(nearest(y2, s2) - 41.999999999999993_dp) > 1e-12) error stop print*, nearest(x3, s3) if (abs(nearest(x3, s3) - 1.00000012e+00_sp) > 1e-6) error stop print*, nearest(y3, s3) if (abs(nearest(y3, s3) - 1.0000000000000001e+00_dp) > 1e-12) error stop print*, nearest(x4, s3) if (abs(nearest(x4, s3) - 42.0000038_sp) > 1e-6) error stop print*, nearest(y4, s3) if (abs(nearest(y4, s3) - 42.000000000000007_dp) > 1e-12) error stop print*, nearest(x3, s4) if (abs(nearest(x3, s4) - 0.999999940_sp) > 1e-6) error stop print*, nearest(y3, s4) if (abs(nearest(y3, s4) - 0.99999999999999989_dp) > 1e-12) error stop print*, nearest(x4, s4) if (abs(nearest(x4, s4) - 41.9999962_sp) > 1e-6) error stop print*, nearest(y4, s4) if (abs(nearest(y4, s4) - 41.999999999999993_dp) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/data_implied_do_01.f900000664000175000017500000000052715141516316025322 0ustar alastairalastairprogram data_implied_do_01 real :: a(5) integer :: i DATA (a(i),i=1,5) /1.0, 2.0, 3*0.0/ print *, a if (abs(a(1) - 1.0) > 1e-8) error stop if (abs(a(2) - 2.0) > 1e-8) error stop if (abs(a(3) - 0.0) > 1e-8) error stop if (abs(a(4) - 0.0) > 1e-8) error stop if (abs(a(5) - 0.0) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/class_102.f900000664000175000017500000000335015141516316023410 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/8303 ! Extended type with polymorphic dispatch through self%obj%method(wrap(1)%arr) ! LLVM IR verification failed with type mismatch for allocatable array argument module class_102_mod type, abstract :: AbsType contains procedure(method), deferred :: method end type AbsType abstract interface subroutine method(self,arr) import class(AbsType), intent(inout) :: self real(8), allocatable, intent(inout) :: arr(:) end subroutine method end interface type, extends(AbsType) :: MyType class(AbsType), allocatable :: obj contains procedure :: method => implementation procedure :: do_work end type MyType type :: Wrapper real(8), allocatable :: arr(:) end type Wrapper contains subroutine implementation(self,arr) class(MyType), intent(inout) :: self real(8), allocatable, intent(inout) :: arr(:) integer :: i do i = 1, size(arr) arr(i) = arr(i) * 2.0d0 end do end subroutine implementation subroutine do_work(self,wrap) class(MyType), intent(inout) :: self type(Wrapper), intent(inout) :: wrap(:) call self%obj%method(wrap(1)%arr) end subroutine do_work end module class_102_mod program class_102 use class_102_mod implicit none type(MyType) :: obj type(Wrapper) :: wrap(1) allocate(MyType :: obj%obj) allocate(wrap(1)%arr(3)) wrap(1)%arr = [1.0d0, 2.0d0, 3.0d0] call obj%do_work(wrap) if (abs(wrap(1)%arr(1) - 2.0d0) > 1.0d-10) error stop if (abs(wrap(1)%arr(2) - 4.0d0) > 1.0d-10) error stop if (abs(wrap(1)%arr(3) - 6.0d0) > 1.0d-10) error stop print *, "PASS" end program class_102 lfortran-lfortran-2f73434/integration_tests/string_03.f900000664000175000017500000000071615141516316023534 0ustar alastairalastairmodule string_03_mod implicit none character(len = 5), parameter :: intro = "I've " end module program string_03 use string_03_mod, only: intro implicit none character(len = 8) :: verb character(len = 5) :: posit character(len = 4) :: title character(len = 7) :: last_name character(len = 29) :: combined verb = "learned " posit = "from " title = 'the ' last_name = 'best' combined = intro//verb//posit//title//last_name//"." print *, combined end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_15.f900000664000175000017500000000114315141516316026575 0ustar alastairalastair! Test legacy array sections with 64-bit default integers ! Tests that ArrayBound nodes use correct integer kind when -fdefault-integer-8 is used subroutine caller(work, lwork, n) integer :: lwork, n real :: work(lwork) call callee(work(n+1), lwork-n) end subroutine subroutine callee(x, m) integer :: m real :: x(m) x(1) = 42.0 end subroutine program legacy_array_sections_15 implicit none real :: w(100) integer :: i w = 0.0 call caller(w, 100, 10) if (abs(w(11) - 42.0) > 1e-6) error stop "Test failed: w(11) should be 42.0" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/c_ptr_03.f900000664000175000017500000000076715141516316023343 0ustar alastairalastairprogram c_ptr_03 use iso_c_binding, only: c_ptr, c_loc, c_int, c_f_pointer implicit none integer(c_int), target :: x, y type(c_ptr), dimension(2) :: c_requests integer(c_int), pointer :: px, py x = 10 y = 20 c_requests(1) = c_loc(x) c_requests(2) = c_loc(y) call c_f_pointer(c_requests(1), px) call c_f_pointer(c_requests(2), py) print *, "px: ", px if (px /= x) error stop print *, "py: ", py if (py /= y) error stop end program c_ptr_03 lfortran-lfortran-2f73434/integration_tests/file_06_data.dat0000664000175000017500000000003015141516316024300 0ustar alastairalastair ׃@ffF@z?@z@lfortran-lfortran-2f73434/integration_tests/intrinsics_03.f900000664000175000017500000000071015141516316024405 0ustar alastairalastairprogram intrinsics_03 use iso_fortran_env, only: dp => real64 real :: x integer :: i = -12 real(dp) :: a, r1, r2 a = 4.2_dp x = cos(9.5) if (abs(x + 0.997172177) > 1e-7) error stop if (abs(cos(a) + 0.49026082) > 1e-7) error stop if (abs(cos(cos(1.5) + cos(a+cos(a))) - 0.71640354) > 1e-7) error stop r1 = dcos(a) r2 = -0.4902608213406995_dp if (dabs(r1-r2) > 1e-15_dp) error stop print *, iabs(i) if (iabs(i) /= 12) error stop end program intrinsics_03 lfortran-lfortran-2f73434/integration_tests/modules_25.f900000664000175000017500000000015215141516316023674 0ustar alastairalastairprogram module_25 use tomlf_de_character implicit none print *, "running module_25 program" end program lfortran-lfortran-2f73434/integration_tests/format_36.f900000664000175000017500000000150415141516316023520 0ustar alastairalastairprogram format_36 use iso_fortran_env, only: int32, int64, real32, real64 implicit none real(real32) :: val32 real(real64) :: val64 integer(int64) :: minus_one integer(int64) :: val64_bits character(len=8) :: hex32 character(len=16) :: hex64_real character(len=16) :: hex64_expected character(len=16) :: hex64_int val32 = 123.456_real32 val64 = 123.456_real64 minus_one = -1_int64 val64_bits = transfer(val64, val64_bits) write(hex32, '(Z8.8)') val32 if (trim(hex32) /= '42F6E979') error stop write(hex64_real, '(Z16.16)') val64 write(hex64_expected, '(Z16.16)') val64_bits if (trim(hex64_real) /= trim(hex64_expected)) error stop write(hex64_int, '(Z16.16)') minus_one if (trim(hex64_int) /= 'FFFFFFFFFFFFFFFF') error stop end program format_36 lfortran-lfortran-2f73434/integration_tests/volatile_01.f900000664000175000017500000000112115141516316024032 0ustar alastairalastairmodule sj0m_volatile_01 implicit none integer, parameter :: m90_sngl = kind(1.e0) contains function sj0_sngl(x) result(f) integer, parameter :: knd = m90_sngl real(knd) f real(knd), intent(in) :: x real(knd), volatile :: iota = epsilon(x) / 2 f = iota / 6 end function sj0_sngl end module sj0m_volatile_01 program volatile_01 use sj0m_volatile_01 implicit none real(m90_sngl) :: x = 1.0 real(m90_sngl) :: y y = sj0_sngl(x) print *, y if ( abs( y - 9.93410776E-09 ) > 1E-15 ) error stop end program lfortran-lfortran-2f73434/integration_tests/bindc3.f900000664000175000017500000000040415141516316023060 0ustar alastairalastairprogram bindc3 use iso_c_binding, only: c_loc, c_ptr, c_f_pointer type(c_ptr) :: queries integer :: idx = 1 integer(2), pointer :: x integer(2), target :: y call c_f_pointer(queries, x) print *, c_loc(x), queries x => y print *, c_loc(x), c_loc(y) end program lfortran-lfortran-2f73434/integration_tests/bindc_01c.h0000664000175000017500000000016615141516316023276 0ustar alastairalastair#ifndef BINDC_01C #define BINDC_01C void ret_ptr_c(void **p); void print_ptr_c(int n, void *p); #endif // BINDC_01C lfortran-lfortran-2f73434/integration_tests/write_11.f900000664000175000017500000000066015141516316023355 0ustar alastairalastairprogram write_11 implicit none character(len=*), parameter :: temp_file = "_lfortran_temporary_file" character(len=*), parameter :: test_line = "HelloWorld!" integer :: unit, ios ios = 0 unit = 1 open(newunit=unit, file=temp_file) write(unit, iostat=ios) test_line close(unit) print *, ios if(ios <= 0) error stop "IOS should be positive -- as a runtime error should occur" end programlfortran-lfortran-2f73434/integration_tests/intrinsics_100.f900000664000175000017500000000133415141516316024466 0ustar alastairalastairprogram intrinsics_100 implicit none integer(1) :: ix_8, iy_8 integer(2) :: ix_16, iy_16 integer :: iresult integer(8) :: ix_64, iy_64 ix_8 = 127_1 iy_8 = 23_1 iresult = mod(ix_8, iy_8) print *, "Test 1: mod( ", ix_8, ",", iy_8, ") = ", iresult if (iresult /= 12) error stop "Test 1 failed" ix_16 = -32767_2 iy_16 = 17_2 iresult = mod(ix_16, iy_16) print *, "Test 2: mod( ", ix_16, ",", iy_16, ") = ", iresult if (iresult /= -8) error stop "Test 2 failed" ix_64 = 43256_8 iy_64 = 53_8 iresult = mod(ix_64, iy_64) print *, "Test 3: mod( ", ix_64, ",", iy_64, ") = ", iresult if (iresult /= 8) error stop "Test 3 failed" end program intrinsics_100 lfortran-lfortran-2f73434/integration_tests/allocate_06.f900000664000175000017500000000071515141516316024014 0ustar alastairalastairprogram allocate_06 implicit none character(len=:), allocatable :: array(:) call sub(array) if (array(1) /= "abc") error stop print *, array(1) contains subroutine sub(x_array) character(len=:), allocatable, intent(out) :: x_array(:) allocate(character(len=8)::x_array(2)) x_array = ["abc"] if (x_array(1) /= "abc") error stop print *, x_array(1) end subroutine sub end program allocate_06 lfortran-lfortran-2f73434/integration_tests/doloop_17.f900000664000175000017500000000064715141516316023532 0ustar alastairalastairmodule doloop_17_mod implicit none contains function test_func(input) result(output) character(len=*), intent(in) :: input character(len=len(input)) :: output output = 'k' end function test_func end module doloop_17_mod program doloop_17 use doloop_17_mod implicit none integer :: i = 1 do i = 1, 5 print *, test_func('a') end do end program doloop_17 lfortran-lfortran-2f73434/integration_tests/intrinsics_240.f900000664000175000017500000000442215141516316024474 0ustar alastairalastairprogram intrinsics_240 integer(4) :: i, j, o, p integer(8) :: k, l, m, n integer(4) :: shift, shift2 integer(8) :: shift3, shift1 integer(8) :: expected_run(2) integer(4) :: expected_comp_sp(2) integer(8) :: expected_comp_dp(2) integer(8) :: first_arg(2) = [7, -10] integer(8) :: second_arg(2) = [12, -12] integer(4) :: third_arg(2) = [5, 7] integer(8) :: dshiftr_runtime_res(2) integer(4), parameter :: res_comp_sp(2) = dshiftr([10, 632], [7, 918], [8, 17]) integer(8), parameter :: res_comp_dp(2) = dshiftr([14526_8, -726382_8], [12345_8, 1725422_8], [31, 42]) expected_comp_dp = [124777389883392_8, -3046666928128_8] expected_comp_sp = [167772160, 20709376] expected_run = [4035225266123964416_8, -1297036692682702849_8] dshiftr_runtime_res = dshiftr(first_arg, second_arg, third_arg) do i = 1, size(res_comp_sp) print *, res_comp_sp(i) if (res_comp_sp(i) /= expected_comp_sp(i)) error stop end do do i = 1, size(res_comp_dp) print *, res_comp_dp(i) if (res_comp_dp(i) /= expected_comp_dp(i)) error stop end do do i = 1, size(dshiftr_runtime_res) print *, dshiftr_runtime_res(i) if (dshiftr_runtime_res(i) /= expected_run(i)) error stop end do i = 10 j = 7 shift = 8 k = 14526 l = 12345 m = -726382 n = 1725422 o = 632 p = 918 shift1 = 17 shift2 = 31 shift3 = 42 print *, dshiftr(o, p, shift1) if (dshiftr(o, p, shift1) /= 20709376) error stop print *, dshiftr(k, l, shift2) if (dshiftr(k, l, shift2) /= 124777389883392_8) error stop print *, dshiftr(m, n, shift3) if (dshiftr(m, n, shift3) /= -3046666928128_8) error stop print *, dshiftr(10, 7, 6) if(dshiftr(10, 7, 6) /= 671088640) error stop print *, dshiftr(10, -12, 7) if(dshiftr(10, -12, 7) /= 369098751) error stop print *, dshiftr(7_8, 12_8, 5) if (dshiftr(7_8, 12_8, 5) /= 4035225266123964416_8) error stop print *, kind(dshiftr(-10, 4, 3)) if(kind(dshiftr(-10, 4, 3)) /= 4) error stop print *, kind(dshiftr(7_8, 12_8, 5)) if(kind(dshiftr(7_8, 12_8, 5)) /= 8) error stop print *, kind(dshiftr(-10, -12, 7)) if(kind(dshiftr(10, 12, 7)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_85.f900000664000175000017500000000237615141516316024431 0ustar alastairalastairprogram intrinsics_85 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = maxexponent(0.131_sp) integer, parameter :: i2 = maxexponent(0.12819_dp) integer, parameter :: ar1 = maxexponent([0.131_sp, 0.12819_sp, 0.0_sp]) integer, parameter :: ar2 = maxexponent([1.24_dp, 1.119_dp, 0.0_dp]) real(kind=4) :: x real(kind=8) :: y real(sp) :: arr1(3) = [0.131_sp, 0.12819_sp, 0.0_sp] real(dp) :: arr2(3) = [1.24_dp, 1.239_dp, 0.0_dp] integer :: result print *, i1 if (i1 /= 128) error stop print *, i2 if (i2 /= 1024) error stop print *, ar1 if (ar1 /= 128) error stop print *, ar2 if (ar2 /= 1024) error stop result = maxexponent(x) print *, 'maxexponent(x) = ', result if (result /= 128) error stop result = maxexponent(y) print *, 'maxexponent(y) = ', result if (result /= 1024) error stop result = maxexponent(-214.91) print *, 'maxexponent(-214.91) = ', result if (result /= 128) error stop result = maxexponent(214.91D0) print *, 'maxexponent(214.91D0) = ', result if (result /= 1024) error stop print *, maxexponent(arr1) if (maxexponent(arr1) /= 128) error stop print *, maxexponent(arr2) if (maxexponent(arr2) /= 1024) error stop end program intrinsics_85 lfortran-lfortran-2f73434/integration_tests/character_21.f900000664000175000017500000000076415141516316024165 0ustar alastairalastairprogram character_21 implicit none print *, test_func(2) if (test_func(2) /= "119") error stop print *, test_func(4) if (test_func(4) /= "12345") error stop contains function test_func(d) result(res) integer, intent(in) :: d character(11) :: res character(1) claterdigits*(d+1) if (d == 2) then claterdigits = "119" else if (d == 4) then claterdigits = "12345" end if res = claterdigits end function test_func end program character_21 lfortran-lfortran-2f73434/integration_tests/associate_26.f900000664000175000017500000000127615141516316024210 0ustar alastairalastairprogram associate_26 implicit none type :: str integer :: data integer(1) :: a end type type(str), target :: e(8) integer :: i,j,array_sum,loop_sum integer, pointer :: dd(:) integer, parameter :: idx(8) = [(i,i=1,8)] ! Set data e%data = idx !dd=>idx ! OK dd=>e%data ! ICE array_sum = sum(idx(dd)) loop_sum = 0 do j=1,size(dd) loop_sum = loop_sum+idx(dd(j)) end do print *, 'expected =',sum(idx) print *, 'array_sum=',array_sum print *, ' loop_sum=', loop_sum if (array_sum/=sum(idx)) error stop 'array sum result is wrong' if ( loop_sum/=sum(idx)) error stop 'loop sum result is wrong' stop 0 end program lfortran-lfortran-2f73434/integration_tests/program_02.f900000664000175000017500000000026715141516316023675 0ustar alastairalastairmodule program_02_mod implicit none end program program_02 use program_02_mod implicit none contains subroutine f1() end integer function f2() f2 = 3 end end lfortran-lfortran-2f73434/integration_tests/cycle_and_exit1.f900000664000175000017500000000141115141516316024750 0ustar alastairalastairprogram test_loops integer :: i, j, k, l l1 : do i = 1, 5 l2 : do j = 1, 4 if (j > 2) then exit l1 end if print *, "l1", i, "l2", j if (j > 2) then print *, "error l2 1" end if end do l2 if (j > 2) then print *, "error l2 2" end if end do l1 k = 0 l3 : do while(.true.) l4 : do l = 1, 2 if (k > 3) then exit l3 end if print *, "l3", k, "l4", l if (k > 3) then print *, "error l3 1" end if end do l4 if (k > 3) then print *, "error l3 2" end if k = k + 1 end do l3 if (i == 1 .and. j == 3 .and. k == 4 .and. l == 1) then print *, "pass" else print *, "error", i, j, k, l end if end programlfortran-lfortran-2f73434/integration_tests/class_87.f900000664000175000017500000000233115141516316023342 0ustar alastairalastairmodule class_87_mod implicit none type, abstract :: toml_value end type toml_value type :: xx integer :: v = 0 end type xx type, extends(toml_value) :: toml_table class(xx), allocatable :: data end type toml_table contains function cast_to_table(ptr) result(table) class(toml_value), intent(in), target :: ptr type(toml_table), pointer :: table nullify(table) select type (ptr) type is (toml_table) table => ptr end select end function cast_to_table end module class_87_mod program class_87 use class_87_mod implicit none class(toml_value), allocatable :: t type(toml_table) :: p ! Allocate polymorphic object allocate(toml_table :: t) ! Allocate component select type (t) type is (toml_table) allocate(t%data) t%data%v = 42 class default error stop "Wrong dynamic type" end select p = cast_to_table(t) if (.not. allocated(p%data)) then error stop "allocatable member not allocated" end if if (p%data%v /= 42) then error stop "data value corrupted" end if print *, "TEST PASSED" end program class_87 lfortran-lfortran-2f73434/integration_tests/doconcurrentloop_01.f900000664000175000017500000000101115141516316025610 0ustar alastairalastairprogram doconcurrentloop_01 implicit none real, dimension(10000) :: a, b, c real :: scalar integer :: i, nsize scalar = 10 nsize = size(a) do concurrent (i = 1:nsize) a(i) = 5 b(i) = 5 end do call triad(a, b, scalar, c) print *, "End Stream Triad" contains subroutine triad(a, b, scalar, c) real, intent(in) :: a(:), b(:), scalar real, intent(out) :: c(:) integer :: N, i N = size(a) do concurrent (i = 1:N) c(i) = a(i) + scalar * b(i) end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_59.f900000664000175000017500000000073715141516316023545 0ustar alastairalastairprogram arrays_59 real :: A(2,2) = reshape([1.0,2.0,3.0,4.0], [2,2]) call trans(A) print *, A if ( any(abs( A - 12.91 ) > 1e-6) ) error stop contains subroutine trans(A) real, intent(inout) :: A(:, :) real :: B(size(A,1), size(A,2)) B = A A = matprod(transpose(B)) end subroutine function matprod(x) result(k) real,intent(in) :: x(:,:) real :: k(size(x, 1), size(x, 2)) k = 12.91 end function end program lfortran-lfortran-2f73434/integration_tests/data_05.f900000664000175000017500000000043015141516316023132 0ustar alastairalastairSUBROUTINE ITAIRY() IMPLICIT DOUBLE PRECISION (A-H,O-Z) DIMENSION A(2) DATA A/.569444444444444D0,.891300154320988D0/ print *, A(1), A(2) IF (A(1) /= .569444444444444D0) ERROR STOP IF (A(2) /= .891300154320988D0) ERROR STOP RETURN END PROGRAM MAIN CALL ITAIRY() END PROGRAM lfortran-lfortran-2f73434/integration_tests/arrays_55.f900000664000175000017500000000053715141516316023537 0ustar alastairalastairprogram arrays_55 implicit none integer, parameter :: N = 10 real :: x(N), y(3) x = 3 y = g(x(:3))+1 if( any(y /= 6.00) ) error stop print *, y contains function g(A) result(r) real, intent(in) :: A(:) real :: r(size(A)) r = A+2 print *, "g(A) called" end function end program lfortran-lfortran-2f73434/integration_tests/openmp_58.f900000664000175000017500000000100715141516316023530 0ustar alastairalastairprogram openmp_58 use omp_lib implicit none integer, parameter :: N = 5 integer :: A(N) integer :: i, index,total A = 1 total=0 index=1 !$omp parallel !$omp single !$omp taskloop shared(A) do i = 1, N !$omp critical total = total + A(index) * 2 index=index+1 !$omp end critical end do !$omp end taskloop !$omp end single !$omp taskwait !$omp end parallel print *, "Total = ", total, index if(total/=10) error stop end program openmp_58 lfortran-lfortran-2f73434/integration_tests/class_92.f900000664000175000017500000000227715141516316023347 0ustar alastairalastair! Test for unlimited polymorphic array member with type-bound procedures ! Fixes issue #7359 - class(*) vtable codegen bug module class_92_mod implicit none type :: deque private class(*), dimension(:), allocatable :: items integer :: count = 0 contains procedure :: at_size_kind procedure :: at_default procedure :: get_count end type deque contains function at_size_kind(this, i, rc) result(res) class(deque), target, intent(in) :: this integer(8), intent(in) :: i integer, intent(out) :: rc class(*), pointer :: res res => null() rc = 0 end function at_size_kind function at_default(this, i, rc) result(res) class(deque), target, intent(in) :: this integer, intent(in) :: i integer, intent(out) :: rc class(*), pointer :: res res => this%at_size_kind(int(i, 8), rc) end function at_default function get_count(this) result(c) class(deque), intent(in) :: this integer :: c c = this%count end function get_count end module class_92_mod program class_92 use class_92_mod implicit none type(deque) :: d integer :: c c = d%get_count() if (c /= 0) error stop print *, "PASS" end program class_92 lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_13.f900000664000175000017500000000104315141516316026050 0ustar alastairalastairprogram pass_array_by_data_13 implicit none integer :: iseed(4) integer :: n real, allocatable :: work(:,:) allocate(work(3, 5)) iseed = [1, 2, 3, 4] n = 15 call slarnv(2, iseed, n, work) if (abs(work(1, 1) - 2.0) > 1e-6) error stop end program pass_array_by_data_13 subroutine slarnv(idist, iseed, n, x) implicit none integer, intent(in) :: idist integer, intent(inout) :: iseed(*) integer, intent(in) :: n real, intent(inout) :: x(*) if (n > 0) x(1) = 2.0 end subroutine slarnv lfortran-lfortran-2f73434/integration_tests/bindc_12.f900000664000175000017500000000142215141516316023300 0ustar alastairalastairprogram bindc_12 use, intrinsic :: iso_c_binding, only : c_char, c_int, c_null_char implicit none interface function c_chdir(path) bind(C, name="chdir") result(stat) import :: c_char, c_int character(kind=c_char, len=1), intent(in) :: path(*) integer(c_int) :: stat end function c_chdir end interface character(kind=c_char, len=1), allocatable :: cpath(:) integer(c_int) :: stat allocate(cpath(5)) cpath = [ '/', 't', 'm', 'p', c_null_char ] if (cpath(5) /= c_null_char) then error stop "C string not NUL terminated" end if stat = c_chdir(cpath) if (stat /= 0) then error stop "chdir failed" end if print *, "OK: chdir(/tmp) succeeded" end program bindc_12 lfortran-lfortran-2f73434/integration_tests/case_02.f900000664000175000017500000000323315141516316023135 0ustar alastairalastairprogram case_02 implicit none ! local variable declaration integer :: marks, out marks = 81 select case (marks) case (91:100) out = 0 print*, "Excellent!" case (81:90) out = 1 print*, "Very good!" case (71:80) out = 2 print*, "Well done!" case (61:70) out = 3 print*, "Not bad!" case (41:60) out = 4 print*, "You passed!" case (:40) out = 5 print*, "Better try again!" case default out = 6 print*, "Invalid marks" end select print*, "Your marks are ", marks if (out /= 1) error stop ! case default at the top select case (marks) case default print*, "Invalid marks" case (91:100) print*, "Excellent!" case (81:90) print*, "Very good!" case (71:80) print*, "Well done!" case (61:70) print*, "Not bad!" case (41:60) print*, "You passed!" case (:40) print*, "Better try again!" end select print*, "Your marks are ", marks ! case default in the middle select case (marks) case (91:100) print*, "Excellent!" case (81:90) print*, "Very good!" case default print*, "Invalid marks" case (71:80) print*, "Well done!" case (61:70) print*, "Not bad!" case (41:60) print*, "You passed!" case (:40) print*, "Better try again!" end select print*, "Your marks are ", marks end program lfortran-lfortran-2f73434/integration_tests/arrays_45.f900000664000175000017500000000075115141516316023534 0ustar alastairalastairmodule module_arrays_45 integer :: nx = 4 integer :: ny = 4 end module module_arrays_45 subroutine a(cs) use module_arrays_45 real, dimension(nx), intent(in) :: cs print *, cs if (abs(sum(cs) - 10.0) > 1e-8) error stop end subroutine subroutine b(cs) use module_arrays_45 real, dimension(nx, ny), intent(in) :: cs print *, cs end subroutine program arrays_45 real, dimension(4) :: cs real, dimension(4, 4) :: cs2 cs = [1.0, 2.0, 3.0, 4.0] cs2 = 12.87 call a(cs) call b(cs2) end program lfortran-lfortran-2f73434/integration_tests/modules_18c.c0000664000175000017500000000665215141516316023700 0ustar alastairalastair#include #include "modules_18c.h" int f_int_float(int *a, float *b) { return *a + *b; } int f_int_double(int *a, double *b) { return *a + *b; } int f_int_float_complex(int *a, float_complex_t *b) { return *a + crealf(*b) + cimagf(*b); } int f_int_double_complex(int *a, double_complex_t *b) { return *a + creal(*b) + cimag(*b); } int f_int_float_complex_value(int a, float_complex_t b) { return a + crealf(b) + cimagf(b); } int f_int_double_complex_value(int a, double_complex_t b) { return a + creal(b) + cimag(b); } float_complex_t f_float_complex_value_return(float_complex_t b) { float_complex_t r; #if _WIN32 r = _FCmulcr(b, 2.0); #else r = b * 2; #endif return r; } double_complex_t f_double_complex_value_return(double_complex_t b) { double_complex_t r; #if _WIN32 r = _Cmulcr(b, 2.0); #else r = b * 2; #endif return r; } int f_int_float_value(int a, float b) { return a + b; } int f_int_double_value(int a, double b) { return a + b; } int f_int_intarray(int n, int *b) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } double f_int_doublearray(int n, double *b) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } float f_int_floatarray_star(int n, float *b) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } return s; } // -------------------------------------------------------------------- void sub_int_float(int *a, float *b, int *r) { *r = *a + *b; } void sub_int_double(int *a, double *b, int *r) { *r = *a + *b; } void sub_int_float_complex(int *a, float_complex_t *b, int *r) { *r = *a + crealf(*b) + cimagf(*b); } void sub_int_double_complex(int *a, double_complex_t *b, int *r) { *r = *a + creal(*b) + cimag(*b); } void sub_int_float_value(int a, float b, int *r) { *r = a + b; } void sub_int_double_value(int a, double b, int *r) { *r = a + b; } void sub_int_float_complex_value(int a, float_complex_t b, int *r) { *r = a + crealf(b) + cimagf(b); } void sub_int_double_complex_value(int a, double_complex_t b, int *r) { *r = a + creal(b) + cimag(b); } void sub_int_intarray(int n, int *b, int *r) { int i; int s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_floatarray(int n, float *b, float *r) { int i; float s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } void sub_int_doublearray(int n, double *b, double *r) { int i; double s; s = 0; for (i=0; i < n; i++) { s += b[i]; } *r = s; } int f_string(char *s) { return strlen(s); } int32_t call_fortran_i32(int32_t i) { return fortran_i32(&i); } int32_t call_fortran_i32_value(int32_t i) { return fortran_i32_value(i); } int64_t call_fortran_i64(int64_t i) { return fortran_i64(&i); } int64_t call_fortran_i64_value(int64_t i) { return fortran_i64_value(i); } float call_fortran_f32(float i) { return fortran_f32(&i); } float call_fortran_f32_value(float i) { return fortran_f32_value(i); } double call_fortran_f64(double i) { return fortran_f64(&i); } double call_fortran_f64_value(double i) { return fortran_f64_value(i); } lfortran-lfortran-2f73434/integration_tests/openmp_10.f900000664000175000017500000000126315141516316023520 0ustar alastairalastairsubroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n double precision, intent(out) :: ctr double precision :: local_ctr integer :: i local_ctr = 0 !$omp parallel private(i) reduction(+:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr + 1.5 end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_06 use omp_lib integer, parameter :: n = 1000000 double precision :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs(ctr - 1.5e6) > 0.0002 ) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_43.f900000664000175000017500000000122715141516316023526 0ustar alastairalastairprogram openmp_43 implicit none integer :: i,fun_sum,sub_sum,x fun_sum = 0 do concurrent (i = 1:4) reduce(+:fun_sum) fun_sum = fun_sum + FUN(i) end do print *,"FUN sum->", fun_sum sub_sum = 0 do concurrent (i = 1:4) reduce(+:sub_sum) x=i call SUB(x) sub_sum = sub_sum + x end do print *,"SUB sum->", sub_sum if(sub_sum /= 30) error stop if(fun_sum /= 30) error stop contains pure subroutine SUB(x) integer, intent(inout) :: x x = x * x end subroutine SUB PURE integer function FUN(x) integer, intent(in) :: x FUN = x * x end function FUN end program openmp_43lfortran-lfortran-2f73434/integration_tests/namelist_03.f900000664000175000017500000000362515141516316024044 0ustar alastairalastairprogram namelist_test_03 implicit none ! Define variables integer :: i1, i2 real :: r1, r2 logical :: l1, l2 character(len=10) :: c1, c2 integer :: arr1(3) real :: arr2(2) ! Define namelist namelist /testdata/ i1, i2, r1, r2, l1, l2, c1, c2, arr1, arr2 ! Initialize variables i1 = 42 i2 = -17 r1 = 3.14159 r2 = -2.71828 l1 = .true. l2 = .false. c1 = 'hello' c2 = 'world' arr1(1) = 1 arr1(2) = 2 arr1(3) = 3 arr2(1) = 1.5 arr2(2) = 2.5 ! Write namelist to file open(unit=10, file='namelist_test.dat', status='replace', form='formatted') write(10, nml=testdata) close(10) ! Reset variables to different values i1 = 0 i2 = 0 r1 = 0.0 r2 = 0.0 l1 = .false. l2 = .true. c1 = 'xxxxx' c2 = 'yyyyy' arr1(1) = 0 arr1(2) = 0 arr1(3) = 0 arr2(1) = 0.0 arr2(2) = 0.0 ! Read namelist from file open(unit=10, file='namelist_test.dat', status='old', form='formatted') read(10, nml=testdata) close(10) ! Verify values if (i1 /= 42) error stop "Read i1 mismatch" if (i2 /= -17) error stop "Read i2 mismatch" if (abs(r1 - 3.14159) > 1.0e-5) error stop "Read r1 mismatch" if (abs(r2 - (-2.71828)) > 1.0e-5) error stop "Read r2 mismatch" if (.not. l1) error stop "Read l1 mismatch" if (l2) error stop "Read l2 mismatch" if (trim(c1) /= 'hello') error stop "Read c1 mismatch" if (trim(c2) /= 'world') error stop "Read c2 mismatch" if (arr1(1) /= 1) error stop "Read arr1(1) mismatch" if (arr1(2) /= 2) error stop "Read arr1(2) mismatch" if (arr1(3) /= 3) error stop "Read arr1(3) mismatch" if (abs(arr2(1) - 1.5) > 1.0e-5) error stop "Read arr2(1) mismatch" if (abs(arr2(2) - 2.5) > 1.0e-5) error stop "Read arr2(2) mismatch" print *, "" print *, "All namelist tests passed!" end program namelist_test_03 lfortran-lfortran-2f73434/integration_tests/nested_11.f900000664000175000017500000000075615141516316023513 0ustar alastairalastairmodule base implicit none integer, public :: a = 10 end module module intermediate use base, only: a implicit none private end module program nested_11 use base implicit none interface subroutine sub2 use intermediate implicit none end subroutine sub2 end interface call sub contains subroutine sub use intermediate implicit none print *, a if( a /= 10 ) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_192.f900000664000175000017500000001210415141516316024476 0ustar alastairalastairprogram intrinsics_192 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(8) :: x(40) real(8) :: expected(40) real :: y(30) real :: expected_y(30) integer :: i real(dp), parameter :: res(40) = bessel_j0([3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, & 8.43782487005198_dp, 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp]) x = [3.3398640543782485_dp, 5.039184326269492_dp, 6.738504598160736_dp, 8.43782487005198_dp, & 10.137145141943222_dp, 11.836465413834466_dp, 13.53578568572571_dp, 15.235105957616954_dp, & 16.934426229508198_dp, 18.63374650139944_dp, 1.999201299880048d+306, 1.199520279928029d+307, & 2.1991204298680527d+307, 3.198720579808077d+307, 4.198320729748101d+307, 5.197920879688125d+307, & 6.197521029628149d+307, 7.197121179568173d+307, 8.196721329508197d+307, 9.196321479448221d+307, & -0.8439824070371851_dp, -1.0638944422231107_dp, -1.2838064774090363_dp, -1.503718512594962_dp, & -1.7236305477808875_dp, -1.9435425829668134_dp, -2.163454618152739_dp, -2.3833666533386646_dp, & -2.60327868852459_dp, -2.823190723710516_dp, .8439824070371851_dp, 1.0638944422231107_dp, & 1.2838064774090363_dp, 1.503718512594962_dp, 1.7236305477808875_dp, 1.9435425829668134_dp, & 2.163454618152739_dp, 2.3833666533386646_dp, 2.60327868852459_dp, 2.823190723710516_dp] expected = [-0.35276533724012665_dp, -0.16467814025284372_dp, 0.2885135446265932_dp, 0.05889084216205015_dp, & -0.2495399733324126_dp, 0.0104212906373451_dp, 0.21349211445035887_dp, -0.06124277731984677_dp, & -0.17590100995447924_dp, 0.09861767893471807_dp, 5.6416523635296804d-154, -2.2862889422883802d-154, & 6.631140845542755d-155, -5.568530188979783d-155, -1.4147891343158852d-155, 6.574020907172679d-155, & 1.010764003164187d-154, 9.351175657542549d-155, 3.874969850157508d-155, -4.371594366447781d-155, & 0.8296961122853597_dp, 0.7364314862573926_dp, 0.6285104628739052_dp, 0.509752014245272_dp, & 0.3843166288058289_dp, 0.25654187983098076_dp, 0.1307721336491019_dp, 0.011189479462964488_dp, & -0.09834712549229654_dp, -0.19444788933021404_dp, 0.8296961122853597_dp, 0.7364314862573926_dp, & 0.6285104628739052_dp, 0.509752014245272_dp, 0.3843166288058289_dp, 0.25654187983098076_dp, & 0.1307721336491019_dp, 0.011189479462964488_dp, -0.09834712549229654_dp, -0.19444788933021404_dp] do i = 1, size(x) print *, bessel_j0(x(i)), "i = ", i if (abs(bessel_j0(x(i)) - expected(i)) > 1e-12) error stop end do do i = 1, size(res) print *, res(i) if (abs(res(i) - expected(i)) > 1e-12_dp) error stop end do y = [3.3398640543782485_sp, 5.039184326269492_sp, 6.738504598160736_sp, 8.43782487005198_sp, & 10.137145141943222_sp, 11.836465413834466_sp, 13.53578568572571_sp, 15.235105957616954_sp, & 16.934426229508198_sp, 18.63374650139944_sp, & -0.8439824070371851_sp, -1.0638944422231107_sp, -1.2838064774090363_sp, -1.503718512594962_sp, & -1.7236305477808875_sp, -1.9435425829668134_sp, -2.163454618152739_sp, -2.3833666533386646_sp, & -2.60327868852459_sp, -2.823190723710516_sp, .8439824070371851_sp, 1.0638944422231107_sp, & 1.2838064774090363_sp, 1.503718512594962_sp, 1.7236305477808875_sp, 1.9435425829668134_sp, & 2.163454618152739_sp, 2.3833666533386646_sp, 2.60327868852459_sp, 2.823190723710516_sp] expected_y = [-0.35276533724012665_sp, -0.16467814025284372_sp, 0.2885135446265932_sp, 0.05889084216205015_sp, & -0.2495399733324126_sp, 0.0104212906373451_sp, 0.21349211445035887_sp, -0.06124277731984677_sp, & -0.17590100995447924_sp, 0.09861767893471807_sp, & 0.8296961122853597_sp, 0.7364314862573926_sp, 0.6285104628739052_sp, 0.509752014245272_sp, & 0.3843166288058289_sp, 0.25654187983098076_sp, 0.1307721336491019_sp, 0.011189479462964488_sp, & -0.09834712549229654_sp, -0.19444788933021404_sp, 0.8296961122853597_sp, 0.7364314862573926_sp, & 0.6285104628739052_sp, 0.509752014245272_sp, 0.3843166288058289_sp, 0.25654187983098076_sp, & 0.1307721336491019_sp, 0.011189479462964488_sp, -0.09834712549229654_sp, -0.19444788933021404_sp] do i = 1, size(y) print *, bessel_j0(y(i)), "i = ", i if (abs(bessel_j0(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-lfortran-2f73434/integration_tests/file_37.f900000664000175000017500000000046615141516316023156 0ustar alastairalastairprogram file_37 implicit none integer, allocatable :: x integer :: fh ! Open the file for writing and reading allocate(x) open(newunit=fh, status="scratch") write(fh, *) 666 rewind(fh) read(fh, *) x print "(I0)", x close(fh) ! deallocate(x) end program file_37 lfortran-lfortran-2f73434/integration_tests/associate_22.f900000664000175000017500000000115315141516316024176 0ustar alastairalastairprogram associate_22 implicit none type base real :: r character(len=:), allocatable :: s integer, pointer :: x(:) end type integer, pointer :: p_int_var(:), t_int_var(:) type(base), pointer :: p_base_var(:), t_base_var(:) allocate( p_int_var(0), t_int_var(0) ) print*, associated( p_int_var, t_int_var ) if ( associated( p_int_var, t_int_var ) ) error stop nullify( p_int_var ) allocate( p_base_var(0), t_base_var(0) ) print*, associated( p_base_var, t_base_var ) if ( associated( p_base_var, t_base_var ) ) error stop nullify( p_base_var ) end program lfortran-lfortran-2f73434/integration_tests/arrays_reshape_30.f900000664000175000017500000000060215141516316025230 0ustar alastairalastairprogram arrays_reshape_30 implicit none integer, parameter :: x(4) = [1, 2, 3, 4] real :: b(2, 2) = reshape([x], [2, 2]) if (b(1,1) /= 1.0) error stop "Mismatch at b(1,1)" if (b(2,1) /= 2.0) error stop "Mismatch at b(2,1)" if (b(1,2) /= 3.0) error stop "Mismatch at b(1,2)" if (b(2,2) /= 4.0) error stop "Mismatch at b(2,2)" end program arrays_reshape_30 lfortran-lfortran-2f73434/integration_tests/intrinsics_258.f900000664000175000017500000000025515141516316024505 0ustar alastairalastairprogram intrinsics_258 real :: x(5) = [1, 2, 3, 4, 5] integer:: mean mean = sum(x) / 5 print*, sum(abs(x - mean)**2) / (5 - merge(1, 0, .true.)) end programlfortran-lfortran-2f73434/integration_tests/intrinsics_354.f900000664000175000017500000000034715141516316024504 0ustar alastairalastairprogram intrinsics_354 integer :: x(2) x = [1, 2] call sub(x) print *, x if (any(x /= [1, 2])) error stop contains subroutine sub(x) integer :: x(2) real :: arr(minval(abs(x))) end subroutine sub end programlfortran-lfortran-2f73434/integration_tests/intrinsics_82.f900000664000175000017500000000276015141516316024423 0ustar alastairalastairprogram intrinsics_82 double precision :: x(5) x(1) = 1.0d0 x(2) = 2.0d0 x(3) = 3.0d0 x(4) = 4.0d0 x(5) = 5.0d0 print *, tan(x) if( abs(tan(x(1)) - 1.5574077246549023) > 1e-5) error stop if( abs(tan(x(2)) + 2.1850398632615189) > 1e-5) error stop if( abs(tan(x(3)) + 0.14254654307427780) > 1e-5) error stop if( abs(tan(x(4)) - 1.1578212823495775) > 1e-5) error stop if( abs(tan(x(5)) + 3.3805150062465859) > 1e-5) error stop print *, cosh(x) if( abs(cosh(x(1)) - 1.5430806348152437) > 1e-5) error stop if( abs(cosh(x(2)) - 3.7621956910836314) > 1e-5) error stop if( abs(cosh(x(3)) - 10.067661995777765) > 1e-5) error stop if( abs(cosh(x(4)) - 27.308232836016487) > 1e-5) error stop if( abs(cosh(x(5)) - 74.209948524787848) > 1e-5) error stop print *, sinh(x) if( abs(sinh(x(1)) - 1.1752011936438014) > 1e-5) error stop if( abs(sinh(x(2)) - 3.6268604078470190) > 1e-5) error stop if( abs(sinh(x(3)) - 10.017874927409903) > 1e-5) error stop if( abs(sinh(x(4)) - 27.289917197127750) > 1e-5) error stop if( abs(sinh(x(5)) - 74.203210577788752) > 1e-5) error stop print *, tanh(x) if( abs(tanh(x(1)) - 0.76159415595576485) > 1e-5) error stop if( abs(tanh(x(2)) - 0.96402758007581690) > 1e-5) error stop if( abs(tanh(x(3)) - 0.99505475368673046) > 1e-5) error stop if( abs(tanh(x(4)) - 0.99932929973906703) > 1e-5) error stop if( abs(tanh(x(5)) - 0.99990920426259511) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/list_test_03_.f900000664000175000017500000000437115141516316024400 0ustar alastairalastairmodule list_test_03_mod implicit none contains function test_list_01(n) result(sum) integer, intent(in) :: n integer :: sum, i type(_lfortran_list(integer)) :: a sum = 0 do i = 0, n-1 call _lfortran_list_append(a, i) end do do i = 0, n-1 sum = sum + _lfortran_get_item(a, i) end do end function function test_list_insert_02(x, n) result(out) type(_lfortran_list(integer)), intent(inout) :: x integer, intent(in) :: n integer :: i, imod type(_lfortran_list(integer)) :: out out = x do i = 0, n-1 imod = mod(i, 3) if (imod == 0) then call _lfortran_list_insert(out, 0, i + n) else if (imod == 1) then call _lfortran_list_insert(out, _lfortran_len(out), i + n + 1) else if (imod == 2) then call _lfortran_list_insert(out, _lfortran_len(out)/2, i + n + 2) end if end do end function function test_list_02(n) result(acc) integer, intent(in) :: n integer :: acc, i type(_lfortran_list(integer)) :: x x = _lfortran_list_constant(50, 1) acc = 0 x = test_list_insert_02(x, n) do i = 0, n-1 acc = acc + _lfortran_get_item(x, i) end do end function subroutine test_list_02_string() type(_lfortran_list(character(len=:))) :: x, y character(len=:), allocatable :: string character(len=:), allocatable :: buffer integer :: i, imod do i = 0, 49 write(buffer, '(I0)') i + mod(i, 3) string = "xd_" // trim(buffer) call _lfortran_list_append(y, string) end do do i = 0, 49 imod = mod(i, 3) write(buffer, '(I0)') i + imod string = "xd_" // trim(buffer) call _lfortran_list_insert(x, _lfortran_len(x), string) end do do i = 0, 49 if (_lfortran_get_item(x, i) /= _lfortran_get_item(y, i)) error stop end do end subroutine subroutine verify() if (test_list_01(11) /= 55) error stop if (test_list_02(50) /= 3628) error stop call test_list_02_string() end subroutine end module program test_list_insert_ use list_test_03_mod implicit none call verify() end program lfortran-lfortran-2f73434/integration_tests/modules_41.f900000664000175000017500000000212115141516316023670 0ustar alastairalastairmodule modules_41_fpm_targets implicit none type :: fpm_model_t character(len=40) :: package_name end type fpm_model_t contains subroutine build_target_list(model) type(fpm_model_t), intent(inout), pointer :: model integer :: result if( model%package_name /= "fpm_targets" ) error stop associate (x=>model) result = get_object_name() if( result /= 0 ) error stop print *, result end associate print *, model%package_name if( model%package_name /= "fpm_targets_new" ) error stop contains function get_object_name() result(int) integer :: int int = 0 model%package_name = "fpm_targets_new" end function get_object_name end subroutine build_target_list end module modules_41_fpm_targets program modules_41 use modules_41_fpm_targets implicit none type(fpm_model_t), target :: fpm_model type(fpm_model_t), pointer :: fpm_model_ptr fpm_model%package_name = "fpm_targets" print *, fpm_model%package_name fpm_model_ptr => fpm_model call build_target_list(fpm_model_ptr) end program lfortran-lfortran-2f73434/integration_tests/class_96.f900000664000175000017500000000073215141516316023345 0ustar alastairalastairprogram class_95 implicit none character(len=5) :: arr(2) = ["hello", "world"] call ss(arr) contains subroutine ss(generic) class(*) :: generic(:) select type (generic) type is (character(len=*)) call ff(generic) end select end subroutine subroutine ff(x) character(len=*) :: x(:) if(x(1) /= "hello") error stop if(x(2) /= "world") error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/inquire_03.f900000664000175000017500000000243015141516316023675 0ustar alastairalastairprogram inquire_03 integer :: unit = 2 character(12) :: filename, specifier_r, specifier_w, specifier_rw filename = "dummy.txt" open(unit, file=filename, action='write') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "NO" .or. specifier_w /= "YES ".or. specifier_rw /= "NO") error stop close(unit) open(unit, file=filename, action='read') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "NO " .or. specifier_rw /= "NO") error stop close(unit) open(unit, file=filename, action='readwrite') inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "YES " .or. specifier_rw /= "YES") error stop close(unit) open(unit, file=filename) inquire(unit, write=specifier_w, read=specifier_r, readwrite=specifier_rw) print *, specifier_r, specifier_w, specifier_rw if (specifier_r /= "YES" .or. specifier_w /= "YES " .or. specifier_rw /= "YES") error stop close(unit) end program inquire_03 lfortran-lfortran-2f73434/integration_tests/openmp_68.f900000664000175000017500000000517715141516316023545 0ustar alastairalastairprogram openmp_68 use omp_lib implicit none integer, parameter :: n = 100 integer :: i, tid, j integer :: thread_chunks(0:7) = 0 integer :: chunk_sizes(100) ! Track size of each chunk given out integer :: chunk_count = 0 integer :: current_iteration = 1 integer :: chunk_start(100), chunk_thread(100) logical :: test_passed = .true. logical :: looks_like_static = .true. call omp_set_num_threads(4) print *, "=== DYNAMIC Schedule with chunk=", 5, "===" ! Track chunks !$omp parallel private(tid) !$omp do schedule(dynamic, 5) do i = 1, n tid = omp_get_thread_num() !$omp critical ! Check if this is start of new chunk if (i == current_iteration) then chunk_count = chunk_count + 1 chunk_start(chunk_count) = i chunk_thread(chunk_count) = tid thread_chunks(tid) = thread_chunks(tid) + 1 ! Find chunk size if (i + 5 - 1 <= n) then chunk_sizes(chunk_count) = 5 current_iteration = i + 5 else chunk_sizes(chunk_count) = n - i + 1 current_iteration = n + 1 end if end if !$omp end critical end do !$omp end do !$omp end parallel ! Verify dynamic chunk behavior print *, "Total chunks distributed:", chunk_count print *, "Chunks per thread:" do i = 0, omp_get_max_threads()-1 print *, "Thread", i, ":", thread_chunks(i), "chunks" end do ! Check chunk sizes do i = 1, chunk_count-1 if (chunk_sizes(i) /= 5) then print *, "ERROR: Chunk", i, "has size", chunk_sizes(i), "expected", 5 test_passed = .false. end if end do ! Last chunk might be smaller if (chunk_sizes(chunk_count) > 5) then print *, "ERROR: Last chunk too large!" test_passed = .false. end if ! With dynamic, chunks should not follow a strict pattern ! Check for round-robin pattern (which would indicate static behavior) do i = 2, min(chunk_count, 8) if (chunk_thread(i) /= mod(chunk_thread(1) + i - 1, omp_get_max_threads())) then looks_like_static = .false. exit end if end do if (looks_like_static .and. chunk_count > 4) then print *, "WARNING: Dynamic schedule showing static-like round-robin pattern!" end if if (.not. test_passed) then error stop "DYNAMIC chunk schedule test FAILED!" end if print *, "DYNAMIC chunk schedule test completed" end program openmp_68lfortran-lfortran-2f73434/integration_tests/arrays_inputs_15.f900000664000175000017500000000120215141516316025123 0ustar alastairalastairprogram arrays_inputs_15 implicit none integer :: x(10), y(10), i logical :: r do i = 1, size(x) x(i) = i end do call copy_from_to(x, y, 10) r = verify(x, y) print *, r if (.not. r) error stop contains subroutine copy_from_to(xa, xb, n) integer, intent(in) :: n integer, intent(in) :: xa(n) integer, intent(out) :: xb(n) integer :: i do i = 1, size(xa) xb(i) = xa(i) end do end subroutine logical function verify(a, b) result(r) integer, intent(in) :: a(:), b(:) integer :: i r = .true. do i = 1, size(a) r = r .and. (a(i) .eq. b(i)) end do end function end lfortran-lfortran-2f73434/integration_tests/allocate_16.f900000664000175000017500000000060215141516316024010 0ustar alastairalastairprogram allocate_16 implicit none integer :: i, s s = 0 call prg(10, 10, 10, s) print *, s if( s /= 200000000 ) error stop contains subroutine prg(d1, d2, d3, s) integer, intent(in) :: d1, d2, d3 integer, intent(out) :: s integer, allocatable :: d(:, :, :) s = 0 do i = 1, 200000 allocate(d(d1, d2, d3)) s = s + size(d) deallocate(d) end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops10.f900000664000175000017500000000044515141516316025405 0ustar alastairalastairprogram implied_do_loop10 implicit none integer :: i type :: col integer :: rgb(3) end type col type(col) :: colours data (colours%rgb(i), i=1, 3) /1, 2, 3/ print *, "colours%rgb : ", colours%rgb if (any(colours%rgb /= [1, 2, 3])) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_23a.f900000664000175000017500000000237115141516316026572 0ustar alastairalastairmodule string_type_separate_compilation_23 implicit none private public :: string_type public :: operator(//) type :: string_type sequence private character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: concat_string_string end interface operator(//) contains elemental function concat_string_string(lhs, rhs) result(string) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_string_string end module string_type_separate_compilation_23 module ansi_separate_compilation_23 implicit none private public :: ansi_code public :: operator(//) type :: ansi_code private integer(1) :: style = -1 integer(1) :: bg = -1 integer(1) :: fg = -1 end type ansi_code interface operator(//) pure module function concat_left(lval, code) result(str) character(len=*), intent(in) :: lval type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function concat_left end interface operator(//) end module ansi_separate_compilation_23lfortran-lfortran-2f73434/integration_tests/test_ieee_copy_sign.f900000664000175000017500000000466615141516316025754 0ustar alastairalastair! Test ieee_copy_sign function program test_ieee_copy_sign use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, y_sp, r_sp real(real64) :: x_dp, y_dp, r_dp print *, "Testing ieee_copy_sign..." ! Test 1: Positive magnitude, positive sign x_sp = 5.0_real32 y_sp = 3.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(5.0, 3.0) = ", r_sp if (r_sp /= 5.0_real32) error stop "Should be positive 5.0" ! Test 2: Positive magnitude, negative sign x_sp = 5.0_real32 y_sp = -3.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(5.0, -3.0) = ", r_sp if (r_sp /= -5.0_real32) error stop "Should be negative 5.0" ! Test 3: Negative magnitude, positive sign x_sp = -7.0_real32 y_sp = 2.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(-7.0, 2.0) = ", r_sp if (r_sp /= 7.0_real32) error stop "Should be positive 7.0" ! Test 4: Negative magnitude, negative sign x_sp = -7.0_real32 y_sp = -2.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(-7.0, -2.0) = ", r_sp if (r_sp /= -7.0_real32) error stop "Should be negative 7.0" ! Test 5: Zero magnitude, positive sign x_sp = 0.0_real32 y_sp = 1.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(0.0, 1.0) = ", r_sp if (.not. (r_sp == 0.0_real32 .and. .not. ieee_is_negative(r_sp))) then error stop "Should be positive zero" end if ! Test 6: Zero magnitude, negative sign x_sp = 0.0_real32 y_sp = -1.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(0.0, -1.0) = ", r_sp if (.not. (r_sp == 0.0_real32 .and. ieee_is_negative(r_sp))) then error stop "Should be negative zero" end if ! Test 7: Double precision x_dp = 12.5_real64 y_dp = -8.0_real64 r_dp = ieee_copy_sign(x_dp, y_dp) print *, "ieee_copy_sign(12.5d0, -8.0d0) = ", r_dp if (r_dp /= -12.5_real64) error stop "Should be -12.5d0" ! Test 8: Copy sign from negative zero x_sp = 4.0_real32 y_sp = -0.0_real32 r_sp = ieee_copy_sign(x_sp, y_sp) print *, "ieee_copy_sign(4.0, -0.0) = ", r_sp if (r_sp /= -4.0_real32) error stop "Should be -4.0" print *, "All ieee_copy_sign tests passed!" end program test_ieee_copy_sign lfortran-lfortran-2f73434/integration_tests/intrinsics_377.f900000664000175000017500000000075415141516316024513 0ustar alastairalastairprogram intrinsics_377 implicit none integer, allocatable :: a(:) integer :: idx, n n = 50 allocate(a(n)) a = -1 a(2:) = 1 idx = minval(a, dim=1) print *, idx if ( idx /= -1 ) error stop idx = minval(a, dim=1, mask=a>0) print *, idx if ( idx /= 1 ) error stop idx = maxval(a, dim=1) print *, idx if ( idx /= 1 ) error stop idx = maxval(a, dim=1, mask=a>0) print *, idx if ( idx /= 1 ) error stop end program lfortran-lfortran-2f73434/integration_tests/namelist_01.f900000664000175000017500000000015415141516316024034 0ustar alastairalastairprogram namelist1 implicit none integer :: N real :: t, x, Ecut namelist /domain/ N, t, x, Ecut end program lfortran-lfortran-2f73434/integration_tests/complex_32.f900000664000175000017500000000056315141516316023677 0ustar alastairalastairprogram complex_32 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none integer :: i real(dp) :: sum complex(dp) :: z sum = 0.0_dp z = cmplx(1.0_dp, 2.0_dp, kind=dp) do i = 1, 500000 sum = sum + real(z) + aimag(z) z = cmplx(1.0_dp, 2.0_dp, kind=dp) end do print *, int(sum) end program complex_32 lfortran-lfortran-2f73434/integration_tests/modules_61.f900000664000175000017500000000072715141516316023704 0ustar alastairalastairmodule modules_61_mod1 integer :: inn = 10 end module module modules_61_mod2 integer :: inn = 91 end module module modules_61_mod3 contains subroutine foo use modules_61_mod2 print *, inn if (inn /= 91) error stop inn = 1000 print *, inn end subroutine subroutine foo2 use modules_61_mod1 print *, inn if(inn /= 10) error stop end subroutine end module program modules_61 use modules_61_mod3 call foo call foo2 end program modules_61 lfortran-lfortran-2f73434/integration_tests/abs_02.f900000664000175000017500000000030015141516316022757 0ustar alastairalastairprogram abs_02 use iso_fortran_env, only: dp=>real64 implicit none real(dp) :: x x = abs(1.5_dp) print *, x if (x < 0) error stop x = abs(-1.5_dp) print *, x if (x < 0) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_14.f900000664000175000017500000000036615141516316023700 0ustar alastairalastairSUBROUTINE CPDSA() DOUBLE PRECISION PD COMPLEX C PD = 1.0D0 C = DCMPLX(PD, 0.0D0) PRINT *, C if (REAL(C) /= 1.0D0) ERROR STOP if (AIMAG(C) /= 0.0D0) ERROR STOP END SUBROUTINE program main call CPDSA() end program lfortran-lfortran-2f73434/integration_tests/arrays_81.f900000664000175000017500000000172115141516316023532 0ustar alastairalastairmodule arrays81sub1 implicit none contains subroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) real :: simi_jdrop(size(simi, 2)) simi = outprod(matprod21(simi, d), simi_jdrop) contains function outprod(x, y) result(z) implicit none real, intent(in) :: x(:) real, intent(in) :: y(:) real :: z(size(x), size(y)) real :: sum_x_y sum_x_y = sum(x) + sum(y) z = sum_x_y end function outprod function matprod21(x, y) result(z_) implicit none real, intent(in) :: x(:, :) real, intent(in) :: y(:) real, allocatable :: z_(:) allocate(z_(size(x, 1))) z_ = matmul(x, y) end function matprod21 end subroutine end module program arrays_81 use arrays81sub1 real :: simi1(10, 5) real :: d(5) simi1 = 5.0 d = 2.0 call sub(simi1, d) print *, simi1 if( any(abs(simi1 - 500.0) > 1e-8 ) ) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_09.f900000664000175000017500000000041415141516316026061 0ustar alastairalastairmodule implicit_interface_09_module contains function f() implicit integer (f) f = 1 end function f end program main use implicit_interface_09_module integer :: j j = f() if (j /= 1) error stop print *, j end program main lfortran-lfortran-2f73434/integration_tests/complex_31.f900000664000175000017500000000157215141516316023677 0ustar alastairalastairprogram complex_31 use, intrinsic :: iso_fortran_env, only: dp => real64 use, intrinsic :: ieee_arithmetic, only: ieee_is_nan implicit none complex(dp) :: a, b, c real(dp) :: tol tol = 1.0d-12 a = cmplx(1.0d200, 1.0d200, kind=dp) b = cmplx(1.0d200, 1.0d200, kind=dp) c = a / b if (ieee_is_nan(real(c)) .or. ieee_is_nan(aimag(c))) & error stop "nan in div case 1" if (abs(real(c) - 1.0d0) > tol) error stop "div case 1 real" if (abs(aimag(c)) > tol) error stop "div case 1 imag" a = cmplx(1.0d-200, 1.0d200, kind=dp) b = cmplx(1.0d-200, 1.0d200, kind=dp) c = a / b if (ieee_is_nan(real(c)) .or. ieee_is_nan(aimag(c))) & error stop "nan in div case 2" if (abs(real(c) - 1.0d0) > tol) error stop "div case 2 real" if (abs(aimag(c)) > tol) error stop "div case 2 imag" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/const_kind_02.f900000664000175000017500000000035315141516316024355 0ustar alastairalastairprogram const_kind_02 integer, parameter :: int32 = 4, int64 = 8 integer(int32), parameter :: i1 = 1_int32 integer(int64), parameter :: i2 = 1_int64 integer :: i3 i3 = 1_int32 i3 = 1_int64 print *, int32, int64, i1, i2, i3 end program lfortran-lfortran-2f73434/integration_tests/derived_types_58.f900000664000175000017500000000044515141516316025105 0ustar alastairalastairmodule derived_types_58_m type :: enum_stat integer :: success = 0 end type enum_stat type(enum_stat), parameter :: toml_stat = enum_stat() end module program derived_types_58 use derived_types_58_m, only: toml_stat if (toml_stat%success /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/file_22.f900000664000175000017500000000025115141516316023140 0ustar alastairalastairprogram file_22 integer :: filesize inquire(file="file_22_data.txt", size=filesize) print *, filesize if (filesize /= 13) error stop end program file_22lfortran-lfortran-2f73434/integration_tests/intrinsics_208.f900000664000175000017500000000177415141516316024507 0ustar alastairalastairprogram intrinsics_208 use iso_fortran_env, only: sp=>real32, dp=>real64 integer :: i = 123 integer(8) :: j = 1234567 integer :: size integer :: arr1(3) = [11, 121, 1234] integer, parameter :: i1 = bit_size(11) integer(8), parameter :: i2 = bit_size(11) integer, parameter :: ar1 = bit_size([1,2,3]) integer(8), parameter :: ar2 = bit_size([1,2,3]) print *, i1 if( i1 /= 32 ) error stop print *, i2 if( i2 /= 32 ) error stop print *, ar1 if( ar1 /= 32 ) error stop print *, ar2 if( ar2 /= 32 ) error stop print*, bit_size(1) if (bit_size(1) /= 32) error stop print*, bit_size(1_dp) if (bit_size(1_dp) /= 64) error stop size = bit_size(i) print *, size if( size /= 32 ) error stop print*, bit_size(j) if( bit_size(j) /= 64 ) error stop print *, bit_size(arr1) if( bit_size(arr1) /= 32 ) error stop print *, kind(bit_size(1_8)) if( kind(bit_size(1_8)) /= 8 ) error stop end programlfortran-lfortran-2f73434/integration_tests/format_30.f900000664000175000017500000000140515141516316023512 0ustar alastairalastairprogram format_30 print "(2E13.3)", 1.0, 2.0 print "(2ES13.3)", epsilon(1e0), epsilon(3e0) print "(3F10.4)", 1.2345, 2.3456, 3.4567 print "(2EN12.3)", 123.0, 456.0 print "(2ES13.3)", epsilon(1e0), epsilon(3e0) print "(2E13.3E2)", epsilon(1e0),epsilon(1d0) write(*,"(ES0.0E0)") 1.23456789E+10 print "(ES0.15)", 1/3.0d-200 print "(SP,E60.50)", 1.23456789101112e-62_8 write(*,"(ES0.0E0)") 0.0 write(*,"(ES0.0E0)") 10.0 write(*,"(ES0.0E0)") 3.14159 write(*,"(ES0.0E0)") 3.14159E+05 ! print "(E67.62)", 1.23456789101112e-62_8 print "(ES0.15)", 3.0d-100 print "(ES0.0)", 1.0 print "(ES300.0)", 1.0 print "(ES0.8)", tiny(1.0_8) print "(ES0.8)", huge(1.0_8) print "(E14.7)", 0.0 end program format_30 lfortran-lfortran-2f73434/integration_tests/allocated_04.f900000664000175000017500000000062615141516316024157 0ustar alastairalastairmodule mm type t integer,allocatable :: arr(:) end type type(t) :: instance_arr(39) end module program allocated_04 use mm print *, allocated(instance_arr(1)%arr) if (allocated(instance_arr(1)%arr)) error stop allocate(instance_arr(1)%arr(10)) print*, allocated(instance_arr(1)%arr) if (.not. allocated(instance_arr(1)%arr)) error stop end program allocated_04lfortran-lfortran-2f73434/integration_tests/intrinsics_35.f900000664000175000017500000000045215141516316024415 0ustar alastairalastairprogram intrinsics_35 logical l l = any((/.true., .true., .true./)) print *, l call section() contains subroutine section() integer :: a(2, 3), b(2, 3) a = 1 b = 1 b(2, 2) = 2 print *, any(a == b, 1) print *, any(a == b, 2) end subroutine section end program intrinsics_35lfortran-lfortran-2f73434/integration_tests/arrays_10_size.f900000664000175000017500000000157715141516316024565 0ustar alastairalastairmodule mod_ext_arrays_10_size real :: ext_var = 0.0 end module module mod_arrays_10_size contains subroutine OBJ(x) real, intent(inout) :: x(:) end subroutine subroutine sub(calfun, yy, xx) use mod_ext_arrays_10_size, only: ext_var procedure(OBJ) :: calfun integer, intent(in) :: yy real, intent(in) :: xx(:) real :: buggy(2*count(xx > 0.0)) real :: buggy2(2*count(xx > ext_var)) real :: buggy3(2*count(xx > -ext_var)) print * , size(buggy) if (size(buggy) /= 6) error stop print * , size(buggy2) if (size(buggy2) /= 4) error stop print * , size(buggy3) if (size(buggy3) /= 8) error stop end subroutine sub end module mod_arrays_10_size program arrays_10_size use mod_arrays_10_size use mod_ext_arrays_10_size real :: xx(5) = [1.1, 2.1, -1.3, 3.4, 0.0] ext_var = 1.1 call sub(OBJ ,2, xx) end program arrays_10_size lfortran-lfortran-2f73434/integration_tests/template_add_01.f900000664000175000017500000000265115141516316024647 0ustar alastairalastairmodule template_add_01_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop instantiate add_t(integer, func_arg_int), only: add_integer => add_generic a = 5 b = 9 print*, "The result is ", add_integer(a, b) if (add_integer(a, b) /= 14) error stop end subroutine end module program template_add_01 use template_add_01_m implicit none call test_template() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_04s.f900000664000175000017500000000026315141516316024574 0ustar alastairalastairprogram intrinsics_04s complex :: z z = (1.5, 0.1) z = tan(z) print *, z if (abs(real(z) - 4.69238520) > 1e-5) error stop !if (abs(aimag(z) - 6.69462872) > 1e-5) error stop end lfortran-lfortran-2f73434/integration_tests/call_subroutine_without_type_01.f900000664000175000017500000000134215141516316030236 0ustar alastairalastairmodule module_call_subroutine_without_type_01 type :: myType real :: r contains procedure, pass(self) :: get_i end type myType contains subroutine get_i(self) class(myType), intent(inout) :: self call get_r() contains subroutine get_r() print *, "r = ", self % r if (self%r /= 1.0) error stop end subroutine get_r end subroutine get_i end module module_call_subroutine_without_type_01 program call_subroutine_without_type_01 use module_call_subroutine_without_type_01 class(myType), allocatable :: obj allocate(obj) obj%r = 1.0 call obj%get_i() end program call_subroutine_without_type_01 lfortran-lfortran-2f73434/integration_tests/class_68.f900000664000175000017500000000164115141516316023344 0ustar alastairalastairmodule class_68_mod implicit none type, abstract :: toml_lexer contains procedure(func_interface), deferred :: f ! deferred binding end type toml_lexer abstract interface subroutine func_interface(self) import :: toml_lexer class(toml_lexer), intent(inout) :: self end subroutine func_interface end interface end module module class_68_mod2 use class_68_mod type, extends(toml_lexer) :: mocked_lexer integer :: key contains procedure :: f => f_mock end type contains subroutine f_mock(self) class(mocked_lexer), intent(inout) :: self print *, "Mock function called" self%key = 100 end subroutine f_mock subroutine temp(lex) class(toml_lexer), intent(inout) :: lex call lex%f() end subroutine end module program class_68 use class_68_mod2 type(mocked_lexer) :: x call temp(x) if (x%key /= 100) error stop end program lfortran-lfortran-2f73434/integration_tests/declaration_05.f900000664000175000017500000000110315141516316024504 0ustar alastairalastair! Test labels on type declaration statements (Fortran 90+ allows labels on declarations) program label_on_declaration_01 implicit none 10 integer :: i 20 real :: x 30 character(len=10) :: str 40 logical :: flag 50 real, dimension(5) :: arr i = 42 x = 3.14 str = "test" flag = .true. arr = [1.0, 2.0, 3.0, 4.0, 5.0] if (i /= 42) error stop if (abs(x - 3.14) > 1e-6) error stop if (str /= "test") error stop if (.not. flag) error stop if (abs(arr(3) - 3.0) > 1e-6) error stop end program label_on_declaration_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_334.f900000664000175000017500000000355015141516316024501 0ustar alastairalastairprogram intrinsics_334 implicit none type, abstract :: base integer :: id end type type, extends(base) :: toml_value integer :: x = 0 end type toml_value integer :: i integer, allocatable :: from(:), to(:) type(toml_value), allocatable :: struct_from, struct_to type(toml_value), allocatable :: struct_from2(:), struct_to2(:) class(toml_value), allocatable :: struct_from3 class(base), allocatable :: struct_to3 allocate(from(5)) from = [1, 2, 3, 4, 5] allocate(to(5)) call move_alloc(from, to) print *, to if(any(to /= [1,2,3,4,5])) error stop print *, allocated(from) if(allocated(from) .neqv. .false.) error stop allocate(struct_from) struct_from%x = 42 call move_alloc(struct_from, struct_to) if (allocated(struct_to)) then if (struct_to%x /= 42) error stop else error stop end if if (allocated(struct_from)) error stop allocate(struct_from2(3)) do i = 1, 3 struct_from2(i)%x = i * 10 end do call move_alloc(struct_from2, struct_to2) if (allocated(struct_from2)) error stop if (allocated(struct_to2)) then do i = 1, size(struct_to2) if (struct_to2(i)%x /= i * 10) error stop end do else error stop end if allocate(toml_value :: struct_from3) struct_from3%x = 123 call move_alloc(struct_from3, struct_to3) if (allocated(struct_from3)) error stop select type(struct_to3) type is (toml_value) if (struct_to3%x /= 123) error stop end select allocate(struct_from) struct_from%x = 42 call move_alloc(struct_from, struct_to3) if (allocated(struct_from)) error stop select type(struct_to3) type is (toml_value) if (struct_to3%x /= 42) error stop class default error stop end select end program lfortran-lfortran-2f73434/integration_tests/intrinsics_332.f900000664000175000017500000000044515141516316024477 0ustar alastairalastairprogram intrinsics_332 real, allocatable :: x(:, :), x1(:, :) real :: y allocate(x(4, 2), x1(4, 2)) x(:, 1) = -3.0 x(:, 2) = 4.0 y = maxval([sum(abs(x), 2), 0.0_4]) print *, y if( y /= 7.0 ) error stop y = maxval([sum(abs(x), 1), 0.0_4]) print *, y if( y /= 16.0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_07.f900000664000175000017500000000035715141516316026065 0ustar alastairalastairmodule implicit_interface_07_module contains function f() f = 1 end function f end program main use implicit_interface_07_module integer :: j j = f() if (j /= 1) error stop print *, j end program main lfortran-lfortran-2f73434/integration_tests/stop_01.f900000664000175000017500000000025115141516316023203 0ustar alastairalastairprogram stop_01 implicit none integer :: x x = 5 print *, x x = x + 2 print *, x stop x = x + 2 print *, x end program lfortran-lfortran-2f73434/integration_tests/template_travel_02.f900000664000175000017500000000545515141516316025422 0ustar alastairalastairmodule template_travel_02_math implicit none private public :: add_real, slash_real contains pure function add_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x + y end function pure function slash_real(x, y) result(total) real, intent(in) :: x, y real :: total total = x / y end function end module module template_travel_02_travel use template_travel_02_math implicit none private public :: travel_tmpl requirement operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) type, deferred :: D type, deferred :: T type, deferred :: S pure function plus_D(l, r) result(total) type(D), intent(in) :: l, R type(D) :: total end function pure function plus_T(l, r) result(total) type(T), intent(in) :: l, R type(T) :: total end function pure function D_divided_by_T(n, d) result(quotient) type(D), intent(in) :: n type(T), intent(in) :: d type(S) :: quotient end function pure function D_divided_by_S(n, d) result(quotient) type(D), intent(in) :: n type(S), intent(in) :: d type(T) :: quotient end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operations(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) private public :: avg_S_from_T contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template template travel_tmpl2(T, plus, div) require :: operations(T, T, T, plus, plus, div, div) instantiate travel_tmpl(T, T, T, plus, plus, div, div) end template end module module template_travel_02_m use template_travel_02_math use template_travel_02_travel implicit none contains subroutine test_template() instantiate travel_tmpl2(real, add_real, slash_real), & only: avg_real_S_from_S => avg_S_from_S real :: s s = avg_real_S_from_S(1.1, 0.5, 2.0, 0.75) print *, "s=", s end subroutine end module program template_travel_02 use template_travel_02_m implicit none call test_template() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_91.f900000664000175000017500000000450215141516316024417 0ustar alastairalastairprogram intrinsics_91 character(3) :: abc = "abc" character(8) :: elephant = "elephant" character(6) :: potato = "potato" character(1) :: b = "b" character(5) :: an = "@a!n#" character(1) :: t = "t" character(2) :: ta = "ta" integer, parameter :: i1 = index("abc", "b") integer, parameter :: i2 = index("elephant", "@a!n#") integer, parameter :: i3 = index("potato", "t", back=.true.) integer, parameter :: i4 = index("potato", "t", back=.false.) integer, parameter :: i5 = index("potato", "ta", back=.true.) integer, parameter :: ar1(3) = index(["abc", "ele", "pot"], "b") integer, parameter :: ar2(3) = index(["elephant", "gfortran", "lfortran"], "@a!n#") character(3) :: arr1(3) character(8) :: arr2(3) integer :: res(3) print*, i1 if ( i1 /= 2 ) error stop print*, i2 if ( i2 /= 0 ) error stop print*, i3 if ( i3 /= 5 ) error stop print*, i4 if ( i4 /= 3 ) error stop print*, i5 if ( i5 /= 3 ) error stop print*, ar1 if ( any(ar1 /= [2, 0, 0]) ) error stop print*, ar2 if ( any(ar2 /= [0, 0, 0]) ) error stop print*, index("abc", "b") if ( index("abc", "b") /= 2 ) error stop print*, index("elephant", "@a!n#") if ( index("elephant", "@a!n#") /= 0 ) error stop print*, index("potato", "t", back=.true.) if ( index("potato", "t", back=.true.) /= 5 ) error stop print*, index("potato", "t", back=.false.) if ( index("potato", "t", back=.false.) /= 3 ) error stop print*, index("potato", "ta", back=.true.) if ( index("potato", "ta", back=.true.) /= 3 ) error stop print*, index(abc, b) if ( index(abc, b) /= 2 ) error stop print*, index(elephant, an) if ( index(elephant, an) /= 0 ) error stop print*, index(potato, t, back=.true.) if ( index(potato, t, back=.true.) /= 5 ) error stop print*, index(potato, t, back=.false.) if ( index(potato, t, back=.false.) /= 3 ) error stop print*, index(potato, ta, back=.true.) if ( index(potato, ta, back=.true.) /= 3 ) error stop arr1 = ["abc", "ele", "pot"] arr2 = ["elephant", "gfortran", "lfortran"] res = index(arr1, b) print*, res if ( any(res /= [2, 0, 0]) ) error stop res = index(arr2, an, back = .true.) print*, res if ( any(res /= [0, 0, 0]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/dabs_01.f900000664000175000017500000000062015141516316023127 0ustar alastairalastairsubroutine e1z(z) implicit complex*16 (c,z) implicit double precision (a,d-h,o-y) if (abs(dabs(dimag(z))) > 1d-10) error stop if (abs(dabs(0.0d0)) > 1d-10) error stop print *, "dimag(z) =", dimag(z) print *, "dabs(dimag(z)) =", dabs(dimag(z)) print *, "dabs(0.0) = ", dabs(0.0d0) return end program dabs_01 complex*16 z z = (-1.0d0, -0.0d0) call e1z(z) end program lfortran-lfortran-2f73434/integration_tests/modules_47.f900000664000175000017500000000256215141516316023707 0ustar alastairalastairmodule modules_47_tomlf_datetime implicit none public :: toml_time type :: toml_time integer :: hour = 0 integer :: minute = 0 integer :: second = 0 integer, allocatable :: millisec character(len=:), allocatable :: zone end type contains subroutine time_to_string(lhs, rhs) character(len=:), allocatable, intent(out) :: lhs class(toml_time), intent(in) :: rhs if (allocated(rhs%millisec)) then allocate(character(len=12) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2,".",i3.3)') & & rhs%hour, rhs%minute, rhs%second, rhs%millisec else allocate(character(len=8) :: lhs) write(lhs, '(i2.2,":",i2.2,":",i2.2)') & & rhs%hour, rhs%minute, rhs%second end if if (allocated(rhs%zone)) lhs = lhs // trim(rhs%zone) end subroutine time_to_string end module modules_47_tomlf_datetime program modules_47 use modules_47_tomlf_datetime implicit none character(len=:), allocatable :: lhs type(toml_time) :: rhs if( allocated(rhs%millisec) ) error stop allocate(rhs%millisec) rhs%millisec = 100 print *, rhs%millisec, allocated(rhs%millisec) if( rhs%hour /= 0 ) error stop if( rhs%minute /= 0 ) error stop if( rhs%second /= 0 ) error stop if( rhs%millisec /= 100 ) error stop call time_to_string(lhs, rhs) print *, lhs if( .not. allocated(lhs) ) error stop end program lfortran-lfortran-2f73434/integration_tests/automatic_allocation_03.f900000664000175000017500000000025715141516316026421 0ustar alastairalastairprogram automatic_allocation_03 implicit none integer, allocatable :: i i = 4 i = abs(i - 4); if (i /= 0) error stop end program automatic_allocation_03 lfortran-lfortran-2f73434/integration_tests/warning_logicalstar.f900000664000175000017500000000007215141516316025750 0ustar alastairalastairprogram warning_logicalstar logical*4 :: x end programlfortran-lfortran-2f73434/integration_tests/arrays_82.f900000664000175000017500000000265615141516316023543 0ustar alastairalastairsubroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) real :: simi_jdrop(size(simi, 2)) simi_jdrop = 11.0 simi_jdrop = matprod(simi, d) print *, "simi_jdrop = ", simi_jdrop if( any( abs(simi_jdrop - 468.00) > 1e-8 ) ) error stop if( size(simi_jdrop) /= 3 ) error stop simi = outprod(matprod(simi, d), simi_jdrop) contains function outprod(x, y) result(z) implicit none real, intent(in) :: x(:) real, intent(in) :: y(:) real :: z(size(x), size(y)) integer :: j z = 0.0 do j = 1, size(y) z = z + x(j) * y(j) end do end function outprod function matprod(x, y) result(z_) implicit none real, intent(in) :: x(:, :) real, intent(in) :: y(:) real, allocatable :: z_(:) integer :: i, j allocate(z_(size(x, 2))) do i = 1, size(x, 2) z_(i) = 0.0 do j = 1, size(y) z_(i) = z_(i) + x(i, j) * y(j) end do end do end function matprod end subroutine program arrays_82 real :: simi(3, 3) real :: d(3) interface subroutine sub(simi, d) real, intent(inout) :: simi(:, :) real, intent(in) :: d(:) end subroutine sub end interface simi = 12.0 d = 13.0 call sub(simi, d) print *, simi if( any(abs(simi - 657072) > 1e-8) ) error stop if( size(simi) /= 9 ) error stop end program lfortran-lfortran-2f73434/integration_tests/subroutines_16.f900000664000175000017500000000145315141516316024613 0ustar alastairalastairmodule recursive_mod_subroutines_16 contains subroutine recursive_fun1(x, f) implicit none real(8), intent(in) :: x(:) real(8), intent(out) :: f end subroutine recursive_fun1 end module recursive_mod_subroutines_16 module test_solver_mod_subroutines_16 contains subroutine test_solver() contains subroutine temp(rec) use recursive_mod_subroutines_16 procedure(recursive_fun1) :: rec end subroutine subroutine recursive_fun2() use, non_intrinsic :: recursive_mod_subroutines_16, only : recursive_fun1 call temp(recursive_fun1) end subroutine recursive_fun2 end subroutine test_solver end module test_solver_mod_subroutines_16 program subroutines_16 use test_solver_mod_subroutines_16 end program lfortran-lfortran-2f73434/integration_tests/arrays_intrin_03.f900000664000175000017500000000241615141516316025111 0ustar alastairalastairprogram arrays_intrin_03 integer :: i, j integer(8) :: x(3, 5), xmaxval, xmaxval1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = (/4_8, 5_8, 6_8, 7_8, 8_8/) correct2 = (/3_8, 5_8, 5_8, 7_8, 7_8/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xmaxval = maxval(x) print *, xmaxval if( xmaxval /= 8_8 ) error stop xmaxval = maxval(x, mask=modx) print *, xmaxval if( xmaxval /= 7_8 ) error stop xmaxval1 = maxval(x, 1) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct1(i) ) error stop end do xmaxval1 = maxval(x, 1, mask=modx) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct2(i) ) error stop end do xmaxval1 = maxval(x, dim=1) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct1(i) ) error stop end do xmaxval1 = maxval(x, dim=1, mask=modx) print *, xmaxval1 do i = lbound(xmaxval1, 1), ubound(xmaxval1, 1) if( xmaxval1(i) /= correct2(i) ) error stop end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_320.f900000664000175000017500000000311715141516316024473 0ustar alastairalastairprogram intrinsics_240 character(len=100) :: line1 = " Hello, World!" character(len=7) :: line2 = "Okay " character(5) :: line3 = " #o$ " character(1) :: line4 = " " integer, parameter :: l1 = len_trim(" Hello, World!") integer, parameter :: l2 = len_trim("Okay ") integer, parameter :: l3 = len_trim(" #o$ ") integer, parameter :: l4 = len_trim(" ") character(len = 3) :: arr1(3) = [" bc", "d f", "gh "] character :: arr2(3) = [" ", "y ", "o "] integer, parameter :: l5(3) = len_trim([" bc", "d f", "gh "]) integer, parameter :: l6(4) = len_trim([" ", "ok", "y ", "o "]) print*, l1 if (l1 /= 18 ) error stop print*, l2 if (l2 /= 4 ) error stop print*, l3 if (l3 /= 4 ) error stop print*, l4 if (l4 /= 0 ) error stop print*, len_trim(line1) if (len_trim(line1) /= 18 ) error stop print*, len_trim(line2) if (len_trim(line2) /= 4 ) error stop print*, len_trim(line3) if (len_trim(line3) /= 4 ) error stop print*, len_trim(line4) if (len_trim(line4) /= 0 ) error stop print*, l5 if (l5(1) /= 3 ) error stop if (l5(2) /= 3 ) error stop if (l5(3) /= 2 ) error stop print*, l6 if (l6(1) /= 0 ) error stop if (l6(2) /= 2 ) error stop if (l6(3) /= 1 ) error stop if (l6(4) /= 1 ) error stop print*, len_trim(arr1(1)) if (len_trim(arr1(1)) /= 3 ) error stop print*, len_trim(arr1(2)) if (len_trim(arr1(2)) /= 3 ) error stop print*, len_trim(arr1(3)) if (len_trim(arr1(3)) /= 2 ) error stop print*, len_trim(arr2(1)) if (len_trim(arr2(1)) /= 0 ) error stop print*, len_trim(arr2(2)) if (len_trim(arr2(2)) /= 1 ) error stop print*, len_trim(arr2(3)) if (len_trim(arr2(3)) /= 1 ) error stop end program lfortran-lfortran-2f73434/integration_tests/template_add_01c.f900000664000175000017500000000153415141516316025011 0ustar alastairalastairmodule template_add_01c_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine test_template() integer :: n instantiate add_t(integer, operator(+)) n = add_generic(5, 9) print*, "The result is", n end subroutine end module program template_add_01c use template_add_01c_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/read_26.f900000664000175000017500000000062315141516316023143 0ustar alastairalastairprogram read_26 implicit none character(8) :: string = 'abcd' integer :: unit open(newunit=unit, file='foobar_test', status='replace') write(unit, "(A)") string(1:4) rewind(unit) read(unit, "(A)") string(5:8) close(unit, status='delete') if (string /= 'abcdabcd') error stop 'Expected: abcdabcd, got: ' // string print "(A)", string end program read_26lfortran-lfortran-2f73434/integration_tests/arrays_op_12.f900000664000175000017500000000072515141516316024225 0ustar alastairalastairprogram main implicit none real :: z(2) z = 0.0 print *, z z = solution(z) print *, z if (z(1) /= 1.0) error stop if (z(2) /= 2.0) error stop contains function solution(y) result(x) real, dimension(:), intent(in) :: y real, dimension(:), allocatable :: x x = [1.0, 2.0] print *, y if (y(1) /= 0.0) error stop if (y(2) /= 0.0) error stop end function solution end program main lfortran-lfortran-2f73434/integration_tests/class_95.f900000664000175000017500000000122215141516316023337 0ustar alastairalastairprogram class_95 implicit none character(len=5) :: arr(2) = ["hello", "world"] call driver(arr) contains subroutine driver(generic) class(*) :: generic(:) select type (generic) type is (character(len=*)) call get_fixedarray_fixed_length_c(generic) class default print *, "Unsupported type" end select end subroutine driver subroutine get_fixedarray_fixed_length_c(x) character(len=5), intent(in) :: x(2) if (x(1) /= "hello") error stop if (x(2) /= "world") error stop end subroutine get_fixedarray_fixed_length_c end program class_95 lfortran-lfortran-2f73434/integration_tests/operator_overloading_15.f900000664000175000017500000000216115141516316026451 0ustar alastairalastairmodule operator_overloading_15_mod type :: string_t character(len=:), allocatable :: str end type interface operator(==) module procedure string_array_equal module procedure string_equal end interface contains logical function string_array_equal(a, b) type(string_t), intent(in) :: a(:), b(:) integer :: i string_array_equal = .true. do i = 1, size(a) if (a(i)%str /= b(i)%str) then string_array_equal = .false. return end if end do end function logical function string_equal(a, b) type(string_t), intent(in) :: a, b integer :: i string_equal = (a%str == b%str) end function end module operator_overloading_15_mod program operator_overloading_15 use operator_overloading_15_mod type(string_t), allocatable, target :: a(:), b(:) type(string_t), pointer :: a2(:), b2(:) type(string_t), allocatable :: x, y allocate(a(1), b(1)) allocate(x, y) a(1)%str = "Hello" b(1)%str = "HelloWorld" x%str = "Hello" y%str = "HelloWorld" a2 => a b2 => b if (a == b) error stop if (x == y) error stop if (a2 == b2) error stop end programlfortran-lfortran-2f73434/integration_tests/file_47.f900000664000175000017500000000116615141516316023155 0ustar alastairalastairprogram daio_test implicit none ! Simple direct access I/O test with LOGICAL arrays integer :: daunit, dall integer :: i logical :: l(10), lanswer dall = -42 inquire (iolength=dall) l print *, 'logical record iolength =', dall open (newunit=daunit, file='xyzzy.dat', access='direct', form='unformatted', recl=dall) l = .true. do, i=1, 5 l = .not. l write (daunit, rec=i) l end do lanswer = .true. do, i=5, 1, -1 lanswer = .not. lanswer read (daunit, rec=i) l print *, 'record', i if (any(l .neqv. lanswer)) error stop end do close (daunit, status='delete') end programlfortran-lfortran-2f73434/integration_tests/derived_types_35.f900000664000175000017500000000176315141516316025104 0ustar alastairalastairmodule derived_types_35_my_mod type :: my_type sequence integer :: a end type interface read(formatted) module procedure :: read_formatted end interface contains subroutine read_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(inout) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg read(unit, *) mt%a end subroutine end module program derived_types_35 use derived_types_35_my_mod, only: my_type, read(formatted) implicit none type(my_type) :: x integer :: io, iostat character(len=20) :: iomsg x%a = 10 print *, x%a open(newunit=io, form="formatted", file="derived_types_35_file.txt") read(io, *, iostat=iostat, iomsg=iomsg) x close(io) print *, x%a if (x%a /= 125) error stop end program lfortran-lfortran-2f73434/integration_tests/warning_integerstar.f900000664000175000017500000000013315141516316025771 0ustar alastairalastairprogram warning_integerstar integer*4 a integer*8 b end program warning_integerstarlfortran-lfortran-2f73434/integration_tests/separate_compilation_24b.f900000664000175000017500000000037615141516316026577 0ustar alastairalastairsubmodule(sorting_separate_compilation_24) radix_sort_separate_compilation_24 implicit none contains module subroutine sort(n) integer, intent(inout) :: n n = 5 end subroutine end submodule radix_sort_separate_compilation_24lfortran-lfortran-2f73434/integration_tests/minpack_01.f900000664000175000017500000000012515141516316023640 0ustar alastairalastairprogram main use minpack_01, only: enorm1 print *, enorm1(1.0d0) end program lfortran-lfortran-2f73434/integration_tests/allocated_01.f900000664000175000017500000000022015141516316024142 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) print *, allocated(x) if (allocated(x)) error stop end program main lfortran-lfortran-2f73434/integration_tests/array_indices_array_section_assignment.f900000664000175000017500000000023015141516316031701 0ustar alastairalastairprogram test integer :: A(3) = [1,2,3] integer :: X(2) = [1,2] integer :: Y = 2 A(X(:)) = Y print *, A if( any(A /= [2, 2, 3]) ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_194.f900000664000175000017500000000156015141516316024504 0ustar alastairalastair!> the below test cases test the broadcasting of "min" intrinsic !> procedure during compile time program intrinsics_194 integer :: arr3(3), arr2(2) arr3 = min([-1, 2, 3], 2, 5, [4, 4, 5], [5, -8, 7]) if (arr3(1) /= -1) error stop if (arr3(2) /= -8) error stop if (arr3(3) /= 2) error stop ! not necessary to test the dimensions though ! as the initial assignment itself would raise an ! error if the assignment was incompatible if (size(arr3) /= 3) error stop arr3 = min(1, [-1, 2, 20]) if (arr3(1) /= -1) error stop if (arr3(2) /= 1) error stop if (arr3(3) /= 1) error stop arr3 = min([1, 2, 3], [1, 1, [2]]) if (arr3(1) /= 1) error stop if (arr3(2) /= 1) error stop if (arr3(3) /= 2) error stop arr2 = min([1, 2], -1, -4) if (arr2(1) /= -4) error stop if (arr2(2) /= -4) error stop end program lfortran-lfortran-2f73434/integration_tests/do_concurrent_09.f900000664000175000017500000000253115141516316025075 0ustar alastairalastair! equivalent to openmp_15.f90 subroutine initialize_array(n, a) use omp_lib implicit none integer, intent(in) :: n real, dimension(n), intent(out) :: a integer :: i do concurrent (i=1:n) a(i) = 12.91 end do print *, a(1), a(n) end subroutine subroutine parallel_sum(n, a, ctr) use omp_lib implicit none integer, intent(in) :: n, ctr real, dimension(n), intent(in) :: a integer :: i real :: sum sum = 0.0 do concurrent (i=1:n) reduce(+:sum) sum = sum + a(i) end do ! here we have precision error both with gfortran and lfortran ! setting different number of threads leads to different results ! but in any case output of gfortran and lfortran is the same print *, sum if ( ctr == 1 ) then if (abs(sum - 12933994.0) > 1e-7) error stop else ! if (abs(sum - 25867988.0) > 1e-7) error stop ! lfortran always gives 2.58679600e+07 end if end subroutine subroutine reduce_array(n, a, b) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: a real, dimension(n) :: b integer :: i do concurrent (i=2:n) b(i) = a(i) + a(i-1) end do b(1) = a(1) * 2 end subroutine program do_concurrent_09 use omp_lib integer, parameter :: n = 1000000 real, dimension(n) :: a, b call omp_set_num_threads(4) call initialize_array(n, a) print *, a(1), a(n) call parallel_sum(n, a, 1) call reduce_array(n, a, b) call parallel_sum(n, b, 0) end program lfortran-lfortran-2f73434/integration_tests/complex_26.f900000664000175000017500000000065615141516316023705 0ustar alastairalastair! Test: Complex literal assigned to Real PARAMETER ! LAPACK legacy pattern where REAL parameters use complex literal syntax program complex_26 implicit none real :: zero, one parameter (zero = (0.0E+0, 0.0E+0), one = (1.0E+0, 0.0E+0)) ! GFortran accepts this as an extension, extracting the real part if (abs(zero) > 1e-6) error stop if (abs(one - 1.0) > 1e-6) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_05.f900000664000175000017500000000036715141516316026064 0ustar alastairalastairmodule implicit_interface_05_module contains function f() f = 1 end function f end program main use implicit_interface_05_module real :: i i = f() if (abs(i - 1) > 1e-6) error stop print *, i end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_193.f900000664000175000017500000000232415141516316024502 0ustar alastairalastairprogram intrinsics_193 use iso_fortran_env, only: dp => real64 integer :: x, y, z integer(dp) :: a, b, c x = 44 y = -501 z = 0 a = 5468272828_dp b = -3526282829_dp c = 83983_dp print *, poppar(x) if(poppar(x) /= 1) error stop print *, poppar(44) if(poppar(44) /= 1) error stop print *, poppar(y) if(poppar(y) /= 0) error stop print *, poppar(-501) if(poppar(-501) /= 0) error stop print *, poppar(z) if(poppar(z) /= 0) error stop print *, poppar(0) if(poppar(0) /= 0) error stop print *, poppar(a) if(poppar(a) /= 1) error stop print *, poppar(5468272828_dp) if(poppar(5468272828_dp) /= 1) error stop print *, poppar(b) if(poppar(b) /= 0) error stop print *, poppar(-3526282829_dp) if(poppar(-3526282829_dp) /= 0) error stop print *, poppar(c) if(poppar(c) /= 1) error stop print *, poppar(83983_dp) if(poppar(83983_dp) /= 1) error stop print *, kind(poppar(-501)) if(kind(poppar(-501)) /= 4) error stop print *, kind(poppar(y)) if(kind(poppar(y)) /= 4) error stop print *, kind(poppar(5468272828_dp)) if(kind(poppar(5468272828_dp)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/dealloc_01.f900000664000175000017500000001355115141516316023630 0ustar alastairalastairmodule dealloc_01_testdrive use, intrinsic :: iso_fortran_env, only : error_unit implicit none private public :: run_testsuite, new_unittest, unittest_type, testsuite_type, & error_type, skip_test integer, parameter :: success = 0, fatal = 1, skipped = 77 type :: error_type integer :: stat = success character(len=:), allocatable :: message end type error_type abstract interface subroutine test_interface(error) import :: error_type type(error_type), allocatable, intent(out) :: error end subroutine test_interface end interface type :: unittest_type character(len=:), allocatable :: name procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type abstract interface subroutine collect_interface(testsuite) import :: unittest_type type(unittest_type), allocatable, intent(out) :: testsuite(:) end subroutine collect_interface end interface type :: testsuite_type character(len=:), allocatable :: name procedure(collect_interface), pointer, nopass :: collect => null() end type testsuite_type character(len=*), parameter :: fmt = '(1x, *(1x, a))' contains recursive subroutine run_testsuite(collect, unit, stat, parallel) procedure(collect_interface) :: collect integer, intent(in) :: unit integer, intent(inout) :: stat logical, intent(in), optional :: parallel type(unittest_type), allocatable :: testsuite(:) integer :: it logical :: parallel_ parallel_ = .true. if(present(parallel)) parallel_ = parallel call collect(testsuite) do it = 1, size(testsuite) write(unit, '(1x, 3(1x, a), 1x, "(", i0, "/", i0, ")")') & & "Starting", testsuite(it)%name, "...", it, size(testsuite) call run_unittest(testsuite(it), unit, stat) end do end subroutine run_testsuite recursive subroutine run_unittest(test_var, unit, stat) type(unittest_type), intent(in) :: test_var integer, intent(in) :: unit integer, intent(inout) :: stat type(error_type), allocatable :: error character(len=:), allocatable :: message call test_var%test(error) if (.not.test_skipped(error)) then if (allocated(error) .neqv. test_var%should_fail) stat = stat + 1 end if call make_output(message, test_var, error) write(unit, '(a)') message end subroutine run_unittest pure function test_skipped(error) result(is_skipped) type(error_type), intent(in), optional :: error logical :: is_skipped is_skipped = .false. if (present(error)) then is_skipped = error%stat == skipped end if end function test_skipped pure subroutine make_output(output, test, error) character(len=:), allocatable, intent(out) :: output type(unittest_type), intent(in) :: test type(error_type), intent(in), optional :: error character(len=:), allocatable :: label character(len=*), parameter :: indent = " " // "..." // " " if (test_skipped(error)) then output = indent // test%name // " [SKIPPED]" & & // new_line("a") // " Message: " // error%message return end if if (present(error) .neqv. test%should_fail) then if (test%should_fail) then label = " [UNEXPECTED PASS]" else label = " [FAILED]" end if else if (test%should_fail) then label = " [EXPECTED FAIL]" else label = " [PASSED]" end if end if output = indent // test%name // label if (present(error)) then output = output // new_line("a") // " Message: " // error%message end if end subroutine make_output function new_unittest(name, test, should_fail) result(self) character(len=*), intent(in) :: name procedure(test_interface) :: test logical, intent(in), optional :: should_fail type(unittest_type) :: self self%name = name self%test => test if (present(should_fail)) self%should_fail = should_fail end function new_unittest subroutine test_failed(error, message, more, and_more) type(error_type), allocatable, intent(out) :: error character(len=*), intent(in) :: message character(len=*), intent(in), optional :: more character(len=*), intent(in), optional :: and_more character(len=*), parameter :: skip = new_line("a") // " " allocate(error) error%stat = fatal error%message = message if (present(more)) then error%message = error%message // skip // more end if if (present(and_more)) then error%message = error%message // skip // and_more end if end subroutine test_failed subroutine skip_test(error, message, more, and_more) type(error_type), allocatable, intent(out) :: error character(len=*), intent(in) :: message character(len=*), intent(in), optional :: more character(len=*), intent(in), optional :: and_more call test_failed(error, message, more, and_more) error%stat = skipped end subroutine skip_test end module module dealloc_01_linalg use dealloc_01_testdrive, only : new_unittest, unittest_type, error_type, skip_test implicit none contains subroutine collect_linalg(testsuite) type(unittest_type), allocatable, intent(out) :: testsuite(:) testsuite = [ & new_unittest("diag_rqp", test_diag_rqp) & ] end subroutine collect_linalg subroutine test_diag_rqp(error) type(error_type), allocatable, intent(out) :: error call skip_test(error, "Quadruple precision is not enabled") end subroutine test_diag_rqp end module program dealloc_01 use, intrinsic :: iso_fortran_env, only : error_unit use dealloc_01_testdrive, only : run_testsuite, testsuite_type use dealloc_01_linalg, only : collect_linalg implicit none integer :: stat type(testsuite_type), allocatable :: testsuites(:) stat = 0 call run_testsuite(collect_linalg, error_unit, stat) print *, "stat: ", stat if (stat > 0) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_01.f900000664000175000017500000000054515141516316023522 0ustar alastairalastairsubroutine omp_func(n) implicit none integer, intent(in) :: n integer :: i !$omp parallel private(i) shared(n) !$omp do do i = 1, n print *, "xyz" end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 100) error stop end subroutine program openmp_01 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-lfortran-2f73434/integration_tests/array_indices_array_item.f900000664000175000017500000000362315141516316026754 0ustar alastairalastairprogram array_indices_array_item implicit none integer :: arr_idx(2) integer, allocatable :: arr_idx2(:) integer, allocatable :: arr(:, :) real :: arr_1(2, 2), arr_2(2), arr_3(2, 2, 2), arr_4(2, 2) real :: arr_2_reshape(2), arr_4_reshape(2, 2) integer :: rank_val ! Initialize the matrices and arrays arr_1 = reshape([1.0, 2.0, 3.0, 4.0], shape(arr_1)) arr_3 = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0], shape(arr_3)) arr_idx = [2, 1] allocate(arr_idx2(2)) arr_idx2 = [2, 1] !Slicing arr_2 = arr_1(arr_idx, 1) arr_2_reshape = reshape([2.0, 1.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 1) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(1, arr_idx, arr_idx) arr_4_reshape = reshape([3.0, 1.0, 3.0, 1.0], shape(arr_4_reshape)); if (rank(arr_4) /= 2) error stop if (any(arr_4 /= arr_4_reshape)) error stop rank_val = rank(arr_3(1, arr_idx, 2)) print *, rank_val if (rank_val /= 1) error stop rank_val = rank(arr_3(1, [2, 1], 2)) print *, rank_val if (rank_val /= 1) error stop arr_2 = arr_1(arr_idx2, 1) arr_2_reshape = reshape([2.0, 1.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 1) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(1, arr_idx2, arr_idx2) arr_4_reshape = reshape([3.0, 1.0, 3.0, 1.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 2) error stop if (any(arr_4 /= arr_4_reshape)) error stop rank_val = rank(arr_3(1, arr_idx2, 2)) print *, rank_val if (rank_val /= 1) error stop allocate(arr(2, 3)) arr = reshape([1, 2, 3, 4, 5, 6], shape(arr)) rank_val = rank(arr(arr_idx, 1)) print *, rank_val if (rank_val /= 1) error stop if (any(arr(arr_idx, 1) /= [2, 1])) error stop end program array_indices_array_item lfortran-lfortran-2f73434/integration_tests/write_01.f900000664000175000017500000000044115141516316023351 0ustar alastairalastairprogram main implicit none real :: x(2) call compare_solutions(x) contains subroutine compare_solutions(x) real,dimension(:),intent(in) :: x real:: diff(2) diff = [1.0, 2.0] write (*,*), diff end subroutine compare_solutions end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_349.f900000664000175000017500000000061715141516316024510 0ustar alastairalastairprogram intrinsics_349 integer :: A(2,2) = reshape([1,2,3,4],[2,2]) call temp(A) contains subroutine temp(A) integer, intent(inout) :: A(:,:) integer :: X(size(A,1)*size(A,2)) X = [1,2,3,4] print *, pack(X, [.true., .true., .true., .true.]) if (any(pack(X, [.true., .true., .true., .true.]) /= [1,2,3,4])) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/arrays_07.f900000664000175000017500000000313715141516316023533 0ustar alastairalastairprogram arrays_07 implicit none integer, dimension(10) :: x integer, dimension(3, 3) :: y integer :: i, j integer :: start, end, step do i = 1, 3 do j = 1, 3 y(i, j) = i + j end do end do x = [(i, i = 1, 10)] start = x(4) end = x(7) step = x(1) print *, x(start:end:step) if( sum(x(start:end:step)) /= 22 ) error stop ! TODO: Check with any print *, x if( any(x /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, x(1:5) if( any(x(1:5) /= [1, 2, 3, 4, 5]) ) error stop print *, x(3:) if( any(x(3:) /= [3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, x(:5) if( any(x(:5) /= [1, 2, 3, 4, 5]) ) error stop print *, x(5) if( x(5) /= 5 ) error stop print *, x(3:5:2) if( any(x(3:5:2) /= [3, 5]) ) error stop print *, x(:5:2) if( any(x(:5:2) /= [1, 3, 5]) ) error stop print *, x(3::2) if( any(x(3::2) /= [3, 5, 7, 9]) ) error stop print *, x(::2) if( any(x(::2) /= [1, 3, 5, 7, 9]) ) error stop print *, sum(y) if( sum(y) /= 36 ) error stop print *, sum(y(:, 3)) if( sum(y(:, 3)) /= 15 ) error stop print *, sum(y(2:, :)) if( sum(y(2:, :)) /= 27 ) error stop print *, sum(y(4:, 3:)) if( sum(y(4:, 3:)) /= 0 ) error stop print *, sum(y(:2, 2:)) if( sum(y(:2, 2:)) /= 16 ) error stop print *, sum(y(1:2:2, 1:2:1)) if( sum(y(1:2:2, 1:2:1)) /= 5 ) error stop print *, sum(y(:3:2, 3)) if( sum(y(:3:2, 3)) /= 10 ) error stop print *, sum(y(3, 3::2)) if( sum(y(3, 3::2)) /= 6 ) error stop print *, sum(y(3::2, :3:2)) if( sum(y(3::2, :3:2)) /= 10 ) error stop print *, sum(y(::2, ::4)) if( sum(y(::2, ::4)) /= 6 ) error stop print *, sum(y(::2, 3)) if( sum(y(::2, 3)) /= 10 ) error stop end program lfortran-lfortran-2f73434/integration_tests/class_39.f900000664000175000017500000000264515141516316023347 0ustar alastairalastairmodule class_39_mod type :: AbsNestedType contains procedure :: abs_nested_method end type AbsNestedType type, public :: AbsType class(AbsNestedType), allocatable :: nested_obj contains procedure :: abs_method end type AbsType type :: Wrapper class(AbsType), allocatable :: obj type(AbsType) :: t_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine caller(self) class(Client), intent(in) :: self type(Client) :: type_s call self%wrapped%obj%abs_method(42) call self%wrapped%obj%nested_obj%abs_nested_method(101) call type_s%wrapped%t_obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called" if (val /= 42) error stop end subroutine abs_method subroutine abs_nested_method(self, val) class(AbsNestedType), intent(in) :: self integer, intent(in) :: val print *, "abs_nested_method called" if (val /= 101) error stop end subroutine abs_nested_method end module class_39_mod program class_39 use class_39_mod class(Client), allocatable :: var allocate(var) allocate(var%wrapped%obj) allocate(var%wrapped%obj%nested_obj) call var%caller() end program class_39lfortran-lfortran-2f73434/integration_tests/intrinsics_248.f900000664000175000017500000000445315141516316024510 0ustar alastairalastairprogram intrinsics_248 integer, parameter :: a(4) = [10, 20, 30, 40] real, parameter :: b(4) = [10.0, 20.0, 30.0, 40.0] integer, parameter :: c(4) = [32, 92, 67, 89] real, parameter :: d(4) = [33.9, 91.2, 37.4, 19.1] integer :: shift = 2 integer :: boun = 99 real :: bound2 = 99.0 print*, eoshift([1, 2, 3, 4], 2, 10) if (any(eoshift([1, 2, 3, 4], 2, 10) /= [3, 4, 10, 10])) error stop print*, eoshift([1.0, 2.0, 3.0, 4.0], 3, 10.0) if (any(eoshift([1.0, 2.0, 3.0, 4.0], 3, 10.0) /= [4.0, 10.0, 10.0, 10.0])) error stop print*, eoshift(["ab", "cd", "de", "gt", "tg"], 0, "yx") if (any(eoshift(["ab", "cd", "de", "gt", "tg"], 0, "yx") /= ["ab", "cd", "de", "gt", "tg"])) error stop print*, eoshift([1, 2, 3, 4], 2) if (any(eoshift([1, 2, 3, 4], 2) /= [3, 4, 0, 0])) error stop print*, eoshift([1.0, 2.0, 3.0, 4.0], 3) if (any(eoshift([1.0, 2.0, 3.0, 4.0], 3) /= [4.0, 0.0, 0.0, 0.0])) error stop print*, eoshift(["ab", "cd"], 0) if (any(eoshift(["ab", "cd"], 0) /= ["ab", "cd"])) error stop print*, eoshift([57, 62, 73, 24], -2, 10) if (any(eoshift([57, 62, 73, 24], -2, 10) /= [10, 10, 57, 62])) error stop print*, eoshift([31.02, 43.1, 53.5, 41.1], -3, 10.0) if (any(eoshift([31.02, 43.1, 53.5, 41.1], -3, 10.0) /= [10.0, 10.0, 10.0, 31.02])) error stop print*, eoshift(["ab", "cd", "de", "gt", "tg"], 0, "yx") if (any(eoshift(["ab", "cd", "de", "gt", "tg"], 0, "yx") /= ["ab", "cd", "de", "gt", "tg"])) error stop print*, eoshift([1, 2, 3, 4], -2) if (any(eoshift([1, 2, 3, 4], -2) /= [0, 0, 1, 2])) error stop print*, eoshift([1.0, 2.0, 3.0, 4.0], -3) if (any(eoshift([1.0, 2.0, 3.0, 4.0], -3) /= [0.0, 0.0, 0.0, 1.0])) error stop print*, eoshift(["ab", "cd"], 0) if (any(eoshift(["ab", "cd"], 0) /= ["ab", "cd"])) error stop print *, eoshift(a, shift, boun) if (any(eoshift(a, shift, boun) /= [30, 40, 99, 99])) error stop print *, eoshift(b, shift, bound2) if (any(eoshift(b, shift, bound2) /= [30.0, 40.0, 99.0, 99.0])) error stop print *, eoshift(c, shift, boun) if (any(eoshift(c, shift, boun) /= [67, 89, 99, 99])) error stop print *, eoshift(d, shift, bound2) if (any(eoshift(d, shift, bound2) /= [37.4, 19.1, 99.0, 99.0])) error stop end program intrinsics_248lfortran-lfortran-2f73434/integration_tests/save_09.f900000664000175000017500000000074415141516316023173 0ustar alastairalastairsubroutine foo(ir, rr, lr) integer, intent(in) :: ir real, intent(in) :: rr logical, intent(in) :: lr integer, save :: ic = 1 real, save :: rc = 1 logical, save :: lc = .true. ic = ic + 1 rc = rc + 1 lc = .not. lc print *, 'FOO: ', ic, ir, rc, rr, lc, lr if (ic /= ir) error stop if (rc /= rr) error stop if (lc .neqv. lr) error stop end subroutine program save_09 integer i logical :: lr = .false. do i = 2, 4 call foo(i, real(i), lr) lr = .not. lr end do end program lfortran-lfortran-2f73434/integration_tests/file_open_03.f900000664000175000017500000000064215141516316024164 0ustar alastairalastairprogram open_stream_form use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y x = 123456 open(10, file="file_open_03_data.bin", access="stream") write(10) x close(10) open(10, file="file_open_03_data.bin", access="stream") read(10) y close(10) if (y /= x) then print *, "FAIL: expected", x, "got", y error stop 1 end if end program lfortran-lfortran-2f73434/integration_tests/derived_types_69.f900000664000175000017500000000115415141516316025105 0ustar alastairalastairmodule derived_types_69_m type, abstract :: AbsType end type AbsType integer, parameter :: a(2) = [5, 6] integer, parameter :: one = 1 type, extends(AbsType) :: MyType integer :: m1(2) = [one, one] integer :: m2(2) = a integer :: m3(2) = [integer :: 2, 3] end type MyType end module derived_types_69_m program derived_types_69 use derived_types_69_m class(MyType), allocatable :: obj obj = MyType() if (any(obj%m1 /= [1, 1])) error stop if (any(obj%m2 /= [5, 6])) error stop if (any(obj%m3 /= [2, 3])) error stop end program derived_types_69 lfortran-lfortran-2f73434/integration_tests/block_02.f900000664000175000017500000000050015141516316023306 0ustar alastairalastairPROGRAM Block_02 INTEGER :: A A = 10 1 loop: BLOCK INTEGER :: B A = A + 5 IF (A.EQ.15) GO TO 1 B = A / 2 CALL Square(B) END BLOCK loop END PROGRAM Block_02 SUBROUTINE Square(B) INTEGER :: B, Result Result = B * B PRINT *, Result END SUBROUTINE Square lfortran-lfortran-2f73434/integration_tests/derived_types_52.f900000664000175000017500000000174315141516316025101 0ustar alastairalastairmodule bit_type_52 implicit none type, abstract :: bitset_type integer :: flag contains procedure(from_string_abstract), deferred, pass(self) :: from_string end type bitset_type type, extends(bitset_type) :: bitset_large contains procedure, pass(self) :: from_string => from_string_large end type bitset_large type, extends(bitset_large) :: mytype end type mytype abstract interface subroutine from_string_abstract(self) import :: bitset_type class(bitset_type), intent(out) :: self end subroutine from_string_abstract end interface contains subroutine from_string_large(self) class(bitset_large), intent(out) :: self if (self%flag /= 1) error stop end subroutine from_string_large end module program derived_types_52 use bit_type_52 implicit none type(mytype) :: b b%flag = 1 call b%from_string() end program derived_types_52 lfortran-lfortran-2f73434/integration_tests/intrinsics_168.f900000664000175000017500000000307215141516316024505 0ustar alastairalastairprogram intrinsics_168 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ibclr(5, 8) integer, parameter :: i2 = ibclr(-1_8, 5) integer, parameter :: i3 = ibclr(-4, 2_8) integer(8), parameter :: i4 = ibclr(-2_8, 5_8) integer, parameter :: ar1(3) = ibclr([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ibclr([-1_8, -5_8, -10_8], [5, 8, 9]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 5) error stop print *, i2 if (i2 /= -33) error stop print *, i3 if (i3 /= -8) error stop print *, i4 if (i4 /= -34) error stop print*, ibclr(5, 8) if (ibclr(5, 8) /= 5) error stop print*, ibclr(-1, 5) if (ibclr(-1, 5) /= -33) error stop print*, ibclr(a1, a2) if (ibclr(a1, a2) /= 5) error stop print*, ibclr(a3, a1) if (ibclr(a3, a1) /= -33) error stop print*, ibclr(a2, a4) if (ibclr(a2, a4) /= 8) error stop print*, ibclr(a5, a6) if (ibclr(a5, a6) /= -134217730) error stop print *, ar1 if (any(ar1 /= [5, 8, 9])) error stop print *, ar2 if (any(ar2 /= [-33, -261, -522])) error stop print *, ibclr(arr1, arr1) if (any(ibclr(arr1, arr1) /= [5, 8, 9])) error stop print *, ibclr(arr2, arr1) if (any(ibclr(arr2, arr1) /= [-33, -261, -522])) error stop res = ibclr(arr1, arr3) print *, res if (any(res /= [5, 8, 9])) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_75.f900000664000175000017500000000101315141516316023527 0ustar alastairalastairprogram arrays_75 integer :: score(4) = [-1,1,3,2] print *, [score, 1] > 0 if (ALL(([score, 1] > 0) .NEQV. [.false., .true., .true., .true., .true.])) then error stop end if print *, 0 < [score, -1] if (ALL((0 < [score, -1]) .NEQV. [.false., .true., .true., .true., .false.])) then error stop end if print *, [score, 1] <= [score, -1] if (ALL(([score, 1] <= [score, -1]) .NEQV. [.true., .true., .true., .true., .false.])) then error stop end if end programlfortran-lfortran-2f73434/integration_tests/arrays_22.f900000664000175000017500000000067115141516316023530 0ustar alastairalastairprogram arrays_22 use iso_fortran_env, only: wp => real64 implicit none real(wp), dimension(3), parameter :: dpmpar = [epsilon(1.0_wp), & tiny(1.0_wp), & huge(1.0_wp)] real(wp), parameter :: epsmch = dpmpar(1) print *, epsmch if (abs(epsmch - epsilon(1.0_wp))/epsilon(1.0_wp) > 1e-15_wp) error stop end program lfortran-lfortran-2f73434/integration_tests/interface_12a.f900000664000175000017500000000132215141516316024321 0ustar alastairalastairmodule interface_12a_mod use interface_12b_mod interface get_value module procedure :: get_bool end interface contains subroutine get_bool(self, val) class(t), intent(in) :: self logical, intent(out) :: val if (self%value /= 0) then val = .true. else val = .false. end if end subroutine get_bool end module interface_12a_mod program interface_12a use interface_12a_mod implicit none type(t) :: get_type logical :: a real :: b get_type%value = 10 call get_value(get_type, a) call get_value(get_type, b) if (.not.(a)) error stop if (b /= 10.00) error stop end program interface_12a lfortran-lfortran-2f73434/integration_tests/common_19.f900000664000175000017500000000270215141516316023522 0ustar alastairalastair! Test: CHARACTER variables in COMMON blocks (F2018 8.10.3) ! Verifies that CHARACTER data persists across program units via storage association. ! Tests both same-layout access and different variable names for same storage. program common_19 implicit none character(len=8) :: str1 character(len=4) :: str2 integer :: icheck common/charblk/str1, str2, icheck str1 = "ABCDEFGH" str2 = "1234" icheck = 999 call sub_same_layout() call sub_diff_names() print *, "PASS: common_19" end program subroutine sub_same_layout() implicit none ! Same layout as main program character(len=8) :: s1 character(len=4) :: s2 integer :: ival common/charblk/s1, s2, ival ! Verify values match what was set in main if (s1 /= "ABCDEFGH") error stop "s1 should be ABCDEFGH" if (s2 /= "1234") error stop "s2 should be 1234" if (ival /= 999) error stop "ival should be 999" ! Modify values s1 = "XXXXXXXX" s2 = "YYYY" ival = 123 end subroutine subroutine sub_diff_names() implicit none ! Different variable names, same layout character(len=8) :: name1 character(len=4) :: name2 integer :: num common/charblk/name1, name2, num ! Verify modified values from sub_same_layout if (name1 /= "XXXXXXXX") error stop "name1 should be XXXXXXXX" if (name2 /= "YYYY") error stop "name2 should be YYYY" if (num /= 123) error stop "num should be 123" end subroutine lfortran-lfortran-2f73434/integration_tests/parameter_14.f900000664000175000017500000000016215141516316024203 0ustar alastairalastairprogram parameter_14 real :: x parameter ( x = 12.9E+0 ) print *, x if ( abs( x - 12.9 ) > 1e-8 ) error stop end lfortran-lfortran-2f73434/integration_tests/modules_18c.h0000664000175000017500000000421315141516316023674 0ustar alastairalastair#ifndef MODULES_18C #define MODULES_18C #include #include #if _WIN32 typedef _Fcomplex float_complex_t; typedef _Dcomplex double_complex_t; #else typedef float _Complex float_complex_t; typedef double _Complex double_complex_t; #endif int f_int_float(int *a, float *b); int f_int_double(int *a, double *b); int f_int_float_complex(int *a, float_complex_t *b); int f_int_double_complex(int *a, double_complex_t *b); int f_int_float_complex_value(int a, float_complex_t b); int f_int_double_complex_value(int a, double_complex_t b); float_complex_t f_float_complex_value_return(float_complex_t b); double_complex_t f_double_complex_value_return(double_complex_t b); int f_int_float_value(int a, float b); int f_int_double_value(int a, double b); int f_int_intarray(int n, int *b); float f_int_floatarray(int n, float *b); double f_int_doublearray(int n, double *b); float f_int_floatarray_star(int n, float *b); void sub_int_float(int *a, float *b, int *r); void sub_int_double(int *a, double *b, int *r); void sub_int_float_complex(int *a, float_complex_t *b, int *r); void sub_int_double_complex(int *a, double_complex_t *b, int *r); void sub_int_float_value(int a, float b, int *r); void sub_int_double_value(int a, double b, int *r); void sub_int_float_complex_value(int a, float_complex_t b, int *r); void sub_int_double_complex_value(int a, double_complex_t b, int *r); void sub_int_intarray(int n, int *b, int *r); void sub_int_floatarray(int n, float *b, float *r); void sub_int_doublearray(int n, double *b, double *r); int f_string(char *s); int32_t call_fortran_i32(int32_t i); int32_t call_fortran_i32_value(int32_t i); int64_t call_fortran_i64(int64_t i); int64_t call_fortran_i64_value(int64_t i); float call_fortran_f32(float i); float call_fortran_f32_value(float i); double call_fortran_f64(double i); double call_fortran_f64_value(double i); int32_t fortran_i32(int32_t *i); int32_t fortran_i32_value(int32_t i); int64_t fortran_i64(int64_t *i); int64_t fortran_i64_value(int64_t i); float fortran_f32(float *i); float fortran_f32_value(float i); double fortran_f64(double *i); double fortran_f64_value(double i); #endif // MODULES_18C lfortran-lfortran-2f73434/integration_tests/class_05.f900000664000175000017500000000323115141516316023330 0ustar alastairalastair! Source - Page 44 of https://personalpages.manchester.ac.uk/staff/david.d.apsley/lectures/fortran/fortranB.pdf module Defs implicit none private public point, point2d, point3d type, abstract :: point contains procedure(func), deferred :: radius end type point abstract interface real function func( this ) import point class(point) this end function func end interface type, extends(point) :: point2d real x, y contains procedure :: radius => r2d end type point2d type, extends(point2d) :: point3d real z contains procedure :: radius => r3d end type point3d contains real function r2d( this ) class(point2d) this r2d = sqrt( this%x ** 2 + this%y ** 2 ) end function r2d real function r3d( this ) class(point3d) this r3d = sqrt( this%x ** 2 + this%y ** 2 + this%z ** 2 ) end function r3d end module Defs program main use Defs implicit none class(point), pointer :: ptr type(point2d), target :: p2d = point2d( 3, 4 ) type(point3d), target :: p3d = point3d( 3, 4, 5 ) real :: result print *, p2d%x, p2d%y print *, p3d%x, p3d%y, p3d%z ptr => p2d result = ptr%radius() print *, "2-d radius is ", result if( abs(result - 5.0) > 1e-8 ) error stop ptr => p3d result = ptr%radius() print *, "3-d radius is ", result if( abs(result - 7.07106781) > 1e-8 ) error stop p3d%x = 3.0 p3d%y = 4.0 p3d%z = 0.0 result = ptr%radius() print *, "3-d radius is ", result if( abs(result - 5.0) > 1e-8 ) error stop end program main lfortran-lfortran-2f73434/integration_tests/flip_sign.f900000664000175000017500000000050115141516316023666 0ustar alastairalastairprogram flip_sign implicit none integer :: number real :: x, eps = 1e-6 number = 123 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (-5.5)) > eps) error stop number = 124 x = 5.5 if (modulo(number, 2) == 1 ) x = -x if (abs(x - (5.5)) > eps) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_153.f900000664000175000017500000000561315141516316024502 0ustar alastairalastairprogram intrinsics_153 implicit none integer, parameter :: dp = kind(0.d0) integer, parameter :: a1 = dim(11, 31) integer(8), parameter :: a2 = dim(11_8, 31_8) real, parameter :: a3 = dim(11.0, 31.0) real(dp), parameter :: a4 = dim(11.0_dp, 31.0_dp) integer, parameter :: ar1(5) = dim([11, 31, 41, 51, 61], [1, 2, 3, 4, 5]) integer(8), parameter :: ar2(5) = dim([11_8, 31_8, 41_8, 51_8, 61_8], [1_8, 2_8, 3_8, 4_8, 5_8]) real, parameter :: ar3(5) = dim([11.0, 31.0, 41.0, 51.0, 61.0], [1.0, 2.0, 3.0, 4.0, 5.0]) real(dp), parameter :: ar4(5) = dim([11.0_dp, 31.0_dp, 41.0_dp, 51.0_dp, 61.0_dp], [1.0_dp, 2.0_dp, 3.0_dp, 4.0_dp, 5.0_dp]) real :: i,j real(dp) :: x,y integer :: a, b integer(8) :: c, d real(dp) :: res_dp integer :: arr1(4) integer(8) :: arr2(4) real(4) :: arr3(4) real(8) :: arr4(4) i = 30.0 j = 20.0 x = 10.0_dp y = 15.0_dp a = 30 b = 20 c = 10 d = 15 print *, a1 if (a1 /= 0) error stop print *, a2 if (a2 /= 0) error stop print *, a3 if (a3 /= 0.0) error stop print *, a4 if (abs(a4 - (0.0_dp)) > 1e-14_dp) error stop print *, ar1 if (any(ar1 /= [10, 29, 38, 47, 56])) error stop print *, ar2 if (any(ar2 /= [10, 29, 38, 47, 56])) error stop print *, ar3 if (any(abs(ar3 - [10.0, 29.0, 38.0, 47.0, 56.0]) > 1e-7)) error stop print *, ar4 if (any(abs(ar4 - [10.0_dp, 29.0_dp, 38.0_dp, 47.0_dp, 56.0_dp]) > 1e-14_dp)) error stop res_dp = dim(i, j) print *, res_dp if (abs(res_dp - (10.0_dp)) > 1e-14_dp) error stop res_dp = dim(x, y) print *, res_dp if (abs(res_dp - (0.0_dp)) > 1e-14_dp) error stop print *, dim(a, b) if (dim(a, b) /= 10) error stop print *, dim(c, d) if (dim(c, d) /= 0) error stop res_dp = dim(30.0, 20.0) print *, res_dp if (abs(res_dp - (10.0_dp)) > 1e-14_dp) error stop print *, dim(10.0, 15.0) if (abs(dim(10.0, 15.0) - (0.0)) > 1e-7) error stop print *, dim(30, 20) if (dim(30, 20) /= 10) error stop print *, dim(10, 15) if (dim(10, 15) /= 0) error stop print *, kind(dim(30, 20)) if (kind(dim(30, 20)) /= 4) error stop print *, kind(dim(10_8, 15_8)) if (kind(dim(10_8, 15_8)) /= 8) error stop print *, kind(dim(i, j)) if (kind(dim(i, j)) /= 4) error stop print *, kind(dim(a, b)) if (kind(dim(a, b)) /= 4) error stop print *, kind(dim(c, d)) if (kind(dim(c, d)) /= 8) error stop print *, kind(dim(x, y)) if (kind(dim(x, y)) /= 8) error stop arr1 = [33, 12, 31, 4] arr2 = [13_8, 131_8, 3_8, 4_8] arr3 = [41.0, 11.0, 30.0, 3.0] arr4 = [1.0_dp, 3.0_dp, 3.0_dp, 2.0_dp] print *, dim(arr1, arr2) if (any(dim(arr1, arr2) /= [20, 0, 28, 0])) error stop print *, dim(arr3, arr4) if (any(abs(dim(arr3, arr4) - [40.0, 8.0, 27.0, 1.0]) > 1e-7)) error stop end program lfortran-lfortran-2f73434/integration_tests/array_slice_03.f900000664000175000017500000000071715141516316024524 0ustar alastairalastairprogram array_slice_03 implicit none integer :: x(4) integer :: y(2) x = [1, 2, 3, 4] call sub(x, y) print *, "y: ", y(1), y(2) if( y(1) /= 2 ) error stop if( y(2) /= 3 ) error stop contains subroutine sub(x,y) integer, intent(in) :: x(:) integer, intent(out) :: y(:) y = x(2:3) if( y(1) /= 2 ) error stop if( y(2) /= 3 ) error stop end subroutine sub end program array_slice_03 lfortran-lfortran-2f73434/integration_tests/arrays_op_10.f900000664000175000017500000000110215141516316024211 0ustar alastairalastairprogram main implicit none call compare_solutions() contains subroutine compare_solutions() implicit none integer :: i real :: x(2) print *, size(solution()) do i = 1, size(solution()) x(i) = i end do do i = 1, 2 print *, x(i) if( x(i) /= i ) error stop end do end subroutine compare_solutions pure function solution() result(x) implicit none real, dimension(2) :: x x = [1.0, 1.0] end function solution end program main lfortran-lfortran-2f73434/integration_tests/common_21.f900000664000175000017500000000447615141516316023525 0ustar alastairalastair! Test: COMMON block with mixed type sizes and type punning via storage association ! Verifies that the same storage can be accessed as different types (type aliasing) ! and that modifications through one view are visible through another view. ! This is valid Fortran behavior per F2018 8.10.3 (storage association). program common_21 implicit none integer(4) :: i4_1, i4_2 real(8) :: r8 common/mixblk/i4_1, i4_2, r8 ! Initialize with known values i4_1 = 11 i4_2 = 22 r8 = 3.14159265358979d0 ! Verify same layout can read values call sub_verify_layout() ! Modify storage through different type view (type punning) call sub_single_real8_view() ! Verify modification via array view call sub_array_view() ! Final verification: check that arr modifications are visible here ! After sub_array_view sets arr(1)=100, arr(2)=200, we should see: ! - r8 should be 200.0d0 (from arr(2)) if (abs(r8 - 200.0d0) > 1.0d-10) error stop & "r8 should be 200.0 after array modification" print *, "PASS: common_21" end program subroutine sub_verify_layout() implicit none ! Same layout as main program - verify values are preserved integer(4) :: a, b real(8) :: c common/mixblk/a, b, c if (a /= 11) error stop "a should be 11" if (b /= 22) error stop "b should be 22" if (abs(c - 3.14159265358979d0) > 1.0d-10) error stop "c should be pi" end subroutine subroutine sub_single_real8_view() implicit none ! View entire 16 bytes as two real(8) values (type punning) ! First 8 bytes (i4_1 + i4_2) viewed as r8_first ! Second 8 bytes (r8) viewed as r8_second real(8) :: r8_first real(8) :: r8_second common/mixblk/r8_first, r8_second ! Modify through this view - changes underlying storage r8_first = 1.0d0 r8_second = 2.0d0 end subroutine subroutine sub_array_view() implicit none ! View entire 16 bytes as an array of 2 real(8) values real(8) :: arr(2) common/mixblk/arr ! Verify values set by sub_single_real8_view are visible here if (abs(arr(1) - 1.0d0) > 1.0d-10) error stop "arr(1) should be 1.0" if (abs(arr(2) - 2.0d0) > 1.0d-10) error stop "arr(2) should be 2.0" ! Modify via array access - will be visible in main program arr(1) = 100.0d0 arr(2) = 200.0d0 end subroutine lfortran-lfortran-2f73434/integration_tests/parameter_16.f900000664000175000017500000000112215141516316024202 0ustar alastairalastairsubroutine test_complex_param ! COMPLEX PARAMETER from real literal (incl. negative) implicit none complex :: pos_one, neg_one, zero parameter (pos_one = 1.0, neg_one = -1.0, zero = 0.0) if (real(pos_one) /= 1.0) error stop if (aimag(pos_one) /= 0.0) error stop if (real(neg_one) /= -1.0) error stop if (aimag(neg_one) /= 0.0) error stop if (real(zero) /= 0.0) error stop if (aimag(zero) /= 0.0) error stop print *, "PASS: complex parameter with negative real literal" end subroutine program parameter_16 call test_complex_param end program lfortran-lfortran-2f73434/integration_tests/openmp_03.f900000664000175000017500000000046415141516316023524 0ustar alastairalastairsubroutine omp_func(n) implicit none integer :: i, n !$omp parallel shared(i, n) !$omp do do i = 1, n end do !$omp end do !$omp end parallel print *, "n = ", n if (n /= 100) error stop end subroutine program openmp_03 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-lfortran-2f73434/integration_tests/derived_types_25.f900000664000175000017500000000162215141516316025075 0ustar alastairalastairmodule derived_types_25_fpm_error implicit none type :: error_t character(len=:), allocatable :: message end type error_t contains function bad_name_error(error, label, name) type(error_t), allocatable, intent(out) :: error character(len=*), intent(in) :: label character(len=*), intent(in) :: name logical :: bad_name_error allocate(error) error%message = label//"_"//name bad_name_error = allocated(error%message) end function bad_name_error end module derived_types_25_fpm_error program derived_types_25 use derived_types_25_fpm_error implicit none type(error_t), allocatable :: error character(len=:), allocatable :: message print *, allocated(message) if( allocated(message) ) error stop if( .not. bad_name_error(error, "1", "x") ) error stop print *, error%message if( error%message /= "1_x" ) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_76.f900000664000175000017500000000072415141516316025105 0ustar alastairalastairmodule derived_type_76_mod implicit none type, abstract :: toml_value integer :: origin = -1 end type type, extends(toml_value) :: toml_table logical :: l1 = .true. end type type :: parser type(toml_table), allocatable :: s1 end type end module program derived_type_76 use derived_type_76_mod type(parser) :: v1 allocate(v1%s1) v1%s1 = toml_table() if (v1%s1%origin /= -1) error stop if (.not. v1%s1%l1) error stop end program lfortran-lfortran-2f73434/integration_tests/namelist_21.f900000664000175000017500000000111715141516316024036 0ustar alastairalastairprogram test_namelist_iolist implicit none type :: point integer :: x=0 integer :: y=0 end type point type(point) :: dot namelist /nml_dot/ dot dot%x = 10 dot%y = 20 write(*, nml_dot) open(unit=10, file='namelist_21.dat', status='replace', form='formatted') write(10, nml_dot) close(10) dot%x = 0 dot%y = 0 open(unit=10, file='namelist_21.dat', status='old', form='formatted') read(10, nml_dot) close(10) if (dot%x /= 10) error stop if (dot%y /= 20) error stop end program test_namelist_iolist lfortran-lfortran-2f73434/integration_tests/read_11.f900000664000175000017500000000154415141516316023140 0ustar alastairalastairprogram read_11 implicit none integer :: i, j, n real :: a(3, 4) n = 4 open(10, status='scratch') write(10, *) 1.0, 2.0, 3.0, 4.0 write(10, *) 5.0, 6.0, 7.0, 8.0 rewind(10) read(10, *) (a(1,j), j = 1, n) read(10, *) (a(2,j), j = 1, n) close(10) if (abs(a(1,1) - 1.0) > 1e-6) error stop "a(1,1) should be 1.0" if (abs(a(1,2) - 2.0) > 1e-6) error stop "a(1,2) should be 2.0" if (abs(a(1,3) - 3.0) > 1e-6) error stop "a(1,3) should be 3.0" if (abs(a(1,4) - 4.0) > 1e-6) error stop "a(1,4) should be 4.0" if (abs(a(2,1) - 5.0) > 1e-6) error stop "a(2,1) should be 5.0" if (abs(a(2,2) - 6.0) > 1e-6) error stop "a(2,2) should be 6.0" if (abs(a(2,3) - 7.0) > 1e-6) error stop "a(2,3) should be 7.0" if (abs(a(2,4) - 8.0) > 1e-6) error stop "a(2,4) should be 8.0" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/cond_03.f900000664000175000017500000000045715141516316023153 0ustar alastairalastair program cond_03 implicit none real, pointer :: d1, d2 real, target :: t1, t2 ! Initialize target objects t1 = 4 t2 = 5 ! Assign pointers d1 => t1 d2 => t2 if ( d1 > d2) error stop "Test_1 failed" t1 = 7 t2 = 6 if ( d1 < d2) error stop "Test_2 failed" end program cond_03lfortran-lfortran-2f73434/integration_tests/namelist_24.f900000664000175000017500000000113315141516316024037 0ustar alastairalastairmodule namelist_24_mod implicit none integer :: a = 0 end module namelist_24_mod program test_namelist_external_symbol use namelist_24_mod implicit none namelist /nml/ a a = 42 open(unit=10, file='namelist_24.dat', status='replace', form='formatted') write(10, nml=nml) close(10) a = 0 open(unit=10, file='namelist_24.dat', status='old', form='formatted') read(10, nml=nml) close(10) if (a /= 42) error stop "Namelist external symbol test failed" print *, "Namelist external symbol test passed!" end program test_namelist_external_symbol lfortran-lfortran-2f73434/integration_tests/intrinsics_396.f900000664000175000017500000000053315141516316024507 0ustar alastairalastairprogram intrinsics_395 character(:), allocatable :: dir integer :: i integer :: stat character(len=:), allocatable :: redirect, total redirect = " >/dev/null 2>&1" dir = "fortran_scratch2" total = "test -d fortran_scratch2 >/dev/null 2>&1" call execute_command_line(total, exitstat=stat) end program intrinsics_395 lfortran-lfortran-2f73434/integration_tests/functions_52.f900000664000175000017500000000050315141516316024234 0ustar alastairalastairprogram functions_52 integer, allocatable :: b if (allocated(b) /= .false.) error stop b = my() if (allocated(b) /= .true.) error stop if (b /= 44) error stop contains function my() result(ret) integer, allocatable :: ret ret = 44 end function end program lfortran-lfortran-2f73434/integration_tests/class_83.f900000664000175000017500000000272415141516316023344 0ustar alastairalastairprogram class_83 implicit none type :: string_t integer :: dummy = -1 end type type :: preprocess_t type(string_t), allocatable :: strs(:) end type type :: temp type(preprocess_t), allocatable :: arr(:) end type type(temp), allocatable :: x(:), z(:) !------------------------- ! Allocate top-level arrays !------------------------- allocate(x(4)) allocate(z(4)) !------------------------- ! Initialize x(1) !------------------------- allocate(x(1)%arr(2)) allocate(x(1)%arr(1)%strs(3)) allocate(x(1)%arr(2)%strs(1)) x(1)%arr(1)%strs(1)%dummy = 10 x(1)%arr(1)%strs(2)%dummy = 10 x(1)%arr(1)%strs(3)%dummy = 10 x(1)%arr(2)%strs(1)%dummy = 20 z(1) = x(1) if (.not. allocated(z(1)%arr)) error stop "z(1)%arr not allocated" if (size(z(1)%arr) /= 2) error stop "z(1)%arr wrong size" if (.not. allocated(z(1)%arr(1)%strs)) error stop "z(1)%arr(1)%strs not allocated" if (size(z(1)%arr(1)%strs) /= 3) error stop "z(1)%arr(1)%strs wrong size" if (z(1)%arr(1)%strs(1)%dummy /= 10) error stop "z copy failed" x(1) = z(1) if (.not. allocated(x(1)%arr)) error stop "x(1)%arr not allocated after copy back" if (size(x(1)%arr) /= 2) error stop "x(1)%arr wrong size after copy back" if (x(1)%arr(2)%strs(1)%dummy /= 20) error stop "x copy-back failed" print *, "OK: deep allocatable assignment works correctly" end program class_83 lfortran-lfortran-2f73434/integration_tests/intrinsics_399.f900000664000175000017500000000057515141516316024520 0ustar alastairalastairprogram intrinsics_399 debugit: block integer :: j, ilen character(len=256) :: big_argument write(*,*)'arguments seen directly by program' do j=1,command_argument_count() call get_command_argument(number=j,value=big_argument,length=ilen) write(*,'(*(g0))')j,'[',big_argument(:ilen),']' end do end block debugit end program intrinsics_399lfortran-lfortran-2f73434/integration_tests/functions_08.f900000664000175000017500000000101115141516316024230 0ustar alastairalastairmodule function_08_a implicit none end module program functions_08 implicit none real :: x = 5, y real :: p = 5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q contains real function f(a) result(b) real, intent(in) :: a real :: x x = 2 b = a + f_real(0.0) end function real function f_real(a) result(b) real, intent(in) :: a if( a == 0.0 ) then b = 2.0 else b = a + f(1.0) end if end function end program lfortran-lfortran-2f73434/integration_tests/data_17.f900000664000175000017500000000034715141516316023144 0ustar alastairalastairprogram data_17 implicit none character(len=1) :: facts(3) data facts / 'F', 'N', 'E' / if (facts(1) /= 'F') error stop if (facts(2) /= 'N') error stop if (facts(3) /= 'E') error stop end program data_17 lfortran-lfortran-2f73434/integration_tests/intrinsics_231.f900000664000175000017500000000110415141516316024466 0ustar alastairalastairprogram intrinsics_231 use iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: x1 = dgamma(1.0_dp) real(dp), parameter :: x2 = dgamma(3.14_dp) real(dp) :: x = 1.0_dp real(dp) :: y = 3.14_dp print *, x1 if (abs(x1 - 1.0000000000000000_dp) > 1e-12) error stop print *, x2 if (abs(x2 - 2.2844806338178012_dp) > 1e-12) error stop print *, dgamma(x) if (abs(dgamma(x) - 1.0000000000000000_dp) > 1e-12) error stop print *, dgamma(y) if (abs(dgamma(y) - 2.2844806338178012_dp) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/associate_04.f900000664000175000017500000000074315141516316024202 0ustar alastairalastair! Reference - https://www.ibm.com/docs/en/xffbg/121.141?topic=control-associate-construct-fortran-2003 program associate_04 real :: myreal, x, y, theta, a x = 0.42 y = 0.35 myreal = 9.1 theta = 1.5 a = 0.4 associate ( z => -(x*2 + y*2) * cos(theta), v => myreal) print *, a + z, a - z, v v = v * 4.6 end associate print *, myreal if ((myreal - 41.86) > 1e-5 .or. myreal - 41.86 < -1e-5) error stop end program associate_04lfortran-lfortran-2f73434/integration_tests/derived_types_98.f900000664000175000017500000000160715141516316025112 0ustar alastairalastair! Test lhs realloc of derived type module derived_types_98_mod type :: tt character(len=:), allocatable :: name end type tt end module program derived_types_98 use derived_types_98_mod type(tt), allocatable :: dl(:) integer :: i i = 1 allocate(dl(2)) print *, allocated(dl(1)%name) if(allocated(dl(1)%name)) error stop print *, allocated(dl(2)%name) if(allocated(dl(2)%name)) error stop print *, size(dl) if(size(dl) /= 2) error stop dl(1)%name = "first" dl(2)%name = "second" print *, allocated(dl(1)%name) if(.not. allocated(dl(1)%name)) error stop print *, allocated(dl(2)%name) if(.not. allocated(dl(2)%name)) error stop dl = dl(1:i) print *, allocated(dl(1)%name) if(.not. allocated(dl(1)%name)) error stop print *, size(dl) if(size(dl) /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/callback_04.f900000664000175000017500000000072315141516316023761 0ustar alastairalastairmodule dr_fortran_cb contains subroutine print_dr() print *,'Dr. ' end subroutine subroutine print_fortran() print *,'Fortran' end subroutine subroutine print_dr_fortran(title_or_name) interface subroutine title_or_name() end subroutine end interface call title_or_name() end subroutine end module program main use dr_fortran_cb call print_dr_fortran(print_dr) call print_dr_fortran(print_fortran) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_229.f900000664000175000017500000000144615141516316024506 0ustar alastairalastairprogram intrinsics_229 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp) :: x, y, z x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 1.5803544202317088e-021_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 8.5440894639449411e-006_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 0.0000000000000000_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derfc(x) if (abs(derfc(x) - 2.0000000000000000_dp) > 1e-12) error stop print *, derfc(y) if (abs(derfc(y) - 1.9999914559105361_dp) > 1e-12) error stop print *, derfc(z) if (abs(derfc(z) - 2.0000000000000000_dp) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_385.f900000664000175000017500000000042215141516316024502 0ustar alastairalastairprogram intrinsics_385 implicit none real(4) :: x, up, down x = 1.0 up = nearest(x, 1.0) down = nearest(x, -1.0) print *, up print *, down if (up /= 1.00000012) error stop if (down /= 0.999999940) error stop end program intrinsics_385 lfortran-lfortran-2f73434/integration_tests/arrays_23.f900000664000175000017500000000173115141516316023527 0ustar alastairalastairmodule arrays_23 implicit none type :: toml_context !> Current internal position integer :: pos !> Current internal count integer :: num !> Current internal location on the string buffer character(len=:), pointer :: ptr end type toml_context contains subroutine add_context(message, context) !> A detailed message describing the error, requiring some more context character(len=:), allocatable, intent(inout) :: message !> Current context producing the error type(toml_context), intent(in) :: context character(len=20) :: num integer :: line_break if (context%num > 0) then write(num, '("line",1x,i0,":")') context%num message = num(1:len_trim(num)+1) // message end if message = message // & & ' | '// context%ptr(1:line_break) // & & ' |' end subroutine add_context end module arrays_23 program main use arrays_23 implicit none print *, "working" end program main lfortran-lfortran-2f73434/integration_tests/file_12.f900000664000175000017500000000055415141516316023145 0ustar alastairalastairprogram file_12 implicit none character(1024) :: tmp character(:), allocatable :: sentence1 integer :: u = 11 integer :: ios open(u, file="file_12_data.txt", form="formatted", access="stream", status="old") read(u, "(a)", iostat=ios) tmp sentence1 = trim(tmp) print *, sentence1, ios if (ios == 0) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_22.f900000664000175000017500000000122715141516316026057 0ustar alastairalastairmodule implicit_interface_22_mod implicit none interface generic_sub module procedure real_sub end interface contains subroutine real_sub(f, n) integer, intent(in) :: n interface subroutine f(x) real, intent(in) :: x end subroutine end interface real :: x x = 1.0 call f(x) if (n /= 3) error stop print *, "real_sub called with n =", n end subroutine end module program test use implicit_interface_22_mod implicit none external :: my_f call generic_sub(my_f, 3) print *, "PASS" end program subroutine my_f(x) real, intent(in) :: x print *, "my_f called with x =", x end subroutine lfortran-lfortran-2f73434/integration_tests/file_21_data.txt0000664000175000017500000000000515141516316024346 0ustar alastairalastairab cdlfortran-lfortran-2f73434/integration_tests/modules_30.f900000664000175000017500000000114615141516316023674 0ustar alastairalastairmodule fpm_manifest_modules_30 use fpm_manifest_package_modules_30, only : package_config_t use fpm_manifest_executable_modules_30, only : default_executable implicit none contains subroutine package_defaults(package, root) type(package_config_t), intent(inout) :: package character(len=*), intent(in) :: root allocate(package%executable(1)) call default_executable(package%executable(1), package%name) end subroutine package_defaults end module fpm_manifest_modules_30 program modules_30 implicit none print *, "running modules_30 program" end program lfortran-lfortran-2f73434/integration_tests/format_45.f900000664000175000017500000000202215141516316023514 0ustar alastairalastair! Test that embedded null bytes in strings are preserved during formatting program format_45 implicit none character(len=20) :: result_str character(len=10) :: prefix real :: value integer :: i ! Set prefix to null bytes do i = 1, 10 prefix(i:i) = char(0) end do value = 1.5 write(result_str, '(A,F5.2)') prefix, value ! Verify first 10 bytes are null do i = 1, 10 if (ichar(result_str(i:i)) /= 0) error stop end do ! Verify float " 1.50" at positions 11-15 if (ichar(result_str(11:11)) /= 32) error stop ! space if (ichar(result_str(12:12)) /= 49) error stop ! '1' if (ichar(result_str(13:13)) /= 46) error stop ! '.' if (ichar(result_str(14:14)) /= 53) error stop ! '5' if (ichar(result_str(15:15)) /= 48) error stop ! '0' ! Verify trailing spaces at positions 16-20 do i = 16, 20 if (ichar(result_str(i:i)) /= 32) error stop end do print *, "PASS: Null bytes preserved correctly in formatted output" end program lfortran-lfortran-2f73434/integration_tests/common_04.f900000664000175000017500000000063315141516316023515 0ustar alastairalastairprogram main integer :: a, b, c(5), d common / block_1 / a, b, c a = 2 b = 1 d = b c = 4 c(1) = 2 b = c(3) if (a /= 2) error stop if (b /= 4) error stop if (c(1) /= 2) error stop if (c(2) /= 4) error stop if (c(3) /= 4) error stop if (c(4) /= 4) error stop if (c(5) /= 4) error stop if (d /= 1) error stop print *, a, b, c, c(5), d end programlfortran-lfortran-2f73434/integration_tests/string_45.f900000664000175000017500000000072115141516316023536 0ustar alastairalastairprogram string_45 character(len=5), parameter :: color = "hello" integer(1) :: i = 1 integer(2) :: j = 2 integer(4) :: k = 3 integer(8) :: l = 4 print *, color(i:i) if (color(i:i) /= "h") error stop print *, color(j:j) if (color(j:j) /= "e") error stop print *, color(k:k) if (color(k:k) /= "l") error stop print *, color(l:l) if (color(l:l) /= "l") error stop print *, color(5:5) end program string_45lfortran-lfortran-2f73434/integration_tests/string_99.f900000664000175000017500000000053115141516316023546 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/3938 ! character length from bit_size() intrinsic, len() correctness ! Exact MRE from issue body program bitsize2 implicit none character(bit_size(666)):: foo print *, bit_size(666), len(foo) if (bit_size(666) /= 32) error stop if (len(foo) /= 32) error stop end program bitsize2 lfortran-lfortran-2f73434/integration_tests/submodule_14.f900000664000175000017500000000115415141516316024224 0ustar alastairalastairmodule the_interface_submodule_14 implicit none integer,parameter:: dp = selected_real_kind(15) interface real(dp) module function pi() end function pi end interface end module the_interface_submodule_14 submodule (the_interface_submodule_14) the_calculation_submodule_14 implicit none contains real(dp) module function pi() pi = acos(-1.0_dp) end function pi end submodule the_calculation_submodule_14 program submodule_14 use the_interface_submodule_14 implicit none real(dp) :: result = 1.0_dp result = pi() print *, result if (result /= acos(-1.0_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/dict_test_02_.f900000664000175000017500000000254015141516316024343 0ustar alastairalastairmodule dict_test_02_mod implicit none real :: eps = 1e-5 contains subroutine test_dict() _lfortran_dict(integer, real) :: rollnumber2cpi integer :: i integer :: size, size1 size = 7000 size1 = size/7 + 1 rollnumber2cpi = _lfortran_dict_constant(0, 1.1) do i=1000, 1000 + size - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, real(i)/100.0 + 5.0) end do do i=1000, 1000 + size/2 - 1, 7 if ( abs(_lfortran_pop(rollnumber2cpi, i) - real(i)/100.0 - 5.0) > eps ) error stop size1 = size1 - 1 if ( _lfortran_len(rollnumber2cpi) /= size1 ) error stop end do do i=1000, 1000 + size/2 - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, -real(i)/100.0 - 5.0) end do do i=1000, 1000 + size/2 - 1, 7 if ( abs(_lfortran_get_item(rollnumber2cpi, i) + real(i)/100.0 + 5.0) > eps ) error stop end do do i=1000, 1000 + size - 1, 7 call _lfortran_set_item(rollnumber2cpi, i, -real(i)/100.0 - 5.0) end do do i=1000, 1000 + size - 1, 7 if ( abs(_lfortran_get_item(rollnumber2cpi, i) + real(i)/100.0 + 5.0) > eps ) error stop end do end subroutine subroutine tests() call test_dict() end subroutine end module program run_tuples use dict_test_02_mod call tests() end program lfortran-lfortran-2f73434/integration_tests/class_allocate_01.f900000664000175000017500000000166015141516316025174 0ustar alastairalastairmodule shapes_module implicit none type, abstract :: Shape contains procedure(area_interface), deferred :: area end type Shape abstract interface function area_interface(self) result(res) import :: Shape class(Shape), intent(in) :: self real :: res end function area_interface end interface type, extends(Shape) :: Circle real :: radius contains procedure :: area => circle_area end type Circle contains function circle_area(self) result(res) class(Circle), intent(in) :: self real :: res res = 3.14159 * self%radius**2 end function circle_area end module shapes_module program main use shapes_module implicit none class(Shape), allocatable :: s real :: a allocate(Circle :: s) print *, allocated(s) if (allocated(s) .neqv. .true.) error stop end program main lfortran-lfortran-2f73434/integration_tests/string_63.f900000664000175000017500000000136515141516316023543 0ustar alastairalastairprogram string_63 type :: string_type character(len=:), allocatable :: raw end type string_type type(string_type) :: string string%raw = "Hello" string = ff(string) print *, string%raw if(string%raw /= "Hello!!") error stop contains function ff(s) result(string) type(string_type),intent(in) :: s type(string_type) :: string print *, s%raw if(s%raw /= "Hello") error stop ! This should work with no issue (but as to `subroutine_from_function` is using LHS to be the holder of the return, allocating return `string` means allcoating argument `s`) ! allocate(character(len(s%raw)+2) :: string%raw) string%raw = s%raw //"!!" end function end programlfortran-lfortran-2f73434/integration_tests/read_19.f900000664000175000017500000000137515141516316023152 0ustar alastairalastairprogram read_19 ! Test D exponent notation in READ use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x integer :: u open(newunit=u, status='scratch') ! Test D+xx notation write(u, '(A)') "1.5D+02" rewind(u) read(u, *) x if (abs(x - 150.0_dp) > 1.0e-10_dp) error stop "D+02 failed" ! Test D-xx notation rewind(u) write(u, '(A)') "2.5D-03" rewind(u) read(u, *) x if (abs(x - 0.0025_dp) > 1.0e-15_dp) error stop "D-03 failed" ! Test d (lowercase) notation rewind(u) write(u, '(A)') "3.0d+01" rewind(u) read(u, *) x if (abs(x - 30.0_dp) > 1.0e-10_dp) error stop "d+01 failed" close(u) print *, "PASS: D exponent notation works" end program read_19 lfortran-lfortran-2f73434/integration_tests/intrinsics_58.f900000664000175000017500000000357415141516316024432 0ustar alastairalastairprogram intrinsics_58 integer :: x, y, signval real :: x1, y1, signval1 integer :: int_res(4) ! Compile time tests if (sign( 5, 10) /= 5) error stop if (sign(-5, 10) /= 5) error stop if (sign( 5, -10) /= -5) error stop if (sign(-5, -10) /= -5) error stop if (sign( 5., 10.) /= 5.) error stop if (sign(-5., 10.) /= 5.) error stop if (sign( 5., -10.) /= -5.) error stop if (sign(-5., -10.) /= -5.) error stop ! Ensure that compile time broadcasting works !> positive second argument int_res = sign([1, 2, 5, -1], 2) print *, int_res if (int_res(1) /= 1) error stop if (int_res(2) /= 2) error stop if (int_res(3) /= 5) error stop if (int_res(4) /= 1) error stop !> negative second argument int_res = sign([1, 2, -5, 1], -3) print *, int_res if (int_res(1) /= -1) error stop if (int_res(2) /= -2) error stop if (int_res(3) /= -5) error stop if (int_res(4) /= -1) error stop ! Runtime tests x = 5 y = 10 signval = sign(x, y) print *, signval if( signval /= 5 ) error stop x = 5 y = -10 signval = sign(x, y) print *, signval if( signval /= -5 ) error stop x = -5 y = 10 signval = sign(x, y) print *, signval if( signval /= 5 ) error stop x = -5 y = -10 signval = sign(x, y) print *, signval if( signval /= -5 ) error stop x1 = 5.0 y1 = 10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= 5.0 ) error stop x1 = 5.0 y1 = -10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= -5.0 ) error stop x1 = -5.0 y1 = 10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= 5.0 ) error stop x1 = -5.0 y1 = -10.0 signval1 = sign(x1, y1) print *, signval1 if( signval1 /= -5.0 ) error stop end program intrinsics_58 lfortran-lfortran-2f73434/integration_tests/procedure_08.f900000664000175000017500000000300615141516316024216 0ustar alastairalastair!! Test to check if actual function is called instead of its m_type_declaration module procedure_08_module contains subroutine cb(x) implicit none integer, intent(inout), optional :: x(:) x = 1 end subroutine cb subroutine calfun(x) implicit none integer, intent(inout), optional :: x(:) logical :: y x = 2 y = present(x) print *, y if (.not. y) error stop end subroutine calfun end module procedure_08_module program procedure_08 use procedure_08_module call temp(calfun) call temp() call temp2(calfun) call temp2() contains subroutine temp(call_back) implicit none procedure(cb), optional :: call_back integer :: x(4) if(present(call_back)) then call call_back(x) print *, x if(x(1) /= 2) error stop end if end subroutine temp subroutine temp2(call_back) implicit none procedure(cb), optional :: call_back integer, save :: x(4) = 0 if(present(call_back)) then call temp3(call_back, x) call temp3(call_back, x(1:3)) end if end subroutine !! Check: call_back is updated in `pass_array_by_data` pass subroutine temp3(call_back, x) implicit none procedure(cb) :: call_back integer, intent(inout) :: x(:) call call_back(x) print *, x if(x(1) /= 2) error stop end subroutine end program procedure_08lfortran-lfortran-2f73434/integration_tests/intrinsics_137.f900000664000175000017500000000376015141516316024505 0ustar alastairalastairprogram intrinsics_137 use iso_fortran_env, only: int32, int64 implicit none integer, parameter :: sp = kind(0.0) integer, parameter :: dp = kind(0.d0) integer, parameter :: i1 = huge(0) integer(8), parameter :: i2 = huge(12_dp) real, parameter :: i3 = huge(1.1_sp) real(8), parameter :: i4 = huge(1.5_dp) integer, parameter :: ar1(3) = huge([1, 2, 45]) real, parameter :: ar2(3) = huge([1.0, 2.0, 45.0]) integer(int32) :: i integer(int64) :: j real(sp) :: r real(dp) :: d integer :: arr1(3) = [11, 13, 7] real :: arr2(3) = [11.0, 13.0, 7.0] i = 0 j = 1 r = 0.0_sp d = 0.0_dp print *, i1 if (i1 /= 2147483647) error stop print *, i2 if (i2 /= 9223372036854775807_int64) error stop print *, i3 if (abs((i3 - 3.40282347e+38_sp) / 3.40282347e+38_sp) > 1e-6_sp) error stop print *, i4 if (abs(i4 - 1.79769313486231571e+308_dp) > 1e-12_dp) error stop print *, ar1 if (any(ar1 /= [2147483647, 2147483647, 2147483647])) error stop print *, ar2 if (any(abs((ar2 - [3.40282347e+38_sp, 3.40282347e+38_sp, 3.40282347e+38_sp]) / 3.40282347e+38_sp) > 1e-6_sp)) error stop print *, huge(i) if (huge(i) /= 2147483647_int32) error stop print*, huge(j) if (huge(j) /= 9223372036854775807_int64) error stop print*, huge(r) if ((huge(r) - 3.40282347e+38) / 3.40282347e+38 > 1e-8_sp) error stop print*, huge(d) if (abs(huge(d) - 1.79769313486231571e+308_dp) > 1e-8_dp) error stop print *, kind(huge(1)) if (kind(huge(1)) /= int32) error stop print *, kind(huge(1.0)) if (kind(huge(1.0)) /= sp) error stop print *, kind(huge(1.0_dp)) if (kind(huge(1.0_dp)) /= dp) error stop print *, huge(arr1) if (any(huge(arr1) /= [2147483647, 2147483647, 2147483647])) error stop print *, huge(arr2) if (any(abs((huge(arr2) - [3.40282347e+38, 3.40282347e+38, 3.40282347e+38]) / 3.40282347e+38) > 1e-6)) error stop end program intrinsics_137 lfortran-lfortran-2f73434/integration_tests/class_07.f900000664000175000017500000000055415141516316023337 0ustar alastairalastairmodule class_07_mod private type, abstract :: tester contains procedure(testing_method), deferred, nopass :: testing end type tester abstract interface pure function testing_method() result(n) integer :: n end function testing_method end interface end module program class_07 use class_07_mod end program lfortran-lfortran-2f73434/integration_tests/present_06.f900000664000175000017500000000157515141516316023715 0ustar alastairalastair! Test: procedure dummy passed through to another routine without being called subroutine inner(func, x, y) implicit none double precision :: func external :: func double precision, intent(in) :: x double precision, intent(out) :: y y = func(x) end subroutine inner subroutine outer(f, a, b) implicit none double precision :: f external :: f double precision, intent(in) :: a double precision, intent(out) :: b call inner(f, a, b) end subroutine outer double precision function myfunc(x) implicit none double precision, intent(in) :: x myfunc = x * 2.0d0 end function myfunc program present_06 implicit none double precision :: result double precision, external :: myfunc call outer(myfunc, 2.0d0, result) if (abs(result - 4.0d0) > 1.0d-10) error stop "Expected 4.0" print *, "PASS" end program present_06 lfortran-lfortran-2f73434/integration_tests/class_63.f900000664000175000017500000000020015141516316023325 0ustar alastairalastairmodule class_63_module use class_63_module_2, only: MyType end module program class_63 use class_63_module end programlfortran-lfortran-2f73434/integration_tests/string_47.f900000664000175000017500000000164215141516316023543 0ustar alastairalastairprogram string_47 implicit none type :: string character(:), allocatable :: s end type type(string), allocatable :: tokens(:) tokens = bpe("abc") print *, tokens(1)%s, tokens(2)%s, tokens(3)%s if( tokens(1)%s /= "a" ) error stop if( tokens(2)%s /= "b" ) error stop if( tokens(3)%s /= "c" ) error stop contains function merge_utf8_pairs(intokens) result(tokens) type(string), intent(in) :: intokens(:) type(string), allocatable :: tokens(:) allocate(tokens(size(intokens))) tokens = intokens end function function bpe(token) result(tokens) character(*), intent(in) :: token type(string), allocatable :: tokens(:) integer :: i allocate(tokens(len(token))) do i = 1, len(token) tokens(i)%s = token(i:i) end do tokens = merge_utf8_pairs(tokens) end function end program lfortran-lfortran-2f73434/integration_tests/while_07.f900000664000175000017500000000044715141516316023343 0ustar alastairalastairprogram while_07 implicit none logical :: finished(4) integer :: count = 0 finished = .true. do while (all(finished)) finished = .false. count = count + 1 if (count > 1) error stop end do print *, count if (count /= 1) error stop end program while_07 lfortran-lfortran-2f73434/integration_tests/data_01.f900000664000175000017500000000112215141516316023125 0ustar alastairalastairprogram data_01 integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b, p data x, td, b /1, 4, 3/ data y, z /2.0, 3.0/ data c1 /0.0, 0.22, -0.14, -0.21/ data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ print *, x, y, z if (x /= 1) error stop if (abs(y-2.0) > 1e-5) error stop if (abs(z-3.0) > 1e-5) error stop if (abs(c1(1)-0.0) > 1e-5) error stop if (abs(c1(2)-0.22) > 1e-5) error stop if (abs(c1(4)+0.21) > 1e-5) error stop if (abs(bf1-0.8) > 1e-5) error stop if (abs(xx90-0.55) > 1e-5) error stop if (abs(xx95-0.62) > 1e-5) error stop p = b ** (td-1) if (abs(p-27.0) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/format_41.f900000664000175000017500000000120715141516316023514 0ustar alastairalastairprogram format_40 ! Test sign control format descriptors: S, SP, SS implicit none character(len=20) :: output ! Test S (restore default sign printing) write(output, 100) -42.43, 42.43 if (output /= " -42.430 42.430 ") error stop "Test 1 failed" ! Test SP (always print sign) write(output, 101) -42.43, 42.43 if (output /= " -42.430 +42.430 ") error stop "Test 2 failed" ! Test SS (suppress optional plus sign) write(output, 102) -42.43, 42.43 if (output /= " -42.430 42.430 ") error stop "Test 3 failed" print *, "OK" 100 format (s, 2f10.3) 101 format (sp, 2f10.3) 102 format (ss, 2f10.3) end program lfortran-lfortran-2f73434/integration_tests/cpp_pre_03.f900000664000175000017500000000056115141516316023654 0ustar alastairalastairprogram cpp_pre_03 #ifdef _WIN32 print *,"Windows" #endif #ifdef __linux__ print *,"Linux" #endif #ifdef __APPLE__ print *,"OSX" #endif #ifdef __aarch64__ print *,"Apple ARM" #endif #ifdef __x86_64__ print *,"Apple AMD" #endif #ifdef __FreeBSD__ print *,"FreeBSD" #endif #ifdef __OpenBSD__ print *,"OpenBSD" #endif print *, "Ok" end program lfortran-lfortran-2f73434/integration_tests/binop_of_struct_instance_in_function_call.f900000664000175000017500000000135415141516316032374 0ustar alastairalastairmodule module_binop_of_struct_instance_in_function_call type custom_data_type real(4), dimension(:), pointer :: x, y end type contains function func(x0) real(4), intent(in) :: x0(:) real(4) :: func(size(x0)) func = x0 + 1 end function end module module_binop_of_struct_instance_in_function_call program binop_of_struct_instance_in_function_call use module_binop_of_struct_instance_in_function_call implicit none real(4), target :: A(2), B(2) type(custom_data_type) :: d real(4), dimension(2) :: tmp A = [1, 2] B = [3, 10] d%x => A d%y => B tmp = func(d%x - d%y) print *, tmp if (any(tmp /= [-1., -7.])) error stop end program binop_of_struct_instance_in_function_call lfortran-lfortran-2f73434/integration_tests/file_48.f900000664000175000017500000000167315141516316023161 0ustar alastairalastairprogram daio4 implicit none integer, parameter :: unit_no = 24 integer :: i, i1, iolen logical :: l, pf character(4) :: s real :: r complex :: c complex, parameter :: cval = (12.34, 56.78) ! inquire (iolength=iolen) l, s, i, r, c ! Causes ICE: see PR #9761 ! ! So I hard code iolen. iolen = 24 open (unit_no, file='fort.24', access='direct', recl=iolen) do, i=1, 10 l = mod (i,2) == 0 write (unit_no, rec=i) l, 'wxyz', i, i+0.5, cval end do ! Read fails to read correctly: do, i=1, 10 l = .false.; s = 'uini'; i1 = -42; r = -42.42 read (unit_no, rec=i) l, s, i1, r, c pf = (l .eqv. mod (i, 2) == 0) .and. & (s == 'wxyz') .and. & (i == i1) .and. & (abs (r - (i + 0.5)) < 0.0001) .and. & (c == cval) print *, 'l, s, i1, r =', l, s, i1, r, c print *, 'read', i, merge ('pass', 'fail', pf) if (.not. pf) error stop end do close (unit_no) end programlfortran-lfortran-2f73434/integration_tests/subroutines_20.f900000664000175000017500000000074615141516316024612 0ustar alastairalastairprogram subroutines_20 type :: regex_token character(len=:), allocatable :: ccl end type regex_token type :: regex_pattern type(regex_token) :: pattern end type regex_pattern type(regex_pattern) :: my_pattern call temp(my_pattern%pattern) if (my_pattern%pattern%ccl /= "abc") error stop contains subroutine temp(pattern) type(regex_token), intent(out) :: pattern pattern%ccl = 'abc' end subroutine temp end program lfortran-lfortran-2f73434/integration_tests/array_indices_array_section.f900000664000175000017500000000217715141516316027465 0ustar alastairalastairprogram array_indices_array_section implicit none integer :: arr_idx(2) real :: arr_1(2, 2), arr_2(2, 2), arr_3(2, 2, 2), arr_4(2, 2, 2) real :: arr_2_reshape(2, 2), arr_4_reshape(2, 2, 2) ! Initialize the matrices and arrays arr_1 = reshape([1.0, 2.0, 3.0, 4.0], shape(arr_1)) arr_3 = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 5.0], shape(arr_3)) arr_idx = [2, 1] ! Slicing arr_2 = arr_1(arr_idx, :) arr_2_reshape = reshape([2.0, 1.0, 4.0, 3.0], shape(arr_2_reshape)); print *, rank(arr_2) if (rank(arr_2) /= 2) error stop if (any(arr_2 /= arr_2_reshape)) error stop arr_4 = arr_3(:, :, arr_idx) arr_4_reshape = reshape([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 3) error stop if (any(arr_4 /= arr_4_reshape)) error stop arr_4 = arr_3(:, arr_idx, :) arr_4_reshape = reshape([3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0], shape(arr_4_reshape)); print *, rank(arr_4) if (rank(arr_4) /= 3) error stop if (any(arr_4 /= arr_4_reshape)) error stop end program array_indices_array_section lfortran-lfortran-2f73434/integration_tests/types_23.f900000664000175000017500000000107415141516316023372 0ustar alastairalastairprogram types_23 complex(8) :: A(3) = [(1, 1), (2, 2), (3, 3)] integer(8) :: B(3) = [(1, 1), (2, 2), (3, 3)] real(8) :: C(3) = [(1, 1), (2, 2), (3, 3)] complex(8) :: D(3) = [1, 2, 3] print*, A if ( abs(real(A(1)) - 1.00) > 10e-5 ) error stop if ( abs(imag(A(2)) - 2.00) > 10e-5 ) error stop print*, B if ( abs(B(1) - 1.00) > 10e-5 ) error stop print*, C if ( abs(C(1) - 1.00) > 10e-5 ) error stop print*, D if ( abs(real(D(1)) - 1.00) > 10e-5 ) error stop if ( abs(imag(D(2)) - 0.00) > 10e-5 ) error stop endlfortran-lfortran-2f73434/integration_tests/string_46.f900000664000175000017500000000111015141516316023530 0ustar alastairalastairprogram string_46 type :: string character(:), allocatable :: s end type type(string), allocatable :: x(:) allocate(x(2)) allocate(character(len("fix")) :: x(1)%s) x(1)%s = "fix" allocate(character(len("lfortran")) :: x(2)%s) x(2)%s = "lfortran" x = g(x) print *, x(1)%s, x(2)%s if( x(1)%s /= "fix" ) error stop if( x(2)%s /= "lfortran" ) error stop contains function g(intokens) result(tokens) type(string), intent(in) :: intokens(:) type(string), allocatable :: tokens(:) allocate(tokens(size(intokens))) tokens = intokens end function end program lfortran-lfortran-2f73434/integration_tests/openmp_41.f900000664000175000017500000000113315141516316023520 0ustar alastairalastairprogram openmp_41 integer :: i, j, k, res=0, resi=0, resj=0, resk=0 print *,"----","i","j","k" do concurrent (i = 1:4 ,j = 1:3 ,k = 1:2) reduce(+:res,resi,resj,resk) print *, "----" ,i,j,k res=res+1 resi=resi+i resj=resj+j resk=resk+k end do print *,"res = ",res print *,"resi = ",resi print *,"resj = ",resj print *,"resk = ",resk ! Check the result if ( resi /= 60 ) error stop ! (1+2+3+4) * 3 * 2=60 if ( resj /= 48 ) error stop ! (1+2+3) * 4 * 2 = 48 if ( resk /= 36 ) error stop ! (1+2) * 4* 3 = 36 if ( res /= 24 ) error stop ! Total iterations = 4 * 3 * 2 = 24 end programlfortran-lfortran-2f73434/integration_tests/namelist_07.f900000664000175000017500000000463015141516316024045 0ustar alastairalastairprogram namelist_complex implicit none ! Define complex variables complex(4) :: c4_scalar complex(8) :: c8_scalar complex(4) :: c4_array(3) complex(8) :: c8_array(2) ! Define namelist namelist /complex_test/ c4_scalar, c8_scalar, c4_array, c8_array ! Initialize complex scalars c4_scalar = (1.5, -2.3) c8_scalar = (3.14159, 2.71828) ! Initialize complex arrays c4_array(1) = (1.0, 1.0) c4_array(2) = (2.0, -2.0) c4_array(3) = (3.0, 3.0) c8_array(1) = (10.5, -20.3) c8_array(2) = (-15.7, 30.2) ! Write namelist to file open(unit=10, file='namelist_complex.dat', status='replace', form='formatted') write(10, nml=complex_test) close(10) ! Reset all values to zero c4_scalar = (0.0, 0.0) c8_scalar = (0.0d0, 0.0d0) c4_array = (0.0, 0.0) c8_array = (0.0d0, 0.0d0) ! Read namelist from file open(unit=10, file='namelist_complex.dat', status='old', form='formatted') read(10, nml=complex_test) close(10) ! Verify complex scalars (with tolerance for floating point) if (abs(real(c4_scalar) - 1.5) > 1.0e-5) error stop "c4_scalar real part mismatch" if (abs(aimag(c4_scalar) - (-2.3)) > 1.0e-5) error stop "c4_scalar imag part mismatch" if (abs(real(c8_scalar) - 3.14159d0) > 1.0d-5) error stop "c8_scalar real part mismatch" if (abs(aimag(c8_scalar) - 2.71828d0) > 1.0d-5) error stop "c8_scalar imag part mismatch" ! Verify complex arrays if (abs(real(c4_array(1)) - 1.0) > 1.0e-5) error stop "c4_array(1) real mismatch" if (abs(aimag(c4_array(1)) - 1.0) > 1.0e-5) error stop "c4_array(1) imag mismatch" if (abs(real(c4_array(2)) - 2.0) > 1.0e-5) error stop "c4_array(2) real mismatch" if (abs(aimag(c4_array(2)) - (-2.0)) > 1.0e-5) error stop "c4_array(2) imag mismatch" if (abs(real(c4_array(3)) - 3.0) > 1.0e-5) error stop "c4_array(3) real mismatch" if (abs(aimag(c4_array(3)) - 3.0) > 1.0e-5) error stop "c4_array(3) imag mismatch" if (abs(real(c8_array(1)) - 10.5d0) > 1.0d-5) error stop "c8_array(1) real mismatch" if (abs(aimag(c8_array(1)) - (-20.3d0)) > 1.0d-5) error stop "c8_array(1) imag mismatch" if (abs(real(c8_array(2)) - (-15.7d0)) > 1.0d-5) error stop "c8_array(2) real mismatch" if (abs(aimag(c8_array(2)) - 30.2d0) > 1.0d-5) error stop "c8_array(2) imag mismatch" print *, "Complex number namelist test passed!" end program namelist_complex lfortran-lfortran-2f73434/integration_tests/namelist_15.f900000664000175000017500000000203415141516316024040 0ustar alastairalastairprogram namelist_15 implicit none ! Variables of different intrinsic types integer :: act_i real :: act_r character(len=10) :: act_c logical :: act_l integer :: lun namelist /act_cli/ act_i namelist /act_cli/ act_r, act_c namelist /act_cli/ act_l act_i = 42 act_r = 3.5 act_c = 'hello' act_l = .true. open(newunit=lun, file='test.nml', status='replace', action='write') write(lun, nml=act_cli) close(lun) act_i = -1 act_r = -1.0 act_c = '' act_l = .false. open(newunit=lun, file='test.nml', status='old', action='read') read(lun, nml=act_cli) close(lun, status='delete') if (act_i /= 42) error stop 'act_i mismatch' if (abs(act_r - 3.5) > 1e-6) error stop 'act_r mismatch' if (act_c /= 'hello') error stop 'act_c mismatch' if (.not. act_l) error stop 'act_l mismatch' print *, 'PASSED: file-based NAMELIST with mixed intrinsic types' end program namelist_15 lfortran-lfortran-2f73434/integration_tests/allocate_33.f900000664000175000017500000000211015141516316024003 0ustar alastairalastairmodule allocate_33_mod implicit none type :: person character(len=50) :: name integer, allocatable :: scores(:) end type person contains function update_person(original) result(updated) type(person), allocatable, intent(in) :: original type(person), allocatable :: updated integer :: num_scores allocate(updated) updated%name = "modified: " // trim(original%name) num_scores = size(original%scores) allocate(updated%scores(num_scores + 1)) if (num_scores > 0) then updated%scores(1:num_scores) = original%scores + 10 end if updated%scores(num_scores + 1) = 999 end function update_person end module allocate_33_mod program allocate_33 use allocate_33_mod implicit none type(person), allocatable :: x allocate(x) x%name = "john doe" allocate(x%scores(3)) x%scores = [85, 92, 78] x = update_person(x) if (x%scores(1) /= 95) error stop if (x%scores(2) /= 102) error stop if (x%scores(3) /= 88) error stop if (x%scores(4) /= 999) error stop print *, "All tests passed." end program allocate_33lfortran-lfortran-2f73434/integration_tests/while_06.f900000664000175000017500000000040115141516316023330 0ustar alastairalastairprogram while_06 integer :: x = 0 integer, parameter :: skip_tokens(*) = [0,1,2] integer :: hit = 0 do while(any(x == skip_tokens)) print *, "Hi" x = 16 hit = hit + 1 end do if(hit /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/format_21.f900000664000175000017500000000061715141516316023516 0ustar alastairalastairprogram format_21 !> add tests to ensure that colon edit descriptor is supported print "(I2, :, A)", 42 print "(I2, :, A)", 42, " is the answer" print "(I3, :, I10)", 42, 43 print "(A, I2, :, A)", "The touch is ", 42, " degrees" print "(A, I2, :, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)", "The touch is ", 42 end program format_21 lfortran-lfortran-2f73434/integration_tests/implied_do_loops11.f900000664000175000017500000000114115141516316025400 0ustar alastairalastairprogram implied_do_loops11 implicit none integer i integer, parameter:: nmax = 5, a(nmax) = [1,2,4,8,8], & b(nmax-1) = [ ( a(i)-a(i-1), i=2,nmax ) ] integer:: c(nmax-1) = [ ( a(i)-a(i-1), i=2,nmax ) ] print "(A,5(1X,I0))", 'a =' ,a if (any(a /= [1,2,4,8,8])) error stop print "(A,4(1X,I0))", 'b = ',b if (any(b /= [1,2,4,0])) error stop print "(A,4(1X,I0))", 'c = ',c if (any(c /= [1,2,4,0])) error stop print "(A,4(1X,I0))", '? = ', ( a(i)-a(i-1), i=2,nmax ) if (any([ (a(i)-a(i-1), i=2,nmax) ] /= [1,2,4,0])) error stop end program implied_do_loops11lfortran-lfortran-2f73434/integration_tests/separate_compilation_20b.f900000664000175000017500000000040115141516316026560 0ustar alastairalastairsubmodule (stdlib_error_separate_compilation_20) f18estop_separate_compilation_20 implicit none contains module procedure error_stop integer, parameter :: i = 3 code = i end procedure end submodule f18estop_separate_compilation_20lfortran-lfortran-2f73434/integration_tests/elemental_17.f900000664000175000017500000000161315141516316024176 0ustar alastairalastairmodule elemental_17_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains elemental function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = x%string_ // " called func" end function bracket end module elemental_17_mod program elemental_17 use elemental_17_mod implicit none type(string_t) :: lines(3) lines(1)%string_ = "Hello" lines(2)%string_ = "World" allocate(character(0) :: lines(3)%string_) ! Allocate empty strings (unallocated variables musn't be referenced) lines = bracket(lines) print *, lines(1)%string_ if(lines(1)%string_ /= "Hello called func") error stop print *, lines(2)%string_ if(lines(2)%string_ /= "World called func") error stop print *, lines(3)%string_ if(lines(3)%string_ /= " called func") error stop end program elemental_17 lfortran-lfortran-2f73434/integration_tests/case_01.f900000664000175000017500000000074315141516316023137 0ustar alastairalastairprogram case_01 implicit none integer(8) :: i, out i = 4 select case(i) case (1) out = 10 print *, "1" case (2) out = 20 print *, "2" case (3) out = 30 print *, "3" case (4) out = 40 print *, "4" end select if (out /= 40) error stop selectcase(i) case (1) out = 11 print *, "1" case (2,3,4) out = 22 print *, "2,3,4" end select if (out /= 22) error stop end lfortran-lfortran-2f73434/integration_tests/assumed_rank_01.f900000664000175000017500000000077115141516316024701 0ustar alastairalastairprogram assumed_rank_01 implicit none integer :: a(3) = [1,2,3] integer :: b(2, 2, 1) = reshape([1, 2, 3, 4], [2, 2, 1]) call show(a, 3, 1) call show(b, 4, 3) contains subroutine show(x, expected_size, expected_rank) integer :: x(..) integer, intent(in) :: expected_size, expected_rank if (size(x) /= expected_size) error stop if (rank(x) /= expected_rank) error stop print *, size(x) print *, rank(x) end subroutine end program lfortran-lfortran-2f73434/integration_tests/arrays_06_size.f900000664000175000017500000000057515141516316024567 0ustar alastairalastairprogram arrays_06_size integer :: x = 2 call temp(x) contains subroutine temp(x) integer, intent(inout) :: x integer :: keep(x) keep = [1,2] print *, keep if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop x = 1 print *, keep if (keep(1) /= 1) error stop if (keep(2) /= 2) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/namelist_05.f900000664000175000017500000000376615141516316024054 0ustar alastairalastairprogram namelist_3d implicit none ! Define 3D arrays integer :: cube(2,3,4) real :: tensor(2,2,2) integer :: i, j, k ! Define namelist namelist /arrays3d/ cube, tensor ! Initialize cube (2x3x4 = 24 elements) do k = 1, 4 do j = 1, 3 do i = 1, 2 cube(i,j,k) = (i-1)*12 + (j-1)*4 + k end do end do end do ! Initialize tensor (2x2x2 = 8 elements) tensor(1,1,1) = 1.1 tensor(1,1,2) = 1.2 tensor(1,2,1) = 2.1 tensor(1,2,2) = 2.2 tensor(2,1,1) = 3.1 tensor(2,1,2) = 3.2 tensor(2,2,1) = 4.1 tensor(2,2,2) = 4.2 ! Write namelist to file open(unit=10, file='namelist_3d.dat', status='replace', form='formatted') write(10, nml=arrays3d) close(10) ! Reset all values to zero cube = 0 tensor = 0.0 ! Read namelist from file open(unit=10, file='namelist_3d.dat', status='old', form='formatted') read(10, nml=arrays3d) close(10) ! Verify cube values do k = 1, 4 do j = 1, 3 do i = 1, 2 if (cube(i,j,k) /= (i-1)*12 + (j-1)*4 + k) then error stop "Cube element mismatch" end if end do end do end do ! Verify tensor values (with tolerance for floating point) if (abs(tensor(1,1,1) - 1.1) > 1.0e-5) error stop "tensor(1,1,1) mismatch" if (abs(tensor(1,1,2) - 1.2) > 1.0e-5) error stop "tensor(1,1,2) mismatch" if (abs(tensor(1,2,1) - 2.1) > 1.0e-5) error stop "tensor(1,2,1) mismatch" if (abs(tensor(1,2,2) - 2.2) > 1.0e-5) error stop "tensor(1,2,2) mismatch" if (abs(tensor(2,1,1) - 3.1) > 1.0e-5) error stop "tensor(2,1,1) mismatch" if (abs(tensor(2,1,2) - 3.2) > 1.0e-5) error stop "tensor(2,1,2) mismatch" if (abs(tensor(2,2,1) - 4.1) > 1.0e-5) error stop "tensor(2,2,1) mismatch" if (abs(tensor(2,2,2) - 4.2) > 1.0e-5) error stop "tensor(2,2,2) mismatch" print *, "3D array namelist test passed!" end program namelist_3d lfortran-lfortran-2f73434/integration_tests/string_94.f900000664000175000017500000000062415141516316023544 0ustar alastairalastairprogram test_string_concat implicit none type :: string_t character(5) :: s end type string_t type(string_t) :: t character(:), allocatable :: result t%s = "World" result = "Hello " // t%s if (result /= "Hello World") error stop "wrong string" if (len(result) /= 11) error stop "wrong length" print *, "test passed" end program test_string_concat lfortran-lfortran-2f73434/integration_tests/capital_01.f900000664000175000017500000000025115141516316023633 0ustar alastairalastairPROGRAM CAPITAL_01 INTEGER A,B,C A=1 B=2 C=A+B PRINT *, C IF ( A /= 1 ) ERROR STOP IF ( B /= 2 ) ERROR STOP IF ( C /= 3 ) ERROR STOP END lfortran-lfortran-2f73434/integration_tests/intrinsics_66.f900000664000175000017500000000047315141516316024424 0ustar alastairalastairprogram intrinsics_66 real :: x,y(2) x = 1.0 y = 2.0 print *, sign(y(1),x) print *, sign(y(2),x) print *, sign(y(2), -x) if (abs(sign(y(1),x) - 2.0) > 1e-9) error stop if (abs(sign(y(2),x) - 2.0) > 1e-9) error stop if (abs(sign(y(2),-x) - (-2.0)) > 1e-9) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_op_5.f900000664000175000017500000000222315141516316024142 0ustar alastairalastairprogram array_op_5 implicit none integer :: a(2, 2, 1), b(2, 2, 1) complex :: c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i + j + k b(i, j, k) = i*j*k end do end do end do c = a + (0.0, 1.0)*b call check(c, 0) c = -a + (0.0, 1.0)*(-b) call check(c, 1) contains subroutine check(c, op_code) implicit none complex, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k real :: left, right do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) select case(op_code) case (0) left = i + j + k right = i*j*k if(c(i, j, k) /= left + right*(0.0, 1.0)) error stop case (1) left = i + j + k right = i*j*k if(c(i, j, k) /= -left - right*(0.0, 1.0)) error stop end select end do end do end do end subroutine check end program lfortran-lfortran-2f73434/integration_tests/subroutines_05.f900000664000175000017500000000032115141516316024602 0ustar alastairalastairprogram bugSize integer, pointer :: x(:) allocate(x(4)) call f(x) contains subroutine f(x) integer, intent(in) :: x(:) real :: E(size(x)) E = x E = [ 1, 2, 3, 4 ] print*, E end subroutine end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_28.f900000664000175000017500000000052015141516316026060 0ustar alastairalastairprogram implicit_interface_28 implicit none intrinsic sqrt real :: result result = find(sqrt, 9.0) print *, result if (abs(result - 3.0) > 1.0e-6) error stop contains real function find(func, x) real, external :: func real, intent(in) :: x find = func(x) end function find end program implicit_interface_28 lfortran-lfortran-2f73434/integration_tests/reserved_02.f900000664000175000017500000000031715141516316024041 0ustar alastairalastairprogram reserved_02 implicit none if (integer() /= 1) error stop contains integer function integer() integer function function = 5 function = function/function integer = function end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_362.f900000664000175000017500000000162515141516316024503 0ustar alastairalastairprogram intrinsics_362 implicit none integer :: a(10) integer :: b(5, 3) a = [1,2,3,4,5,6,7,8,9,10] print *, is_contiguous(b(1:, 1:)) if (is_contiguous(b(1:, 1:)) .neqv. .true.) error stop print *, is_contiguous(a(::2)) if (is_contiguous(a(::2)) .neqv. .false.) error stop print *, is_contiguous(b(1:2, 1:2)) if (is_contiguous(b(1:2, 1:2)) .neqv. .false.) error stop print *, is_contiguous(b(1:2, 1:2:2)) if (is_contiguous(b(1:2, 1:2:2)) .neqv. .false.) error stop print *, is_contiguous(b) if (is_contiguous(b) .neqv. .true.) error stop call sub(a(::2)) call sub(a) call sub(a(::1)) call sub(a(::-1)) call sub(a(1:9)) contains subroutine sub (x) integer :: x(:) if (is_contiguous (x)) then print *, 'X is contiguous' else print *, 'X is not contiguous' end if end subroutine sub end programlfortran-lfortran-2f73434/integration_tests/arrays_31.f900000664000175000017500000000021515141516316023522 0ustar alastairalastairprogram arrays_31 implicit none integer :: x(5) integer :: pqr = size(x) print *, pqr if (pqr /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_67.f900000664000175000017500000000224215141516316024421 0ustar alastairalastairprogram intrinsics_67 double precision :: x x = 1.0D0 print *, dcosh(x) print *, dsinh(x) print *, dcosh(1.2D0) print *, dsinh(1.2D0) print *, dtanh(x) print *, dtanh(1.2D0) if (abs(dcosh(x) - 1.5430806348152437D0) > 1d-14) error stop if (abs(dsinh(x) - 1.1752011936438014D0) > 1d-14) error stop if (abs(dcosh(1.2D0) - 1.8106555673243747D0) > 1d-14) error stop if (abs(dsinh(1.2D0) - 1.5094613554121725D0) > 1d-12) error stop if (abs(dtanh(x) - 0.76159415595576485D0) > 1d-14) error stop if (abs(dtanh(1.2D0) - 0.83365460701215521D0) > 1d-14) error stop x = 4.2D0 print *, dcosh(x) print *, dsinh(x) print *, dcosh(4.2D0) print *, dsinh(4.2D0) print *, dtanh(x) print *, dtanh(4.2D0) if (abs(dcosh(x) - 33.350663308872818D0) > 1d-14) error stop if (abs(dsinh(x) - 33.335667732052336D0) > 1d-14) error stop if (abs(dcosh(4.2D0) - 33.350663308872818D0) > 1d-14) error stop if (abs(dsinh(4.2D0) - 33.335667732052336D0) > 1d-14) error stop if (abs(dtanh(x) - 0.99955036645953343D0) > 1d-14) error stop if (abs(dtanh(4.2D0) - 0.99955036645953343D0) > 1d-14) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_34_module2.f900000664000175000017500000000021615141516316025324 0ustar alastairalastairmodule fpm_manifest_modules_34 use fpm_manifest_package_modules_34, only : package_config_t implicit none end module fpm_manifest_modules_34 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_06.f900000664000175000017500000000127215141516316026600 0ustar alastairalastairmodule legacy_array_sections_06_module contains subroutine dbtpcf(work) real(4),dimension(*), intent(out) :: work integer(4) :: iq call dbintk(work(iq)) end subroutine dbtpcf subroutine dbintk(q) implicit none real(4),dimension(*),intent(out) :: q end subroutine dbintk end module legacy_array_sections_06_module program legacy_array_sections_06 use legacy_array_sections_06_module implicit none real(4), dimension(10) :: work work = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] call dbtpcf(work) print *, work if (any(work - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] > 1e-6)) error stop end program legacy_array_sections_06lfortran-lfortran-2f73434/integration_tests/character_02.f900000664000175000017500000000131615141516316024156 0ustar alastairalastairmodule character_02_mod implicit none contains pure integer function get_length(i, fmt) result(o) integer, intent(in) :: i character(*), intent(in) :: fmt integer, parameter :: MAX_STR = 100 character(MAX_STR) :: s write(s, fmt) i o = len_trim(s) end function get_length pure function get_string(i) result(o) integer, intent(in) :: i character(4), parameter :: fmt = "(i0)" character(len=get_length(i, fmt)) :: o write(o, fmt) i end function get_string end module character_02_mod program character_02 use character_02_mod implicit none if (get_string(3252) /= "3252") error stop end program character_02 lfortran-lfortran-2f73434/integration_tests/modules_52.f900000664000175000017500000000063215141516316023677 0ustar alastairalastairmodule module_52_fpm_cmd_new contains subroutine validate_toml_data(input) use module_52_tomlf_de, only : toml_parse use module_52_tomlf_type, only : toml_table implicit none character(len=:), intent(in), allocatable :: input(:) type(toml_table), allocatable :: table if (allocated(table)) deallocate(table) call toml_parse(table, input) end subroutine validate_toml_data end module module_52_fpm_cmd_new lfortran-lfortran-2f73434/integration_tests/select_rank_07.f900000664000175000017500000000140115141516316024514 0ustar alastairalastairprogram select_rank_07 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(inout) :: x(..) integer, save :: a(2) = [5, 3] integer, save :: b(2, 3) = reshape([6, 5, 4, 3, 2, 1], [2, 3]) select rank(x) rank (1) x = a print *, x if (x(1) /= 5 .or. x(2) /= 3) error stop rank (2) x = b print *, x if (x(1,1) /= 6 .or. x(2,1) /= 5 .or. x(1,2) /= 4 .or. & x(2,2) /= 3 .or. x(1,3) /= 2 .or. x(2,3) /= 1) error stop end select end subroutine check end program select_rank_07 lfortran-lfortran-2f73434/integration_tests/operator_overloading_20.f900000664000175000017500000000134415141516316026447 0ustar alastairalastairmodule operator_overloading_20_mod implicit none type :: Vector2D real :: x, y contains procedure :: add generic :: operator(+) => add end type Vector2D contains type(Vector2D) function add(this, that) class(Vector2D), intent(in) :: this, that add%x = this%x + that%x add%y = this%y + that%y end function add end module operator_overloading_20_mod program operator_overloading_20 use operator_overloading_20_mod implicit none type(Vector2D) :: v1, v2, v3 v1 = Vector2D(1.0, 2.0) v2 = Vector2D(3.0, 4.0) v3 = v1 + v2 if (abs(v3%x - 4.0) > 1e-5) error stop if (abs(v3%y - 6.0) > 1e-5) error stop end program operator_overloading_20 lfortran-lfortran-2f73434/integration_tests/class_72.f900000664000175000017500000000133015141516316023332 0ustar alastairalastairmodule class_72_mod implicit none private public :: version_t type :: version_t integer :: major contains procedure :: greater generic, public :: operator(>) => greater end type version_t contains elemental function greater(lhs, rhs) result(is_greater) class(version_t), intent(in) :: lhs, rhs logical :: is_greater is_greater = lhs%major > rhs%major end function greater end module class_72_mod program class_72 use class_72_mod implicit none type(version_t), allocatable :: v1(:) type(version_t) :: v2 allocate(v1(2)) v1(1) = version_t(5) v2 = version_t(6) if (v1(1) > v2) error stop end program class_72 lfortran-lfortran-2f73434/integration_tests/file_23.f900000664000175000017500000000167015141516316023147 0ustar alastairalastair! Testing different kinds of integer variables as unit number. program file_23 type :: file_t integer(1) :: iunit_1 integer(2) :: iunit_2 integer(4) :: iunit_4 integer(8) :: iunit_8 end type file_t type(file_t) :: f character(30) :: str open(newunit=f%iunit_1, file='file_23_data.txt') read(f%iunit_1, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_1) open(newunit=f%iunit_2, file='file_23_data.txt') read(f%iunit_2, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_2) open(newunit=f%iunit_4, file='file_23_data.txt') read(f%iunit_4, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_4) open(newunit=f%iunit_8, file='file_23_data.txt') read(f%iunit_8, *) str print *, str if(str /= "HelloWorld!") error stop close(f%iunit_8) end program file_23lfortran-lfortran-2f73434/integration_tests/arrays_intrin_04.f900000664000175000017500000000052615141516316025112 0ustar alastairalastairprogram arrays_intrin_04 integer :: i, j integer, parameter :: dp = kind(0.d0) real(dp) :: x(3, 5), xdiff do i = 1, 3 do j = 1, 5 x(i, j) = (i + j) / 7._dp end do end do xdiff = abs(maxval(x) - (8._dp / 7)) print *, xdiff, maxval(x) if( xdiff > 1e-6_dp ) error stop end program lfortran-lfortran-2f73434/integration_tests/template_commutative.f900000664000175000017500000000405415141516316026153 0ustar alastairalastairmodule template_commutative_m implicit none public requirement magma_r(T, bin, equal) type, deferred :: T pure elemental function bin(x, y) result(bin) type(T), intent(in) :: x type(T), intent(in) :: y type(T) :: bin end function pure elemental function equal(x, y) result(equal) type(T), intent(in) :: x type(T), intent(in) :: y ! type(T) :: equal logical :: equal end function end requirement template commutative_prop(T, bin, equal) require :: magma_r(T, bin, equal) contains pure function commutative_p(x, y) result(prop) interface operator(==) procedure equal end interface type(T), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template template alt_commutative_prop(bin, equal) require :: magma_r(integer, bin, equal) contains pure function commutative_p(x, y) result(prop) interface operator(==) procedure equal end interface type(integer), intent(in) :: x, y type(logical) :: prop prop = bin(x,y) == bin(y,x) end function end template end module template_commutative_m program test_template_commutative_p use template_commutative_m instantiate alt_commutative_prop(operator(+), operator(==)), only: plus_comm => commutative_p instantiate commutative_prop(integer, operator(+), operator(==)), only: int_plus_comm => commutative_p instantiate alt_commutative_prop(operator(-), operator(==)), only: minus_comm => commutative_p instantiate commutative_prop(integer, operator(-), operator(==)), only: int_minus_comm => commutative_p print *, "test commutative" print *, "plus_comm: ", plus_comm(3, 4) print *, "int_plus_comm: ", int_plus_comm(3, 4) print *, "minus_comm: ", minus_comm(3, 4) print *, "int_minus_comm: ", int_minus_comm(3, 4) end program lfortran-lfortran-2f73434/integration_tests/namelist_18.f900000664000175000017500000000175615141516316024055 0ustar alastairalastairprogram test_namelist_derived_nested implicit none type :: inner_t integer :: vec(2) real :: mat(2, 2) end type type :: outer_t type(inner_t) :: inner integer :: tag real :: arr(3) end type type(outer_t) :: o namelist /nml/ o o%inner%vec = [10, 20] o%inner%mat = reshape([1.0, 2.0, 3.0, 4.0], [2, 2]) o%tag = 7 o%arr = [5.5, 6.5, 7.5] open(unit=10, file='namelist_dt_18.dat', status='replace', form='formatted') write(10, nml=nml) close(10) o%inner%vec = 0 o%inner%mat = 0.0 o%tag = 0 o%arr = 0.0 open(unit=10, file='namelist_dt_18.dat', status='old', form='formatted') read(10, nml=nml) close(10) if (any(o%inner%vec /= [10, 20])) error stop if (any(abs(o%inner%mat - reshape([1.0, 2.0, 3.0, 4.0], [2, 2])) > 1.0e-5)) error stop if (o%tag /= 7) error stop if (any(abs(o%arr - [5.5, 6.5, 7.5]) > 1.0e-5)) error stop end program test_namelist_derived_nested lfortran-lfortran-2f73434/integration_tests/write_fortran_01.f900000664000175000017500000000132415141516316025105 0ustar alastairalastairprogram write_fortran_01 implicit none character(len=100) :: output write(output, '(A)') "Hello" if (trim(output) /= "Hello") error stop "A format failed" write(output, '(I0)') 42 if (trim(output) /= "42") error stop "I0 format failed" write(output, '(I5)') 42 if (output(1:5) /= " 42") error stop "I5 format failed" write(output, '(F8.2)') 3.14159 if (trim(adjustl(output)) /= "3.14") error stop "F8.2 format failed" write(output, '(E12.4)') 1.23e-5 if (index(output, "123") == 0) error stop "E12.4 format failed" write(output, *) 123 if (trim(adjustl(output)) /= "123") error stop "Default format failed" end program write_fortran_01 lfortran-lfortran-2f73434/integration_tests/floor_02.f900000664000175000017500000000123515141516316023343 0ustar alastairalastairprogram floor_02 implicit none real, parameter :: a1 = 3.3 ! 3 real, parameter :: a2 = 3.5 ! 3 real, parameter :: a3 = 3.7 ! 3 real, parameter :: b1 = -3.3 ! -4 real, parameter :: b2 = -3.5 ! -4 real, parameter :: b3 = -3.7 ! -4 integer, parameter :: x1 = floor(a1) ! 3 integer, parameter :: x2 = floor(a2) ! 3 integer, parameter :: x3 = floor(a3) ! 3 integer, parameter :: y1 = floor(b1) ! -4 integer, parameter :: y2 = floor(b2) ! -4 integer, parameter :: y3 = floor(b3) ! -4 if(x1 /= 3 .or. x2 /= 3 .or. x3 /= 3) error stop if(y1 /= -4 .or. y2 /= -4 .or. y3 /= -4) error stop print*, x1, x2, x3 print*, y1, y2, y3 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_174.f900000664000175000017500000000072115141516316024500 0ustar alastairalastairprogram intrinsics_174 integer :: y(1) integer :: z(1) integer :: w(1) y = [6] z = [5] w = [5] print *, shape([[1., 2., 3.], [4., 5., 6.]]) if (any(shape([[1., 2., 3.], [4., 5., 6.]]) /= y)) error stop print *, shape([[1., 2., 3.], [4., 5.]]) if (any(shape([[1., 2., 3.], [4., 5.]]) /= z)) error stop print *, shape([[1., 2.], [4., 5., 6.]]) if (any(shape([[1., 2.], [4., 5., 6.]]) /= w)) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_21a.f900000664000175000017500000000074715141516316026575 0ustar alastairalastairmodule math_separate_compilation_21 implicit none interface logspace module function func1(n, base) result(res) integer, intent(in) :: n integer, intent(in) :: base real :: res(max(n,0)) end function func1 module function func2(n, base) result(res) integer, intent(in) :: n real, intent(in) :: base integer :: res(max(n, 0)) end function func2 end interface end modulelfortran-lfortran-2f73434/integration_tests/common_13.f900000664000175000017500000000071715141516316023520 0ustar alastairalastairblock data integer myint, myzero integer myarr common /myblock/ myint, myzero, /arrblock/ myarr(10) data myint/44/ data myarr/1,2,3,4,5,6,7,8,9,10/ end program common_13 implicit none integer myint, myzero integer myarr common /myblock/ myint, myzero, /arrblock/ myarr(10) if (myint /= 44) error stop if (myzero /= 0) error stop if (any(myarr /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_251.f900000664000175000017500000000361615141516316024502 0ustar alastairalastairprogram intrinsics_251 use, intrinsic :: iso_fortran_env, only: sp => real32, dp => real64 real(sp), parameter :: r1 = erf(1.1_sp) real(dp), parameter :: r2 = erf(40.12_dp) real(sp), parameter :: ar1(3) = erf([0.5_sp, -1.5_sp, 2.2_sp]) real(dp), parameter :: ar2(2) = erf([-0.2_dp, 0.0_dp]) real(sp) :: x real(dp) :: y, z real(sp) :: arr1(3) real(dp) :: arr2(3), res(3) x = 6.738377383_sp y = 3.1473863781_dp z = 7389.83936383_dp print *, erf(x) if (abs(erf(x) - 1.00000000e+00_sp) > 1e-6) error stop print *, erf(y) if (abs(erf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, erf(z) if (abs(erf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_sp y = -3.1473863781_dp z = -7389.83936383_dp print *, erf(x) if (abs(erf(x) - (-1.00000000e+00_sp)) > 1e-6) error stop print *, erf(y) if (abs(erf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, erf(z) if (abs(erf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, r1 if (abs(r1 - 8.80205095e-01_sp) > 1e-6_sp) error stop print *, r2 if (abs(r2 - 1.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [5.20499885e-01_sp, -9.66105163e-01_sp, 9.98137176e-01_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [-2.22702589210478474e-01_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_sp, -3.1473863781_sp, -7389.83936383_sp] print *, erf(arr1) if (any(abs(erf(arr1) - [-1.00000000e+00_sp, -9.99991477e-01_sp, -1.00000000e+00_sp]) > 1e-6_sp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = erf(arr2) print *, res if (any(abs(res - [1.00000000000000000e+00_dp, 9.99991455910536065e-01_dp, 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_232.f900000664000175000017500000000263715141516316024503 0ustar alastairalastairprogram intrinsics_232 implicit none integer, parameter :: i1 = iparity([1,2,3,4,5,6,7,8,9,10,11]) integer(8), parameter :: i2 = product([1, 2, 3], [.true., .true., .true.]) integer(4), parameter :: i3 = product([11, 2, 5], 1, mask = [.true., .false., .true.]) integer :: i(10) = [1,2,3,4,5,6,7,8,9,10] integer :: x(5) = [ 1, 2, 3, 4, 5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] integer :: dim = 1 print *, i1 if ( i1 /= 0 ) error stop print *, i2 if ( i2 /= 6 ) error stop print *, i3 if ( i3 /= 55 ) error stop print *, iparity( array = x, mask = mask ) if ( .not. iparity( array = x, mask = mask ) == 7 ) error stop print *, iparity( x, mask = mask) if ( .not. iparity( x, mask = mask ) == 7 ) error stop print *, iparity( x, mask ) if ( .not. iparity( x, mask ) == 7 ) error stop print *, iparity( x, mask = mask, dim = dim ) if ( .not. iparity( x, mask = mask, dim = dim ) == 7 ) error stop print *, iparity([1,2,4,5,6,8,10,11]) if ( iparity([1,2,4,5,6,8,10,11]) /= 13 ) error stop print *, iparity(i) if ( iparity(i) /= 11 ) error stop print *, iparity(i, [.true., .false., .true., .false., .true., .false., .true., .false., .true., .false.]) if ( iparity(i, [.true., .false., .true., .false., .true., .false., .true., .false., .true., .false.]) /= 9 ) error stop end programlfortran-lfortran-2f73434/integration_tests/precision_03.f900000664000175000017500000000014515141516316024215 0ustar alastairalastairprogram precision_03 print *, 3.0*3.1 if (abs((3.0*3.1) - 9.29999924) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/associate_21.f900000664000175000017500000000055315141516316024200 0ustar alastairalastairprogram associate_21 use associate_21_mod_b type(model_t) :: tmp_model allocate(tmp_model%dependency(1)) call tmp_model%update_dependency(1, 5) !!! TODO: Need to associate properly and handle integer pointer ! if (tmp_model%dependency(1)%name /= "LFortran") error stop ! if (tmp_model%dependency(1)%key /= 5) error stop end programlfortran-lfortran-2f73434/integration_tests/types_12.f900000664000175000017500000000044115141516316023365 0ustar alastairalastairprogram types_12 use iso_c_binding, only: c_int, c_double implicit none interface integer(c_int) function f(a, b) result(r) import :: c_int, c_double integer(c_int), value, intent(in) :: a real(c_double), value, intent(in) :: b end function end interface end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_14.f900000664000175000017500000000031315141516316026423 0ustar alastairalastairprogram separate_compilation_14a use separate_compilation_14a_module print *, global_var print *, global_var_initialised if (global_var_initialised /= 89) error stop end program separate_compilation_14a lfortran-lfortran-2f73434/integration_tests/namelist_25.f900000664000175000017500000000200615141516316024040 0ustar alastairalastairprogram namelist_internal_read_array implicit none integer :: a, b, c real :: x character(len=20) :: name character(len=256) :: readme(7) namelist /EXPECTED/ a, b, name, x, c ! Initialize with default values a = 0 b = 0 c = 0 x = 0.0 name = '' ! Build the namelist input readme(1) = '&EXPECTED' readme(2) = ' a = 42' readme(3) = ' b = 100' readme(4) = ' name = "Hello"' readme(5) = ' x = 3.14' readme(6) = ' c = -7' readme(7) = '/' read(readme, nml=EXPECTED) if (a /= 42) error stop "a has wrong value" if (b /= 100) error stop "b has wrong value" if (c /= -7) error stop "c has wrong value" if (abs(x - 3.14) > 1.0e-5) error stop "x has wrong value" if (trim(name) /= "Hello") error stop "name has wrong value" print *, 'a =', a print *, 'b =', b print *, 'c =', c print *, 'x =', x print *, 'name = "' // trim(name) // '"' print *, 'All tests passed!' end program namelist_internal_read_array lfortran-lfortran-2f73434/integration_tests/intrinsics_386.f900000664000175000017500000000021615141516316024504 0ustar alastairalastairprogram main complex :: x(2) = [(1.0, 2.0), (3.0, 4.0)] print *, product(x) if (product(x) /= (-5.0, 10.0)) error stop end programlfortran-lfortran-2f73434/integration_tests/character_19.f900000664000175000017500000000152315141516316024166 0ustar alastairalastairprogram character_19 implicit none character(len=4) :: test_char = "2021" character(len=:), allocatable :: alloc_char logical :: result ! Test 1: passing character(len=4) to function expecting character(len=1) ! Should use first character only result = isdigit(test_char) if (.not. result) error stop ! Test 2: passing allocatable character with runtime length ! Should also use first character only alloc_char = "1234" result = isdigit(alloc_char) if (.not. result) error stop ! Test 3: allocatable with different content alloc_char = "9999" result = isdigit(alloc_char) if (result) error stop contains logical function isdigit(c) character(len=1), intent(in) :: c isdigit = index("12",c) > 0 end function isdigit end program character_19lfortran-lfortran-2f73434/integration_tests/parsing_03.f900000664000175000017500000000017015141516316023663 0ustar alastairalastairPROGRAM parsing_03 INTEGER :: tes INTEGER :: res tes = 1 res = tes * 2 print *, res, tes END PROGRAMlfortran-lfortran-2f73434/integration_tests/derived_types_15.f900000664000175000017500000000157515141516316025103 0ustar alastairalastairmodule derived_types_15_module_1 implicit none private public :: t_1 type t_1 real :: i contains generic :: compute => multiply, sqrt_subtract procedure :: multiply procedure :: sqrt_subtract end type t_1 contains function multiply(self, j) result(res) class(t_1), intent(in) :: self real, intent(in) :: j real :: res res = self%i * j end function multiply function sqrt_subtract(self, j) result(res) class(t_1), intent(in) :: self integer, intent(in) :: j real :: res res = self%i - (j ** 0.5) end function sqrt_subtract end module program name use derived_types_15_module_1 implicit none type(t_1) :: type_1 type_1%i = 100.0 if (type_1%compute(5.0) /= 500) error stop if (type_1%compute(2500) /= 50) error stop end program name lfortran-lfortran-2f73434/integration_tests/string_42.f900000664000175000017500000000045615141516316023540 0ustar alastairalastairprogram string_42 implicit none character(len=2), allocatable :: line character(len=2) :: c allocate(character(len=2) :: line) line = "ab" read(line, *) c ! Test reading from allocatable string. print *, c if(c /= "ab") error stop end program string_42lfortran-lfortran-2f73434/integration_tests/string_04.f900000664000175000017500000000104315141516316023527 0ustar alastairalastairprogram string_04 implicit none character(len = 40), allocatable :: user_data(:) character, allocatable :: greetings(:) character(len=:), allocatable :: str allocate(user_data(3)) user_data(1) = 'Mr. ' user_data(2) = 'Rowan ' user_data(3) = 'Atkinson' allocate(greetings(5)) greetings(1) = 'h' greetings(2) = 'e' greetings(3) = 'l' greetings(4) = 'l' greetings(5) = 'o' print *, 'Here is ', user_data(1), user_data(2), user_data(3) print *, greetings allocate(character(len=8)::str) str = 'abcd' if (len(str(2:)) /= 3) error stop end program lfortran-lfortran-2f73434/integration_tests/class_98.f900000664000175000017500000000072115141516316023345 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/7952 ! move_alloc with unallocated source must deallocate destination ! Exact MRE from issue body program badalloc implicit none type,abstract :: foo end type foo type, extends(foo) :: bar end type bar type(bar), allocatable :: x class(foo), allocatable :: y call move_alloc(x, y) if(allocated(y)) error stop 'Y SHOULD BE UNALLOCATED!' print "(A)", 'Y IS UNALLOCATED.' end program badalloc lfortran-lfortran-2f73434/integration_tests/namelist_23.f900000664000175000017500000000172415141516316024044 0ustar alastairalastairprogram test_namelist_internal_proc implicit none integer :: act_i real :: act_r character(len=10) :: act_c logical :: act_l integer :: lun namelist /act_cli/ act_i namelist /act_cli/ act_r, act_c namelist /act_cli/ act_l act_i = 42 act_r = 3.5 act_c = 'hello' act_l = .true. call write_namelist() act_i = 0 act_r = 0.0 act_c = '' act_l = .false. open(unit=10, file='namelist_23.dat', status='old', form='formatted') read(10, nml=act_cli) close(10) if (act_i /= 42) error stop if (abs(act_r - 3.5) > 1.0e-5) error stop if (act_c /= 'hello') error stop if (.not. act_l) error stop contains subroutine write_namelist() open(file='namelist_23.dat', newunit=lun, status='replace', form='formatted') write(lun, nml=act_cli) close(unit=lun) end subroutine write_namelist end program test_namelist_internal_proc lfortran-lfortran-2f73434/integration_tests/bits_04.f900000664000175000017500000000501015141516316023160 0ustar alastairalastairprogram bits_04 implicit none if (bgt(10, 4) .neqv. .true.) error stop if (bgt(10, -4) .neqv. .false.) error stop if (bgt(-10, 4) .neqv. .true.) error stop if (bgt(-10, -4) .neqv. .false.) error stop if (bgt(10, 0) .neqv. .true.) error stop if (bgt(-10, 0) .neqv. .true.) error stop if (bgt(10_8, 4_8) .neqv. .true.) error stop if (bgt(10_8, -4_8) .neqv. .false.) error stop if (bgt(-10_8, 4_8) .neqv. .true.) error stop if (bgt(-10_8, -4_8) .neqv. .false.) error stop if (bgt(10_8, 0_8) .neqv. .true.) error stop if (bgt(-10_8, 0_8) .neqv. .true.) error stop if (bge(10, 4) .neqv. .true.) error stop if (bge(10, -4) .neqv. .false.) error stop if (bge(-10, 4) .neqv. .true.) error stop if (bge(-10, -4) .neqv. .false.) error stop if (bge(10, 0) .neqv. .true.) error stop if (bge(-10, 0) .neqv. .true.) error stop if (bge(-10, -10) .neqv. .true.) error stop if (bge(10_8, 4_8) .neqv. .true.) error stop if (bge(10_8, -4_8) .neqv. .false.) error stop if (bge(-10_8, 4_8) .neqv. .true.) error stop if (bge(-10_8, -4_8) .neqv. .false.) error stop if (bge(10_8, 0_8) .neqv. .true.) error stop if (bge(-10_8, 0_8) .neqv. .true.) error stop if (bge(-10_8, -10_8) .neqv. .true.) error stop if (ble(10, 4) .neqv. .false.) error stop if (ble(10, -4) .neqv. .true.) error stop if (ble(-10, 4) .neqv. .false.) error stop if (ble(-10, -4) .neqv. .true.) error stop if (ble(10, 0) .neqv. .false.) error stop if (ble(-10, 0) .neqv. .false.) error stop if (ble(-10, -10) .neqv. .true.) error stop if (ble(10_8, 4_8) .neqv. .false.) error stop if (ble(10_8, -4_8) .neqv. .true.) error stop if (ble(-10_8, 4_8) .neqv. .false.) error stop if (ble(-10_8, -4_8) .neqv. .true.) error stop if (ble(10_8, 0_8) .neqv. .false.) error stop if (ble(-10_8, 0_8) .neqv. .false.) error stop if (ble(-10_8, -10_8) .neqv. .true.) error stop if (blt(10, 4) .neqv. .false.) error stop if (blt(10, -4) .neqv. .true.) error stop if (blt(-10, 4) .neqv. .false.) error stop if (blt(-10, -4) .neqv. .true.) error stop if (blt(10, 0) .neqv. .false.) error stop if (blt(-10, 0) .neqv. .false.) error stop if (blt(10_8, 4_8) .neqv. .false.) error stop if (blt(10_8, -4_8) .neqv. .true.) error stop if (blt(-10_8, 4_8) .neqv. .false.) error stop if (blt(-10_8, -4_8) .neqv. .true.) error stop if (blt(10_8, 0_8) .neqv. .false.) error stop if (blt(-10_8, 0_8) .neqv. .false.) error stop end programlfortran-lfortran-2f73434/integration_tests/functions_41.f900000664000175000017500000000065515141516316024242 0ustar alastairalastairprogram functions_41 implicit none call notrecursive_sub print *, notrecursive_fun() contains non_recursive subroutine notrecursive_sub print *, "This is a non-recursive subroutine" end subroutine notrecursive_sub non_recursive integer function notrecursive_fun() print *, "This is a non-recursive function" notrecursive_fun = 1 end function notrecursive_fun end program functions_41 lfortran-lfortran-2f73434/integration_tests/transfer_02.f900000664000175000017500000000052215141516316024044 0ustar alastairalastairprogram transfer_02 integer :: result double precision :: d complex :: result1 real :: r d = 3.14D0 result = transfer(d, result) print *, result if (result /= 1374389535) error stop r = 1.0 result1 = transfer(r, result1) print *, result1 if( real(result1) /= 1.0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_21.f900000664000175000017500000000065215141516316026427 0ustar alastairalastairprogram separate_compilation_21 use math_separate_compilation_21 implicit none integer, parameter :: n = 2 integer, parameter :: base = 1 real :: result1(n) integer :: result2(n) result1 = logspace(n, base) result2 = logspace(n, base) print *, result1 print *, result2 if (.not. all(result1 == [1.0, 2.0])) error stop if (.not. all(result2 == [1, 2])) error stop end programlfortran-lfortran-2f73434/integration_tests/common_05.f900000664000175000017500000000130415141516316023512 0ustar alastairalastairprogram main integer :: a, b, c(5), d common / block_1 / a, b, c a = 1 b = 2 c = 3 d = 4 b = c(1) d = a + b a = 5 * b if (a > b) then d = a + b / d else if (c(1) > d) then d = a - b end if select case (a) case (1) d = a + b case (2) d = a - b case default d = a * b end select do while (a > b) d = a + b a = a - 1 end do do a = 1, c(1), 1 d = a + b end do print *, a, b, c, d if (a /= 4) error stop if (b /= 3) error stop do a = 1, 5 if (c(a) /= 3) error stop end do if (d /= 6) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_221.f900000664000175000017500000000075215141516316024475 0ustar alastairalastairprogram intrinsics_221 implicit none integer, parameter :: N = 10 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(N) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx print*, S if (abs(S - 1.983523537509) > 1e-7) error stop end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_06.f900000664000175000017500000000215315141516316026452 0ustar alastairalastairmodule operator_overloading_06_mo_vec type :: typ1 real :: x, y contains procedure :: diff, neg generic :: operator(-) => diff, neg end type typ1 ! extended type type, extends(typ1) :: typ2 real :: z end type typ2 contains pure type(typ1) function diff(this, that) class(typ1), intent(in) :: this, that diff = typ1(this%x - that%x, this%y - that%y) end function diff pure type(typ1) function neg(this) class(typ1), intent(in) :: this neg = typ1(-this%x, -this%y) end function neg end module operator_overloading_06_mo_vec program vec_test use operator_overloading_06_mo_vec, only: typ2, typ1 type(typ2) :: var1 = typ2(1., 3., 5.), var2 = typ2(2., 4., 6.) type(typ1) :: result print *, var1, var2 print *, -var2 result = -var2 if( abs(result%x + 2.0) > 1e-8 ) error stop if( abs(result%y + 4.0) > 1e-8 ) error stop print *, var1 - var2 result = var1 - var2 if( abs(result%x + 1.0) > 1e-8 ) error stop if( abs(result%y + 1.0) > 1e-8 ) error stop end program vec_test lfortran-lfortran-2f73434/integration_tests/class_88.f900000664000175000017500000000222515141516316023345 0ustar alastairalastairmodule class_88_m type t integer :: n = 0 contains procedure :: tbp => f end type contains function f(this) class(t), pointer, intent(in) :: this integer, pointer :: f f => this%n end function f end module program test use class_88_m implicit none type(t), target :: xt class(t), pointer :: xp integer, pointer :: result_ptr ! Initialize xt%n = 42 xp => xt ! Test type-bound procedure call with type variable result_ptr => xt%tbp() print *, result_ptr, xt%tbp() if (result_ptr /= 42) error stop "Failed: xt%tbp() should return 42" ! Test type-bound procedure call with class pointer result_ptr => xp%tbp() print *, result_ptr, xp%tbp() if (result_ptr /= 42) error stop "Failed: xp%tbp() should return 42" ! Test assignment through pointer-returning TBP with type variable xt%tbp() = 99 print *, xt%tbp() if (xt%n /= 99) error stop "Failed: xt%tbp() = 99 should set xt%n to 99" ! Test assignment through pointer-returning TBP with class pointer xp%tbp() = 123 print *, xp%tbp() if (xt%n /= 123) error stop "Failed: xp%tbp() = 123 should set xt%n to 123" print *, "OK" end program test lfortran-lfortran-2f73434/integration_tests/common_18.f900000664000175000017500000000137115141516316023522 0ustar alastairalastair! Test: COMMON block with reordered members ! This tests storage association with different member orderings ! Main: real(8), int, int vs Subroutine: int, int, real(8) program common_18 implicit none real(8) :: r8 integer :: i1, i2 common /data/ r8, i1, i2 r8 = 3.14159d0 i1 = 42 i2 = 99 call sub_reordered() print *, "PASS: common_18" end program subroutine sub_reordered() implicit none integer :: j1, j2 real(8) :: s8 common /data/ j1, j2, s8 ! j1 overlaps first 4 bytes of r8, j2 overlaps second 4 bytes of r8 ! s8 overlaps i1 and i2 (reinterpreted as real(8)) ! Just verify we can access without crashing - values will be reinterpreted j1 = 1 j2 = 2 s8 = 1.0d0 end subroutine lfortran-lfortran-2f73434/integration_tests/namelist_02.f900000664000175000017500000000047715141516316024045 0ustar alastairalastairprogram namelist_01 implicit none integer :: count = 10 integer :: max_iter = 100 real :: tolerance = 1.0e-6 real :: factor = 1.5 logical :: verbose = .false. character(len=30) :: method = 'default' namelist /config/ count, max_iter, tolerance, factor, verbose, method end program namelist_01 lfortran-lfortran-2f73434/integration_tests/format_15.f900000664000175000017500000000016615141516316023520 0ustar alastairalastairprogram format_15 integer ::i 10 FORMAT (5A,I100) write (*,10) ('*',i=1,5), 12345678 end program format_15lfortran-lfortran-2f73434/integration_tests/types_15.f900000664000175000017500000000164215141516316023374 0ustar alastairalastairprogram types_15 implicit none integer, parameter :: dp = kind(0.d0) integer(kind=4) :: n_src, n_des real(kind=4) :: z_src, z_des integer(kind=8) :: n_big_src, n_big_des real(dp) :: z_big_src, z_big_des n_src = 2 n_big_src = 2_8 z_src = 3.14 z_big_src = 3.14_dp print *, n_src, n_big_src, z_src, z_big_src n_des = n_src n_big_des = n_big_src z_des = z_src z_big_des = z_big_src print *, n_des, n_big_des, z_des, z_big_des n_des = n_big_src n_big_des = z_src z_des = z_big_src z_big_des = n_src print *, n_des, n_big_des, z_des, z_big_des n_des = z_src n_big_des = z_big_src z_des = n_src z_big_des = n_big_src print *, n_des, n_big_des, z_des, z_big_des n_des = z_big_src n_big_des = n_src z_des = n_big_src z_big_des = z_src print *, n_des, n_big_des, z_des, z_big_des end program lfortran-lfortran-2f73434/integration_tests/intrinsics_142.f900000664000175000017500000000155215141516316024476 0ustar alastairalastairprogram intrinsics_142 integer, dimension(3) :: a, b integer(8), dimension(5) :: c, d integer(8), dimension(3) :: e integer :: res integer(8) :: res_8 a = [1, 2, 3] b = [4, 5, 6] c = [1_8, 2_8, 3_8, 4_8, 5_8] d = [6_8, 7_8, 8_8, 9_8, 10_8] e = [6_8, 7_8, 8_8] res = dot_product([1, 2, 3],[4, 5, 6]) print *, res if (res /= 32) error stop res = dot_product(a, b) print *, res if (res /= 32) error stop res_8 = dot_product([1_8, 2_8, 3_8, 4_8, 5_8],[6_8, 7_8, 8_8, 9_8, 10_8]) print *, res_8 if (res_8 /= 130) error stop res_8 = dot_product(c, d) print *, res_8 if (res_8 /= 130) error stop res_8 = dot_product(a, e) print *, res_8 if (res_8 /= 44) error stop res_8 = dot_product(e, b) print *, res_8 if (res_8 /= 107) error stop end program intrinsics_142 lfortran-lfortran-2f73434/integration_tests/arrays_69.f900000664000175000017500000000733715141516316023551 0ustar alastairalastairprogram arrays_69 integer :: A(4) = [1,2,3,4] integer :: A1(3,3) = reshape([1,2,3,4,5,6,7,8,9], [3,3]) integer :: A2(2,2,2) = reshape([1,2,3,4,5,6,7,8], [2,2,2]) integer :: tmp(2,2) = reshape([5,5,5,5], [2,2]) !!!! ArrayItem = ArrayItem A([1,2]) = A([2,1]) if (A(1) /= 2 .or. A(2) /= 1) error stop A1([1,2],1) = A1([2,1],1) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 4 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 7 .or. A1(2,3) /= 8 .or. A1(3,3) /= 9) error stop A1([1,2],[2,3]) = A1([2,1],[2,3]) if (A1(1,1) /= 2 .or. A1(2,1) /= 1 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],1) = A1(1,[1,2]) if (A1(1,1) /= 2 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2(1,[1,2],[1,2]) = A2([1,2],[2,1],1) if (A2(1,1,1) /= 3 .or. A2(2,1,1) /= 2 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!!! ArrayItem = ArrayConstant A([1,2]) = [5,5] if (A(1) /= 5 .or. A(2) /= 5) error stop A1([1,2],1) = [5,5] if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 4 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A1([1,2],[1,2]) = tmp if (A1(1,1) /= 5 .or. A1(2,1) /= 5 .or. A1(3,1) /= 3 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 8 .or. A1(2,3) /= 7 .or. A1(3,3) /= 9) error stop A2([1,2],1,1) = [5,5] if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 1 .or. A2(2,1,2) /= 6 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop A2([1,2],1,[1,2]) = tmp if (A2(1,1,1) /= 5 .or. A2(2,1,1) /= 5 .or. A2(1,2,1) /= 4 .or. A2(2,2,1) /= 4 .or. & & A2(1,1,2) /= 5 .or. A2(2,1,2) /= 5 .or. A2(1,2,2) /= 2 .or. A2(2,2,2) /= 8) error stop !!! LHS and RHS contains common variable A = A([3,1,2,4]) if (A(1) /= 3 .or. A(2) /= 5 .or. A(3) /= 5 .or. A(4) /= 4) error stop A1 = A1(:,[3,2,1]) if (A1(1,1) /= 8 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 5 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A2 = A2(:,[2,1],:) if (A2(1,1,1) /= 4 .or. A2(2,1,1) /= 4 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 2 .or. A2(2,1,2) /= 8 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1(1,1:2) = A1(1,[2,1]) - A(1:2) if (A1(1,1) /= 2 .or. A1(2,1) /= 7 .or. A1(3,1) /= 9 .or. & & A1(1,2) /= 3 .or. A1(2,2) /= 5 .or. A1(3,2) /= 6 .or. & & A1(1,3) /= 5 .or. A1(2,3) /= 5 .or. A1(3,3) /= 3) error stop A1 = A1 * A1(1,1) if (A1(1,1) /= 4 .or. A1(2,1) /= 14 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 6 .or. A1(2,2) /= 10 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop A2(:,1,:) = A2(1,:,:) * A2(1,1,1) if (A2(1,1,1) /= 16 .or. A2(2,1,1) /= 20 .or. A2(1,2,1) /= 5 .or. A2(2,2,1) /= 5 .or. & & A2(1,1,2) /= 8 .or. A2(2,1,2) /= 20 .or. A2(1,2,2) /= 5 .or. A2(2,2,2) /= 5) error stop A1([2,1],[1,2]) = A1([1,2],[3,2]) * A1(2,1) if (A1(1,1) /= 140 .or. A1(2,1) /= 140 .or. A1(3,1) /= 18 .or. & & A1(1,2) /= 140 .or. A1(2,2) /= 84 .or. A1(3,2) /= 12 .or. & & A1(1,3) /= 10 .or. A1(2,3) /= 10 .or. A1(3,3) /= 6) error stop end programlfortran-lfortran-2f73434/integration_tests/interface_19.f900000664000175000017500000000257115141516316024176 0ustar alastairalastairmodule interface_19_mod implicit none abstract interface function FUNC_WITH_ARGS(x, args) result(f) implicit none real, intent(in) :: x real, intent(in) :: args(:) real :: f end function FUNC_WITH_ARGS end interface contains ! an implementation of the abstract interface 'FUNC_WITH_ARGS' function g0(x, args) result(f) implicit none real, intent(in) :: x real, intent(in) :: args(:) real :: f f = args(1)*x**2 + args(2)*x + args(3) end function g0 function interval_max(fun, args, grid_size) result(x) implicit none procedure(FUNC_WITH_ARGS) :: fun real, intent(in) :: args(:) integer, intent(in) :: grid_size real :: x real :: k integer :: i real :: fgrid(grid_size) do i = 1, grid_size k = real(i) / grid_size !> function call with procedure variable fgrid(i) = fun(k, args) end do x = maxval(fgrid) end function interval_max end module interface_19_mod program interface_19 use interface_19_mod implicit none real :: res real :: args_i(3) = [1.0, -2.0, 1.0] integer, parameter :: grid_size_i = 10 res = interval_max(g0, args_i, grid_size_i) print *, res if (abs(res - 0.81_4) > 1.0e-13) error stop end program lfortran-lfortran-2f73434/integration_tests/string_100.f900000664000175000017500000000134015141516316023604 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/5901 ! Allocatable scalar character string with merge and concatenation ! Exact MRE from issue body module integertostring implicit none integer :: n(2) = [42,-1] contains pure function i0(n) character(:),allocatable :: i0 integer,intent(in) :: n character(range(n)+2) :: result write(result,"(I0)") n i0 = trim(adjustl(result)) end function i0 end module integertostring program initialtest use integertostring, only: i0, n implicit none character(:),allocatable:: string string = 'The answer is '//merge(i0(n(1)),i0(n(2)),n(1)>0)//'.' print *,'"'//string//'"' if (string /= 'The answer is 42.') error stop end program initialtest lfortran-lfortran-2f73434/integration_tests/namelist_06.f900000664000175000017500000000374515141516316024052 0ustar alastairalastairprogram namelist_mixed implicit none ! Define variables of mixed dimensions integer :: scalar integer :: vec(5) integer :: mat(3,3) integer :: cube(2,2,2) integer :: i, j, k ! Define namelist with all dimensions mixed together namelist /mixed/ scalar, vec, mat, cube ! Initialize scalar scalar = 42 ! Initialize vector (5 elements) vec = [10, 20, 30, 40, 50] ! Initialize matrix (3x3 = 9 elements) do j = 1, 3 do i = 1, 3 mat(i,j) = i + j * 10 end do end do ! Initialize cube (2x2x2 = 8 elements) do k = 1, 2 do j = 1, 2 do i = 1, 2 cube(i,j,k) = i + j*10 + k*100 end do end do end do ! Write namelist to file open(unit=10, file='namelist_mixed.dat', status='replace', form='formatted') write(10, nml=mixed) close(10) ! Reset all values to zero scalar = 0 vec = 0 mat = 0 cube = 0 ! Read namelist from file open(unit=10, file='namelist_mixed.dat', status='old', form='formatted') read(10, nml=mixed) close(10) ! Verify scalar if (scalar /= 42) error stop "Scalar mismatch" ! Verify vector if (vec(1) /= 10) error stop "vec(1) mismatch" if (vec(2) /= 20) error stop "vec(2) mismatch" if (vec(3) /= 30) error stop "vec(3) mismatch" if (vec(4) /= 40) error stop "vec(4) mismatch" if (vec(5) /= 50) error stop "vec(5) mismatch" ! Verify matrix do j = 1, 3 do i = 1, 3 if (mat(i,j) /= i + j * 10) then error stop "Matrix element mismatch" end if end do end do ! Verify cube do k = 1, 2 do j = 1, 2 do i = 1, 2 if (cube(i,j,k) /= i + j*10 + k*100) then error stop "Cube element mismatch" end if end do end do end do print *, "Mixed dimension namelist test passed!" end program namelist_mixed lfortran-lfortran-2f73434/integration_tests/arithmetic_if_01.f900000664000175000017500000000144215141516316025030 0ustar alastairalastairprogram arithmetic_if_01 integer :: x, c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_235.f900000664000175000017500000000606015141516316024500 0ustar alastairalastairprogram intrinsics_235 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 ! real(sp) :: x real(sp) :: y, z real(dp) :: a, b, c ! x = 971.72820_sp y = 23.82920_sp z = 62.739713_sp a = 9271.72826260_dp b = 23.82926260_dp c = 62.73971326260_dp ! print *, lgamma(x) ! if (abs(lgamma(x) - 5710.34375) > 1e-5) error stop print *, lgamma(y) if (abs(lgamma(y) - 5.10680733e+01) > 1e-5) error stop print *, lgamma(23.82920) if (abs(lgamma(23.82920) - 5.10680733e+01) > 1e-5) error stop ! print *, lgamma(z) ! if (abs(lgamma(z) - 1.95790390e+02) > 1e-5) error stop print *, lgamma(62.739713) if (abs(lgamma(62.739713) - 1.95790390e+02) > 1e-5) error stop print *, lgamma(a) if (abs(lgamma(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, lgamma(9271.72826260_dp) if (abs(lgamma(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, lgamma(b) if (abs(lgamma(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, lgamma(23.82926260_dp) if (abs(lgamma(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, lgamma(c) if (abs(lgamma(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, lgamma(62.73971326260_dp) if (abs(lgamma(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, algama(y) if (abs(algama(y) - 5.10680733e+01) > 1e-5) error stop print *, algama(23.82920) if (abs(algama(23.82920) - 5.10680733e+01) > 1e-5) error stop ! print *, algama(z) ! if (abs(algama(z) - 1.95790390e+02) > 1e-5) error stop print *, algama(62.739713) if (abs(algama(62.739713) - 1.95790390e+02) > 1e-5) error stop print *, algama(a) if (abs(algama(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, algama(9271.72826260_dp) if (abs(algama(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, algama(b) if (abs(algama(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, algama(23.82926260_dp) if (abs(algama(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, algama(c) if (abs(algama(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, algama(62.73971326260_dp) if (abs(algama(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, dlgama(a) if (abs(dlgama(a) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, dlgama(9271.72826260_dp) if (abs(dlgama(9271.72826260_dp) - 7.54193119924598432e+04_dp) > 1e-12) error stop print *, dlgama(b) if (abs(dlgama(b) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, dlgama(23.82926260_dp) if (abs(dlgama(23.82926260_dp) - 5.10682662991165941e+01_dp) > 1e-12) error stop print *, dlgama(c) if (abs(dlgama(c) - 1.95790392620801725e+02_dp) > 1e-12) error stop print *, dlgama(62.73971326260_dp) if (abs(dlgama(62.73971326260_dp) - 1.95790392620801725e+02_dp) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/interface_03.f900000664000175000017500000000076315141516316024170 0ustar alastairalastairprogram interface_03 implicit none interface subroutine a1(a) integer, intent(inout) :: a end subroutine end interface interface subroutine a2(a) integer, intent(inout) :: a end subroutine subroutine a3(a) real, intent(inout) :: a end subroutine end interface procedure(a1) :: sub contains subroutine X() interface subroutine a4(a) integer, intent(inout) :: a end subroutine end interface end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_209.f900000664000175000017500000002025115141516316024477 0ustar alastairalastairprogram intrinsics_209 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(sp) :: q,y,z real(dp) :: k,l,m real(dp) :: w(19) real(dp) :: large(38) real(sp) :: x(19) real(dp) :: expected_w(19) real(sp) :: expected_x(19) real(dp) :: expected_large(38) real(dp), parameter :: comp(38) = atand([988.522977022977_dp, 989.021978021978_dp, 989.520979020979_dp, & 990.01998001998_dp , 990.518981018981_dp, 991.017982017982_dp, 991.516983016983_dp, 992.015984015984_dp, & 992.514985014985_dp, 993.013986013986_dp, 993.512987012987_dp, 994.011988011988_dp, & 994.510989010989_dp, 995.00999000999_dp, 995.508991008991_dp, 996.007992007992_dp, & 996.506993006993_dp, 997.005994005994_dp, 997.504995004995_dp, & -988.522977022977_dp, -989.021978021978_dp, -989.520979020979_dp, -990.01998001998_dp , & -990.518981018981_dp, -991.017982017982_dp, -991.516983016983_dp, -992.015984015984_dp, & -992.514985014985_dp, -993.013986013986_dp, -993.512987012987_dp, -994.011988011988_dp, & -994.510989010989_dp, -995.00999000999_dp, -995.508991008991_dp, -996.007992007992_dp, & -996.506993006993_dp, -997.005994005994_dp, -997.504995004995_dp]) real(dp), parameter :: res(19) = atand([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_x(19) = atand([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.999_sp, -0.999_sp, -0.998_sp, -0.998_sp, -0.997_sp, & -0.997_sp, -0.996_sp, -0.996_sp, -0.995_sp, -0.995_sp, -0.994_sp, -0.994_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] x = [0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.999_sp, -0.999_sp, -0.998_sp, -0.998_sp, -0.997_sp, & -0.997_sp, -0.996_sp, -0.996_sp, -0.995_sp, -0.995_sp, -0.994_sp, -0.994_sp] large = [988.522977022977_dp, 989.021978021978_dp, 989.520979020979_dp ,990.01998001998_dp , & 990.518981018981_dp, 991.017982017982_dp, 991.516983016983_dp, 992.015984015984_dp, & 992.514985014985_dp, 993.013986013986_dp, 993.512987012987_dp, 994.011988011988_dp, & 994.510989010989_dp, 995.00999000999_dp, 995.508991008991_dp, 996.007992007992_dp, & 996.506993006993_dp, 997.005994005994_dp, 997.504995004995_dp, & -988.522977022977_dp, -989.021978021978_dp, -989.520979020979_dp, -990.01998001998_dp , & -990.518981018981_dp, -991.017982017982_dp, -991.516983016983_dp, -992.015984015984_dp, & -992.514985014985_dp, -993.013986013986_dp, -993.512987012987_dp, -994.011988011988_dp, & -994.510989010989_dp, -995.00999000999_dp, -995.508991008991_dp, -996.007992007992_dp, & -996.506993006993_dp, -997.005994005994_dp, -997.504995004995_dp] expected_w = [17.796630203668819_dp, 27.744370169482565_dp, 36.054618166461040_dp, & -17.796630203668819_dp, -27.744370169482565_dp, -36.054618166461040_dp, & -45.000000000000000_dp, -44.985686790326952_dp, -44.971366429413692_dp, & -44.957038913689956_dp, -44.942704239585503_dp, -44.928362403530095_dp, & -44.914013401953525_dp, -44.899657231285609_dp, -44.885293887956209_dp, & -44.870923368395196_dp, -44.856545669032499_dp, -44.842160786298116_dp, & -44.827768716622060_dp] expected_x = [17.7966309_sp, 27.7443714_sp, 36.0546188_sp, -17.7966309_sp, & -27.7443714_sp, -36.0546188_sp, -45.0000000_sp, -44.9713364_sp, -44.9713364_sp, & -44.9426460_sp, -44.9426460_sp, -44.9139252_sp, -44.9139252_sp, -44.8851776_sp, & -44.8851776_sp, -44.8564034_sp, -44.8564034_sp, -44.8275948_sp, -44.8275948_sp] expected_large = [89.942039020538502_dp, 89.942068264142364_dp, 89.942097478252023_dp, 89.942126662912045_dp, & 89.942155818166967_dp, 89.942184944061196_dp, 89.942214040639058_dp, 89.942243107944805_dp, & 89.942272146022574_dp, 89.942301154916436_dp, 89.942330134670371_dp, 89.942359085328249_dp, & 89.942388006933868_dp, 89.942416899530954_dp, 89.942445763163107_dp, 89.942474597873883_dp, & 89.942503403706695_dp, 89.942532180704944_dp, 89.942560928911888_dp, & -89.942039020538502_dp, -89.942068264142364_dp, -89.942097478252023_dp, -89.942126662912045_dp, & -89.942155818166967_dp, -89.942184944061196_dp, -89.942214040639058_dp, -89.942243107944805_dp, & -89.942272146022574_dp, -89.942301154916436_dp, -89.942330134670371_dp, -89.942359085328249_dp, & -89.942388006933868_dp, -89.942416899530954_dp, -89.942445763163107_dp, -89.942474597873883_dp, & -89.942503403706695_dp, -89.942532180704944_dp, -89.942560928911888_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(w) print *, atand(w(i)) if (abs(atand(w(i)) - expected_w(i)) > 1e-12_dp) error stop end do do i = 1, size(x) print *, atand(x(i)) if (abs(atand(x(i)) - expected_x(i)) > 1e-5_sp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i) - expected_x(i)) > 1e-5_sp) error stop end do do i = 1, size(large) print *, atand(large(i)) if (abs(atand(large(i)) - expected_large(i)) > 1e-12_dp) error stop end do do i = 1, size(comp) print *, comp(i) if (abs(comp(i) - expected_large(i)) > 1e-5_sp) error stop end do q = 0.123 y = 0.876 z = 0.542 k = 0.1237382_dp l = 0.8767382_dp m = 0.5427382_dp print *, atand(q) if (atand(q) - 7.01215982_sp > 1e-5) error stop print *, atand(y) if (atand(y) - 41.2183571_sp > 1e-5) error stop print *, atand(z) if (atand(z) - 28.4576912_sp > 1e-5) error stop print *, atand(0.123_sp) if (atand(0.123_sp) - 7.01216030_sp > 1e-5) error stop print *, atand(0.876_sp) if (atand(0.876_sp) - 41.2183571_sp > 1e-5) error stop print *, atand(0.542_sp) if (atand(0.542_sp) - 28.4576931_sp > 1e-5) error stop print *, atand(k) if (atand(k) - 7.0538217578390441_dp > 1e-12) error stop print *, atand(l) if (atand(l) - 41.242282419755384_dp > 1e-12) error stop print *, atand(m) if (atand(m) - 28.490374622093171_dp > 1e-12) error stop print *, atand(0.1237382_dp) if (atand(0.1237382_dp) - 7.0538217578390441_dp > 1e-12) error stop print *, atand(0.8767382_dp) if (atand(0.8767382_dp) - 41.242282419755391_dp > 1e-12) error stop print *, atand(0.5427382_dp) if (atand(0.5427382_dp) - 528.490374622093171_dp > 1e-12) error stop q = -0.123 y = -0.876 z = -0.542 k = -0.1237382_dp l = -0.8767382_dp m = -0.5427382_dp print *, atand(q) if (atand(q) - (-7.01215982_sp) > 1e-5) error stop print *, atand(y) if (atand(y) - (-41.2183571_sp) > 1e-5) error stop print *, atand(z) if (atand(z) - (-28.4576912_sp) > 1e-5) error stop print *, atand(-0.123_sp) if (atand(-0.123_sp) - (-7.01216030_sp) > 1e-5) error stop print *, atand(-0.876_sp) if (atand(-0.876_sp) - (-41.2183571_sp) > 1e-5) error stop print *, atand(-0.542_sp) if (atand(-0.542_sp) - (-28.4576931_sp) > 1e-5) error stop print *, atand(k) if (atand(k) - (-7.0538217578390441_sp) > 1e-12) error stop print *, atand(l) if (atand(l) - (-41.242282419755384_dp) > 1e-12) error stop print *, atand(m) if (atand(m) - (-28.490374622093171_dp) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_pow_test.f900000664000175000017500000000014315141516316025311 0ustar alastairalastairprogram complex2 complex :: x, y, z x = (3.0, 4.0) y = (3.0, 2.0) z = x**y print *, z end program lfortran-lfortran-2f73434/integration_tests/crlf_fixed_form.f900000664000175000017500000000017215141516316025050 0ustar alastairalastairC Fixed-form CRLF test with label program test 10 continue print *, 'hello * world' end lfortran-lfortran-2f73434/integration_tests/variables_03.f900000664000175000017500000000034615141516316024175 0ustar alastairalastairprogram variables_03 implicit none integer :: x logical :: b x = 2 b = (x /= 2) if (b) error stop b = (x == 2) if (.not. b) error stop b = .not. (x == 2) if (b) error stop b = (x == 2) b = .not. b if (b) error stop end program lfortran-lfortran-2f73434/integration_tests/file_03.f900000664000175000017500000000147015141516316023143 0ustar alastairalastairprogram file_03 implicit none integer :: no_of_students, roll_no, age, fd, i character(len = 20) :: first_name, last_name real :: weight ! for asserting/verification integer :: total_age = 0 real :: total_weight = 0.0 fd = 10 open(fd, file="file_03_data.txt") read(fd, *) no_of_students print *, "Total no of students is:", no_of_students do i = 1, no_of_students read(fd, *) roll_no, first_name, last_name, age, weight print *, roll_no, first_name, last_name, age, weight total_age = total_age + age total_weight = total_weight + weight end do print *, "total_age:", total_age print *, "total_weight:", total_weight if (total_age /= 150) error stop if (abs(total_weight - 519.600037) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_20.f900000664000175000017500000000037315141516316023673 0ustar alastairalastairprogram complex_20 complex(8), parameter :: x = (1.129D0, -2.12D0) real(8), parameter :: re = x%re real(8), parameter :: ri = x%im if (abs(re - 1.129D0) > 1e-15) error stop if (abs(ri - (-2.12D0)) > 1e-15) error stop end program lfortran-lfortran-2f73434/integration_tests/test_ieee_next_down.f900000664000175000017500000000453215141516316025757 0ustar alastairalastair! Test ieee_next_down function (Fortran 2018 standard) program ieee_next_down_01 use, intrinsic :: ieee_arithmetic, only: ieee_next_down, ieee_is_finite, ieee_next_up implicit none real(4) :: x_sp, next_sp real(8) :: x_dp, next_dp print *, "Testing ieee_next_down..." ! Test 1: Next down from positive value x_sp = 1.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(1.0) =", next_sp if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 2: Next down from negative value x_sp = -1.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(-1.0) =", next_sp if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 3: Next down from zero x_sp = 0.0 next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(0.0) =", next_sp if (next_sp >= 0.0) error stop "next_down(0.0) should be negative" ! Test 4: Relationship with spacing for positive numbers x_sp = 1.0 next_sp = ieee_next_down(x_sp) print *, "Difference: 1.0 - next_down(1.0) =", x_sp - next_sp print *, "spacing(1.0) =", spacing(x_sp) ! For next_down from positive x, the difference is spacing(next_down(x)) ! which is half of spacing(x) since we cross to lower exponent if (next_sp >= x_sp) error stop "next_down should be less than x" ! Test 5: Double precision x_dp = 1.0d0 next_dp = ieee_next_down(x_dp) print *, "ieee_next_down(1.0d0) =", next_dp if (next_dp >= x_dp) error stop "Should be less" ! Test 6: Large negative value should still give smaller value x_sp = -huge(x_sp) / 2.0 next_sp = ieee_next_down(x_sp) if (next_sp >= x_sp) error stop "Should be less even for large negative x" ! Test 7: From -huge(x) should give -infinity x_sp = -huge(x_sp) next_sp = ieee_next_down(x_sp) print *, "ieee_next_down(-huge) =", next_sp if (ieee_is_finite(next_sp)) error stop "next_down(-huge) should be -infinity" ! Test 8: Verify inverse relationship with next_up x_sp = 1.0 next_sp = ieee_next_down(x_sp) if (ieee_next_down(ieee_next_up(x_sp)) /= x_sp) then error stop "next_down(next_up(x)) should equal x" end if print *, "Inverse relationship verified" print *, "All ieee_next_down tests passed!" end program ieee_next_down_01 lfortran-lfortran-2f73434/integration_tests/derived_types_36.f900000664000175000017500000000233315141516316025077 0ustar alastairalastairmodule derived_types_36_my_mod type :: my_type sequence character(len=:), allocatable :: a end type interface write(formatted) module procedure :: write_formatted end interface contains subroutine write_formatted(mt, unit, iotype, v_list, iostat, iomsg) type(my_type), intent(in) :: mt integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: v_list(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, '(a)') mt%a end subroutine end module program derived_types_36 use derived_types_36_my_mod, only: my_type, write(formatted) implicit none type(my_type) :: x integer :: iostat character(len=20) :: iomsg, tmp character(len=20) :: arr_iomsg(2) x%a = "tmp234" tmp = "tmp1" print *, tmp open(10, form="formatted", file="derived_types_36_file.txt") write(10, '(dt)', iostat=iostat, iomsg=iomsg) x close(10) open(10, form="formatted", file="derived_types_36_file.txt") read(10, '(a)', iostat=iostat, iomsg=arr_iomsg(1)) tmp close(10) print *, tmp if (tmp /= "tmp234") error stop end program lfortran-lfortran-2f73434/integration_tests/types_09.f900000664000175000017500000000111315141516316023370 0ustar alastairalastairprogram types_09 use iso_c_binding, only: c_char implicit none integer, parameter :: ucs4=selected_char_kind("ISO_10646") character(1,ucs4), parameter :: nen=char(int(Z'5e74'),ucs4) contains subroutine f(s, s2) character(kind=c_char, len=:), allocatable, intent(in) :: s character(len=:), allocatable, intent(in) :: s2 character(kind=1, len=*), parameter :: lowercase = & & 'abcdefghijklmnopqrstuvwxyz' end subroutine subroutine s() use,intrinsic :: iso_fortran_env, only : int32 integer(int32) :: x = 1 end subroutine s end program lfortran-lfortran-2f73434/integration_tests/derived_types_78.f900000664000175000017500000000222415141516316025104 0ustar alastairalastairprogram derived_types_78 ! by @RonShepard in Fortran Discourse apart from write stmt below implicit none type ll_t character(:), allocatable :: text ! line of text. type(ll_t), allocatable :: history ! previous lines of text. end type ll_t type(ll_t), allocatable :: list call push( 'first line', list ) call push( 'second line', list ) call push( 'this is the last line', list ) call printall( list ) contains subroutine push( newtext, list ) ! push a new line of text into the linked list. character(*), intent(in) :: newtext type(ll_t), intent(inout), allocatable :: list type(ll_t), allocatable :: work allocate( work ) work%text = newtext print *, allocated(work%history) call move_alloc( from=list, to=work%history ) call move_alloc( from=work, to=list ) return end subroutine push recursive subroutine printall( list ) type(ll_t), intent(in) :: list if( allocated(list%history) ) call printall( list%history ) write(*,'(a)') '"'//list%text//'"' ! @harperjf added '"' and // return end subroutine printall end program lfortran-lfortran-2f73434/integration_tests/do_concurrent_05.f900000664000175000017500000000120415141516316025065 0ustar alastairalastair! equivalent to openmp_08.f90 subroutine increment_ctr(n, ctr) use omp_lib implicit none integer, intent(in) :: n real, intent(out) :: ctr real :: local_ctr integer :: i local_ctr = 1 do concurrent (i=1:n) reduce(*:local_ctr) local_ctr = local_ctr * 1.5 end do ctr = ctr + local_ctr end subroutine program do_concurrent_05 use omp_lib integer, parameter :: n = 10 real :: ctr real :: res = 1.5**10 call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if(abs((ctr - res)) > 0.0002 ) error stop end program lfortran-lfortran-2f73434/integration_tests/cpu_time_02_wasm.f900000664000175000017500000000056015141516316025056 0ustar alastairalastair! program cpu_time_02_wasm ! use iso_fortran_env, only: dp=>real64 ! implicit none ! real(dp) :: t1, t2 ! interface ! subroutine cpu_time(t) bind(js) ! import :: dp ! real(dp), intent(out) :: t ! end subroutine ! end interface ! call cpu_time(t1) ! print *, "Some computation" ! call cpu_time(t2) ! print *, "Total time: ", t2-t1 ! end program lfortran-lfortran-2f73434/integration_tests/format_31.f900000664000175000017500000000127715141516316023522 0ustar alastairalastairprogram format_31 implicit none call printit(3*1365+1) call printit(3*37+1) contains subroutine printit(ii) integer,intent(in) :: ii integer :: nz, kz character(len=*),parameter :: show32 = '(1x,"value=",i4,", value(bits)=",b32.32,1x,", trailz=",i3)' print '(a)', repeat('-',80) print show32, ii, ii, trailz(ii) call trimz(ii,nz,kz) print show32, kz, kz, trailz(kz) print '(b32.32)', 4096 print '(b32.16)', 4096 print '(b32)', 4096 print '(b32.8)', 4096 end subroutine printit subroutine trimz(v,nz,kz) integer,intent(in) :: v integer,intent(out) :: nz integer,intent(out) :: kz nz=trailz(v) kz=shiftr(v,nz) end subroutine trimz end program format_31lfortran-lfortran-2f73434/integration_tests/class_32.f900000664000175000017500000000403515141516316023333 0ustar alastairalastairmodule class_32_test_module implicit none type :: Composed integer :: x end type Composed type :: Base class(Composed), allocatable :: obj end type type :: Super integer :: x end type Super type, extends(Super) :: Derived integer :: y end type end module class_32_test_module program class_32 use class_32_test_module implicit none class(Composed), allocatable :: c class(Composed), allocatable :: d class(Base), allocatable :: c_base class(Base), allocatable :: d_base class(Super), allocatable :: c_super class(Derived), allocatable :: d_derived ! test case 1: assignment of class var to class var allocate(c) c%x = 1 print *, "c%x: ", c%x allocate(d) d%x = 42 print *, "d%x: ", d%x c = d print *, "c%x after assignment: ", c%x if (c%x /= 42) error stop d%x = 3 print *, "d%x: ", d%x ! verify deep copy print *, "c%x: ", c%x if (c%x == 3) error stop ! test case 2: assignment of class var to struct member class allocate(c_base) allocate(d_base) allocate(c_base%obj) ! needed because lfortran does not automatically allocate this allocate(d_base%obj) ! needed because lfortran does not automatically allocate this c_base%obj = c d_base%obj = d print *, "c_base%obj%x: ", c_base%obj%x if (c_base%obj%x /= 42) error stop print *, "d_base%obj%x: ", d_base%obj%x if (d_base%obj%x /= 3) error stop c%x = 20 print *, "c%x: ", c%x ! verify deep copy print *, "c_base%obj%x: ", c_base%obj%x if (c_base%obj%x == 20) error stop ! test case 3: assignment of derived class var to base class var allocate(c_super) c_super%x = 1 print *, "c_super%x: ", c_super%x allocate(d_derived) d_derived%x = 42 print *, "d_derived%x: ", d_derived%x c_super = d_derived print *, "c_super%x after assignment: ", c_super%x d_derived%x = 2 ! verify deep copy print *, "c_super%x after assignment: ", c_super%x if (c_super%x == 2) error stop end program class_32lfortran-lfortran-2f73434/integration_tests/intrinsics_06.f900000664000175000017500000000046515141516316024417 0ustar alastairalastairprogram intrinsics_06 real :: x integer, parameter :: dp = kind(0.d0) x = asin(0.84147098) print *, x x = acos(0.54030231) print *, x x = atan(1.5574077) print *, x x = datan(1.5574077_dp) print *, x x = asinh(1.1752012) print *, x x = acosh(1.5430806) print *, x x = atanh(0.76159416) print *, x end lfortran-lfortran-2f73434/integration_tests/modules_02.f900000664000175000017500000000060615141516316023673 0ustar alastairalastairmodule modules_02_a implicit none contains subroutine b() print *, "b()" end subroutine end module module modules_02_c implicit none contains subroutine d() print *, "d()" end subroutine subroutine e() print *, "e()" end subroutine end module program modules_02 use modules_02_a use modules_02_c, only: x=>d use modules_02_c, only: e implicit none call b() call x() call e() end lfortran-lfortran-2f73434/integration_tests/parameter_08.f900000664000175000017500000000053015141516316024205 0ustar alastairalastairprogram parameter_08 real, parameter :: A(*) = sin([1.0, 2.0, 3.0, 4.0]) real, parameter :: B(*) = sin(A) real, parameter :: C(*) = cos(B) print *, sum(A) if (abs(sum(A) - 1.13508582) > 1e-6) error stop print *, sum(B) if (abs(sum(B) - 0.988748252) > 1e-6) error stop print *, sum(C) if (abs(sum(C) - 3.20269895) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_94.f900000664000175000017500000000063215141516316024422 0ustar alastairalastairprogram intrinsics_94 real :: x,y real(kind=8) :: a, b x = 3.0 y = 4.0 print *, hypot(x,y) if (abs(hypot(x,y) - 5.0) > 1e-6) error stop print *, hypot(3.0D0, 4.0D0) if (abs(hypot(3.0D0, 4.0D0) - 5.0D0) > 1e-9) error stop a = 12.0D0 b = 5.0D0 print *, hypot(a,b) if (abs(hypot(a,b) - 13.0D0) > 1e-9) error stop print *, hypot(12.0D0, 5.0D0) if (abs(hypot(12.0D0, 5.0D0) - 13.0D0) > 1e-9) error stop end program lfortran-lfortran-2f73434/integration_tests/write_12.f900000664000175000017500000000055315141516316023357 0ustar alastairalastairprogram write_12 implicit none integer :: x character(20) :: buf x = 42 ! Test that unit 6 is pre-connected (writes to stdout) write(6, '(A,I0)') "x = ", x ! Verify formatted write works correctly write(buf, '(A,I0)') "x = ", x if (trim(buf) /= "x = 42") error stop "formatted write failed" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/arrays_34.f900000664000175000017500000000105215141516316023525 0ustar alastairalastairprogram arrays_34 implicit none integer, pointer :: x(:) call sub(x, 1) print *, x if( any(x /= 1) ) error stop contains subroutine sub(x, z) integer, intent(out), pointer :: x(:) integer, intent(in) :: z integer :: n select case (z) case (1) n = 1 allocate(x(n)) x = (/ 1 /) case default print *, "z =", z print *, "z not supported." end select end subroutine sub end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_02.f900000664000175000017500000000113015141516316026565 0ustar alastairalastairsubroutine sub(a) double precision :: a dimension :: a(16) print *, a if (abs(a(1) - 1) > 1d-15) error stop if (abs(a(2) - 2) > 1d-15) error stop if (.not. all(abs(a(3:) - 1) < 1d-15)) error stop end subroutine program main double precision :: a(16,3) integer :: j j = 3 a = 1 a(2,3) = 2 call sub(a(1,j)) a(2,2) = 2 j = 2 call sub2(a(1,j)) contains subroutine sub2(a) real(8) :: a(16) print *, a if (abs(a(1) - 1) > 1d-15) error stop if (abs(a(2) - 2) > 1d-15) error stop if (.not. all(abs(a(3:) - 1) < 1d-15)) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/modules_27_module2.f900000664000175000017500000000177015141516316025334 0ustar alastairalastairmodule tomlf_build_array use tomlf_build_keyval, only : get_value, GLOBAL_VAR implicit none interface get_value module procedure :: get_elem_table module procedure :: get_elem_array module procedure :: get_elem_keyval end interface get_value contains subroutine get_elem_table(array, pos, ptr, stat) integer, intent(inout) :: array integer, intent(in) :: pos real, pointer, intent(out) :: ptr integer, intent(out), optional :: stat GLOBAL_VAR = 1.0 end subroutine get_elem_table subroutine get_elem_array(array, pos, ptr, stat) complex, intent(inout) :: array integer, intent(in) :: pos real, pointer, intent(out) :: ptr integer, intent(out), optional :: stat end subroutine get_elem_array subroutine get_elem_keyval(array, pos, ptr, stat) integer, intent(inout) :: array integer, intent(in) :: pos complex, pointer, intent(out) :: ptr integer, intent(out), optional :: stat end subroutine get_elem_keyval end module tomlf_build_array lfortran-lfortran-2f73434/integration_tests/declaration_03.f900000664000175000017500000000052115141516316024505 0ustar alastairalastairprogram declaration_03 implicit none type(character(len=4)) :: str1 = 'abcd' type(real):: r1 = 1.53 type(character(len=*)),parameter:: str2='(*(g0))' print *, str1, str2, r1 if (str1 /= 'abcd') error stop if ((r1 - 1.53) > 1e-4) error stop if (str2 /= '(*(g0))') error stop end program declaration_03lfortran-lfortran-2f73434/integration_tests/data_14.f900000664000175000017500000000023615141516316023136 0ustar alastairalastairprogram data_14 integer, parameter :: n = 4 real, dimension(n) :: arr data (arr(i), integer :: i = 1,n) /0.0, 0.0, 0.0, 0.0/ print *, arr end program lfortran-lfortran-2f73434/integration_tests/subroutines_12.f900000664000175000017500000000041615141516316024605 0ustar alastairalastairPROGRAM subroutines_12 IMPLICIT NONE INTEGER :: nang = 2 CALL my_subroutine CONTAINS SUBROUTINE my_subroutine INTEGER, DIMENSION(nang) :: fxhv fxhv = [1, 2] PRINT *, fxhv if ( sum(fxhv) /= 3 ) error stop END SUBROUTINE my_subroutine END PROGRAM subroutines_12 lfortran-lfortran-2f73434/integration_tests/common_24a.f900000664000175000017500000000022015141516316023650 0ustar alastairalastairsubroutine set1() implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 1 end subroutine set1 lfortran-lfortran-2f73434/integration_tests/separate_compilation_03.f900000664000175000017500000000050215141516316026421 0ustar alastairalastairprogram separate_compilation_03 use separate_compilation_03a_module use separate_compilation_03b_module real :: x0(5) real :: res1, res2 x0 = 9124.124 res1 = mixing_anderson(x0) print *, mixing_anderson(x0) res2 = integrate_trapz_1(x0) print *, integrate_trapz_1(x0) if (abs(res1 - res2) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/template_add_04.f900000664000175000017500000000236315141516316024652 0ustar alastairalastairmodule template_add_04_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F, mult) require :: R(T, F) integer :: mult private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z integer :: i z = F(x, y) do i = 1,mult-1 z = F(z, F(x,y)) end do end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() integer, parameter :: n = 10 instantiate add_t(real, func_arg_real, n), only: add_real => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) end subroutine end module program template_add_04 use template_add_04_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/dict_test_03_.f900000664000175000017500000000547515141516316024356 0ustar alastairalastairmodule dict_test_03_mod implicit none contains function power2(i, mod_) result(res) integer(8), intent(in) :: i, mod_ integer(8) :: p1, p2, px, py, res if (i == 0 .or. i == 1) then res = 2 ** i return end if p1 = i / 2 p2 = i - p1 px = mod(power2(p1, mod_), mod_) py = mod(power2(p2, mod_), mod_) res = mod(px * py, mod_) end function function generate_key(i) result(key) integer, intent(in) :: i character(len=:), allocatable :: key _lfortran_dict(integer, character(len=:)) :: i2d integer :: mod_, key_digits, digit i2d = _lfortran_dict_constant(0, "a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, "j") mod_ = int(99997, kind=8) key_digits = int(power2(int(i, kind=8), int(mod_, kind=8))) key = "" do while (key_digits > 0) digit = mod(key_digits, 10) key = key // _lfortran_get_item(i2d, digit) key_digits = key_digits / 10 end do end function subroutine test_dict() type(_lfortran_dict(character(len=:), integer(8))) :: number2cpi character(len=:),allocatable :: key integer :: i, size, cd, size1 integer(8) :: val cd = 1 size = cd * 150 do i = 1000, 1000 + size - 1 key = generate_key(i) val = power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do size1 = _lfortran_len(number2cpi) do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_pop(number2cpi, key) /= val) error stop size1 = size1 - 1 if (_lfortran_len(number2cpi) /= size1) error stop end do do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do do i = 1000, 1000 + size/2 - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_get_item(number2cpi, key) /= val) error stop end do do i = 1000, 1000 + size - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) call _lfortran_set_item(number2cpi, key, val) end do do i = 1000, 1000 + size - 1 key = generate_key(i) val = -power2(int(i, kind=8), int(99997, kind=8)) if (_lfortran_get_item(number2cpi, key) /= val) error stop end do do i = 1000 + size/4, 1000 + size/2 - 1 key = generate_key(i) print *, key, _lfortran_get_item(number2cpi, key) end do end subroutine end module program test_dict_main use dict_test_03_mod call test_dict() end program lfortran-lfortran-2f73434/integration_tests/character_18.f900000664000175000017500000000146715141516316024174 0ustar alastairalastair! Test: CHARACTER(*) assumed-size array via nested EXTERNAL declaration ! This is the actual LAPACK pattern where an intermediate subroutine ! has an EXTERNAL declaration and calls through implicit interface. ! Currently FAILING - see issue #9381 ! ! Pattern: main -> schkhs (has EXTERNAL slatme) -> slatme (has CHARACTER(*)) program character_18 implicit none character(1) :: adumma(1) adumma(1) = ' ' call schkhs(adumma) end program character_18 subroutine schkhs(adumma) implicit none character(1) :: adumma(1) external :: slatme call slatme(adumma) end subroutine schkhs subroutine slatme(ei) implicit none character(1) :: ei(*) if (ei(1) == ' ') then print *, 'PASS' else error stop 'FAIL: expected space character' end if end subroutine slatme lfortran-lfortran-2f73434/integration_tests/openmp_71.f900000664000175000017500000000112615141516316023525 0ustar alastairalastair! For CUDA C Dump of OpenMP Target Constructs program openmp_71 implicit none real, allocatable, dimension(:) :: a, b integer :: i allocate(a(10000000), b(10000000)) b=5 !$omp target map(tofrom:a, b) !$omp teams !$omp distribute parallel do do i = 1, 10000000 a(i) = i + b(i)*340 end do !$omp end distribute parallel do !$omp end teams !$omp end target print*, a(5), b(5) if(a(5) /= 1705) error stop if(b(5) /= 5) error stop end program openmp_71lfortran-lfortran-2f73434/integration_tests/select_type_20.f900000664000175000017500000000073015141516316024541 0ustar alastairalastairprogram select_type_20 implicit none logical, target :: l(3) class(*), pointer :: generic(:) l = [.true., .false., .true.] generic => l select type (x => generic) type is (logical) if (.not. x(1)) error stop if (x(2)) error stop if (count(x) /= 2) error stop x(2) = .true. if (count(l) /= 3) error stop class default error stop end select print *, "ok" end program select_type_20 lfortran-lfortran-2f73434/integration_tests/operator_overloading_14.f900000664000175000017500000000155315141516316026454 0ustar alastairalastairmodule operator_overloading_14_mod implicit none type, abstract :: base_type end type base_type type, extends(base_type) :: my_type integer :: x contains procedure :: my_type_equal generic :: operator(==) => my_type_equal end type contains logical function my_type_equal(a, b) class(my_type), intent(in) :: a class(base_type), intent(in) :: b my_type_equal = .false. select type(b) type is (my_type) my_type_equal = (b%x == a%x) end select end function my_type_equal end module operator_overloading_14_mod program operator_overloading_14 use operator_overloading_14_mod implicit none type(my_type) :: a, b a%x = 5 b%x = 5 if (.not. a == b) error stop b%x = 6 if (a == b) error stop end program operator_overloading_14lfortran-lfortran-2f73434/integration_tests/lapack_08.f900000664000175000017500000000075115141516316023465 0ustar alastairalastair! MRE: COMMON block + multiple EQUIVALENCE pairs causes symtab error ! When a subroutine has both COMMON and multiple EQUIVALENCE pairs, ! the ASR verifier reports "symbol table was not found in scope" ! Reduced from LAPACK sblat1.f CHECK2 subroutine program lapack_08 integer :: n common /c/ n call sub() print *, 'PASS' end program subroutine sub() integer :: n real :: x(8), a(4), b(4) common /c/ n equivalence (x(1), a(1)), (x(5), b(1)) end subroutine lfortran-lfortran-2f73434/integration_tests/arrays_94.f900000664000175000017500000000102615141516316023534 0ustar alastairalastairprogram arrays_94 implicit none integer :: result logical :: array(5) array = [ .true., .false., .true., .false., .true.] call truecount(array, result) print *, "Number of true elements:", result if (result /= 3) error stop contains subroutine truecount(array, return_value) logical, intent(in) :: array(:) integer, intent(out) :: return_value integer :: loc(count((array .and. .true.))) return_value = size(loc) end subroutine truecount end program arrays_94 lfortran-lfortran-2f73434/integration_tests/class_48.f900000664000175000017500000000341215141516316023340 0ustar alastairalastairprogram class_48 implicit none type :: SeriesInt integer :: scalar_data integer, allocatable :: array_data(:) end type type :: SeriesIntNested type(SeriesInt), allocatable :: v end type interface Series procedure Series_scalar, Series_array end interface interface SeriesNested procedure Series_nested_scalar_int end interface class(SeriesInt), allocatable :: s1, s2 class(SeriesIntNested), allocatable :: s3 ! Call Series with integer s1 = Series(42) print *, "s1%scalar_data:", s1%scalar_data print *, "s1%array_data:", s1%array_data if (s1%scalar_data /= 42) error stop if (.not. all(s1%array_data == [0, 0, 0, 0])) error stop print * ! Call Series with array s2 = Series([1,2,3,4]) print *, "s2%scalar_data:", s2%scalar_data print *, "s2%array_data:", s2%array_data if (s2%scalar_data /= 101) error stop if (.not. all(s2%array_data == [1, 2, 3, 4])) error stop print * allocate(s3) ! Call SeriesNested with integer and assign to a struct instance member s3%v = SeriesNested(42) print *, "s3%v%scalar_data:", s3%v%scalar_data if (s3%v%scalar_data /= 42) error stop contains function Series_scalar(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data self%scalar_data = data allocate(self%array_data(4)) ! initialize to zeroes end function function Series_nested_scalar_int(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data self%scalar_data = data end function function Series_array(data) result(self) type(SeriesInt) :: self integer, intent(in) :: data(:) self%array_data = data self%scalar_data = 101 end function end program class_48 lfortran-lfortran-2f73434/integration_tests/string_64.f900000664000175000017500000000164115141516316023541 0ustar alastairalastairprogram string_64 character(len=1), parameter :: NUL = achar(int(z'00')) !! Null character(len=1), parameter :: TAB = achar(int(z'09')) !! Horizontal tab character(len=1), parameter :: LF = achar(int(z'0A')) !! NL line feed, new line character(len=1), parameter :: VT = achar(int(z'0B')) !! Vertical tab character(len=1), parameter :: FF = achar(int(z'0C')) !! NP form feed, new page character(len=1), parameter :: CR = achar(int(z'0D')) !! Carriage return character(len=5) :: testMdata(2,2) testMdata = reshape( [ character(len=5) :: & TAB, & "X"//TAB//"Y", & "YES", & "NO" ], [2,2] ) if (testMdata(1,1) /= TAB .or. testMdata(1,2) /= "YES") error stop if (testMdata(2,1) /= "X"//TAB//"Y" .or. testMdata(2,2) /= "NO") error stop print *, len(NUL//TAB//LF//VT//FF//CR) if(len(NUL//TAB//LF//VT//FF//CR) /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_48.f900000664000175000017500000000114315141516316024242 0ustar alastairalastair! Testing a function is never called twice as a side effect of creating temporary strings (return slot) program functions_48 character(:), allocatable :: ss1 ss1 = ff(f2(), 10) print *, len(ss1) if(len(ss1) /= 20) error stop contains function ff(x, y) result(str) integer :: x integer :: y character(x + y) :: str end function function f2() result(num) integer :: num integer, save :: called = 0 num = 10 print *, "called" if(called /= 0) error stop called = called + 1 end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_281.f900000664000175000017500000001166215141516316024505 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = tanh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = tanh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [-0.55680344433989626_dp, -0.47557764686289139_dp, -0.28450043308229522_dp, & 0.55680344433989626_dp, 0.47557764686289139_dp, 0.28450043308229522_dp, 0.76159415595576485_dp, & 0.68013372295360075_dp, 0.74101025957155131_dp, -0.23703120039784659_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [-0.556803405_sp, -0.475577623_sp, -0.284500420_sp, & 0.556803405_sp, 0.475577623_sp, 0.284500420_sp, 0.761594176_sp, & 0.680133700_sp, 0.741010249_sp, -0.237031206_sp] res_x = tanh(arg_x) res_y = tanh(arg_y) expected_res_x = [-0.59101371380532286_dp, -0.49573755452355417_dp, -0.28848735226454980_dp, & 0.59101371380793721_dp, 0.49573755452355417_dp, 0.28848735226454980_dp, 0.51594386420508198_dp, & 7.7808675521968823E-002_dp, 0.25621481487810227_dp, -0.23930935875580195_dp, -0.62194009906582415_dp, & 0.51594386420508198_dp, 7.7808675521968823E-002_dp, 0.25621481487810227_dp, -0.23930935875580195_dp] expected_res_y = [-0.591013670_sp, -0.495737523_sp, -0.288487345_sp, & 0.591013670_sp, 0.495737523_sp, 0.288487345_sp, 0.515943885_sp, & 7.78086558E-02_sp, 0.256214768_sp, -0.239309371_sp, -0.621940076_sp, & 0.515943885_sp, 7.78086558E-02_sp, 0.256214768_sp, -0.239309371_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, tanh(a) if (abs(tanh(a)) - 0.47601427711167560_dp > 1e-12) error stop print *, tanh(0.5178181202_dp) if (abs(tanh(0.5178181202_dp) - 0.47601427711167560_dp) > 1e-12) error stop print *, tanh(b) if (tanh(b) - (-7.26875812E-02_sp) > 1e-5) error stop print *, tanh(-0.072816_sp) if (tanh(-0.072816_sp) - (-7.26875812E-02_sp) > 1e-5) error stop print *, tanh(c) if (tanh(c) - (-0.47601427711167560_dp) > 1e-12) error stop print *, tanh(-0.5178181202_dp) if (tanh(-0.5178181202_dp) - (-0.47601427711167560_dp) > 1e-12) error stop print *, tanh(d) if (tanh(d) - (7.26875812E-02_sp) > 1e-5) error stop print *, tanh(0.072816_sp) if (tanh(0.072816_sp) - (7.26875812E-02_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, tanh(a) if (abs(tanh(a) - (-0.265417270575538994_dp)) > 1e-12) error stop print *, tanh(-0.271927291_dp) if (abs(tanh(-0.271927291_dp) - (-0.265417270575538994_dp)) > 1e-12) error stop print *, tanh(b) if (tanh(b) - (-0.563722372_sp) > 1e-5) error stop print *, tanh(-0.6382728_sp) if (tanh(-0.6382728_sp) - (-0.563722372_sp) > 1e-5) error stop print *, tanh(c) if (tanh(c) - (0.26541727057553899_dp) > 1e-12) error stop print *, tanh(0.271927291_dp) if (tanh(0.271927291_dp) - (0.26541727057553899_dp) > 1e-12) error stop print *, tanh(d) if (tanh(d) - (0.563722372_sp) > 1e-5) error stop print *, tanh(0.6382728_sp) if (tanh(0.6382728_sp) - (0.563722372_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/nested_10.f900000664000175000017500000000146215141516316023505 0ustar alastairalastairprogram example_lmder1 implicit none integer, parameter :: wp = 8 integer, parameter :: n = 3 integer, parameter :: m = 15 integer :: i real(wp) :: x(n), fvec(m) x = 1 call fcn(m, n, x, fvec) print *, fvec do i = 1, m if ((abs(fvec(i)) - 1.0) > 1e-6) error stop end do contains subroutine check_deriv() call fcn2(m, n, x, fvec) end subroutine check_deriv subroutine fcn2(m, n, x, fvec) integer, intent(in) :: m integer, intent(in) :: n real(wp), intent(in) :: x(n) real(wp), intent(inout) :: fvec(m) end subroutine fcn2 subroutine fcn(m, n, x, fvec) integer, intent(in) :: m integer, intent(in) :: n real(wp), intent(in) :: x(n) real(wp), intent(out) :: fvec(m) fvec = x(1) end subroutine fcn end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_03.f900000664000175000017500000000271415141516316026452 0ustar alastairalastairmodule operator_overloading_01_overload_comp_m implicit none public operator (>) interface operator (>) module procedure greater_than_inverse end interface interface operator (<) module procedure less_than_inverse end interface contains pure logical function greater_than_inverse(log1, log2) logical, intent (in) :: log1, log2 if( log1 .eqv. .true. .and. log2 .eqv. .false. ) then greater_than_inverse = .true. else greater_than_inverse = .false. end if end function pure logical function less_than_inverse(log1, log2) logical, intent (in) :: log1, log2 if( log1 .eqv. .false. .and. log2 .eqv. .true. ) then less_than_inverse = .true. else less_than_inverse = .false. end if end function pure logical function less_than_overload_use(log1, log2) logical, intent (in) :: log1, log2 less_than_overload_use = log1 < log2 end function end module program operator_overloading_01 use operator_overloading_01_overload_comp_m implicit none logical, parameter :: T = .true., F = .false. print *, "T>T:", T>T ! Yields: F print *, "T>F:", T>F ! Yields: F print *, "F>T:", F>T ! Yields: T print *, "F>F:", F>F ! Yields: F print *, "T 1e-7) error stop if (abs(asin(x) - 0.523598790) > 1e-7) error stop if (abs(asin(0.5_dp) - 0.52359877559829893_dp) > 1e-15) error stop if (abs(asin(y) - 0.52359877559829882_dp) > 1e-15) error stop print *, acos(0.5), acos(0.5_dp), s5, d5, acos(x), acos(y) if (abs(acos(0.5) - 1.04719758) > 1e-7) error stop if (abs(acos(x) - 1.04719758) > 1e-6) error stop if (abs(acos(0.5_dp) - 1.0471975511965979_dp) > 1e-15) error stop if (abs(acos(y) - 1.0471975511965979_dp) > 1e-15) error stop print *, atan(0.5), atan(0.5_dp), s6, d6, atan(x), atan(y) if (abs(atan(0.5) - 0.463647604) > 1e-7) error stop if (abs(atan(x) - 0.463647604) > 1e-6) error stop if (abs(atan(0.5_dp) - 0.46364760900080609_dp) > 1e-15) error stop if (abs(atan(y) - 0.46364760900080609_dp) > 1e-15) error stop print *, sinh(0.5), sinh(0.5_dp), s7, d7, sinh(x), sinh(y) print *, cosh(0.5), cosh(0.5_dp), s8, d8, cosh(x), cosh(y) print *, tanh(0.5), tanh(0.5_dp), s9, d9, tanh(x), tanh(y) print *, asinh(0.5), asinh(0.5_dp), s10, d10, asinh(x), asinh(y) print *, acosh(1.5), acosh(1.5_dp), s11, d11, acosh(x2), acosh(y2) print *, atanh(0.5), atanh(0.5_dp), s12, d12, atanh(x), atanh(y) end lfortran-lfortran-2f73434/integration_tests/separate_compilation_28a.f900000664000175000017500000000026515141516316026577 0ustar alastairalastair! Common block with CHARACTER - setter subroutine subroutine set_name() implicit none character(32) :: srnamt common /srnamc/ srnamt srnamt = 'HELLO' end subroutine lfortran-lfortran-2f73434/integration_tests/allocate_05.f900000664000175000017500000000044015141516316024006 0ustar alastairalastairprogram allocate_05 implicit none character(len=:), allocatable :: string character(len=3) :: num allocate(character(len=3)::string) num = "abc" string = num if (string /= "abc") error stop string(:) = num if (string /= "abc") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_120.f900000664000175000017500000000047615141516316024476 0ustar alastairalastairprogram intrinsics_120 integer :: x(5) = [ 1, 2, 3, 4 ,5 ] logical :: mask(5) = [ .TRUE., .FALSE., .TRUE., .FALSE., .TRUE. ] if ( .not. product( array = x, mask = mask ) == 15 ) error stop if ( .not. product( x, mask = mask ) == 15 ) error stop if ( .not. product( x, mask ) == 15 ) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_30.f900000664000175000017500000000326215141516316024412 0ustar alastairalastairprogram intrinsics_30 use iso_fortran_env, only : int8, int16 implicit none integer, parameter :: a1 = range(11) integer, parameter :: a2 = range(22.90) integer, parameter :: a3 = range((1,2)) integer(4) :: i1 integer(8) :: i2 integer(int8) :: i3 integer(int16) :: i4 real(4) :: r1 real(8) :: r2 complex(4) :: c1 complex(8) :: c2 integer, parameter :: ri3 = range(i3) integer, parameter :: ri4 = range(i4) integer, parameter :: ar1 = range([1, 21, 13]) integer, parameter :: ar2 = range([1.0, 21.0, 13.0]) integer, parameter :: ar3 = range([(1, 2), (31, 4), (51, 62)]) integer :: arr1(3) = [1, 21, 13] real(8) :: arr2(3) = [1.0, 21.0, 13.0] complex :: arr3(3) = [(1, 2), (31, 4), (51, 62)] print *, a1 if (a1 /= 9) error stop print *, a2 if (a2 /= 37) error stop print *, a3 if (a3 /= 37) error stop print *, ar1 if (ar1 /= 9) error stop print *, ar2 if (ar2 /= 37) error stop print *, ar3 if (ar3 /= 37) error stop print *, range(ri3) if (ri3 /= 2) error stop print *, range(ri4) if (ri4 /= 4) error stop print *, range(i1) if (range(i1) /= 9) error stop print *, range(i2) if (range(i2) /= 18) error stop print *, range(r1) if (range(r1) /= 37) error stop print *, range(r2) if (range(r2) /= 307) error stop print *, range(c1) if (range(c1) /= 37) error stop print *, range(c2) if (range(c2) /= 307) error stop print *, range(arr1) if (range(arr1) /= 9) error stop print *, range(arr2) if (range(arr2) /= 307) error stop print *, range(arr3) if (range(arr3) /= 37) error stop end program lfortran-lfortran-2f73434/integration_tests/subroutines_06.f900000664000175000017500000000275415141516316024617 0ustar alastairalastairmodule subroutines_06_bitset interface assignment(=) pure module subroutine assign_large( set1, set2 ) integer, intent(out) :: set1 integer, intent(in) :: set2 end subroutine assign_large pure module subroutine assign_logint8_large( self, logical_vector ) integer, intent(out) :: self logical, intent(in) :: logical_vector(:) end subroutine assign_logint8_large end interface interface error_handler module subroutine error_handler( message, error, status, & module, procedure ) character(*), intent(in) :: message integer, intent(in) :: error integer, intent(out), optional :: status character(*), intent(in), optional :: module character(*), intent(in), optional :: procedure end subroutine error_handler end interface error_handler contains module subroutine error_handler( message, error, status, module, procedure ) character(*), intent(in) :: message integer, intent(in) :: error integer, intent(out), optional :: status character(*), intent(in), optional :: module character(*), intent(in), optional :: procedure print *, error, status end subroutine error_handler end module program subroutines_06 use subroutines_06_bitset implicit none ! empty program end program subroutines_06 lfortran-lfortran-2f73434/integration_tests/derived_types_44.f900000664000175000017500000000175615141516316025106 0ustar alastairalastair! Test pointer association program derived_types_44 type :: sds real, dimension(:), pointer :: f end type real, dimension(:), pointer :: x call sub_to_allocate(x) print *, "size(x): ", size(x) print *, "lbound(x): ", lbound(x) if (lbound(x,1) /= 1) error stop print *, "ubound(x): ", ubound(x) if ( abs(x(1) - 1.0) > 1e-8 ) error stop if ( abs(x(2) - 2.0) > 1e-8 ) error stop if ( abs(x(100000) - 88.0) > 1e-8 ) error stop print *, "x(1) = ", x(1) print *, "x(2) = ", x(2) print *, "x(100000) = ", x(100000) ! Use big size to make sure about correct memory. deallocate(x) contains subroutine sub_to_allocate(x) real, dimension(:), pointer, intent(inout) :: x type(sds) :: s allocate(s%f(100000)) x => s%f x(1)=1.0 x(2)=2.0 x(100000)=88.0 print *, "x(1) = ", x(1) print *, "x(2) = ", x(2) print *, "x(100000) = ", x(100000) end subroutine end program lfortran-lfortran-2f73434/integration_tests/read_29.f900000664000175000017500000000062015141516316023143 0ustar alastairalastairprogram read_complex implicit none integer :: iunit complex :: cnum open (newunit=iunit, file='complex.data', form='formatted', status='unknown') write (iunit, '(2f10.5)') (42.5, -42.5) rewind (iunit) read (iunit, '(2f10.5)') cnum close (iunit, status='keep') if (abs(real(cnum) - 42.5) > 1.0e-5 .or. abs(aimag(cnum) + 42.5) > 1.0e-5) stop print *, 'test passed' end programlfortran-lfortran-2f73434/integration_tests/error_stop_03.f900000664000175000017500000000010515141516316024414 0ustar alastairalastairprogram error_stop_03 implicit none error stop 0 end program lfortran-lfortran-2f73434/integration_tests/array_indices_array_item_assignment_2.f900000664000175000017500000000141215141516316031417 0ustar alastairalastairprogram array_indices_array_item_assignment_2 real :: Q(4), R(4), S(4), X(2,2) logical, save :: mask(2) = [.true.,.false.] R = [1, 4, 2, 3] S = [3, 2, 1, 4] Q = 5.0 X = reshape(R, shape(X)) Q(trueloc(R < S)) = Q(trueloc(R < S)) + 1.0 Q(trueloc(R >= S)) = -Q(trueloc(R >= S)) - 1.0 print *, Q if( any(Q /= [6.0, -6.0, -6.0, 6.0]) ) error stop X([1,2], trueloc(mask)) = X([2,1], trueloc(mask)) print *, X if( X(1,1) /= 4.0 .or. X(2,1) /= 1.0 .or. X(1,2) /= 2.0 .or. X(2,2) /= 3.0 ) error stop contains function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_23b.f900000664000175000017500000000063715141516316026576 0ustar alastairalastairsubmodule (ansi_separate_compilation_23) stdlib_ansi_operator use string_type_separate_compilation_23, only : operator(//) implicit none contains pure module function concat_left(lval, code) result(str) character(len=*), intent(in) :: lval type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function concat_left end submodule stdlib_ansi_operatorlfortran-lfortran-2f73434/integration_tests/derived_types_08.f900000664000175000017500000000223515141516316025077 0ustar alastairalastairmodule shape_mod type shape integer :: color logical :: filled integer :: x integer :: y contains procedure :: initialize => initialize_subrout end type shape type, extends(shape) :: rectangle integer :: length integer :: width end type rectangle contains subroutine initialize_subrout(sh, color, filled, x, y) ! initialize shape objects class(shape) :: sh integer :: color logical :: filled integer :: x integer :: y sh%color = color sh%filled = filled sh%x = x sh%y = y end subroutine initialize_subrout end module program derived_types_08 use shape_mod implicit none type(shape) :: shp ! declare an instance of shape type(rectangle) :: rect ! declare an instance of rectangle call shp%initialize(1, .true., 10, 20) ! initialize shape call rect%initialize(2, .false., 100, 200) ! initialize rectangle print *, shp%color, shp%filled, shp%x, shp%y print *, rect%color, rect%filled, rect%x, rect%y rect%length = 100 rect%width = 200 print *, rect%length, rect%width end programlfortran-lfortran-2f73434/integration_tests/entry_07.f900000664000175000017500000000033715141516316023372 0ustar alastairalastairsubroutine dzror() implicit none double precision zxlo entry dstzr(zxlo) if (abs(zxlo - 1.2) > 1e-7) error stop print *, 'dstzr: zxlo = ', zxlo return end program entry_07 call dstzr(1.2d0) end program lfortran-lfortran-2f73434/integration_tests/openmp_31.f900000664000175000017500000000055615141516316023527 0ustar alastairalastairprogram openmp_31 implicit none real :: phi(100) integer :: j phi = 10124.142 !$omp parallel do private(j) shared(phi) do j = 1, 100 print *, phi(1) !$omp atomic phi(1) = phi(1) + 1 end do !$omp end parallel do print *, phi(1) if (abs(phi(1) - 10224.1416) > 1e-8) error stop end program openmp_31 lfortran-lfortran-2f73434/integration_tests/arrays_102.f900000664000175000017500000000100015141516316023572 0ustar alastairalastairprogram arrays_102 implicit none type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: build_dirs(:) type(string_t) :: temp temp%s = "build" allocate(build_dirs(0)) associate(xx => temp) build_dirs = [build_dirs, temp] end associate if (size(build_dirs) /= 1) error stop "Wrong size" if (build_dirs(1)%s /= "build") error stop "Wrong value" print *, "OK:", build_dirs(1)%s end program arrays_102 lfortran-lfortran-2f73434/integration_tests/doloop_07.f900000664000175000017500000000050615141516316023523 0ustar alastairalastairprogram doloop_07 implicit none integer :: i, cnt cnt = 0 do i = 1, 10 if (i <= 5) then if (i == 1) then cnt = cnt + 1 if ( cnt == 1 ) exit end if end if cnt = cnt + 1 end do print *, cnt if (cnt /= 1) error stop end lfortran-lfortran-2f73434/integration_tests/data_implied_do_04.f900000664000175000017500000000065315141516316025325 0ustar alastairalastairreal function func() integer i real coef(5,4) data (coef(i,1),i=1,5)/1.0,1.0,3*0.0/ if (abs(coef(1,1) - 1.0) > 1e-8) error stop if (abs(coef(2,1) - 1.0) > 1e-8) error stop if (abs(coef(3,1) - 0.0) > 1e-8) error stop if (abs(coef(4,1) - 0.0) > 1e-8) error stop if (abs(coef(5,1) - 0.0) > 1e-8) error stop return end function program data_implied_do_04 real y y = func() end program lfortran-lfortran-2f73434/integration_tests/derived_types_93.f900000664000175000017500000000231215141516316025077 0ustar alastairalastairmodule derived_types_93_mod implicit none type :: temp_test integer :: val end type temp_test type :: dep_t character(len=:), allocatable :: proj_dir type(temp_test), allocatable :: tmp contains procedure :: equal_dep generic :: operator(==) => equal_dep end type dep_t contains logical function equal_dep(lhs, rhs) class(dep_t), intent(in) :: lhs, rhs if (allocated(lhs%proj_dir) .neqv. allocated(rhs%proj_dir)) then equal_dep = .false. else if (.not. allocated(lhs%proj_dir)) then equal_dep = .true. else equal_dep = lhs%proj_dir == rhs%proj_dir end if end function equal_dep end module derived_types_93_mod program derived_types_93 use derived_types_93_mod type(dep_t), allocatable :: d1(:), d2(:) integer :: i allocate(d1(5), d2(5)) do i = 1, 3 d1(i)%proj_dir = "AAA" d2(i)%proj_dir = "AAA" allocate(d1(i)%tmp) allocate(d2(i)%tmp) d1(i)%tmp%val = i d2(i)%tmp%val = i end do do i = 1, size(d1) if(.not. d1(i) == d2(i)) error stop end do end program derived_types_93lfortran-lfortran-2f73434/integration_tests/arrays_op_9.f900000664000175000017500000000156015141516316024151 0ustar alastairalastairprogram arrays_op_9 implicit none call f() contains function modify(n, array_a) result(r) integer, intent(in) :: n real(4), intent(in) :: array_a(n) real(4) :: r(n) r = sqrt(array_a) end function subroutine verify(array_a, array_b, result, size) real(4), intent(in) :: array_a(:), array_b(:), result(:) integer, intent(in) :: size integer :: i real(4) :: eps eps = 1e-6 do i = 1, size if ( abs(array_a(i) * array_a(i) + sqrt(array_b(i)) - result(i)) > eps ) error stop end do end subroutine subroutine f() integer :: i, j real(4) :: array_a(256), array_b(256), array_c(256) do i = 1, 256 array_a(i) = i end do do j = 1, 256 array_b(j) = j + 5 end do array_c = array_a**2 + modify(256, array_b) call verify(array_a, array_b, array_c, 256) end subroutine end program lfortran-lfortran-2f73434/integration_tests/string_30.f900000664000175000017500000000574015141516316023536 0ustar alastairalastairmodule stdlib_string_type implicit none private public :: string_type public :: operator(//) type :: string_type private character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: concat_string_string module procedure :: concat_string_char module procedure :: concat_char_string end interface operator(//) contains elemental function concat_string_string(lhs, rhs) result(string) type(string_type), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_string_string elemental function concat_string_char(lhs, rhs) result(string) type(string_type), intent(in) :: lhs character(len=*), intent(in) :: rhs type(string_type) :: string end function concat_string_char elemental function concat_char_string(lhs, rhs) result(string) character(len=*), intent(in) :: lhs type(string_type), intent(in) :: rhs type(string_type) :: string end function concat_char_string end module stdlib_string_type module stdlib_ansi use stdlib_string_type, only : string_type implicit none private public :: ansi_code public :: to_string, operator(//) public :: concat_left_str, concat_right_str type :: ansi_code private integer(1) :: style = -1_1 integer(1) :: bg = -1_1 integer(1) :: fg = -1_1 end type ansi_code interface to_string pure module function to_string_ansi_code(code) result(str) type(ansi_code), intent(in) :: code character(len=:), allocatable :: str end function to_string_ansi_code end interface to_string interface operator(//) pure module function concat_left_str(lval, code) result(str) type(string_type), intent(in) :: lval type(ansi_code), intent(in) :: code type(string_type) :: str end function concat_left_str pure module function concat_right_str(code, rval) result(str) type(string_type), intent(in) :: rval type(ansi_code), intent(in) :: code type(string_type) :: str end function concat_right_str end interface operator(//) end module stdlib_ansi submodule (stdlib_ansi) stdlib_ansi_operator use stdlib_string_type, only : operator(//) implicit none contains pure module function concat_left_str(lval, code) result(str) type(string_type), intent(in) :: lval type(ansi_code), intent(in) :: code type(string_type) :: str str = lval // to_string(code) end function concat_left_str pure module function concat_right_str(code, rval) result(str) type(string_type), intent(in) :: rval type(ansi_code), intent(in) :: code type(string_type) :: str str = to_string(code) // rval end function concat_right_str end submodule stdlib_ansi_operator lfortran-lfortran-2f73434/integration_tests/arrays_49.f900000664000175000017500000000207115141516316023535 0ustar alastairalastair! This test checks the maxloc intrinsic function when ! the passed-array dimension is a variable. SUBROUTINE TEST_MAXLOC(i,a) INTEGER,INTENT(in) :: i INTEGER, DIMENSION(i),INTENT(in) :: a INTEGER ::res res = maxloc(a,1) print *, res if(res /= 5) error stop END SUBROUTINE TEST_MAXLOC SUBROUTINE TEST_MINLOC(i,a) INTEGER,INTENT(in) :: i INTEGER, DIMENSION(i),INTENT(in) :: a INTEGER ::res res = minloc(a,1) print *, res if(res /= 1) error stop END SUBROUTINE TEST_MINLOC PROGRAM arrays_49 implicit none INTEGER :: x INTEGER :: a(10) = [1,2,3,4,1000,5,6,7,8,9] x = 10 call TEST_MAXLOC(x,a) call TEST_MINLOC(x,a) END PROGRAM arrays_49lfortran-lfortran-2f73434/integration_tests/matmul_01.f900000664000175000017500000001261415141516316023523 0ustar alastairalastair! Compile and run in Release mode with: ! gfortran -O3 -march=native -ffast-math -funroll-loops matmul_01.f90 && ./a.out ! To develop, compile and run with: ! gfortran -Wall -Wextra -Wimplicit-interface -g -fcheck=all -fbacktrace matmul_01.f90 && ./a.out module matmul_01_cpu implicit none contains subroutine matmul1(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: n integer :: i, j, k n = size(A, 1) C = 0 do j = 1, n do k = 1, n do i = 1, n C(i,j) = C(i,j) + A(i,k)*B(k,j) end do end do end do end subroutine ! The arguments A, B are swapped, ! and all accesses to A, B, C are tranposed subroutine kernel2(B, A, C, x, y, i1, s1) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer, intent(in) :: x, y, i1, s1 integer :: k !LF$ attributes simd :: A0, A1, A2, A3, A4, A5 real, dimension(8) :: A0, A1, A2, A3, A4, A5 !LF$ attributes simd :: u00, u01, u10, u11, u20, u21 !LF$ attributes simd :: u30, u31, u40, u41, u50, u51 real, dimension(8) :: u00, u01, u10, u11, u20, u21, u30, u31, & u40, u41, u50, u51 ! This function computes: !C(x:x+6-1, y:y+16-1) = C(x:x+6-1, y:y+16-1) + matmul( & ! A(x:x+6-1, i1:i1+s1-1), & ! B(i1:i1+s1-1, y:y+16-1) ) u00 = C(y :y+ 7,x+0) u01 = C(y+8:y+15,x+0) u10 = C(y :y+ 7,x+1) u11 = C(y+8:y+15,x+1) u20 = C(y :y+ 7,x+2) u21 = C(y+8:y+15,x+2) u30 = C(y :y+ 7,x+3) u31 = C(y+8:y+15,x+3) u40 = C(y :y+ 7,x+4) u41 = C(y+8:y+15,x+4) u50 = C(y :y+ 7,x+5) u51 = C(y+8:y+15,x+5) do k = i1, i1+s1-1 A0 = A(k,x+0) u00 = u00 + A0 * B(y :y+ 7,k) u01 = u01 + A0 * B(y+8:y+15,k) A1 = A(k,x+1) u10 = u10 + A1 * B(y :y+ 7,k) u11 = u11 + A1 * B(y+8:y+15,k) A2 = A(k,x+2) u20 = u20 + A2 * B(y :y+ 7,k) u21 = u21 + A2 * B(y+8:y+15,k) A3 = A(k,x+3) u30 = u30 + A3 * B(y :y+ 7,k) u31 = u31 + A3 * B(y+8:y+15,k) A4 = A(k,x+4) u40 = u40 + A4 * B(y :y+ 7,k) u41 = u41 + A4 * B(y+8:y+15,k) A5 = A(k,x+5) u50 = u50 + A5 * B(y :y+ 7,k) u51 = u51 + A5 * B(y+8:y+15,k) end do C(y :y+ 7,x+0) = u00 C(y+8:y+15,x+0) = u01 C(y :y+ 7,x+1) = u10 C(y+8:y+15,x+1) = u11 C(y :y+ 7,x+2) = u20 C(y+8:y+15,x+2) = u21 C(y :y+ 7,x+3) = u30 C(y+8:y+15,x+3) = u31 C(y :y+ 7,x+4) = u40 C(y+8:y+15,x+4) = u41 C(y :y+ 7,x+5) = u50 C(y+8:y+15,x+5) = u51 end subroutine subroutine matmul2(A, B, C) real, intent(in) :: A(:,:), B(:,:) real, intent(out) :: C(:,:) integer :: s1, s2, s3, n integer :: i1, i2, i3, x, y n = size(A, 1) ! Use the commented out numbers for a good benchmark s3 = 48 ! 64 s2 = 12 ! 120 s1 = 24 ! 240 C = 0 do i3 = 1, n, s3 do i2 = 1, n, s2 do i1 = 1, n, s1 do x = i2, i2+s2-1, 6 do y = i3, i3+s3-1, 16 call kernel2(A, B, C, x, y, i1, s1) end do end do end do end do end do end subroutine end module program matmul_01 use matmul_01_cpu, only: matmul1, matmul2 implicit none integer, parameter :: dp = kind(0.d0) integer :: n, iter, i real(dp) :: t1, t2, t, GHz, fma_clock, freq, measured, percent_peak real, allocatable :: A(:,:), B(:,:), C(:,:), C2(:,:) real :: err ! Use n = 960 for a good benchmark n = 96 ! Increase `iter` so that the total time for a given benchmark is about 1s ! in order to get accurate timings iter = 1 print *, "Size (n x n): n =", n print *, "Iter =", iter print *, "Size MB:", 4._dp*n*n/1024**2 allocate(A(n,n), B(n,n), C(n,n), C2(n,n)) call random_number(A) call random_number(B) print *, "Fortran intrinsic matmul:" call cpu_time(t1) do i = 1, iter C = matmul(A, B) end do call cpu_time(t2) t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp ! This is CPU specific (Apple M1 number here) freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" print * print *, "matmul2:" call cpu_time(t1) do i = 1, iter call matmul2(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-3) error stop print * print *, "matmul1:" call cpu_time(t1) do i = 1, iter call matmul1(A, B, C2) end do call cpu_time(t2) err = maxval(abs(C-C2)) print *, "Error:", err t = (t2-t1)/iter GHz = 1e9_dp fma_clock = 0.0625_dp freq = 3.2_dp*GHz measured = t * freq / n**3 percent_peak = fma_clock / measured * 100 print *, "Time: ", t print *, "Clock cycles per element:" print *, "Theoretical performance peak:", fma_clock, "cycles" print *, "Measured: ", measured, "cycles" print *, "Percent peak: ", percent_peak, "%" if (err > 1e-3) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_17.f900000664000175000017500000000211115141516316024006 0ustar alastairalastairprogram allocate_17 implicit none integer, allocatable :: arr1(:), arr2(:), arr3(:), arr4(:), arr5(:,:) logical, allocatable :: l_arr1(:), l_arr2(:), l_arr3(:) integer, parameter :: src(5) = [2,1,3,4,1], src2(2,3) = reshape([1,2,3,2,1,3], [2,3]) logical, parameter :: l_src(3) = [.true.,.false.,.true.] integer :: isrc isrc = 10 allocate(arr1(5)) arr1 = isrc if (any(arr1 /= 10)) error stop allocate(arr2(5), source=isrc) if (any(arr2 /= 10)) error stop allocate(arr3(5), arr4(5), source=src) if (any(arr3 /= [2,1,3,4,1])) error stop if (any(arr4 /= [2,1,3,4,1])) error stop allocate(arr5(2,3), source=src2(:,1:3)) if (any(arr5(:,1) /= [1,2])) error stop if (any(arr5(:,2) /= [3,2])) error stop if (any(arr5(:,3) /= [1,3])) error stop allocate(l_arr1(3), source = .true.) if (any(l_arr1 .neqv. .true.)) error stop allocate(l_arr2(3), l_arr3(3), source = l_src) if (any(l_arr2 .neqv. [.true., .false., .true.])) error stop if (any(l_arr3 .neqv. [.true., .false., .true.])) error stop end program lfortran-lfortran-2f73434/integration_tests/statement_01.f900000664000175000017500000000017315141516316024225 0ustar alastairalastairdouble precision function alnorm() double precision z, zexp zexp(z) = dexp(z) return end program statement_01 end program lfortran-lfortran-2f73434/integration_tests/external_06.f900000664000175000017500000000032115141516316024043 0ustar alastairalastairdouble precision function enorm(n) result(y) double precision, intent(in) :: n y = n return end function program main double precision, external :: enorm print *, enorm(1.0d0) end program lfortran-lfortran-2f73434/integration_tests/div_to_mul.f900000664000175000017500000000053715141516316024066 0ustar alastairalastairprogram div_to_mul implicit none real :: x = 3.14, eps = 1e-6 real, parameter :: pi = 3.14 integer :: y = 2 if (abs(x/pi - 1.0) > eps) error stop if (abs(x/2.0 - 1.57) > eps) error stop if (abs(x/2.0_8 - 1.57) > eps) error stop if (abs(x/2 - 1.57) > eps) error stop if (abs(y/2 - 1) > eps) error stop end program lfortran-lfortran-2f73434/integration_tests/data_12.f900000664000175000017500000000162415141516316023136 0ustar alastairalastair! testing data statements in a module module data_12_module implicit none integer :: x, td real :: y, z, c1(4), bf1, xx90, xx95, b data x, td, b /1, 4, 3/ data y, z /2.0, 3.0/ data c1 /0.0, 0.22, -0.14, -0.21/ data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ end module data_12_module program data_12_program use data_12_module implicit none print *, x if (x /= 1) error stop print *, y if (abs(y-2.0) > 1e-5) error stop print *, z if (abs(z-3.0) > 1e-5) error stop print *, c1(1) if (abs(c1(1)-0.0) > 1e-5) error stop print *, c1(2) if (abs(c1(2)-0.22) > 1e-5) error stop print *, c1(4) if (abs(c1(4)+0.21) > 1e-5) error stop print *, bf1 if (abs(bf1-0.8) > 1e-5) error stop print *, xx90 if (abs(xx90-0.55) > 1e-5) error stop print *, xx95 if (abs(xx95-0.62) > 1e-5) error stop end program data_12_program lfortran-lfortran-2f73434/integration_tests/class_66.f900000664000175000017500000000177615141516316023353 0ustar alastairalastairmodule class_66_mod implicit none type, abstract :: bitset_type integer :: n = 0 contains procedure(print_abstract), deferred, pass(self) :: print_base generic :: print => print_base end type bitset_type abstract interface subroutine print_abstract(self) import :: bitset_type class(bitset_type), intent(inout) :: self end subroutine print_abstract end interface type, extends(bitset_type) :: bitset_64 integer :: extra = 64 contains procedure, pass(self) :: print_base => print_bitset_64 end type bitset_64 contains subroutine print_bitset_64(self) class(bitset_64), intent(inout) :: self self%n = 10 self%extra = 20 end subroutine print_bitset_64 end module class_66_mod program class_66 use class_66_mod class(bitset_64), allocatable :: b allocate(bitset_64 :: b) call b%print() if (b%n /= 10 .or. b%extra /= 20) error stop end program class_66 lfortran-lfortran-2f73434/integration_tests/implicit_interface_26.f900000664000175000017500000000241615141516316026064 0ustar alastairalastair! Test that visit order does not affect type propagation for implicit interfaces. ! dqc25c is defined BEFORE dqk15w - exercises reverse type propagation. program implicit_interface_26 implicit none double precision :: result call dqc25c(square, 0.0d0, 1.0d0, result) if (abs(result - 0.125d0) > 1.0d-10) error stop print *, "PASSED" contains double precision function square(x) double precision, intent(in) :: x square = x * x end function end program double precision function dqwgtc(x) double precision, intent(in) :: x dqwgtc = 0.5d0 end function ! Caller - does NOT call f or dqwgtc, only passes them (defined BEFORE dqk15w) subroutine dqc25c(f, a, b, result) double precision, external :: f double precision, external :: dqwgtc double precision, intent(in) :: a, b double precision, intent(out) :: result call dqk15w(f, dqwgtc, a, b, result) end subroutine ! Callee - actually calls f and w (defined AFTER dqc25c) subroutine dqk15w(f, w, a, b, result) double precision, external :: f double precision, external :: w double precision, intent(in) :: a, b double precision, intent(out) :: result double precision :: centr centr = 0.5d0*(a+b) result = f(centr) * w(centr) end subroutine lfortran-lfortran-2f73434/integration_tests/implicit_typing_01.f900000664000175000017500000000041515141516316025424 0ustar alastairalastairprogram implicit_typing_01 implicit double precision (a-h,o-z) dimension :: dv(0:100) integer :: i do i = 0,100 dv(i) = i end do print *, dv(0:100) do i = 0,100 if (abs(dv(i)-i) > 1e-10) error stop end do end program lfortran-lfortran-2f73434/integration_tests/attr_intrinsic.f900000664000175000017500000000260215141516316024754 0ustar alastairalastair! this program tests 'intrinsic' attribute used in declarations program attr_intrinsic implicit none ! variable 'abs' with same name as intrinsic elemental ! function 'abs' integer, parameter :: abs = 11 integer :: i1, i2 ! variable 'char' with same name as intrinsic elemental ! function 'char' integer, parameter :: char = 19 call sub1() i1 = fun1() call sub2() i2 = fun2() contains subroutine sub1() ! intrinsic 'abs' means, 'abs' used in this subroutine ! is actually the intrinsic elemental function 'abs' intrinsic abs print *, abs(-4) if (abs(-4) /= 4) error stop end subroutine sub1 function fun1() result(i) ! dummy result output integer :: i ! the 'char' here is the variable 'char' not the intrinsic ! function print *, 'variable char: ', char if (char /= 19) error stop end function fun1 subroutine sub2() print *, abs if (abs /= 11) error stop end subroutine sub2 function fun2() result(i) ! dummy result output integer :: i intrinsic char ! the 'char' here is the intrinsic function 'char' not ! the variable 'char' print *, 'intrinsic elemental char(65): ', char(65) if (char(65) /= 'A') error stop end function fun2 end program attr_intrinsic lfortran-lfortran-2f73434/integration_tests/allocate_26.f900000664000175000017500000000041015141516316024006 0ustar alastairalastairprogram allocate_26 implicit none integer(4) :: ind character(len=:, kind=1), allocatable, dimension(:) :: arr integer(4) :: i allocate(arr(3), mold="hello") arr = "hello" print *, arr if (any(arr /= ["hello", "hello", "hello"])) error stop end program allocate_26lfortran-lfortran-2f73434/integration_tests/string_21.f900000664000175000017500000000163415141516316023534 0ustar alastairalastairmodule string_21_fpm_string integer, public, parameter :: tfc = selected_char_kind('DEFAULT') contains function f_string(c_string) use iso_c_binding character(len=1), intent(in) :: c_string(:) character(:), allocatable :: f_string integer :: i, n i = 0 do while(c_string(i + 1) /= C_NULL_CHAR) i = i + 1 end do n = i allocate(character(kind=tfc, len=n) :: f_string) do i = 1, n f_string(i:i) = c_string(i) end do print *, f_string end function f_string end module program string_21 use string_21_fpm_string use iso_c_binding implicit none character(len=1) :: c_string(6) character(:), allocatable :: f_string_result c_string(1) = 'H' c_string(2) = 'e' c_string(3) = 'l' c_string(4) = 'l' c_string(5) = 'o' c_string(6) = C_NULL_CHAR f_string_result = f_string(c_string) print *, f_string_result if( f_string_result /= "Hello" ) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_15b.f900000664000175000017500000000021615141516316026220 0ustar alastairalastairsubroutine strsm( a, n ) integer :: i, n real :: a(0 : *), res print *,"x" res = 0.0 do i = 0, n - 1 res = res + a(i) end do print *, res end lfortran-lfortran-2f73434/integration_tests/case_08.f900000664000175000017500000000123415141516316023142 0ustar alastairalastairprogram case_08 implicit none character(len=100) :: line character :: ch line = "-5" if (len_trim(line) < 2) then print *, "Error: Input line is too short: '", trim(line), "'" error stop end if ch = line(2:2) if (iachar(ch) < 32 .or. iachar(ch) > 126) then print *, "Error: Second character is non-printable (char code:", iachar(ch), ")" error stop end if select case (ch) case ("-", "0":"9") print *, "Second character is a '-' or a digit: ", ch case default print *, "Error: Unexpected second character: ", ch error stop end select end program case_08 lfortran-lfortran-2f73434/integration_tests/submodule_10.f900000664000175000017500000000223215141516316024216 0ustar alastairalastairmodule math_submodule_10 implicit none interface logspace module function func1(n, base) result(res) integer, intent(in) :: n integer, intent(in) :: base real :: res(max(n,0)) end function func1 module function func2(n, base) result(res) integer, intent(in) :: n real, intent(in) :: base integer :: res(max(n, 0)) end function func2 end interface end module submodule (math_submodule_10) log_submodule_10 implicit none contains module procedure func1 real, parameter :: array(2) = [1.0 , 2.0] res = array end procedure module procedure func2 integer, parameter :: array(2) = [1 , 2] res = array end procedure end submodule program submodule_10 use math_submodule_10 implicit none integer, parameter :: n = 2 integer, parameter :: base = 1 real :: result1(n) integer :: result2(n) result1 = logspace(n, base) result2 = logspace(n, base) print *, result1 print *, result2 if (.not. all(result1 == [1.0, 2.0])) error stop if (.not. all(result2 == [1, 2])) error stop end programlfortran-lfortran-2f73434/integration_tests/types_05.f900000664000175000017500000000034115141516316023366 0ustar alastairalastairprogram types_05 implicit none real :: r integer :: i r = 1. * 2 r = 2 * 1. r = 2 * (3+1.) r = 2 * (3.-1) r = 1/2 r = 1./2 r = 1/2. i = 1. * 2 i = 2 * 1. i = 2 * (3+1.) i = 2 * (3.-1) i = 1/2 i = 1./2 i = 1/2. end program lfortran-lfortran-2f73434/integration_tests/intrinsics_313.f900000664000175000017500000000350215141516316024473 0ustar alastairalastairprogram intrinsics_313 implicit none integer(4), parameter :: i1(1) = maxloc([1,2,3]) integer(4), parameter :: i2(1) = maxloc([1.0, 2.0, 3.0]) integer(4), parameter :: i3(1) = maxloc(["aa", "db", "ca"]) integer(4), parameter :: i4(1) = maxloc([1,2,3], 1, [.true., .true., .true.]) integer(8), parameter :: i5(1) = maxloc([1,2,3], 1, mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = maxloc([1,2,3], mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = maxloc(["aa", "db", "ca"], 1, mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = maxloc(["aa", "db", "ca"], mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = maxloc([1, 3, 2], 1, mask = [.true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = maxloc([3, 2, 1, 3], back = .true.) integer(4), parameter :: i11(1) = maxloc([3.0, 2.0, 1.0, 3.0], back = .true.) integer(4), parameter :: i12(1) = maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 4) print *, i1 if (i1(1) /= 3) error stop print *, i2 if (i2(1) /= 3) error stop print *, i3 if (i3(1) /= 2) error stop print *, i4 if (i4(1) /= 3) error stop print *, i5 if (i5(1) /= 3) error stop print *, i6 if (i6(1) /= 3) error stop print *, i7 if (i7(1) /= 3) error stop print *, i8 if (i8(1) /= 3) error stop print *, i9 if (i9(1) /= 3) error stop print *, i10 if (i10(1) /= 4) error stop print *, i11 if (i11(1) /= 4) error stop print *, i12 if (i12(1) /= 0) error stop print *, kind(maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) if (kind(maxloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_123.f900000664000175000017500000000375115141516316024500 0ustar alastairalastairprogram intrinsics_123 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = shiftl([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = shiftl([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [24, -52, 144, 320, 2144] integer(8) :: expected_res2(5) = [210944, 356352, 1408, -95, -137216] integer(4), parameter :: comp1 = shiftl(12, 1) integer(8), parameter :: comp2 = shiftl(103, 11) print *, comp1 if (comp1 /= 24) error stop print *, comp2 if (comp2 /= 210944) error stop res_x = shiftl(arg_x, arg_y) res_x2 = shiftl(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, shiftl(10_4, 0) if (.not. shiftl(10_4, 0) == 10) error stop print*, shiftl(-10_8, 1) if ( shiftl(-10_8, 1) /= -20 ) error stop print*, shiftl(not(10_4), 2) if ( shiftl(not(10_4), 2) /= -44 ) error stop print*, shiftl(not(10_8), 3) if ( shiftl(not(10_8), 3) /= -88 ) error stop print*, shiftl(-x, y) if ( shiftl(-x, y) /= -64 ) error stop print*, shiftl(i, j) if ( shiftl(i, j) /= 128 ) error stop print*, shiftl(10, 1) if ( shiftl(10, 1) /= 20 ) error stop print*, shiftl(8, 2) if ( shiftl(8, 2) /= 32 ) error stop end lfortran-lfortran-2f73434/integration_tests/floor_03.f900000664000175000017500000000064415141516316023347 0ustar alastairalastairprogram floor_03 implicit none real :: x1, x2, x3 real :: y1, y2, y3 x1 = 3.3 ! 3 x2 = 3.5 ! 3 x3 = 3.7 ! 3 y1 = -3.3 ! -4 y2 = -3.5 ! -4 y3 = -3.7 ! -4 if(floor(x1) /= 3 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop if(floor(y1) /= -4 .or. floor(y2) /= -4 .or. floor(y3) /= -4) error stop print*, floor(x1), floor(x2), floor(x3) print*, floor(y1), floor(y2), floor(y3) end program lfortran-lfortran-2f73434/integration_tests/class_17.f900000664000175000017500000000560615141516316023343 0ustar alastairalastairmodule class_17_mod implicit none type :: type_pass integer :: value contains procedure :: set_value_pass generic :: set_value => set_value_pass end type type :: type_no_pass integer :: value contains procedure, nopass :: set_value_no_pass, set_value_no_pass_no_obj generic :: set_value => set_value_no_pass, set_value_no_pass_no_obj end type contains subroutine set_value_pass(this, value) class(type_pass), intent(inout) :: this integer, intent(in) :: value this%value = 2 * value end subroutine subroutine set_value_no_pass(obj, value) class(type_no_pass), intent(inout) :: obj integer, intent(in) :: value obj%value = value end subroutine subroutine set_value_no_pass_no_obj(value) integer, intent(inout) :: value value = 25 end subroutine end module program class_17 use class_17_mod implicit none integer :: value type(type_pass) :: obj_pass type(type_no_pass) :: obj_no_pass obj_pass%value = 42 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration) ! case 1. passed as argument call obj_pass%set_value(45) print *, "obj_pass%value: ", obj_pass%value if (obj_pass%value /= 90) error stop ! case 2. passed as kwarg call obj_pass%set_value(value=50) print *, "obj_pass%value: ", obj_pass%value if (obj_pass%value /= 100) error stop obj_no_pass%value = 42 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration) ! case 1. both are arguments call obj_no_pass%set_value(obj_no_pass, 5) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 5) error stop ! case 2. first is argument, second is kwarg call obj_no_pass%set_value(obj_no_pass, value=10) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 10) error stop ! case 3. both are kwargs call obj_no_pass%set_value(obj=obj_no_pass, value=11) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 11) error stop ! case 4. both are kwargs, but position interchanged call obj_no_pass%set_value(value=64, obj=obj_no_pass) print *, "obj_no_pass%value: ", obj_no_pass%value if (obj_no_pass%value /= 64) error stop value = 10 ! below tests show different calls to the same ! GenericProcedure (actually the same StructMethodDeclaration), ! which accepts only one argument ! case 1. passed as argument call obj_no_pass%set_value(value) print *, "value: ", value if (value /= 25) error stop value = 30 ! case 2. passed as kwarg call obj_no_pass%set_value(value=value) print *, "value: ", value if (value /= 25) error stop end program class_17 lfortran-lfortran-2f73434/integration_tests/derived_types_30.f900000664000175000017500000000237215141516316025074 0ustar alastairalastairmodule testdrive_derived_types_30 implicit none public :: unittest_type abstract interface subroutine test_interface(error) integer, intent(out) :: error end subroutine test_interface end interface type :: unittest_type procedure(test_interface), pointer, nopass :: test => null() logical :: should_fail = .false. end type unittest_type contains subroutine run_unittest(test_var, error) type(unittest_type), intent(in) :: test_var integer, intent(inout) :: error call test_var%test(error) end subroutine run_unittest subroutine test_impl1(error) integer, intent(out) :: error error = 2 end subroutine test_impl1 end module testdrive_derived_types_30 program derived_types_30 use testdrive_derived_types_30 implicit none type(unittest_type) :: var integer :: error var % test => test_impl call run_unittest(var, error) print *, error if( error /= 1 ) error stop var % test => test_impl1 call run_unittest(var, error) print *, error if( error /= 2 ) error stop contains subroutine test_impl(error) integer, intent(out) :: error error = 1 end subroutine test_impl end program lfortran-lfortran-2f73434/integration_tests/parsing_01.f900000664000175000017500000000136215141516316023665 0ustar alastairalastairmodule submodule implicit none integer :: complex = 1 interface module subroutine function(integer,real) integer, intent(in) :: integer integer, intent(out) :: real end subroutine function end interface contains end module submodule submodule (submodule) module contains module procedure function real = 2*integer end procedure function end submodule module program program use submodule, only: character => complex, subroutine => function implicit none integer :: integer, real integer = character associate: associate (logical=>character,complex=>real) call subroutine(logical,complex) print*, (complex) end associate associate end program program lfortran-lfortran-2f73434/integration_tests/derived_types_54.f900000664000175000017500000000147715141516316025107 0ustar alastairalastairmodule derived_types_54_m implicit none type :: Base contains procedure :: get_out => Base_get_out end type type, extends(Base) :: Derived contains procedure :: get_out => Derived_get_out end type contains subroutine Base_get_out(self, outi) class(Base) :: self integer :: outi outi = 1 end subroutine subroutine Derived_get_out(self, outi) class(Derived) :: self integer :: outi outi = 2 end subroutine end module program derived_types_54 use derived_types_54_m implicit none type(Base) :: b type(Derived) :: d integer :: outi call d%get_out(outi) if (outi /= 2) error stop call b%get_out(outi) if (outi /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/passing_array_04.f900000664000175000017500000000127415141516316025071 0ustar alastairalastairMODULE passing_array_04_mod implicit none CONTAINS FUNCTION test_01 (len,value) result(res) implicit none integer ,intent(in) :: len INTEGER, DIMENSION(2,2,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 subroutine test_entry integer :: len INTEGER, DIMENSION(6, 2) :: value INTEGER :: ret len = 3 ret = test_01(len,value) print * , ret if(ret /= 12) error stop end subroutine test_entry END MODULE passing_array_04_mod program passing_array_04 use passing_array_04_mod implicit none call test_entry end program passing_array_04 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_09.f900000664000175000017500000000117515141516316026605 0ustar alastairalastairprogram legacy_array_sections_09 implicit none integer :: n, lwa real, allocatable :: wa(:) n = 3 lwa = 10 allocate(wa(lwa)) wa = 0.0 call caller(n, lwa, wa) contains subroutine callee(n, diag) implicit none integer, intent(in) :: n real, intent(inout) :: diag(n) diag = diag end subroutine callee subroutine caller(n, lwa, wa) implicit none integer, intent(in) :: n integer, intent(in) :: lwa real, intent(inout) :: wa(lwa) call callee(n, wa(1)) end subroutine caller end program legacy_array_sections_09 lfortran-lfortran-2f73434/integration_tests/complex_08.f900000664000175000017500000000260615141516316023702 0ustar alastairalastairprogram complex_08 use iso_fortran_env, only: sp => real32, dp => real64 implicit none complex(sp), parameter :: c1 = conjg((1.0_sp, 2.0_sp)) complex(dp), parameter :: c2 = conjg((-3.0_dp, -4.0_dp)) complex(sp), parameter :: ar1(2) = conjg([(1.0_sp, 2.0_sp), (-3.0_sp, 4.0_sp)]) complex(dp), parameter :: ar2(2) = conjg([(-1.0_dp, -2.0_dp), (3.0_dp, -4.0_dp)]) complex(sp) :: x = conjg((0, 0)) complex(dp) :: y = conjg((2.0, -5.5)) complex(dp) :: z = (42, 3.14) complex(sp) :: arr1(3) = [(0, 0), (2.0, 5.5), (42, -3.14)] complex(dp) :: arr2(3) = [(-1.0, -2.0), (3.0, -4.0), (42, -3.14)] print *, c1 if (abs(c1 - (1.0_sp, -2.0_sp)) > 1e-5) error stop print *, c2 if (abs(c2 - (-3.0_dp, 4.0_dp)) > 1e-5) error stop print *, ar1 if (any(abs(ar1 - [(1.0_sp, -2.0_sp), (-3.0_sp, -4.0_sp)]) > 1e-5)) error stop print *, ar2 if (any(abs(ar2 - [(-1.0_dp, 2.0_dp), (3.0_dp, 4.0_dp)]) > 1e-5)) error stop print *, x if (abs(x - (0, 0)) > 1e-5) error stop print *, y if (abs(y - (2.0, 5.5)) > 1e-5) error stop print *, conjg(z) if (abs(conjg(z) - (42, -3.14)) > 1e-5) error stop print *, conjg(arr1) if (any(abs(conjg(arr1) - [(0, 0), (2.0, -5.5), (42, 3.14)]) > 1e-5)) error stop print *, conjg(arr2) if (any(abs(conjg(arr2) - [(-1.0, 2.0), (3.0, 4.0), (42, 3.14)]) > 1e-5)) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_17.f900000664000175000017500000000133315141516316026431 0ustar alastairalastairprogram separate_compilation_17 use mod_separate_compilation_17 implicit none integer(4) :: fnv_1_hasher = 1 type(key_type) :: key integer(1) :: test_object(4) allocate(key % value(4)) fnv_1_hasher = fnv_1_hash( key % value ) print *, fnv_1_hasher print *, key % value if (fnv_1_hasher /= 5) error stop if (.not. all(key % value == [1, 2, 3, 4])) error stop call test_fnv_1() contains subroutine test_fnv_1() integer(4) :: hash hash = fnv_1_hash( test_object ) print *, hash print *, test_object if (hash /= 5) error stop if (.not. all(test_object == [1, 2, 3, 4])) error stop end subroutine test_fnv_1 end programlfortran-lfortran-2f73434/integration_tests/interface_12b.f900000664000175000017500000000060115141516316024321 0ustar alastairalastairmodule interface_12b_mod implicit none type, public :: t integer :: value end type t interface get_value module procedure :: get_real end interface get_value contains subroutine get_real(self, val) class(t), intent(in) :: self real, intent(out) :: val val = real(self%value) end subroutine get_real end module interface_12b_mod lfortran-lfortran-2f73434/integration_tests/intrinsics_80.f900000664000175000017500000000046415141516316024420 0ustar alastairalastairprogram intrinsics_80 implicit none integer :: x(2) x = 10 print *, func(x) if (x(1) /= 10) error stop if (x(2) /= 10) error stop contains integer function func(R) result(i) integer, intent(in) :: R(:) i = sum(R) end function end program lfortran-lfortran-2f73434/integration_tests/doloop_02.f900000664000175000017500000000074115141516316023517 0ustar alastairalastairprogram doloop_02 implicit none integer :: i, j, a, b j = 0 a = 1 b = 10 do i = a, b j = j + i end do if (j /= 55) error stop print *, j a = 0 do i = 1, 10 do j = 1, 10 a = a + (i-1)*10+j end do end do if (a /= 100*101/2) error stop print *, a a = 0 do i = 1, 10 do j = 1, i a = a + j end do end do if (a /= 220) error stop print *, a end lfortran-lfortran-2f73434/integration_tests/read_35.f900000664000175000017500000000112215141516316023136 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6811 ! Reading from character variable into integer array ! Exact MRE from issue body program read_35 implicit none character(23) :: cinput = '42 666 -42 -666 10 9 0 ' integer :: input(7) read(cinput, *) input print "(A,7(1X,I0))", 'input was ', input if (input(1) /= 42) error stop if (input(2) /= 666) error stop if (input(3) /= -42) error stop if (input(4) /= -666) error stop if (input(5) /= 10) error stop if (input(6) /= 9) error stop if (input(7) /= 0) error stop end program read_35 lfortran-lfortran-2f73434/integration_tests/class_80.f900000664000175000017500000000123315141516316023333 0ustar alastairalastairmodule class_80_mod type :: class_value character(len=:), allocatable :: value end type type :: temp_type character(len=:), allocatable :: value end type contains subroutine cast_to_keyval(ptr, val) class(class_value), intent(inout) :: ptr(:) type(temp_type), intent(inout), optional :: val(:) val(1)%value = ptr(1)%value end subroutine cast_to_keyval end module program class_80 use class_80_mod type(temp_type), allocatable :: x(:) type(class_value), allocatable :: y(:) allocate(x(1)) allocate(y(1)) y(1)%value = "Hello World" call cast_to_keyval(y, x) if (x(1)%value /= "Hello World") error stop end program class_80lfortran-lfortran-2f73434/integration_tests/use_04.f900000664000175000017500000000060415141516316023017 0ustar alastairalastairmodule use_04_mod implicit none private contains subroutine increment(x) integer, intent(inout) :: x x = x + 2 end subroutine end module use_04_mod program use_04 use use_04_mod implicit none integer :: x x = 5 call increment(x) if (x /= 6) error stop contains subroutine increment(x) integer, intent(out) :: x x = x + 1 end subroutine end programlfortran-lfortran-2f73434/integration_tests/intrinsics_319.f900000664000175000017500000000113015141516316024474 0ustar alastairalastairprogram intrinsics_319 integer(4) :: count4, count_max4, count_rate4 integer(8) :: count8, count_max8, count_rate8 real(4) :: count_rate_r4 real(8) :: count_rate_r8 call system_clock(count4, count_rate4, count_max4) print *, count4, count_rate4, count_max4 call system_clock(count8, count_rate8, count_max8) print *, count8, count_rate8, count_max8 call system_clock(count4, count_rate_r4, count_max4) print *, count4, count_rate_r4, count_max4 call system_clock(count8, count_rate_r8, count_max8) print *, count8, count_rate_r8, count_max8 end programlfortran-lfortran-2f73434/integration_tests/integer_boz_01.f900000664000175000017500000000033415141516316024527 0ustar alastairalastairprogram integer_boz_01 use iso_fortran_env, only: int64 implicit none print * , int( z'DEADBEEF1EADBEEF', int64 ) if ( int( z'DEADBEEF1EADBEEF', int64 ) /= -2401053092097442065_8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/declaration_04.f900000664000175000017500000000064615141516316024516 0ustar alastairalastair! Handle assignment from parameters of struct type ! Inside Declaration using type() syntax program declaration_04 implicit none type class_t integer :: i character(len=5) :: s end type type(class_t) , parameter :: T_ONE = class_t(15,'abcde') type(class_t) :: my_class = T_ONE print *, my_class if ((my_class%i) /= 15) error stop if ((my_class%s) /= 'abcde') error stop end program declaration_04lfortran-lfortran-2f73434/integration_tests/intrinsics_17.f900000664000175000017500000000057715141516316024425 0ustar alastairalastairprogram intrinsics_17 use iso_fortran_env, only: sp=>real32, dp=>real64 real(sp) :: x real(dp) :: y x = exp(1.5_sp) print *, x y = exp(1.5_dp) print *, y x = log(1.5_sp) print *, x y = log(1.5_dp) print *, y x = erf(1.5_sp) print *, x y = erf(1.5_dp) print *, y x = atan2(1.5_sp, 2.5_sp) print *, x y = atan2(1.5_dp, 2.5_dp) print *, y y = datan2(1.5_dp, 2.5_dp) print *, y end lfortran-lfortran-2f73434/integration_tests/templates/0000775000175000017500000000000015141516316023376 5ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/templates/sort.f900000664000175000017500000001041115141516316024702 0ustar alastairalastairmodule sort_m implicit none private public :: sort_tmpl requirement comparable(T, lt, gt) type, deferred :: T elemental function lt(lhs, rhs) type(T), intent(in) :: lhs, rhs logical :: lt end function elemental function gt(lhs, rhs) type(T), intent(in) :: lhs, rhs logical :: gt end function end requirement template sort_tmpl(T, lt, gt) private public :: sorted_order, sorted, sort require :: comparable(T, lt, gt) generic :: operator(<) => lt generic :: operator(>) => gt generic :: sorted_order => sorted_order_ generic :: sorted => sorted_ generic :: sort => sort_ contains pure recursive function sorted_order_(array) result(sorted_indices) type(T), intent(in) :: array(:) integer, allocatable :: sorted_indices(:) integer :: i associate(n => size(array)) select case (n) case (0) allocate(sorted_indices(0)) case (1) sorted_indices = [1] case (2) if (array(1) > array(2)) then sorted_indices = [2, 1] else sorted_indices = [1, 2] end if case default associate(pivot => (n/2 + 1), indices => [(i, i = 1, n)]) associate( & less_than_pivot => array < array(pivot), & greater_than_pivot => array > array(pivot)) associate( & indices_less_than_pivot => pack(indices, less_than_pivot), & indices_greater_than_pivot => pack(indices, greater_than_pivot), & indices_equal_pivot => pack(indices, .not.(less_than_pivot.or.greater_than_pivot))) associate( & sorted_less_than => sorted_order_(array(indices_less_than_pivot)), & sorted_greater_than => sorted_order_(array(indices_greater_than_pivot))) sorted_indices = & [ indices_less_than_pivot(sorted_less_than) & , indices_equal_pivot & , indices_greater_than_pivot(sorted_greater_than) & ] end associate end associate end associate end associate end select end associate end function pure function sorted_(array) type(T), intent(in) :: array(:) type(T), allocatable :: sorted_ sorted_ = array(sorted_order(array)) end function pure subroutine sort_(array) type(T), intent(inout) :: array(:) array = sorted(array) end subroutine end template end module program test_sort use sort_m, only: sort_tmpl implicit none instantiate sort_tmpl(real, operator(<), operator(>)), only: sorted_order instantiate sort_tmpl(integer, operator(<), operator(>)), only: sorted_order instantiate sort_tmpl(real, operator(>), operator(<)), only: reverse_sorted_order => sorted_order associate(real_order => sorted_order([3.0, 2.0, 2.0, 1.0])) if (.not.all(real_order == [4, 2, 3, 1])) then print *, "real_order was ", real_order, " but should have been ", [4, 2, 3, 1] end if end associate associate(int_order => sorted_order([3, 2, 2, 1])) if (.not.all(int_order == [4, 2, 3, 1])) then print *, "int_order was ", int_order, " but should have been ", [4, 2, 3, 1] end if end associate associate(reverse_order => reverse_sorted_order([1.0, 2.0, 2.0, 3.0])) if (.not.all(reverse_order == [4, 2, 3, 1])) then print *, "reverse_order was ", reverse_order, " but should have been ", [4, 2, 3, 1] end if end associate end programlfortran-lfortran-2f73434/integration_tests/templates/add.f900000664000175000017500000000225415141516316024451 0ustar alastairalastairmodule template_add_m implicit none private public :: add_t requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function end template contains subroutine test_template() instantiate add_t(real, operator(+)), only: add_real => add_generic instantiate add_t(integer, operator(+)), only: add_integer => add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop a = 5 b = 9 print*, "The result is ", add_integer(a, b) if (add_integer(a, b) /= 14) error stop end subroutine end module program template_add use template_add_m implicit none call test_template() end program template_add lfortran-lfortran-2f73434/integration_tests/templates/sum.f900000664000175000017500000000316415141516316024526 0ustar alastairalastairmodule sum_m private public :: sum_t requirement R(T, Tadd, Tzero) type :: T; end type function Tadd(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function function Tzero() result(z) type(T) :: z end function end requirement template sum_t(T, Tadd, Tzero) require :: R(T, Tadd, Tzero) private public :: sum_generic contains function sum_generic(x) result(r) type(T), intent(in) :: x(:) type(T) :: r integer :: i r = Tzero() do i = 1, size(x) r = Tadd(r, x(i)) end do end function end template contains real function real_add(x, y) result(z) real, intent(in) :: x, y z = x + y end function real function real_zero() result(z) z = 0 end function integer function int_add(x, y) result(z) integer, intent(in) :: x, y z = x + y end function integer function int_zero() result(z) z = 0 end function subroutine test_template() instantiate sum_t(real, real_add, real_zero), only: sum_real => sum_generic instantiate sum_t(integer, int_add, int_zero), only: sum_integer => sum_generic real :: x(10) integer :: y(10) x = 1 print*, "The result is ", sum_real(x) if (abs(sum_real(x) - 10.0) > 1e-5) error stop y = 1 print*, "The result is ", sum_integer(a, b) if (sum_integer(a, b) /= 10) error stop end subroutine end module program sum use sum_m, only: test_template call test_template() end program lfortran-lfortran-2f73434/integration_tests/select_rank_13.f900000664000175000017500000000267715141516316024531 0ustar alastairalastairmodule example_mod implicit none contains subroutine check_arg(arg) class(*), dimension(..), intent(in) :: arg select rank (assoc => arg) rank (0) select type (assoc) type is (integer) print *, "Received a scalar integer: ", assoc class default error stop end select rank (1) select type (assoc) type is (integer) print *, "Received an array of integers (rank: 1)" ! If needed, access as 1D: print *, assoc class default error stop end select rank (2) select type (assoc) type is (integer) print *, "Received an array of integers (rank: 2)" ! If needed, access as 2D: print *, assoc class default error stop end select rank default print *, "Unsupported array rank: ", rank(arg) error stop end select end subroutine check_arg end module example_mod program test use example_mod implicit none integer :: scalar_int = 42 integer :: int_array1(3) = [1, 2, 3] integer :: int_array2(2,2) = reshape([1,2,3,4], [2,2]) call check_arg(scalar_int) ! Outputs: Received a scalar integer: 42 call check_arg(int_array1) ! Outputs: Received an array of integers (rank: 1) call check_arg(int_array2) ! Outputs: Received an array of integers (rank: 2) end program test lfortran-lfortran-2f73434/integration_tests/statement_06.f900000664000175000017500000000055515141516316024236 0ustar alastairalastairSUBROUTINE st_fn_bug2() COMPLEX ZDUM,ZDUM1,ZDUM2,CSIGN1 REAL CABS1 CABS1(ZDUM) = ABS(REAL(ZDUM)) + ABS(AIMAG(ZDUM)) CSIGN1(ZDUM1,ZDUM2) = CABS1(ZDUM1)*(ZDUM2/CABS1(ZDUM2)) ZDUM1 = (1.0, 2.0) ZDUM2 = (2.0, 3.0) print *, CABS1(CSIGN1(ZDUM1,ZDUM2)) if ( abs(CABS1(CSIGN1(ZDUM1,ZDUM2)) - 3.0) > 1e-8 ) error stop END program statement_02 call st_fn_bug2() end program lfortran-lfortran-2f73434/integration_tests/class_85.f900000664000175000017500000000172315141516316023344 0ustar alastairalastairmodule class_85_mod implicit none type :: string_t character(:), allocatable :: s end type string_t type :: string_list_t type(string_t), allocatable :: items(:) type(string_t), allocatable :: item end type string_list_t contains subroutine set_list(list) type(string_t), allocatable, intent(in) :: list(:) if (allocated(list)) error stop "list allocated" end subroutine set_list subroutine set_list_scalar(list_mem) type(string_t), allocatable, intent(in) :: list_mem if (allocated(list_mem)) error stop "list allocated" end subroutine set_list_scalar end module class_85_mod program class_85 use class_85_mod implicit none type(string_list_t) :: mylist call set_list(mylist%items) call set_list_scalar(mylist%item) if (allocated(mylist%items)) error stop "mylist%items allocated" if (allocated(mylist%item)) error stop "mylist%item allocated" end program class_85lfortran-lfortran-2f73434/integration_tests/intrinsics_392.f900000664000175000017500000000116415141516316024504 0ustar alastairalastairmodule bspline_sub_module contains subroutine check_inputs(nx) implicit none integer(4),intent(in),optional :: nx call check(nx) contains subroutine check(n) implicit none integer(4),intent(in),optional :: n print *, present(n) if (present(n) .neqv. .true.) error stop end subroutine check end subroutine check_inputs end module bspline_sub_module program intrinsics_392 use bspline_sub_module implicit none integer(4) :: nx call check_inputs(nx) end program intrinsics_392 lfortran-lfortran-2f73434/integration_tests/file_18.f900000664000175000017500000000067115141516316023153 0ustar alastairalastairprogram file_18 implicit none integer :: j = 11, x = 43, y =-54 integer :: nlines = 0, io open(j, file="file_18_data.txt", status='old') write(j, *) x write(j, *) y close(j) open (j, file = 'file_18_data.txt', status='old') do read(j, *, iostat=io) if (io/=0) exit nlines = nlines + 1 end do close (j) print *, nlines if (nlines /= 2) error stop end program file_18 lfortran-lfortran-2f73434/integration_tests/functions_12.f900000664000175000017500000000042615141516316024234 0ustar alastairalastairprogram functions_12 implicit none contains logical function decodebase(string) result(r) implicit none character(len=*), intent(in) :: string character(len=len(string)) :: string_local real, parameter :: x = real(huge(1)) end function decodebase end program lfortran-lfortran-2f73434/integration_tests/class_15.f900000664000175000017500000000204315141516316023331 0ustar alastairalastairmodule class_15_mod type :: logger_type contains private procedure, public, pass(self) :: add_log_file end type logger_type contains subroutine add_log_file(self, filename, unit) class(logger_type), intent(inout) :: self character(*), optional :: filename integer, optional :: unit if (present(filename)) filename = "lfortran" if (present(unit)) unit = 10 end subroutine add_log_file end module program class_15 use class_15_mod type(logger_type) :: logger integer :: unit character(len=100) :: filename call logger % add_log_file(unit=unit) !> which is already done call logger % add_log_file(filename=filename) call logger % add_log_file(unit=unit, filename=filename) call logger % add_log_file(filename=filename, unit=unit) ! reverse the order call logger % add_log_file() print *, filename if (filename /= "lfortran") error stop print *, unit if (unit /= 10) error stop end programlfortran-lfortran-2f73434/integration_tests/implied_do_loops_print.f900000664000175000017500000000066515141516316026464 0ustar alastairalastairprogram test_write_implied_do use iso_fortran_env, only: output_unit implicit none integer, parameter :: stdout = output_unit integer :: ii, iii character(len=20) :: lines(3) lines(1) = "first" lines(2) = "second" lines(3) = "third" ii = 3 print *, ( trim(lines(iii)), iii = 1, ii ) ! Verify that all values were printed if (ii /= 3) error stop end program test_write_implied_do lfortran-lfortran-2f73434/integration_tests/string_24.f900000664000175000017500000000033215141516316023531 0ustar alastairalastairprogram string_24 type :: string character(:), allocatable :: s end type type(string) :: z(5) allocate(character(1) :: z(1)%s) z(1)%s(1:1) = "x" print *, z(1)%s(1:1) if (z(1)%s(1:1) /= "x") error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_09.f900000664000175000017500000000153115141516316023526 0ustar alastairalastairsubroutine parallel_factorial(n, ctr) use omp_lib use iso_fortran_env implicit none integer, intent(in) :: n integer(kind =int64), intent(inout) :: ctr integer(kind =int64) :: local_ctr integer :: i local_ctr = 1 !$omp parallel private(i) reduction(*:local_ctr) !$omp do do i = 1, n local_ctr = local_ctr * i end do !$omp end do !$omp end parallel ctr = ctr + local_ctr end subroutine program openmp_09 use omp_lib use iso_fortran_env integer, parameter :: n = 20 integer(kind =int64) :: ctr integer(kind =int64) :: res res = 2432902008176640000_int64 ! Factorial of 20 call omp_set_num_threads(8) ctr = 0 call parallel_factorial(n, ctr) print *, ctr if(ctr /= res) error stop end program lfortran-lfortran-2f73434/integration_tests/common_06.f900000664000175000017500000000020115141516316023506 0ustar alastairalastairsubroutine solsy() double precision rowns common /ls0001/ rowns(209) end program common_06 call solsy() end program lfortran-lfortran-2f73434/integration_tests/array_constructor_02.f900000664000175000017500000000122215141516316026001 0ustar alastairalastairprogram array_constructor_02 implicit none type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type :: build_target_t type(build_target_ptr), allocatable :: dependencies(:) end type type(build_target_t) :: a, b call add_dependency(a, b) contains subroutine add_dependency(target, dependency) type(build_target_t), intent(inout) :: target type(build_target_t) , intent(in), target :: dependency allocate(target%dependencies(2)) target%dependencies = [target%dependencies, build_target_ptr(dependency)] end subroutine add_dependency end program lfortran-lfortran-2f73434/integration_tests/associate_06.f900000664000175000017500000000016715141516316024204 0ustar alastairalastairmodule associate_06_stdlib_string use associate_06_stdlib_string_type end module program associate_06 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_110.f900000664000175000017500000000037415141516316024472 0ustar alastairalastairprogram intrinsics_110 integer :: a, b, result a = 10 b = 7 if ( .not. min0( a1 = a, a2 = b ) == 7 ) error stop if ( .not. min0( a, a2 = b ) == 7 ) error stop if ( .not. min0( a, b ) == 7 ) error stop end program intrinsics_110 lfortran-lfortran-2f73434/integration_tests/intrinsics_170.f900000664000175000017500000001740415141516316024502 0ustar alastairalastairprogram intrinsics_170 use iso_fortran_env, only: sp => real32, dp => real64 implicit none integer, parameter :: i1 = exponent(1.0_sp) integer, parameter :: i2 = exponent(1.32_dp) integer, parameter :: i3(3) = exponent([3.121_sp, 4.1_sp, 5.32_sp]) integer, parameter :: i4(3) = exponent([3.121_dp, 4.1_dp, 5.32_dp]) real(sp) :: x real(dp) :: y real(sp) :: arr1(3) = [3.121_sp, 4.1_sp, 5.32_sp] real(dp) :: arr2(3) = [3.121_dp, 4.1_dp, 5.32_dp] x = 4.1 y = 4.1_dp print *, i1 if (i1 /= 1) error stop print *, i2 if (i2 /= 1) error stop print *, i3 if (any(i3 /= [2, 3, 3])) error stop print *, i4 if (any(i4 /= [2, 3, 3])) error stop print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(4.1_dp) if (exponent(4.1_dp) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop x = 0.5 y = 0.5_dp print *, exponent(x) if (exponent(x) /= 0) error stop print *, exponent(0.5_dp) if (exponent(0.5_dp) /= 0) error stop print *, exponent(y) if (exponent(y) /= 0) error stop print *, exponent(0.5) if (exponent(0.5) /= 0) error stop x = -12.94 y = -12.94_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(-12.94_dp) if (exponent(-12.94_dp) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-12.94) if (exponent(-12.94) /= 4) error stop x = 1e+6_sp y = 1e+10_dp print *, exponent(x) if (exponent(x) /= 20) error stop print *, exponent(1e+10_dp) if (exponent(1e+10_dp) /= 34) error stop print *, exponent(y) if (exponent(y) /= 34) error stop print *, exponent(1e+6) if (exponent(1e+6) /= 20) error stop x = -1e+6_sp y = -1e+10_dp print *, exponent(x) if (exponent(x) /= 20) error stop print *, exponent(-1e+10_dp) if (exponent(-1e+10_dp) /= 34) error stop print *, exponent(y) if (exponent(y) /= 34) error stop print *, exponent(-1e+6) if (exponent(-1e+6) /= 20) error stop x = 1e-6_sp y = 1e-10_dp print *, exponent(x) if (exponent(x) /= -19) error stop print *, exponent(1e-10_dp) if (exponent(1e-10_dp) /= -33) error stop print *, exponent(y) if (exponent(y) /= -33) error stop print *, exponent(1e-6) if (exponent(1e-6) /= -19) error stop x = 0.0 y = 0.0_dp print *, exponent(x) if (exponent(x) /= 0) error stop print *, exponent(0.0_dp) if (exponent(0.0_dp) /= 0) error stop print *, exponent(y) if (exponent(y) /= 0) error stop print *, exponent(0.0) if (exponent(0.0) /= 0) error stop print *, exponent(3.99) if (exponent(3.99) /= 2) error stop print *, exponent(3.99_dp) if (exponent(3.99_dp) /= 2) error stop x = 3.99 y = 3.99_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(7.99) if (exponent(7.99) /= 3) error stop print *, exponent(7.99_dp) if (exponent(7.99_dp) /= 3) error stop x = 7.99 y = 7.99_dp print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop print *, exponent(8.1) if (exponent(8.1) /= 4) error stop print *, exponent(8.1_dp) if (exponent(8.1_dp) /= 4) error stop x = 8.1 y = 8.1_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(2.0) if (exponent(2.0) /= 2) error stop print *, exponent(2.0_dp) if (exponent(2.0_dp) /= 2) error stop x = 2.0 y = 2.0_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(8.0) if (exponent(8.0) /= 4) error stop print *, exponent(8.0_dp) if (exponent(8.0_dp) /= 4) error stop x = 8.0 y = 8.0_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(0.1) if (exponent(0.1) /= -3) error stop print *, exponent(0.1_dp) if (exponent(0.1_dp) /= -3) error stop x = 0.1 y = 0.1_dp print *, exponent(x) if (exponent(x) /= -3) error stop print *, exponent(y) if (exponent(y) /= -3) error stop print *, exponent(0.01) if (exponent(0.01) /= -6) error stop print *, exponent(0.01_dp) if (exponent(0.01_dp) /= -6) error stop x = 0.01 y = 0.01_dp print *, exponent(x) if (exponent(x) /= -6) error stop print *, exponent(y) if (exponent(y) /= -6) error stop print *, exponent(0.001) if (exponent(0.001) /= -9) error stop print *, exponent(0.001_dp) if (exponent(0.001_dp) /= -9) error stop x = 0.001 y = 0.001_dp print *, exponent(x) if (exponent(x) /= -9) error stop print *, exponent(y) if (exponent(y) /= -9) error stop print *, exponent(-3.99) if (exponent(-3.99) /= 2) error stop print *, exponent(-3.99_dp) if (exponent(-3.99_dp) /= 2) error stop x = -3.99 y = -3.99_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(-7.99) if (exponent(-7.99) /= 3) error stop print *, exponent(-7.99_dp) if (exponent(-7.99_dp) /= 3) error stop x = -7.99 y = -7.99_dp print *, exponent(x) if (exponent(x) /= 3) error stop print *, exponent(y) if (exponent(y) /= 3) error stop print *, exponent(-8.1) if (exponent(-8.1) /= 4) error stop print *, exponent(-8.1_dp) if (exponent(-8.1_dp) /= 4) error stop x = -8.1 y = -8.1_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-2.0) if (exponent(-2.0) /= 2) error stop print *, exponent(-2.0_dp) if (exponent(-2.0_dp) /= 2) error stop x = -2.0 y = -2.0_dp print *, exponent(x) if (exponent(x) /= 2) error stop print *, exponent(y) if (exponent(y) /= 2) error stop print *, exponent(-8.0) if (exponent(-8.0) /= 4) error stop print *, exponent(-8.0_dp) if (exponent(-8.0_dp) /= 4) error stop x = -8.0 y = -8.0_dp print *, exponent(x) if (exponent(x) /= 4) error stop print *, exponent(y) if (exponent(y) /= 4) error stop print *, exponent(-0.1) if (exponent(-0.1) /= -3) error stop print *, exponent(-0.1_dp) if (exponent(-0.1_dp) /= -3) error stop x = -0.1 y = -0.1_dp print *, exponent(x) if (exponent(x) /= -3) error stop print *, exponent(y) if (exponent(y) /= -3) error stop print *, exponent(-0.01) if (exponent(-0.01) /= -6) error stop print *, exponent(-0.01_dp) if (exponent(-0.01_dp) /= -6) error stop x = -0.01 y = -0.01_dp print *, exponent(x) if (exponent(x) /= -6) error stop print *, exponent(y) if (exponent(y) /= -6) error stop print *, exponent(-0.001) if (exponent(-0.001) /= -9) error stop print *, exponent(-0.001_dp) if (exponent(-0.001_dp) /= -9) error stop x = -0.001 y = -0.001_dp print *, exponent(x) if (exponent(x) /= -9) error stop print *, exponent(y) if (exponent(y) /= -9) error stop print *, exponent(arr1) if (any(exponent(arr1) /= [2, 3, 3])) error stop print *, exponent(arr2) if (any(exponent(arr2) /= [2, 3, 3])) error stop print *, kind(exponent(1.0_sp)) if (kind(exponent(1.0_sp)) /= 4) error stop print *, kind(exponent(1.0_dp)) if (kind(exponent(1.0_dp)) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/equivalence_09.f900000664000175000017500000000042015141516316024525 0ustar alastairalastairprogram equivalence_09 real ci( 2, 2 ), civ( 4 ), cr( 2, 2 ), crv( 4 ) equivalence ( ci( 1, 1 ), civ( 1 ) ), ( cr( 1, 1 ), crv( 1 ) ) ci(1,1) = 5 if(civ(1) /= 5) error stop cr(1,1) = 7 if(crv(1) /= 7) error stop end lfortran-lfortran-2f73434/integration_tests/sin_03.f900000664000175000017500000000017215141516316023013 0ustar alastairalastairprogram sin_03 use iso_fortran_env, only: dp => real64 implicit none real(dp) :: x x = sin(1.5_dp) print *, x end program lfortran-lfortran-2f73434/integration_tests/arrays_25.f900000664000175000017500000000073315141516316023532 0ustar alastairalastairprogram arrays_25 implicit none type :: model_t integer, allocatable :: decoder_idx(:) end type type(model_t) :: m allocate(m%decoder_idx(10)) m%decoder_idx(:) = 0 m%decoder_idx(5) = 5 print *, m%decoder_idx call decode(m%decoder_idx) contains subroutine decode(idx) integer, intent(in) :: idx(:) if (idx(4) /= 0) error stop if (idx(5) /= 5) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/derived_types_55.f900000664000175000017500000000166115141516316025103 0ustar alastairalastairmodule derived_types_55_m implicit none type :: Base contains procedure :: get_out end type Base type, extends(Base) :: Derived contains procedure :: get_out => derived_get_out end type Derived contains subroutine get_out(self, outi) class(Base), intent(in) :: self integer, intent(out) :: outi outi = 1 end subroutine get_out subroutine derived_get_out(self, outi) class(Derived), intent(in) :: self integer, intent(out) :: outi outi = 2 end subroutine derived_get_out subroutine helper(self) class(Base), intent(in) :: self integer :: outi call self%get_out(outi) if (outi /= 2) error stop end subroutine helper end module derived_types_55_m program derived_types_55 use derived_types_55_m implicit none type(Derived) :: c call helper(c) end program derived_types_55 lfortran-lfortran-2f73434/integration_tests/file_07_data.dat0000664000175000017500000000022415141516316024306 0ustar alastairalastair  \"@p{@{^A @HRAffHz?pm@Hff@= @ (@R?Yff@33lfortran-lfortran-2f73434/integration_tests/equivalence_03.f900000664000175000017500000000110315141516316024516 0ustar alastairalastairprogram equivalence_03 implicit none DOUBLE PRECISION DMACH(5) INTEGER*4 SMALL(2) INTEGER*4 LARGE(2) INTEGER*4 RIGHT(2) INTEGER*4 DIVER(2) INTEGER*4 LOG10(2) EQUIVALENCE (DMACH(1),SMALL(1)) EQUIVALENCE (DMACH(2),LARGE(1)) EQUIVALENCE (DMACH(3),RIGHT(1)) EQUIVALENCE (DMACH(4),DIVER(1)) EQUIVALENCE (DMACH(5),LOG10(1)) dmach(2) = 5.6_8 if(large(1) /= 1717986918) error stop if(large(2) /= 1075209830) error stop dmach(2) = 5.7_8 if(large(1) /= -858993459) error stop if(large(2) /= 1075236044) error stop endlfortran-lfortran-2f73434/integration_tests/intrinsics_184.f900000664000175000017500000000345315141516316024506 0ustar alastairalastairprogram intrinsics_184 implicit none integer, parameter :: ascii = selected_char_kind ("ascii") integer, parameter :: ascii_case = selected_char_kind ("ASciI") integer, parameter :: default = selected_char_kind ("default") integer, parameter :: ucs4 = selected_char_kind ("ISO_10646") integer, parameter :: other = selected_char_kind ("other") character(5) :: ascii_str = "ascii" character(5) :: ascii_case_str = "ASciI" character(7) :: default_str = "default" character(9) :: ucs4_str = "ISO_10646" character(5) :: other_str = "other" print*, selected_char_kind("ascii") if (selected_char_kind("ascii") /= 1) error stop print*, selected_char_kind("ASciI") if (selected_char_kind("ASciI") /= 1) error stop print*, selected_char_kind("default") if (selected_char_kind("default") /= 1) error stop print*, selected_char_kind("ISO_10646") if (selected_char_kind("ISO_10646") /= 4) error stop print*, selected_char_kind("other") if (selected_char_kind("other") /= -1) error stop print*, selected_char_kind(ascii_str) if (selected_char_kind(ascii_str) /= 1) error stop print*, selected_char_kind(ascii_case_str) if (selected_char_kind(ascii_case_str) /= 1) error stop print*, selected_char_kind(default_str) if (selected_char_kind(default_str) /= 1) error stop print*, selected_char_kind(ucs4_str) if (selected_char_kind(ucs4_str) /= 4) error stop print*, selected_char_kind(other_str) if (selected_char_kind(other_str) /= -1) error stop print*, ascii if (ascii /= 1) error stop print*, ascii_case if (ascii_case /= 1) error stop print*, default if (default /= 1) error stop print*, ucs4 if (ucs4 /= 4) error stop print*, other if (other /= -1) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_44.f900000664000175000017500000000145015141516316023677 0ustar alastairalastairmodule modules_44_fpm_cmd_new use modules_44_module_fpm_filesystem, only : warnwrite implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir end type type, extends(fpm_cmd_settings) :: fpm_new_settings character(len=:), allocatable :: name end type contains subroutine cmd_new(settings) type(fpm_new_settings), intent(in) :: settings character(len=:), allocatable :: littlefile(:) littlefile = [character(len=80) :: '# ', 'My cool new project!'] call warnwrite(settings%name, littlefile) ! call warnwrite(settings%name, littlefile) end subroutine cmd_new end module modules_44_fpm_cmd_new program modules_44 use modules_44_fpm_cmd_new implicit none type(fpm_new_settings) :: settings call cmd_new(settings) end program modules_44 lfortran-lfortran-2f73434/integration_tests/save_01.f900000664000175000017500000000145715141516316023165 0ustar alastairalastairsubroutine save_sub() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function save_fun() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function module save_module_2 implicit none public real :: x = 5, z real, save :: y = 5 contains subroutine sub_save() real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end subroutine real function fun_save() implicit none real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end function end module program save_01 real :: x = 5, z real, save :: y = 5 real :: a(5), b(5,4) save a, b end program lfortran-lfortran-2f73434/integration_tests/functions_34.f900000664000175000017500000000147015141516316024240 0ustar alastairalastairmodule functions_34_mod_1 abstract interface subroutine OBJ() end subroutine end interface procedure(OBJ), pointer :: f_ptr contains subroutine caller_f_ptr() implicit none call f_ptr() end subroutine end module module functions_34_mod_2 contains subroutine set_ptr_and_call() use functions_34_mod_1, only : f_ptr, caller_f_ptr f_ptr => fff call caller_f_ptr() end subroutine subroutine fff() print *, "hi" end subroutine subroutine fff2() print *, "bye" end subroutine end module functions_34_mod_2 program functions_34 use functions_34_mod_2 use functions_34_mod_1 ,only: f_ptr call set_ptr_and_call() f_ptr => fff2 call f_ptr() end program functions_34lfortran-lfortran-2f73434/integration_tests/logical4.f900000664000175000017500000000032315141516316023414 0ustar alastairalastairprogram logical4 ! this program checks logical operators implicit none ! variable declaration logical :: a, b, c ! assigning values a = 2 b = -1 c = 0 print *, a, b, c end program logical4 lfortran-lfortran-2f73434/integration_tests/modules_07.f900000664000175000017500000000011715141516316023675 0ustar alastairalastairprogram modules_07 use modules_07_module, only: b implicit none call b() end lfortran-lfortran-2f73434/integration_tests/program_01.f900000664000175000017500000000155315141516316023673 0ustar alastairalastairprogram program_01 implicit none integer, parameter :: dp=kind(0.d0) real(dp) :: a integer :: i print *, "Normal random numbers:" do i = 1, 10 call rand(a) print *, a end do contains subroutine rand(x) ! Returns a psuedorandom scalar drawn from the standard normal distribution. ! ! [1] Marsaglia, G., & Bray, T. A. (1964). A Convenient Method for ! Generating Normal Variables. SIAM Review, 6(3), 260–264. real(dp), intent(out) :: x logical, save :: first = .true. real(dp), save :: u(2) real(dp) :: r2 if (first) then do call random_number(u) u = 2*u-1 r2 = sum(u**2) if (r2 < 1 .and. r2 > 0) exit end do u = u * sqrt(-2*log(r2)/r2) x = u(1) else x = u(2) end if first = .not. first end subroutine end program lfortran-lfortran-2f73434/integration_tests/character_17.f900000664000175000017500000000511715141516316024167 0ustar alastairalastair! Test CHARACTER(*) assumed-size arrays via EXTERNAL with various dimensions ! Comprehensive test for DescriptorArray handling in implicit interfaces: ! 1. CHARACTER(1) array with size 1 (basic case) ! 2. CHARACTER(10) array with size 3 (string length > 1, multiple elements) ! 3. 2D CHARACTER array (multi-dimensional) program character_17 implicit none character(1) :: single_char(1) character(10) :: multi_char(3) character(5) :: matrix(2, 3) external sub_char_1d_single external sub_char_1d_multi external sub_char_2d ! Test 1: Single element CHARACTER(1) array single_char(1) = 'A' call sub_char_1d_single(single_char) ! Test 2: CHARACTER(10) array with 3 elements multi_char(1) = 'First ' multi_char(2) = 'Second ' multi_char(3) = 'Third ' call sub_char_1d_multi(multi_char) ! Test 3: 2D CHARACTER(5) array matrix(1, 1) = 'R1C1 ' matrix(2, 1) = 'R2C1 ' matrix(1, 2) = 'R1C2 ' matrix(2, 2) = 'R2C2 ' matrix(1, 3) = 'R1C3 ' matrix(2, 3) = 'R2C3 ' call sub_char_2d(matrix) print *, "PASS" end program subroutine sub_char_1d_single(arr) implicit none character(*) :: arr(*) logical :: lsame external lsame if (.not. lsame(arr(1), 'A')) then error stop "Test 1 failed: arr(1) is not A" end if end subroutine subroutine sub_char_1d_multi(arr) implicit none character(*) :: arr(*) if (arr(1)(1:5) /= 'First') then error stop "Test 2 failed: arr(1) is not First" end if if (arr(2)(1:6) /= 'Second') then error stop "Test 2 failed: arr(2) is not Second" end if if (arr(3)(1:5) /= 'Third') then error stop "Test 2 failed: arr(3) is not Third" end if end subroutine subroutine sub_char_2d(arr) implicit none character(*) :: arr(2, *) ! Check column-major order (Fortran) if (arr(1, 1) /= 'R1C1 ') then error stop "Test 3 failed: arr(1,1) is not R1C1" end if if (arr(2, 1) /= 'R2C1 ') then error stop "Test 3 failed: arr(2,1) is not R2C1" end if if (arr(1, 2) /= 'R1C2 ') then error stop "Test 3 failed: arr(1,2) is not R1C2" end if if (arr(2, 2) /= 'R2C2 ') then error stop "Test 3 failed: arr(2,2) is not R2C2" end if if (arr(1, 3) /= 'R1C3 ') then error stop "Test 3 failed: arr(1,3) is not R1C3" end if if (arr(2, 3) /= 'R2C3 ') then error stop "Test 3 failed: arr(2,3) is not R2C3" end if end subroutine logical function lsame(ca, cb) implicit none character(1), intent(in) :: ca, cb lsame = ca == cb end function lfortran-lfortran-2f73434/integration_tests/intrinsics_45.f900000664000175000017500000000053015141516316024413 0ustar alastairalastairprogram intrinsics_45 use iso_fortran_env, only : real_kinds, integer_kinds, character_kinds, logical_kinds use iso_fortran_env, only : iostat_end print *, size(real_kinds), size(integer_kinds), size(character_kinds), size(logical_kinds) print *, iostat_end if (iostat_end /= -1) error stop ! Does not work yet !print *, real_kinds end program lfortran-lfortran-2f73434/integration_tests/intrinsics_160.f900000664000175000017500000000320515141516316024473 0ustar alastairalastairprogram intrinsics_160 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ior(5, 8) integer, parameter :: i2 = ior(-1, 5) integer, parameter :: i3 = ior(-4_8, 2_8) integer(8), parameter :: i4 = ior(-2_8, 5_8) integer, parameter :: ar1(3) = ior([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ior([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -1) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -1) error stop print*, ior(5, 8) if (ior(5, 8) /= 13) error stop print*, ior(-1, 5) if (ior(-1, 5) /= -1) error stop print*, ior(8, -4) if (ior(8, -4) /= -4) error stop print*, ior(-2, -5) if (ior(-2, -5) /= -1) error stop print*, ior(a1, a2) if (ior(a1, a2) /= 13) error stop print*, ior(a3, a4) if (ior(a3, a4) /= -1) error stop print*, ior(a2, a5) if (ior(a2, a5) /= -2) error stop print*, ior(a5, a6) if (ior(a5, a6) /= -1) error stop print *, ar1 if (any(ar1 /= [13, 13, 11])) error stop print *, ar2 if (any(ar2 /= [-1, -5, -1])) error stop print *, ior(arr1, arr3) if (any(ior(arr1, arr3) /= [13, 13, 11])) error stop print *, ior(arr2, arr2) if (any(ior(arr2, arr2) /= [-1, -5, -10])) error stop res = ior(arr1, arr3) print *, res if (any(res /= [13, 13, 11])) error stop end program lfortran-lfortran-2f73434/integration_tests/template_nested.f900000664000175000017500000000243715141516316025103 0ustar alastairalastairmodule template_nested_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = F(x, y) end function function call_add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z z = add_generic(x, y) end function end template contains real function func_arg_real(x, y) result(z) real, intent(in) :: x, y z = x + y end function subroutine test_template() instantiate add_t(real, func_arg_real), only: add_real => call_add_generic real :: x, y integer :: a, b x = 5.1 y = 7.2 print*, "The result is ", add_real(x, y) if (abs(add_real(x, y) - 12.3) > 1e-5) error stop end subroutine end module program template_nested use template_nested_m implicit none call test_template() end program template_nested lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_05.f900000664000175000017500000000077515141516316026606 0ustar alastairalastairsubroutine qrfac() implicit none real:: a(5, 5) a = 12.9 print *, enorm(a(1, 1)) if ( abs(enorm(a(1,1)) - 832.049927 ) > 1e-8) error stop contains pure real function enorm(x) implicit none real, intent(in) :: x(5) integer :: i enorm = 0.0 do i = 1, 5 enorm = enorm + x(i)**2 end do end function enorm end subroutine qrfac program legacy_array_sections_05 implicit none call qrfac() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_16.f900000664000175000017500000000312215141516316024411 0ustar alastairalastairprogram intrinsics_16 use iso_fortran_env, only: sp=>real32, dp=>real64 real(sp) :: r32 real(dp) :: r64 complex(sp) :: c32 complex(dp) :: c64 real(sp), parameter :: x1 = aimag((5._sp, 7._sp)) real(dp), parameter :: x2 = aimag((8.2_dp, 7.12_dp)) real(sp), parameter :: ar1(3) = aimag([(5._sp, 7._sp), (8.2_sp, 7.12_sp), (1.2_sp, 3.4_sp)]) real(dp), parameter :: ar2(3) = aimag([(5._dp, 7._dp), (8.2_dp, 7.12_dp), (1.2_dp, 3.4_dp)]) complex(sp) :: arr1(3) = [(5._sp, 7._sp), (8.2_sp, 7.12_sp), (1.2_sp, 3.4_sp)] complex(dp) :: arr2(3) = [(5._dp, 7._dp), (8.2_dp, 7.12_dp), (1.2_dp, 3.4_dp)] c32 = (5._sp, 7._sp); c64 = (5._dp, 7._dp) print *, kind(aimag(arr2)) if (kind(aimag(arr2)) /= 8) error stop print *, x1 if (abs(x1 - 7.0_sp) > 1e-5) error stop print *, x2 if (abs(x2 - 7.12000000000000011e+00_dp) > 1e-10) error stop print *, ar1 if (any(ar1 - [7.0_sp, 7.11999989e+00_sp, 3.40000010e+00_sp] > 1e-6)) error stop print *, ar2 if (any(ar2 - [7.00000000000000000e+00_dp, 7.12000000000000011e+00_dp, 3.39999999999999991e+00_dp] > 1e-10)) error stop r32 = aimag(c32) print *, r32 if (abs(r32 - 7) > 1e-5) error stop r64 = aimag(c64) print *, r64 if (abs(r64-7) > 1e-10) error stop r32 = imag(c32) print *, r32 if (abs(r32-7) > 1e-5) error stop r64 = dimag(c64) print *, r64 if (abs(r64-7) > 1e-10) error stop print *, aimag(arr1) if (any(aimag(arr1) - [7.0_sp, 7.11999989e+00_sp, 3.40000010e+00_sp] > 1e-6)) error stop print *, aimag(arr2) ! Does not work yet #4542 if (any(aimag(arr2) - [7.00000000000000000e+00_dp, 7.12000000000000011e+00_dp, 3.39999999999999991e+00_dp] > 1e-10)) error stop end program lfortran-lfortran-2f73434/integration_tests/realloc_lhs_16.f900000664000175000017500000000133615141516316024520 0ustar alastairalastair! Test automatic reallocation with -fdefault-integer-8 ! This triggers the bug where hardcoded i32 constants are multiplied with i64 values program realloc_lhs_16 implicit none real, allocatable :: a(:), b(:), c(:) integer :: i ! Allocate source arrays allocate(a(10), b(10)) do i = 1, 10 a(i) = real(i) b(i) = real(i * 2) end do ! c is NOT allocated - triggers automatic reallocation ! This should compute shape and allocate c to match a + b c = a + b ! Verify result if (size(c) /= 10) error stop if (abs(c(1) - 3.0) > 0.001) error stop if (abs(c(5) - 15.0) > 0.001) error stop if (abs(c(10) - 30.0) > 0.001) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_23.f900000664000175000017500000000045415141516316024414 0ustar alastairalastairprogram intrinsics_23 implicit none integer(kind=4), parameter :: i32 = huge(0) integer(kind=8), parameter :: i64 = huge(0_8) real(kind=4), parameter :: y = huge(0.0) real(kind=8), parameter :: z = huge(0.0d0) print *, i32, i64, y, z print *, huge(0), huge(0_8), huge(0.0), huge(0.0d0) end program lfortran-lfortran-2f73434/integration_tests/goto_gototarget_return_01.f900000664000175000017500000000055515141516316027033 0ustar alastairalastairsubroutine add_or_sub(select, a, b) integer :: select real :: a, b if (select == 1) goto 1 if (select == 2) goto 2 1 continue return 2 continue return end subroutine program goto_gototarget_return_01 real :: a, b integer :: select a = 1.0 b = 2.0 select = 1 call add_or_sub(select, a, b) print *, a select = 2 call add_or_sub(select, a, b) print *, a end program lfortran-lfortran-2f73434/integration_tests/arrays_op_21.f900000664000175000017500000000075015141516316024223 0ustar alastairalastairprogram arrays_op_20 implicit none real, allocatable :: array(:, :), arrayoutput(:, :) integer :: i, j allocate(array(2:5, 5:10)) allocate(arrayoutput(2:5, 5:10)) array = 3.0 arrayoutput = f(5, array) print *, size(arrayoutput) print *, arrayoutput if( size(arrayoutput) /= 24 ) error stop if( any(arrayoutput /= 3.0) ) error stop contains function f(m, input) result(output) integer :: m real :: input(2:m, m:2*m) real :: output(2:m, m:2*m) output = input end function end program lfortran-lfortran-2f73434/integration_tests/formatted_read_input_01.txt0000664000175000017500000000004015141516316026632 0ustar alastairalastairhello world shorty longerthanvarlfortran-lfortran-2f73434/integration_tests/string_62b.f900000664000175000017500000000040315141516316023674 0ustar alastairalastairmodule string_62_mod character(3) :: str = "Hi!" contains subroutine ff print *,"Side 2 : ", str if(str /= "Bye") error stop str = "123" print *, ">> Side 2 changed variable value to:", str end subroutine end module lfortran-lfortran-2f73434/integration_tests/issue_8324.f900000664000175000017500000000030515141516316023526 0ustar alastairalastairprogram arraysection implicit none integer :: ilist(6,6) ilist(1,1:3) = [1,2,4] print "(3(1X,I0))", ilist(1,1:3) if (any(ilist(1,1:3) /= [1, 2, 4])) error stop end program arraysectionlfortran-lfortran-2f73434/integration_tests/print_04.f900000664000175000017500000000051215141516316023355 0ustar alastairalastairprogram print_04 implicit none integer :: x character(len=5) :: f = "(5i3)" x = (2+3)*5 print "(5i3)", x, 1, 3, x, (2+3)*5+x write(*,"(5i3)") x, 1, 3, x, (2+3)*5+x print f, x, 1, 3, x, (2+3)*5+x write(*,f) x, 1, 3, x, (2+3)*5+x print 1000, x, 1, 3, x, (2+3)*5+x write(*,1000) x, 1, 3, x, (2+3)*5+x 1000 format(5i3) end program lfortran-lfortran-2f73434/integration_tests/read_03.f900000664000175000017500000000045315141516316023137 0ustar alastairalastairprogram read_03 integer(8) :: blocks(2) integer :: unit open(newunit=unit, file="read_03_data.txt") read(unit, *) blocks if (blocks(1) /= 123456789) error stop if (blocks(2) /= 987654321) error stop close(unit) print *, "Read text data:", blocks end program read_03lfortran-lfortran-2f73434/integration_tests/derived_types_05.f900000664000175000017500000000372015141516316025074 0ustar alastairalastairmodule derived_types_05_stdlib_string_type implicit none type :: string_type character(len=:), allocatable :: raw end type string_type interface string_type pure elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string pure elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 pure elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 pure elemental module function new_string_from_logical_lk(val) result(new) logical, intent(in) :: val type(string_type) :: new end function new_string_from_logical_lk end interface string_type end module submodule(derived_types_05_stdlib_string_type) stdlib_string_type_constructor contains elemental module function new_string(string) result(new) character(len=*), intent(in), optional :: string type(string_type) :: new end function new_string elemental module function new_string_from_integer_int32(val) result(new) integer(4), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int32 elemental module function new_string_from_integer_int64(val) result(new) integer(8), intent(in) :: val type(string_type) :: new end function new_string_from_integer_int64 elemental module function new_string_from_logical_lk(val) result(new) logical, intent(in) :: val type(string_type) :: new end function new_string_from_logical_lk end submodule stdlib_string_type_constructor program derived_type_05 end program lfortran-lfortran-2f73434/integration_tests/modules_35.f900000664000175000017500000000147115141516316023702 0ustar alastairalastairmodule M_CLI2_21 contains subroutine get_args_fixed_length_a_array(strings) character(len=*), allocatable :: strings(:) character(len=:), allocatable :: strings_a(:) integer :: place ! TODO: AST to ASR doesn't respect character(5) ! which it should. Fix needed here. allocate(character(5) :: strings_a(2)) if(place > 0) then if (len(strings_a) <= len(strings))then strings = strings_a else strings = [character(len=len(strings)) ::] end if end if if(place > 0) then strings = [character(len=len(strings)) ::] end if end subroutine get_args_fixed_length_a_array end module M_CLI2_21 program modules_35 use M_CLI2_21 character(len=5), allocatable :: string(:) allocate(string(2)) print *, "executing modules_35" call get_args_fixed_length_a_array(string) end program lfortran-lfortran-2f73434/integration_tests/array_04_all.f900000664000175000017500000000056315141516316024175 0ustar alastairalastairprogram array_04_all implicit none integer :: i, j logical l1(4) logical, dimension(2, 3) :: l2 l1 = [.true., .true., .true., .true.] if (.not. all(l1)) error stop print *, l1 l2 = reshape([.true., .true., .true., .true., .false., .true.], [2, 3]) if (.not. all(l2(:, 1))) error stop do i = 1, 2 do j = 1, 3 print *, l2(i, j) end do end do end program lfortran-lfortran-2f73434/integration_tests/arrays_08_size.f900000664000175000017500000000130715141516316024563 0ustar alastairalastairprogram arrays_08_size integer :: y = 2 call temp(y) contains subroutine temp(x) integer, intent(inout) :: x logical :: keep(x) integer :: result(x) keep = [.true., .true.] x = 1 result = trueloc(keep) print * , result if (any(result /= [1, 2])) error stop end subroutine function trueloc(x) result(loc) logical, intent(in) :: x(:) integer(4), allocatable :: loc(:) integer :: i, j allocate(loc(count(x))) j = 1 do i = 1, size(x) if( x(i) ) then loc(j) = i j = j + 1 end if end do end function trueloc end program lfortran-lfortran-2f73434/integration_tests/arrays_op_27.f900000664000175000017500000000045115141516316024227 0ustar alastairalastairprogram arrays_op_27 implicit none integer :: R(4), V(4), U(4) R = 23 V = 9 U = 1 R(2:4) = V(2:4) * 1 * U(2:4) print *, R if (R(1) /= 23) error stop if (R(2) /= 9) error stop if (R(3) /= 9) error stop if (R(4) /= 9) error stop end program arrays_op_27 lfortran-lfortran-2f73434/integration_tests/entry_08.f900000664000175000017500000000036715141516316023376 0ustar alastairalastairsubroutine dzror(status) integer status entry dstzr() return status = 8 end subroutine program entry_08 integer :: status status = 1 call dzror(status) if (status /= 1) error stop print *, "status = ", status end program lfortran-lfortran-2f73434/integration_tests/integer_bin_op_dim_external_module.f900000664000175000017500000000274215141516316031010 0ustar alastairalastairmodule xx integer :: nx = 4 integer :: ny = 1 integer :: nz = 1 end module xx subroutine a(cs) use xx integer, dimension(nx * ny - 1), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3])) error stop end subroutine subroutine b(cs) use xx integer, dimension(nx * ny), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4])) error stop end subroutine subroutine c(cs) use xx integer, dimension(2 + 3), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine subroutine d(cs) use xx integer, dimension(nx - 1), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3])) error stop end subroutine subroutine e(cs) use xx integer, dimension(1 + nx * ny), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine subroutine f(cs) use xx integer, dimension(nx * ny * nz), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4])) error stop end subroutine subroutine g(cs) use xx integer, dimension(1 + 2 + 3), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5, 6])) error stop end subroutine subroutine h(cs) use xx integer, dimension(nx * ny + ny * nz), intent(in) :: cs print *, cs if (all(cs /= [1, 2, 3, 4, 5])) error stop end subroutine program main integer, dimension(8) :: cs cs = [1, 2, 3, 4, 5, 6, 7, 8] call a(cs) call b(cs) call c(cs) call d(cs) call f(cs) call g(cs) call h(cs) end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_10.f900000664000175000017500000000241015141516316026044 0ustar alastairalastairmodule pass_array_by_data_10_pintrf_module public :: OBJCON contains subroutine OBJCON(x, out) implicit none real, intent(in) :: x(:) real, intent(out) :: out end subroutine OBJCON end module pass_array_by_data_10_pintrf_module subroutine cobyla(x, out) implicit none real, intent(inout) :: x(:) real, intent(out) :: out call evaluate(calcfc_internal, out) contains subroutine calcfc_internal(x_internal, out) implicit none real, intent(in) :: x_internal(:) real, intent(out) :: out out = sum(x_internal**2) end subroutine calcfc_internal subroutine evaluate(calcfc, out) use, non_intrinsic :: pass_array_by_data_10_pintrf_module, only : OBJCON implicit none procedure(OBJCON) :: calcfc real, intent(out) :: out call calcfc(x, out) end subroutine evaluate end subroutine program pass_array_by_data_10 implicit none interface subroutine cobyla(x, out) real, intent(inout) :: x(:) real, intent(out) :: out end subroutine cobyla end interface real :: x(2) = [1.0, 2.0] real :: out call cobyla(x, out) print *, out if ( abs(out - 5.0 ) > 1e-8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_10.f900000664000175000017500000000041315141516316026050 0ustar alastairalastairmodule implicit_interface_10_module implicit none interface function fun(i) integer fun end function fun end interface end module implicit_interface_10_module program main use implicit_interface_10_module end program main lfortran-lfortran-2f73434/integration_tests/array_slice_04.f900000664000175000017500000000215715141516316024525 0ustar alastairalastairprogram array_slice_04 implicit none integer :: i, j integer :: array1(10) integer :: array2(10, 10) real, allocatable :: y(:) allocate(y(13)) y = [(real(i - 1, 4)**2, i = 1, 13)] print *, y(2:12:2) if( any(y(2:12:2) /= [1.0, 9.0, 25.0, 49.0, 81.0, 121.0]) ) error stop array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print *, array1(1:10) if( any(array1(1:10) /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop print *, array1(10:1:-1) if( any(array1(10:1:-1) /= [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) ) error stop array1 = [(i, i = 1, 10)] array1(:) = 0 array1(1:5) = 1 array1(6:) = 1 do i = 1, 10 do j = 1, 10 array2(i, j) = i * j end do end do print *, array1(1) if( array1(1) /= 1 ) error stop print *, array1(1:10:2) if( any(array1(1:10:2) /= [1, 1, 1, 1, 1]) ) error stop print *, array2(:, 3) if( any(array2(:, 3) /= [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]) ) error stop print *, array1(10:1:-1) if( any(array1(10:1:-1) /= [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) ) error stop end program array_slice_04 lfortran-lfortran-2f73434/integration_tests/character_16.f900000664000175000017500000000073715141516316024171 0ustar alastairalastair! Test: CHARACTER(*) assumed-size array via implicit interface ! MRE from issue #9381 - direct call from program to subroutine program character_16 implicit none character(1) :: adumma(1) adumma(1) = ' ' call callee(adumma) end program character_16 subroutine callee(ei) implicit none character(1) :: ei(*) if (ei(1) == ' ') then print *, 'PASS' else error stop 'FAIL: expected space character' end if end subroutine callee lfortran-lfortran-2f73434/integration_tests/intrinsics_04.f900000664000175000017500000000115115141516316024406 0ustar alastairalastairprogram intrinsics_04 use iso_fortran_env, only: dp=>real64, sp=>real32 real(dp) :: x complex(dp) :: z x = 1.5_dp x = tan(x) print *, x if (abs(x - 14.101419947171721_dp) > 1e-10_dp) error stop if (abs(tan(1.5_sp) - 14.1014204_sp) > 1e-6) error stop if (abs(tan(tan(1.5_sp) + tan(x+tan(x))) - 2.254825) > 1e-5) error stop z = (1.5_dp, 3.5_dp) z = tan(z) print *, z if (abs(real(z,dp) - 2.57834890405532317E-004_dp) > 1e-10_dp) error stop if (abs(real(tan((1.5_sp, 3.5_sp)), sp) - 2.57834879E-004_sp) > 1e-10_dp) error stop if (abs(aimag(z) - 1.0018071108086137_dp) > 1e-10_dp) error stop end program intrinsics_04 lfortran-lfortran-2f73434/integration_tests/doloop_04.f900000664000175000017500000000110415141516316023513 0ustar alastairalastairprogram doloop_04 implicit none integer :: i, j, k j = 0 k = 2 do i = 1, 10, k j = j + i end do if (j /= 25) error stop print *, j j = 0 k = -2 do i = 10, 1, k j = j + i end do if (j /= 30) error stop print *, j j = 0 a: do i = 1, 10 j = j + i if (i == 2) exit a end do a if (j /= 3) error stop j = 0 b: do i = 1, 10, 2 j = j + i if (i == 3) exit b end do b if (j /= 4) error stop j = 0 i = 1 c: do j = j + i if (i == 2) exit c i = i + 1 end do c if (j /= 3) error stop !test-issue 746 k = 2 do i = 1, 10, k 100 continue end do end lfortran-lfortran-2f73434/integration_tests/nested_external_dedup_01.f900000664000175000017500000000063715141516316026573 0ustar alastairalastairprogram nested_external_dedup_01 implicit none call outer() contains subroutine outer() integer :: a a = 0 call inner1() call inner2() contains subroutine inner1() a = a + 1 end subroutine inner1 subroutine inner2() a = a + 2 end subroutine inner2 end subroutine outer end program nested_external_dedup_01 lfortran-lfortran-2f73434/integration_tests/procedure_13.f900000664000175000017500000000217515141516316024220 0ustar alastairalastairmodule pintrf_mod_procedure_13 implicit none private public :: OBJCON interface subroutine OBJCON(x) implicit none real, intent(in) :: x end subroutine OBJCON end interface end module pintrf_mod_procedure_13 module cobylb_mod_procedure_13 contains subroutine cobylb(calcfc) use, non_intrinsic :: pintrf_mod_procedure_13, only : OBJCON implicit none procedure(OBJCON) :: calcfc call evaluate(calcfc_internal) contains subroutine calcfc_internal(x_internal) implicit none real, intent(in) :: x_internal call calcfc(x_internal) end subroutine calcfc_internal subroutine evaluate(calcfc) use, non_intrinsic :: pintrf_mod_procedure_13, only : OBJCON implicit none procedure(OBJCON) :: calcfc call calcfc(12.91) end subroutine evaluate end subroutine cobylb end module program procedure_13 use cobylb_mod_procedure_13 call cobylb(calcfc) contains subroutine calcfc(x) implicit none real, intent(in) :: x print *, "inside calcfc: ", x if ( abs(x - 12.91) > 1e-8 ) error stop end subroutine calcfc end program lfortran-lfortran-2f73434/integration_tests/tuple_test_03_.f900000664000175000017500000000113015141516316024544 0ustar alastairalastairmodule tuple_test_03_mod implicit none real :: eps = 1e-12 contains subroutine tests() _lfortran_tuple(integer, real, character(len=:)) :: t1 t1 = _lfortran_tuple_constant(1, 2.0, "3") integer :: x real :: y character(len=:), allocatable :: s x = _lfortran_get_item(t1, -3) y = _lfortran_get_item(t1, -2) s = _lfortran_get_item(t1, -1) if (x /= 1) error stop if (abs(y - 2.0) > eps) error stop if (s /= "3") error stop end subroutine end module program run_tuples use tuple_test_03_mod call tests() end program lfortran-lfortran-2f73434/integration_tests/derived_types_09.f900000664000175000017500000000010415141516316025071 0ustar alastairalastairprogram derived_types_09 use derived_types_09b, only: f end program lfortran-lfortran-2f73434/integration_tests/intrinsics_212.f900000664000175000017500000000652515141516316024501 0ustar alastairalastairprogram intrinsics_212 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: x = 1 complex(4) :: z4 complex(8) :: z8 print*, cabs((1.0, 2.0)) if (abs(cabs((1.0, 2.0)) - 2.23606798) > 10e-5) error stop print*, zabs((1.0_8, 2.0_8)) if (abs(zabs((1.0_8, 2.0_8)) - 2.23606798_8) > 10e-5) error stop print*, cdabs((1.0_8, 2.0_8)) if (abs(cdabs((1.0_8, 2.0_8)) - 2.23606798_8) > 10e-5) error stop print*, csin((1.0, 2.0)) if (abs(csin((1.0, 2.0)) - (3.16577840,1.95960104)) > 10e-5) error stop print*, zsin((1.0_8, 2.0_8)) if (abs(zsin((1.0_8, 2.0_8)) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, cdsin((1.0_8, 2.0_8)) if (abs(cdsin((1.0_8, 2.0_8)) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, ccos((1.0, 2.0)) if (abs(ccos((1.0, 2.0)) - (2.03272295,-3.05189776)) > 10e-5) error stop print*, zcos((1.0_8, 2.0_8)) if (abs(zcos((1.0_8, 2.0_8)) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, cdcos((1.0_8, 2.0_8)) if (abs(cdcos((1.0_8, 2.0_8)) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, csqrt((1.0, 2.0)) if (abs(csqrt((1.0, 2.0)) - (1.27201965,0.78615138)) > 10e-5) error stop print*, zsqrt((1.0_8, 2.0_8)) if (abs(zsqrt((1.0_8, 2.0_8)) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cdsqrt((1.0_8, 2.0_8)) if (abs(cdsqrt((1.0_8, 2.0_8)) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cexp((1.0, 2.0)) if (abs(cexp((1.0, 2.0)) - (-1.13120438,2.47172667)) > 10e-5) error stop print*, zexp((1.0_8, 2.0_8)) if (abs(zexp((1.0_8, 2.0_8)) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, cdexp((1.0_8, 2.0_8)) if (abs(cdexp((1.0_8, 2.0_8)) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, xor(1, 1) if (xor(1, 1) /= 0) error stop z4 = (1.0, 2.0) z8 = (1.0_dp, 2.0_dp) print*, cabs(z4) if (abs(cabs(z4) - 2.23606798) > 10e-5) error stop print*, zabs(z8) if (abs(zabs(z8) - 2.23606798_8) > 10e-5) error stop print*, cdabs(z8) if (abs(cdabs(z8) - 2.23606798_8) > 10e-5) error stop print*, csin(z4) if (abs(csin(z4) - (3.16577840,1.95960104)) > 10e-5) error stop print*, zsin(z8) if (abs(zsin(z8) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, cdsin(z8) if (abs(cdsin(z8) - (3.16577840_8,1.95960104_8)) > 10e-5) error stop print*, ccos(z4) if (abs(ccos(z4) - (2.03272295,-3.05189776)) > 10e-5) error stop print*, zcos(z8) if (abs(zcos(z8) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, cdcos(z8) if (abs(cdcos(z8) - (2.03272295_8,-3.05189776_8)) > 10e-5) error stop print*, csqrt(z4) if (abs(csqrt(z4) - (1.27201965,0.78615138)) > 10e-5) error stop print*, zsqrt(z8) if (abs(zsqrt(z8) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cdsqrt(z8) if (abs(cdsqrt(z8) - (1.27201965_8,0.78615138_8)) > 10e-5) error stop print*, cexp(z4) if (abs(cexp(z4) - (-1.13120438,2.47172667)) > 10e-5) error stop print*, zexp(z8) if (abs(zexp(z8) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, cdexp(z8) if (abs(cdexp(z8) - (-1.13120438_8,2.47172667_8)) > 10e-5) error stop print*, xor(x, x) if (xor(x, x) /= 0) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_08_b.f900000664000175000017500000000020115141516316024171 0ustar alastairalastairmodule modules_08_b implicit none private public b contains integer function b() b = 5 + kind(.true.) end function end module lfortran-lfortran-2f73434/integration_tests/intrinsics_199.f900000664000175000017500000000026415141516316024511 0ustar alastairalastairprogram intrinsics_199 integer, parameter :: n = 10 logical :: x(n) integer :: res x = .false. x(1:5) = .true. res = count(x, 1) print *, res if (res /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_32.f900000664000175000017500000000063015141516316023521 0ustar alastairalastairprogram openmp_32 use omp_lib implicit none real :: phi integer :: j, i phi = 10124.142 call omp_set_num_threads(4) do i = 1, 10 !$omp parallel do private(j) reduction(+:phi) do j = 1, 100 phi = phi + 1.0 end do !$omp end parallel do end do print *, phi if (abs(phi - 11124.1416) > 1e-8) error stop end program openmp_32 lfortran-lfortran-2f73434/integration_tests/string_82.f900000664000175000017500000000053015141516316023535 0ustar alastairalastairprogram string_82 class(*), allocatable :: x allocate(x, source='abc') select type (x) type is (character(len=*)) print *, "String type" ! print *, x ! <<<<<<<<<<<<<<<<<< unlimited polymorphic types not supported yet class default print *, "Unknown type" error stop end select end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_07c.c0000664000175000017500000000024215141516316026415 0ustar alastairalastair#include #include #define MPI_STATUS_SIZE 5 void mpi_init_wrapper(int *ierr) { int argc = 0; char **argv = NULL; *ierr = 5; } lfortran-lfortran-2f73434/integration_tests/cpp_pre_04.f900000664000175000017500000000051515141516316023654 0ustar alastairalastairprogram cpp_pre_03 #ifdef __ELF__ print *,"ELF" #endif #ifdef __x86_64__ print *,"x86_64" #endif #ifdef __i386__ print *,"i386" #endif #ifdef __SIZEOF_POINTER__ print *,"SIZEOF_POINTER", __SIZEOF_POINTER__ #endif #ifdef __SIZEOF_SIZE_T__ print *,"SIZEOF_SIZE_T",__SIZEOF_SIZE_T__ #endif print *, "Ok" end program lfortran-lfortran-2f73434/integration_tests/bindc_07.c0000664000175000017500000000265415141516316023140 0ustar alastairalastair#include #include #include // Dummy getcwd function that mimics the real getcwd behavior char* getcwd_dummy(char* buf, size_t size) { const char* dummy_path = "/home/user/test/directory"; size_t path_len = strlen(dummy_path); if (buf == NULL) { printf("ERROR: Received NULL buffer pointer!\n"); return NULL; } if (size <= path_len) { printf("ERROR: Buffer too small! Need %zu, got %zu\n", path_len + 1, size); return NULL; } // Debug: Print what we received printf("C function received:\n"); printf(" - Buffer pointer: %p\n", (void*)buf); printf(" - Buffer size: %zu\n", size); // Copy the dummy path to the buffer strcpy(buf, dummy_path); printf(" - Copied path: '%s'\n", buf); printf(" - Path length: %zu\n", strlen(buf)); return buf; // Return the buffer pointer on success } char* test_char_array(char* buffer, int len) { printf("C test_char_array received:\n"); printf(" - Buffer pointer: %p\n", (void*)buffer); printf(" - Length parameter: %d\n", len); if (buffer == NULL) { printf(" - ERROR: NULL buffer!\n"); return NULL; } // Write a test string const char* test_str = "Hello from C!"; strncpy(buffer, test_str, len - 1); buffer[len - 1] = '\0'; printf(" - Wrote to buffer: '%s'\n", buffer); return buffer; } lfortran-lfortran-2f73434/integration_tests/read_09.f900000664000175000017500000000107115141516316023142 0ustar alastairalastairprogram read_09 ! Test variable-bounds implied-do in READ implicit none integer :: vals(5), i, n open(10, file='read_09_input.txt', status='replace') write(10, '(5I6)') 10, 20, 30, 40, 50 close(10) open(10, file='read_09_input.txt', status='old') n = 5 read(10, *) (vals(i), i=1, n) close(10, status='delete') if (vals(1) /= 10) error stop if (vals(2) /= 20) error stop if (vals(3) /= 30) error stop if (vals(4) /= 40) error stop if (vals(5) /= 50) error stop print *, "All tests passed!" end program lfortran-lfortran-2f73434/integration_tests/complex_30.f900000664000175000017500000000312115141516316023666 0ustar alastairalastairprogram complex_ops_01 ! Test that complex arithmetic works correctly ! This also serves to verify inline complex ops when implemented implicit none complex :: a, b, c, d real :: eps eps = 1.0e-6 ! Test complex multiplication: (1+2i) * (3+4i) = (1*3-2*4) + (1*4+2*3)i = -5 + 10i a = (1.0, 2.0) b = (3.0, 4.0) c = a * b if (abs(real(c) - (-5.0)) > eps) error stop "mul real failed" if (abs(aimag(c) - 10.0) > eps) error stop "mul imag failed" ! Test complex addition: (1+2i) + (3+4i) = 4 + 6i c = a + b if (abs(real(c) - 4.0) > eps) error stop "add real failed" if (abs(aimag(c) - 6.0) > eps) error stop "add imag failed" ! Test complex subtraction: (1+2i) - (3+4i) = -2 - 2i c = a - b if (abs(real(c) - (-2.0)) > eps) error stop "sub real failed" if (abs(aimag(c) - (-2.0)) > eps) error stop "sub imag failed" ! Test complex division: (1+2i) / (3+4i) = (1*3+2*4)/(3^2+4^2) + (2*3-1*4)/(3^2+4^2)i ! = 11/25 + 2/25 i = 0.44 + 0.08i c = a / b if (abs(real(c) - 0.44) > eps) error stop "div real failed" if (abs(aimag(c) - 0.08) > eps) error stop "div imag failed" ! Test compound expression d = (a * b + a) / b - a ! = ((-5+10i) + (1+2i)) / (3+4i) - (1+2i) ! = (-4+12i) / (3+4i) - (1+2i) ! = ((-4*3+12*4)/25 + (12*3-(-4)*4)/25 i) - (1+2i) ! = (36/25 + 52/25 i) - (1+2i) ! = (1.44 - 1) + (2.08 - 2)i = 0.44 + 0.08i if (abs(real(d) - 0.44) > eps) error stop "compound real failed" if (abs(aimag(d) - 0.08) > eps) error stop "compound imag failed" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/expr_11.f900000664000175000017500000000020015141516316023167 0ustar alastairalastairprogram expr_11 ! Test parantheses in expressions with type casts (#1043) real*8 x x=(2.0*x+1.0)/(x*(x+1)) end program lfortran-lfortran-2f73434/integration_tests/test_call_arg_structinstance_member.f900000664000175000017500000000122115141516316031177 0ustar alastairalastairmodule module_test_call_arg_structinstance_member implicit none type :: data_type real(4) :: arr(4) end type data_type contains subroutine sub(arr) real(4), intent(inout) :: arr(:) integer :: i do i = 1, 4 arr(i) = real(i, kind=4) + 10.0_4 end do end subroutine sub end module module_test_call_arg_structinstance_member program test_call_arg_structinstance_member use module_test_call_arg_structinstance_member implicit none type(data_type) :: d d%arr = 0.0_4 call sub(d%arr) print *, d%arr if (any(d%arr /= [11., 12., 13., 14.])) error stop end program lfortran-lfortran-2f73434/integration_tests/internal_subr_host_vars_01.f900000664000175000017500000000104715141516316027161 0ustar alastairalastair! Verify host association for internal subroutines and enforce via error stop subroutine add(x, y) implicit none real, intent(in) :: x, y real :: s s = x + y if (s /= 3.0) error stop contains subroutine add2() implicit none real :: t ! add2 should be able to see x, y from the host t = x + y + 2.0 if (t /= 5.0) error stop end subroutine add2 end subroutine add program internal_subr_host_vars_01 implicit none call add(1.0, 2.0) end program internal_subr_host_vars_01 lfortran-lfortran-2f73434/integration_tests/doloop_12.f900000664000175000017500000000066315141516316023523 0ustar alastairalastairmodule gg contains function func_arr3(inp_ref) result(ret_arr) integer, intent(in) :: inp_ref integer,allocatable :: ret_arr(:) allocate(ret_arr(1)) ret_arr = [inp_ref] print *, "worked", inp_ref end function end module program p use gg implicit none integer, allocatable :: inp(:) integer :: i =77 do i= 1, 3 inp = func_arr3(i) end do end program lfortran-lfortran-2f73434/integration_tests/intrinsics_333.f900000664000175000017500000000157115141516316024501 0ustar alastairalastairprogram intrinsics_333 implicit none real(4) :: rhobeg = 10000 real(4), allocatable :: x0(:), xl(:), xu(:) logical, allocatable :: lbx(:) logical, allocatable :: ubx(:) real(4), parameter :: EPS = -10000 allocate(x0(10), xl(10), xu(10)) allocate(lbx(size(x0)), ubx(size(x0))) x0(1:10:2) = 11 x0(2:10:2) = 18 lbx(1:10:2) = .true. lbx(2:10:2) = .false. ubx(2:10:2) = .false. ubx(1:10:2) = .true. xl(1:10:2) = 1 xl(2:10:2) = 2 xu(1:10:2) = 7 xu(2:10:2) = 10 rhobeg = max(EPS, minval([rhobeg, x0(falseloc(lbx)) - xl(falseloc(lbx)), xu(falseloc(ubx)) - x0(falseloc(ubx))])) print *, rhobeg if( rhobeg /= -8.0 ) error stop contains function falseloc(x) result(y) logical :: x(:) integer :: i, j integer, allocatable :: y(:) allocate(y(size(x) - count(x))) j = 1 do i = 1, size(x) if( .not. x(i) ) then y(j) = i j = j + 1 end if end do end function end program lfortran-lfortran-2f73434/integration_tests/template_array_01.f900000664000175000017500000000225715141516316025237 0ustar alastairalastairmodule template_array_01_m implicit none private public :: test_template requirement r(t) type, deferred :: t end requirement template array_tmpl(t) require :: r(t) private public :: insert_t contains function insert_t(lst, i) result(r) type(t), intent(in) :: lst(:), i type(t) :: r lst(1) = i r = lst(1) end function function insert_t_n(n, lst, i) result(r) integer, intent(in) :: n type(t), intent(in) :: lst(n), i type(t) :: r lst(1) = i r = lst(1) end function end template contains subroutine test_template() instantiate array_tmpl(integer), only: insert_int => insert_t, insert_int_n => insert_t_n integer :: a(1), i, r a(1) = 0 i = 1 print *, a(1) r = insert_int(a, i) print *, a(1) a(1) = 0 print *, a(1) r = insert_int_n(size(a), a, i) print *, a(1) end subroutine end module program template_array_01 use template_array_01_m implicit none call test_template() end lfortran-lfortran-2f73434/integration_tests/implicit_interface_17.f900000664000175000017500000000036215141516316026062 0ustar alastairalastairprogram implicit_interface_17 implicit none real :: y( 5,5 ) external :: isamax integer :: isamax y = 1.0 y( 4, 1 ) = 19.68 print *, y( isamax(2, y( 1, 1 ), 1 ), 1 ) if ( abs(y(isamax(2, y(1,1), 1), 1 ) - 19.68) > 1e-8 ) error stop end lfortran-lfortran-2f73434/integration_tests/arrays_14.f900000664000175000017500000000044715141516316023532 0ustar alastairalastairprogram array_14 integer :: a = 10 integer :: b(2) b = [14, 12] call foo() if( b(1) /= 243 ) error stop if( b(2) /= 930 ) error stop contains subroutine foo() if( a /= 10 ) error stop if( b(1) /= 14 ) error stop if( b(2) /= 12 ) error stop b(1) = 243 b(2) = 930 end subroutine end program lfortran-lfortran-2f73434/integration_tests/file_44.f900000664000175000017500000000060615141516316023150 0ustar alastairalastairprogram scale_factor2 implicit none character(27) :: f_string = ' 13.1234 13.1234E0 1312.34' real :: a, b, c real :: correct = 13.1234 read (f_string, '(F9.5, 1X, E9.3, 1X, 2PF7.4)') a, b, c print *, 'a, b, c =', a, b, c if (abs (correct - a) > 0.001) error stop if (abs (correct - b) > 0.001) error stop if (abs (correct - c) > 0.001) error stop end program lfortran-lfortran-2f73434/integration_tests/hashmap_struct_01.f900000664000175000017500000000121115141516316025240 0ustar alastairalastairmodule stdlib_hashmaps_hashmap_struct_01 implicit none type :: open_hashmap_type integer(4) :: slots end type open_hashmap_type end module stdlib_hashmaps_hashmap_struct_01 program hashmap_struct_01 use stdlib_hashmaps_hashmap_struct_01 implicit none type(open_hashmap_type) :: map call in_open_map(map) contains subroutine expand_open_slots(map) type(open_hashmap_type), intent(inout) :: map end subroutine expand_open_slots subroutine in_open_map(map) class(open_hashmap_type), intent(inout) :: map call expand_open_slots(map) end subroutine in_open_map end program lfortran-lfortran-2f73434/integration_tests/string_79.f900000664000175000017500000000133515141516316023547 0ustar alastairalastair! Testing declaration in function module string_79_mod contains pure function foo (x) result(res) character(*), intent(in) :: x character(:), allocatable :: res allocate(character(len(x) + len("abc")):: res) res = x // 'abc' end function pure function ff(line,length) result(strout) character(len=*) , intent(in) :: line integer , intent(in) :: length character(len=max(length, len(foo(line)))) :: strout ! The main concern of this test -- Is to handle this declaration correctly end function end module program string_79 use string_79_mod print *, len(ff("HelloWorld", 10)) if(len(ff("HelloWorld", 10)) /= 13) error stop end program lfortran-lfortran-2f73434/integration_tests/file_32.f900000664000175000017500000000413415141516316023145 0ustar alastairalastairprogram file_32 implicit none complex, allocatable :: array(:,:,:,:) integer :: stat, io character(len=200) :: line character(len=20) :: part real :: c1(2), c2(2), c3(2), c4(2) ! Allocate a 4D complex array of shape (2, 2, 1, 1) = 4 elements allocate(array(2,2,1,1)) ! Sample values c1 = [0.0, 0.0] c2 = [2.0, 0.0] c3 = [1.0, 0.0] c4 = [3.0, 0.0] ! Open file open(newunit=io, file="file_32_data.txt", status="replace", action="write", iostat=stat) if (stat /= 0) then print *, "Error opening file for writing" stop 1 end if ! Initialize line line = '' ! Append each point with a space after it write(part, '(f3.1,",",f3.1)') c1(1), c1(2) line = trim(line) // '(' // trim(part) // ') ' print *, "line1 = ", trim(line) write(part, '(f3.1,",",f3.1)') c2(1), c2(2) line = trim(line) // ' ' // '(' // trim(part) // ') ' print *, "line2 = ", trim(line) write(part, '(f3.1,",",f3.1)') c3(1), c3(2) line = trim(line) // ' ' // '(' // trim(part) // ') ' write(part, '(f3.1,",",f3.1)') c4(1), c4(2) line = trim(line) // ' ' // '(' // trim(part) // ')' ! Write final line write(io, '(a)') trim(line) close(io) ! Open text file open(newunit=io, file="file_32_data.txt", status="old", action="read", iostat=stat) if (stat /= 0) then print *, "Error opening file" stop 1 end if ! Directly read entire array in one READ statement read(io, *, iostat=stat) array if (stat /= 0) then print *, "Error reading array" stop 1 end if close(io) ! Print to verify print *, "array(1,1,1,1) = ", abs(array(1,1,1,1)) if ( abs(abs(array(1,1,1,1)) - 0.0) > 1e-6 ) error stop print *, "array(2,1,1,1) = ", abs(array(2,1,1,1)) if ( abs(abs(array(2,1,1,1)) - 2.0) > 1e-6 ) error stop print *, "array(1,2,1,1) = ", abs(array(1,2,1,1)) if ( abs(abs(array(1,2,1,1)) - 1.0) > 1e-6 ) error stop print *, "array(2,2,1,1) = ", abs(array(2,2,1,1)) if ( abs(abs(array(2,2,1,1)) - 3.0) > 1e-6 ) error stop end program lfortran-lfortran-2f73434/integration_tests/logical_arrays_logical_binop_01.f900000664000175000017500000000330215141516316030072 0ustar alastairalastairprogram main implicit none logical, parameter :: x1(2) = [.true., .false.] ! parameter variable != logical constant print *, x1 .neqv. .true. if (all((x1 .neqv. .true.) .neqv. [.false., .true.])) error stop ! logical array constant == logical array constant print *, [.false., .true.] .eqv. [.false., .true.] if (all(([.false., .true.] .eqv. [.false., .true.]) .neqv. [.true., .true.])) error stop ! parameter variable != function returning logical constant print *, x1 .neqv. get_true() if (all((x1 .neqv. get_true()) .neqv. [.false., .true.])) error stop ! logical constant == parameter variable print *, .true. .eqv. x1 if (all((.true. .eqv. x1) .neqv. [.true., .false.])) error stop ! parameter variable and logical constant print *, x1 .and. .false. if (all((x1 .and. .false.) .neqv. [.false., .false.])) error stop ! logical constant or parameter variable print *, .false. .or. x1 if (all((.false. .or. x1) .neqv. [.true., .false.])) error stop ! logical expression or logical constant print *, 1 > 2 .or. x1 if (all((1 > 2 .or. x1) .neqv. [.true., .false.])) error stop ! logical expression or logical constant print *, ((1 + 2) > 2) .or. x1 if (all((((1 + 2) > 2) .or. x1) .neqv. [.true., .true.])) error stop ! logical expression or logical constant print *, ((1 + 2) == 3) .or. x1 if (all((((1 + 2) == 3) .or. x1) .neqv. [.true., .true.])) error stop ! logical expression or logical constant print *, ((1 + 2) == 3) .or. x1 if (all((((1 + 2) == 3) .or. x1) .neqv. [.true., .true.])) error stop contains logical function get_true() result(value) value = .true. end function get_true end program main lfortran-lfortran-2f73434/integration_tests/arrays_101.f900000664000175000017500000000210615141516316023601 0ustar alastairalastairprogram static_large_array implicit none ! Test that large fixed-size arrays use heap allocation instead of stack ! This prevents stack overflow for arrays >= 4096 bytes (4 KB) ! The allocated memory is automatically freed at function exit ! Small array (4 * 100 = 400 bytes < 4096) - should use stack real :: small_arr(100) ! Large array (4 * 2000 = 8000 bytes >= 4096) - should use heap real :: large_arr(2000) integer :: i real :: sum ! Initialize arrays small_arr = 1.0 large_arr = 2.0 ! Simple verification if (small_arr(1) /= 1.0) error stop if (large_arr(1) /= 2.0) error stop ! Test BLOCK in loop - arrays must be freed each iteration ! Without heap allocation, this would cause stack overflow or memory leak sum = 0.0 do i = 1, 1000 block real :: block_arr(500) ! 2000 bytes, but BLOCK always uses heap block_arr = real(i) sum = sum + block_arr(1) end block end do if (abs(sum - 500500.0) > 0.1) error stop print *, "OK" end program lfortran-lfortran-2f73434/integration_tests/entry_06.f900000664000175000017500000000072415141516316023371 0ustar alastairalastairdouble precision function mvndfn( w ) double precision w(*) entry mvndnt() w(1) = 10.9d0 w(2) = 10.9d0 if (abs(w(1) - 10.9d0) > 1e-10) error stop if (abs(w(2) - 10.9d0) > 1e-10) error stop mvndfn = 1.2d0 end program entry_06 interface double precision function mvndfn( w ) double precision w(*) end function end interface double precision w(2) if (abs(mvndfn(w) - 1.2d0) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/doloop_16.f900000664000175000017500000000020315141516316023515 0ustar alastairalastairprogram doloop_16 integer :: i do i = 0, -16 end do print *, i if ( i /= 0 ) error stop end program doloop_16 lfortran-lfortran-2f73434/integration_tests/string_96.f900000664000175000017500000000047715141516316023554 0ustar alastairalastairprogram string_96 character(len=:), allocatable :: long_short(:) integer :: isize isize = 3 allocate(character(len=10) :: long_short(3)) long_short(1) = "first" long_short(2) = "second" long_short(3) = "third" long_short=long_short(:isize-1) print *, long_short end program string_96lfortran-lfortran-2f73434/integration_tests/separate_compilation_25b.f900000664000175000017500000000051515141516316026573 0ustar alastairalastairsubmodule (linalg_separate_compilation_25) linalg_diag_separate_compilation_25 implicit none contains module function diag_real(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i,i) end do end function diag_real end submodulelfortran-lfortran-2f73434/integration_tests/common_14.f900000664000175000017500000000064315141516316023517 0ustar alastairalastairprogram common_14 implicit none real :: x, y common /coords/ x, y x = 5.0 y = 10.0 call show_coords contains subroutine show_coords implicit none real :: x, y common /coords/ x, y print *, "x =", x, ", y =", y if ( abs(x - 5.0) > 1e-8 ) error stop if ( abs(y - 10.0) > 1e-8 ) error stop end subroutine show_coords end program common_14 lfortran-lfortran-2f73434/integration_tests/implicit_typing_03.f900000664000175000017500000000064115141516316025427 0ustar alastairalastairmodule implicit_typing_03_first parameter (x=90) end module implicit_typing_03_first module implicit_typing_03_second use implicit_typing_03_first, only: x contains subroutine print_x print *, x if (abs(x - 90.0) > 1e-8) error stop end subroutine print_x end module implicit_typing_03_second program implicit_typing_03 use implicit_typing_03_second call print_x() end program implicit_typing_03 lfortran-lfortran-2f73434/integration_tests/functions_20.f900000664000175000017500000000110215141516316024223 0ustar alastairalastairpure function diag_rsp_mat(A, k) result(res) real, intent(in) :: A(:,:) integer, intent(in) :: k real :: res(minval(shape(A)) - abs(k)) res = 123.71_4 end function diag_rsp_mat program functions_20 real, dimension(3,3) :: A real :: B(2) integer :: k interface function diag_rsp_mat(A, k) result(res) real, intent(in) :: A(:,:) integer, intent(in) :: k real :: res(minval(shape(A)) - abs(k)) end function diag_rsp_mat end interface k = 1 B = diag_rsp_mat(A, k) print *, B if (any(abs(B - 123.71_4) > 1e-6)) error stop end program functions_20 lfortran-lfortran-2f73434/integration_tests/bindc_04c.c0000664000175000017500000000153115141516316023271 0ustar alastairalastair#include void a_func(void *func(void*)) { float array[5]; for (int i = 0; i < 5; i++) { array[i] = i; } struct thread_data { float* a; int n; } data; data.a = array; // print &array as integer printf("Array address in C: %ld\n", (long int) array); printf("Array[0] address in C: %ld\n", (long int) &array[0]); data.n = 5; func(&data); } void b_func(void *func(void*)) { float array[5]; for (int i = 0; i < 5; i++) { array[i] = i; } float *data = array; // print &array as integer printf("Array address in C for b_func: %ld\n", (long int) array); func(data); } void c_func(void *array) { printf("Printing array in C for c_func\n"); float *data = array; for (int i = 0; i < 5; i++) { printf("%f\n", data[i]); } } lfortran-lfortran-2f73434/integration_tests/list_of_lists_test.f900000664000175000017500000000163115141516316025635 0ustar alastairalastairprogram lp_list_of_lists_test implicit none type(_lfortran_list(_lfortran_list(integer))) :: x type(_lfortran_list(integer)) :: y call _lfortran_list_append(x, _lfortran_list_constant(1, 0, 1, 12, 15, 15)) y = _lfortran_list_constant(10, 10, 10) call _lfortran_list_append(y, 16) call _lfortran_list_append(x, y) if (_lfortran_get_item(_lfortran_get_item(x, 0), 1) /= 0) error stop if (_lfortran_get_item(_lfortran_get_item(x, 1), 0) /= 10) error stop if (_lfortran_len(_lfortran_get_item(x, 0)) /= 6) error stop if (_lfortran_len(_lfortran_get_item(x, 1)) /= 4) error stop ! Making sure its copy call _lfortran_list_append(y, -22) if (_lfortran_len(_lfortran_get_item(x, 1)) /= 4) error stop call _lfortran_list_append(_lfortran_get_item(x, 1), 36) if (_lfortran_len(_lfortran_get_item(x, 1)) /= 5) error stop end program lp_list_of_lists_test lfortran-lfortran-2f73434/integration_tests/intrinsics_33.f900000664000175000017500000000020715141516316024411 0ustar alastairalastairprogram intrinsics_29 implicit none print *, 'This is record 1.'//new_line('A')//'This is record 2.' end program intrinsics_29 lfortran-lfortran-2f73434/integration_tests/intent_out_struct_member_no_dealloc.f900000664000175000017500000000302215141516316031217 0ustar alastairalastair! Test: allocatable struct member passed to non-allocatable struct intent(out) ! The allocatable actual should NOT be deallocated when dummy is non-allocatable ! This is a regression test for incorrect ImplicitDeallocate generation module intent_out_struct_member_no_dealloc_m implicit none type :: inner_t integer :: val end type inner_t type :: wrapper_t type(inner_t), allocatable :: inner end type wrapper_t contains ! Non-allocatable struct intent(out) - should NOT deallocate actual subroutine set_inner(x) type(inner_t), intent(out) :: x x%val = 99 end subroutine set_inner end module intent_out_struct_member_no_dealloc_m program intent_out_struct_member_no_dealloc use intent_out_struct_member_no_dealloc_m implicit none type(wrapper_t) :: w logical :: was_allocated_before, is_allocated_after allocate(w%inner) w%inner%val = 1 was_allocated_before = allocated(w%inner) ! w%inner is allocatable struct member ! But set_inner takes non-allocatable struct intent(out) ! This should NOT deallocate w%inner before the call call set_inner(w%inner) is_allocated_after = allocated(w%inner) ! Verify allocation status was preserved if (.not. was_allocated_before) error stop 1 if (.not. is_allocated_after) then print *, "BUG: w%inner was incorrectly deallocated!" error stop 2 end if if (w%inner%val /= 99) error stop 3 print *, "Test passed" end program intent_out_struct_member_no_dealloc lfortran-lfortran-2f73434/integration_tests/derived_types_63.f900000664000175000017500000000210515141516316025074 0ustar alastairalastairmodule derived_types_63_m implicit none type :: enum_policy integer :: append = 3 end type enum_policy type(enum_policy), parameter :: merge_policy = enum_policy() type :: toml_merge_config integer :: table = merge_policy%append end type toml_merge_config interface toml_merge_config module procedure :: new_merge_config end interface toml_merge_config contains function new_merge_config(table) result(config) character(*), intent(in), optional :: table type(toml_merge_config) :: config if (present(table)) config%table = merge_policy%append contains subroutine set_enum(enum, str) character(*), intent(in) :: str integer, intent(inout) :: enum enum = merge_policy%append end subroutine set_enum end function new_merge_config end module derived_types_63_m program derived_types_63 use derived_types_63_m type(toml_merge_config) :: config2, config3 config2 = config3 if (config2%table /= 3 .or. config3%table /= 3) error stop if (config2%table /= config3%table) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_39_module.f900000664000175000017500000000073015141516316025250 0ustar alastairalastairmodule modules_39_module_fpm_filesystem_39 contains function join_path(a1, a2, a3, a4, a5) result(path) character(len=*), intent(in) :: a1, a2 character(len=*), intent(in), optional :: a3, a4, a5 character(len=:), allocatable :: path end function join_path subroutine filewrite(filename, filedata) character(len=*), intent(in) :: filename character(len=*), intent(in) :: filedata(:) end subroutine filewrite end module modules_39_module_fpm_filesystem_39 lfortran-lfortran-2f73434/integration_tests/intrinsics_158.f900000664000175000017500000000442715141516316024511 0ustar alastairalastairprogram intrinsics_158 logical, parameter :: l1 = bge(10, 5) logical, parameter :: l2 = bge(10_8, -5_8) integer:: k1 = 10 integer:: k2 = 5 integer:: k3 = -5 integer:: k4 = 15 integer:: k5 = 0 integer:: k6 = -15 logical:: t = .true. logical, parameter :: ar1(4) = bge([1, 2, 4, 5], 3) logical, parameter :: ar2(4) = bge([-1, 3, -7, 5], -3) integer :: arr1(4) integer :: arr2(3) logical :: res(3) arr1 = [11, 2, 13, 4] arr2 = [-5_8, 7_8, 0_8] print *, l1 if (l1 .neqv. .true.) error stop print *, l2 if (l2 .neqv. .false.) error stop print *, ar1 if (any(ar1) .neqv. .true.) error stop print *, ar2 if (any(ar2) .neqv. .true.) error stop print*, bge(10, 5) if (bge(10, 5) .neqv. .true.) error stop print*, bge(-5, 10) if (bge(-5, 10) .neqv. .True.) error stop print*, bge(-5, 5) if (bge(-5, 5) .neqv. .true.) error stop print*, bge(-5, -15) if (bge(-5, -15) .neqv. .true.) error stop print*, bge(5, 15) if (bge(5, 15) .neqv. .false.) error stop print*, bge(5, -15) if (bge(5, -15) .neqv. .false.) error stop print*, bge(0, -5) if (bge(0, -5) .neqv. .false.) error stop print*, bge(0, 5) if (bge(0, 5) .neqv. .false.) error stop print*, bge(-5, 0) if (bge(-5, 0) .neqv. .true.) error stop print*, bge(5, 0) if (bge(5, 0) .neqv. t) error stop print*, bge(k1, k2) if (bge(k1, k2) .neqv. .true.) error stop print*, bge(k3, k1) if (bge(k3, k1) .neqv. .true.) error stop print*, bge(k3, k3) if (bge(k3, k3) .neqv. .true.) error stop print*, bge(k3, k6) if (bge(k3, k6) .neqv. .true.) error stop print*, bge(k2, k4) if (bge(k2, k4) .neqv. .false.) error stop print*, bge(k2, k6) if (bge(k2, k6) .neqv. .false.) error stop print*, bge(k5, k3) if (bge(k5, k3) .neqv. .false.) error stop print*, bge(k5, k2) if (bge(k5, k2) .neqv. .false.) error stop print*, bge(k3, k5) if (bge(k3, k5) .neqv. .true.) error stop print*, bge(k2, k5) if (bge(k2, k5) .neqv. t) error stop print *, bge(arr1, 5) if (any(bge(arr1, 5) .neqv. .true.) .neqv. .true.) error stop res = bge(arr2, k5) print *, res if (any(res .neqv. .true.) .neqv. .false.) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_29_module3.f900000664000175000017500000000155515141516316025340 0ustar alastairalastairmodule fpm_manifest_executable use fpm_manifest_dependency1, only : dependency_config_t, error_t, toml_table, new_dependencies implicit none public :: executable_config_t, new_executable type :: executable_config_t character(len=:), allocatable :: name character(len=:), allocatable :: source_dir character(len=:), allocatable :: main type(dependency_config_t), allocatable :: dependency(:) end type executable_config_t contains subroutine new_executable(self, table, error) type(executable_config_t), intent(out) :: self type(toml_table), intent(inout) :: table type(error_t), allocatable, intent(out) :: error type(toml_table), pointer :: child call new_dependencies(self%dependency, child, error=error) end subroutine new_executable end module fpm_manifest_executable lfortran-lfortran-2f73434/integration_tests/modules_58_module.f900000664000175000017500000000166715141516316025263 0ustar alastairalastairMODULE module_58_module01 IMPLICIT NONE INTEGER, PUBLIC :: nx1 = 1000 INTEGER, PUBLIC :: nx2 = 1000 REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: arr END MODULE MODULE module_58_module02 USE module_58_module01 IMPLICIT NONE REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_flux REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_fluxm CONTAINS SUBROUTINE mms_deallocate END SUBROUTINE mms_deallocate SUBROUTINE mms_allocate ( ) nx1 = 555 ALLOCATE( ref_flux(nx1), ref_fluxm(nx2) ) print *,"Size of nx1",nx1 if(size(ref_flux) /= 555) error stop print *,"Size of nx2",nx2 if(size(ref_fluxm) /= 1000) error stop END SUBROUTINE mms_allocate SUBROUTINE test_alocate_external allocate(arr(nx1)) print *, size(arr) if(size(ref_flux) /= 555) error stop end SUBROUTINE test_alocate_external END MODULE module_58_module02lfortran-lfortran-2f73434/integration_tests/intrinsics_380.f900000664000175000017500000000147515141516316024506 0ustar alastairalastairmodule testdrive_intrinsics_380 implicit none contains !> Obtain the value of an environment variable subroutine get_variable(var, val) !> Name of variable character(len=*), intent(in) :: var !> Value of variable character(len=:), allocatable, intent(out) :: val integer :: length, stat call get_environment_variable(var, length=length, status=stat) allocate(character(len=length) :: val, stat=stat) if (length > 0) then call get_environment_variable(var, val, status=stat) end if end subroutine get_variable end module testdrive_intrinsics_380 program intrinsics_380 use testdrive_intrinsics_380 character(len=:), allocatable :: val call get_variable("LFORTRAN_TEST_ENV_VAR", val) write(*,*) trim(val) if (trim(val) /= "STATUS OK!") error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_352.f900000664000175000017500000000155315141516316024502 0ustar alastairalastairprogram intrinsics_352 implicit none integer :: n integer :: seed_to_put(10) integer :: seed_to_get(10) integer, allocatable :: seed(:) call random_seed(size=n) allocate(seed(n)) call random_seed(get=seed) seed_to_put = [1,2,3,4,5,6, 7, 8, 9, 10] call random_seed(size=n) print *, n call random_seed(put=seed_to_put) print *, seed_to_put call random_seed(get=seed_to_get) print *, seed_to_get call init_random_seed() contains subroutine init_random_seed() INTEGER :: i, n, clock INTEGER, DIMENSION(:), ALLOCATABLE :: seed CALL RANDOM_SEED(size = n) ALLOCATE(seed(n)) CALL SYSTEM_CLOCK(COUNT=clock) seed = clock + 37 * (/ (i - 1, i = 1, n) /) CALL RANDOM_SEED(put=seed) DEALLOCATE(seed) end subroutine init_random_seed end program lfortran-lfortran-2f73434/integration_tests/array_section_04.f900000664000175000017500000000153215141516316025066 0ustar alastairalastairmodule function_32_mod_array_section_04 contains subroutine istril(y) real(8), intent(inout) :: y(:, :) print *, y(2, 2) if ( abs(y(2,2) - 3.0) > 1e-8 ) error stop y(2, 2) = 4.0 end subroutine function istril_func(y) result(z) real(8), intent(inout) :: y(:, :) logical :: z print *, y(2, 2) z = .true. if ( abs(y(2,2) - 4.0) > 1e-8 ) z = .false. y(1,2) = 4.0 end function subroutine matprod(y) real(8), intent(inout) :: y(:, :) call istril(y) if(.not. istril_func(y)) error stop end subroutine end module program array_section_04 use function_32_mod_array_section_04 real(8) :: A(5, 3) A = 1.0_8 A(1,2) = 0 A(2,2) = 3.0 call matprod(A(1:2,1:2)) print *, A(2,2) if ( abs(A(2,2) - 4.0_8) > 1e-8 ) error stop if ( abs(A(1,2) - 4.0_8) > 1e-8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_64.f900000664000175000017500000000023215141516316024413 0ustar alastairalastairprogram intrinsics_64 real :: x, y x = 1.0 y = -0.0 x = sign(x, y) print *, x if (abs(x - (-1.0)) > 1e-9) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_25.f900000664000175000017500000000062015141516316023673 0ustar alastairalastairprogram complex_25 implicit none integer,parameter :: pr = 6, wp = selected_real_kind(pr) real(wp),parameter:: small = tiny(1.0_wp) complex(wp) :: a, b a = cmplx(-2,1,wp)*small b = cmplx(-1,2,wp)*small print *, small if (abs(small - 1.1920929E-38_wp) > 1e-12_wp) error stop print *, a/b if (abs(a/b - (0.800000012,0.600000024)) > 1e-12_wp) error stop end program complex_25 lfortran-lfortran-2f73434/integration_tests/class_25.f900000664000175000017500000000117715141516316023341 0ustar alastairalastairmodule class_25_m implicit none type base integer :: m = 1 end type type, extends(base) :: derived integer :: n = 2 end type end module program class_25 use class_25_m implicit none class(base), allocatable :: b b = derived(10, 20) select type(b) type is (derived) if (b%m /= 10) error stop if (b%n /= 20) error stop class default error stop end select b = base(3) select type(b) type is (base) if (b%m /= 3) error stop class default error stop end select end program lfortran-lfortran-2f73434/integration_tests/functions_31.f900000664000175000017500000000121615141516316024233 0ustar alastairalastairprogram function_31 integer :: x(2,3) = reshape([1, 2, 3, 4, 5, 6], [2,3]) call func(x) contains subroutine func(x) integer, intent(in) :: x(:, :) integer :: y2(size(x, 2), size(x, 1) + 1) y2 = reshape([allocate_return_type_func(x), x(1,:)], shape(y2)) print *, y2 if(any(y2(:, 1) /= [1,2,3]) .or. any(y2(:, 2) /= [4,5,6]) .or. any(y2(:, 3) /= [1,3,5])) error stop end subroutine function allocate_return_type_func(x) result(z) integer, intent(in) :: x(:, :) integer, allocatable :: z(:, :) allocate(z(size(x,1), size(x,2))) z = x end function end program lfortran-lfortran-2f73434/integration_tests/implicit_typing_07.f900000664000175000017500000000014215141516316025427 0ustar alastairalastairprogram dim_param parameter (ialen = 42) integer :: myarray(ialen) myarray = 0 end program lfortran-lfortran-2f73434/integration_tests/intrinsics_329.f900000664000175000017500000000317615141516316024511 0ustar alastairalastairprogram intrinsics_329 use iso_fortran_env, only: dp => real64 real(dp), parameter :: w = -5.1_dp real(dp), parameter :: x = 5.8_dp real(dp) :: y = 6.0_dp real(dp) :: z = -5.8_dp integer(dp) :: res_4 integer(dp) :: res_8 res_4 = idnint(w) print *, res_4 if (res_4 /= -5) error stop res_8 = idnint(w) print *, res_8 if (res_8 /= -5) error stop res_4 = idnint(x) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(x) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(y) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(y) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(z) print *, res_4 if (res_4 /= -6) error stop res_8 = idnint(z) print *, res_8 if (res_8 /= -6) error stop res_4 = idnint(5.8_dp) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(5.8_dp) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(6.00_dp) print *, res_4 if (res_4 /= 6) error stop res_8 = idnint(6.00_dp) print *, res_8 if (res_8 /= 6) error stop res_4 = idnint(0.0_dp) print *, res_4 if (res_4 /= 0) error stop res_8 = idnint(0.0_dp) print *, res_8 if (res_8 /= 0) error stop res_4 = idnint(-412.124_dp) print *, res_4 if (res_4 /= -412) error stop res_8 = idnint(-412.124_dp) print *, res_8 if (res_8 /= -412) error stop res_4 = idnint(-412.00_dp) print *, res_4 if (res_4 /= -412) error stop res_8 = idnint(-412.00_dp) print *, res_8 if (res_8 /= -412) error stop end program lfortran-lfortran-2f73434/integration_tests/nullify_07.f900000664000175000017500000000031515141516316023707 0ustar alastairalastairprogram nullify_07 implicit none character(len=:), pointer :: str allocate(character(len=5) :: str) str = "Hello" print *, str nullify(str) if(len(str) /= 0) error stop end program nullify_07lfortran-lfortran-2f73434/integration_tests/include_03.f900000664000175000017500000000021015141516316023636 0ustar alastairalastairprogram include_03 implicit none include 'i.inc' integer, dimension(i) :: x print *, i if (i /= 4) error stop end program include_03 lfortran-lfortran-2f73434/integration_tests/do_loop_04.f900000664000175000017500000000045115141516316023656 0ustar alastairalastairprogram do_loop_04 integer :: n = 2, k do k = 2, n print *, k end do ! without --use-loop-variable-after-loop ! remove/ update this test if we make using the loop variable after the loop by default if (k /= 2) error stop print *, "k after = ", k end program lfortran-lfortran-2f73434/integration_tests/intrinsics_298.f900000664000175000017500000000602015141516316024505 0ustar alastairalastairprogram intrinsics_298 implicit none integer, parameter :: x1 = dot_product([1, 2, 3], [4, 5, 6]) integer(8), parameter :: x2 = dot_product([12_8, 33_8, 41_8], [13_8, 1_8, 7_8]) real, parameter :: x3 = dot_product([3.0, 5.0, 11.0], [7.0, 13.0, 17.0]) real(8), parameter :: x4 = dot_product([3.0_8, 5.0_8, 11.0_8], [7.0_8, 13.0_8, 17.0_8]) complex, parameter :: x5 = dot_product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], [(7.0, 8.0), (9.0, 10.0), (11.0, 12.0)]) complex(8), parameter :: x6 = dot_product([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)],& [(7.0_8, 8.0_8), (9.0_8, 10.0_8), (11.0_8, 12.0_8)]) logical, parameter :: x7 = dot_product([.true., .false., .true.], [.true., .true., .false.]) integer :: i1(3) = [13, 2, 4], i2(3) = [13_8, 2_8, 4_8] integer(8) :: i3(3) = [13_8, 2_8, 4_8], i4(3) = [13_8, 2_8, 4_8] real :: r1(3) = [13.0, 2.0, 4.0], r2(3) = [13.0, 2.0, 4.0] real(8) :: r3(3) = [13.0_8, 2.0_8, 4.0_8], r4(3) = [13.0_8, 2.0_8, 4.0_8] complex :: c1(3) = [(13.0, 2.0), (2.0, 4.0), (4.0, 6.0)], c2(3) = [(13.0, 2.0), (2.0, 4.0), (4.0, 6.0)] complex(8) :: c3(3) = [(13.0_8, 2.0_8), (2.0_8, 4.0_8), (4.0_8, 6.0_8)],& c4(3) = [(13.0_8, 2.0_8), (2.0_8, 4.0_8), (4.0_8, 6.0_8)] logical :: l1(3) = [.true., .false., .true.], l2(3) = [.true., .false., .true.] print *, x1 if (x1 /= 32) error stop print *, x2 if (x2 /= 476) error stop print *, x3 if (abs(x3 - 273.0) > 1e-6) error stop print *, x4 if (abs(x4 - 273.0_8) > 1e-12) error stop print *, abs(x5) if (abs(abs(x5) - 217.745270) > 1e-5) error stop print *, abs(x6) if (abs(abs(x6) - 217.74526401279087_8) > 1e-12) error stop print *, x7 if (.not. x7) error stop print *, dot_product(i1, i2) if (dot_product(i1, i2) /= 189) error stop print *, dot_product(i3, i4) if (dot_product(i3, i4) /= 189_8) error stop print *, dot_product(r1, r2) if (abs(dot_product(r1, r2) - 189.0) > 1e-6) error stop print *, dot_product(r3, r4) if (abs(dot_product(r3, r4) - 189.0_8) > 1e-12) error stop print *, abs(dot_product(c1, c2)) if (abs(abs(dot_product(c1, c2)) - 245.0) > 1e-6) error stop print *, abs(dot_product(c3, c4)) if (abs(abs(dot_product(c3, c4)) - 245.0_8) > 1e-12) error stop print *, dot_product(l1, l2) if (.not. dot_product(l1, l2)) error stop ! Cases with mixture of real, integer and complex print *, dot_product(i1, r2) if (abs(dot_product(i1, r2) - 189.0) > 1e-6) error stop print *, dot_product(r1, i2) if (abs(dot_product(i1, r2) - 189.0) > 1e-6) error stop print *, dot_product(c1, i2) if (abs(abs(dot_product(c1, i2)) - 197.699265) > 1e-6) error stop print *, dot_product(i1, c2) if (abs(abs(dot_product(i1, c2)) - 197.699265) > 1e-6) error stop print *, dot_product(c4, r3) if (abs(abs(dot_product(c4, r3)) - 197.6992665641428_8) > 1e-12) error stop print *, dot_product(r4, c3) if (abs(abs(dot_product(r4, c3)) - 197.6992665641428_8) > 1e-12) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_71.f900000664000175000017500000000105415141516316024414 0ustar alastairalastairprogram intrinsics_71 implicit none integer :: result_value result_value = routine(3) print *, result_value if (result_value /= 600) error stop contains function routine(p) result(r) integer, intent(in) :: p integer :: a(1, p) integer :: b(p, 1) integer :: c(1, 1) integer :: r a(1, 1) = 10 a(1, 2) = 10 a(1, 3) = 10 b(1, 1) = 20 b(2, 1) = 20 b(3, 1) = 20 c = matmul(a, b) r = c(1, 1) end function routine end program lfortran-lfortran-2f73434/integration_tests/call_subroutine_without_type.f900000664000175000017500000000116515141516316027741 0ustar alastairalastairmodule module_call_subroutine_without_type type :: myType real :: r contains procedure, pass(self) :: get_i end type myType contains subroutine get_i(self) class(myType), intent(inout) :: self call get_r() contains subroutine get_r() print *, "r = ", self % r if (self%r /= 1.0) error stop end subroutine get_r end subroutine get_i end module module_call_subroutine_without_type program call_subroutine_without_type use module_call_subroutine_without_type end program call_subroutine_without_typelfortran-lfortran-2f73434/integration_tests/derived_types_35_file.txt0000664000175000017500000000000415141516316026307 0ustar alastairalastair125 lfortran-lfortran-2f73434/integration_tests/implied_do_loops16.f900000664000175000017500000000251715141516316025415 0ustar alastairalastairprogram implied_do_loops16 implicit none character(len=*), parameter :: scr = "src/" character(len=:), allocatable :: expected(:) type :: string_t character(len=:), allocatable :: s end type string_t type(string_t), allocatable :: file_names(:) integer :: j allocate(character(len=5) :: expected(2)) expected = ["mod1 ", "mod2 "] allocate(file_names(2)) file_names(1)%s = "src/mod1" file_names(2)%s = "src/mod2" if (.not. allocated(expected)) error stop "ERROR: expected not allocated" if (.not. allocated(file_names)) error stop "ERROR: file_names not allocated" if (size(expected) /= size(file_names)) error stop & "ERROR: size mismatch between expected and file_names" do j = 1, size(expected) if (len_trim(expected(j)) == 0) error stop "ERROR: empty expected entry" if (.not. allocated(file_names(j)%s)) error stop "ERROR: unallocated file name" end do write(*,'("EXPECTED: ",*(g0:,","))') & (scr // trim(expected(j)), j=1, size(expected)) write(*,'("FOUND: ",*(g0:,","))') & (trim(file_names(j)%s), j=1, size(file_names)) do j = 1, size(expected) if (scr // trim(expected(j)) /= trim(file_names(j)%s)) then error stop "ERROR: EXPECTED and FOUND differ" end if end do end program lfortran-lfortran-2f73434/integration_tests/file_10_data.txt0000664000175000017500000000014115141516316024345 0ustar alastairalastairhello hi bye. 1234\nhi hello \n abcd!? \n ajdfsalfj;as\n \r jdalfk\14 dsfjlkf\r\tjkdlfas\n\r\t\n lfortran-lfortran-2f73434/integration_tests/separate_compilation_25a.f900000664000175000017500000000114315141516316026570 0ustar alastairalastairmodule linalg_separate_compilation_25 implicit none interface diag module function diag_real(A) result(res) real, intent(in) :: A(:,:) real :: res(minval(shape(A))) end function diag_real end interface end module linalg_separate_compilation_25 module stats_corr_separate_compilation_25 use linalg_separate_compilation_25, only: diag implicit none interface corr procedure corr_real end interface corr contains module function corr_real(x) result(res) real, intent(in) :: x(:, :) real :: res(2) res = diag(x) end function corr_real end modulelfortran-lfortran-2f73434/integration_tests/legacy_array_sections_08.f900000664000175000017500000000057715141516316026611 0ustar alastairalastairprogram legacy_array_sections_08 implicit none real(4) :: x(2) x = [1.0, 2.0] print *, f1(x) if (any(f1(x) - [0.841470957, 0.909297407] > 1e-6)) error stop contains pure elemental real(4) function f1(x) implicit none real(4),intent(in) :: x f1 = sin(x) end function f1 end program legacy_array_sections_08 lfortran-lfortran-2f73434/integration_tests/error_stop_02.f900000664000175000017500000000026515141516316024422 0ustar alastairalastairprogram error_stop_02 implicit none integer :: x x = 5 print *, x x = x + 2 print *, x error stop x = x + 2 print *, x end program lfortran-lfortran-2f73434/integration_tests/expr_20.f900000664000175000017500000000016715141516316023203 0ustar alastairalastairprogram expr_20 integer :: n n = -123 n = n / 10 print *, n if (n /= -12) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_18.f900000664000175000017500000001633415141516316023535 0ustar alastairalastairprogram openmp_18 !*****************************************************************************80 ! !! MAIN is the main program for COMPUTE_PI. ! ! Discussion: ! ! COMPUTE_PI estimates the value of PI. ! ! This program uses Open MP parallelization directives. ! ! It should run properly whether parallelization is used or not. ! ! However, the parallel version computes the sum in a different ! order than the serial version; some of the quantities added are ! quite small, and so this will affect the accuracy of the results. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 April 2009 ! ! Author: ! ! John Burkardt ! use omp_lib implicit none integer, parameter :: logn_max = 9 ! change to 10 for more accurate results print *, '\n' print *, 'COMPUTE_PI' print *, ' FORTRAN90/OpenMP version' print *, '\n' print *, ' Estimate the value of PI by summing a series.' call omp_set_num_threads(8) print *, '\n' print *, ' The number of processors available = ', omp_get_num_procs ( ) print *, ' The number of threads available = ', omp_get_max_threads ( ) call r8_test ( logn_max ) ! ! Terminate. ! print *, '\n' print *, 'COMPUTE_PI' print *, ' Normal end of execution.' stop 0 end subroutine r8_test ( logn_max ) !*****************************************************************************80 ! !! R8_TEST estimates the value of PI using double precision. ! ! Discussion: ! ! PI is estimated using N terms. N is increased from 10^2 to 10^LOGN_MAX. ! The calculation is repeated using both sequential and Open MP enabled code. ! Wall clock time is measured by calling SYSTEM_CLOCK. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 April 2009 ! ! Author: ! ! John Burkardt ! use omp_lib implicit none double precision error double precision estimate integer logn integer logn_max character ( len = 3 ) mode integer n double precision, parameter :: r8_pi = 3.141592653589793D+00 double precision wtime print *, ' ' print *, 'R8_TEST:' print *, ' Estimate the value of PI,' print *, ' using double precision arithmetic.' print *, ' ' print *, ' N = number of terms computed and added;' print *, ' ' print *, ' MODE = SEQ for sequential code;' print *, ' MODE = OMP for Open MP enabled code;' print *, ' (performance depends on whether Open MP is used,' print *, ' and how many processes are available!)' print *, ' ' print *, ' ESTIMATE = the computed estimate of PI;' print *, ' ' print *, ' ERROR = ( the computed estimate - PI );' print *, ' ' print *, ' TIME = elapsed wall clock time;' print *, ' ' print *, ' Note that you can''t increase N forever, because:' print *, ' A) ROUNDOFF starts to be a problem, and' print *, ' B) maximum integer size is a problem.' print *, ' ' print *, ' The maximum integer:' , huge ( n ) print *, ' ' print *, ' ' print *, ' N Mode Estimate Error Time' print *, ' ' n = 1 do logn = 1, logn_max ! ! Sequential calculation. ! mode = 'SEQ' wtime = omp_get_wtime ( ) call r8_pi_est_seq ( n, estimate ) wtime = omp_get_wtime ( ) - wtime error = abs ( estimate - r8_pi ) if (logn == logn_max .and. error > 1e-12) error stop print *, & n, mode, estimate, error, wtime ! ! Open MP enabled calculation. ! mode = 'OMP' wtime = omp_get_wtime ( ) call r8_pi_est_omp ( n, estimate ) wtime = omp_get_wtime ( ) - wtime error = abs ( estimate - r8_pi ) print *, & n, mode, estimate, error, wtime n = n * 10 end do return end subroutine r8_pi_est_omp ( n, estimate ) !*****************************************************************************80 ! !! R8_PI_EST_OMP estimates the value of PI, using Open MP. ! ! Discussion: ! ! The calculation is based on the formula for the indefinite integral: ! ! Integral 1 / ( 1 + X**2 ) dx = Arctan ( X ) ! ! Hence, the definite integral ! ! Integral ( 0 <= X <= 1 ) 1 / ( 1 + X**2 ) dx ! = Arctan ( 1 ) - Arctan ( 0 ) ! = PI / 4. ! ! A standard way to approximate an integral uses the midpoint rule. ! If we create N equally spaced intervals of width 1/N, then the ! midpoint of the I-th interval is ! ! X(I) = (2*I-1)/(2*N). ! ! The approximation for the integral is then: ! ! Sum ( 1 <= I <= N ) (1/N) * 1 / ( 1 + X(I)**2 ) ! ! In order to compute PI, we multiply this by 4; we also can pull out ! the factor of 1/N, so that the formula you see in the program looks like: ! ! ( 4 / N ) * Sum ( 1 <= I <= N ) 1 / ( 1 + X(I)**2 ) ! ! Until roundoff becomes an issue, greater accuracy can be achieved by ! increasing the value of N. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 13 January 2003 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer N, the number of terms to add up. ! ! Output, double precision ESTIMATE, the estimated value of pi. ! implicit none double precision h double precision estimate integer i integer n double precision sum2 double precision x h = 1.0D+00 / dble ( 2 * n ) sum2 = 0.0D+00 !$omp parallel shared(h, n) private(i, x) reduction(+:sum2) !$omp do do i = 1, n x = h * dble ( 2 * i - 1 ) sum2 = sum2 + 1.0D+00 / ( 1.0D+00 + x**2 ) end do !$omp end do !$omp end parallel estimate = 4.0D+00 * sum2 / dble ( n ) return end subroutine r8_pi_est_seq ( n, estimate ) !*****************************************************************************80 ! !! R8_PI_EST_SEQ estimates the value of PI, using sequential execution. ! ! Discussion: ! ! The calculation is based on the formula for the indefinite integral: ! ! Integral 1 / ( 1 + X**2 ) dx = Arctan ( X ) ! ! Hence, the definite integral ! ! Integral ( 0 <= X <= 1 ) 1 / ( 1 + X**2 ) dx ! = Arctan ( 1 ) - Arctan ( 0 ) ! = PI / 4. ! ! A standard way to approximate an integral uses the midpoint rule. ! If we create N equally spaced intervals of width 1/N, then the ! midpoint of the I-th interval is ! ! X(I) = (2*I-1)/(2*N). ! ! The approximation for the integral is then: ! ! Sum ( 1 <= I <= N ) (1/N) * 1 / ( 1 + X(I)**2 ) ! ! In order to compute PI, we multiply this by 4; we also can pull out ! the factor of 1/N, so that the formula you see in the program looks like: ! ! ( 4 / N ) * Sum ( 1 <= I <= N ) 1 / ( 1 + X(I)**2 ) ! ! Until roundoff becomes an issue, greater accuracy can be achieved by ! increasing the value of N. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 06 January 2003 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer N, the number of terms to add up. ! ! Output, double precision ESTIMATE, the estimated value of pi. ! implicit none double precision h double precision estimate integer i integer n double precision sum2 double precision x h = 1.0D+00 / dble ( 2 * n ) sum2 = 0.0D+00 do i = 1, n x = h * dble ( 2 * i - 1 ) sum2 = sum2 + 1.0D+00 / ( 1.0D+00 + x**2 ) end do estimate = 4.0D+00 * sum2 / dble ( n ) return end lfortran-lfortran-2f73434/integration_tests/arrays_88.f900000664000175000017500000000150415141516316023540 0ustar alastairalastairprogram arrays_88 implicit none integer, parameter :: n = 5 integer :: offset(n) real :: offsetr(n) integer :: pos integer :: offset_date offset = (/1, 2, 3, 4, 5/) offsetr = (/1.0, 2.0, 3.0, 4.0, 5.0/) pos = 10 offset_date = 3 print *, peek(pos + offset(:offset_date)) if( any(peek(pos + offset(:offset_date)) /= [110, 120, 130]) ) error stop print *, peekr(pos + offsetr(:offset_date)) if( any(peekr(pos + offsetr(:offset_date)) /= [110.0, 120.0, 130.0]) ) error stop contains function peek(x) result(y) integer, intent(in) :: x(:) integer :: y(size(x)) y = x * 10 end function peek function peekr(x) result(y) real, intent(in) :: x(:) real :: y(size(x)) y = x * 10 end function peekr end program arrays_88 lfortran-lfortran-2f73434/integration_tests/select_type_11.f900000664000175000017500000000115015141516316024536 0ustar alastairalastairprogram select_type_11 implicit none integer, save :: arr(3) = [1, 2, 3] print *, "Before:", arr call update_any(arr) print *, "After: ", arr if(arr(1) /= 10) then print *, "Test failed: arr(1) should be 10, but is ", arr(1) else print *, "Test passed: arr(1) is ", arr(1) end if contains subroutine update_any(generic) class(*) :: generic(:) integer, pointer :: xx(:) select type(generic) type is (integer) xx => generic xx(1) = 10 end select end subroutine update_any end program select_type_11lfortran-lfortran-2f73434/integration_tests/arrays_60.f900000664000175000017500000000167715141516316023541 0ustar alastairalastairprogram arrays_60 implicit none ! Declare variables integer, dimension(5) :: array real :: scalar_value integer :: i real, dimension(5) :: x, y, z array = (/ 1, 0, 3, 0, 5 /) x = (/ 1.0, 2.0, 3.0, 4.0, 5.0 /) y = (/ 2.0, 4.0, 6.0, 8.0, 10.0 /) scalar_value = 2.5 print *, "Result:", square(scalar_value) z = array_function(x, y) print *, "Result (z):", z if( any(abs(z - 2.41421366) > 1e-6) ) error stop where (array == 0) array = 10 end where do i = 1, size(array) print *, "array(", i, ") squared =", square(real(array(i))) end do contains real function square(a) real, intent(in) :: a square = a * a end function real function array_function(a, b) real, intent(in) :: a(:), b(:) real :: temp(size(a)) array_function = 0.0 temp = a + sqrt(b) array_function = temp(1) end function end program arrays_60 lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_10_foo.f900000664000175000017500000000015715141516316027437 0ustar alastairalastairsubroutine foo(x) implicit none real, intent(inout) :: x(*) x(1) = x(1) + 10.0 end subroutine foo lfortran-lfortran-2f73434/integration_tests/functions_44.f900000664000175000017500000000104515141516316024237 0ustar alastairalastairmodule functions_44_mod implicit none type string_t character(len=:), allocatable :: string_ end type string_t contains function bracket(x) result(res) class(string_t), intent(in) :: x type(string_t) :: res res%string_ = "2" res%string_ = x%string_ end function bracket end module functions_44_mod program functions_44 use functions_44_mod implicit none type(string_t) :: lines(5) lines(1)%string_ = "1" lines(1) = bracket(lines(1)) if (lines(1)%string_ /= "1") error stop end program functions_44 lfortran-lfortran-2f73434/integration_tests/assign_to2.f900000664000175000017500000000027215141516316023771 0ustar alastairalastairprogram main integer :: i, sum, ZERO 10 assign 30 to next sum = ZERO i = 1 20 GO TO next,(30, 50, 70) 30 IF( 0<1) GO TO 70 50 print *, 50 assign 50 to next 70 print *, 70 end program lfortran-lfortran-2f73434/integration_tests/bindc_09.f900000664000175000017500000000203115141516316023303 0ustar alastairalastairprogram bindc_09 ! Test: function declared EXTERNAL then defined locally ! Reproduces type mismatch when function is declared EXTERNAL (BindC ABI ! expected by caller) but defined locally (Source ABI, returns struct). ! The caller tries to convert struct to struct which fails without fix. implicit none ! Declare complex function as EXTERNAL - this makes caller expect BindC ABI complex :: get_complex_local external :: get_complex_local complex :: result ! Call the function - caller expects vector type return from EXTERNAL ! but function actually returns struct type since it's locally defined result = get_complex_local(1.0, 2.0) ! Verify result if (abs(real(result) - 1.0) > 1e-5) error stop if (abs(aimag(result) - 2.0) > 1e-5) error stop print *, "PASS" end program ! Local function definition - uses Source ABI, returns struct complex function get_complex_local(re, im) implicit none real, intent(in) :: re, im get_complex_local = cmplx(re, im) end function lfortran-lfortran-2f73434/integration_tests/file_28.f900000664000175000017500000000137215141516316023153 0ustar alastairalastairprogram file_28 implicit none integer :: unit_num, unit_num2 integer :: stat, a, b, c integer, dimension(5) :: data_out = [10, 20, 30, 40, 50] integer, dimension(5) :: data_in ! Choose a unit number unit_num = 20 ! Write data to file open(unit=unit_num, file='file_28.txt', status='replace') write(unit_num, *) data_out rewind(unit_num) open(unit=unit_num) read(unit_num, *) data_in close(unit_num, status='delete') open(newunit=unit_num2, file='file_28.txt', status='replace', access='stream', form='unformatted') write(unit_num2) 1, 2, 3 rewind(unit_num2) read(unit_num2) a, b, c close(unit_num2, status='delete') if (a /= 1 .or. b /= 2 .or. c /= 3) error stop end program file_28lfortran-lfortran-2f73434/integration_tests/class_76.f900000664000175000017500000000133515141516316023343 0ustar alastairalastairmodule constructor_mod implicit none type :: toml_map end type toml_map type :: toml_table class(toml_map), allocatable :: map end type toml_table interface toml_table module procedure toml_table_init end interface toml_table contains function toml_table_init() result(this) type(toml_table) :: this allocate(toml_map :: this%map) end function toml_table_init end module constructor_mod module reexport_mod use constructor_mod, only: toml_table end module reexport_mod program main use reexport_mod, only: toml_table implicit none type(toml_table) :: tabx tabx = toml_table() if (.not. allocated(tabx%map)) error stop 1 end program main lfortran-lfortran-2f73434/integration_tests/allocated_03.f900000664000175000017500000000022415141516316024150 0ustar alastairalastairprogram main implicit none real(4), allocatable :: x(:) allocate(x(10)) if (.not.allocated(x)) error stop end program main lfortran-lfortran-2f73434/integration_tests/fma_02.f900000664000175000017500000000075215141516316022770 0ustar alastairalastairmodule fma_02_mod contains subroutine ss(x) integer, intent(in) :: x real(4) :: b(x) b = 1 b = -b + 1.0*b ! Test FMA opt. with `--fast` (pointerToDataArray) print *, b if(any(b /= 0.0)) error stop end subroutine end module program fma_02 use fma_02_mod implicit none real ::b(10) b = 1 b = -b + b*1.0 ! Test FMA opt. with `--fast` (fixedSizeAsrray) print *, b if(any(b /= 0.0)) error stop call ss(10) end program lfortran-lfortran-2f73434/integration_tests/multiple_procs_in_bin_op.f900000664000175000017500000000252515141516316027001 0ustar alastairalastairmodule julienne_string_m_multiple_procs_in_bin_op use iso_c_binding, only : c_bool implicit none private public :: string_t public :: operator(.separatedBy.) type string_t private character(len=:), allocatable :: string_ end type interface operator(.csv.) pure module function strings_with_comma_separator(strings) result(csv) implicit none type(string_t), intent(in) :: strings(:) type(string_t) csv end function end interface interface operator(.separatedBy.) pure module function strings_with_separator(strings, sep) result(joined) implicit none type(string_t), intent(in) :: strings(:) character(len=*), intent(in) :: sep type(string_t) :: joined end function end interface contains module procedure strings_with_comma_separator end procedure module procedure strings_with_separator end procedure end module julienne_string_m_multiple_procs_in_bin_op program create_markdown_table use julienne_string_m_multiple_procs_in_bin_op implicit none contains pure function markdown_table(column_header) result(lines) type(string_t), intent(in) :: column_header(:) character(len=1), parameter :: column_separator = "|" type(string_t) lines(5) lines(1) = column_header .separatedBy. column_separator end function end programlfortran-lfortran-2f73434/integration_tests/goto_05.f900000664000175000017500000000101115141516316023165 0ustar alastairalastairprogram goto_05 implicit none integer :: a, n ! Jump to the label n = 1 -> 1 assign 1 to n a = 0 go to n, (1, 2, 3) a = a + 1 1 a = a + 2 2 a = a + 4 3 a = a + 8 print *, a if(a /= 2+4+8) error stop ! Jump to the label n = 6 -> 6 assign 6 to n a = 0 go to n, (4, 5, 6) a = a + 1 4 a = a + 2 5 a = a + 4 6 a = a + 8 print *, a if(a /= 8) error stop ! Jump to the label n = 8 -> 8 assign 8 to n a = 0 go to n, (7, 8, 9) a = a + 1 7 a = a + 2 8 a = a + 4 9 a = a + 8 print *, a if(a /= 4+8) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_138.f900000664000175000017500000000271315141516316024503 0ustar alastairalastairprogram intrinsics_138 implicit none real :: x = 3.143 complex(4) :: y = (2.33, 4.1) real(kind=4) :: x1(2) complex(kind=8) :: y1 integer(4), parameter :: r1 = precision(1._4) integer(8), parameter :: r2 = precision(67._8) integer, parameter :: r3 = precision((1, 2)) integer(4), parameter :: ar1 = precision([11.3_4, 1.7_4, 0.0_4]) integer(8), parameter :: ar2 = precision([11.3_8, 1.7_8, 0.0_8]) integer, parameter :: ar3 = precision([(1, 2), (3, 4), (11, 22)]) real(4) :: arr1(3) = [11.3_4, 1.7_4, 0.0_4] complex(8) :: arr2(3) = [(11.3_8, 1.7_8), (0.0_8, 1.1_8), (5.0_8, 0.1_8)] print *, r1 if (r1 /= 6) error stop print *, r2 if (r2 /= 15) error stop print *, ar1 if (ar1 /= 6) error stop print *, ar2 if (ar2 /= 15) error stop print *, precision(x) if (precision(x) /= 6) error stop print *, precision(y) if (precision(y) /= 6) error stop print *, precision(1._8) ** 0.5 if (abs(precision(1._8) ** 0.5_8 - 3.87298346) > 1e-6) error stop print*, precision(1.0) if (precision(1.0) /= 6) error stop print *, precision(x1) if (precision(x1) /= 6) error stop print *, precision(1.0d0) if (precision(1.0d0) /= 15) error stop print *, precision(y1) if (precision(y1) /= 15) error stop print *, precision(arr1) if (precision(arr1) /= 6) error stop print *, precision(arr2) if (precision(arr2) /= 15) error stop end programlfortran-lfortran-2f73434/integration_tests/modules_37.f900000664000175000017500000000262015141516316023701 0ustar alastairalastairmodule modules_37_fpm_backend implicit none public :: build_package type, abstract :: fpm_cmd_settings logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_build_settings end type type string_t character(len=:), allocatable :: s end type type build_target_ptr type(build_target_t), pointer :: ptr => null() end type build_target_ptr type build_target_t character(:), allocatable :: output_dir end type build_target_t type :: fpm_model_t end type fpm_model_t contains subroutine build_package(targets, model, verbose) type(build_target_ptr), intent(inout) :: targets(:) type(fpm_model_t), intent(in) :: model logical, intent(in) :: verbose integer :: i, j type(string_t), allocatable :: build_dirs(:) type(string_t) :: temp allocate(build_dirs(0)) do i = 1, size(targets) associate(target => targets(i)%ptr) temp%s = target%output_dir build_dirs = [build_dirs, temp] end associate end do end subroutine build_package subroutine cmd_build(settings) type(fpm_build_settings), intent(in) :: settings type(fpm_model_t) :: model type(build_target_ptr), allocatable :: targets(:) call build_package(targets, model, verbose=settings%verbose) end subroutine cmd_build end module modules_37_fpm_backend program modules_37 implicit none print *, "executing modules_37" end program modules_37 lfortran-lfortran-2f73434/integration_tests/separate_compilation_15a.f900000664000175000017500000000117315141516316026572 0ustar alastairalastairmodule separate_compilation_15a_module implicit none private public :: test_solver contains subroutine test_solver() real :: xl(2) real :: xu(2) call recursive_fun2() print *, "xl = ", xl if ( abs(sum(xl) - (-7.0)) > 1e-8 ) error stop print *, "xu = ", xu if ( abs(sum(xu) - 2.0) > 1e-8 ) error stop contains subroutine take_xl_xu(xl, xu) implicit none real, intent(out) :: xl(:) real, intent(out) :: xu(:) xl = [12.0, -19.0] xu = [1.0, 1.0] end subroutine subroutine recursive_fun2() implicit none call take_xl_xu(xl, xu) end subroutine recursive_fun2 end subroutine test_solver end module separate_compilation_15a_module lfortran-lfortran-2f73434/integration_tests/passing_array_02.f900000664000175000017500000000277215141516316025073 0ustar alastairalastairMODULE passing_array_02_mod implicit none INTERFACE test_01_interface MODULE PROCEDURE test_01 END INTERFACE test_01_interface INTERFACE test_02_interface MODULE PROCEDURE test_02 END INTERFACE test_02_interface CONTAINS FUNCTION test_01 (len,value) result(res) implicit none INTEGER, intent(in) :: len INTEGER, DIMENSION(3,len),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_01 FUNCTION test_02 (value) result(res) implicit none ! Passed array has dimension = 30 while the array in this function has dimension = 3 ! Slicing is premesible (3 <= 30), so accept it. INTEGER, DIMENSION(3,1),intent(in) :: value INTEGER :: res res = size(value) END FUNCTION test_02 subroutine test_entry integer:: len INTEGER, DIMENSION(3, 10) :: arr INTEGER :: ret len = 10 ret = test_01_interface (len,arr) print * , ret if (ret /= 30) error stop ret = test_01 (len,arr) print * , ret if (ret /= 30) error stop ret = test_02_interface (arr) print * , ret if (ret /= 3) error stop ret = test_02 (arr) print * , ret if (ret /= 3) error stop end subroutine test_entry END MODULE passing_array_02_mod program passing_array_02 use passing_array_02_mod implicit none call test_entry end program passing_array_02 lfortran-lfortran-2f73434/integration_tests/test_ord.f900000664000175000017500000000073615141516316023551 0ustar alastairalastair! Testing Python's ord intrinsic ! -- Example -- ! i: i32 ! s = "x" ! i = ord(s) # Equivalent in LFortran is `lfortran_ord()` program test_ord implicit none if (_lfortran_ord("H") /= 72) error stop if (_lfortran_ord("c") /= 99) error stop if (_lfortran_ord("1") /= 49) error stop character(len=:), allocatable :: x x = "Hello,World" if (_lfortran_ord(x(1)) /= 72) error stop if (_lfortran_ord(x(6)) /= 44) error stop end program test_ord lfortran-lfortran-2f73434/integration_tests/intrinsics_224.f900000664000175000017500000000170715141516316024501 0ustar alastairalastairprogram intrinsics_224 implicit none real(4) :: x1 = 1.0_4, x2 = 42.0_4 real(8) :: y1 = 1.0_8, y2 = 42.0_8 real(4), parameter :: x3 = 1.0_4, x4 = 42.0_4 real(8), parameter :: y3 = 1.0_8, y4 = 42.0_8 print*, spacing(x1) if (abs(spacing(x1) - 1.19209290E-07) > 1e-6) error stop print*, spacing(y1) if (abs(spacing(y1) - 2.2204460492503131E-016) > 1e-6) error stop print*, spacing(x2) if (abs(spacing(x2) - 3.81469727E-06) > 1e-6) error stop print*, spacing(y2) if (abs(spacing(y2) - 7.1054273576010019E-015) > 1e-6) error stop print*, spacing(x3) if ( abs(spacing(x3) - 1.19209290e-07) > 1e-6 ) error stop print*, spacing(y3) if ( abs(spacing(y3) - 2.2204460492503131e-16) > 1e-6 ) error stop print*, spacing(x4) if ( abs(spacing(x4) - 3.81469727e-06) > 1e-6 ) error stop print*, spacing(y4) if ( abs(spacing(y4) - 2.2204460492503131e-16) > 1e-6 ) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_46.f900000664000175000017500000000577115141516316024430 0ustar alastairalastairprogram intrinsics_46 implicit none ! Compile_time integer :: i, j, c integer(8) :: li_1, lj_1, li_2, lj_2 integer(8) :: int_res(4) integer, parameter :: dp = kind(0d0) character(len=1) :: c_1 = 'b' character(len = 1) :: a = 'a' character(len = 1) :: b = 'b' character(len = 1) :: d = '#' character(len=1) :: e(3) integer :: x(3) integer, parameter :: i1 = ichar('a') integer(8), parameter :: i2 = ichar('a', kind=8) integer, parameter :: ar1(3) = ichar(['a', '$', '%']) integer(8), parameter :: ar2(3) = ichar(['a', '$', '%'], 8) character(1) :: arr1(3) = ['a', 'A', '@'] print *, i1 if (i1 /= 97) error stop print *, i2 if (i2 /= 97) error stop print *, ar1 if (any(ar1 /= [97, 36, 37])) error stop print *, ar2 if (any(ar2 /= [97, 36, 37])) error stop print *, ichar(arr1) if (any(ichar(arr1) /= [97, 65, 64])) error stop i = ichar(' ') j = iachar(' ') li_1 = ichar('A', 8) lj_1 = iachar('a', 8) li_2 = ichar('Z', kind=8) lj_2 = iachar('z', kind=8) c_1 = char(100); e = ["a", "b", "c"] x = [97, 98, 99] if (i /= 32) error stop if (j /= 32) error stop if (li_1 /= 65) error stop if (lj_1 /= 97) error stop if (li_2 /= 90) error stop if (lj_2 /= 122) error stop ! Compile time with broadcasting int_res = ichar([' ', 'c', 'd', 'e'], kind=8) if (int_res(1) /= 32) error stop if (kind(int_res(1)) /= dp) error stop if (int_res(2) /= 99) error stop if (kind(int_res(2)) /= dp) error stop if (int_res(3) /= 100) error stop if (kind(int_res(3)) /= dp) error stop if (int_res(4) /= 101) error stop if (kind(int_res(4)) /= dp) error stop ! Run_time c = ichar(c_1) if (c /= 100) error stop if (char(c) /= 'd') error stop c = 100 c_1 = achar(100) if (c_1 /= "d") error stop c_1 = achar(c) if (c_1 /= "d") error stop c_1 = char(100) if (c_1 /= "d") error stop c_1 = char(c) if (c_1 /= "d") error stop c_1 = "e" c = iachar("e") if (c /= 101) error stop c = iachar(c_1) if (c /= 101) error stop c = ichar("e") if (c /= 101) error stop c = ichar(c_1) if (c /= 101) error stop print *, ichar(a) if(ichar(a) /= 97) error stop print *, ichar(b) if(ichar(b) /= 98) error stop print *, ichar(d) if(ichar(d) /= 35) error stop print *, ichar('a') if(ichar('a') /= 97) error stop print *, ichar('b') if(ichar('b') /= 98) error stop print *, ichar('C') if(ichar('C') /= 67) error stop print *, ichar('#') if(ichar('#') /= 35) error stop print *, kind(ichar(a)) if(kind(ichar(a)) /= 4) error stop print *, kind(ichar(a, 8)) if(kind(ichar(a, 8)) /= 8) error stop print *, kind(ichar('a')) if(kind(ichar('a')) /= 4) error stop print *, kind(ichar('a', 8)) if(kind(ichar('a', 8)) /= 8) error stop print *, ichar(e) if (any(ichar(e) /= x)) error stop end program intrinsics_46 lfortran-lfortran-2f73434/integration_tests/modules_16.f900000664000175000017500000000016615141516316023701 0ustar alastairalastair! This is a test for https://gitlab.com/lfortran/lfortran/-/issues/532 program modules_16 use modules_16b end program lfortran-lfortran-2f73434/integration_tests/arrays_op_11.f900000664000175000017500000000122515141516316024220 0ustar alastairalastairprogram main implicit none real :: z(2) print *, solution() z = solution() print *, z call compare_solutions(z) contains subroutine compare_solutions(x) real, dimension(:), intent(in) :: x real, dimension(size(x)) :: diff diff = solution() - x if (diff(1) /= 0.0) error stop if (diff(2) /= 0.0) error stop diff = x - solution() if (diff(1) /= 0.0) error stop if (diff(2) /= 0.0) error stop end subroutine pure function solution() result(x) real, dimension(:), allocatable :: x x = [1.0, 2.0] end function solution end program main lfortran-lfortran-2f73434/integration_tests/intrinsics_244.f900000664000175000017500000000263715141516316024506 0ustar alastairalastairprogram intrinsics_244 integer, parameter :: x1(4) = cshift([1, 2, 3, 4], 2) real, parameter :: y1(4) = cshift([1.0, 2.0, 3.0, 4.0], -2) logical, parameter :: z1(4) = cshift([.true., .false., .true., .false.], -1) character(len=2), parameter :: c1(4) = cshift(["ab", "bc", "cd", "de"], 2) integer :: x(4) = [1, 2, 3, 4] real :: y(4) = [1.0, 2.0, 3.0, 4.0] logical :: z(4) = [.true., .false., .true., .false.] character(len=2) :: c(4) = ["ab", "bc", "cd", "de"] integer :: shift(4) = [1, -2, -3, 2] integer :: shift_val = -2 print*, cshift(x, shift(1)) if (any(cshift(x, shift(1)) /= [2, 3, 4, 1])) error stop print*, cshift(y, shift(2)) if (any(cshift(y, shift(2)) /= [3.0, 4.0, 1.0, 2.0])) error stop print*, cshift(z, shift(3)) if (any(cshift(z, shift(3)) .neqv. [.false., .true., .false., .true.])) error stop print*, cshift(c, shift(4)) if (any(cshift(c, shift(4)) /= ["cd", "de", "ab", "bc"])) error stop print*, x1 if (any(x1 /= [3, 4, 1, 2])) error stop print*, y1 if (any(y1 /= [3.0, 4.0, 1.0, 2.0])) error stop print*, z1 if (z1(1) .neqv. .false. .or. z1(2) .neqv. .true. .or. z1(3) .neqv. .false. .or. z1(4) .neqv. .true.) error stop print *, cshift(x, shift_val) if (any(y1 /= [3.0, 4.0, 1.0, 2.0])) error stop print *, shift_val if (shift_val /= -2) error stop ! print*, c1 ! gives segfault end program lfortran-lfortran-2f73434/integration_tests/intrinsics_264.f900000664000175000017500000000605615141516316024507 0ustar alastairalastairprogram intrinsics_264 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(sp), parameter :: a1 = sin(1.0_sp) real(dp), parameter :: a2 = sin(1.0_dp) complex(sp), parameter :: a3 = sin((1.0_sp, 1.5_sp)) complex(dp), parameter :: a4 = sin((1.0_dp, 1.5_dp)) real(sp), parameter :: ar1(3) = sin([1.0_sp, 1.5_sp, 2.0_sp]) real(dp), parameter :: ar2(3) = sin([1.0_dp, 1.5_dp, 2.0_dp]) complex(sp), parameter :: ac1(3) = sin([(1.0_sp, 1.5_sp), (2.0_sp, 2.5_sp), (3.0_sp, 3.5_sp)]) complex(dp), parameter :: ac2(3) = sin([(1.0_dp, 1.5_dp), (2.0_dp, 2.5_dp), (3.0_dp, 3.5_dp)]) real(sp) :: b1 = 0.5_sp real(dp) :: b2 = 0.7_dp complex(sp) :: b3 = (0.5_sp, 0.7_sp) complex(dp) :: b4 = (0.5_dp, 0.7_dp) real(sp) :: br1(3) = [0.5_sp, 0.7_sp, 0.9_sp] real(dp) :: br2(3) = [0.5_dp, 0.7_dp, 0.9_dp] complex(sp) :: bc1(3) = [(0.5_sp, 0.7_sp), (0.9_sp, 1.1_sp), (1.3_sp, 1.5_sp)] complex(dp) :: bc2(3) = [(0.5_dp, 0.7_dp), (0.9_dp, 1.1_dp), (1.3_dp, 1.5_dp)] print *, a1 if (abs(a1 - 8.41470957e-01_sp) > 1e-6_sp) error stop print *, a2 if (abs(a2 - 8.41470984807896507e-01_dp) > 1e-12_dp) error stop print *, a3 if (abs(a3 - (1.979484_sp, 1.150455_sp)) > 1e-6_sp) error stop print *, a4 if (abs(a4 - (1.9794844356103003_dp, 1.1504545994253859_dp)) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [0.841470957_sp, 0.997494996_sp, 0.909297407_sp]) > 1e-6_sp)) error stop print *, ar2 if (any(abs(ar2 - [0.84147098480789650_dp, 0.99749498660405445_dp, 0.90929742682568171_dp]) > 1e-12_dp)) error stop print *, ac1 if (any(abs(ac1 - [(1.97948444_sp, 1.15045464_sp), (5.57607508_sp, -2.51777339_sp), & (2.33875704_sp, -16.3770771_sp)]) > 1e-6_sp)) error stop print *, ac2 if (any(abs(ac2 - [(1.9794844356103003_dp, 1.1504545994253859_dp), (5.5760750444083884_dp, -2.5177734552480526_dp), & (2.3387571511543750_dp, -16.377076888816426_dp)]) > 1e-12_dp)) error stop print *, sin(b1) if (abs(sin(b1) - 0.479425550_sp) > 1e-6_sp) error stop print *, sin(b2) if (abs(sin(b2) - 0.64421768723769102_dp) > 1e-12_dp) error stop print *, sin(b3) if (abs(sin(b3) - (0.601760089_sp, 0.665719807_sp)) > 1e-6_sp) error stop print *, sin(b4) if (abs(sin(b4) - (0.60176007656391672_dp, 0.66571982846862043_dp)) > 1e-12_dp) error stop print *, sin(br1) if (any(abs(sin(br1) - [0.479425550_sp, 0.644217670_sp, 0.783326924_sp]) > 1e-6_sp)) error stop print *, sin(br2) if (any(abs(sin(br2) - [0.47942553860420301_dp, 0.64421768723769102_dp, 0.78332690962748341_dp]) > 1e-12_dp)) error stop print *, sin(bc1) if (any(abs(sin(bc1) - [(0.601760089_sp, 0.665719807_sp), (1.30699551_sp, 0.830251873_sp), & (2.26668358_sp, 0.569579840_sp)]) > 1e-6_sp)) error stop print *, sin(bc2) if (any(abs(sin(bc2) - [(0.60176007656391672_dp, 0.66571982846862043_dp), (1.3069954824217060_dp, 0.83025178152468282_dp), & (2.2666835402217402_dp, 0.56957976005226330_dp)]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_96.f900000664000175000017500000000073615141516316024431 0ustar alastairalastairprogram intrinsics_96 character c integer :: a1 = 35 integer :: a2(3) = [39, 63, 66] print*, char(65) if (char(65) /= 'A') error stop ! print*, char([34, 39, 67]) ! Doesn't work yet print*, char(a1) if (char(a1) /= '#') error stop print*, char(a2) if (char(a2(1)) /= "'") error stop if (char(a2(2)) /= '?') error stop if (char(a2(3)) /= 'B') error stop c = char(32) print*, c if (c /= ' ') error stop end programlfortran-lfortran-2f73434/integration_tests/data_06.f900000664000175000017500000000032715141516316023140 0ustar alastairalastairprogram data_06 integer illin ,ntrep common / block_1 / illin, ntrep data illin/129/, ntrep/8753/ if (illin /= 129) error stop if (ntrep /= 8753) error stop print *, illin, ntrep end program lfortran-lfortran-2f73434/integration_tests/common_26.f900000664000175000017500000000157315141516316023525 0ustar alastairalastairprogram common_26 implicit none ! All Fortran standards allow the size of blank common to vary between ! program units - from F66 (7.2.1.3) to F2023 (8.10.2.5). real :: pi, epsilon, sq2 common // pi, epsilon, sq2 pi = 3.1415654 epsilon = 2.718281828 sq2 = 1.414213562 call print_pi () call print_eps () call print_sq2 () print *, "All tests passed" end program subroutine print_pi () implicit none real :: pi common pi if (abs(pi - 3.1415654) > 1.0e-6) error stop "Wrong pi value" end subroutine subroutine print_eps () implicit none real :: dummy, eps common dummy, eps if (abs(eps - 2.718281828) > 1.0e-6) error stop "Wrong epsilon value" end subroutine subroutine print_sq2 () implicit none real :: dummy(2), sq2 common dummy, sq2 if (abs(sq2 - 1.414213562) > 1.0e-6) error stop "Wrong sqrt(2) value" end subroutine lfortran-lfortran-2f73434/integration_tests/error_stop_01.f900000664000175000017500000000010315141516316024410 0ustar alastairalastairprogram error_stop_01 implicit none error stop end program lfortran-lfortran-2f73434/integration_tests/sin_02.f900000664000175000017500000000350715141516316023017 0ustar alastairalastairprogram sin_02 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp), parameter :: pi = 3.1415926535897932384626433832795_dp real(dp) :: x, r1, r2, err x = 10.5_dp r1 = dsin(x) r2 = -0.87969575997167_dp err = abs(r1-r2) print *, x, r1, r2 print *, err if (err > 1e-15_dp) error stop contains real(dp) function abs(x) result(r) real(dp), intent(in) :: x if (x >= 0) then r = x else r = -x end if end function elemental integer function floor(x) result(r) real(dp), intent(in) :: x if (x >= 0) then r = x else r = x-1 end if end function elemental real(dp) function modulo(x, y) result(r) real(dp), intent(in) :: x, y r = x-floor(x/y)*y end function elemental real(dp) function min(x, y) result(r) real(dp), intent(in) :: x, y if (x < y) then r = x else r = y end if end function elemental real(dp) function max(x, y) result(r) real(dp), intent(in) :: x, y if (x > y) then r = x else r = y end if end function elemental real(dp) function dsin(x) result(r) real(dp), intent(in) :: x real(dp) :: y integer :: n y = modulo(x, 2*pi) y = min(y, pi - y) y = max(y, -pi - y) y = min(y, pi - y) r = kernel_dsin(y) end function ! Accurate on [-pi/2,pi/2] to about 1e-16 elemental real(dp) function kernel_dsin(x) result(res) real(dp), intent(in) :: x real(dp), parameter :: S1 = 0.9999999999999990771_dp real(dp), parameter :: S2 = -0.16666666666664811048_dp real(dp), parameter :: S3 = 8.333333333226519387e-3_dp real(dp), parameter :: S4 = -1.9841269813888534497e-4_dp real(dp), parameter :: S5 = 2.7557315514280769795e-6_dp real(dp), parameter :: S6 = -2.5051823583393710429e-8_dp real(dp), parameter :: S7 = 1.6046585911173017112e-10_dp real(dp), parameter :: S8 = -7.3572396558796051923e-13_dp real(dp) :: z z = x*x res = x * (S1+z*(S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))) end function end program lfortran-lfortran-2f73434/integration_tests/derived_types_07.f900000664000175000017500000000120215141516316025067 0ustar alastairalastairmodule derived_types_07_stdlib_logger type :: logger_type private logical :: add_blank_line = .false. integer, allocatable :: log_units(:) integer :: max_width = 0 contains private final :: final_logger end type logger_type contains subroutine final_logger( self ) type(logger_type), intent(in) :: self integer :: iostat character(256) :: message integer :: unit end subroutine end module program derived_types_05 implicit none end program lfortran-lfortran-2f73434/integration_tests/derived_types_84.f900000664000175000017500000000033215141516316025077 0ustar alastairalastairprogram derived_types_84 use derived_types_84_module implicit none type(Person) :: p1 p1%age = 25 call get_age(p1) print *, p1%age if (p1%age /= 30) error stop end program derived_types_84 lfortran-lfortran-2f73434/integration_tests/array_slice_01.f900000664000175000017500000000133715141516316024521 0ustar alastairalastairprogram array_slice_01 implicit none integer, target :: a(5, 6, 7, 19), sum_slice integer, pointer :: b(:, :), c(:) integer :: i, j, suma b => a(:, 3, 4:6, 17) a = 20 sum_slice = sum_array_slice(b) print *, sum_slice if( sum_slice /= 285 ) error stop do i = lbound(a, 1), ubound(a, 1) do j = 4, 6 if( a(i, 3, j, 17) /= 19 ) error stop end do end do suma = sum(a) print *, suma if( suma /= 79785 ) error stop contains function sum_array_slice(array) result(r) integer, intent(inout) :: array(:, :) integer :: i, j integer :: r r = 0 do i = lbound(array, 1), ubound(array, 1) do j = lbound(array, 2), ubound(array, 2) array(i, j) = 19 r = r + array(i, j) end do end do end function end program lfortran-lfortran-2f73434/integration_tests/subroutines_09.f900000664000175000017500000000273115141516316024615 0ustar alastairalastairmodule subroutines_09_tomlf_build_array implicit none private public :: get_value !> Getter functions to manipulate TOML arrays interface get_value module procedure :: get_elem_table module procedure :: get_elem_value_string end interface get_value contains subroutine get_elem_table(array, pos, ptr, stat) !> Instance of the TOML array integer, intent(inout) :: array !> Position in the array integer, intent(in) :: pos !> Pointer to child table integer, pointer, intent(out) :: ptr !> Status of operation logical, intent(out), optional :: stat nullify(ptr) stat = .true. end subroutine get_elem_table !> Retrieve TOML value as deferred-length character subroutine get_elem_value_string(array, pos, ptr, def, stat) !> Instance of the TOML array logical, intent(inout) :: array !> Position in the array integer, intent(in) :: pos !> Pointer to child table integer, pointer, intent(out) :: ptr !> Status of operation logical, intent(out), optional :: stat integer, intent(out), optional :: def nullify(ptr) stat = .true. end subroutine get_elem_value_string end module program main use subroutines_09_tomlf_build_array, only: get_value implicit none integer :: a = 10, pos integer, pointer :: ptr logical :: f = .false. call get_value(a, pos, ptr, stat=f) call get_value(f, pos, ptr, stat=f) end program main lfortran-lfortran-2f73434/integration_tests/allocate_01.f900000664000175000017500000000504315141516316024006 0ustar alastairalastairprogram allocate_01 implicit none integer, allocatable :: a(:), e(:) real, allocatable :: b(:, :), f(:, :) complex, allocatable :: c(:, :, :), g(:, :, :) integer :: d(5) = [1, 2, 3, 4, 5] complex :: r integer :: n, ierr integer :: i, j, k n = 10 allocate(e, mold=d) if (size(e) /= 5) error stop allocate(a, mold=e) if (size(a) /= 5) error stop deallocate(a) allocate(b(2, 3)) allocate(f, mold=b) if (size(f, 1) /= 2 .or. size(f, 2) /= 3) error stop deallocate(b) allocate(c(2, 3, 4)) allocate(g, mold=c) if (size(g, 1) /= 2 .or. size(g, 2) /= 3 .or. size(g, 3) /= 4) error stop deallocate(c) allocate(a(5:n + 5)) allocate(b(n:2*n, n:3*n), stat=ierr) if( size(a) /= n + 1 ) error stop if( size(b) /= (n + 1)*(2*n + 1) ) error stop do i = lbound(a, 1), ubound(a, 1) a(i) = i end do do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) b(i, j) = i + j end do end do call sum(a, b, c) if (lbound(c, 1) /= 5 .or. ubound(c, 1) /= n + 5) error stop if (lbound(c, 2) /= n .or. ubound(c, 2) /= 2 * n) error stop if (lbound(c, 3) /= n .or. ubound(c, 3) /= 3 * n) error stop do i = lbound(a, 1), ubound(a, 1) if (a(i) /= i) error stop end do do i = lbound(b, 1), ubound(b, 1) do j = lbound(b, 2), ubound(b, 2) if (b(i, j) /= i + j) error stop end do end do do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) if (c(i, j, k) /= i + j + k) error stop end do end do end do r = reduce_sum(c) if (r /= (114345.0, 0.0)) error stop contains subroutine sum(a, b, c) implicit none integer, allocatable, intent(in) :: a(:) real, allocatable, intent(in) :: b(:, :) complex, allocatable, intent(out) :: c(:, :, :) integer :: i, j, k complex, allocatable :: c_copy(:, :, :) allocate(c_copy(lbound(a, 1):ubound(a, 1), lbound(b, 1):ubound(b, 1), lbound(b, 2):ubound(b, 2))) allocate(c(lbound(a, 1):ubound(a, 1), lbound(b, 1):ubound(b, 1), lbound(b, 2):ubound(b, 2))) do i = lbound(a, 1), ubound(a, 1) do j = lbound(b, 1), ubound(b, 1) do k = lbound(b, 2), ubound(b, 2) c_copy(i, j, k) = a(i) + b(j, k) c(i, j, k) = a(i) + b(j, k) end do end do end do deallocate(c_copy) end subroutine sum complex function reduce_sum(c) result(r) implicit none complex, intent(in) :: c(:, :, :) integer :: i, j, k r = 0 do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) r = r + c(i, j, k) end do end do end do end function reduce_sum end lfortran-lfortran-2f73434/integration_tests/interface_14.f900000664000175000017500000000150215141516316024162 0ustar alastairalastairmodule interface_14_data implicit none public data_t type data_t integer :: x end type end module program interface_14 use interface_14_data, only: data_t implicit none integer :: x x = get_x_from_data(return_x_from_data) print *, x if (x /= 100) error stop contains function return_x_from_data(d) type(data_t), intent(inout) :: d integer :: return_x_from_data return_x_from_data = d%x end function function get_x_from_data(R) interface function R(d) use interface_14_data implicit none type(data_t), intent(inout) :: d integer :: R end function end interface integer :: get_x_from_data type(data_t) :: d d%x = 100 get_x_from_data = R(d) end function end program lfortran-lfortran-2f73434/integration_tests/array_08_transfer.f900000664000175000017500000000160115141516316025247 0ustar alastairalastairprogram array_08_transfer implicit none character(kind=1), dimension(5) :: chr_arr1 character(kind=1, len=2), dimension(5) :: chr_arr2 character(len=*), parameter :: rhs = "xyzw" character(kind=1), dimension(4) :: chr_arr3 !Check indexed assignment chr_arr1(2:5) = transfer(rhs, chr_arr1) print *, chr_arr1 print *, rhs if (chr_arr1(2) /= 'x' .or. chr_arr1(3) /= 'y' .or. & chr_arr1(4) /= 'z' .or. chr_arr1(5) /= 'w') error stop !Check multi-length assignment chr_arr2(1:2) = transfer(rhs, chr_arr2) print *, chr_arr2(1:2) print *, rhs if (chr_arr2(1) /= 'xy' .or. chr_arr2(2) /= 'zw') error stop !Check assignment to entire array chr_arr3 = transfer(rhs, chr_arr3) print *, chr_arr3 print *, rhs if (chr_arr3(1) /= 'x' .or. chr_arr3(2) /= 'y' .or. & chr_arr3(3) /= 'z' .or. chr_arr3(4) /= 'w') error stop end program array_08_transferlfortran-lfortran-2f73434/integration_tests/derived_types_97_mod1.f900000664000175000017500000000057015141516316026027 0ustar alastairalastairmodule derived_types_97_mod1 implicit none type :: point_t integer :: x integer :: y end type point_t interface point_t module procedure point_new end interface point_t contains type(point_t) function point_new() result(p) p%x = 0 p%y = 0 end function point_new end module derived_types_97_mod1 lfortran-lfortran-2f73434/integration_tests/intrinsics_384.f900000664000175000017500000000035015141516316024501 0ustar alastairalastairprogram intrinsics_384 implicit none integer, allocatable :: arr(:) allocate(arr(3)) arr = [1, 2, 3] print *, eoshift(arr, 1, 0) if (any(eoshift(arr, 1, 0) /= [2, 3, 0])) error stop end program intrinsics_384lfortran-lfortran-2f73434/integration_tests/parameter_07.f900000664000175000017500000000060315141516316024205 0ustar alastairalastairprogram parameter_07 integer, parameter :: n = 2 complex :: sum real, parameter :: d(3 : n+3) = [2.48574089138753566e-5,1.05142378581721974, -3.45687097222016235] print *, d(3) if (abs(d(3) - 2.48574089138753566e-5) > 1e-6) error stop print *, d(4) if (abs(d(4) - 1.05142378581721974) > 1e-6) error stop print *, d(5) if (abs(d(5) + 3.45687097222016235) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/template_04.f900000664000175000017500000003646215141516316024051 0ustar alastairalastairmodule template_04_semigroup implicit none private public :: semigroup, extended_semigroup, derive_extended_semigroup requirement semigroup(T, combine) type, deferred :: T elemental function combine(x, y) result(combined) type(T), intent(in) :: x, y type(T) :: combined end function end requirement requirement extended_semigroup(T, combine, sconcat, stimes) require :: semigroup(T, combine) pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) !! Must contain at least one element type(T) :: combined end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated end function end requirement template derive_extended_semigroup(T, combine) require :: semigroup(T, combine) private public :: sconcat, stimes contains pure function sconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else error stop "Attempted to sconcat empty list" end if end function elemental function stimes(n, a) result(repeated) integer, intent(in) :: n type(T), intent(in) :: a type(T) :: repeated integer :: i if (n < 1) error stop "n must be > 0" repeated = a do i = 2, n repeated = combine(repeated, a) end do end function end template end module module template_04_monoid use template_04_semigroup, only: semigroup, extended_semigroup, derive_extended_semigroup implicit none private public :: monoid, extended_monoid, derive_extended_monoid requirement monoid(T, combine, empty) require :: semigroup(T, combine) pure function empty() type(T) :: empty end function end requirement requirement extended_monoid(T, combine, sconcat, stimes, empty, mconcat) require :: extended_semigroup(T, combine, sconcat, stimes) require :: monoid(T, combine, empty) pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined end function end requirement template derive_extended_monoid(T, combine, empty) require :: monoid(T, combine, empty) private public :: stimes, mconcat instantiate derive_extended_semigroup(T, combine), only: stimes => stimes contains pure function mconcat(list) result(combined) type(T), intent(in) :: list(:) type(T) :: combined integer :: i if (size(list) > 0) then combined = list(1) do i = 2, size(list) combined = combine(combined, list(i)) end do else combined = empty() end if end function end template end module module template_04_semiring use template_04_monoid, only: monoid implicit none private public :: semiring requirement semiring(T, plus, zero, mult, one) require :: monoid(T, plus, zero) require :: monoid(T, mult, one) end requirement end module module template_04_unitring use template_04_semiring implicit none public :: & unit_ring_only_minus, & unit_ring_only_negate, & unit_ring, & derive_unit_ring_from_minus, & derive_unit_ring_from_negate requirement unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: semiring(T, plus, zero, mult, one) elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference end function end requirement requirement unit_ring_only_negate(T, plus, zero, mult, one, negate) require :: semiring(T, plus, zero, mult, one) elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated end function end requirement requirement unit_ring(T, plus, zero, mult, one, minus, negate) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) end requirement template derive_unit_ring_from_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) private public :: negate contains elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated negated = minus(zero(), x) end function end template template derive_unit_ring_from_negate(T, plus, zero, mult, one, negate) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) private public :: minus contains elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference difference = plus(x, negate(y)) end function end template end module module template_04_field !! field is a unit_ring that also has a division or inverse operation use template_04_unitring, only: unit_ring implicit none private public :: & field_only_division, & field_only_inverse, & field, & derive_field_from_division, & derive_field_from_inverse requirement field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function divide(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient end function end requirement requirement field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: unit_ring(T, plus, zero, mult, one, minus, negate) elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse end function end requirement requirement field(T, plus, zero, mult, one, minus, negate, divide, invert) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) end requirement template derive_field_from_division(T, plus, zero, mult, one, minus, negate, divide) require :: field_only_division(T, plus, zero, mult, one, minus, negate, divide) private public :: invert contains elemental function invert(x) result(inverse) type(T), intent(in) :: x type(T) :: inverse inverse = divide(one(), x) end function end template template derive_field_from_inverse(T, plus, zero, mult, one, minus, negate, invert) require :: field_only_inverse(T, plus, zero, mult, one, minus, negate, invert) private public :: divide contains elemental function divide_(x, y) result(quotient) type(T), intent(in) :: x, y type(T) :: quotient quotient = mult(x, invert(y)) end function end template end module module template_04_matrix use template_04_monoid, only: derive_extended_monoid use template_04_semiring, only: semiring use template_04_unitring, only: unit_ring_only_minus, derive_unit_ring_from_minus use template_04_field, only: field_only_division implicit none private public :: matrix_tmpl template matrix_tmpl(T, plus_t, zero_t, times_t, one_t, n) require :: semiring(T, plus_t, zero_t, times_t, one_t) integer :: n private public :: & matrix, & plus_matrix, & times_matrix, & zero, & one, & matrix_subtraction_tmpl type :: matrix type(T) :: elements(n, n) end type interface operator(+) procedure :: plus_matrix end interface interface operator(*) procedure times_matrix end interface template matrix_subtraction_t(minus_t) require :: unit_ring_only_minus(T, plus_t, zero_t, times_t, one_t, minus_t) private public :: minus_matrix, gaussian_solver_tmpl interface operator(-) procedure minus_matrix end interface template gaussian_solver_tmpl(div_t) instantiate derive_unit_ring_from_minus(T, plus_t, zero_t, times_t, one_t, minus_t), only: negate require :: field_only_division(T, plus_t, zero_t, times_t, one_t, minus_t, negate, div_t) contains pure function row_eschelon(x) result(reduced) type(matrix), intent(in) :: x type(matrix) :: reduced integer :: i, ii, j type(T) :: r reduced = x do i = 1, n ! Assume pivot m(i,i) is not zero do ii = i+1, n r = div_t(reduced%elements(i,i), reduced%elements(ii,i)) reduced%elements(ii, i) = zero_t() do j = i+1, n reduced%elements(ii, j) = minus_t(reduced%elements(ii, j), times_t(reduced%elements(i, j), r)) end do end do end do end function pure function back_substitute(x, y) result(solved) type(matrix), intent(in) :: x, y type(matrix) :: solved integer :: i, j type(T) :: tmp(n) solved = y do i = n, 1, -1 tmp = zero_t() do j = i+1, n tmp = plus_t(tmp, times_t(x%elements(i,j), solved%elements(:,j))) end do solved%elements(:,i) = div_t(minus_t(solved%elements(:,i), tmp), x%elements(i,i)) end do end function elemental function div_matrix(x, y) result(quotient) type(matrix), intent(in) :: x, y type(matrix) :: quotient quotient = back_substitute(row_eschelon(x), y) end function end template contains elemental function minus_matrix(x, y) result(difference) type(matrix), intent(in) :: x, y type(matrix) :: difference difference%elements = minus_t(x%elements, y%elements) end function end template contains elemental function plus_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j ! TODO: something wrong with elemental function operations ! combined%elements = plus_t(x%elements, y%elements) do i = 1, n do j = 1, n combined%elements(i,j) = plus_t(x%elements(i,j), y%elements(i,j)) end do end do end function pure function zero() type(matrix) :: zero zero%elements = zero_t() end function elemental function times_matrix(x, y) result(combined) type(matrix), intent(in) :: x, y type(matrix) :: combined integer :: i, j, k type(T) :: dot do i = 1, n do j = 1, n ! TODO: something wrong with elemental function operations ! combined%elements(i, j) = sum(times_t(x%elements(i,:), y%elements(:,j))) dot = zero_t() do k = 1, n dot = plus_t(dot, times_t(x%elements(i,k), y%elements(k,j))) end do combined%elements(i, j) = dot end do end do end function pure function one() type(matrix) :: one integer :: i one%elements = zero_t() do concurrent (i = 1:n) one%elements(i, i) = one_t() end do end function end template end module module template_04_func implicit none private public :: zero_integer, zero_real, one_integer, one_real contains pure function zero_integer() result(z) integer :: z z = 0 end function pure function one_integer() result(z) integer :: z z = 1 end function pure function zero_real() result(z) real :: z z = 0 end function pure function one_real() result(z) real :: z z = 1 end function end module program template_04 use template_04_matrix use template_04_func integer, parameter :: n = 2 instantiate matrix_tmpl(integer, operator(+), zero_integer, operator(*), one_integer, n), & only: integer_matrix => matrix, & integer_plus_matrix => plus_matrix, & integer_times_matrix => times_matrix, & integer_matrix_subtraction_t => matrix_subtraction_t instantiate integer_matrix_subtraction_t(operator(-)), & only: integer_minus_matrix => minus_matrix, & integer_gaussian_solver_tmpl => gaussian_solver_tmpl instantiate integer_gaussian_solver_tmpl(operator(/)), & only: integer_div_matrix => div_matrix type(integer_matrix) :: m1, m2, m3, m4 m1%elements(1,1) = 1 m1%elements(1,2) = 0 m1%elements(2,1) = 0 m1%elements(2,2) = 1 m2%elements(1,1) = 1 m2%elements(1,2) = 2 m2%elements(2,1) = 2 m2%elements(2,2) = 1 m3 = integer_plus_matrix(m1, m2) print *, m3%elements(1,1), m3%elements(1,2) print *, m3%elements(2,1), m3%elements(2,2), achar(10) m4 = integer_times_matrix(m3, m2) print *, m4%elements(1,1), m4%elements(1,2) print *, m4%elements(2,1), m4%elements(2,2), achar(10) instantiate matrix_tmpl(real, operator(+), zero_real, operator(*), one_real, n), & only: real_matrix => matrix, & real_plus_matrix => plus_matrix, & real_times_matrix => times_matrix, & real_matrix_subtraction_t => matrix_subtraction_t instantiate real_matrix_subtraction_t(operator(-)), & only: real_minus_matrix => minus_matrix, & real_gaussian_solver_tmpl => gaussian_solver_tmpl instantiate real_gaussian_solver_tmpl(operator(/)), & only: real_div_matrix => div_matrix type(real_matrix) :: r1, r2, r3, r4 r1%elements(1,1) = 1.2 r1%elements(1,2) = 0 r1%elements(2,1) = 0 r1%elements(2,2) = 1 r2%elements(1,1) = 1 r2%elements(1,2) = 2.5 r2%elements(2,1) = 2 r2%elements(2,2) = 1 r3 = real_plus_matrix(r1, r2) print *, r3%elements(1,1), r3%elements(1,2) print *, r3%elements(2,1), r3%elements(2,2), achar(10) r4 = real_times_matrix(r3, r2) print *, r4%elements(1,1), r4%elements(1,2) print *, r4%elements(2,1), r4%elements(2,2), achar(10) end programlfortran-lfortran-2f73434/integration_tests/arrays_reshape_18.f900000664000175000017500000000072515141516316025244 0ustar alastairalastairprogram arrays_reshape_18 integer :: A(2,2) integer :: B(2,2) A = reshape(source = [1,2,2,1], shape = shape(A)) print *, A(1,1), A(1,2), A(2,1), A(2,2) if (A(1,1) /= 1) error stop if (A(1,2) /= 2) error stop if (A(2,1) /= 2) error stop if (A(2,2) /= 1) error stop B = reshape([1,2,2,1], shape = shape(B)) print *, B(1,1), B(1,2), B(2,1), B(2,2) if (B(1,1) /= 1) error stop if (B(1,2) /= 2) error stop if (B(2,1) /= 2) error stop if (B(2,2) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_29b.f900000664000175000017500000000051215141516316026574 0ustar alastairalastairmodule separate_compilation_29b_module implicit none type :: t integer :: x end type t type(t) :: targets contains subroutine sb() targets%x = 2 end subroutine sb integer function get_b() get_b = targets%x end function get_b end module separate_compilation_29b_module lfortran-lfortran-2f73434/integration_tests/modules_31_module2.f900000664000175000017500000000142715141516316025326 0ustar alastairalastairmodule fpm_cmd_update_modules_31 use fpm_dependency_modules_31, only : dependency_tree_t, error_t implicit none type, abstract :: fpm_cmd_settings character(len=:), allocatable :: working_dir logical :: verbose=.true. end type type, extends(fpm_cmd_settings) :: fpm_update_settings character(len=5), allocatable :: name(:) logical :: fetch_only logical :: clean end type contains subroutine cmd_update(settings) type(fpm_update_settings), intent(in) :: settings type(dependency_tree_t) :: deps type(error_t), allocatable :: error integer :: ii call deps%update(deps%dep(ii)%name, error) end subroutine cmd_update end module fpm_cmd_update_modules_31 lfortran-lfortran-2f73434/integration_tests/where_01.f900000664000175000017500000000074715141516316023342 0ustar alastairalastairprogram where_01 implicit none integer :: a(10), b(10), i a = -2 a(1) = 1 a(5) = 8 b = -3 where (a >= 0) b = 1 else where b = 0 end where where (a >= 0) b = 1 elsewhere b = 0 end where where (a >= 0) b = 1 elsewhere b = 0 endwhere if (abs(b(1) - 1) > 1e-6) error stop if (abs(b(5) - 1) > 1e-6) error stop do i = 2, 4 if (abs(b(i) - 0) > 1e-6) error stop end do do i = 6, 10 if (abs(b(i) - 0) > 1e-6) error stop end do print *, b print *, a end program lfortran-lfortran-2f73434/integration_tests/read_15.f900000664000175000017500000000101015141516316023130 0ustar alastairalastairprogram read_15 implicit none integer :: u, x character(len=*), parameter :: fname = "read_15_tmp.txt" open(newunit=u, file=fname, status="replace", action="write") write(u, *) 1 close(u) open(newunit=u, file=fname, status="old", action="read") read(u, *, end=10) x if (x /= 1) then print *, "FAIL" error stop end if read(u, *, end=10) x print *, "FAIL" error stop 10 continue print *, "PASS" close(u, status="delete") end program read_15 lfortran-lfortran-2f73434/integration_tests/c_ptr_04.f900000664000175000017500000000130115141516316023325 0ustar alastairalastairmodule mod_uop contains subroutine uop( sendbuf) use iso_c_binding, only: c_loc, c_ptr, c_null_ptr, c_associated real(8), dimension(:), intent(in), target :: sendbuf type(c_ptr) :: c_send c_send = c_null_ptr c_send = c_loc(sendbuf) print *, 'C pointer: ', c_send if (.not. c_associated(c_send)) then error stop 'Error: c_send is null' end if end subroutine end module mod_uop program c_ptr_04 use mod_uop use iso_c_binding, only: c_loc,c_ptr real(8) :: vin(65000) ! type(c_ptr) :: c_send call uop(vin) ! c_send = c_loc(vin) ! print *, 'C pointer: ', c_send end program c_ptr_04lfortran-lfortran-2f73434/integration_tests/lbound_01.f900000664000175000017500000000023615141516316023504 0ustar alastairalastairprogram lbound_01 integer(8) :: x(2) integer(8) :: res(1) res = lbound(x, kind = 8) print *, res if (res(1) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_190.f900000664000175000017500000000034115141516316024474 0ustar alastairalastairprogram intrinsics_190 implicit none integer :: res(1) print *, kind([real:: 1]) ! this line is necessary to assure it works res = kind([real:: 1]) print *, res if (res(1) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_152.f900000664000175000017500000000543015141516316024476 0ustar alastairalastairprogram intrinsics_152 implicit none integer :: k1= 5 integer :: k2= 5_4 integer :: k3= 58_8 integer :: k4= 8 integer :: k5 = 9 integer :: k6 = 2 integer :: m90_quad integer :: m90_dble integer, parameter :: sp = selected_real_kind(6,37) integer, parameter :: dp = selected_real_kind(15,307) print*, sp if (sp /= 4) error stop print*, dp if (dp /= 8) error stop print*, selected_real_kind() if (selected_real_kind() /= 4) error stop print*, selected_real_kind(1, 5) if (selected_real_kind(1, 5) /= 4) error stop print*, selected_real_kind(3, 32) if (selected_real_kind(3, 32) /= 4) error stop print*, selected_real_kind(5, 39) if (selected_real_kind(5, 39) /= 8) error stop print*, selected_real_kind(6, 51) if (selected_real_kind(6, 51) /= 8) error stop print*, selected_real_kind(7, 2) if (selected_real_kind(7, 2) /= 8) error stop print*, selected_real_kind(9, 1) if (selected_real_kind(9, 1) /= 8) error stop print*, selected_real_kind(12, 33) if (selected_real_kind(12, 33) /= 8) error stop print*, selected_real_kind(14, 32) if (selected_real_kind(14, 32) /= 8) error stop print*, selected_real_kind(7, 38, 2) if (selected_real_kind(7, 38, 2) /= 8) error stop print*, selected_real_kind(8, 38, 3) if (selected_real_kind(8, 38, 3) /= -5) error stop print*, selected_real_kind(9, 38, 2) if (selected_real_kind(9, 39, 2) /= 8) error stop print*, selected_real_kind(16, 37) ! output form lfortran is 8 whereas gfortran is 10 print*, selected_real_kind(17, 37) ! output form lfortran is 8 whereas gfortran is 10 print*, selected_real_kind(k1) if (selected_real_kind(k1) /= 4) error stop print*, selected_real_kind(k2) if (selected_real_kind(k2) /= 4) error stop print*, selected_real_kind(k1, k3) if (selected_real_kind(k1, k3) /= 8) error stop print*, selected_real_kind(k5, k4) if (selected_real_kind(k5, k4) /= 8) error stop print*, selected_real_kind(k1, k5) if (selected_real_kind(k1, k5) /= 4) error stop print*, selected_real_kind(k5, k2, k6) if (selected_real_kind(k5, k2, k6) /= 8) error stop print*, selected_real_kind(k5, k2, 3) if (selected_real_kind(k5, k2, 3) /= -5) error stop print*, selected_real_kind(34) if (selected_real_kind(34) /= -1) error stop print*, selected_real_kind(50,10,2) if (selected_real_kind(50,10,2) /= -1) error stop print*, selected_real_kind(45,16) if (selected_real_kind(50,10,2) /= -1) error stop m90_quad = selected_real_kind(p=digits(1.d0)+1) print*, m90_quad if (m90_quad /= -1) error stop m90_dble = selected_real_kind(15, 307) print *, m90_dble print*, max(selected_real_kind(r = range(1.d0)+1), m90_dble) end program lfortran-lfortran-2f73434/integration_tests/arrays_intrin_02.f900000664000175000017500000000171315141516316025107 0ustar alastairalastairprogram arrays_intrin_02 logical l1(3), l2(3), l3(3) integer m1(2,3), m2(2,3) l1 = [.true., .true., .true.] l2 = [.true., .true., .false.] l3 = [.false., .false., .false.] if (.not. all(l1)) error stop if (all(l2)) error stop if (all(l3)) error stop if (.not. any(l1)) error stop if (.not. any(l2)) error stop if (any(l3)) error stop m1 = 1 m2 = 1 m2(1,2) = 2 m2(2,2) = 2 call matrixCheck(m1, m2) contains subroutine matrixCheck(m1, m2) integer, intent(in) :: m1(2,3), m2(2,3) if (all(m1 == m2)) error stop if (.not. all(all(m1 == m2, 1) .eqv. [.true., .false., .true.])) error stop if (.not. all(all(m1 == m2, 2) .eqv. [.false., .false.])) error stop if (.not. any(m1 == m2)) error stop if (.not. all(any(m1 == m2, 1) .eqv. [.true., .false., .true.])) error stop if (.not. all(any(m1 == m2, 2) .eqv. [.true., .true.])) error stop end subroutine matrixCheck end program arrays_intrin_02lfortran-lfortran-2f73434/integration_tests/passing_array_05.f900000664000175000017500000000106615141516316025071 0ustar alastairalastairprogram test_arrays implicit none real :: a(10, 20, 30) call pass_array(a) print *, "Test passed" contains subroutine pass_array(arr) real :: arr(10, 20, *) call recv_array(arr(1:10, 1:20, 1)) end subroutine pass_array subroutine recv_array(x) real :: x(:, :) integer :: ub1, ub2 ub1 = ubound(x, 1) ub2 = ubound(x, 2) if (ub1 /= size(x,1)) stop "ubound dim 1 failed" if (ub2 /= size(x,2)) stop "ubound dim 2 failed" end subroutine recv_array end program test_arrayslfortran-lfortran-2f73434/integration_tests/string_80.f900000664000175000017500000000061415141516316023536 0ustar alastairalastairmodule string_80_mod integer :: i = 10 end module program string_80 use string_80_mod call ff(10) call ff(3) contains subroutine ff(expected_len) integer, intent(in) :: expected_len character(i), allocatable :: cc i = 3 cc = "as" print *, len(cc) if(len(cc) /= expected_len) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/modules_08.f900000664000175000017500000000023415141516316023676 0ustar alastairalastairprogram modules_08 use modules_08_a, only: a use modules_08_b, only: b implicit none if (a() /= 3) error stop if (b() /= 9) error stop print *, "OK" end lfortran-lfortran-2f73434/integration_tests/file_27.f900000664000175000017500000000400415141516316023145 0ustar alastairalastairprogram file_27 implicit none integer :: unit_num, unit_num2, unit_num3, unit_num4, unit_num5 integer :: stat character(len=200) :: iomsg logical :: is_lfortran = .true. character(len=:), allocatable :: iomsg2 #ifdef __GFORTRAN__ is_lfortran = .false. #endif open(newunit=unit_num, file='data2.txt', status='old', iostat=stat, iomsg=iomsg) write(unit_num, *) "HI" if (stat /= 2) error stop if (is_lfortran) then if (trim(iomsg) /= "File `data2.txt` does not exists! Cannot open a file with the `status=old`") error stop end if close(unit_num) ! TODO: Support same file opening twice (Issue #6904) ! open(newunit=unit_num2, file='data2.txt', status='new', iostat=stat, iomsg=iomsg) ! if (stat /= 0) error stop ! open(newunit=unit_num2, file='data2.txt', status='new', iostat=stat, iomsg=iomsg) ! if (stat /= 17) error stop ! if (is_lfortran) then ! if (trim(iomsg) /= "File `data2.txt` exists! Cannot open a file with the `status=new`") error stop ! end if ! close(unit_num2, status="delete") open(newunit=unit_num3, file='data3.txt', status='temp', iostat=stat, iomsg=iomsg) write(unit_num3, *) "HI" if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "STATUS specifier in OPEN statement has invalid value.") error stop end if close(unit_num3) open(newunit=unit_num4, file='data4.txt', status='new', form="temp", iostat=stat, iomsg=iomsg) if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "FORM specifier in OPEN statement has invalid value.") error stop end if close(unit_num4) open(newunit=unit_num5, file='data5.txt', status='new', access="temp", iostat=stat, iomsg=iomsg) if (stat /= 5002) error stop if (is_lfortran) then if (trim(iomsg) /= "ACCESS specifier in OPEN statement has invalid value.") error stop end if close(unit_num5) print *, len(iomsg) if (len(iomsg) /= 200) error stop end programlfortran-lfortran-2f73434/integration_tests/doloop_01.f900000664000175000017500000000223315141516316023514 0ustar alastairalastairprogram doloop_01 implicit none integer :: i, j j = 0 do i = 1, 10 j = j + i end do if (j /= 55) error stop print *, j j = 0 do i = 10, 1, -1 j = j + i end do if (j /= 55) error stop print *, j j = 0 do i = 1, 9, 2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 9, 1, -2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 1, 10, 2 j = j + i end do if (j /= 25) error stop print *, j j = 0 do i = 1, 10, 3 j = j + i end do if (j /= 22) error stop print *, j j = 0 do i = 10, 1, -3 j = j + i end do if (j /= 22) error stop print *, j j = 0 do i = 1, 1 j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 1, -1 j = j + i end do if (j /= 1) error stop print *, j j = 0 do i = 1, 0 j = j + i end do if (j /= 0) error stop print *, j j = 0 do i = 0, 1, -1 j = j + i end do if (j /= 0) error stop print *, j end lfortran-lfortran-2f73434/integration_tests/functions_14.f900000664000175000017500000000023215141516316024231 0ustar alastairalastairsubroutine find_fit(expr) interface integer function expr() end function end interface end subroutine program functions_14 end program lfortran-lfortran-2f73434/integration_tests/arrays_67.f900000664000175000017500000000041415141516316023534 0ustar alastairalastairprogram arrays_67 integer :: A(4) = [1,2,3,4] call temp(A) print *, A if (A(1) /= 5) error stop if (A(2) /= 5) error stop contains subroutine temp(A) integer, intent(inout) :: A(:) A([1,2]) = [5,5] end subroutine end programlfortran-lfortran-2f73434/integration_tests/arrays_98.f900000664000175000017500000000135115141516316023541 0ustar alastairalastairmodule arrays_98_mod character(*), parameter :: hello = "HELLO" character(*), parameter :: bye = "BYE" contains logical function ff(lhs) character(*), dimension(:), intent(in) :: lhs ff = ff2(lhs) end function ff logical function ff2(lhs) character(len=*), dimension(:), intent(in) :: lhs ff2 = all(lhs==hello) end function ff2 end module program arrays_98 use arrays_98_mod character(5) :: arr(20) arr = hello call ss(arr,.true.) arr = bye call ss(arr, .false.) contains subroutine ss(s, expected) character(*) :: s(:) logical :: expected if ( expected .neqv. ff(arr) ) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_11.f900000664000175000017500000000160115141516316026443 0ustar alastairalastairmodule operator_overloading_11_module_1 implicit none type :: t end type interface operator(/=) module procedure ne end interface contains logical function ne(x, y) type(t), intent(in) :: x, y print *, "t::ne" ne = .false. end function end module operator_overloading_11_module_1 module operator_overloading_11_module_2 use operator_overloading_11_module_1, only: t, operator(/=) type :: u type(t) :: x end type interface operator(/=) module procedure une end interface contains logical function une(a, b) type(u), intent(in) :: a, b print *, "u::une" une = .false. end function end module operator_overloading_11_module_2 program main use operator_overloading_11_module_2 implicit none type(t) :: x type(u) :: y if (x /= x) error stop if (y /= y) error stop end program main lfortran-lfortran-2f73434/integration_tests/select_type_01.f900000664000175000017500000000160215141516316024537 0ustar alastairalastairprogram select_type_01 implicit none type base integer::i end type type, extends(base)::child integer::j end type class(base), pointer :: bptr type(base), target :: base_target = base(10) type(child), target :: child_target child_target = child(20, 30) print *, base_target%i print *, child_target%i, child_target%j bptr => child_target call perform_select_type(bptr) bptr => base_target call perform_select_type(bptr) contains subroutine perform_select_type(bptr) class(base), pointer :: bptr select type(bptr) type is (base) print *, "base type: component value: ", bptr%i if( bptr%i /= 10 ) error stop type is (child) print *, "child type: component values: ", bptr%i, bptr%j if( bptr%i /= 20 ) error stop if( bptr%j /= 30 ) error stop end select end subroutine end program select_type_01 lfortran-lfortran-2f73434/integration_tests/arrays_intrin_05.f900000664000175000017500000000243015141516316025107 0ustar alastairalastairprogram arrays_intrin_05 integer :: i, j integer(8) :: x(3, 5), xminval, xminval1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = [2_8, 3_8, 4_8, 5_8, 6_8] correct2 = [3_8, 3_8, 5_8, 5_8, 7_8] do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do print *, x xminval = minval(x) print *, xminval if( xminval /= 2_8 ) error stop xminval = minval(x, mask=modx) print *, xminval if( xminval /= 3_8 ) error stop xminval1 = minval(x, 1) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct1(i) ) error stop end do xminval1 = minval(x, 1, mask=modx) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct2(i) ) error stop end do xminval1 = minval(x, dim=1) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct1(i) ) error stop end do xminval1 = minval(x, dim=1, mask=modx) print *, xminval1 do i = lbound(xminval1, 1), ubound(xminval1, 1) if( xminval1(i) /= correct2(i) ) error stop end do end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_23.f900000664000175000017500000000014215141516316026423 0ustar alastairalastairprogram separate_compilation_23 use ansi_separate_compilation_23 implicit none end programlfortran-lfortran-2f73434/integration_tests/class_79.f900000664000175000017500000000136615141516316023352 0ustar alastairalastairmodule class_79_mod type, abstract :: class_value character(len=:), allocatable :: value end type type, extends(class_value) :: temp_type character(len=:), allocatable :: dir class(class_value), pointer :: cwd_ptr end type contains function cast_to_keyval(ptr) result(kval) class(class_value), intent(in), target :: ptr type(temp_type), pointer :: kval nullify(kval) select type(ptr) type is (temp_type) kval => ptr end select end function cast_to_keyval end module program class_79 use class_79_mod class(temp_type), pointer :: t class(class_value), allocatable :: p allocate(temp_type :: p) p%value = "Hello" t => cast_to_keyval(p) if (t%value /= "Hello") error stop end program class_79lfortran-lfortran-2f73434/integration_tests/intrinsics_195.f900000664000175000017500000000155415141516316024510 0ustar alastairalastair!> the below test cases test the broadcasting of "max" intrinsic !> procedure during compile time program intrinsics_195 integer :: arr3(3), arr2(2) arr3 = max([-1, 2, 3], 2, 5, [4, 4, 5], [5, -8, 7]) if (arr3(1) /= 5) error stop if (arr3(2) /= 5) error stop if (arr3(3) /= 7) error stop ! not necessary to test the dimensions though ! as the initial assignment itself would raise an ! error if the assignment was incompatible if (size(arr3) /= 3) error stop arr3 = max(1, [-1, 2, 20]) if (arr3(1) /= 1) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 20) error stop arr3 = max([1, 2, 3], [1, 1, [2]]) if (arr3(1) /= 1) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 3) error stop arr2 = max([1, 2], -1, -4) if (arr2(1) /= 1) error stop if (arr2(2) /= 2) error stop end program lfortran-lfortran-2f73434/integration_tests/test_ieee_rint.f900000664000175000017500000000406115141516316024723 0ustar alastairalastair! Test ieee_rint function program test_ieee_rint use, intrinsic :: ieee_arithmetic use, intrinsic :: iso_fortran_env, only: real32, real64 implicit none real(real32) :: x_sp, r_sp real(real64) :: x_dp, r_dp print *, "Testing ieee_rint..." ! Test 1: Round 2.3 (should round to 2.0 with round-to-nearest) x_sp = 2.3_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.3) = ", r_sp if (abs(r_sp - 2.0_real32) > 1.0e-6) error stop "2.3 should round to 2.0" ! Test 2: Round 2.7 (should round to 3.0) x_sp = 2.7_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.7) = ", r_sp if (abs(r_sp - 3.0_real32) > 1.0e-6) error stop "2.7 should round to 3.0" ! Test 3: Round 2.5 (should round to 2.0 - round to even) x_sp = 2.5_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(2.5) = ", r_sp if (abs(r_sp - 2.0_real32) > 1.0e-6) error stop "2.5 should round to 2.0 (nearest even)" ! Test 4: Round 3.5 (should round to 4.0 - round to even) x_sp = 3.5_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(3.5) = ", r_sp if (abs(r_sp - 4.0_real32) > 1.0e-6) error stop "3.5 should round to 4.0 (nearest even)" ! Test 5: Negative numbers x_sp = -2.7_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(-2.7) = ", r_sp if (abs(r_sp - (-3.0_real32)) > 1.0e-6) error stop "-2.7 should round to -3.0" ! Test 6: Already integer x_sp = 5.0_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(5.0) = ", r_sp if (abs(r_sp - 5.0_real32) > 1.0e-6) error stop "5.0 should remain 5.0" ! Test 7: Double precision x_dp = 7.6_real64 r_dp = ieee_rint(x_dp) print *, "ieee_rint(7.6d0) = ", r_dp if (abs(r_dp - 8.0_real64) > 1.0e-10) error stop "7.6d0 should round to 8.0d0" ! Test 8: Zero x_sp = 0.0_real32 r_sp = ieee_rint(x_sp) print *, "ieee_rint(0.0) = ", r_sp if (r_sp /= 0.0_real32) error stop "0.0 should remain 0.0" print *, "All ieee_rint tests passed!" end program test_ieee_rint lfortran-lfortran-2f73434/integration_tests/test_ieee_arithmetic_02.f900000664000175000017500000000033315141516316026377 0ustar alastairalastairprogram test_ieee_arithmetic_02 use , intrinsic:: ieee_arithmetic integer , parameter:: dp = kind(1d0) real:: expected = 1/3.0 if (abs(1/3.0_dp - expected) > 1e-6) error stop end program test_ieee_arithmetic_02 lfortran-lfortran-2f73434/integration_tests/arrays_76.f900000664000175000017500000000051615141516316023537 0ustar alastairalastairprogram array_76 integer :: i integer :: arr(10) integer :: arr_indecies(10) integer,allocatable :: arr_res(:) allocate(arr_res(11)) do i =1,10 arr(i) = i arr_indecies(i) = i end do arr_res = [arr(arr_indecies),11] print *, arr_res do i = 1 , 11 if (arr_res(i) /= i) error stop end do end program lfortran-lfortran-2f73434/integration_tests/functions_11.f900000664000175000017500000000076715141516316024243 0ustar alastairalastairprogram functions_11 implicit none real :: x=5, y real :: p=5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q contains double precision function f(a) result(b) real, intent(in) :: a real :: x x = 2 b = a + f_real(0.0) end function double precision function f_real(a) result(b) real, intent(in) :: a if( a == 0.0 ) then b = 2.0 else b = a + f(1.0) end if end function end program lfortran-lfortran-2f73434/integration_tests/intrinsics_28.f900000664000175000017500000000054015141516316024415 0ustar alastairalastairprogram debug implicit none integer, parameter :: a = 10, b = -20, c = 30 integer, parameter :: d = -40, e = 0, f = 50 if (min(a, b, c, d, e, f) /= -40) error stop if (max(a, b, c, d, e, f) /= 50) error stop if (max(a, b) /= 10) error stop if (min(a, b) /= -20) error stop if (max(a, b, c) /= 30) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_04.f900000664000175000017500000000074215141516316024012 0ustar alastairalastairprogram allocate_04 implicit none integer, allocatable :: c(:, :, :) character(len=:), allocatable :: string character(len=:), allocatable :: message character(len=20) :: num allocate(character(len=8)::string) allocate(character(len=20)::message) allocate(c(3, 3, 3)) num = "lfortran" string = trim(num) if (string /= "lfortran") error stop num = "lfortran working" message = num(1:len_trim(num)+1) print *, message end program lfortran-lfortran-2f73434/integration_tests/openmp_49.f900000664000175000017500000000045115141516316023532 0ustar alastairalastairprogram openmp_49 use omp_lib implicit none call omp_set_num_threads(8) !$omp parallel !$omp master print *, "Welcome to Master Thread!" if(omp_get_thread_num() /= 0) error stop !$omp end master !$omp end parallel end program openmp_49lfortran-lfortran-2f73434/integration_tests/intrinsics_245.f900000664000175000017500000000100115141516316024467 0ustar alastairalastairprogram intrinsics_245 implicit none complex :: complex_arg, result complex_arg = cmplx(real(1.0, kind=4), 0.0) result = cmplx(complex_arg, kind = 8) print *, result if (result /= (1.0, 0.0)) error stop print *, cmplx(real(1, kind=4), 0.00000000, kind=8) if (cmplx(real(1, kind=4), 0.00000000, kind=8) /= (1.0, 0.0)) error stop print *, cmplx(1.00000000, real(0, kind=4), kind=8) if (cmplx(1.00000000, real(0, kind=4), kind=8) /= (1.0, 0.0)) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_46.f900000664000175000017500000000103715141516316023533 0ustar alastairalastairmodule module_arrays_46 integer :: nx = 4 integer :: ny = 4 end module module_arrays_46 subroutine a(cs) use module_arrays_46 real, dimension(nx), intent(in) :: cs print *, cs if (abs(sum(cs) - 10.0) > 1e-8) error stop end subroutine subroutine b(cs) use module_arrays_46 real, dimension(nx, ny), intent(in) :: cs print *, sum(cs) if (abs(sum(cs) - 205.919983) > 1e-8) error stop end subroutine program arrays_46 real, dimension(4) :: cs real, dimension(4, 4) :: cs2 cs = [1.0, 2.0, 3.0, 4.0] cs2 = 12.87 call a(cs) call b(cs2) end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_25.f900000664000175000017500000000370315141516316026063 0ustar alastairalastair! Test passing procedure variables through implicit interface call chains ! This verifies that Function argument type info propagates to implicit ! interface parameters, enabling correct codegen without bitcast workarounds. program implicit_interface_25 implicit none real(8) :: result, expected ! Test 1: Pass a function through an implicit interface call chain expected = 25.0d0 call test_procedure_pass(square_fn, 5.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 1 failed" ! Test 2: Different function, same interface expected = 8.0d0 call test_procedure_pass(double_fn, 4.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 2 failed" ! Test 3: Chain through two implicit interface levels expected = 49.0d0 call outer_chain(square_fn, 7.0d0, result) if (abs(result - expected) > 1.0d-10) error stop "Test 3 failed" print *, "PASSED" contains real(8) function square_fn(x) real(8), intent(in) :: x square_fn = x * x end function real(8) function double_fn(x) real(8), intent(in) :: x double_fn = x * 2.0d0 end function end program ! Subroutine with implicit interface for the procedure argument subroutine test_procedure_pass(f, x, result) implicit none real(8), intent(in) :: x real(8), intent(out) :: result real(8), external :: f result = f(x) end subroutine ! Outer chain: passes procedure through another implicit interface layer subroutine outer_chain(f, x, result) implicit none real(8), intent(in) :: x real(8), intent(out) :: result real(8), external :: f ! Call inner routine which also has implicit interface for f call inner_apply(f, x, result) end subroutine ! Inner layer of the chain subroutine inner_apply(func, val, out) implicit none real(8), intent(in) :: val real(8), intent(out) :: out real(8), external :: func out = func(val) end subroutine lfortran-lfortran-2f73434/integration_tests/sqrt_02.f900000664000175000017500000000010615141516316023207 0ustar alastairalastairprogram sqrt_02 real, parameter :: x = 30 print*, sqrt(x) end program lfortran-lfortran-2f73434/integration_tests/arrays_op_1.f900000664000175000017500000000215615141516316024143 0ustar alastairalastairprogram array_op_1 implicit none integer :: a(4), b(4) real :: c(4), d(4) integer :: i, j i = 0 ! TODO: Include i + 4 in the end ! Should be ignored. Fix to be made ! in implied_do_loops.cpp. a = [i + 1, (i + j, j = 1, i + 3)] b = [4*a(i + 1), 5*a(i + 2), 6*a(i + 3), 7*a(i + 4)] ! c = [i + 1, (i*j, j = 1, i + 3)] c(1) = i + 1 c(2) = i*1 c(3) = i*2 c(4) = i*3 print *, a(1), a(2), a(3), a(4) print *, b(1), b(2), b(3), b(4) print *, c(1), c(2), c(3), c(4) d = a + b + c print *, d(1), d(2), d(3), d(4) if( d(1) /= 6.0 ) error stop if( d(2) /= 6.0 ) error stop if( d(3) /= 14.0 ) error stop if( d(4) /= 24.0 ) error stop d = a - b*c print *, d(1), d(2), d(3), d(4) if( d(1) /= -3.0 ) error stop if( d(2) /= 1.0 ) error stop if( d(3) /= 2.0 ) error stop if( d(4) /= 3.0 ) error stop d = a*b*c print *, d(1), d(2), d(3), d(4) if( d(1) /= 4.0 ) error stop if( d(2) /= 0.0 ) error stop if( d(3) /= 0.0 ) error stop if( d(4) /= 0.0 ) error stop d = (a*b)/(c + 1) print *, d(1), d(2), d(3), d(4) if( d(1) /= 2.0 ) error stop if( d(2) /= 5.0 ) error stop if( d(3) /= 24.0 ) error stop if( d(4) /= 63.0 ) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_19.f900000664000175000017500000001103515141516316024416 0ustar alastairalastairprogram intrinsics_19 ! Test intrinsics both declarations and executable statements. ! Single and double precision, real only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = abs(-0.5), & s2 = exp(0.5), & s3 = log(0.5), & s4 = erf(0.5), & s5 = erfc(0.5), & s6 = sqrt(0.5), & s7 = gamma(0.5), & s8 = atan2(0.5, 0.5), & s9 = log_gamma(0.5), & s9_ = log_gamma(log_gamma(0.5) + 3*log_gamma(0.5+log_gamma(0.5))), & s10 = log10(0.5) integer, parameter :: & s11 = nint(3.6), & s12 = floor(3.6), & s13 = nint(-3.6), & s14 = floor(-3.6) real(dp), parameter :: & d1 = abs(-0.5_dp), & d2 = exp(0.5_dp), & d3 = log(0.5_dp), & d4 = erf(0.5_dp), & d5 = erfc(0.5_dp), & d6 = sqrt(0.5_dp), & d7 = gamma(0.5_dp), & d8 = atan2(0.5_dp, 0.5_dp), & d9 = log_gamma(0.5_dp), & d9_ = log_gamma(log_gamma(0.5_dp) + 3*log_gamma(0.5_dp+log_gamma(0.5_dp))), & d10 = log10(0.5_dp) integer, parameter :: & d11 = nint(3.6_dp), & d12 = floor(3.6_dp), & d13 = nint(-3.6_dp), & d14 = floor(-3.6_dp) real :: x, x2 real(dp) :: y, y2 x = 0.5 y = 0.5_dp x2 = 3.6 y2 = 3.6_dp print *, abs(-0.5), abs(-0.5_dp), s1, d1, abs(-x), abs(-y) print *, "Exp: ", exp(0.5), exp(0.5_dp), s2, d2, exp(x), exp(y) if (abs(exp(0.5) - 1.64872122) > 1e-7) error stop if (abs(exp(0.5_dp) - 1.64872127070012819) > 1e-7_dp) error stop if (abs(s2 - 1.64872122) > 1e-7) error stop if (abs(d2 - 1.64872127070012819) > 1e-7_dp) error stop if (abs(exp(x) - 1.64872122) > 1e-7) error stop if (abs(exp(y) - 1.64872127070012819) > 1e-7_dp) error stop print *, "Log: ", log(0.5), log(0.5_dp), s3, d3, log(x), log(y) if (abs(log(0.5) + 0.693147182) > 1e-7) error stop if (abs(log(0.5_dp) + 0.693147180559945286) > 1e-7_dp) error stop if (abs(s3 + 0.693147182) > 1e-7) error stop if (abs(d3 + 0.693147180559945286) > 1e-7_dp) error stop if (abs(log(x) + 0.693147182) > 1e-7) error stop if (abs(log(y) + 0.693147180559945286) > 1e-7_dp) error stop print *, "dlog10: ", dlog10(0.5_dp), dlog10(y2) if (abs(dlog10(0.5_dp) + 0.301029995663981198) > 1e-7_dp) error stop if (abs(dlog10(y2) - 0.556302500767287267) > 1e-7_dp) error stop print *, "Erf: ", erf(0.5), erf(0.5_dp), s4, d4, erf(x), erf(y) if (abs(erf(0.5) - 0.520499885) > 1e-7) error stop if (abs(erf(0.5_dp) - 0.520499877813046519) > 1e-7_dp) error stop if (abs(s4 - 0.520499885) > 1e-7) error stop if (abs(d4 - 0.520499877813046519) > 1e-7_dp) error stop if (abs(erf(x) - 0.520499885) > 1e-7) error stop if (abs(erf(y) - 0.520499877813046519) > 1e-7_dp) error stop print *, "Erfc: ", erfc(0.5), erfc(0.5_dp), s5, d5, erfc(x), erfc(y) if (abs(erfc(0.5) - 0.479500115) > 1e-7) error stop if (abs(erfc(0.5_dp) - 0.479500122186953481) > 1e-7_dp) error stop if (abs(s5 - 0.479500115) > 1e-7) error stop if (abs(d5 - 0.479500122186953481) > 1e-7_dp) error stop if (abs(erfc(x) - 0.479500115) > 1e-7) error stop if (abs(erfc(y) - 0.479500122186953481) > 1e-7_dp) error stop print *, sqrt(0.5), sqrt(0.5_dp), s6, d6, sqrt(x), sqrt(y) print *, gamma(0.5), gamma(0.5_dp), s7, d7, gamma(x), gamma(y) print *, atan2(0.5, 0.5), atan2(0.5_dp, 0.5_dp), s8, d8, atan2(x,x), atan2(y,y) print *, log_gamma(0.5), log_gamma(0.5_dp), s9, d9, log_gamma(x), log_gamma(y) print *, s9_, log_gamma(log_gamma(x) + 3*log_gamma(x+log_gamma(x))) print *, d9_, log_gamma(log_gamma(y) + 3*log_gamma(y+log_gamma(y))) print *, "Log10: ", log10(0.5), log10(0.5_dp), s10, d10, log10(x), log10(y) if (abs(log10(0.5) + 0.301030010) > 1e-7) error stop if (abs(log10(0.5_dp) + 0.301029995663981198) > 1e-7_dp) error stop if (abs(s10 + 0.301030010) > 1e-7) error stop if (abs(d10 + 0.301029995663981198) > 1e-7_dp) error stop if (abs(log10(x) + 0.301030010) > 1e-7) error stop if (abs(log10(y) + 0.301029995663981198) > 1e-7_dp) error stop print *, nint(3.6), nint(3.6_dp), s11, d11, nint(x2), nint(y2) print *, floor(3.6), floor(3.6_dp), s12, d12, floor(x2), floor(y2) print *, nint(-3.6), nint(-3.6_dp), s13, d13, nint(-x2), nint(-y2) print *, floor(-3.6), floor(-3.6_dp), s14, d14, floor(-x2), floor(-y2) if (abs(dsqrt(4.0_dp) - 2.0_dp) > 1e-15_dp) error stop if (abs(dsqrt(y) - 0.70710678118654757_dp) > 1e-15_dp) error stop if (abs(s9_ - log_gamma(log_gamma(x) + 3*log_gamma(x+log_gamma(x)))) > 1e-7) error stop if (abs(d9_ - log_gamma(log_gamma(y) + 3*log_gamma(y+log_gamma(y)))) > 1e-15_dp) error stop if (abs(s9 - 0.572364926) > 1e-7) error stop if (abs(d9 - 0.57236494292470008) > 1e-7_dp) error stop if (abs(s9_ - 0.656042993) > 1e-7) error stop if (abs(d9_ - 0.65604298092238577) > 1e-7_dp) error stop end program intrinsics_19 lfortran-lfortran-2f73434/integration_tests/class_81.f900000664000175000017500000000174115141516316023340 0ustar alastairalastairmodule bar_type implicit none private public :: bar_destroy type, public :: bar integer :: v = 0 contains final :: bar_destroy end type bar interface bar_destroy module procedure bar_destroy end interface bar_destroy contains subroutine bar_destroy(this) type(bar), intent(inout) :: this this%v = -1 end subroutine end module bar_type module foo_type implicit none type :: foo contains procedure :: f end type contains subroutine f(this, x) use bar_type, only: bar class(foo), intent(in) :: this type(bar), intent(in) :: x print *, "foo%f called, x%v =", x%v if (x%v /= 42) error stop end subroutine end module foo_type program class_81 use foo_type use bar_type implicit none type(foo) :: a type(bar) :: b b%v = 42 print *, "Before call: b%v =", b%v if (b%v /= 42) error stop call a%f(b) print *, "After call: b%v =", b%v if (b%v /= 42) error stop end program class_81lfortran-lfortran-2f73434/integration_tests/fortuno_01.f900000664000175000017500000000177615141516316023727 0ustar alastairalastairmodule fortuno_basetypes implicit none type, abstract :: test_base character(:), allocatable :: name end type test_base type :: test_ptr_item class(test_base), pointer :: item => null() end type test_ptr_item type :: test_list private type(test_ptr_item), pointer :: storage_(:) => null() integer :: nitems = 0 contains procedure :: free => test_list_free end type contains subroutine test_list_free(this) class(test_list), intent(inout) :: this select type (item => this%storage_(1)%item) class default end select end subroutine test_list_free end module fortuno_basetypes program fortuno_01 use fortuno_basetypes implicit none type(test_list) :: my_list call my_list%free() print *, "Test list has been freed successfully." end programlfortran-lfortran-2f73434/integration_tests/template_simple_01.f900000664000175000017500000000376415141516316025416 0ustar alastairalastairmodule template_simple_01_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function subroutine test_template() instantiate generic_sum(integer, operator(+), cast_integer), only: generic_sum_integer => generic_sum instantiate generic_sum(real, operator(+), cast_real), only: generic_sum_real => generic_sum integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum_integer(a_i) s_r = generic_sum_real(a_r) print *, s_i print *, s_r end subroutine end module program template_simple_01 use template_simple_01_m implicit none call test_template() endlfortran-lfortran-2f73434/integration_tests/types_03.f900000664000175000017500000000014615141516316023367 0ustar alastairalastairprogram types_03 implicit none real :: r integer :: i r = 1.5 print *, r i = r print *, i end program lfortran-lfortran-2f73434/integration_tests/procedure_04.f900000664000175000017500000000111415141516316024210 0ustar alastairalastairmodule procedure_04_mod interface subroutine func(n) integer, intent(inout) :: n end subroutine end interface contains subroutine g(fcn2, n) procedure(func) :: fcn2 integer, intent(inout) :: n call fcn2(n) end subroutine subroutine f(fcn1, n) procedure(func) :: fcn1 integer, intent(inout) :: n call g(fcn1, n) end subroutine end module program procedure_04 use procedure_04_mod, only: f integer :: n n = 5 call f(myfn, n) print *, n if (n /= 6) error stop contains subroutine myfn(n) integer, intent(inout) :: n n = n + 1 end subroutine end program lfortran-lfortran-2f73434/integration_tests/char_array_initialization_declaration.f900000664000175000017500000000175015141516316031512 0ustar alastairalastairprogram char_array_initialization_declaration CHARACTER(len=2) :: char1(2) = "ap" CHARACTER(len=3), dimension(2) :: char2 = "app" CHARACTER(*), dimension(2), parameter :: char1_param = "ap" CHARACTER, parameter :: char2_param(2)*3 = "ghi" CHARACTER, parameter :: char3_param*(2 + 1) = "App" CHARACTER :: char3*4 = "Goat" CHARACTER :: char4*4 print *, char1 if (char1(1) /= "ap") error stop if (char1(2) /= "ap") error stop print *, char2 if (char2(1) /= "app") error stop if (char2(2) /= "app") error stop print *, char1_param if (char1_param(1) /= "ap") error stop if (char1_param(2) /= "ap") error stop print *, char2_param if (char2_param(1) /= "ghi") error stop if (char2_param(2) /= "ghi") error stop print *, char3_param if (char3_param /= "App") error stop print *, char3 if (char3 /= "Goat") error stop char4 = "Boat" print *, char4 if (char4 /= "Boat") error stop end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_01.f900000664000175000017500000000221715141516316026446 0ustar alastairalastairmodule operator_overloading_01_overload_asterisk_m implicit none public operator (*) interface operator (*) module procedure logical_and end interface interface operator (+) module procedure bin_add end interface contains pure logical function logical_and(log1, log2) logical, intent (in) :: log1, log2 logical_and = (log1 .and. log2) end function pure integer function bin_add(log1, log2) logical, intent (in) :: log1, log2 if( log1 .and. log2 ) then bin_add = 2 elseif( .not. log1 .and. .not. log2 ) then bin_add = 0 else bin_add = 1 endif end function end module program operator_overloading_01 use operator_overloading_01_overload_asterisk_m implicit none logical, parameter :: T = .true., F = .false. print *, "T*T:", T*T ! Yields: T print *, "T*F:", T*F ! Yields: F print *, "F*T:", F*T ! Yields: F print *, "F*F:", F*F ! Yields: F print *, "T+T:", T+T ! Yields: 2 print *, "T+F:", T+F ! Yields: 1 print *, "F+T:", F+T ! Yields: 1 print *, "F+F:", F+F ! Yields: 0 end program lfortran-lfortran-2f73434/integration_tests/elemental_05.f900000664000175000017500000000073615141516316024200 0ustar alastairalastairprogram elemental_05 integer, parameter :: n = 10 integer :: i type :: vector integer :: elements(n) end type type(vector) :: a, b, c do i = 1, n a%elements(i) = i b%elements(i) = i end do c%elements = add_vector(a%elements, b%elements) print *, c%elements do i = 1, n if (c%elements(i) /= 2*i) error stop end do contains elemental function add_vector(a, b) result(c) integer, intent(in) :: a, b integer :: c c = a + b end function end program lfortran-lfortran-2f73434/integration_tests/block_04.f900000664000175000017500000000105715141516316023320 0ustar alastairalastairsubroutine hybrd() implicit none real, dimension(3):: wa3 real :: temp interface subroutine fcn(n) implicit none integer, intent(in) :: n end subroutine fcn end interface main : block temp = enorm(3, Wa3) end block main contains real function enorm(n, x) result(y) implicit none integer, intent(in) :: n real, dimension(n), intent(in) :: x y = 0.0 end function enorm end subroutine program main implicit none call hybrd() end program lfortran-lfortran-2f73434/integration_tests/class_49.f900000664000175000017500000000114015141516316023335 0ustar alastairalastairmodule class_49_m_1 implicit none type base integer :: m = 1 end type end module module class_49_m_2 use class_49_m_1, only: base type, extends(base) :: derived integer :: n = 2 end type end module program class_49 use class_49_m_1, only: base use class_49_m_2, only: derived class(base), allocatable :: b allocate(derived :: b) b = derived(10, 20) select type(b) type is (derived) if (b%m /= 10) error stop if (b%n /= 20) error stop class default error stop end select end program lfortran-lfortran-2f73434/integration_tests/intrinsics_14.f900000664000175000017500000000211215141516316024405 0ustar alastairalastairprogram intrinsics_14 integer, parameter :: & k1 = selected_int_kind(5), & k2 = selected_int_kind(5_4), & k3 = selected_int_kind(5_8), & k4 = selected_int_kind(8), & k5 = selected_int_kind(10), & k6 = selected_real_kind(5), & k7 = selected_real_kind(5_4), & k8 = selected_real_kind(5_8), & k9 = selected_real_kind(8), & k10 = selected_char_kind("default"), & k11 = selected_real_kind(p=5), & k12 = selected_real_kind(p=10) integer :: i1 character(7) :: s1 s1 = "default" i1 = 5 print*,selected_int_kind(5), k1 ! 4 print*,selected_int_kind(5_4), k2 ! 4 print*,selected_int_kind(5_8), k3 ! 4 print*,selected_int_kind(8), k4 ! 4 print*,selected_int_kind(10), k5 ! 8 print*,selected_real_kind(5), k6 ! 4 print*,selected_real_kind(5_4), k7 ! 4 print*,selected_real_kind(5_8), k8 ! 4 print*,selected_real_kind(8), k9 ! 8 print*,selected_char_kind("default"), k10 ! 1 print *, selected_int_kind(i1) print *, selected_real_kind(i1) print *, selected_char_kind(s1) print *, selected_real_kind(p=5), k11 print *, selected_real_kind(p=10), k12 end program lfortran-lfortran-2f73434/integration_tests/external_05.f900000664000175000017500000000034615141516316024051 0ustar alastairalastairsubroutine idz_snorm(matvec) external matvec call matvec(n,v,m,u,p1,p2,p3,p4) end subroutine idz_diffsnorm0(matvec) external matvec call matvec(n,v,m,u1,p1,p2,p3,p4) return end program external_04 end program lfortran-lfortran-2f73434/integration_tests/fma_03.f900000664000175000017500000000041615141516316022766 0ustar alastairalastairprogram fma_03 implicit none integer ::b(10) integer ::bb(10) real :: r bb = 0 bb(2) = 100 b = 1 r = 2 b(1) = bb(int(r*r - r,4)) ! Test fma in nested expression print *, b(1) if(b(1) /= 100) error stop end program fma_03lfortran-lfortran-2f73434/integration_tests/file_12_data.txt0000664000175000017500000000000015141516316024341 0ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/implied_do_loops15.f900000664000175000017500000000117615141516316025414 0ustar alastairalastairprogram implied_do_loops15 integer n(3) n = [(42, i = 1, size(n))] print "(3I3)", n if (any(n /= 42)) error stop call test_expression() call test_subroutine() contains subroutine test_expression() integer m(5) m = [(i*2, i = 1, 5)] print "(5I3)", m if (m(1) /= 2) error stop if (m(5) /= 10) error stop end subroutine test_expression subroutine test_subroutine() integer arr(4) arr = [(j*3, j = 1, 4)] print "(4I3)", arr if (arr(1) /= 3) error stop if (arr(4) /= 12) error stop end subroutine test_subroutine end program implied_do_loops15 lfortran-lfortran-2f73434/integration_tests/file_04.f900000664000175000017500000000103415141516316023140 0ustar alastairalastairprogram load_model_program implicit none integer :: int_data1, int_data2 real :: real_data1, real_data2 integer :: u = 11 open(u, file="file_04_data.dat", form="unformatted", access="stream") read(u) int_data1, real_data1, int_data2, real_data2 print *, "Data: ", int_data1, real_data1, int_data2, real_data2 if (int_data1 /= 345239) error stop if (abs(real_data1 - (52.91)) > 1e-6) error stop if (int_data2 /= -345239) error stop if (abs(real_data2 - (-52.91)) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/parameter_10.f900000664000175000017500000000110515141516316024175 0ustar alastairalastairprogram parameter_10 implicit none integer, parameter :: N = 10 integer, parameter :: sp = kind(1.0) integer, parameter :: dp = kind(1.d0) real(dp), parameter :: pi = 2*asin(1._dp) real(dp), parameter :: a = 0, b = pi real(dp), parameter :: dx = (b-a)/N integer :: i real(dp), parameter :: X(N) = [(sin(a+(b-a)*i/N), i = 1, N)] real(dp), parameter :: S = sum(X)*dx logical, parameter :: l = S < 2 real(kind=merge(sp, dp, l)) :: y print *, (kind(y) == sp) if (kind(y) /= sp) then error stop end if print *, S if (abs(S - 1.9835235375094546_dp) > 1e-14) error stop end program lfortran-lfortran-2f73434/integration_tests/class_45.f900000664000175000017500000000210415141516316023332 0ustar alastairalastairmodule class_45_mod type, public, abstract :: AbsType contains procedure(method), deferred, nopass :: method end type AbsType abstract interface function method() result(arr) import integer, allocatable :: arr(:) end function method end interface type, extends(AbsType) :: ConcreteType contains procedure, nopass :: method => concrete_method end type ConcreteType contains subroutine client(obj) class(AbsType), intent(in) :: obj integer, allocatable :: local_arr(:) allocate(local_arr(2)) local_arr = obj%method() print *, "local_arr: ", local_arr if (.not. all(local_arr == [1, 2])) error stop end subroutine client function concrete_method() result(arr) integer, allocatable :: arr(:) allocate(arr(2)) arr = [1, 2] end function concrete_method end module class_45_mod program class_45 use class_45_mod implicit none class(AbsType), allocatable :: var allocate(ConcreteType :: var) call client(var) end program class_45 lfortran-lfortran-2f73434/integration_tests/operator_overloading_12.f900000664000175000017500000000144115141516316026446 0ustar alastairalastairmodule module_operator_overloading_12 implicit none public :: operator(.and.) interface operator(.and.) elemental module function and(lhs, rhs) result(diagnosis) implicit none integer, intent(in) :: lhs, rhs integer :: diagnosis end function end interface contains elemental module function and(lhs, rhs) result(diagnosis) implicit none integer, intent(in) :: lhs, rhs integer :: diagnosis diagnosis = lhs + rhs end function and end module module_operator_overloading_12 program operator_overloading_12 use module_operator_overloading_12, only: operator(.and.) implicit none integer :: a, b, c a = 5 b = 5 c = a .and. b print *, "The result of a .and. b is:", c if ( c /= 10 ) error stop end program operator_overloading_12lfortran-lfortran-2f73434/integration_tests/cmake_minimal_test_01.f900000664000175000017500000000053615141516316026051 0ustar alastairalastairsubroutine test_real() implicit none real :: a(3) = -9.13 double precision :: b(9) = 3.14D0 print *, a if(any(abs(a - (-9.13) ) > 1e-9)) error stop print *, b if(any(abs(b - 3.14D0) > 1d-9)) error stop end subroutine program cmake_minimal_test_01 implicit none integer :: i(3) = 9 print *, i if(any(i /= 9)) error stop call test_real() end program lfortran-lfortran-2f73434/integration_tests/class_14.f900000664000175000017500000000170215141516316023331 0ustar alastairalastairmodule malloc_failure implicit none type, public, abstract :: AbsType contains procedure(callee), deferred, nopass :: callee end type AbsType abstract interface subroutine callee(mode) integer, intent(in) :: mode end subroutine callee end interface type :: SomeClass private class(AbsType), allocatable :: object contains procedure :: caller end type SomeClass interface SomeClass procedure :: constructor end interface SomeClass contains function constructor(object) result(self) type(SomeClass) :: self class(AbsType), intent(in) :: object self%object = object end function constructor subroutine caller(self) class(SomeClass), intent(in) :: self call self%object%callee(mode=0) end subroutine caller end module malloc_failure program main end programlfortran-lfortran-2f73434/integration_tests/intrinsics_25.f900000664000175000017500000000322015141516316024410 0ustar alastairalastairprogram intrinsics_25 implicit none integer(4), parameter:: x = ishft(123, 5) integer(4), parameter:: y = ishft(25, 0) integer(8), parameter:: z = ishft(1000000000, -2) integer(4), parameter:: i1 = ishft(-1921, -4) integer(8), parameter:: i2 = ishft(-6_8, -32_8) integer(8), parameter:: i3 = ishft( 29382382013459_8, 12_8) integer(8), parameter:: i4 = ishft(-987236238948_8, -23_8) integer(1), parameter:: i5 = ishft(3, -4) integer(1), parameter:: i6 = ishft(-4, 2) integer(1), parameter:: i7 = ishft(123, -3) integer(1), parameter:: i8 = ishft(-16, 1) integer(2), parameter:: i9 = ishft(3, -4) integer(2), parameter:: i10 = ishft(-4, 2) integer(2), parameter:: i11 = ishft(123, -3) integer(8) :: a1, a2, a3, a4 integer(4) :: b1, b2, b3, b4 a1 = -1921 a2 = -6_8 a3 = 29382382013459_8 a4 = -987236238948_8 a1 = ishft(a1, -4) a2 = ishft(a2, -32_8) a3 = ishft(a3, 12_8) a4 = ishft(a4, -23_8) b1 = -1921 b2 = -6 b3 = 29382382 b4 = -9872362 b1 = ishft(b1, -4) b2 = ishft(b2, -31) b3 = ishft(b3, 12) b4 = ishft(b4, -23) print *, b1, b2, b3, b4 print *, a1, a2, a3, a4 print *, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 print *, x, y, z if (x /= 3936 .or. y /= 25 .or. z /= 250000000) error stop if (a1 /= 1152921504606846855_8 .or. a2 /= 4294967295_8 .or. & a3 /= 120350236727128064_8 .or. a4 /= 2199023137864_8) error stop if (b1 /= 268435335 .or. b2 /= 1 .or. & b3 /= 91152384 .or. b4 /= 510) error stop if (i1 /= 268435335_8 .or. i2 /= 4294967295_8 .or. & i3 /= 120350236727128064_8 .or. i4 /= 2199023137864_8 .or. & i5 /= 0 .or. i6 /= -16 .or. i7 /= 15 .or. i8 /= -32 .or. & i9 /= 0 .or. i10 /= -16 .or. i11 /= 15) error stop end program intrinsics_25lfortran-lfortran-2f73434/integration_tests/intrinsics_306.f900000664000175000017500000000200415141516316024471 0ustar alastairalastairprogram intrinsics_306 implicit none real, parameter :: x1 = imagpart((1.0, 2.0)) real(8), parameter :: x2 = imagpart((1.0_8, 2.0_8)) real, parameter :: ar1(3) = imagpart([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = imagpart([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 2.0) error stop print *, x2 if (x2 /= 2.0_8) error stop print *, imagpart(x) if (imagpart(x) /= 2.0) error stop print *, imagpart(y) if (imagpart(y) /= 2.0_8) error stop print *, ar1 if (any(ar1 /= [2.0, 4.0, 6.0])) error stop print *, ar2 if (any(ar2 /= [2.0_8, 4.0_8, 6.0_8])) error stop print *, imagpart(x) if (imagpart(x) /= 2.0) error stop print *, imagpart(y) if (imagpart(y) /= 2.0_8) error stop print *, imagpart(z) if (any(imagpart(z) /= [2.0, 4.0, 6.0])) error stop end programlfortran-lfortran-2f73434/integration_tests/contig.f900000664000175000017500000000061715141516316023207 0ustar alastairalastairmodule test_mod implicit none contains subroutine sub_test(a,b) real, dimension(:), intent(in) , contiguous :: a real, dimension(:), intent(out), contiguous :: b b = a end subroutine sub_test end module test_mod program contig use test_mod implicit none real, dimension(5) :: a,b a = 1.0 call sub_test(a,b) print *, b end program contiglfortran-lfortran-2f73434/integration_tests/do_loop_03.f900000664000175000017500000000031215141516316023651 0ustar alastairalastairprogram do_loop_03 integer :: n = 2, k do k = 2, n print *, k end do ! with --use-loop-variable-after-loop if (k /= 3) error stop print *, "k after = ", k end program lfortran-lfortran-2f73434/integration_tests/write_fortran_02.f900000664000175000017500000000216415141516316025111 0ustar alastairalastairprogram write_fortran_02 implicit none character(len=100) :: output integer :: val, ierr real :: fval val = 12345 fval = 3.14159 write(output, '(I0)') val if (trim(output) /= "12345") error stop "Integer variable failed" write(output, '(A, I0, A)') "Value: ", val, " units" if (trim(output) /= "Value: 12345 units") error stop "Mixed format failed" write(output, '(F8.2)') fval if (trim(adjustl(output)) /= "3.14") error stop "Real variable failed" write(output, '(I0, 1X, I0, 1X, I0)') 10, 20, 30 if (trim(output) /= "10 20 30") error stop "Separator format failed" write(output, '(I0)') -99 if (trim(output) /= "-99") error stop "Negative integer failed" write(output, '(A, I0, A, F6.2)') "x=", 10, " y=", 20.5 if (trim(output) /= "x=10 y= 20.50") error stop "Complex mixed format failed" write(output, '(A10)') "World" if (output(6:10) /= "World") error stop "A10 format failed" write(output, '(A)', iostat=ierr) "Hello World" if (ierr /= 0) error stop "iostat check failed" end program write_fortran_02 lfortran-lfortran-2f73434/integration_tests/functions_46.f900000664000175000017500000000113215141516316024236 0ustar alastairalastair! Test calling `foo2` that has a string return of length depending on the input array size. program functions_46 character(1) :: arr(12) call foo(arr) contains pure function foo2(set) result(string) character(len=1), intent(in) :: set(:) character(len=size(set)) :: string !!! <<< Testing this end function foo2 subroutine foo(set) character(len=1), intent(in) :: set(:) character(len=:), allocatable :: chomped_string print *, len(foo2(set)) if(len(foo2(set)) /= size(set)) error stop end subroutine foo end program lfortran-lfortran-2f73434/integration_tests/implicit_argument_casting_01.f900000664000175000017500000000075615141516316027454 0ustar alastairalastairsubroutine idz_realcomp(n, a) implicit none integer, parameter :: dp = kind(0.d0) integer n real(dp) a(n) a = 12.5d0 end subroutine program main implicit none integer, parameter :: dp = kind(0.d0) complex(dp) :: w(5) call idzp_svd(5, w) contains subroutine idzp_svd(ls, w) implicit none complex(dp) :: w(*) integer :: ls, isi isi = 1 call idz_realcomp(ls*2, w(isi)) print *, w(isi) if (abs(real(w(isi), dp) - 12.5d0) > 1e-12) error stop end end program lfortran-lfortran-2f73434/integration_tests/modules_27_module1.f900000664000175000017500000000115715141516316025332 0ustar alastairalastairmodule tomlf_build_keyval implicit none real :: GLOBAL_VAR interface get_value module procedure :: get_value_float_sp module procedure :: get_value_float_dp end interface get_value contains subroutine get_value_float_sp(self, val, stat) complex, intent(in) :: self real(4), intent(out) :: val integer, intent(out), optional :: stat end subroutine get_value_float_sp subroutine get_value_float_dp(self, val, stat) complex, intent(in) :: self real(8), intent(out) :: val integer, intent(out), optional :: stat end subroutine get_value_float_dp end module tomlf_build_keyval lfortran-lfortran-2f73434/integration_tests/inquire_01.f900000664000175000017500000000071715141516316023701 0ustar alastairalastairprogram inquire_01 implicit none call check_inquire_01() contains subroutine check_inquire_01() logical :: file_exists character(len=:), allocatable :: fname fname = "this/will/fail.always" inquire (file='/this/will/fail.always', exist=file_exists) print *, file_exists inquire (file=fname, exist=file_exists) print *, file_exists end subroutine check_inquire_01 end program inquire_01 lfortran-lfortran-2f73434/integration_tests/derived_types_99.f900000664000175000017500000000040015141516316025101 0ustar alastairalastairprogram derived_types_99 implicit none type :: t integer :: x end type type(t) :: a(4) integer :: i do i = 1, 4 a(i)%x = i * 10 end do associate(q => a%x) print *, q end associate end program derived_types_99 lfortran-lfortran-2f73434/integration_tests/intrinsics_257.f900000664000175000017500000000565015141516316024510 0ustar alastairalastairprogram intrinsics_257 implicit none integer(4), parameter :: i1 = product([1, 2, 3]) real(4), parameter :: i2 = product([1.0, 2.0, 3.0]) complex(4), parameter :: i3 = product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) integer(8), parameter :: i4 = product([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i5 = product([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) complex(8), parameter :: i6 = product([(1.5_8, 2.2_8), (22.9_8, 1.4_8), (3.0_8, 1.1_8)], mask = [.true., .false., .true.]) integer(4), parameter :: i7 = product([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i8 = product([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) complex(4), parameter :: i9 = product([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)], dim = 1, mask = [.true., .false., .true.]) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] complex(4) :: ar3(4) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 6) error stop print *, i2 if (abs(i2 - 6.0) > 1e-6) error stop print *, i3 if (abs(i3 - (-85.0000000, 20.0000000)) > 1e-6) error stop print *, i4 if (i4 /= 6) error stop print *, i5 if (abs(i5 - 4.5_8) > 1e-12) error stop print *, i6 if (abs(i6 - (2.0799999999999996,8.2500000000000000)) > 1e-6) error stop print *, i7 if (i7 /= 55) error stop print *, i8 if (abs(i8 - 55.9000015) > 1e-6) error stop print *, i9 if (abs(i9 - (-7.00000000,16.0000000)) > 1e-6) error stop print *, product(ar1) if (product(ar1) /= 126) error stop print *, product(ar2) if (abs(product(ar2) - 200.879974) >1e-6 ) error stop print *, product(ar3) ! if (abs(product(ar3) - (-755.000000,-540.000000)) > 1e-6) error stop ! wrong answer print *, product(ar1, mask = mask) if (product(ar1, mask = mask) /= 63) error stop print *, product(ar2, mask = mask) if (abs(product(ar2, mask = mask) - 64.7999954) > 1e-6) error stop print *, product(ar3, mask = mask) ! if (abs(product(ar3, mask = mask) - (-177.000000, 56.0000000)) > 1e-6) error stop print *, product(ar1, dim = dim) if (product(ar1, dim = dim) /= 126) error stop print *, product(ar2, dim = dim) if (abs(product(ar2, dim = dim) - 200.879974) > 1e-6) error stop print *, product(ar3, dim = dim) ! if (abs(product(ar3, dim = dim) - (-755.000000,-540.000000)) > 1e-6) error stop print *, product(ar1, mask = mask, dim = dim) if (product(ar1, mask = mask, dim = dim) /= 63) error stop print *, product(ar2, mask = mask, dim = dim) if (abs(product(ar2, mask = mask, dim = dim) - 64.7999954) > 1e-6) error stop print *, product(ar3, mask = mask, dim = dim) ! if (abs(product(ar3, mask = mask, dim = dim) - (-177.000000,56.0000000)) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/operator_overloading_18.f900000664000175000017500000000122515141516316026454 0ustar alastairalastairmodule operator_overloading_18_mod implicit none ! Abstract base type type, abstract :: temp contains procedure :: test_equal procedure(is_equal), deferred :: is_same generic :: operator(==) => is_same end type temp abstract interface logical function is_equal(this, other) import :: temp class(temp), intent(in) :: this, other end function is_equal end interface contains subroutine test_equal(a, b) class(temp), intent(in) :: a, b if (a == b) print *, "Hi" end subroutine test_equal end module operator_overloading_18_mod program operator_overloading_18 use operator_overloading_18_mod end programlfortran-lfortran-2f73434/integration_tests/intrinsics_48.f900000664000175000017500000000041115141516316024414 0ustar alastairalastairprogram intrinsics_48 implicit none real :: x(3) x = [1., 2., 3.] x = log_gamma(x) + log_gamma(x + 1) print *, x if (x(1) /= 0.0) error stop if (abs(x(2) - 0.693147182) > 1e-12) error stop if (abs(x(3) - 2.48490667) > 1e-12) error stop end program intrinsics_48 lfortran-lfortran-2f73434/integration_tests/modules_42.f900000664000175000017500000000122515141516316023675 0ustar alastairalastairmodule modules_42_fpm_targets implicit none type int_t integer :: i end type int_t contains subroutine prune_build_targets() type(int_t) :: modules_used(1) modules_used(1)%i = 0 call collect_used_modules() print *, modules_used(1)%i if( modules_used(1)%i /= 2 ) error stop contains recursive subroutine collect_used_modules() modules_used(1)%i = 2 modules_used = [modules_used(1)] end subroutine collect_used_modules end subroutine prune_build_targets end module modules_42_fpm_targets program modules_42 use modules_42_fpm_targets implicit none call prune_build_targets() end program modules_42 lfortran-lfortran-2f73434/integration_tests/allocatable_dummy_descriptor_01.f900000664000175000017500000000151715141516316030140 0ustar alastairalastairprogram allocatable_dummy_descriptor_01 implicit none type :: item_t integer :: s end type item_t type :: container_t type(item_t), allocatable :: list(:) end type container_t type(item_t), allocatable :: src(:) type(container_t), allocatable :: containers(:) allocate(src(1)) src(1)%s = 123 allocate(containers(1)) call get_list(src, containers(1)%list) if (.not. allocated(containers(1)%list)) error stop if (size(containers(1)%list) /= 1) error stop if (containers(1)%list(1)%s /= 123) error stop contains subroutine get_list(src, list) type(item_t), allocatable, intent(in) :: src(:) type(item_t), allocatable, intent(out) :: list(:) if (.not. allocated(src)) return allocate(list(size(src))) list = src end subroutine get_list end program allocatable_dummy_descriptor_01 lfortran-lfortran-2f73434/integration_tests/iso_c_binding_01.f900000664000175000017500000000050015141516316025001 0ustar alastairalastairprogram iso_c_binding_01 use iso_c_binding character(len=2, kind=c_char), parameter :: a = 'a' if (a /= 'a') error stop if (len(a) /= 2) error stop if (kind(a) /= c_char) error stop print *, "c_intptr_t:", c_intptr_t if (c_intptr_t /= 8) error stop end program iso_c_binding_01 lfortran-lfortran-2f73434/integration_tests/arrays_02.f900000664000175000017500000000027015141516316023521 0ustar alastairalastairprogram arrays_02 implicit none integer, parameter :: dp = kind(0.d0) real(dp) :: a(3), b a(1) = 3._dp a(2) = 2._dp a(3) = 1._dp b = sum(a) if (abs(b-6._dp) > 1e-12_dp) error stop end lfortran-lfortran-2f73434/integration_tests/arrays_78.f900000664000175000017500000000103215141516316023533 0ustar alastairalastair! This test ensures that reshape's return gets ! assigned correctly to the LHS if it's `PointerToData`-physicalType array. program arrays_78 integer :: x(2,3) = reshape([1, 2, 3, 4, 5, 6], [2,3]) call func(x) contains subroutine func(x) integer, intent(in) :: x(:, :) integer :: y(size(x, 2), size(x, 1)) print *, reshape(x, [3,2]) y = reshape(x, shape(y)) print *, y if(any(y /= reshape([1, 2, 3, 4, 5, 6], [3,2]))) error stop end subroutine end program arrays_78 lfortran-lfortran-2f73434/integration_tests/lfortran_intrinsic_sin_c.c0000664000175000017500000003306615141516316026640 0ustar alastairalastair#include #define __HI(x) *(1+(int*)&x) #define __LO(x) *(int*)&x /* @(#)k_rem_pio2.c 1.3 95/01/18 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) * double x[],y[]; int e0,nx,prec; int ipio2[]; * * __kernel_rem_pio2 return the last three digits of N with * y = x - N*pi/2 * so that |y| < pi/2. * * The method is to compute the integer (mod 8) and fraction parts of * (2/pi)*x without doing the full multiplication. In general we * skip the part of the product that are known to be a huge integer ( * more accurately, = 0 mod 8 ). Thus the number of operations are * independent of the exponent of the input. * * (2/pi) is represented by an array of 24-bit integers in ipio2[]. * * Input parameters: * x[] The input value (must be positive) is broken into nx * pieces of 24-bit integers in double precision format. * x[i] will be the i-th 24 bit of x. The scaled exponent * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 * match x's up to 24 bits. * * Example of breaking a double positive z into x[0]+x[1]+x[2]: * e0 = ilogb(z)-23 * z = scalbn(z,-e0) * for i = 0,1,2 * x[i] = floor(z) * z = (z-x[i])*2**24 * * * y[] ouput result in an array of double precision numbers. * The dimension of y[] is: * 24-bit precision 1 * 53-bit precision 2 * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit * precison, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; * w = (long double)y[0]; * r_head = t+w; * r_tail = w - (r_head - t); * * e0 The exponent of x[0] * * nx dimension of x[] * * prec an integer indicating the precision: * 0 24 bits (single) * 1 53 bits (double) * 2 64 bits (extended) * 3 113 bits (quad) * * ipio2[] * integer array, contains the (24*i)-th to (24*i+23)-th * bit of 2/pi after binary point. The corresponding * floating value is * * ipio2[i] * 2^(-24(i+1)). * * External function: * double scalbn(), floor(); * * * Here is the description of some local variables: * * jk jk+1 is the initial number of terms of ipio2[] needed * in the computation. The recommended value is 2,3,4, * 6 for single, double, extended,and quad. * * jz local integer variable indicating the number of * terms of ipio2[] used. * * jx nx - 1 * * jv index for pointing to the suitable ipio2[] for the * computation. In general, we want * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 * is an integer. Thus * e0-3-24*jv >= 0 or (e0-3)/24 >= jv * Hence jv = max(0,(e0-3)/24). * * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. * * q[] double array with integral value, representing the * 24-bits chunk of the product of x and 2/pi. * * q0 the corresponding exponent of q[0]. Note that the * exponent for q[i] would be q0-24*i. * * PIo2[] double precision array, obtained by cutting pi/2 * into 24 bits chunks. * * f[] ipio2[] in floating point * * iq[] integer array by breaking up q[] in 24-bits chunk. * * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] * * ih integer. If >0 it indicates q[] is >= 0.5, hence * it also indicates the *sign* of the result. * */ /* * Constants: * The hexadecimal values are the intended ones for the following * constants. The decimal values may be used, provided that the * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ //#include "fdlibm.h" #ifdef __STDC__ static const int init_jk[] = {2,3,4,6}; /* initial value for jk */ #else static int init_jk[] = {2,3,4,6}; #endif #ifdef __STDC__ static const double PIo2[] = { #else static double PIo2[] = { #endif 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */ 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */ 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */ 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */ 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */ 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */ 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */ 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */ }; #ifdef __STDC__ static const double #else static double #endif zero = 0.0, one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ #ifdef __STDC__ int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) #else int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) double x[], y[]; int e0,nx,prec; int ipio2[]; #endif { int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; double z,fw,f[20],fq[20],q[20]; /* initialize jk*/ jk = init_jk[prec]; jp = jk; /* determine jx,jv,q0, note that 3>q0 */ jx = nx-1; jv = (e0-3)/24; if(jv<0) jv=0; q0 = e0-24*(jv+1); /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ j = jv-jx; m = jx+jk; for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j]; /* compute q[0],q[1],...q[jk] */ for (i=0;i<=jk;i++) { for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; } jz = jk; recompute: /* distill q[] into iq[] reversingly */ for(i=0,j=jz,z=q[jz];j>0;i++,j--) { fw = (double)((int)(twon24* z)); iq[i] = (int)(z-two24*fw); z = q[j-1]+fw; } /* compute n */ z = scalbn(z,q0); /* actual value of z */ z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */ n = (int) z; z -= (double)n; ih = 0; if(q0>0) { /* need iq[jz-1] to determine n */ i = (iq[jz-1]>>(24-q0)); n += i; iq[jz-1] -= i<<(24-q0); ih = iq[jz-1]>>(23-q0); } else if(q0==0) ih = iq[jz-1]>>23; else if(z>=0.5) ih=2; if(ih>0) { /* q > 0.5 */ n += 1; carry = 0; for(i=0;i0) { /* rare case: chance is 1 in 12 */ switch(q0) { case 1: iq[jz-1] &= 0x7fffff; break; case 2: iq[jz-1] &= 0x3fffff; break; } } if(ih==2) { z = one - z; if(carry!=0) z -= scalbn(one,q0); } } /* check if recomputation is needed */ if(z==zero) { j = 0; for (i=jz-1;i>=jk;i--) j |= iq[i]; if(j==0) { /* need recomputation */ for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */ for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */ f[jx+i] = (double) ipio2[jv+i]; for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; } jz += k; goto recompute; } } /* chop off zero terms */ if(z==0.0) { jz -= 1; q0 -= 24; while(iq[jz]==0) { jz--; q0-=24;} } else { /* break z into 24-bit if necessary */ z = scalbn(z,-q0); if(z>=two24) { fw = (double)((int)(twon24*z)); iq[jz] = (int)(z-two24*fw); jz += 1; q0 += 24; iq[jz] = (int) fw; } else iq[jz] = (int) z ; } /* convert integer "bit" chunk to floating-point value */ fw = scalbn(one,q0); for(i=jz;i>=0;i--) { q[i] = fw*(double)iq[i]; fw*=twon24; } /* compute PIo2[0,...,jp]*q[jz,...,0] */ for(i=jz;i>=0;i--) { for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; fq[jz-i] = fw; } /* compress fq[] into y[] */ switch(prec) { case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; } } return n&7; } /* @(#)e_rem_pio2.c 1.4 95/01/18 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== * */ /* __ieee754_rem_pio2(x,y) * * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2() */ //#include "fdlibm.h" /* * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const int two_over_pi[] = { #else static int two_over_pi[] = { #endif 0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, 0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, 0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, 0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, 0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, 0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, 0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, 0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, 0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, 0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, 0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, }; #ifdef __STDC__ static const int npio2_hw[] = { #else static int npio2_hw[] = { #endif 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, 0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A, 0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C, 0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB, 0x404858EB, 0x404921FB, }; /* * invpio2: 53 bits of 2/pi * pio2_1: first 33 bit of pi/2 * pio2_1t: pi/2 - pio2_1 * pio2_2: second 33 bit of pi/2 * pio2_2t: pi/2 - (pio2_1+pio2_2) * pio2_3: third 33 bit of pi/2 * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) */ #ifdef __STDC__ static const double #else static double #endif //zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */ half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ //two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */ pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */ pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */ pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ #ifdef __STDC__ int ieee754_rem_pio2(double x, double *y) #else int __ieee754_rem_pio2(x,y) double x,y[]; #endif { double z,w,t,r,fn; double tx[3]; int e0,i,j,nx,n,ix,hx; hx = __HI(x); /* high word of x */ ix = hx&0x7fffffff; if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ if(hx>0) { z = x - pio2_1; if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ y[0] = z - pio2_1t; y[1] = (z-y[0])-pio2_1t; } else { /* near pi/2, use 33+33+53 bit pi */ z -= pio2_2; y[0] = z - pio2_2t; y[1] = (z-y[0])-pio2_2t; } return 1; } else { /* negative x */ z = x + pio2_1; if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ y[0] = z + pio2_1t; y[1] = (z-y[0])+pio2_1t; } else { /* near pi/2, use 33+33+53 bit pi */ z += pio2_2; y[0] = z + pio2_2t; y[1] = (z-y[0])+pio2_2t; } return -1; } } if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */ t = fabs(x); n = (int) (t*invpio2+half); fn = (double)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 85 bit */ if(n<32&&ix!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { j = ix>>20; y[0] = r-w; i = j-(((__HI(y[0]))>>20)&0x7ff); if(i>16) { /* 2nd iteration needed, good to 118 */ t = r; w = fn*pio2_2; r = t-w; w = fn*pio2_2t-((t-r)-w); y[0] = r-w; i = j-(((__HI(y[0]))>>20)&0x7ff); if(i>49) { /* 3rd iteration need, 151 bits acc */ t = r; /* will cover all possible cases */ w = fn*pio2_3; r = t-w; w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } } y[1] = (r-y[0])-w; if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } /* * all other (large) arguments */ if(ix>=0x7ff00000) { /* x is inf or NaN */ y[0]=y[1]=x-x; return 0; } /* set z = scalbn(|x|,ilogb(x)-23) */ __LO(z) = __LO(x); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ __HI(z) = ix - (e0<<20); for(i=0;i<2;i++) { tx[i] = (double)((int)(z)); z = (z-tx[i])*two24; } tx[2] = z; nx = 3; while(tx[nx-1]==zero) nx--; /* skip zero term */ n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} return n; } lfortran-lfortran-2f73434/integration_tests/template_simple_02.f900000664000175000017500000000363115141516316025410 0ustar alastairalastairmodule template_simple_02_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_sum{integer, operator(+), cast_integer}(a_i) s_r = generic_sum{real, operator(+), cast_real}(a_r) s_i = generic_sum{integer, operator(+), cast_integer}(a_i) print *, s_i print *, s_r end subroutine end module program template_simple_02 use template_simple_02_m implicit none call test_template() endlfortran-lfortran-2f73434/integration_tests/intrinsics_92.f900000664000175000017500000000040015141516316024411 0ustar alastairalastairprogram intrinsics_92 real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = -4.721_8 if ( abs(anint(x4) - 1.0) > 1e-5 ) error stop if ( abs(anint(x8) + 5.0) > 1e-5) error stop x8 = anint(x4,8) if ( abs(x8 - 1.0) > 1e-5 ) error stop end lfortran-lfortran-2f73434/integration_tests/doloop_11.f900000664000175000017500000000033015141516316023511 0ustar alastairalastairprogram doloop11 implicit none integer :: i integer :: s s = 0 do i = 1, 2 s = i end do print *, s, i if (i /= 3) error stop if (s /= 2) error stop end program doloop11 lfortran-lfortran-2f73434/integration_tests/template_matrix_test.f900000664000175000017500000000251015141516316026154 0ustar alastairalastairmodule real_func_m public :: real_zero, real_one contains pure function real_zero() real :: real_zero real_zero = 0. end function pure function real_one() real :: real_one real_one = 1. end function end module module integer_func_m public :: integer_zero, integer_one contains pure function integer_zero() integer :: integer_zero integer_zero = 0. end function pure function integer_one() integer :: integer_one integer_one = 1. end function end module program template_matrix_test use matrix_m, only: matrix_tmpl use integer_func_m use real_func_m implicit none integer, parameter :: n = 2 instantiate matrix_tmpl(real, operator(+), real_zero, operator(*), real_one, n), only: & real_matrix => matrix, & real_plus_matrix => plus_matrix, & real_times_matrix => times_matrix, & real_matrix_subtraction_tmpl => matrix_subtraction_tmpl instantiate matrix_tmpl(integer, operator(+), integer_zero, operator(*), integer_one, n), only: & integer_matrix => matrix, & integer_plus_matrix => plus_matrix, & integer_times_matrix => times_matrix, & integer_matrix_subtraction_tmpl => matrix_subtraction_tmpl end programlfortran-lfortran-2f73434/integration_tests/derived_types_80.f900000664000175000017500000000110515141516316025072 0ustar alastairalastairmodule m_labels_derived_types_80 implicit none type :: toml_label character(:), allocatable :: source end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label end type toml_diagnostic end module m_labels_derived_types_80 program derived_types_80 use m_labels_derived_types_80 implicit none type(toml_diagnostic) :: diag type(toml_label) :: lbl integer, allocatable :: x lbl%source = "Something went wrong" diag%label = lbl print *, diag%label%source end program derived_types_80 lfortran-lfortran-2f73434/integration_tests/character_15.f900000664000175000017500000000026015141516316024157 0ustar alastairalastairprogram character_15 implicit none character*(*) hello parameter (hello = 'Hello world!') print *, hello if (len(hello) /= 12) error stop end program character_15 lfortran-lfortran-2f73434/integration_tests/derived_types_65.f900000664000175000017500000000160715141516316025104 0ustar alastairalastairmodule derived_types_65_m implicit none type :: t_date integer :: year, month, day end type type :: t_address character(len=:), allocatable :: city, road_name integer :: house_number end type type :: t_person character(len=:), allocatable :: first_name, last_name, e_mail end type type, extends(t_person) :: t_employee type(t_date) :: hired_date character(len=:), allocatable :: position real :: monthly_salary end type end module derived_types_65_m program derived_types_65 use derived_types_65_m implicit none type(t_employee) :: employee employee%first_name = 'John' employee%last_name = 'Doe' employee%hired_date%year = 2020 print *, 'Employee hired in year', employee%hired_date%year if (employee%hired_date%year /= 2020) error stop end program derived_types_65lfortran-lfortran-2f73434/integration_tests/arrays_op_2.f900000664000175000017500000000222015141516316024134 0ustar alastairalastairprogram array_op_2d implicit none integer :: a(2, 2, 1), b(2, 2, 1), c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i*i b(i, j, k) = j*j end do end do end do i = 0 print *, a(1, 1, 1), a(1, 2, 1), a(2, 1, 1), a(2, 2, 1) print *, b(1, 1, 1), b(1, 2, 1), b(2, 1, 1), b(2, 2, 1) c = a + b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 2 ) error stop if( c(1, 2, 1) /= 5 ) error stop if( c(2, 1, 1) /= 5 ) error stop if( c(2, 2, 1) /= 8 ) error stop c = a - b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 0 ) error stop if( c(1, 2, 1) /= -3 ) error stop if( c(2, 1, 1) /= 3 ) error stop if( c(2, 2, 1) /= 0 ) error stop c = a*b print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 1 ) error stop if( c(1, 2, 1) /= 4 ) error stop if( c(2, 1, 1) /= 4 ) error stop if( c(2, 2, 1) /= 16 ) error stop c = b/a print *, c(1, 1, 1), c(1, 2, 1), c(2, 1, 1), c(2, 2, 1) if( c(1, 1, 1) /= 1 ) error stop if( c(1, 2, 1) /= 4 ) error stop if( c(2, 1, 1) /= 0 ) error stop if( c(2, 2, 1) /= 1 ) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_29.f900000664000175000017500000000016115141516316023700 0ustar alastairalastairprogram modules_29 use fpm_manifest_executable implicit none print *, "running modules_29 program" end program lfortran-lfortran-2f73434/integration_tests/arrays_95.f900000664000175000017500000000076515141516316023546 0ustar alastairalastairmodule module_arrays_95_mm contains function foo(ii) result(res) integer :: ii integer :: res(10) res = -8 res(ii) = 9 end function end module program arrays_95 use module_arrays_95_mm integer :: inn integer :: res(10) inn = 1 print *, foo(inn) res = foo(inn) if (res(inn) /= 9) error stop "Test failed" if (size(foo(inn)) /= 10) error stop "Test failed" if (all(res(inn:) == -8)) error stop "Test failed" end program lfortran-lfortran-2f73434/integration_tests/issue_7357.f900000664000175000017500000000127415141516316023541 0ustar alastairalastairmodule stdlib_hashmaps implicit none type open_map_entry_ptr integer(4) :: inmap end type open_map_entry_ptr type :: open_hashmap_type type(open_map_entry_ptr), allocatable :: inverse(:) end type open_hashmap_type end module stdlib_hashmaps program main use stdlib_hashmaps implicit none type(open_hashmap_type) :: map type(open_map_entry_ptr), allocatable :: dummy_inverse(:) allocate(dummy_inverse(1)) call move_alloc( dummy_inverse, map % inverse ) print *, size(map % inverse) if (allocated(dummy_inverse)) error stop if (.not. allocated(map%inverse)) error stop if (size(map%inverse) /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_312.f900000664000175000017500000000330015141516316024466 0ustar alastairalastairprogram intrinsics_312 integer(4), parameter :: i1(1) = minloc([1,2,3]) integer(4), parameter :: i2(1) = minloc([1.0, 2.0, 3.0]) integer(4), parameter :: i3(1) = minloc(["aa", "db", "ca"]) integer(4), parameter :: i4(1) = minloc([1,2,3], mask = [.true., .true., .true.]) integer(8), parameter :: i5(1) = minloc([1,2,3], mask=[.true., .false., .true.], kind = 8) integer(4), parameter :: i6(1) = minloc([1,2,3], mask=[.true., .false., .true.], dim=1) integer(4), parameter :: i7(1) = minloc(["aa", "db", "ca"], mask=[.true., .false., .true.]) integer(4), parameter :: i8(1) = minloc(["aa", "db", "ca"], mask=[.true., .false., .true.], dim = 1) integer(4), parameter :: i9(1) = minloc([1, 3, 2], mask = [.true., .false., .true.], back = .true.) integer(4), parameter :: i10(1) = minloc([3, 2, 1, 3], back = .true.) integer(4), parameter :: i11(1) = minloc([3.0, 2.0, 1.0, 3.0], back = .true., dim=1) integer(4), parameter :: i12(1) = minloc(["aa", "db", "ca"], mask = [.false., .false., .false.], kind = 4) print *, i1 if (i1(1) /= 1) error stop print *, i2 if (i2(1) /= 1) error stop print *, i3 if (i3(1) /= 1) error stop print *, i4 if (i4(1) /= 1) error stop print *, i5 if (i5(1) /= 1) error stop print *, i6 if (i6(1) /= 1) error stop print *, i7 if (i7(1) /= 1) error stop print *, i8 if (i8(1) /= 1) error stop print *, i9 if (i9(1) /= 1) error stop print *, i10 if (i10(1) /= 3) error stop print *, i11 if (i11(1) /= 3) error stop print *, i12 if (i12(1) /= 0) error stop print *, kind(minloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) if (kind(minloc(["aa", "db", "ca"], 1, mask = [.false., .false., .false.], kind = 8)) /= 8) error stop end program lfortran-lfortran-2f73434/integration_tests/format_08.f900000664000175000017500000000026615141516316023523 0ustar alastairalastairprogram format_08 implicit none character(:), allocatable :: a integer :: b(10) a = "xx" b = 1 print "(aai6)", a,"hi",15 print "(1000(i6))", b end programlfortran-lfortran-2f73434/integration_tests/valid_array_assignment_same_length_different_start.f900000664000175000017500000000062415141516316034260 0ustar alastairalastairprogram valid_array_assignment_same_length_different_start ! array with size 3 and start index 2 integer :: arr1(2:4) ! array with size 3 and start index 1 integer :: arr2(1:3) arr1 = [1, 2, 3] ! valid assignment as only "size" matters for array ! assignment, not "start index" arr2 = arr1 if (size(arr2) /= 3) error stop if (arr2(1) /= 1) error stop end program lfortran-lfortran-2f73434/integration_tests/file_01_data.txt0000664000175000017500000000004115141516316024344 0ustar alastairalastair10130 c 4.20 9223372036854775804 lfortran-lfortran-2f73434/integration_tests/custom_unary_operator_01.f900000664000175000017500000000126615141516316026670 0ustar alastairalastairmodule custom_unary_operator_01_module implicit none public :: operator(.negation.) interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i end function negative end module custom_unary_operator_01_module program custom_unary_operator_01 use custom_unary_operator_01_module, only : operator(.negation.) implicit none integer :: res integer :: input_int input_int = 10 res = .negation. input_int print *, "res: ", res print *, "res /= -input_int: ", res /= -input_int if (res /= -input_int) error stop end program custom_unary_operator_01 lfortran-lfortran-2f73434/integration_tests/intrinsics_05.f900000664000175000017500000000016615141516316024414 0ustar alastairalastairprogram intrinsics_05 real :: x x = sinh(1.0) print *, x x = cosh(1.0) print *, x x = tanh(1.0) print *, x end lfortran-lfortran-2f73434/integration_tests/file_40.f900000664000175000017500000000150215141516316023140 0ustar alastairalastairprogram file_40 implicit none integer :: i real :: r open(10, file="data.txt", status="replace", form="formatted") write(10,'(A)') "1 2" ! INTEGER field (I4) write(10,'(A)') "3 . 5" ! REAL field (F5.1) close(10) open(10, file="data.txt", form="formatted", blank="null") read(10,'(I4)') i read(10,'(F5.1)') r close(10) print *, "INTEGER :", i ! -> 12 print *, "REAL :", r ! -> 3.5 if ( i /= 12) error stop if ( r /= 3.5) error stop open(10, file="data.txt", form="formatted", blank="zero") read(10,'(I4)') i read(10,'(F5.1)') r close(10) print *, "INTEGER :", i ! -> 1002 print *, "REAL :", r ! -> 3.5 (same result) if ( i /= 1002) error stop if ( abs(r-30.0499992) > 1e-6 ) error stop end program lfortran-lfortran-2f73434/integration_tests/block_09.f900000664000175000017500000000044215141516316023322 0ustar alastairalastairblock data init_data real :: xyzzy common xyzzy data xyzzy / 42.0 / end block data init_data program test_blank_common implicit none real :: xyzzy common xyzzy if (abs(xyzzy - 42.0) > 1.0e-8) error stop "wrong value" print *, "test passed" end program test_blank_common lfortran-lfortran-2f73434/integration_tests/separate_compilation_13.f900000664000175000017500000000031015141516316026417 0ustar alastairalastairprogram separate_compilation_13 use ieee_arithmetic, only: ieee_quiet_nan use separate_compilation_13a_module real :: x call check(x) print *, x if (abs(x - 151.15981) > 1e-8) error stop end program lfortran-lfortran-2f73434/integration_tests/dlaswap.f900000664000175000017500000000450315141516316023355 0ustar alastairalastairsubroutine dlaswp(n, a, lda, k1, k2, ipiv, incx) INTEGER INCX, K1, K2, LDA, N INTEGER IPIV( * ) DOUBLE PRECISION A( LDA, * ) INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32 DOUBLE PRECISION TEMP IF( incx > 0 ) THEN ix0 = k1 i1 = k1 i2 = k2 inc = 1 ELSE IF( incx < 0 ) THEN ix0 = k1 + ( k1-k2 )*incx i1 = k2 i2 = k1 inc = -1 ELSE RETURN END IF n32 = ( n / 32 )*32 IF( n32 /= 0 ) THEN DO 30 j = 1, n32, 32 ix = ix0 DO 20 i = i1, i2, inc ip = ipiv( ix ) IF( ip /= i ) THEN DO 10 k = j, j + 31 temp = a( i, k ) a( i, k ) = a( ip, k ) a( ip, k ) = temp 10 CONTINUE END IF ix = ix + incx 20 CONTINUE 30 CONTINUE END IF IF( n32 /= n ) THEN n32 = n32 + 1 ix = ix0 DO 50 i = i1, i2, inc ip = ipiv( ix ) IF( ip /= i ) THEN DO 40 k = n32, n temp = a( i, k ) a( i, k ) = a( ip, k ) a( ip, k ) = temp 40 CONTINUE END IF ix = ix + incx 50 CONTINUE END IF RETURN end subroutine PROGRAM test_dlaswp INTEGER :: n, lda, k1, k2, incx, i INTEGER, ALLOCATABLE :: ipiv(:) DOUBLE PRECISION, ALLOCATABLE :: a(:,:) ! Define the input values n = 4 lda = 4 k1 = 1 k2 = 4 incx = 1 ! Allocate the arrays ALLOCATE(ipiv(n)) ALLOCATE(a(lda, n)) ! Initialize the matrix 'a' in column-major order a = RESHAPE([ 1.0D0, 2.0D0, 3.0D0, 4.0D0, & 5.0D0, 6.0D0, 7.0D0, 8.0D0, & 9.0D0, 10.0D0, 11.0D0, 12.0D0, & 13.0D0, 14.0D0, 15.0D0, 16.0D0 ], [ lda, n ]) ! Initialize the pivot array ipiv = [4, 1, 2, 3] ! Print the original matrix PRINT *, "Original matrix A:" DO i = 1, lda PRINT *, a(i, :) END DO ! Call the subroutine CALL dlaswp(n, a, lda, k1, k2, ipiv, incx) ! Print the modified matrix PRINT *, "Modified matrix A:" DO i = 1, lda PRINT *, a(i, :) END DO END PROGRAM test_dlaswp lfortran-lfortran-2f73434/integration_tests/func_parameter_type_02.f900000664000175000017500000000035215141516316026255 0ustar alastairalastairSUBROUTINE sub(f) EXTERNAL f H=HINIT853(f) RETURN END REAL FUNCTION HINIT853(f) HINIT853 = f(3.0) END Real function f(x) real :: x f = x end function program main EXTERNAL f call sub(f) end programlfortran-lfortran-2f73434/integration_tests/array_section_09.f900000664000175000017500000000314415141516316025074 0ustar alastairalastair! Test ILP64 array section with assumed-size arrays ! This tests that array section operations work correctly when ! -fdefault-integer-8 is used (ILP64 mode) program array_section_ilp64 implicit none integer, parameter :: n = 4 real :: a(n, n) integer :: i, j do j = 1, n do i = 1, n a(i, j) = real(i + j * 10) end do end do call test_section(a, n, 2, 3) contains subroutine test_section(a, lda, ilo, ihi) integer, intent(in) :: lda, ilo, ihi real, intent(inout) :: a(lda, *) real :: sum_val integer :: i, j sum_val = 0.0 do j = ilo, ihi do i = ilo, ihi sum_val = sum_val + a(i, j) end do end do ! Expected: a(2,2) + a(3,2) + a(2,3) + a(3,3) ! = 22 + 23 + 32 + 33 = 110 if (abs(sum_val - 110.0) > 0.001) error stop ! Test array section passed to subroutine call modify_section(a(ilo:ihi, ilo:ihi), ihi - ilo + 1) ! Verify modification: each element should be multiplied by 2 sum_val = 0.0 do j = ilo, ihi do i = ilo, ihi sum_val = sum_val + a(i, j) end do end do ! Expected: 110 * 2 = 220 if (abs(sum_val - 220.0) > 0.001) error stop end subroutine subroutine modify_section(b, n) integer, intent(in) :: n real, intent(inout) :: b(n, n) integer :: i, j do j = 1, n do i = 1, n b(i, j) = b(i, j) * 2.0 end do end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_161.f900000664000175000017500000000323415141516316024476 0ustar alastairalastairprogram intrinsics_161 integer :: a1 = 5, a2 = 8 integer(8) :: a3 = -1, a4 = -4 integer :: a5 = -2, a6 = -5 integer, parameter :: i1 = ieor(5, 8) integer, parameter :: i2 = ieor(-1, 5) integer, parameter :: i3 = ieor(-4_8, 2_8) integer(8), parameter :: i4 = ieor(-2_8, 5_8) integer, parameter :: ar1(3) = ieor([5, 8, 9], [8, 5, 2]) integer(8), parameter :: ar2(3) = ieor([-1_8, -5_8, -10_8], [5_8, 8_8, 9_8]) integer :: arr1(3), arr3(3) integer(8) :: arr2(3) integer :: res(3) arr1 = [5, 8, 9] arr3 = [8, 5, 2] arr2 = [-1_8, -5_8, -10_8] print *, i1 if (i1 /= 13) error stop print *, i2 if (i2 /= -6) error stop print *, i3 if (i3 /= -2) error stop print *, i4 if (i4 /= -5) error stop print*, ieor(5, 8) if (ieor(5, 8) /= 13) error stop print*, ieor(-1, 5) if (ieor(-1, 5) /= -6) error stop print*, ieor(8, -4) if (ieor(8, -4) /= -12) error stop print*, ieor(-2, -5) if (ieor(-2, -5) /= 5) error stop print*, ieor(a1, a2) if (ieor(a1, a2) /= 13) error stop print*, ieor(a3, a4) if (ieor(a3, a4) /= 3) error stop print*, ieor(a2, a5) if (ieor(a2, a5) /= -10) error stop print*, ieor(a5, a6) if (ieor(a5, a6) /= 5) error stop print *, ar1 if (any(ar1 /= [13, 13, 11])) error stop print *, ar2 if (any(ar2 /= [-6, -13, -1])) error stop print *, ieor(arr1, arr3) if (any(ieor(arr1, arr3) /= [13, 13, 11])) error stop print *, ieor(arr2, arr2) if (any(ieor(arr2, arr2) /= [0, 0, 0])) error stop res = ieor(arr1, arr3) print *, res if (any(res /= [13, 13, 11])) error stop end program lfortran-lfortran-2f73434/integration_tests/class_67.f900000664000175000017500000000171015141516316023340 0ustar alastairalastairmodule class_67_mod implicit none type :: other_type class(*), allocatable :: value end type other_type contains subroutine copy_other(src, dest) type(other_type), intent(in) :: src type(other_type), intent(out) :: dest allocate(dest%value, source=src%value) end subroutine copy_other end module class_67_mod program class_67 use class_67_mod, only : copy_other, other_type implicit none type :: dummy_type integer :: val(15) end type dummy_type type(other_type) :: other_in, other_out type(dummy_type) :: dummy_val integer :: i dummy_val%val = [(i, i=1,15)] allocate(other_in%value, source=dummy_val) call copy_other(other_in, other_out) ! TODO: (Issue 8645) Handle class(*) in allocate ! select type(p => other_out%value) ! type is (dummy_type) ! if (p%val(1) /= 1 .or. p%val(15) /= 15) error stop ! end select end program class_67 lfortran-lfortran-2f73434/integration_tests/format_42.f900000664000175000017500000000141515141516316023516 0ustar alastairalastairprogram format_42 implicit none real :: val1, val2 character(len=50) :: str1, str2 val1 = 42.43 val2 = 123.456 ! Test PE format with exponent width (E_int suffix) write(str1, 100) val1 write(str2, 200) val2 write(*, 100) val1 write(*, 200) val2 ! Verify the format works correctly ! With 3P scale factor: 42.43 displays as 424.3000E-01 ! The format is E14.6E2, so it uses 14 characters total if (trim(adjustl(str1)) /= '424.3000E-01') error stop "PE14.6E2 format failed" ! With 2P scale factor: 123.456 displays as 12.3456E+01 ! The format is E12.5E2, so it uses 12 characters total if (trim(adjustl(str2)) /= '12.3456E+01') error stop "PE12.5E2 format failed" print *, "PASSED" 100 format (3PE14.6E2) 200 format (2PE12.5E2) end program lfortran-lfortran-2f73434/integration_tests/intrinsics_108.f900000664000175000017500000000532715141516316024504 0ustar alastairalastairprogram intrinsics_108 integer(4) :: x, y, i_4 integer(8) :: i, j integer :: arr3(3) integer(4) :: arg_x(5) = [12, 13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, 95, 134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = shiftr([12, 13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = shiftr([103, 87, 88, 95, 134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [6, 3, 2, 1, 2] integer(8) :: expected_res2(5) = [0, 0, 5, 95, 0] integer(4), parameter :: comp1 = shiftr(12, 1) integer(4), parameter :: neg1 = shiftr(-122, 23) integer(8), parameter :: comp2 = shiftr(103, 11) integer(8), parameter :: neg2 = shiftr(-19381002102129_8, 63) print *, comp1 if (comp1 /= 6) error stop print *, comp2 if (comp2 /= 0) error stop res_x = shiftr(arg_x, arg_y) res_x2 = shiftr(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, shiftr(10_4, 0) if (.not. shiftr(10_4, 0) == 10) error stop print*, shiftr(-10_8, 1) ! if ( shiftr(i, j) /= 9223372036854775803 ) error stop ! Does not work yet print*, shiftr(not(10_4), 2) ! if ( shiftr(i, j) /= 1073741821 ) error stop ! Does not work yet print*, shiftr(not(10_8), 3) ! if ( shiftr(i, j) /= 2305843009213693950 ) error stop ! Does not work yet print*, shiftr(-x, y) ! if ( shiftr(-x, y) /= 1073741820 ) error stop print*, shiftr(i, j) if ( shiftr(i, j) /= 0 ) error stop print*, shiftr(10, 1) if ( shiftr(10, 1) /= 5 ) error stop print*, shiftr(8, 2) if ( shiftr(8, 2) /= 2 ) error stop ! test broadcasting of `shiftr` arr3 = shiftr([20, 11, 8], 1) if (arr3(1) /= 10) error stop if (arr3(2) /= 5) error stop if (arr3(3) /= 4) error stop arr3 = shiftr([20, 11, 8], [1, 2, 3]) if (arr3(1) /= 10) error stop if (arr3(2) /= 2) error stop if (arr3(3) /= 1) error stop i_4 = -122 j = -19381002102129_8 x = 23 y = 63 print *, shiftr(i_4, x), shiftr(j, y) if (shiftr(i_4, x) /= 511 .or. shiftr(j, y) /= 1) error stop print *, neg1, neg2 if (neg1 /= 511 .or. neg2 /= 1) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_372.f900000664000175000017500000000041215141516316024475 0ustar alastairalastairprogram intrinsics_372 real, allocatable :: a(:), b(:) complex :: c(2) allocate(a(2)) allocate(b(2)) a = 1 b = 2 c = cmplx(a,b) print *, c if (c(1) /= (1.0, 2.0)) error stop if (c(2) /= (1.0, 2.0)) error stop end programlfortran-lfortran-2f73434/integration_tests/elemental_10.f900000664000175000017500000000600215141516316024164 0ustar alastairalastairprogram elemental_10 implicit none real, dimension(1) :: array_param real :: scalar_param, expected_ans, epsilon = 1.0e-6 real, dimension(1) :: result_2param real, dimension(1) :: result_3param array_param = [1.0] scalar_param = 1.0 expected_ans = 2.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) if (any(abs(result_2param - 2.0) > epsilon)) then error stop "Array, Array does not match 1.0" end if result_2param = func2(array_param, scalar_param) if (any(abs(result_2param - expected_ans) > epsilon)) then error stop "Array, Scalar does not match 1.0" end if result_2param = func2(scalar_param, array_param) if (any(abs(result_2param - expected_ans) > epsilon)) then error stop "Scalar, Array does not match 1.0" end if result_2param = func2(scalar_param, scalar_param) if (abs(result_2param(1) - expected_ans) > epsilon) then error stop "Scalar, Scalar does not match 1.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Array, Array does not match 1.0" end if result_3param = func3(array_param, array_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Array, Scalar does not match 1.0" end if result_3param = func3(array_param, scalar_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Scalar, Array does not match 1.0" end if result_3param = func3(array_param, scalar_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Array, Scalar, Scalar does not match 1.0" end if result_3param = func3(scalar_param, array_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Array, Array does not match 1.0" end if result_3param = func3(scalar_param, array_param, scalar_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Array, Scalar does not match 1.0" end if result_3param = func3(scalar_param, scalar_param, array_param) if (any(abs(result_3param - expected_ans) > epsilon)) then error stop "Scalar, Scalar, Array does not match 1.0" end if result_3param = func3(scalar_param, scalar_param, scalar_param) if (abs(result_3param(1) - expected_ans) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 1.0" end if contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_10 lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_05.f900000664000175000017500000000141515141516316026054 0ustar alastairalastairmodule pass_array_by_data_05_find_fit_module implicit none contains subroutine find_fit(data_x, expr) real, intent(in) :: data_x(:) real :: y interface function expr(x) result(z) real, intent(in) :: x(:) real :: z end function expr end interface print *, size(data_x) y = expr(data_x) print *, y if (abs(y - 6.000) > 1e7 ) error stop end subroutine find_fit end module program example_primes use pass_array_by_data_05_find_fit_module, only: find_fit implicit none real :: data_x(3) integer :: i data_x = [1.0, 2.0, 3.0] call find_fit(data_x, expression) contains function expression(x) result(y) real, intent(in) :: x(:) real :: y integer :: i y = 0.0 do i = 1, size(x) y = y + x(i) end do end function expression end program example_primes lfortran-lfortran-2f73434/integration_tests/utf8_bom_01.f900000664000175000017500000000016015141516316023740 0ustar alastairalastairprogram utf8_bom_01 integer :: x x = 42 if (x /= 42) error stop print *, "UTF-8 BOM test passed" end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_04a.f900000664000175000017500000000036615141516316026573 0ustar alastairalastairmodule separate_compilation_04a_module implicit none contains subroutine lu() end subroutine subroutine resol_lu(L) real, allocatable :: L(:,:) print *, sum(L) if ( abs(sum(L) - 2.08361094e+04 ) > 1e-8 ) error stop end subroutine end module lfortran-lfortran-2f73434/integration_tests/intrinsics_369.f900000664000175000017500000000022115141516316024501 0ustar alastairalastairprogram intrinsics_369 implicit none real(kind(1d0)):: x = huge(x) print *, x if (abs(x - huge(x)) > 1e-8) error stop end program intrinsics_369 lfortran-lfortran-2f73434/integration_tests/implicit_interface_15.f900000664000175000017500000000026615141516316026063 0ustar alastairalastairprogram implicit_interface_15 real a(3) a = [1.0, 12.512, -3.512] call stfsm(a) end program subroutine stfsm( a ) real :: a( 0: * ) external :: strsm call strsm( a, 3 ) return end lfortran-lfortran-2f73434/integration_tests/intrinsics_290.f900000664000175000017500000000403315141516316024477 0ustar alastairalastairprogram intrinsics_290 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: a real(sp) :: d integer :: i real(dp) :: log_runtime_dp(3) = [0.875_dp, 3.367_dp, 2.140_dp] real(sp) :: log_runtime_sp(3) = [0.875, 3.367, 2.140] real(dp) :: log_res_dp(3) real(sp) :: log_res_sp(3) real(dp) :: expected_dp(3) = [-5.7991946977686754E-002_dp, 0.52724311638808863_dp, 0.33041377334919086_dp] real(sp) :: expected_sp(3) = [-5.79919480E-02_sp, 0.527243137_sp, 0.330413789] real(dp), parameter :: res(3) = log10([0.875_dp, 3.367_dp, 2.140_dp]) real(sp), parameter :: res_sp(3) = log10([0.875, 3.367, 2.140]) do i = 1, 3 print *, res(i) if (abs(res(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, res_sp(i) if (abs(res_sp(i) - expected_sp(i)) > 1e-5) error stop end do log_res_dp = log10(log_runtime_dp) log_res_sp = log10(log_runtime_sp) do i = 1, 3 print *, log_res_dp(i) if (abs(log_res_dp(i) - expected_dp(i)) > 1e-12_dp) error stop end do do i = 1, 3 print *, log_res_sp(i) if (abs(log_res_sp(i) - expected_sp(i)) > 1e-5) error stop end do a = log10(10.92839272_dp) d = log10(10.92839272) print *, a if (a - 1.03855629331626087e+00_dp > 1e-12_dp) error stop print *,log10(10.92839272_dp) if (log10(10.92839272_dp) - 1.03855629331626087e+00_dp > 1e-12_dp) error stop print *, d if (d - 1.03855634e+00_sp > 1e-5) error stop print *, log10(10.92839272) if (log10(10.92839272) - 1.03855634e+00_sp > 1e-5) error stop a = log10(83.728927_dp) d = log10(31.738222) print *, a if (a - 1.92287552568858744e+00_dp > 1e-12_dp) error stop print *,log10(83.728927_dp) if (log10(83.728927_dp) - 1.92287552568858744e+00_dp > 1e-12_dp) error stop print *, d if (d - 1.50158262e+00_sp > 1e-5) error stop print *, log10(31.738222) if (log10(31.738222) - 1.50158262e+00_sp > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/template_unitring.f900000664000175000017500000000362615141516316025461 0ustar alastairalastairmodule unit_ring_m use semiring_m, only: semiring implicit none private public :: & unit_ring_only_minus, & unit_ring_only_negate, & unit_ring, & derive_unit_ring_from_minus, & derive_unit_ring_from_negate requirement unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: semiring(T, plus, zero, mult, one) elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference end function end requirement requirement unit_ring_only_negate(T, plus, zero, mult, one, negate) require :: semiring(T, plus, zero, mult, one) elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated end function end requirement requirement unit_ring(T, plus, zero, mult, one, minus, negate) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) end requirement template derive_unit_ring_from_minus(T, plus, zero, mult, one, minus) require :: unit_ring_only_minus(T, plus, zero, mult, one, minus) private public :: negate contains elemental function negate(x) result(negated) type(T), intent(in) :: x type(T) :: negated negated = minus(zero(), x) end function end template template derive_unit_ring_from_negate(T, plus, zero, mult, one, negate) require :: unit_ring_only_negate(T, plus, zero, mult, one, negate) private public :: minus contains elemental function minus(x, y) result(difference) type(T), intent(in) :: x, y type(T) :: difference difference = plus(x, negate(y)) end function end template end module lfortran-lfortran-2f73434/integration_tests/intrinsics_307.f900000664000175000017500000000171415141516316024501 0ustar alastairalastairprogram intrinsics_307 implicit none real, parameter :: x1 = imag((1.0, 2.0)) real(8), parameter :: x2 = imag((1.0_8, 2.0_8)) real, parameter :: ar1(3) = imag([(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)]) real(8), parameter :: ar2(3) = imag([(1.0_8, 2.0_8), (3.0_8, 4.0_8), (5.0_8, 6.0_8)]) complex :: x = (1.0, 2.0) complex(8) :: y = (1.0_8, 2.0_8) complex :: z(3) = [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)] print *, x1 if (x1 /= 2.0) error stop print *, x2 if (x2 /= 2.0_8) error stop print *, imag(x) if (imag(x) /= 2.0) error stop print *, imag(y) if (imag(y) /= 2.0_8) error stop print *, ar1 if (any(ar1 /= [2.0, 4.0, 6.0])) error stop print *, ar2 if (any(ar2 /= [2.0_8, 4.0_8, 6.0_8])) error stop print *, imag(x) if (imag(x) /= 2.0) error stop print *, imag(y) if (imag(y) /= 2.0_8) error stop print *, imag(z) if (any(imag(z) /= [2.0, 4.0, 6.0])) error stop end programlfortran-lfortran-2f73434/integration_tests/openmp_47.f900000664000175000017500000000040515141516316023527 0ustar alastairalastairprogram openmp_47 use omp_lib implicit none real::res res=1 call omp_set_num_threads(16) !$omp parallel reduction(*:res) res=res*1.5 !$omp end parallel if(res /= 1.5**16) error stop print *, res end program openmp_47lfortran-lfortran-2f73434/integration_tests/nested_vars1.f900000664000175000017500000000063515141516316024322 0ustar alastairalastairmodule nested_vars1 implicit none contains subroutine h(x) integer, intent(inout) :: x x = x + 1 call g() contains subroutine g() x = x + 1 end subroutine endsubroutine end module program nested_vars1_main use nested_vars1, only: h implicit none integer :: x x = 5 call h(x) print *, x if (x /= 7) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_68.f900000664000175000017500000000223215141516316024421 0ustar alastairalastairprogram intrinsics_68 double precision :: x, y x = 1.0D0 y = -2.0D0 print *, dsign(x, y) print *, dsign(x, -y) print *, dsign(-x, y) print *, dsign(-x, -y) if (abs(dsign(x, y) - (-1.0D0)) > 1d-14) error stop if (abs(dsign(x, -y) - (1.0D0)) > 1d-14) error stop if (abs(dsign(-x, y) - (-1.0D0)) > 1d-14) error stop if (abs(dsign(-x, -y) - (1.0D0)) > 1d-14) error stop print *, dsign(0.0D0, y) print *, dsign(0.0D0, -y) print *, dsign(x, 0.0D0) print *, dsign(-x, 0.0D0) if (abs(dsign(0.0D0, y) - (-0.0D0)) > 1d-14) error stop if (abs(dsign(0.0D0, -y) - (0.0D0)) > 1d-14) error stop if (abs(dsign(x, 0.0D0) - (1.0D0)) > 1d-14) error stop if (abs(dsign(-x, 0.0D0) - (1.0D0)) > 1d-14) error stop print *, dsign(0.0D0, 0.0D0) print *, dsign(-0.0D0, 0.0D0) print *, dsign(0.0D0, -0.0D0) print *, dsign(-0.0D0, -0.0D0) if (abs(dsign(0.0D0, 0.0D0) - (0.0D0)) > 1d-14) error stop if (abs(dsign(-0.0D0, 0.0D0) - (0.0D0)) > 1d-14) error stop if (abs(dsign(0.0D0, -0.0D0) - (-0.0D0)) > 1d-14) error stop if (abs(dsign(-0.0D0, -0.0D0) - (-0.0D0)) > 1d-14) error stop end program lfortran-lfortran-2f73434/integration_tests/openmp_61.f900000664000175000017500000000057615141516316023534 0ustar alastairalastairprogram openmp_61 use omp_lib implicit none integer :: array(1005), i,sum=0 !$omp teams num_teams(4) !$omp distribute do i = 1, 1000 array(i) = i * 2 end do !$omp end distribute !$omp end teams ! Sum of all elements !$omp parallel do reduction(+:sum) do i=1,1000 sum=sum+array(i) end do !$omp end parallel do print *,sum if(sum/=1001000) error stop end program openmp_61lfortran-lfortran-2f73434/integration_tests/modules_55.f900000664000175000017500000000074715141516316023711 0ustar alastairalastairmodule stdlib_kinds_modules_55 use iso_fortran_env, only: int64 implicit none private public :: int64 end module stdlib_kinds_modules_55 module stdlib_hashmaps_modules_55 use stdlib_kinds_modules_55, only: int64 implicit none private integer, parameter, public :: int_calls = int64 end module stdlib_hashmaps_modules_55 program modules_55 use stdlib_hashmaps_modules_55 implicit none print *, int_calls if( int_calls /= 8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_18.f900000664000175000017500000000023215141516316026427 0ustar alastairalastairprogram separate_compilation_18 use mod_separate_compilation_18, only: f implicit none integer :: i i = f(5) print *, i if (i /= 6) error stop end programlfortran-lfortran-2f73434/integration_tests/common_11.f900000664000175000017500000000031415141516316023507 0ustar alastairalastairsubroutine sub1() double precision el common /dvod01/ el(13) end subroutine sub2() double precision el common /dvod01/ el(13) end program common_11 call sub1() call sub2() end program lfortran-lfortran-2f73434/integration_tests/array_section_08.f900000664000175000017500000000320515141516316025071 0ustar alastairalastair! Test self-referencing array section assignments with --realloc-lhs-arrays ! This tests the fix for use-after-free when arr = arr(i:j) causes realloc ! to free/move memory before the copy completes. program array_section_08 implicit none call test_simple_array() call test_struct_array() print *, "PASS" contains subroutine test_simple_array() real, allocatable :: arr(:) integer :: i allocate(arr(5)) do i = 1, 5 arr(i) = real(i * 10) end do arr = arr(3:5) ! Self-referencing - was causing use-after-free if (size(arr) /= 3) error stop "simple: size should be 3" if (arr(1) /= 30.0) error stop "simple: arr(1) should be 30" if (arr(2) /= 40.0) error stop "simple: arr(2) should be 40" if (arr(3) /= 50.0) error stop "simple: arr(3) should be 50" end subroutine subroutine test_struct_array() type :: item_t character(len=:), allocatable :: name integer :: value end type item_t type(item_t), allocatable :: items(:) integer :: i allocate(items(3)) do i = 1, 3 allocate(character(len=10) :: items(i)%name) items(i)%name = "item" // char(48 + i) items(i)%value = i * 10 end do items = items(2:3) ! Self-referencing struct array if (size(items) /= 2) error stop "struct: size should be 2" if (items(1)%value /= 20) error stop "struct: items(1)%value should be 20" if (items(2)%value /= 30) error stop "struct: items(2)%value should be 30" end subroutine end program array_section_08 lfortran-lfortran-2f73434/integration_tests/intrinsics_204.f900000664000175000017500000001373515141516316024503 0ustar alastairalastairprogram intrinsics_204 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(dp) :: x(40) real(dp) :: expected(40) real(dp) :: expected_res(32) integer :: i real :: y(28) real :: expected_y(28) real(dp), parameter :: res(32) = bessel_y1([9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp, & 9.99200319880048e307_dp, 1036.462826483388272_dp, 1.7197292882018389_dp, & 10.2368267382872828_dp, 0.17197292882018389_dp, 152.67283628_dp, & 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp]) expected_res = [-1.1242697836494346E-156_dp, -3.6987410577069675E-155_dp, 6.6185432736853698E-155_dp, & -7.9441122443324676E-155_dp, & -1.2379145453411093E-002_dp, -0.27253834632671181_dp, 0.24932183511315256_dp, -3.8313116038851942_dp, & -2.9667345859170198E-002_dp, 2.4613344707389746E-002_dp, -0.56789241609783492_dp, -0.57335504482194688_dp, & 0.10420535567671903_dp, 0.13391492370821437_dp, -7.8417916615948820E-003_dp, -6.8571787853437760E-002_dp, & 0.16838460392882040_dp, 5.4736765729333475E-002_dp, 5.3856989331157942E-002_dp, 5.2089913683587979E-002_dp, & -1.1559813724346837_dp, -1.1563150553800137_dp, -1.1566489944373206_dp, -1.1569831898838661_dp, & -1.4609752198895190_dp, -1.4611112512331177_dp, -1.4612475261578066_dp, -1.4615208070815726_dp, & 1.5957661062982142E-002_dp, 1.8761706846965608E-002_dp, 2.1413515766267922E-002_dp, 2.6176157352140857E-002_dp] do i = 1, size(res) print *, res(i) if (abs(res(i) - expected_res(i)) > 1e-5_dp) error stop end do x = [9.98600559790084e307_dp,9.98800479820072e307_dp,9.9900039985006e307_dp,9.99200319880048e307_dp, & 1036.462826483388272_dp, 1.7197292882018389_dp, 10.2368267382872828_dp, 0.17197292882018389_dp, & 152.67283628_dp, 632.92729728_dp, 1.2728272919_dp, 1.265228272919_dp, & 3.229995504589554d-153, 1.9201212555874555d-153, 6.809537363878625d-155, 5.690181373063991d-154, & 29.82407037185126_dp, 35.2459016393_dp, 46.2634946_dp, 24.7740903638_dp, & 15.8978408636372_dp, 8.801468212714914_dp, 8.798080767692923_dp, 8.791287884846061575_dp, & 0.6635324560331525_dp, 0.6633115808685429_dp, 0.6630906573122884_dp, 0.6628696853957159_dp, & 0.5042349934053336_dp, 0.5041796815747646_dp, 0.5041242821300232_dp, 0.50401322049655_dp, & 1.3994502099160337d-303, 1.199530179928029d-303, 9.99610149940024d-304, 5.9977008996401444d-304, & 499.19032387045183_dp, 499.2802878848461_dp, 499.3702518992403_dp, 499.5501799280288_dp] expected = [-1.1242697836494346E-156_dp, -3.6987410577069675E-155_dp, 6.6185432736853698E-155_dp, & -7.9441122443324676E-155_dp, & -1.2379145453411093E-002_dp, -0.27253834632671181_dp, 0.24932183511315256_dp, -3.8313116038851942_dp, & -2.9667345859170198E-002_dp, 2.4613344707389746E-002_dp, -0.56789241609783492_dp, -0.57335504482194688_dp, & -1.9709617906990824E+152_dp, -3.3155185929797410E+152_dp, -9.3489430830433235E+153_dp, -1.1188040075158112E+153_dp, & 0.10420535567671903_dp, 0.13391492370821437_dp, -7.8417916615948820E-003_dp, -6.8571787853437760E-002_dp, & 0.16838460392882040_dp, 5.4736765729333475E-002_dp, 5.3856989331157942E-002_dp, 5.2089913683587979E-002_dp, & -1.1559813724346837_dp, -1.1563150553800137_dp, -1.1566489944373206_dp, -1.1569831898838661_dp, & -1.4609752198895190_dp, -1.4611112512331177_dp, -1.4612475261578066_dp, -1.4615208070815726_dp, & -4.5490705411075559E+302_dp, -5.3072426439973200E+302_dp, -6.3686805541718252E+302_dp, -1.0614396800043461E+303_dp, & 1.5957661062982142E-002_dp, 1.8761706846965608E-002_dp, 2.1413515766267922E-002_dp, 2.6176157352140857E-002_dp] do i = 1, size(x) print *, bessel_y1(x(i)), "i = ", i if (abs(bessel_y1(x(i)) - expected(i)) > 1e-12_dp) error stop end do y = [1036.462826483388272_sp, 1.7197292882018389_sp, 10.2368267382872828_sp, 0.17197292882018389_sp, & 152.67283628_sp, 632.92729728_sp, 1.2728272919_sp, 1.2828272919_sp, & 29.82407037185126_sp, 35.2459016393_sp, 46.2634946_sp, 24.7740903638_sp, & 15.8978408636372_sp, 8.801468212714914_sp, 8.798080767692923_sp, 8.791287884846061575_sp, & 0.6635324560331525_sp, 0.6633115808685429_sp, 0.6630906573122884_sp, 0.6628696853957159_sp, & 0.5042349934053336_sp, 0.5041796815747646_sp, 0.5041242821300232_sp, 0.50401322049655_sp, & 499.19032387045183_sp, 499.2802878848461_sp, 499.3702518992403_sp, 499.5501799280288_sp] expected_y = [-1.23779038E-02_sp, -0.272538334_sp, 0.249321833_sp, -3.83131123_sp, & -2.96673458E-02_sp, 2.46131476E-02_sp, -0.567892432_sp, -0.560734272_sp, & 0.104205415_sp, 0.133914948_sp, -7.84158148E-03_sp, -6.85717091E-02_sp, & 0.168384567_sp, 5.47366850E-02_sp, 5.38569130E-02_sp, 5.20897955E-02_sp, & -1.15598142_sp, -1.15631497_sp, -1.15664887_sp, -1.15698314_sp, & -1.46097517_sp, -1.46111119_sp, -1.46124744_sp, -1.46152067_sp, & 1.59581173E-02_sp, 1.87612697E-02_sp, 2.14131586E-02_sp, 2.61759404E-02_sp ] do i = 1, size(y) print *, bessel_y1(y(i)), "i = ", i if (abs(bessel_y1(y(i)) - expected_y(i)) > 1e-6) error stop end do end program lfortran-lfortran-2f73434/integration_tests/pass_array_by_data_11.f900000664000175000017500000000115115141516316026046 0ustar alastairalastairprogram pass_array_by_data_11 implicit none real :: y0(5) y0 = AB5(func, y0(:)) if (any(y0 /= [1.0,1.0,1.0,1.0,0.0])) error stop contains function AB5(f, y0) interface real function f(y) real, intent(in) :: y(:) end function end interface real, intent(in) :: y0(:) real, allocatable :: AB5(:) allocate(AB5(size(y0))) AB5(1:size(y0)-1) = func(y0(1:3)) AB5(size(y0)) = 0.0 end function real function func(y) real, intent(in) :: y(:) func = 1.0 end function end programlfortran-lfortran-2f73434/integration_tests/read_07_data.txt0000664000175000017500000000001115141516316024343 0ustar alastairalastairABCDEF T lfortran-lfortran-2f73434/integration_tests/intrinsics_114.f900000664000175000017500000000047115141516316024474 0ustar alastairalastairprogram intrinsics_114 real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = 4.321_8 print *, aint( a = x4, kind = 8 ) if ( .not. aint( a = x8, kind = 4 ) == 4 ) error stop if ( .not. aint( x8, kind = 4 ) == 4 ) error stop if ( .not. aint( x8, 4 ) == 4 ) error stop end program intrinsics_114 lfortran-lfortran-2f73434/integration_tests/format_06.f900000664000175000017500000000145315141516316023520 0ustar alastairalastairprogram format_06 real :: a,b,c,d a = 123.456 b = 123.45678 c = 12.34 d = 123.45 10 format(a,a) 20 format("Success!",/,10X,A6,"World!") 30 format(4a4) 40 format(A2,4(2X,A),I3) print *, "a", "b" print 10, "c", "d" print 20, "Hello 123" write (*,30) "dancing","in","the","moonlight" write (*,40) "ab", "cdef", "ghi", "jkl","qwerty",12 print 50 , 123,456,12345,6789 print 60, 123.456, -123.45678, 12.34, -123.45 write (*,70) -a, b, -c, d write (*,80) -a, b, -c, d 50 format(i3,i10.5,/i6.6,2x,i3) 60 format(d10.2,d15.6,d010.2,2x,d7.2) 70 format(1pd10.2,2pd15.6,1pd010.2,2x,1pd9.2) 80 format(-1pe10.2,-2pe15.6,1pe010.2,2x,1pe9.2) ! Checking different scopes if ( a > 0) then print 90, "Hello " if ( b > 0) then write (*,100) "World!" end if 100 format(a) end if 90 format (a) end program lfortran-lfortran-2f73434/integration_tests/template_add_01b.f900000664000175000017500000000263215141516316025010 0ustar alastairalastairmodule template_add_01b_m implicit none private public :: add_t, test_template requirement R(T, F) type, deferred :: T interface operator (+) procedure F end interface function F(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z end function end requirement template add_t(T, F) require :: R(T, F) private public :: add_generic contains function add_generic(x, y) result(z) type(T), intent(in) :: x, y type(T) :: z !print*, "x, y, z, x+y+z =", x, y, z, x+y+z z = x + y end function function add_generic2(x, y, z) result(s) type(T), intent(in) :: x, y, z type(T) :: s s = x + y + z end function end template contains integer function func_arg_int(x, y) result(z) integer, intent(in) :: x, y z = x + y end function subroutine test_template() integer :: n1, n2 instantiate add_t(integer, func_arg_int), only: add_integer => add_generic, add_integer2 => add_generic2 n1 = add_integer(5, 9) n2 = add_integer2(5, 9, 10) print*, "The result is", n1 print*, "The result is", n2 end subroutine end module program template_add_01b use template_add_01b_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/logical_casting_01.f900000664000175000017500000000033515141516316025343 0ustar alastairalastairprogram logical_casting_01 implicit none logical :: x(3) = [1, 1, 0] print *, x if (x(1) .neqv. .true.) error stop if (x(2) .neqv. .true.) error stop if (x(3) .neqv. .false.) error stop end programlfortran-lfortran-2f73434/integration_tests/variables_02.f900000664000175000017500000000030715141516316024171 0ustar alastairalastairprogram variables_02 implicit none integer :: x, y x = 2 y = x + 1 if (y /= 3) error stop x = 2 y = 3 y = (x+2)*(1-y)+1 if (y /= -7) error stop x = 2 y = -x*(-x) if (y /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/derived_types_86.f900000664000175000017500000000065415141516316025110 0ustar alastairalastairmodule derived_types_86_mod type :: json_ser_config integer :: l1 = 14 character(len=:), allocatable :: indent end type type :: json_serializer type(json_ser_config) :: config = json_ser_config() end type end module program derived_types_86 use derived_types_86_mod type(json_serializer) :: ser ser = json_serializer() ser%config%indent = "Hello" if (ser%config%l1 /= 14) error stop end program derived_types_86lfortran-lfortran-2f73434/integration_tests/interface_29.f900000664000175000017500000000046415141516316024176 0ustar alastairalastairmodule bench_mod contains subroutine run(x) interface integer function f() end function f end interface integer :: x if (x /= 1) error stop print *, x end subroutine run end module bench_mod program main use bench_mod call run(1) end program main lfortran-lfortran-2f73434/integration_tests/block_05.f900000664000175000017500000000121515141516316023315 0ustar alastairalastairsubroutine hybrd(n) implicit none integer :: n main : block if ( n <= 0 ) then exit main else if ( n >= 2 ) then if ( n <= 4 ) then n = n +1 else exit main end if else n = n + 9 end if n = n + 2 end block main n = n + 3 print *, "n = ", n end subroutine hybrd program main implicit none integer :: n n = -5 call hybrd(n) if (n /= -2) error stop n = 1 call hybrd(n) if (n /= 15) error stop n = 5 call hybrd(n) if (n /= 8) error stop end program main lfortran-lfortran-2f73434/integration_tests/do_concurrent_03.f900000664000175000017500000000101615141516316025064 0ustar alastairalastair! equivalent to openmp_06.f90 subroutine increment_ctr(n, ctr) ! use omp_lib implicit none integer, intent(in) :: n integer, intent(inout) :: ctr integer :: local_ctr integer :: i local_ctr = 0 do concurrent (i = 1:n) reduce(+:local_ctr) local_ctr = local_ctr + 1 end do ctr = ctr + local_ctr end subroutine program do_concurrent_03 use omp_lib integer, parameter :: n = 1000000 integer :: ctr call omp_set_num_threads(8) ctr = 0 call increment_ctr(n, ctr) print *, ctr if (ctr /= 1000000) error stop end program lfortran-lfortran-2f73434/integration_tests/common_24.f900000664000175000017500000000034015141516316023512 0ustar alastairalastairprogram common_24 implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 0 iunit = 0 call set1() call set2() if (info /= 2) error stop end program common_24 lfortran-lfortran-2f73434/integration_tests/template_triple.f900000664000175000017500000000703715141516316025121 0ustar alastairalastairmodule Math_integer_m implicit none contains pure function add_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = x + y end function pure function minus_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = x - y end function pure function max_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = max(x, y) end function pure function min_integer(x, y) result(result) integer, intent(in) :: x, y integer :: result result = min(x, y) end function pure function zero_integer() result(result) integer :: result result = 0 end function pure function one_integer() result(result) integer :: result result = 1 end function end module module Math_real_m implicit none contains pure function add_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x + y end function pure function minus_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x - y end function pure function slash_real(x, y) result(result) real, intent(in) :: x, y real :: result result = x / y end function pure function max_real(x, y) result(result) real, intent(in) :: x, y real :: result result = max(x, y) end function pure function min_real(x, y) result(result) real, intent(in) :: x, y real :: result result = min(x, y) end function pure function zero_real() result(result) real :: result result = 0.0 end function pure function one_real() result(result) real :: result result = 1.0 end function end module module triple_m implicit none private public :: triple_tmpl requirement magma_r(T, plus_T) type, deferred :: T pure function plus_T(l, r) result(total) type(T), intent(in) :: l, r type(T) :: total end function end requirement template triple_tmpl(T, plus_T) require :: magma_r(T, plus_T) private public :: triple_l, triple_r contains pure function triple_l(t) result(result) type(T), intent(in) :: t type(T) :: result result = plus_T(plus_T(t, t), t) end function pure function triple_r(t) result(result) type(T), intent(in) :: t type(T) :: result result = plus_T(t, plus_T(t, t)) end function end template end module module use_triple_m use Math_integer_m use Math_real_m use triple_m contains subroutine test_add_triples() instantiate triple_tmpl(integer, add_integer), & only: triple_add_l => triple_l, & triple_add_r => triple_r integer :: tal, tar tal = triple_add_l(7) tar = triple_add_r(7) print *, "tal = ", tal, " tar = ", tar end subroutine subroutine test_minus_triples() instantiate triple_tmpl(real, minus_real), & only: triple_minus_l => triple_l, & triple_minus_r => triple_r real :: tml, tmr tml = triple_minus_l(7.0) tmr = triple_minus_r(7.0) print *, "tml = ", tml, " tmr = ", tmr end subroutine subroutine test_max_triples() instantiate triple_tmpl(real, max_real), & only: triple_max_l => triple_l, & triple_max_r => triple_r real :: tmaxl, tmaxr tmaxl = triple_max_l(7.0) tmaxr = triple_max_r(7.0) print *, "tmaxl =", tmaxl, " tmaxr =", tmaxr end subroutine end module program template_triple use use_triple_m call test_add_triples() call test_minus_triples() call test_max_triples() end program template_triple lfortran-lfortran-2f73434/integration_tests/data_02.f900000664000175000017500000000152215141516316023132 0ustar alastairalastairprogram data2 implicit none integer :: j data j / 5 / integer :: i, iarx(3,1), iary(3,1) print *, "1", j if (.true.) then print *, "2" data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, iarx(1, 1) if (iarx(1, 1) /= 1) error stop print *, iary(1, 1) if (iary(1, 1) /= 9) error stop print *, iarx(2, 1) if (iarx(2, 1) /= 1950) error stop print *, iary(2, 1) if (iary(2, 1) /= 1350) error stop print *, iarx(3, 1) if (iarx(3, 1) /= 4350) error stop print *, iary(3, 1) if (iary(3, 1) /= 4) error stop else data(iarx(i,1), iary(i,1),i=1,3)/ 1, 9, 1950,1350, 4350, 4/ print *, "3" end if print *, "4" data(iary(i,1),i=1,3)/ 1, 9, 1950 / print *, "5" end program lfortran-lfortran-2f73434/integration_tests/compiler_version_01.f900000664000175000017500000000020015141516316025567 0ustar alastairalastairprogram compiler_version_01 use, intrinsic :: iso_fortran_env implicit none print *, compiler_version() end program lfortran-lfortran-2f73434/integration_tests/character_05.f900000664000175000017500000000026315141516316024161 0ustar alastairalastairprogram character_05 character(1) :: b b = "X" call f(b) contains subroutine f(s) bind(c) character(1) :: s if (s /= "X") error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/select_type_09.f900000664000175000017500000000267215141516316024557 0ustar alastairalastairmodule select_type_09_mod implicit none type, abstract :: base end type base type, extends(base) :: int_val integer :: i end type int_val type, extends(base) :: real_val real :: r end type real_val type :: temp class(base), allocatable :: bas end type temp contains subroutine print_value(val, x) class(base), intent(inout) :: val class(real_val), intent(out) :: x select type(v => val) type is(int_val) v%i = 50 x%r = 3.5 end select end subroutine print_value subroutine print_value2(val) class(temp), intent(inout) :: val select type(v => val%bas) type is(int_val) v%i = 50 end select end subroutine print_value2 end module select_type_09_mod program select_type_09 use select_type_09_mod implicit none class(base), allocatable :: val class(real_val), allocatable :: r_val type(temp), allocatable :: val2 allocate(int_val :: val) allocate(r_val) select type(val) type is(int_val) val%i = 42 call print_value(val, r_val) if (val%i /= 50) error stop end select if (r_val%r /= 3.5) error stop select type(cmd => val) class is(int_val) cmd%i = 42 call print_value(cmd, r_val) if (cmd%i /= 50) error stop end select allocate(val2) allocate(int_val :: val2%bas) call print_value2(val2) select type(v => val2%bas) type is(int_val) if (v%i /= 50) error stop end select end program select_type_09 lfortran-lfortran-2f73434/integration_tests/arrays_71.f900000664000175000017500000000141415141516316023530 0ustar alastairalastairprogram arrays_71 integer :: x1(5) = [2,1,3,3,2] integer :: x2(3,3) = reshape([1,10,11,22,1,2,1,1,2], [3,3]) integer :: y(3) = [0, 0, 0] integer :: y2(5) = [0, 0, 0, 0, 0] integer :: z = 2 y = [z, x2(1,1), x2(1,2)] if(y(1) /= 2 .or. y(2) /= 1 .or. y(3) /= 22) error stop y = [z, x1([1,2])] if(y(1) /= 2 .or. y(2) /= 2 .or. y(3) /= 1) error stop y = [z, x2([1,2],1)] if(y(1) /= 2 .or. y(2) /= 1 .or. y(3) /= 10) error stop y2 = [z, x2([1,2],[1,2])] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 10 .or. y2(4) /= 22 .or. y2(5) /= 1) error stop y2 = [z, x2(2:3,2:3)] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 2 .or. y2(4) /= 1 .or. y2(5) /= 2) error stop y2 = [z, x2(1:2,[1,2])] if(y2(1) /= 2 .or. y2(2) /= 1 .or. y2(3) /= 10 .or. y2(4) /= 22 .or. y2(5) /= 1) error stop end programlfortran-lfortran-2f73434/integration_tests/array_01.f900000664000175000017500000000020615141516316023334 0ustar alastairalastairprogram main implicit none real(8) :: x(3) x = [1., 2., 3.] print *, x print *, sin(x) end program lfortran-lfortran-2f73434/integration_tests/separate_compilation_05.f900000664000175000017500000000042315141516316026425 0ustar alastairalastairprogram separate_compilation_05 use separate_compilation_05b_module use ieee_arithmetic, only: ieee_is_nan implicit none real, allocatable :: A(:,:) allocate(A(3,3)) A = 02315.1235 call temp(A) print *, ieee_is_nan(A(1,1)) if ( ieee_is_nan(A(1,1)) ) error stop end program lfortran-lfortran-2f73434/integration_tests/external_13.f900000664000175000017500000000170015141516316024043 0ustar alastairalastair! Test that external functions with implicit interfaces get underscore mangling ! when --mangle-underscore flag is used. ! ! This test verifies the fix for issue #9473 where --mangle-underscore and ! --all-mangling did not apply to external interface functions (like LAPACK/BLAS). ! ! We define a simple stub to avoid needing actual LAPACK at link time. module external_mangle_stubs implicit none contains subroutine dummy_external_(x) bind(C, name="dummy_external_") integer, intent(inout) :: x x = x + 1 end subroutine end module program external_mangle_01 use external_mangle_stubs implicit none integer :: x x = 41 ! Call external function with implicit interface ! With --mangle-underscore, this should generate a call to dummy_external_ call dummy_external(x) if (x == 42) then print *, "PASSED" else print *, "FAILED: x =", x error stop end if end program lfortran-lfortran-2f73434/integration_tests/external_07.f900000664000175000017500000000051015141516316024044 0ustar alastairalastairdouble precision function f(x) double precision x f = x**2 return end function f subroutine sub(f) external f double precision f print *, f(2.0d0) if (abs(f(2.0d0) - 4.0d0) > 1.0d-10) error stop return end subroutine sub recursive subroutine a() external f call sub(f) end program external_07 call a() end lfortran-lfortran-2f73434/integration_tests/return_04.f900000664000175000017500000000033115141516316023537 0ustar alastairalastairprogram return_04 implicit none call sub() contains subroutine sub() integer :: n if (n <= 1) then return end if if (n == 4) then n = 1 end if end subroutine end program lfortran-lfortran-2f73434/integration_tests/dcmplx_01.f900000664000175000017500000000166715141516316023521 0ustar alastairalastairprogram dcmplx_01 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: x, y complex(dp) :: z ! Use values that require double precision for accurate representation ! These values would lose precision if converted to single precision x = 1.123456789012345d0 y = 2.987654321098765d0 ! Test dcmplx with single real argument z = dcmplx(x) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z)) > 1d-15) error stop ! Test dcmplx with two real arguments z = dcmplx(x, y) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z) - 2.987654321098765d0) > 1d-15) error stop ! Test dconjg z = (1.123456789012345d0, 2.987654321098765d0) z = dconjg(z) if (abs(real(z, dp) - 1.123456789012345d0) > 1d-15) error stop if (abs(aimag(z) + 2.987654321098765d0) > 1d-15) error stop end program dcmplx_01 lfortran-lfortran-2f73434/integration_tests/external_12_module.f900000664000175000017500000000113015141516316025404 0ustar alastairalastairmodule external_12_module1 LOGICAL(4), ALLOCATABLE, DIMENSION(:) :: inrdone end module external_12_module1 MODULE external_12_module2 use external_12_module1, only: inrdone REAL(4), PARAMETER :: one = 1.0 PUBLIC :: inner CONTAINS SUBROUTINE inner ( ) REAL(4), ALLOCATABLE, DIMENSION(:) :: dfmxi REAL(4) :: epsi=1.0E-4 ALLOCATE( dfmxi(5) ) ALLOCATE( inrdone(5) ) dfmxi = -one WHERE( dfmxi <= epsi ) inrdone = .TRUE. print *, "inrdone: ", inrdone if (any(inrdone .neqv. .TRUE.)) error stop END SUBROUTINE inner END MODULE external_12_module2 lfortran-lfortran-2f73434/integration_tests/transfer_05.f900000664000175000017500000000132315141516316024047 0ustar alastairalastairmodule stdlib_hash_32bit_water_transfer_05 use iso_fortran_env, only: int8, int32, int64 implicit none contains subroutine int8_water_hash( key ) integer(int8), intent(in) :: key(:) print *, sum(key) if (sum(key) /= -9) error stop end subroutine int8_water_hash subroutine character_water_hash( key ) character(*), intent(in) :: key call int8_water_hash( transfer( key, 0_int8, len(key, kind=int64) ) ) end subroutine character_water_hash end module stdlib_hash_32bit_water_transfer_05 program transfer_05 use stdlib_hash_32bit_water_transfer_05 character(len=10) :: key key = 'abcdefghij' call character_water_hash(key) end program lfortran-lfortran-2f73434/integration_tests/external_09.f900000664000175000017500000000075315141516316024057 0ustar alastairalastairsubroutine map_xi_to_c (cs, cv) implicit none real, dimension(2), intent(in) :: cs real, intent(out) :: cv real, external :: fold cv=fold(cs(1)) return end function fold (x0) implicit none real :: fold real :: x0 fold = x0 end program external_09 implicit none real :: cv = 12.91 real, dimension(2) :: cs = [12.92, -22.0] call map_xi_to_c(cs, cv) print *, cv if ( abs(cv - 12.92) > 1e-8 ) error stop end program external_09 lfortran-lfortran-2f73434/integration_tests/derived_types_19.f900000664000175000017500000000047115141516316025101 0ustar alastairalastairmodule derived_types_module_19_1 use derived_types_module_19, only: check_proc implicit none contains subroutine check_here() call check_proc() end subroutine end module program main implicit none print *, "running derived_types_19 main program" end program main lfortran-lfortran-2f73434/integration_tests/character_10.f900000664000175000017500000000650015141516316024155 0ustar alastairalastair module module_10_mod use iso_c_binding implicit none interface function f_string00_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string01_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string02_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string03_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string04_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function function f_string05_c_caller() result(r) bind(c) import :: c_int integer(c_int) :: r end function end interface contains function f_string00_fortran(s) result(r) bind(c) character(kind=c_char) :: s character(kind=c_char) :: r print "('Fortran Side : `f_string00_fortran` called with s =', '[', a, ']' )", s if(s /= 'H') error stop r = s s(1:1) = 'X' end function function f_string01_fortran(s) result(r) bind(c) character(len=1, kind=c_char), value :: s character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string01_fortran` called with s =', '[', a, ']' )", s if(s /= 'H') error stop r = s s = 'X' end function function f_string02_fortran(s, n) result(r) bind(c) integer(c_int), value :: n character(len=1, kind=c_char) :: s(n) character(len=1, kind=c_char) :: r character(len=:, kind=c_char), allocatable :: local_str print "('Fortran Side : `f_string02_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= "A") error stop local_str = s(1) // "?????????????" if(local_str /= "A?????????????") error stop if(len(local_str) /= 14) error stop r = local_str s(1) = '2' end function function f_string03_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(*) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string03_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'B') error stop r = s(1) s(1) = '3' end function function f_string04_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(*) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string04_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'C') error stop r = s(1) s(1) = '4' end function function f_string05_fortran(s) result(r) bind(c) character(len=1, kind=c_char) :: s(:) character(len=1, kind=c_char) :: r print "('Fortran Side : `f_string05_fortran` called with s =', '[', a, ']' )", s(1) if(s(1) /= 'D') error stop r = s(1) s(1) = '5' end function end module program module_10 use module_10_mod integer :: dummy dummy = f_string00_c_caller() dummy = f_string01_c_caller() dummy = f_string02_c_caller() dummy = f_string03_c_caller() dummy = f_string04_c_caller() dummy = f_string05_c_caller() end programlfortran-lfortran-2f73434/integration_tests/intrinsics_274.f900000664000175000017500000000246415141516316024507 0ustar alastairalastairprogram intrinsics_274 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real :: x = 3.143 real(dp) :: y = 2.33 real(sp), parameter :: r1 = epsilon(1._sp) real(dp), parameter :: r2 = epsilon(67._dp) real(sp), parameter :: ar1 = epsilon([11.3_sp, 1.7_sp, 0.0_sp]) real(dp), parameter :: ar2 = epsilon([11.3_dp, 1.7_dp, 0.0_dp]) real(sp) :: arr1(3) = [11.3_sp, 1.7_sp, 0.0_sp] real(dp) :: arr2(3) = [19.3_dp, 3.7_dp, 0.0_dp] print *, r1 if (abs(r1 - 1.19209290E-07) > 1e-6) error stop print *, r2 if (abs(r2 - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, ar1 if (abs(ar1 - 1.19209290E-07) > 1e-6) error stop print *, ar2 if (abs(ar2 - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, epsilon(x) if (abs(epsilon(x) - 1.19209290E-07) > 1e-6) error stop print *, epsilon(y) if (abs(epsilon(y) - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop print *, epsilon(1._dp) ** 0.5 !Part of Minpack if (abs((epsilon(1._dp) ** 0.5_dp) - 1.4901161193847656E-008_dp) > 1e-12_dp) error stop print *, epsilon(arr1) if (abs(epsilon(arr1) - 1.19209290E-07) > 1e-6) error stop print *, epsilon(arr2) if (abs(epsilon(arr2) - 2.2204460492503131E-016_dp) > 1e-12_dp) error stop end programlfortran-lfortran-2f73434/integration_tests/lapack_04.f900000664000175000017500000000074315141516316023462 0ustar alastairalastair! MRE from LAPACK slals0.f: integer array index into real array ! causes type check assertion: check_equal_type(i32[:], r32[:]) ! Pattern: arr(idx(i)) passed to implicit-interface subroutine subroutine test integer :: idx(2) real :: arr(4) idx(1) = 1 arr = 1.0 call sub(arr(idx(1))) end subroutine test subroutine sub(x) real :: x(*) if (x(1) /= 1.0) stop 1 end subroutine sub program lapack_04 call test print *, 'PASS' end program lapack_04 lfortran-lfortran-2f73434/integration_tests/save_11.f900000664000175000017500000000066015141516316023161 0ustar alastairalastairsubroutine foo_save_11(reference) integer , intent(in) :: reference integer, save , dimension(2) :: arr = [1,1] complex :: c = (1,1) arr = arr + 1 c = c + (1, 1) print *, arr if(any(arr /= reference)) error stop print *, c if(c /= complex(reference, reference)) error stop end subroutine foo_save_11 program save_11 call foo_save_11(2) call foo_save_11(3) end program save_11lfortran-lfortran-2f73434/integration_tests/max_01.f900000664000175000017500000000015215141516316023003 0ustar alastairalastairprogram max_01 real(8) :: y real :: z y = 5.2d0 z = 9.0 print *, max(y, z) end programlfortran-lfortran-2f73434/integration_tests/forall_01.f900000664000175000017500000000016315141516316023477 0ustar alastairalastairprogram forall_01 implicit none integer :: ivec(3), i forall(i=1:3) ivec(i)=i print *,ivec end program forall_01 lfortran-lfortran-2f73434/integration_tests/string_23.f900000664000175000017500000000031315141516316023527 0ustar alastairalastairprogram string_23 type :: string character(:), allocatable :: s end type type(string) :: z allocate(character(1) :: z%s) z%s(1:1) = "x" print *, z%s(1:1) if (z%s(1:1) /= "x") error stop end program lfortran-lfortran-2f73434/integration_tests/parameter_06.f900000664000175000017500000000053615141516316024211 0ustar alastairalastairprogram parameter_06 integer, parameter :: n = 2 complex :: sum real, parameter :: d(0 : n) = [2.48574089138753566e-5,1.05142378581721974, -3.45687097222016235] print *, d(0) if (abs(d(0) - 2.48574089138753566e-5) > 1e-6) error stop sum = cmplx(d(0), kind = 8) print *, sum if (abs(sum % re - 2.48574089138753566e-5) > 1e-6) error stop end program lfortran-lfortran-2f73434/integration_tests/implicit_typing_04.f900000664000175000017500000000050515141516316025427 0ustar alastairalastairsubroutine outer(x) implicit real(kind=8) (a-h,o-z), integer(kind=4) (i-n) contains function inner() implicit real(kind=8) (a-h,o-z), integer(kind=4) (i-n) inner = 1 end function inner end subroutine outer program implicit_typing_04 implicit none real(8) :: x call outer(x) end program lfortran-lfortran-2f73434/integration_tests/arrays_47.f900000664000175000017500000000055715141516316023542 0ustar alastairalastairmodule module_arrays_47 integer :: nx = 4 integer :: ny = 4 integer :: nz = 4 contains subroutine a(cs) real, dimension(nx, ny, nz), intent(in) :: cs print *, sum(cs) if (abs(sum(cs) - 6343.99072) > 1e-8) error stop end subroutine end module module_arrays_47 program arrays_47 use module_arrays_47 real, dimension(4, 4, 4) :: cs cs = 99.1248 call a(cs) end program lfortran-lfortran-2f73434/integration_tests/character_20.f900000664000175000017500000000243315141516316024157 0ustar alastairalastairprogram character_20 implicit none character(len=10) :: long_str character(len=5) :: short_str logical :: result long_str = "hello12345" result = check_short(long_str) if (.not. result) error stop "Test 1 failed" short_str = "world" result = check_exact(short_str) if (.not. result) error stop "Test 2 failed" call test_with_allocatable() contains function check_short(s) result(res) character(len=5), intent(in) :: s logical :: res res = (s == "hello") end function check_short function check_exact(s) result(res) character(len=5), intent(in) :: s logical :: res res = (s == "world") end function check_exact subroutine test_with_allocatable() character(len=8), allocatable :: alloc_str logical :: result allocate(alloc_str) alloc_str = "testing!" result = check_alloc(alloc_str) if (.not. result) error stop "Test 3 failed" deallocate(alloc_str) end subroutine test_with_allocatable function check_alloc(s) result(res) character(len=4), intent(in) :: s logical :: res res = (s == "test") end function check_alloc end program character_20 lfortran-lfortran-2f73434/integration_tests/read_08.f900000664000175000017500000000115415141516316023143 0ustar alastairalastairprogram read_08 ! Test reading logical values with T/F format implicit none logical :: val1, val2, val3, val4 open(10, status='scratch') write(10, '(A)') 'T' write(10, '(A)') 'F' write(10, '(A)') 't' write(10, '(A)') 'f' rewind(10) read(10, *) val1 read(10, *) val2 read(10, *) val3 read(10, *) val4 close(10) if (.not. val1) error stop "Expected T to be .true." if (val2) error stop "Expected F to be .false." if (.not. val3) error stop "Expected t to be .true." if (val4) error stop "Expected f to be .false." print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops12.f900000664000175000017500000000146015141516316025405 0ustar alastairalastair!This file contains tests for implied do loops in array initializers. program implied_do_loop12 implicit none integer :: k integer, parameter :: MAX_ITEMS = 3 ! Derived type type :: derived_t real :: a end type derived_t ! Array of integers initialized via implied-DO integer :: arr1(MAX_ITEMS) = (/ (k, k = 0, MAX_ITEMS-1) /) type(derived_t) :: arr2(MAX_ITEMS) = (/ (derived_t(k), k = 0, MAX_ITEMS-1) /) print *,arr1 if(arr1(1) /= 0) error stop if(arr1(2) /= 1) error stop if(arr1(3) /= 2) error stop ! Array of derived_t objects initialized via implied-DO print *, arr2 if (abs(arr2(1)%a - 0.0) > 1e-12) error stop if (abs(arr2(2)%a - 1.0) > 1e-12) error stop if (abs(arr2(3)%a - 2.0) > 1e-12) error stop end program implied_do_loop12lfortran-lfortran-2f73434/integration_tests/intrinsics_117.f900000664000175000017500000000047715141516316024505 0ustar alastairalastairprogram intrinsics_117 print *, mod( a = 17.5, p = 5.5 ) print *, mod( a = 17.5d0, p = 5.5 ) print *, mod( a = 17.5, p = 5.5d0 ) if ( .not. mod( a = 17, p = 3 ) == 2 ) error stop if ( .not. mod( 17, p = 3 ) == 2 ) error stop if ( .not. mod( 17, 3 ) == 2 ) error stop end program intrinsics_117 lfortran-lfortran-2f73434/integration_tests/string_05.f900000664000175000017500000000035715141516316023537 0ustar alastairalastairprogram string_05 character(len=3) :: s1 character(len=5) :: s2 character(len=7) :: s3 print *, len(s1) print *, len(s2) print *, len(s3) if (len(s1) /= 3) error stop if (len(s2) /= 5) error stop if (len(s3) /= 7) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_37.f900000664000175000017500000000074715141516316024251 0ustar alastairalastairmodule functions_37_mod interface generic procedure :: ff end interface contains pure function ff() result(ret) integer :: ret ret = 190 end function function foo() result(arr) integer :: arr(generic()) ! Depends on `ff` to be fully declared (through interface `generic`) end function end module program functions_37 use functions_37_mod print *, size(foo()) if(size(foo()) /= 190) error stop end program functions_37lfortran-lfortran-2f73434/integration_tests/intrinsics_19c.f900000664000175000017500000000270215141516316024562 0ustar alastairalastairprogram intrinsics_19c ! Test math intrinsics both declarations and executable statements. ! Single and double precision, complex only. integer, parameter :: dp = kind(0.d0) real, parameter :: & s1 = abs((0.5,0.5)), & s5 = aimag((0.4,0.5)) complex, parameter :: & s2 = exp((0.5,0.5)), & s3 = log((0.5,0.5)), & s4 = sqrt((0.5,0.5)) real(dp), parameter :: & d1 = abs((0.5_dp,0.5_dp)), & d5 = aimag((0.4,0.5)) complex(dp), parameter :: & d2 = exp((0.5_dp,0.5_dp)), & d3 = log((0.5_dp,0.5_dp)), & d4 = sqrt((0.5_dp,0.5_dp)) complex :: x real :: x1 = -1 complex(dp) :: y x = (0.5,0.5) y = (0.5_dp,0.5_dp) if (abs(-1) /= 1) error stop if (abs(int(x1)) /= 1) error stop if (abs(-1) /= 1) error stop if (abs(x1) /= 1.0) error stop if (abs(-1.0) /= 1) error stop if (abs(abs((0.5, 0.5)) - 0.707106769) > 1e-7) error stop if (abs(abs(x) - 0.707106769) > 1e-7) error stop if (abs(abs(-x) - 0.707106769) > 1e-7) error stop if (abs(abs((0.5_dp, 0.5_dp)) - 0.70710678118654757) > 1e-7) error stop if (abs(abs(y) - 0.70710678118654757) > 1e-7) error stop if (abs(abs(-y) - 0.70710678118654757) > 1e-7) error stop print *, exp((0.5,0.5)), exp((0.5_dp,0.5_dp)), s2, d2, exp(x), exp(y) print *, log((0.5,0.5)), log((0.5_dp,0.5_dp)), s3, d3, log(x), log(y) print *, sqrt((0.5,0.5)), sqrt((0.5_dp,0.5_dp)), s4, d4, sqrt(x), sqrt(y) x = (0.4,0.5) y = (0.4_dp,0.5_dp) print *, aimag((0.5,0.5)), aimag((0.5_dp,0.5_dp)), s5, d5, aimag(x), aimag(y) end lfortran-lfortran-2f73434/integration_tests/bindc6_sum.c0000664000175000017500000000021615141516316023574 0ustar alastairalastairdouble sum_arr(const double *a, int n) { double sum = 0.0; for (int i = 0; i < n; i++) { sum += a[i]; } return sum; } lfortran-lfortran-2f73434/integration_tests/character_14.f900000664000175000017500000000047515141516316024166 0ustar alastairalastairprogram character_14 implicit none integer, parameter :: tfc = selected_char_kind('DEFAULT') character(1, tfc) :: hash = tfc_"a" print *, tfc_"a" == hash hash = 1_"a" if (len(hash) /= 1) error stop if (len(1_"a") /= 1) error stop if (hash /= 1_"a") error stop end program character_14lfortran-lfortran-2f73434/integration_tests/class_06.f900000664000175000017500000000052215141516316023331 0ustar alastairalastairmodule class_06_mod private type, abstract :: tester contains procedure(testing), deferred, pass :: testing end type tester abstract interface subroutine testing(self) import tester class(tester), intent(inout) :: self end subroutine testing end interface end module program class_06 use class_06_mod end program lfortran-lfortran-2f73434/integration_tests/arithmetic_if_02.f900000664000175000017500000000145115141516316025031 0ustar alastairalastairprogram arithmetic_if_02 real :: x integer :: c ! Singleline x = -3 c = 0 if (x) 1, 2, 3 1 c = c + 1 2 c = c + 2 3 c = c + 4 print *, c if (c /= 7) error stop x = 0 c = 0 if (x) 4, 5, 6 4 c = c + 1 5 c = c + 2 6 c = c + 4 print *, c if (c /= 6) error stop x = 7 c = 0 if (x) 7, 8, 9 7 c = c + 1 8 c = c + 2 9 c = c + 4 print *, c if (c /= 4) error stop ! Multiline x = -3 c = 0 if (x) 11, 12, 13 11 c = c + 1 c = c + 100 12 c = c + 2 c = c + 200 13 c = c + 4 c = c + 400 print *, c if (c /= 707) error stop x = 0 c = 0 if (x) 14, 15, 16 14 c = c + 1 c = c + 100 15 c = c + 2 c = c + 200 16 c = c + 4 c = c + 400 print *, c if (c /= 606) error stop x = 7 c = 0 if (x) 17, 18, 19 17 c = c + 1 c = c + 100 18 c = c + 2 c = c + 200 19 c = c + 4 c = c + 400 print *, c if (c /= 404) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_op_3.f900000664000175000017500000000305015141516316024137 0ustar alastairalastairprogram array_op_3 implicit none integer :: a(2, 2, 1), b(2, 2, 1) logical :: c(2, 2, 1) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 1 a(i, j, k) = i/j b(i, j, k) = j/i end do end do end do c = a == b call check(c, a, b, 0) c = a /= b call check(c, a, b, 1) c = a < b call check(c, a, b, 2) c = b <= a call check(c, a, b, 3) c = b > a call check(c, a, b, 4) c = b >= a call check(c, a, b, 5) contains subroutine check(c, a, b, op_code) implicit none integer, intent(in) :: a(:, :, :), b(:, :, :) logical, intent(in) :: c(:, :, :) integer, intent(in) :: op_code integer :: i, j, k do i = lbound(a, 1), ubound(a, 1) do j = lbound(a, 2), ubound(a, 2) do k = lbound(a, 3), ubound(a, 3) select case(op_code) case (0) if(c(i, j, k) .neqv. (a(i, j, k) == b(i, j, k))) error stop case (1) if(c(i, j, k) .neqv. (a(i, j, k) /= b(i, j, k))) error stop case (2) if(c(i, j, k) .neqv. (a(i, j, k) < b(i, j, k))) error stop case (3) if(c(i, j, k) .neqv. (b(i, j, k) <= a(i, j, k))) error stop case (4) if(c(i, j, k) .neqv. (b(i, j, k) > a(i, j, k))) error stop case (5) if(c(i, j, k) .neqv. (b(i, j, k) >= a(i, j, k))) error stop end select end do end do end do end subroutine check end program lfortran-lfortran-2f73434/integration_tests/openmp_38.f900000664000175000017500000000056515141516316023536 0ustar alastairalastairprogram openmp_38 use omp_lib ! declare variables as required integer :: ny, nx, nz integer :: iy, ix, iz ny=3 nx=4 nz=5 !$omp parallel do collapse(3) private(iy, ix, iz) do iy = 1, ny do ix = 1, nx do iz = 1, nz print *,"iy->", iy,"ix->", ix,"iz->", iz end do end do end do !$omp end parallel do end program lfortran-lfortran-2f73434/integration_tests/string_01.f900000664000175000017500000000017015141516316023524 0ustar alastairalastairprogram print_01 implicit none character(len = 7) :: my_name = 'Dominic' print *, 'My name is ', my_name end program lfortran-lfortran-2f73434/integration_tests/string_32.f900000664000175000017500000000143315141516316023533 0ustar alastairalastairmodule string32_mod type :: string_type sequence character(len=:), allocatable :: raw end type string_type interface operator(//) module procedure :: compare_string_type_with_char end interface contains pure function compare_string_type_with_char(s1, s2) result(res) type(string_type), intent(in) :: s1 character(len=*), intent(in) :: s2 type(string_type) :: res res%raw = s1%raw//s2 end function end module program string_32 use string32_mod, only: string_type, operator(//) implicit none type(string_type) :: a character(len=10) :: b type(string_type) :: res a%raw = "hi" b = "bye" res = a // b print *, res%raw if (res%raw /= "hibye") error stop end program lfortran-lfortran-2f73434/integration_tests/array_unbounded_01.f900000664000175000017500000000036715141516316025407 0ustar alastairalastairsubroutine sub(x, z) real :: x(1:*), z(10) x(1) = 4.29 print *, x(1) end subroutine program array_unbounded_01 real :: y(10), w(10) call sub(y, w) print *, y(1) if (abs(y(1) - 4.29) > 1e-10) error stop end program lfortran-lfortran-2f73434/integration_tests/class_28.f900000664000175000017500000000131715141516316023340 0ustar alastairalastairmodule stdlib_hashmap_wrappers_class_28 implicit none private public :: other_type type :: other_type class(*), allocatable :: value end type other_type end module stdlib_hashmap_wrappers_class_28 module stdlib_hashmaps_class_28 use stdlib_hashmap_wrappers_class_28 implicit none type :: open_map_entry_type type(other_type) :: other end type open_map_entry_type end module stdlib_hashmaps_class_28 program class_28 use stdlib_hashmaps_class_28 use stdlib_hashmap_wrappers_class_28 implicit none type(open_map_entry_type), pointer :: new_ent type(other_type) :: other allocate(new_ent) other = new_ent % other end programlfortran-lfortran-2f73434/integration_tests/derived_types_60.f900000664000175000017500000000111315141516316025067 0ustar alastairalastairmodule derived_types_60_mod type :: diagnostic_type integer :: x end type diagnostic_type type :: parser_type type(diagnostic_type), allocatable :: diagnostic end type parser_type end module derived_types_60_mod program derived_types_60 use derived_types_60_mod implicit none type(diagnostic_type), allocatable :: diagnostic type(parser_type) :: parser allocate(diagnostic) allocate(parser%diagnostic) parser%diagnostic%x = 2 diagnostic = parser%diagnostic if (diagnostic%x /= 2) error stop end program derived_types_60 lfortran-lfortran-2f73434/integration_tests/set_test_01.f900000664000175000017500000000134315141516316024053 0ustar alastairalastairprogram lp_set_test_01 integer :: x _lfortran_set(integer) :: test_set test_set = _lfortran_set_constant(1, 2, 3, 4, 4, 5, 4, 10) call _lfortran_set_add(test_set, 1) call _lfortran_set_add(test_set, 10) call _lfortran_set_add(test_set, 11) x = _lfortran_len(test_set) if (x /= 7) error stop test_set = _lfortran_set_constant(1, 2, 3, 4) if (_lfortran_len(test_set) /= 4) error stop call _lfortran_set_add(test_set, -50) if (_lfortran_len(test_set) /= 5) error stop type(_lfortran_set(integer)) :: test_set_ test_set_ = _lfortran_set_constant(3, 4, 8, 5, 4, 10) call _lfortran_set_add(test_set_, 1) if (_lfortran_len(test_set_) /= 6) error stop ! Add other intrinsics later end program lfortran-lfortran-2f73434/integration_tests/submodule_03.f900000664000175000017500000000101515141516316024216 0ustar alastairalastairmodule submodule_03_mod implicit none interface module function f(a) result(r) integer, intent(in) :: a integer :: r end function end interface end module submodule (submodule_03_mod) submodule_03_submod contains module function f(a) result(r) integer, intent(in) :: a integer :: r r = a + 1 end function end submodule program submodules_03_prog use submodule_03_mod, only: f implicit none integer :: i i = f(5) print *, i if (i /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/logical_testing.f900000664000175000017500000000243315141516316025071 0ustar alastairalastairprogram logicalStringInput implicit none integer, parameter :: n = 6 logical :: x character(len=1) :: actual(n), expected(n) integer :: ios, i character(len=20), dimension(n) :: inputs = [ & ".true. ", ".false. ", "true ", "false ", & "True ", "False " ] ! as suggested, creating array for the expected tests expected = ['T', 'F', 'T', 'F', 'T', 'F'] ! as suggested, using the scratch file over .txt file open(unit=10, status="scratch") ! writing in the scratch file do i = 1, n write(10, '(A)') trim(inputs(i)) end do rewind(10) ! reading do i = 1, n read(10, *, iostat=ios) x if (ios /= 0) then print *, "Error reading logical at index", i stop 1 end if if (x) then actual(i) = 'T' else actual(i) = 'F' end if end do close(10) ! array se check validation do i = 1, n if (actual(i) /= expected(i)) then print *, "Test failed at index", i print *, "Expected:", expected(i), " but got:", actual(i) stop 1 end if end do print *, "Tests Working Correctly!" end program logicalStringInput lfortran-lfortran-2f73434/integration_tests/custom_operator_08.f900000664000175000017500000000212515141516316025454 0ustar alastairalastairmodule custom_operator_08_a implicit none public :: string_t public :: operator(//) type string_t character(len=:), allocatable :: string_ end type interface operator(//) module procedure string_t_cat_string_t end interface contains elemental module function from_characters(string) result(new_string) implicit none character(len=*), intent(in) :: string type(string_t) new_string new_string%string_ = string end function pure module function string_t_cat_string_t(lhs, rhs) result(lhs_cat_rhs) implicit none class(string_t), intent(in) :: lhs, rhs type(string_t) lhs_cat_rhs lhs_cat_rhs = string_t(lhs%string_ // rhs%string_) end function end module custom_operator_08_a module custom_operator_08_b use custom_operator_08_a implicit none contains subroutine test_concat type(string_t) :: str str = string_t("a") // string_t("b") end subroutine test_concat end module custom_operator_08_b program custom_operator_08 use custom_operator_08_b implicit none call test_concat() end program custom_operator_08 lfortran-lfortran-2f73434/integration_tests/string_62.f900000664000175000017500000000041215141516316023532 0ustar alastairalastairprogram string_62 use string_62_mod print *,"Side 1 : ", str if(str /="Hi!") error stop str = "Bye" print *, ">> Side 1 changed variable value to :", str call ff print *,"Side 1 : ", str if(str /="123") error stop end program lfortran-lfortran-2f73434/integration_tests/external_01.f900000664000175000017500000000032115141516316024036 0ustar alastairalastairprogram main double precision, external :: enorm print *, enorm(1.0d0) end program double precision function enorm(n) result(y) double precision, intent(in) :: n y = n return end function lfortran-lfortran-2f73434/integration_tests/namelist_04.f900000664000175000017500000000306315141516316024041 0ustar alastairalastairprogram namelist_2d implicit none ! Define 2D arrays integer :: matrix(3,4) real :: grid(2,3) integer :: i, j ! Define namelist namelist /arrays2d/ matrix, grid ! Initialize matrix (3x4 = 12 elements) do j = 1, 4 do i = 1, 3 matrix(i,j) = (i-1)*4 + j end do end do ! Initialize grid (2x3 = 6 elements) grid(1,1) = 1.5 grid(1,2) = 2.5 grid(1,3) = 3.5 grid(2,1) = 4.5 grid(2,2) = 5.5 grid(2,3) = 6.5 ! Write namelist to file open(unit=10, file='namelist_2d.dat', status='replace', form='formatted') write(10, nml=arrays2d) close(10) ! Reset all values to zero matrix = 0 grid = 0.0 ! Read namelist from file open(unit=10, file='namelist_2d.dat', status='old', form='formatted') read(10, nml=arrays2d) close(10) ! Verify matrix values do j = 1, 4 do i = 1, 3 if (matrix(i,j) /= (i-1)*4 + j) error stop "Matrix element mismatch" end do end do ! Verify grid values (with tolerance for floating point) if (abs(grid(1,1) - 1.5) > 1.0e-5) error stop "grid(1,1) mismatch" if (abs(grid(1,2) - 2.5) > 1.0e-5) error stop "grid(1,2) mismatch" if (abs(grid(1,3) - 3.5) > 1.0e-5) error stop "grid(1,3) mismatch" if (abs(grid(2,1) - 4.5) > 1.0e-5) error stop "grid(2,1) mismatch" if (abs(grid(2,2) - 5.5) > 1.0e-5) error stop "grid(2,2) mismatch" if (abs(grid(2,3) - 6.5) > 1.0e-5) error stop "grid(2,3) mismatch" print *, "2D array namelist test passed!" end program namelist_2d lfortran-lfortran-2f73434/integration_tests/associate_10.f900000664000175000017500000000074715141516316024203 0ustar alastairalastairsubroutine find_fit(data_y) real, intent(inout) :: data_y(2) real :: tol, fvec(2) tol = sqrt(epsilon(1.0)) * 1e4 fvec = tol call fcn(fvec) contains subroutine fcn(fvec) real :: fvec(:) data_y = fvec end subroutine fcn end subroutine find_fit program associate_10 real :: datay(2) datay = 4.0 call find_fit(datay) print *, datay if( abs(datay(1) - 3.45266986) > 1e-6 ) error stop if( abs(datay(2) - 3.45266986) > 1e-6 ) error stop end program associate_10 lfortran-lfortran-2f73434/integration_tests/bindc4.f900000664000175000017500000000220115141516316023056 0ustar alastairalastairprogram bindc4 use iso_c_binding, only: c_associated, c_loc, c_ptr, c_f_pointer, c_null_ptr type(c_ptr) :: queries type(c_ptr) :: queries2 = c_null_ptr integer :: i, j integer(2), target :: xv(3, 4), yv(3,4) integer :: newshape(2) integer(2), pointer :: x(:, :), y(:,:) newshape(1) = 2 newshape(2) = 3 x => xv y => yv do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, c_loc(x(i, j)) end do end do call c_f_pointer(queries, x, newshape) print *, c_loc(x), queries do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, c_loc(x(i, j)) end do end do call c_f_pointer(queries, x, [3, 4]) print *, c_loc(x), queries do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) print *, i, j, c_loc(x(i, j)) end do end do if (.not. c_associated(queries, c_loc(x(1, 1)))) error stop if (.not. c_associated(queries, c_loc(x))) error stop if (c_associated(queries, c_loc(y))) error stop if (c_associated(queries2)) error stop ! TODO: Fix the following test !if (.not. c_associated(queries)) error stop queries = c_null_ptr end program lfortran-lfortran-2f73434/integration_tests/intrinsics_317.f900000664000175000017500000000157215141516316024504 0ustar alastairalastairprogram intrinsics_317 implicit none integer :: arg_num character(len=100) :: arg_value integer :: arg_length, arg_status ! Print a message if no arguments are passed call get_command_argument(0, arg_value) if (trim(arg_value) == "") then print *, "No command-line arguments provided." else ! Loop through the arguments passed on the command line do arg_num = 1, 3 ! Assuming we want to read 3 arguments call get_command_argument(arg_num, arg_value, arg_length, arg_status) if (trim(arg_value) /= "") then print *, "Argument ", arg_num, ": ", trim(arg_value) print *, "Length", arg_length print *, "Status", arg_status else print *, "No more arguments." exit end if end do end if end program lfortran-lfortran-2f73434/integration_tests/intrinsics_397.f900000664000175000017500000000272715141516316024517 0ustar alastairalastairprogram intrinsics_397 implicit none integer, parameter :: lk1 = selected_logical_kind(1) integer, parameter :: lk8 = selected_logical_kind(8) integer, parameter :: lk16 = selected_logical_kind(16) integer, parameter :: lk32 = selected_logical_kind(32) integer, parameter :: lk64 = selected_logical_kind(64) integer, parameter :: lk128 = selected_logical_kind(128) integer, parameter :: lk256 = selected_logical_kind(256) ! Test with variables integer :: bits integer :: kind_result ! Check parameter evaluations if (lk1 /= 1) error stop if (lk8 /= 1) error stop if (lk16 /= 2) error stop if (lk32 /= 4) error stop if (lk64 /= 8) error stop if (lk128 /= 16) error stop if (lk256 /= -1) error stop ! Not supported ! Test with runtime values bits = 4 kind_result = selected_logical_kind(bits) if (kind_result /= 1) error stop bits = 16 kind_result = selected_logical_kind(bits) if (kind_result /= 2) error stop bits = 24 kind_result = selected_logical_kind(bits) if (kind_result /= 4) error stop bits = 48 kind_result = selected_logical_kind(bits) if (kind_result /= 8) error stop bits = 100 kind_result = selected_logical_kind(bits) if (kind_result /= 16) error stop bits = 200 kind_result = selected_logical_kind(bits) if (kind_result /= -1) error stop ! Not supported end program intrinsics_397 lfortran-lfortran-2f73434/integration_tests/volatile_02.f900000664000175000017500000000015115141516316024035 0ustar alastairalastairprogram volatile_02 implicit none real, volatile :: iota_2 = 1 / 2.0 print *, iota_2 end programlfortran-lfortran-2f73434/integration_tests/inquire_02.f900000664000175000017500000000121715141516316023676 0ustar alastairalastairprogram inquire_02 type :: string_t character(:), allocatable :: s end type integer :: unit, pos_value character(len=1) :: ch logical :: ex type(string_t) :: temp temp%s = "data.txt" open(unit=10, file="data.txt") write(10, '(A)', advance='no') 'abcd' ! writes 4 characters, no newline rewind(10) ! go back to start read(10, '(A)', advance='no') ch ! read 1 character (1 byte) inquire(unit=10, pos=pos_value) inquire(file="data.txt", exist=ex) print *, "Position:", pos_value if(pos_value /= 2) error stop if(ex .neqv. .true.) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_90.f900000664000175000017500000000070615141516316024420 0ustar alastairalastairmodule intrinsics_90_module contains subroutine tester(arr) real(8) :: arr(:,:) integer :: n real(8) :: vec(size(arr,1)) vec = huge(1.d0) do n = 1, size(arr,2) vec = min(arr(:,n),vec) end do print *, vec if (any(abs(vec - (-13.9d0)) > 1d-9)) error stop end subroutine tester end module intrinsics_90_module program intrinsics_90 use intrinsics_90_module implicit none real(8) :: arr(3,3) arr = -13.9d0 call tester(arr) end program lfortran-lfortran-2f73434/integration_tests/arrays_89.f900000664000175000017500000000073215141516316023543 0ustar alastairalastairprogram arrays_89 integer :: temp (0:2, 2:4) temp = 1 call change(temp) print *, temp if( any(temp /= reshape([1, 1, 1, 1, 1, 99, 2, 1, 1], [3, 3])) ) error stop contains subroutine change(x) integer, intent(inout) :: x(:, :) print *, lbound(x, 1), lbound(x, 2) if( lbound(x, 1) /= 1 ) error stop if( lbound(x, 2) /= 1 ) error stop x(1, 3) = 2 x(3, 2) = 99 end subroutine end program arrays_89 lfortran-lfortran-2f73434/integration_tests/transfer_08.f900000664000175000017500000000054415141516316024056 0ustar alastairalastairprogram transfer_08 implicit none character(len=:), allocatable :: lhs character(kind=1) :: rhs(3) rhs = ["A", "B", "C"] ! Transfer first 2 characters of rhs into lhs allocate(character(len=2) :: lhs) lhs(1:2) = transfer(rhs(1:2), lhs) print *, "lhs = [", lhs, "]" print *, "rhs = [", rhs, "]" end programlfortran-lfortran-2f73434/integration_tests/where_14.f900000664000175000017500000000146015141516316023337 0ustar alastairalastair! Test that `BinOp` on arrays inside `where` works and result in correct `BinOp` after indexing. program where_14 real :: A(4) call temp(A) contains subroutine temp(A) real, intent(in) :: A(:) integer :: xbdi(size(A)) integer :: ssq(size(A)) xbdi = [212334,0,212121,0] ssq = [1,10,1,-1] where (xbdi == 0) ssq = max(0, ssq - xbdi) print *, ssq if(any(ssq /= [1, 10, 1, 0])) error stop ssq = [100,0,100,3] where (xbdi == 0) ssq = max(0, 2 - ssq) print *, ssq if(any(ssq /= [100, 2, 100, 0])) error stop ssq = [100,0,100,3] where (xbdi == 0) ssq = max(0,ssq - 2) print *, ssq if(any(ssq /= [100, 0, 100, 1])) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/product_01.f900000664000175000017500000000250215141516316023677 0ustar alastairalastairprogram test_product integer :: i, j integer(8) :: x(3, 5), xproduct, xproduct1(5), correct1(5), correct2(5) logical :: modx(3, 5) correct1 = (/24_8, 60_8, 120_8, 210_8, 336_8/) correct2 = (/3_8, 15_8, 5_8, 35_8, 7_8/) do i = lbound(x, 1), ubound(x, 1) do j = lbound(x, 2), ubound(x, 2) x(i, j) = i + j modx(i, j) = mod(i + j, 2) == 1 end do end do xproduct = product(x) print *, xproduct if( xproduct /= 12192768000_8 ) error stop xproduct = product(x, mask=modx) print *, xproduct if( xproduct /= 55125 ) error stop xproduct1 = product(x, 1) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct1(i) ) error stop end do xproduct1 = product(x, 1, mask=modx) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct2(i) ) error stop end do xproduct1 = product(x, dim=1) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct1(i) ) error stop end do xproduct1 = product(x, dim=1, mask=modx) print *, xproduct1 do i = lbound(xproduct1, 1), ubound(xproduct1, 1) if( xproduct1(i) /= correct2(i) ) error stop end do end program lfortran-lfortran-2f73434/integration_tests/exit_01.f900000664000175000017500000000021515141516316023167 0ustar alastairalastairprogram exit_01 integer :: i, N N = 10 do i = 1, N print *, i if ( i .eq. 5 ) then call exit() end if end do end program lfortran-lfortran-2f73434/integration_tests/legacy_array_sections_14_foo.f900000664000175000017500000000015615141516316027442 0ustar alastairalastairsubroutine foo(x) implicit none real, intent(inout) :: x(*) x(1) = x(1) + 1.0 end subroutine foo lfortran-lfortran-2f73434/integration_tests/array_bound_4.f900000664000175000017500000000025415141516316024451 0ustar alastairalastairprogram array_bound_4 integer :: x(-10:-5) if (lbound(x, 1) /= -10) error stop if (ubound(x, 1) /= -5) error stop if (size(x) /= 6) error stop end program lfortran-lfortran-2f73434/integration_tests/select_rank_06.f900000664000175000017500000000114715141516316024522 0ustar alastairalastairprogram select_rank_06 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) integer :: c(2, 1) integer :: d(3, 2) select rank(x) rank (1) print *, x(1) if (x(1) /= 4) error stop rank (2) print *, x(1, 2) if (x(1, 2) /= 3) error stop end select end subroutine check end program select_rank_06lfortran-lfortran-2f73434/integration_tests/submodule_11.f900000664000175000017500000000104515141516316024220 0ustar alastairalastairmodule math_submodule_11 implicit none interface logspace module subroutine logspace_sub(n) integer, intent(inout) :: n end subroutine logspace_sub end interface end module submodule (math_submodule_11) math_submodule_11_logspace implicit none contains module procedure logspace_sub n = 3 end procedure end submodule program submodule_11 use math_submodule_11 implicit none integer :: n = 2 call logspace(n) print *, n if (n /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_18.f900000664000175000017500000000073515141516316025103 0ustar alastairalastairmodule derived_types_18_module_1 implicit none type t_1 integer :: i end type t_1 type, extends(t_1) :: t_2 real :: r end type t_2 end module program derived_types_10 use derived_types_18_module_1 implicit none type(t_1) :: type_1 type(t_2) :: type_2 type_1%i = 123 type_2%t_1 = type_1 type_2%r = 10.00 if (type_2%i /= 123) error stop if (type_2%r /= 10.00) error stop end program derived_types_10 lfortran-lfortran-2f73434/integration_tests/data_15.f900000664000175000017500000000534615141516316023146 0ustar alastairalastairprogram data_15 implicit none real ABC(2,3,4,5) real :: sum_ABC real, parameter :: expected_sum_ABC = 345.6 ! Initialize 4D array ABC (2x3x4x5 = 120 elements) data ABC/ & 1.11, 1.12, 1.13, 1.14, 1.15, 1.21, 1.22, 1.23, 1.24, 1.25, 1.31, 1.32, 1.33, 1.34, 1.35, & 1.41, 1.42, 1.43, 1.44, 1.45, 1.51, 1.52, 1.53, 1.54, 1.55, 1.61, 1.62, 1.63, 1.64, 1.65, & 2.11, 2.12, 2.13, 2.14, 2.15, 2.21, 2.22, 2.23, 2.24, 2.25, 2.31, 2.32, 2.33, 2.34, 2.35, & 2.41, 2.42, 2.43, 2.44, 2.45, 2.51, 2.52, 2.53, 2.54, 2.55, 2.61, 2.62, 2.63, 2.64, 2.65, & 3.11, 3.12, 3.13, 3.14, 3.15, 3.21, 3.22, 3.23, 3.24, 3.25, 3.31, 3.32, 3.33, 3.34, 3.35, & 3.41, 3.42, 3.43, 3.44, 3.45, 3.51, 3.52, 3.53, 3.54, 3.55, 3.61, 3.62, 3.63, 3.64, 3.65, & 4.11, 4.12, 4.13, 4.14, 4.15, 4.21, 4.22, 4.23, 4.24, 4.25, 4.31, 4.32, 4.33, 4.34, 4.35, & 4.41, 4.42, 4.43, 4.44, 4.45, 4.51, 4.52, 4.53, 4.54, 4.55, 4.61, 4.62, 4.63, 4.64, 4.65 / print *, "4D array ABC elements:" print *, "ABC(1,1,1,1) =", ABC(1,1,1,1) print *, "ABC(2,3,4,5) =", ABC(2,3,4,5) print *, "ABC(1,2,3,4) =", ABC(1,2,3,4) print *, "ABC(2,1,3,2) =", ABC(2,1,3,2) print *, "ABC(1,3,2,5) =", ABC(1,3,2,5) print *, "ABC(2,2,2,2) =", ABC(2,2,2,2) print *, "ABC(1,3,4,1) =", ABC(1,3,4,1) print *, "ABC(2,3,1,5) =", ABC(2,3,1,5) ! Verify ABC values if (abs(ABC(1,1,1,1) - 1.11) > 1.0e-5) error stop "ABC(1,1,1,1) value is incorrect" if (abs(ABC(2,3,4,5) - 4.65) > 1.0e-5) error stop "ABC(2,3,4,5) value is incorrect" if (abs(ABC(1,2,3,4) - 3.62) > 1.0e-5) error stop "ABC(1,2,3,4) value is incorrect" if (abs(ABC(2,1,3,2) - 2.23) > 1.0e-5) error stop "ABC(2,1,3,2) value is incorrect" if (abs(ABC(1,3,2,5) - 4.42) > 1.0e-5) error stop "ABC(1,3,2,5) value is incorrect" if (abs(ABC(2,2,2,2) - 2.14) > 1.0e-5) error stop "ABC(2,2,2,2) value is incorrect" if (abs(ABC(1,3,4,1) - 1.53) > 1.0e-5) error stop "ABC(1,3,4,1) value is incorrect" if (abs(ABC(2,3,1,5) - 4.32) > 1.0e-5) error stop "ABC(2,3,1,5) value is incorrect" ! Check last few elements print *, "Last few ABC elements:" print *, "ABC(2,3,4,3) =", ABC(2,3,4,3) print *, "ABC(2,3,4,4) =", ABC(2,3,4,4) print *, "ABC(2,3,4,5) =", ABC(2,3,4,5) if (abs(ABC(2,3,4,3) - 3.32) > 1.0e-5) error stop "ABC(2,3,4,3) value is incorrect" if (abs(ABC(2,3,4,4) - 4.21) > 1.0e-5) error stop "ABC(2,3,4,4) value is incorrect" if (abs(ABC(2,3,4,5) - 4.65) > 1.0e-5) error stop "ABC(2,3,4,5) value is incorrect" print *, "Calculating sum..." ! Use intrinsic sum function to calculate the sums sum_ABC = sum(ABC) print *, "Sum of all ABC elements:", sum_ABC ! Verify sums if (abs(sum_ABC - expected_sum_ABC) > 1.0e-5) then print *, "Expected ABC sum:", expected_sum_ABC, "Actual:", sum_ABC error stop "Sum of ABC array is incorrect" end if print *, "Ok!" end program lfortran-lfortran-2f73434/integration_tests/procedure_24.f900000664000175000017500000000144515141516316024221 0ustar alastairalastairmodule procedure_24_mod implicit none type :: type1_t contains procedure :: printme end type type1_t contains subroutine printme(this) class(type1_t), intent(in) :: this end subroutine printme end module procedure_24_mod module procedure_24_mod2 implicit none type :: type2_t integer :: key contains procedure :: printme end type type2_t contains subroutine printme(this, n) class(type2_t), intent(inout) :: this integer, intent(in) :: n this%key = n end subroutine printme end module procedure_24_mod2 program procedure_24 use procedure_24_mod use procedure_24_mod2 implicit none type(type1_t) :: obj1 type(type2_t) :: obj2 call obj1%printme() call obj2%printme(422) if (obj2%key /= 422) error stop end program procedure_24lfortran-lfortran-2f73434/integration_tests/modules_54.f900000664000175000017500000000063715141516316023706 0ustar alastairalastairmodule module_modules_54 interface func procedure specialFunc end interface func contains function specialFunc() result(value) logical :: value value = .false. end function specialFunc end module module_modules_54 program modules_54 use module_modules_54 implicit none logical :: v v = specialFunc() print *, v if (v) error stop end program modules_54 lfortran-lfortran-2f73434/integration_tests/common_07.f900000664000175000017500000000026315141516316023517 0ustar alastairalastairSUBROUTINE DP86CO() COMMON /CONDO8/XOLD,HOUT RETURN END subroutine CONTD8() COMMON /CONDO8/XOLD,H RETURN END PROGRAM MAIN COMMON /CONDO8/XOLD,H end PROGRAM lfortran-lfortran-2f73434/integration_tests/enum_02_module.f900000664000175000017500000000032115141516316024526 0ustar alastairalastairmodule enum_02_module implicit none enum, bind(c) enumerator :: red, blue enumerator yellow end enum integer, parameter :: compiler_enum = kind(red) end module enum_02_module lfortran-lfortran-2f73434/integration_tests/format_44.f900000664000175000017500000000251415141516316023521 0ustar alastairalastairprogram format_44 ! Test formatting of special floating-point values (Infinity, NaN) implicit none real :: zero, pos_inf, neg_inf, nan_val character(20) :: str zero = 0.0 pos_inf = 1.0 / zero neg_inf = -1.0 / zero nan_val = zero / zero ! Test G format with Infinity write(str, '(G12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "G12.5 +Inf failed" write(str, '(G12.5)') neg_inf if (trim(adjustl(str)) /= "-Infinity") error stop "G12.5 -Inf failed" ! Test E format with Infinity write(str, '(E12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "E12.5 +Inf failed" write(str, '(E12.5)') neg_inf if (trim(adjustl(str)) /= "-Infinity") error stop "E12.5 -Inf failed" ! Test ES format with Infinity write(str, '(ES12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "ES12.5 +Inf failed" ! Test EN format with Infinity write(str, '(EN12.5)') pos_inf if (trim(adjustl(str)) /= "Infinity") error stop "EN12.5 +Inf failed" ! Test G format with NaN write(str, '(G12.5)') nan_val if (trim(adjustl(str)) /= "NaN") error stop "G12.5 NaN failed" ! Test E format with NaN write(str, '(E12.5)') nan_val if (trim(adjustl(str)) /= "NaN") error stop "E12.5 NaN failed" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/derived_types_11.f900000664000175000017500000000061615141516316025072 0ustar alastairalastairmodule derived_types_11 implicit none type :: y character(kind=1, len=1) :: backslash = '\' end type y type(y), public, parameter :: type_y = y() character(len=3) :: x = "lf" // type_y%backslash end module derived_types_11 program main use derived_types_11 implicit none if (type_y%backslash /= '\') error stop if (x /= "lf\") error stop end program lfortran-lfortran-2f73434/integration_tests/procedure_19.f900000664000175000017500000000154015141516316024221 0ustar alastairalastairmodule mod1_procedure_19 type :: my_type real :: value = 0.0 contains procedure :: plus generic :: g_proc => plus end type my_type contains subroutine plus(self, increment) class(my_type), intent(inout) :: self real, intent(in) :: increment self%value = self%value + increment end subroutine plus end module mod1_procedure_19 module mod2_procedure_19 use mod1_procedure_19 end module mod2_procedure_19 program procedure_19 use mod2_procedure_19 type(my_type) :: obj real :: test_increment = 5.0 call obj%g_proc(test_increment) print *, 'After adding', test_increment, ':', obj%value if (abs(obj%value - 5.0) > 1.0e-6) error stop call obj%g_proc(3.0) print *, 'After adding 3.0:', obj%value if (abs(obj%value - 8.0) > 1.0e-6) error stop end program procedure_19 lfortran-lfortran-2f73434/integration_tests/arrays_13.f900000664000175000017500000000216615141516316023531 0ustar alastairalastairprogram arrays_13 implicit none integer :: u, v integer, pointer :: i(:) real, pointer :: r(:, :) integer, target :: iv(2) real, target :: rv(2, 3) i => iv r => rv i(1) = 1 if( i(1) /= 1 ) then i(2) = 3 else i(2) = 7 end if if( iv(1) /= 1 ) error stop if( iv(2) /= 7 ) error stop do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) rv(u, v) = u * v end do end do call check_real(r) call check_real_without_pointer(r) contains subroutine check_real(r) real, pointer :: r(:, :) integer :: u, v do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) if( r(u, v) /= u * v ) error stop end do end do end subroutine subroutine check_real_without_pointer(r) real :: r(:, :) integer :: u, v do u = lbound(r, 1), ubound(r, 1) do v = lbound(r, 2), ubound(r, 2) if( r(u, v) /= u * v ) error stop end do end do end subroutine end program lfortran-lfortran-2f73434/integration_tests/intrinsics_330.f900000664000175000017500000000026015141516316024470 0ustar alastairalastairprogram intrinsics_330 print *, amax0(1,2,3) if (amax0(1, 2, 3) /= 3) error stop print *, max1(1.0,2.0,3.0) if (max1(1.0,2.0,3.0) /= 3.0) error stop end programlfortran-lfortran-2f73434/integration_tests/arrays_op_17.f900000664000175000017500000000046715141516316024235 0ustar alastairalastairprogram arrays_op_17 implicit none integer, allocatable :: g(:), y(:, :) integer :: b(20), i allocate(y(20, 20), g(20)) b = 2 y = 4 g = 8 do i = 1, 20 y(i, :) = g(:) * y(i, :) + b(:) end do print *, y if( any(y /= 34) ) error stop end program arrays_op_17 lfortran-lfortran-2f73434/integration_tests/array_concat.f900000664000175000017500000000174515141516316024374 0ustar alastairalastairprogram array_concat integer :: A = 2 integer :: B(3) = [1,2,3] real :: x(4) = [1.0, 2.0, -3.0, 4.0] integer, allocatable :: B2(:) integer :: C(4) logical :: D(4) C = [B, A] print *, C if( C(1) /= 1 .or. C(2) /= 2 .or. C(3) /= 3 .or. C(4) /= 2 ) error stop print *, B(1:3) D = [B, A] > 1 print *, D if( any(D .neqv. [.false., .true., .true., .true.]) ) error stop allocate(B2(size(B))) B2 = B D = [B2, A] > 1 print *, D if( any(D .neqv. [.false., .true., .true., .true.]) ) error stop D = [B([3,2,1]), A] > 1 print *, D if( any(D .neqv. [.true., .true., .false., .true.]) ) error stop D = [B2(2:3), A, A] > 1 print *, D if( any(D .neqv. [.true., .true., .true., .true.]) ) error stop call temp(x) contains subroutine temp(x) real, intent(in) :: x(:) real :: xx(size(x)) real :: tn(size(x) - 1) logical :: y tn = x(1:size(x)-1) xx = x y = any(xx <= 0 .and. abs([tn, 0.0]) > 0) print *, y if( y .neqv. .true.) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/allocate_09.f900000664000175000017500000000103015141516316024006 0ustar alastairalastairprogram allocate_09 implicit none call get_command_arguments_quoted() contains subroutine get_command_arguments_quoted() character(len=:), allocatable :: arg integer :: ilength ilength = 10 if( allocated(arg) ) deallocate(arg) allocate(character(len=ilength) :: arg) arg = 'okay fine' print *, arg, len(arg) if( arg /= 'okay fine' ) error stop if( len(arg) /= 9 ) error stop end subroutine get_command_arguments_quoted end program allocate_09 lfortran-lfortran-2f73434/integration_tests/transfer_11.f900000664000175000017500000000066115141516316024050 0ustar alastairalastairprogram transfer_string_to_int8 ! Test transfer of character string to integer(1) array implicit none integer(1) :: bytes(5) character(len=5) :: str integer :: i integer(1), parameter :: expected(5) = [104_1, 101_1, 108_1, 108_1, 111_1] ! "hello" str = "hello" bytes = transfer(str, bytes) do i = 1, 5 if (bytes(i) /= expected(i)) error stop end do print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/intrinsics_353.f900000664000175000017500000000035215141516316024477 0ustar alastairalastairprogram intrinsics_353 implicit none real, dimension(8) :: x real :: y call random_number(harvest=x) print *, 'Random numbers:', x call random_number(harvest=y) print *, 'Random numbers:', y end programlfortran-lfortran-2f73434/integration_tests/types_14.f900000664000175000017500000000021015141516316023361 0ustar alastairalastairprogram types_14 use iso_fortran_env, only: dp=>real64 implicit none double precision :: r, s(5) r = 1.0_dp end program lfortran-lfortran-2f73434/integration_tests/write_04.f900000664000175000017500000000016515141516316023357 0ustar alastairalastairprogram write_04 implicit none write(*,'("Hello ")',advance='NO') write(*,'("world!")') end programlfortran-lfortran-2f73434/integration_tests/pass_array_by_data_08.f900000664000175000017500000000104315141516316026054 0ustar alastairalastairprogram pass_array_by_data_08 implicit none integer, dimension(10) :: a interface subroutine fill_array(aa) integer, dimension(:), intent(out) :: aa integer :: i end subroutine fill_array end interface call fill_array(a) print *, a if( any(a /= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ) error stop end program pass_array_by_data_08 subroutine fill_array(a) implicit none integer, dimension(:), intent(out) :: a integer :: i do i = 1, 10 a(i) = i end do end subroutine fill_array lfortran-lfortran-2f73434/integration_tests/intrinsics_136.f900000664000175000017500000000367115141516316024505 0ustar alastairalastairprogram intrinsics_136 integer(4) :: x, y integer(8) :: i, j integer(4) :: arg_x(5) = [12, -13, 18, 20, 67] integer(4) :: arg_y(5) = [1, 2, 3, 4, 5] integer(8) :: arg_x2(5) = [103, 87, 88, -95, -134] integer(8) :: arg_y2(5) = [11, 12, 4, 0, 10] integer(4) :: res_x(5) integer(8) :: res_x2(5) integer(4), parameter :: res(5) = rshift([12, -13, 18, 20, 67], [1, 2, 3, 4, 5]) integer(8), parameter :: res2(5) = rshift([103, 87, 88, -95, -134], [11, 12, 4, 0, 10]) integer(4) :: expected_res(5) = [6, -4, 2, 1, 2] integer(8) :: expected_res2(5) = [0, 0, 5, -95, -1] integer(4), parameter :: comp1 = rshift(12, 1) integer(8), parameter :: comp2 = rshift(103, 11) print *, comp1 if (comp1 /= 6) error stop print *, comp2 if (comp2 /= 0) error stop res_x = rshift(arg_x, arg_y) res_x2 = rshift(arg_x2, arg_y2) do i = 1, size(res) print *, res(i) if (res(i) /= expected_res(i)) error stop end do do i = 1, size(res2) print *, res2(i) if (res2(i) /= expected_res2(i)) error stop end do do i = 1, size(res_x) print *, res_x(i) if (res_x(i) /= expected_res(i)) error stop end do do i = 1, size(res_x2) print *, res_x2(i) if (res_x2(i) /= expected_res2(i)) error stop end do x = 16 y = 2 i = 8 j = 4 print*, rshift(10_4, 0) if ( rshift(10_4, 0) /= 10) error stop print*, rshift(-10_8, 1) if ( rshift(-10_8, 1) /= -5 ) error stop print*, rshift(not(10_4), 2) if ( rshift(not(10_4), 2) /= -3 ) error stop print*, rshift(not(10_8), 3) if ( rshift(not(10_8), 3) /= -2 ) error stop print*, rshift(-x, y) if ( rshift(-x, y) /= -4 ) error stop print*, rshift(i, j) if ( rshift(i, j) /= 0 ) error stop print*, rshift(10, 1) if ( rshift(10, 1) /= 5 ) error stop print*, rshift(8, 2) if ( rshift(8, 2) /= 2 ) error stop endlfortran-lfortran-2f73434/integration_tests/test_ieee_arithmetic_03.f900000664000175000017500000000114615141516316026403 0ustar alastairalastairprogram test_ieee use, intrinsic :: ieee_arithmetic, only: ieee_support_inf, ieee_support_nan implicit none real(4) :: arr_sp(5) = [1.0, 2.0, 3.0, 4.0, 5.0] real(8) :: arr_dp(3) = [1.0d0, 2.0d0, 3.0d0] logical :: result_sp(5), result_dp(3) result_sp = ieee_support_inf(arr_sp) if (.not. all(result_sp)) error stop result_sp = ieee_support_nan(arr_sp) if (.not. all(result_sp)) error stop result_dp = ieee_support_inf(arr_dp) if (.not. all(result_dp)) error stop result_dp = ieee_support_nan(arr_dp) if (.not. all(result_dp)) error stop print *, "test passed" end program test_ieee lfortran-lfortran-2f73434/integration_tests/callback_02.f900000664000175000017500000000115015141516316023752 0ustar alastairalastairmodule callback_02 contains subroutine cb(res, a, b, f) real, intent(in) :: a, b real :: res interface subroutine f(x, res) implicit none real, intent(in) :: x real :: res end subroutine end interface call f(a, res) print *, res call f(b, res) print *, res res = (b-a)*res print *, res end subroutine real function foo(c, d, res) real :: c, d, res call cb(res, c, d, f) foo = res contains subroutine f(x, res) real, intent(in) :: x real :: res res = 2*x end subroutine f end function foo end module program main use callback_02 real :: res = 0 res = foo(1.5, 2.0, res) end program lfortran-lfortran-2f73434/integration_tests/format_13.f900000664000175000017500000000023615141516316023514 0ustar alastairalastairprogram format_13 implicit none character(len=10) :: flc write(flc, '(i0)') -2_1 print *, flc if (flc /= "-2") error stop end program lfortran-lfortran-2f73434/integration_tests/class_20.f900000664000175000017500000000052115141516316023324 0ustar alastairalastairmodule class_20_m implicit none type base integer :: m = 44 end type type, extends(base) :: derived integer :: n = 45 end type end module program class_20 use class_20_m implicit none class(base), allocatable :: b allocate(derived :: b) if (b%m /= 44) error stop end program lfortran-lfortran-2f73434/integration_tests/associate_03.f900000664000175000017500000000057015141516316024177 0ustar alastairalastairprogram associate_03 implicit none integer, pointer :: p1 integer, target :: t1 = 2, t2 = 1 integer :: i print *, t1, t2 ! Runtime pointer association if (t1 > t2) then p1 => t1 else p1 => t2 end if print *, p1 ! Does not work yet: !if (p1 == t2) error stop i = p1 if (i == t2) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_388.f900000664000175000017500000000052115141516316024505 0ustar alastairalastairprogram intrinsics_388 integer exit_status exit_status = -1 call execute_command_line( & command = "export TEST_ENV_VAR_VALUE=23", & wait = .true., & exitstat = exit_status & ) print *, "Exit status after setting environment variable:", exit_status if (exit_status /= 0) error stop end program intrinsics_388 lfortran-lfortran-2f73434/integration_tests/separate_compilation_03b.f900000664000175000017500000000033715141516316026571 0ustar alastairalastairmodule separate_compilation_03b_module contains real function mixing_anderson(x0) ! Finds "x" so that R(x) = 0, uses x0 as the initial estimate real, intent(in) :: x0(:) mixing_anderson = sum(x0) end function end module lfortran-lfortran-2f73434/integration_tests/class_02.f900000664000175000017500000000205715141516316023332 0ustar alastairalastairmodule class_circle2 implicit none private public :: main real :: pi = 3.1415926535897931d0 ! Class-wide private constant type, public :: Circle real :: radius contains procedure :: circle_area !=> circle_area ! Can you point to implementation in diff module? procedure :: circle_print end type Circle contains real function circle_area(this) class(Circle), intent(in) :: this circle_area = pi * this%radius**2 end function circle_area subroutine circle_print(this) class(Circle), intent(in) :: this real :: area area = this%circle_area() ! Call the type-bound function print *, 'Circle: r = ', this%radius, ' area = ', area end subroutine circle_print subroutine main() type(Circle) :: c ! Declare a variable of type Circle. c = Circle(1.0) ! Use the implicit constructor, radius = 1.5. c%radius = 1.5 call c%circle_print ! Call the type-bound subroutine end subroutine end module program circle_test use class_circle2, only: main implicit none call main() end program lfortran-lfortran-2f73434/integration_tests/kwargs_01.f900000664000175000017500000000226715141516316023525 0ustar alastairalastairprogram kwargs_01 ! Test keyword arguments implicit none integer :: i i = f(1, 2, 3, 4) if (i /= 1234) error stop call s(1, 2, 3, 4, i) if (i /= 1234) error stop i = f(1, 2, 3, d=4) if (i /= 1234) error stop call s(1, 2, 3, d=4, f=i) if (i /= 1234) error stop i = f(1, 2, c=3, d=4) if (i /= 1234) error stop call s(1, 2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(1, 2, d=3, c=4) if (i /= 1243) error stop call s(1, 2, d=3, c=4, f=i) if (i /= 1243) error stop i = f(1, b=2, c=3, d=4) if (i /= 1234) error stop call s(1, b=2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(1, c=2, d=3, b=4) if (i /= 1423) error stop call s(1, c=2, d=3, b=4, f=i) if (i /= 1423) error stop i = f(a=1, b=2, c=3, d=4) if (i /= 1234) error stop call s(a=1, b=2, c=3, d=4, f=i) if (i /= 1234) error stop i = f(d=1, c=2, a=3, b=4) if (i /= 3421) error stop call s(d=1, c=2, a=3, b=4, f=i) if (i /= 3421) error stop contains integer function f(a, b, c, d) integer, intent(in) :: a, b, c, d f = a*1000 + b*100 + c*10 + d end function subroutine s(a, b, c, d, f) integer, intent(in) :: a, b, c, d integer, intent(out) :: f f = a*1000 + b*100 + c*10 + d end subroutine end program lfortran-lfortran-2f73434/integration_tests/nested_16.f900000664000175000017500000000162015141516316023507 0ustar alastairalastairmodule nested_16_mod implicit none type :: terminal integer :: a = 1 end type type :: toml_lexer integer :: dummy = 0 type(terminal) :: term = terminal() end type toml_lexer contains subroutine temp2(lex) class(toml_lexer), intent(inout) :: lex lex%dummy = 400 lex%term%a = 100 end subroutine temp2 subroutine wrapper(lexer) class(toml_lexer) :: lexer if (lexer%term%a /= 1) error stop call temp() if (lexer%dummy /= 400) error stop if (lexer%term%a /= 100) error stop contains subroutine temp() call temp2(lexer) end subroutine temp end subroutine wrapper end module nested_16_mod program nested_16 use nested_16_mod implicit none type(toml_lexer) :: my_lexer my_lexer%dummy = 123 call wrapper(my_lexer) end program nested_16 lfortran-lfortran-2f73434/integration_tests/class_73.f900000664000175000017500000000237015141516316023340 0ustar alastairalastairprogram class_73 implicit none type :: toml_map_structure end type toml_map_structure type, extends(toml_map_structure) :: toml_ordered_map integer, allocatable :: arr(:) end type toml_ordered_map class(toml_map_structure), allocatable :: self, self2, self3 type(toml_ordered_map), allocatable, target :: map type(toml_ordered_map), pointer :: map_ptr allocate(map) allocate(map%arr(3)) map%arr = [1, 2, 3] self = map select type(self) type is (toml_ordered_map) if (any(self%arr /= [1,2,3])) error stop class default error stop end select map_ptr => map if (any(map_ptr%arr /= [1,2,3])) error stop deallocate(self) self = map_ptr select type(self) type is (toml_ordered_map) if (any(self%arr /= [1,2,3])) error stop class default error stop end select allocate(self2) self2 = map select type(self2) type is (toml_ordered_map) if (any(self2%arr /= [1,2,3])) error stop class default error stop end select call move_alloc(map, self3) select type(self3) type is (toml_ordered_map) if (any(self3%arr /= [1,2,3])) error stop class default error stop end select end program class_73 lfortran-lfortran-2f73434/integration_tests/flush_02.f900000664000175000017500000000026115141516316023341 0ustar alastairalastairprogram flush_02 implicit none open(10, file="file_01_data.txt") open(11, file="file_02_data.txt") call FLUSH() close(10) close(11) end program flush_02 lfortran-lfortran-2f73434/integration_tests/template_array_02.f900000664000175000017500000000463615141516316025243 0ustar alastairalastairmodule template_array_02_math implicit none private public :: add_integer, zero_integer, add_real, zero_real contains pure function add_integer(x, y) result(r) integer, intent(in) :: x, y integer :: r r = x + y end function pure function zero_integer(x) result(r) integer, intent(in) :: x integer :: r r = 0 end function pure function add_real(x, y) result(r) real, intent(in) :: x, y real :: r r = x + y end function pure function zero_real(x) result(r) real, intent(in) :: x real :: r r = 0 end function end module module template_array_02_m use template_array_02_math implicit none private public :: test_template requirement operations(t, plus_t, zero_t) type, deferred :: t pure function plus_t(l, r) result(rs) type(t), intent(in) :: l, r type(t) :: rs end function pure function zero_t(l) result(rs) type(t), intent(in) :: l type(t) :: rs end function end requirement template array_tmpl(t, plus_t, zero_t) require :: operations(t, plus_t, zero_t) private public :: mysum_t contains function mysum_t(a) result(r) type(t), intent(in) :: a(:) type(t) :: r integer :: i r = zero_t(a(1)) do i = 1, size(a) r = plus_t(r, a(i)) end do end function function mysum_t_n(n, a) result(r) integer, intent(in) :: n type(t), intent(in) :: a(n) type(t) :: r integer :: i r = zero_t(a(1)) do i = 1, size(a) r = plus_t(r, a(i)) end do end function end template contains subroutine test_template() instantiate array_tmpl(integer, add_integer, zero_integer), only: & mysum_integer => mysum_t, mysum_integer_n => mysum_t_n integer :: a(10), b(10), i, sa, sb do i = 1, size(a) a(i) = i b(i) = i end do sa = mysum_integer(a) sb = mysum_integer_n(size(b), b) print *, sa print *, sb end subroutine end module program template_array_02 use template_array_02_math use template_array_02_m implicit none call test_template() end lfortran-lfortran-2f73434/integration_tests/class_42.f900000664000175000017500000000256215141516316023337 0ustar alastairalastairmodule class_42_mod type, public :: AbsType contains procedure :: abs_method end type AbsType type, extends(AbsType) :: ConcreteType contains procedure :: abs_method => concrete_abs_method end type ConcreteType type :: Wrapper class(AbsType), allocatable :: obj class(ConcreteType), allocatable :: c_obj end type Wrapper type :: Client type(Wrapper) :: wrapped contains procedure :: caller end type Client contains subroutine concrete_abs_method(self, val) class(ConcreteType), intent(in) :: self integer, intent(in) :: val print *, "concrete_abs_method called with value", val if (val /= 37) error stop end subroutine concrete_abs_method subroutine caller(self) class(Client), intent(in) :: self call self%wrapped%c_obj%abs_method(37) call self%wrapped%obj%abs_method(42) end subroutine caller subroutine abs_method(self, val) class(AbsType), intent(in) :: self integer, intent(in) :: val print *, "abs_method called with value ", val if (val /= 42) error stop end subroutine abs_method end module class_42_mod program class_42 use class_42_mod class(Client), allocatable :: var allocate(var) allocate(ConcreteType :: var%wrapped%c_obj) allocate(var%wrapped%obj) call var%caller() end program class_42lfortran-lfortran-2f73434/integration_tests/class_33.f900000664000175000017500000000076715141516316023344 0ustar alastairalastairprogram class_33 implicit none type :: val_type integer :: origin = 3 end type class(val_type), allocatable :: val1 allocate(val1) call sub(val1) print *, "Outside val1%origin: ", val1%origin if (val1%origin /= 5) error stop contains subroutine sub(val) type(val_type), intent(inout) :: val print *, "Inside subroutine, val%origin: ", val%origin if (val%origin /= 3) error stop val%origin = 5 end subroutine sub end program class_33 lfortran-lfortran-2f73434/integration_tests/file_open_04.f900000664000175000017500000000067715141516316024175 0ustar alastairalastairprogram open_direct_form use iso_fortran_env, only: int32 implicit none integer(int32) :: x, y x = 654321 open(10, file="file_open_04_data.bin", access="direct", recl=4) write(10, rec=1) x close(10) open(10, file="file_open_04_data.bin", access="direct", recl=4) read(10, rec=1) y close(10) if (y /= x) then print *, "FAIL: expected", x, "got", y error stop 1 end if end programlfortran-lfortran-2f73434/integration_tests/derived_types_72.f900000664000175000017500000000107615141516316025102 0ustar alastairalastairprogram main implicit none integer,parameter :: n = 2 type :: my_type integer :: key end type type :: my_type2 type(my_type), allocatable :: x(:) end type type :: matrix integer :: elements(n) end type type(matrix) :: m type(my_type) :: arr(5) type(my_type2) :: mt2 integer :: i m%elements = [1, 2] arr = [(my_type(i), i=1, 5)] if (any(arr%key /= [1,2,3,4,5])) error stop allocate(mt2%x(1)) mt2%x(1) = arr(1) mt2%x = [mt2%x, arr] if (any(mt2%x%key /= [1, 1, 2, 3, 4, 5])) error stop end programlfortran-lfortran-2f73434/integration_tests/derived_types_95.f900000664000175000017500000000145715141516316025112 0ustar alastairalastairprogram derived_types_95 type:: tt integer :: n end type class(tt), allocatable :: arr(:) integer :: i print *, allocated(arr) if(allocated(arr)) error stop allocate(arr(3)) arr(1)%n = 10 arr(2)%n = 20 arr(3)%n = 30 do i = 1, size(arr) print *, arr(i)%n if(arr(i)%n /= i*10) error stop end do print *, allocated(arr) if(.not. allocated(arr)) error stop call foo(arr) contains subroutine foo(arg) class(tt), intent(in) :: arg(:) integer :: i print *, size(arg) if(size(arg) /= 3) error stop do i = 1, size(arg) print *, arg(i)%n ! if(arg(i)%n /= i*10) error stop >>>>>>>>>>>>>>>> !TODO: Uncomment when fixed end do end subroutine end programlfortran-lfortran-2f73434/integration_tests/intrinsics_203.f900000664000175000017500000001241315141516316024472 0ustar alastairalastairprogram intrinsics_203 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 real(sp) :: x,y,z real(dp) :: i,j,k integer :: iterator real(dp) :: w(19) real(sp) :: u(19) real(sp) :: res_u(19) real(dp) :: res_w(19) real(dp) :: expected_w(19) real(sp) :: expected_u(19) real(dp), parameter :: res1(19) = asind([0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp]) real(sp), parameter :: res_2(19) = asind([0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004995004995_sp, -0.999000999000999_sp, & -0.9985014985014985_sp, -0.998001998001998_sp, -0.9975024975024975_sp, & -0.997002997002997_sp, -0.9965034965034965_sp, -0.996003996003996_sp, & -0.9955044955044955_sp, -0.995004995004995_sp, -0.9945054945054945_sp, & -0.994005994005994_sp]) w = [0.321_dp, 0.526_dp, 0.728_dp, -0.321_dp, -0.526_dp, -0.728_dp, & -1.0_dp, -0.9995004995004995_dp, -0.999000999000999_dp, & -0.9985014985014985_dp, -0.998001998001998_dp, -0.9975024975024975_dp, & -0.997002997002997_dp, -0.9965034965034965_dp, -0.996003996003996_dp, & -0.9955044955044955_dp, -0.995004995004995_dp, -0.9945054945054945_dp, & -0.994005994005994_dp] u = [0.321_sp, 0.526_sp, 0.728_sp, -0.321_sp, -0.526_sp, -0.728_sp, & -1.0_sp, -0.9995004995004995_sp, -0.999000999000999_sp, & -0.9985014985014985_sp, -0.998001998001998_sp, -0.9975024975024975_sp, & -0.997002997002997_sp, -0.9965034965034965_sp, -0.996003996003996_sp, & -0.9955044955044955_sp, -0.995004995004995_sp, -0.9945054945054945_sp, & -0.994005994005994_sp] expected_w = [18.7234114226922479_dp, 31.7355871858161613_dp, 46.7189879975828859_dp, & -18.7234114226922479_dp, -31.7355871858161613_dp, -46.7189879975828859_dp, & -90.0000000000000000_dp, -88.1889782219856926_dp, -87.4387217993888584_dp, & -86.8629570229495442_dp, -86.3775039053440139_dp, -85.9497575149846398_dp, & -85.5629967823348778_dp, -85.2072890476047604_dp, -84.8761629060389708_dp, & -84.5651234927047142_dp, -84.2708982602068915_dp, -83.9910168022338581_dp, & -83.7235599383380418_dp] expected_u = [18.7234116_sp, 31.7355881_sp, 46.7189827_sp, & -18.7234116_sp, -31.7355881_sp, -46.7189827_sp, & -90.0000000_sp, -88.1890030_sp, -87.4387589_sp, & -86.8629379_sp, -86.3774948_sp, -85.9497604_sp, & -85.5630112_sp, -85.2072754_sp, -84.8761520_sp, & -84.5651245_sp, -84.2709045_sp, -83.9909973_sp, & -83.7235489_sp] res_w = asind(w) res_u = asind(u) do iterator = 1, size(res1) print *, res1(iterator) if (abs(res1(iterator) - expected_w(iterator)) > 1e-12_dp) error stop end do do iterator = 1, size(res_2) print *, res_2(iterator) if (abs(res_2(iterator) - expected_u(iterator)) > 1e-5_sp) error stop end do do iterator = 1, size(res_w) print *, asind(res_w(iterator)) if (abs(res_w(iterator) - expected_w(iterator)) > 1e-12_dp) error stop end do do iterator = 1, size(res_u) print *, asind(res_u(iterator)) if (abs(res_u(iterator) - expected_u(iterator)) > 1e-5_sp) error stop end do x = 0.123 y = 0.876 z = 0.542 i = 0.321 j = 0.526 k = 0.728 print *, asind(x) if (asind(x) - 7.06527281 > 1e-5) error stop print *, asind(y) if (asind(y) - 61.1635399 > 1e-5) error stop print *, asind(z) if (asind(z) - 32.8198891 > 1e-5) error stop print *, asind(i) if (asind(i) - 18.723412014063609_dp > 1e-12) error stop print *, asind(j) if (asind(j) - 31.735588727756351_dp > 1e-12) error stop print *, asind(k) if (asind(k) - 46.7189879975828859_dp > 1e-12) error stop print *, asind(0.123_sp) if (asind(0.123_sp) - 7.06527328 > 1e-5) error stop print *, asind(0.876_sp) if (asind(0.876_sp) - 61.1635437 > 1e-5) error stop print *, asind(0.542_sp) if (asind(0.542_sp) - 32.8198929 > 1e-5) error stop print *, asind(0.321_dp) if (asind(0.321_dp) - 18.723411422692248_dp > 1e-12) error stop print *, asind(0.526_dp) if (asind(0.526_dp) - 31.735587185816161_dp > 1e-12) error stop print *, asind(0.728_dp) if (asind(0.728_dp) - 46.718987997582886_dp > 1e-12) error stop x = -0.123 y = -0.876 z = -0.542 i = -0.321 j = -0.526 k = -0.728 print *, asind(x) if (asind(x) - (-7.06527281) > 1e-5) error stop print *, asind(y) if (asind(y) - (-61.1635399) > 1e-5) error stop print *, asind(z) if (asind(z) - (-32.8198891) > 1e-5) error stop print *, asind(i) if (asind(i) - (-18.7234114226922479_dp) > 1e-12) error stop print *, asind(j) if (asind(j) - (-31.7355871858161613_dp) > 1e-12) error stop print *, asind(k) if (asind(k) - (-46.718986762209930_dp) > 1e-12) error stop end program lfortran-lfortran-2f73434/integration_tests/list_test_09_.f900000664000175000017500000000331415141516316024402 0ustar alastairalastairmodule list_test_09_mod implicit none real :: eps = 1e-6 contains subroutine test_list_concat() type(_lfortran_list(integer)) :: x, y, z type(_lfortran_list(character(:))) :: c, d integer :: i z = _lfortran_concat(x, y) if (_lfortran_len(z) /= 0) error stop x = _lfortran_list_constant(1, 2, 3) z = _lfortran_concat(x, y) do i = 1, 3 if (_lfortran_get_item(z, i - 1) /= i) error stop end do call _lfortran_clear(x) y = _lfortran_list_constant(6, 7, 8) z = _lfortran_concat(x, y) do i = 1, 3 if (_lfortran_get_item(z, i - 1) /= i + 5) error stop end do x = _lfortran_list_constant(1, 2, 3, 4, 5) z = _lfortran_concat(x, y) do i = 1, 8 if (_lfortran_get_item(z, i - 1) /= i) error stop end do call _lfortran_clear(x) call _lfortran_clear(y) do i = 9, 50 call _lfortran_list_append(x, i) end do do i = 51, 100 call _lfortran_list_append(y, i) end do z = _lfortran_concat(_lfortran_concat(z, x), y) call _lfortran_set_item(x, 0, 0) call _lfortran_set_item(x, 1, 0) call _lfortran_clear(y) do i = 1, 99 if (_lfortran_get_item(z, i - 1) /= i) error stop end do c = _lfortran_list_constant('a', 'b') d = _lfortran_list_constant('c', 'd', 'e') c = _lfortran_concat(c, d) if (_lfortran_len(c) /= 5) error stop do i = 0, 4 if (_lfortran_ord(_lfortran_get_item(c, i)) - _lfortran_ord('a') /= i) error stop end do end subroutine end module program test_list_concat_ use list_test_09_mod implicit none call test_list_concat() end program lfortran-lfortran-2f73434/integration_tests/character_12.f900000664000175000017500000000144515141516316024162 0ustar alastairalastairprogram character_12 use iso_c_binding, only: c_char implicit none character(:), allocatable :: text character(kind=c_char, len=:), allocatable :: y text = "Hello" if (.not. expect_h(text)) error stop if (.not. expect_h("Hello")) error stop if (expect_h("World")) error stop y = 'Hello' // achar(0) if (.not. temp(y)) error stop contains logical function expect_h(x) character, intent(in) :: x(*) expect_h = (x(1) == 'H') end function expect_h logical function temp(x) character(kind=c_char), intent(in) :: x(*) integer :: i i = 1 temp = .false. if (ichar(x(i)) >= ichar('A') .and. ichar(x(i)) <= ichar('Z')) then temp = .true. end if end function temp end program character_12 lfortran-lfortran-2f73434/integration_tests/implied_do_loops17.f900000664000175000017500000000146415141516316025416 0ustar alastairalastair! Test that the loop variable in an array constructor implied-DO ! is isolated and does not affect outer variables with the same name program implied_do_loops17 implicit none integer :: a(5) integer :: i, j real :: b(3) ! Test 1: Basic isolation test i = 0 a = [(1, i = 1, 5)] if (i /= 0) error stop ! Test 2: Multiple implied-DO loops should each restore their variable j = 42 a = [(j, j = 1, 5)] if (j /= 42) error stop ! Test 3: With expression in the implied-DO body i = 100 a = [(i*2, i = 1, 5)] if (i /= 100) error stop ! Test 4: Nested implied-DO should also isolate variables i = 10 j = 20 b = [(real(i+j), i = 1, 3)] if (i /= 10) error stop if (j /= 20) error stop print *, "PASSED" end program implied_do_loops17 lfortran-lfortran-2f73434/integration_tests/intrinsics_288.f900000664000175000017500000000666015141516316024516 0ustar alastairalastairprogram intrinsics_288 implicit none type :: my_type integer :: a end type integer, dimension(3) :: source1 = [1, 2, 3] real, dimension(3) :: source2 = [1.0, 2.0, 3.0] logical, dimension(3) :: source3 = [.true., .false., .true.] complex, dimension(3) :: source4 = [(1, 2), (2, 3), (3, 4)] character(len=1), dimension(3) :: source5 = ['a', 'b', 'c'] integer, dimension(3) :: source = [1, 2, 3] integer, dimension(3, 2) :: result integer, dimension(2, 3) :: result1 real, dimension(3, 2) :: result2 logical, dimension(2, 3) :: result3 complex, dimension(3, 2) :: result4 integer :: a = 1 integer, dimension(2) :: result5 character :: ch = 'b' character, dimension(2) :: result6 logical :: lo = .true. logical, dimension(2) :: result7 real :: rl = 1.0 real, dimension(2) :: result8 type(my_type) :: source6(2) type(my_type) :: result9(2,3) integer :: i, j result = spread(source, dim=2, ncopies=2) print *, result if (result(1, 1) /= 1 .or. result(1, 2) /= 1 .or. result(2, 1) /= 2 .or. & result(2, 2) /= 2 .or. result(3, 1) /= 3 .or. result(3, 2) /= 3) error stop print *, spread([1, 4, 5], 2, 2) result = spread([1, 4, 5], 2, 2) print *, result(1, 1) ! Does not work yet ! if (result(1, 1) /= 1 .or. result(1, 2) /= 1 .or. result(2, 1) /= 4 .or. & ! result(2, 2) /= 4 .or. result(3, 1) /= 5 .or. result(3, 2) /= 5) error stop print *, spread([1, 2, 3, 4, 5], 1, 2) print *, spread([1.0, 2.0, 3.0], 1, 3) print *, spread([(1, 2), (2, 3)], 1, 2) print *, spread(['a', 'b', 'c'], 1, 3) print *, spread([.true., .false., .true.], 1, 2) print *, spread(source1, 1, 2) result1 = spread(source1, 1, 2) print *, result1 print *, result1(1, 2) if (result1(1, 1) /= 1 .or. result1(1, 2) /= 2 .or. result1(1, 3) /= 3 .or. & result1(2, 1) /= 1 .or. result1(2, 2) /= 2 .or. result1(2, 3) /= 3) error stop print *, spread(source2, 2, 2) result2 = spread(source2, 2, 2) if (abs(result2(1, 1) - 1.0) > 1e-6 .or. abs(result2(1, 2) - 1.0) > 1e-6 .or. abs(result2(2, 1) - 2.0) > 1e-6 .or. & abs(result2(2, 2) - 2.0) > 1e-6 .or. abs(result2(3, 1) - 3.0) > 1e-6 .or. abs(result2(3, 2) - 3.0) > 1e-6) error stop print *, spread(source3, 1, 2) result3 = spread(source3, 1, 2) print *, result3(2, 1) if (result3(1, 1) .neqv. .true. .or. result3(1, 2) .neqv. .false. .or. result3(1, 3) .neqv. .true. .or. & result3(2, 1) .neqv. .false. .or. result3(2, 2) .neqv. .false. .or. result3(2, 3) .neqv. .true.) error stop print *, spread(source4, 2, 2) result4 = spread(source4, 2, 2) if (result4(1, 1) /= (1, 2) .or. result4(1, 2) /= (1, 2) .or. result4(2, 1) /= (2, 3) .or. & result4(2, 2) /= (2, 3) .or. result4(3, 1) /= (3, 4) .or. result4(3, 2) /= (3, 4)) error stop print *, spread(source5, 1, 3) ! Wrong output with LFortran ! tests for Scalar Sources result5 = SPREAD(a, 1, 2) print *, result5 if (result5(1) /= 1 .or. result5(2) /= 1 ) error stop result6 = SPREAD(ch, 1, 2) print *, result6 if (result6(1) /= 'b' .or. result6(2) /= 'b' ) error stop result7 = SPREAD(lo, 1, 2) print *, result7 if ( (result7(1) .neqv. .true.) .or. (result7(2) .neqv. .true.) ) error stop result8 = SPREAD(rl, 1, 2) print *, result8 if ( abs(result8(1) - 1.0) > 1e-6 .or. abs(result8(2) - 1.0) > 1e-6 ) error stop do i = 1, 2 source6(i)%a = i end do result9 = spread(source6, dim=2, ncopies=3) do i = 1, 2 do j = 1, 3 if (result9(i,j)%a /= i) error stop end do end do end program lfortran-lfortran-2f73434/integration_tests/precision_01.f900000664000175000017500000000030415141516316024210 0ustar alastairalastairprogram precision_01 double precision :: x,x1, x2 x1 = 1.234D0 x2 = 4.567D0 x = 1.0 - x1 / x2 print *, x if (abs(x - 0.72980074447120646D0) > 1d-10) error stop end program lfortran-lfortran-2f73434/integration_tests/arrays_op_16.f900000664000175000017500000000042315141516316024224 0ustar alastairalastairprogram arrays_op_16 implicit none integer:: x(10) = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/), i integer, allocatable :: y(:) allocate(y(10)) y(:) = x(:) print *, x, y do i = 1, 10 if( y(i) /= i ) error stop end do end program arrays_op_16 lfortran-lfortran-2f73434/integration_tests/arrays_10.f900000664000175000017500000000016015141516316023516 0ustar alastairalastairprogram arrays_10 implicit none integer, pointer :: x(:) allocate(x(1)) x = [ 1 ] end program arrays_10 lfortran-lfortran-2f73434/integration_tests/select_type_21.f900000664000175000017500000000077415141516316024552 0ustar alastairalastairprogram select_type_char_mre implicit none call print_any(" Hello World ") print *, "test passed" contains subroutine print_any(generic) class(*), intent(in) :: generic character(len=:), allocatable :: out select type (generic) type is (character(len=*)) out = trim(generic) class default stop 1 end select if (out /= " Hello World ") stop 2 end subroutine print_any end program select_type_char_mrelfortran-lfortran-2f73434/integration_tests/functions_05.f900000664000175000017500000000130715141516316024235 0ustar alastairalastairprogram functions_01 implicit none integer :: x = 5, y real :: p = 5, q real :: a, b, c y = f(x) print *, y q = f_real(p) print *, q a = 20.0 b = -30.0 c = signr32(a, b) print *, c contains integer function f(a) result(b) integer, intent(in) :: a integer :: x x = 2 b = a + x end function real function f_real(a) result(b) real, intent(in) :: a b = a + signr32(1.0, a) end function real(4) function signr32(x, y) result(r) real(4), intent(in) :: x, y r = x if ((x >= 0.0 .and. y >= 0.0) .or. (x <= 0.0 .and. y <= 0.0)) then r = x else r = -x end if end function end program lfortran-lfortran-2f73434/integration_tests/modules_33_module3.f900000664000175000017500000000067315141516316025333 0ustar alastairalastairmodule fpm_modules_33 use fpm_dependency_modules_33, only : package_config_t, error_t use fpm_model_modules_33, only: fpm_model_t implicit none contains subroutine build_model(model, package, error) type(fpm_model_t), intent(out) :: model type(package_config_t), intent(in) :: package type(error_t), allocatable, intent(out) :: error call model%deps%add(package, error) end subroutine build_model end module fpm_modules_33 lfortran-lfortran-2f73434/integration_tests/associate_25.f900000664000175000017500000000057015141516316024203 0ustar alastairalastairprogram associate_23 implicit none type :: line_token integer :: first end type type(line_token), allocatable :: token(:) integer :: shift allocate(token(2)) token%first = [2, 4] associate(first => token%first) shift = first(1) - 1 end associate if (shift /= 1) error stop "shift mismatch" end program associate_23 lfortran-lfortran-2f73434/integration_tests/separate_compilation_27a.f900000664000175000017500000000125515141516316026576 0ustar alastairalastairmodule kinds_separate_compilation_27 use iso_fortran_env, only: int8, int16, int32, int64 end module kinds_separate_compilation_27 module error_separate_compilation_27 implicit none interface module subroutine error_sub(code) integer, intent(inout) :: code end subroutine error_sub end interface end module error_separate_compilation_27 module io_separate_compilation_27 use kinds_separate_compilation_27, only: int8, int16, int32, int64 use error_separate_compilation_27, only: error_sub implicit none contains subroutine open(i) integer, intent(inout) :: i call error_sub(i) end subroutine open end module io_separate_compilation_27lfortran-lfortran-2f73434/integration_tests/allocate_31.f900000664000175000017500000000232215141516316024006 0ustar alastairalastairmodule allocate_31_mod type, abstract :: Base contains procedure(work_interface), deferred :: work end type abstract interface subroutine work_interface(self) import Base class(Base), intent(inout) :: self end subroutine end interface type, extends(Base) :: Child integer :: value contains procedure :: work => child_work end type contains subroutine child_work(self) class(Child), intent(inout) :: self print *, "Child work called, value =", self%value end subroutine end module allocate_31_mod program allocate_31 use allocate_31_mod implicit none class(Base), allocatable :: src, obj ! Allocate src as Child type allocate(Child :: src) select type(src) type is (Child) src%value = 42 end select ! Allocate obj with mold=src (should get Child type but not copy data) allocate(obj, mold=src) ! Set obj's value select type(obj) type is (Child) obj%value = 123 if (obj%value /= 123) error stop "obj%value should be 123" end select ! Call deferred procedure call obj%work() end program allocate_31 lfortran-lfortran-2f73434/integration_tests/intrinsics_326.f900000664000175000017500000000060315141516316024476 0ustar alastairalastairprogram intrinsics_326 integer :: A(3) A = [1, 9, -1] call temp(A) contains subroutine temp(xpt) integer, intent(in) :: xpt(:) logical :: y(size(xpt)) integer :: iubd real :: subd_test(size(xpt)) subd_test = [1.0, 9.0, -1.0] y = .true. print *, minloc(subd_test, mask = y) if (any(minloc(subd_test, mask = y) /= 3)) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_16b.f900000664000175000017500000000013115141516316026215 0ustar alastairalastairlogical function sisnan( sin ) real, intent(in) :: sin sisnan = (sin.ne.sin) return end lfortran-lfortran-2f73434/integration_tests/operator_overloading_02.f900000664000175000017500000000132115141516316026442 0ustar alastairalastairmodule overload_assignment_m implicit none private public assignment (=) interface assignment (=) module procedure logical_gets_integer end interface contains subroutine logical_gets_integer(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = (i == 0) end subroutine subroutine logical_gets_integer_use(tf, i) logical, intent (out) :: tf integer, intent (in) :: i tf = i end subroutine end module program main use overload_assignment_m, only: assignment(=) implicit none logical :: tf tf = 0 print *, "tf=0:", tf ! Yields: T tf = 1 print *, "tf=1:", tf ! Yields: F end program lfortran-lfortran-2f73434/integration_tests/implied_do_loops9.f900000664000175000017500000000114015141516316025326 0ustar alastairalastairprogram implied_do_loops9 integer, parameter :: n = 3 complex :: b(n,n) complex, parameter :: i_ = cmplx(0,1) integer :: i,j b = reshape([((merge(i + 1*i_,0*i_,i==j), i=1,n), j=1,n)], [n,n]) print * , b if (b(1,1) /= cmplx(1,1)) error stop if (b(1,2) /= cmplx(0,0)) error stop if (b(1,3) /= cmplx(0,0)) error stop if (b(2,1) /= cmplx(0,0)) error stop if (b(2,2) /= cmplx(2,1)) error stop if (b(2,3) /= cmplx(0,0)) error stop if (b(3,1) /= cmplx(0,0)) error stop if (b(3,2) /= cmplx(0,0)) error stop if (b(3,3) /= cmplx(3,1)) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_27.f900000664000175000017500000000035215141516316023700 0ustar alastairalastairmodule tomlf_build use tomlf_build_array, only : get_value use tomlf_build_keyval, only : get_value implicit none end module tomlf_build program modules_27 implicit none print *, "running modules_27 program" end program lfortran-lfortran-2f73434/integration_tests/if_label_01.f900000664000175000017500000000120315141516316023751 0ustar alastairalastairprogram if_label_01 implicit none integer :: basein_local basein_local = 1 ! Try 1 or 2 to test both branches ALL: if (basein_local < 0) then print *, "Inside IF block: basein_local =", basein_local else TMP: block basein_local = 2 ! This will override the outer variable exit ALL end block TMP print *, "Inside ELSE block: basein_local =", basein_local basein_local = 3 ! This will not be executed if the exit is taken end if ALL print *, "After IF block: basein_local =", basein_local if (basein_local /= 2) error stop end program if_label_01 lfortran-lfortran-2f73434/integration_tests/complex_div_test.f900000664000175000017500000000020315141516316025263 0ustar alastairalastairprogram complex2 complex :: x x = (3.0, 4.0) x = x/4.0 print *, x x = 2/x print *, x x = 1/(x + (0.0, 3.0)) print *, x end program lfortran-lfortran-2f73434/integration_tests/file_34.f900000664000175000017500000000142015141516316023142 0ustar alastairalastairprogram file_34 implicit none integer :: io, ios character(len=:), allocatable :: temp2 character(len=:), allocatable :: temp temp2 = 'HELLO' open(newunit=io, file="config.toml", access="stream", form="formatted", & status="replace", iostat=ios) if (ios /= 0) stop "open-for-write failed" write(io, '(a)', iostat=ios) trim(temp2) if (ios /= 0) stop "write failed" close(io) allocate(character(len=5) :: temp) open(newunit=io, file="config.toml", access="stream", form="formatted", & status="old", iostat=ios) if (ios /= 0) stop "open-for-read failed" read(io, '(a)') temp print *, "First character read =", temp close(io, status="delete") if (temp /= "HELLO") error stop end program file_34 lfortran-lfortran-2f73434/integration_tests/intrinsics_121.f900000664000175000017500000000110315141516316024463 0ustar alastairalastairPROGRAM test integer(4) :: x = 576897908 integer(8) :: y = 5 WRITE (*,*) leadz(0_4) if (leadz(0_4) /= 32) error stop WRITE (*,*) leadz(5_8) if (leadz(5_8) /= 61) error stop WRITE (*,*) leadz(x) if (leadz(x) /= 2) error stop WRITE (*,*) leadz(y) if (leadz(y) /= 61) error stop WRITE (*,*) leadz(-y) if (leadz(-y) /= 0) error stop WRITE (*,*) leadz(-x) if (leadz(-x) /= 0) error stop WRITE (*,*) leadz(-2) if (leadz(-2) /= 0) error stop WRITE (*,*) leadz(0) if (leadz(0) /= 32) error stop END PROGRAMlfortran-lfortran-2f73434/integration_tests/procedure_12.f900000664000175000017500000000164115141516316024214 0ustar alastairalastairmodule procedure_12_mod contains recursive subroutine sub(int, X) integer, intent(in) :: int integer, intent(inout) :: X(:) procedure(sub), pointer :: proc proc => sub if (int <= 5) X(int) = int if (int > 5) return if (mod(int, 2) /= 0) then print *, "Odd: ", int call proc(int + 1, X) else proc => alt_sub call proc(int, X) end if end subroutine sub subroutine alt_sub(int, X) integer, intent(in) :: int integer, intent(inout) :: X(:) if (int <= 5) X(int) = int print *, "Even: ", int call sub(int + 1, X) end subroutine alt_sub end module procedure_12_mod program procedure_12 use procedure_12_mod integer :: X(5) = [0, 0, 0, 0, 0] call sub(1, X) print *, X if(X(1) /= 1 .or. X(2) /= 2 .or. X(3) /= 3 .or. X(4) /= 4 .or. X(5) /= 5) error stop end program procedure_12lfortran-lfortran-2f73434/integration_tests/tuple_test_02_.f900000664000175000017500000000505715141516316024557 0ustar alastairalastairmodule tuple_test_02_mod implicit none real :: eps = 1e-12 contains function set_tuple(a, b) result(t) integer, intent(in) :: a real, intent(in) :: b type(_lfortran_tuple(integer, real, character(len=:), complex)) :: t character(len=:), allocatable :: s s = "" t = _lfortran_tuple_constant(a, b, s, cmplx(a, b)) end function function merge_tuple(a, b) result(c) type(_lfortran_tuple(integer, real, character(len=:), complex)), intent(in) :: a, b type(_lfortran_tuple(integer, real, character(len=:), complex)) :: c integer :: a0, b0 real :: a1, b1 character(len=:), allocatable :: s complex :: a3, b3 a0 = _lfortran_get_item(a, 0) b0 = _lfortran_get_item(b, 0) a1 = _lfortran_get_item(a, 1) b1 = _lfortran_get_item(b, 1) a3 = _lfortran_get_item(a, 3) b3 = _lfortran_get_item(b, 3) s = trim(to_string(a0)) // trim(to_string(b0)) c = _lfortran_tuple_constant(a0 + b0, a1 + b1, s, a3 + b3) end function subroutine f() type(_lfortran_tuple(integer, real, character(len=:), complex)) :: t1, t2 integer :: i real :: j integer :: x real :: y character(len=:), allocatable :: s complex :: z t1 = set_tuple(0, 0.0) do i = 0, 10 j = real(i) t2 = set_tuple(i, j) t1 = merge_tuple(t1, t2) end do x = _lfortran_get_item(t1, 0) y = _lfortran_get_item(t1, 1) s = _lfortran_get_item(t1, 2) z = _lfortran_get_item(t1, 3) if (x /= 55) error stop if (abs(y - 55.0) > eps) error stop if (s /= "4510") error stop if (abs(z - cmplx(55.0, 55.0)) > eps) error stop print *, x, y, s, z end subroutine function g_check(x, y) result(res) type(_lfortran_tuple(integer, integer)), intent(in) :: x, y logical :: res res = _lfortran_get_item(x, 0) == _lfortran_get_item(y, 0) end function subroutine test_issue_1348() type(_lfortran_tuple(integer, integer)) :: a11, b11 a11 = _lfortran_tuple_constant(1, 2) b11 = _lfortran_tuple_constant(1, 2) if (.not. g_check(a11, b11)) error stop end subroutine subroutine tests() call f() call test_issue_1348() end subroutine pure function to_string(i) result(s) integer, intent(in) :: i character(len=:), allocatable :: s character(len=32) :: buffer write(buffer, '(I0)') i s = trim(buffer) end function end module program run_tuples use tuple_test_02_mod call tests() end program lfortran-lfortran-2f73434/integration_tests/lapack_05.f900000664000175000017500000000211015141516316023451 0ustar alastairalastair! MRE: LAPACK-style 2D assumed-size array with leading dimension ! Tests: PointerArray ABI for assumed-size dummy arguments ! Pattern: subroutine with A(LDA, *) passed from caller program lapack_05 implicit none integer, parameter :: LDA = 4, N = 3 real :: A(LDA, N), B(LDA, N) integer :: i, j ! Initialize arrays do j = 1, N do i = 1, LDA A(i,j) = real(i + (j-1)*LDA) B(i,j) = 0.0 end do end do ! Call LAPACK-style subroutine call copy_matrix(LDA, N, A, LDA, B, LDA) ! Verify result do j = 1, N do i = 1, LDA if (abs(B(i,j) - A(i,j)) > 1.0e-6) error stop 1 end do end do print *, "PASS" end program ! LAPACK-style subroutine with assumed-size arrays subroutine copy_matrix(M, N, A, LDA, B, LDB) implicit none integer, intent(in) :: M, N, LDA, LDB real, intent(in) :: A(LDA, *) real, intent(out) :: B(LDB, *) integer :: i, j do j = 1, N do i = 1, M B(i,j) = A(i,j) end do end do end subroutine lfortran-lfortran-2f73434/integration_tests/equivalence_12.f900000664000175000017500000000051715141516316024526 0ustar alastairalastairprogram equivalence_12 ! ICE: segfault when EQUIVALENCE 3D arrays have DATA with mixed values implicit none double precision :: dt19x(2,2,4), dt19xa(2,2,2) equivalence (dt19x(1,1,1), dt19xa(1,1,1)) data dt19xa /1.0d0, 7*0.0d0/ if (abs(dt19x(1,1,1) - 1.0d0) > 1.0d-10) error stop print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/derived_types_57.f900000664000175000017500000000046615141516316025107 0ustar alastairalastairmodule derived_types_57_m type :: ansi_code integer :: m = 44 end type type :: term type(ansi_code) :: black = ansi_code() end type end module program derived_types_57 use derived_types_57_m type(term) :: temp = term() if (temp%black%m /= 44) error stop end program lfortran-lfortran-2f73434/integration_tests/array_bound_2.f900000664000175000017500000000032315141516316024444 0ustar alastairalastairprogram array_bound_2 implicit none integer(8) :: x(4) print *, lbound(x, dim=1), ubound(x, dim=1) if (lbound(x, dim=1) /= 1) error stop if (ubound(x, dim=1) /= 4) error stop end program lfortran-lfortran-2f73434/integration_tests/complex_04.f900000664000175000017500000000030715141516316023672 0ustar alastairalastairprogram complex_04 implicit none complex :: x real :: a, b x = (1.0,-3.0) a = real(x) b = aimag(x) print *, a, b if (abs(a - 1) > 1e-5) error stop if (abs(b - (-3)) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/modules_29_module2.f900000664000175000017500000000207215141516316025332 0ustar alastairalastairmodule fpm_manifest_dependency1 use fpm_git1, only : git_target_t, git_target_branch implicit none type :: toml_table logical :: inline = .false. end type toml_table type :: error_t character(len=:), allocatable :: message end type error_t type :: dependency_config_t character(len=:), allocatable :: name character(len=:), allocatable :: path type(git_target_t), allocatable :: git end type dependency_config_t contains subroutine new_dependency(self) type(dependency_config_t), intent(out) :: self character(len=:), allocatable :: url, obj self%git = git_target_branch(url, obj) end subroutine new_dependency subroutine new_dependencies(deps, table, root, error) type(dependency_config_t), allocatable, intent(out) :: deps(:) type(toml_table), intent(inout) :: table character(*), intent(in), optional :: root type(error_t), allocatable, intent(out) :: error end subroutine new_dependencies end module fpm_manifest_dependency1 lfortran-lfortran-2f73434/integration_tests/openmp_42.f900000664000175000017500000000070415141516316023524 0ustar alastairalastairprogram openmp_42 use omp_lib ! declare variables as required integer :: ny, nx, nz , i,j integer :: iy, ix, iz ny=3 nx=4 nz=5 do j=1,2 do i =1,3 !$omp parallel do collapse(2) private(iy, ix, iz) do iy = 1, ny do ix = 1, nx do iz = 1, nz print *,"iy->", iy,"ix->", ix,"iz->", iz end do end do end do !$omp end parallel do end do end do end programlfortran-lfortran-2f73434/integration_tests/intrinsics_252.f900000664000175000017500000000373615141516316024506 0ustar alastairalastairprogram intrinsics_252 use, intrinsic :: iso_fortran_env, only: dp => real64 real(dp), parameter :: r1 = derf(1.1_dp) real(dp), parameter :: r2 = derf(40.12_dp) real(dp), parameter :: ar1(3) = derf([0.5_dp, -1.5_dp, 2.2_dp]) real(dp), parameter :: ar2(2) = derf([-0.2_dp, 0.0_dp]) real(dp) :: x, y, z real(dp) :: arr1(3), arr2(3), res(3) x = 6.738377383_dp y = 3.1473863781_dp z = 7389.83936383_dp print *, derf(x) if (abs(derf(x) - 1.00000000000000000e+00_dp) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - 9.99991455910536065e-01_dp) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - 1.00000000000000000e+00_dp) > 1e-12) error stop x = -6.738377383_dp y = -3.1473863781_dp z = -7389.83936383_dp print *, derf(x) if (abs(derf(x) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, derf(y) if (abs(derf(y) - (-9.99991455910536065e-01_dp)) > 1e-12) error stop print *, derf(z) if (abs(derf(z) - (-1.00000000000000000e+00_dp)) > 1e-12) error stop print *, r1 if (abs(r1 - 8.80205069574081733e-01_dp) > 1e-12_dp) error stop print *, r2 if (abs(r2 - 1.00000000000000000e+00_dp) > 1e-12_dp) error stop print *, ar1 if (any(abs(ar1 - [5.20499877813046519e-01_dp, -9.66105146475310761e-01_dp, & 9.98137153702018165e-01_dp]) > 1e-12_dp)) error stop print *, ar2 if (any(abs(ar2 - [-2.22702589210478474e-01_dp, 0.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr1 = [-6.738377383_dp, -3.1473863781_dp, -7389.83936383_dp] print *, derf(arr1) if (any(abs(derf(arr1) - [-1.00000000000000000e+00_dp, -9.99991455910536065e-01_dp, & -1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop arr2 = [6.738377383_dp, 3.1473863781_dp, 7389.83936383_dp] res = derf(arr2) print *, res if (any(abs(res - [1.00000000000000000e+00_dp, 9.99991455910536065e-01_dp, & 1.00000000000000000e+00_dp]) > 1e-12_dp)) error stop end programlfortran-lfortran-2f73434/integration_tests/allocate_37.f900000664000175000017500000000040415141516316024013 0ustar alastairalastairprogram alloc_source implicit none integer, allocatable :: a(:), b(:) allocate(a(4)) a = [1, 2, 3, 4] allocate(b, source=a) if (any(b /= a)) error stop "wrong output: b contents do not match a" print *, "test passed" end program alloc_source lfortran-lfortran-2f73434/integration_tests/subroutines_01.f900000664000175000017500000000102715141516316024602 0ustar alastairalastairprogram subroutines_01 implicit none integer :: i, j i = 1 j = 1 if (j /= 1) error stop call f(i, j) print *, i, j if (i /= 1) error stop if (j /= 2) error stop j = 1 if (j /= 1) error stop call f(3, j) print *, j if (j /= 4) error stop j = 1 if (j /= 1) error stop call f(1+2, j) print *, j if (j /= 4) error stop j = 1 if (j /= 1) error stop call f(i+2, j) print *, j if (j /= 4) error stop contains subroutine f(a, b) integer, intent(in) :: a integer, intent(out) :: b b = a + 1 end subroutine end program lfortran-lfortran-2f73434/integration_tests/lapack_06.f900000664000175000017500000000104015141516316023453 0ustar alastairalastair! MRE from LAPACK stfsm.f: 0-based assumed-size dummy A(0:*) ! Pattern: sequence association when passing A(m) to X(*) program lapack_06 implicit none real :: A(0:10) A = 1.0 call stfsm(A) print *, "PASS" end program subroutine stfsm(A) implicit none real :: A(0:*) integer :: M M = 5 ! Sequence association: pass element A(M) to assumed-size dummy X(*) call sub(A(M)) end subroutine subroutine sub(X) implicit none real :: X(*) if (X(1) /= 1.0) error stop "Wrong value" end subroutine lfortran-lfortran-2f73434/integration_tests/do_concurrent_01.f900000664000175000017500000000027515141516316025070 0ustar alastairalastairprogram do_concurrent_01 integer :: i, n real :: x(12) n = 12 x = 0.49 do concurrent(i = 1:n) print *, x(i) if (abs(x(i) - 0.49) > 1e-6) error stop end do end program lfortran-lfortran-2f73434/integration_tests/arrays_91.f900000664000175000017500000000300415141516316023527 0ustar alastairalastairmodule arrays_91_mod contains function matprod21(x, y) result(z) implicit none integer, intent(in) :: x(:, :) integer, intent(in) :: y(:) integer, allocatable :: z(:) allocate(z(size(x, 1))) z = matmul(x, y) end function matprod21 function matprod22(x, y) result(z) implicit none integer, intent(in) :: x(:, :) integer, intent(in) :: y(:, :) integer, allocatable :: z(:, :) allocate(z(size(x, 1), size(y, 2))) z = matmul(x, y) end function matprod22 function matprod12(x, y) result(z) implicit none integer, intent(in) :: x(:) integer, intent(in) :: y(:, :) integer, allocatable :: z(:) allocate(z(size(y, 2))) z = matmul(x, y) end function matprod12 end module program arrays_91 use arrays_91_mod implicit none integer :: x_1(2), x_2(2, 3), y_1(3), y_2(3, 4), z_1(2), z_2(2, 4), y_2_(2, 3), z_1_(3) x_2 = reshape([1, 2, 3, 4, 5, 6], [2, 3]) y_1 = [1, 2, 3] z_1 = matprod21(x_2, y_1) print *, "z_1: ", z_1 if (any(z_1 /= [22, 28])) error stop y_2 = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 4]) z_2 = matprod22(x_2, y_2) print *, "z_2: ", z_2 if (any(z_2 /= reshape([22, 28, 49, 64, 76, 100, 103, 136], [2, 4]))) error stop x_1 = [1, 2] y_2_ = reshape([4, 5, 6, 7, 8, 9], [2, 3]) z_1_ = matprod12(x_1, y_2_) print *, "z_1_: ", z_1_ if (any(z_1_ /= [14, 20, 26])) error stop end program lfortran-lfortran-2f73434/integration_tests/lapack_07.f900000664000175000017500000000061715141516316023465 0ustar alastairalastair! MRE from sblat1.f: down_cast assert with EQUIVALENCE + multi-value DATA ! EQUIVALENCE aliases array Y to part of X, then DATA initializes Y ! with multiple values. This triggers LCOMPILERS_ASSERT in down_cast. program lapack_07 real :: x(4), y(2) equivalence (x(1), y(1)) data y/1.0, 2.0/ if (x(1) /= 1.0) error stop if (x(2) /= 2.0) error stop print *, 'PASS' end program lfortran-lfortran-2f73434/integration_tests/automatic_allocation_01.f900000664000175000017500000000012615141516316026412 0ustar alastairalastairprogram main integer,allocatable:: x(:) x = [1,2,3,4] print *,x end program lfortran-lfortran-2f73434/integration_tests/complex_03.f900000664000175000017500000000033215141516316023667 0ustar alastairalastairprogram complex_03 implicit none complex :: x real :: a, b x = (1.0,-3.0) a = x%re b = x%im print *, a, b print *, x%re, x%im if (abs(x%re - 1) > 1e-5) error stop if (abs(x%im - (-3)) > 1e-5) error stop end program lfortran-lfortran-2f73434/integration_tests/min_01.f900000664000175000017500000000370015141516316023003 0ustar alastairalastairprogram min_min real(8) :: real_inp1 real(8) :: real_inp2 real(4) :: real_inp3 real(4) :: real_inp4 real(8) :: real_inp5 real :: real_inp6 integer(4) :: int_inp1 integer(4) :: int_inp2 real(8) :: output_min integer(4) :: output_min0 real(4) :: output_amin0 integer(4) :: output_min1 real(4) :: output_amin1 real(8) :: output_dmin1 real(8) :: output_min_different_kinds real_inp1 = 5.0d0 real_inp2 = 10.0d0 real_inp3 = 5.0 real_inp4 = 10.0 int_inp1 = 5 int_inp2 = 10 real_inp5 = 5.2d0 real_inp6 = 9.0 output_min = min(real_inp1, real_inp2) print*, output_min if (abs(output_min - 5) >= 1e-15) error stop if( kind(output_min) /= 8) error stop "Incorrect kind for min" output_min0 = min0(int_inp1, int_inp2) print*, output_min0 if (output_min0 /= 5) error stop if( kind(output_min0) /= 4) error stop "Incorrect kind for min" output_amin0 = amin0(int_inp1, int_inp2) print*, output_amin0 if (abs(output_amin0 - 5) >= 1e-7) error stop if (kind (output_amin0) /= 4) error stop "Incorrect kind for min" output_min1 = min1(real_inp3, real_inp4) print*, output_min1 if (output_min1 /= 5) error stop if( kind(output_min1) /= 4) error stop "Incorrect kind for min" output_amin1 = amin1(real_inp3, real_inp4) print*, output_amin1 if (abs(output_amin1 - 5) >= 1e-7) error stop if( kind(output_amin1) /= 4) error stop "Incorrect kind for min" output_dmin1 = dmin1(real_inp1, real_inp1) print*, output_dmin1 if (abs(output_dmin1 - 5) >= 1e-15) error stop if( kind(output_dmin1) /= 8) error stop "Incorrect kind for min" output_min_different_kinds = min(real_inp5, real_inp6) print *, output_min_different_kinds if( abs( output_min_different_kinds - 5.2d0) > 1e-16) error stop if ( Kind(output_min_different_kinds) /= 8) error stop "Incorrect kind for min" end program lfortran-lfortran-2f73434/integration_tests/any_02.f900000664000175000017500000000261215141516316023011 0ustar alastairalastairprogram any_02 logical :: l, c(2, 3, 4) logical :: c1(2), c2(3), c3(4) logical :: c4(2, 3), c5(2, 4), c6(3, 4) integer :: a(2, 3, 4), b(2, 3, 4), i, j, k a = 1 b(1, :, :) = 1 b(2, :, :) = 2 c = a == b c6 = any(a == b, 1) print *, "c6", c6 do i = lbound(c6, 1), ubound(c6, 1) do j = lbound(c6, 2), ubound(c6, 2) if (.not. c6(i, j)) error stop end do end do c5 = any(c, 2) print *, "c5", c5 do j = lbound(c5, 2), ubound(c5, 2) if (.not. c5(1, j)) error stop end do do j = lbound(c5, 1), ubound(c5, 1) if (c5(2, j)) error stop end do c4 = any(c, 3) print *, "c4", c4 do j = lbound(c4, 2), ubound(c4, 2) if (.not. c4(1, j)) error stop end do do j = lbound(c4, 1), ubound(c4, 1) if (c4(2, j)) error stop end do c3 = any(any(c, dim=1), 1) print *, "c3", c3 do i = lbound(c3, 1), ubound(c3, 1) if (.not. c3(i)) error stop end do c2 = any(any(c, 1), 2) print *, "c2", c2 do i = lbound(c2, 1), ubound(c2, 1) if (.not. c2(i)) error stop end do c1 = any(any(c, 2), dim=2) print *, "c1", c1 if (.not. c1(1)) error stop if (c1(2)) error stop l = any(c) print *, l if (.not. l) error stop l = any(any(any(c, 2), dim=2), 1) print *, l if (.not. l) error stop end program any_02 lfortran-lfortran-2f73434/integration_tests/arrays_op_6.f900000664000175000017500000000163115141516316024145 0ustar alastairalastairprogram array_op_5 implicit none real :: a(2, 2, 2), b(2, 2, 2), c(2, 2, 2) real :: d(2, 2, 2) integer :: i, j, k do i = 1, 2 do j = 1, 2 do k = 1, 2 a(i, j, k) = i*i + j*j + k*k b(i, j, k) = 2*(i*j + j*k + i*k) c(i, j, k) = 0 end do end do end do d = asquare(a, b, c) call check(d) contains function asquare(a, b, c) result(d) implicit none real :: a(:, :, :), b(:, :, :), c(:, :, :) real :: d(2, 2, 2) d = a + b + c end function asquare subroutine check(c) implicit none real, intent(in) :: c(:, :, :) integer :: i, j, k do i = lbound(c, 1), ubound(c, 1) do j = lbound(c, 2), ubound(c, 2) do k = lbound(c, 3), ubound(c, 3) if(c(i, j, k) /= (i + j + k)**2) error stop end do end do end do end subroutine check end program lfortran-lfortran-2f73434/integration_tests/equivalence_02.f900000664000175000017500000000111415141516316024517 0ustar alastairalastairprogram equivalence_02 use iso_c_binding, only: c_loc, c_f_pointer implicit none integer, pointer :: mcheps(:) integer, pointer :: minmag(:) integer, pointer :: maxmag(:) double precision, target :: dmach(3) call c_f_pointer(c_loc(dmach(1)), mcheps, [4]) call c_f_pointer(c_loc(dmach(2)), minmag, [4]) call c_f_pointer(c_loc(dmach(3)), maxmag, [4]) minmag = 2 mcheps = 1 if(minmag(1) /= 1) error stop if(minmag(2) /= 1) error stop if(minmag(3) /= 2) error stop if(minmag(4) /= 2) error stop if(mcheps(1) /= 1) error stop endlfortran-lfortran-2f73434/integration_tests/read_10.f900000664000175000017500000000062215141516316023133 0ustar alastairalastairprogram read_10 implicit none integer :: vals(3) integer :: i open(10, status='scratch') write(10, *) 10, 20, 30 rewind(10) read(10, *) (vals(i), i=1, 3) close(10) if (vals(1) /= 10) error stop "vals(1) should be 10" if (vals(2) /= 20) error stop "vals(2) should be 20" if (vals(3) /= 30) error stop "vals(3) should be 30" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/template_travel_01b.f900000664000175000017500000000432015141516316025551 0ustar alastairalastairmodule template_travel_01b_m implicit none private public :: travel_tmpl, test_template requirement operation(A, B, C, op) type, deferred :: A type, deferred :: B type, deferred :: C pure function op(l, r) result(res) type(A), intent(in) :: l type(B), intent(in) :: r type(C) :: res end function end requirement template travel_tmpl(D, T, S, plus_D, plus_T, D_divided_by_T, D_divided_by_S) require :: operation(D, D, D, plus_D) require :: operation(T, T, T, plus_T) require :: operation(D, T, S, D_divided_by_T) require :: operation(D, S, T, D_divided_by_S) private public :: avg_S_from_T, avg_S_from_S contains pure function avg_S_from_T(d1, t1, d2, t2) result(avg) type(D), intent(in) :: d1, d2 type(T), intent(in) :: t1, t2 type(S) :: avg avg = D_divided_by_T(plus_D(d1, d2), plus_T(t1, t2)) end function pure function avg_S_from_S(d1, s1, d2, s2) result(avg) type(D), intent(in) :: d1, d2 type(S), intent(in) :: s1, s2 type(S) :: avg avg = avg_S_from_T(d1, D_divided_by_S(d1, s1), d2, D_divided_by_S(d2, s2)) end function end template contains subroutine test_template() instantiate travel_tmpl(real, real, real, operator(+), operator(+), operator(/), operator(/)), & only: avg_real_S_from_T => avg_S_from_T, avg_real_S_from_S => avg_S_from_S instantiate travel_tmpl(integer, integer, integer, operator(+), operator(+), operator(/), operator(/)), & only: avg_integer_S_from_T => avg_S_from_T, avg_integer_S_from_S => avg_S_from_S real :: s1, s2 integer :: i1, i2 s1 = avg_real_S_from_T(1.0, 3.0, 1.5, 4.0) s2 = avg_real_S_from_S(1.1, s1, 2.0, s1) i1 = avg_integer_S_from_T(1, 3, 20, 4) i2 = avg_integer_S_from_S(1, i1, 15, i1) print *, "s1=", s1 print *, "s2=", s2 print *, "i1=", i1 print *, "i2=", i2 end subroutine end module program template_travel_01b use template_travel_01b_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/intrinsics_285.f900000664000175000017500000000474215141516316024512 0ustar alastairalastairprogram intrinsics_285 use iso_fortran_env, only: sp => real32, dp => real64 implicit none real(4), parameter :: r1 = real(15) real(4), parameter :: r2 = real(15.12_sp) real(4), parameter :: r3 = real((15.123_sp, -7.0_sp)) real(8), parameter :: r4 = real(-7, 8) real(8), parameter :: r5 = real(-15.123_sp, 8) real(8), parameter :: r6 = real(15.123_sp, 8) real(4), parameter :: ar1(3) = real([1, 7, 13]) real(8), parameter :: ar2(3) = real([1.789_sp, 7.123_sp, 13.123_sp], 8) real(4), parameter :: ar3(3) = real([(1.789_sp, 7.123_sp), (13.123_sp, -7.0_sp), (15.123_sp, 8_sp)]) integer(4) :: i4 = 15 real(4) :: r = 15.123_sp complex(4) :: c4 = (15.123_sp, -7.0_sp) integer(8) :: i8 = -7 real(8) :: r8 = -15.123_sp complex(8) :: c8 = (15.123_sp, 8_sp) integer(4) :: arr1(3) real(8) :: arr2(3) complex(4) :: arr3(3) arr1 = [1, 7, 13] arr2 = [1.789_dp, 7.123_dp, 13.123_dp] arr3 = [(1.789_sp, 7.123_sp), (13.123_sp, -7.0_sp), (15.123_sp, 8_sp)] print*, r1 if (abs(r1 - 15.0_sp) > 1e-6_sp) error stop print*, r2 if (abs(r2 - 15.12_sp) > 1e-6_sp) error stop print*, r3 if (abs(r3 - 15.123_sp) > 1e-6_sp) error stop print*, r4 if (abs(r4 - (-7.0_dp)) > 1e-6_dp) error stop print*, r5 if (abs(r5 - (-15.123_dp)) > 1e-6_dp) error stop print*, r6 if (abs(r6 - 15.123_dp) > 1e-6_dp) error stop print*, ar1 if (any(abs(ar1 - [1.0_sp, 7.0_sp, 13.0_sp]) > 1e-6_sp)) error stop print*, ar2 if (any(abs(ar2 - [1.789_dp, 7.123_dp, 13.123_dp]) > 1e-6_dp)) error stop print*, ar3 if (any(abs(ar3 - [1.78900003_sp, 13.1230001_sp, 15.1230001_sp]) > 1e-6_sp)) error stop print*, real(i4) if (abs(real(i4) - 15.0_sp) > 1e-6_sp) error stop print*, real(r) if (abs(real(r) - 15.123_sp) > 1e-6_sp) error stop print*, real(c4) if (abs(real(c4) - 15.123_sp) > 1e-6_sp) error stop print*, real(i8) if (abs(real(i8) - (-7.0_dp)) > 1e-6_dp) error stop print*, real(r8) if (abs(real(r8) - (-15.123_dp)) > 1e-6_dp) error stop print*, real(c8) if (abs(real(c8) - 15.123_dp) > 1e-6_dp) error stop print*, real(arr1) if (any(abs(real(arr1) - [1.0_sp, 7.0_sp, 13.0_sp]) > 1e-6_sp)) error stop print*, real(arr2) if (any(abs(real(arr2) - [1.789_dp, 7.123_dp, 13.123_dp]) > 1e-6_dp)) error stop print*, real(arr3) if (any(abs(real(arr3) - [1.78900003_sp, 13.1230001_sp, 15.1230001_sp]) > 1e-6_sp)) error stop end programlfortran-lfortran-2f73434/integration_tests/write_07.f900000664000175000017500000000035315141516316023361 0ustar alastairalastairprogram write_07 implicit none integer :: stat = 1 real :: value = 3.14 character(len=20) :: buffer write(buffer, '(F6.2)', iostat=stat) value print *, buffer, stat if (stat /= 0) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_280.f900000664000175000017500000001146415141516316024504 0ustar alastairalastairprogram intrinsics_268 use, intrinsic :: iso_fortran_env, only: dp => real64, sp => real32 integer :: i real(dp) :: arg_x(15) real(sp) :: arg_y(15) real(dp) :: res_x(15) real(sp) :: res_y(15) real(dp) :: expected_res_x(15) real(sp) :: expected_res_y(15) real(dp) :: expected_x(10) real(sp) :: expected_y(10) real(dp) :: a = 0.5178181202_dp real(sp) :: b = -0.072816_sp real(dp) :: c = -0.5178181202_dp real(sp) :: d = 0.072816_sp real(dp), parameter :: res_dp(10) = cosh([-0.62818828_dp, -0.51725372_dp, -0.29257208_dp, & 0.62818828_dp, 0.51725372_dp, 0.29257208_dp, 1.00_dp, 0.829362821_dp, 0.952716192_dp, -0.241626228_dp]) real(sp), parameter :: res_sp(10) = cosh([-0.62818828_sp, -0.51725372_sp, -0.29257208_sp, & 0.62818828_sp, 0.51725372_sp, 0.29257208_sp, 1.00_sp, 0.829362821_sp, 0.952716192_sp, -0.241626228_sp]) expected_x = [1.2038847685286660_dp, 1.1367850899207470_dp, 1.0431053788343854_dp, & 1.2038847685286660_dp, 1.1367850899207470_dp, 1.0431053788343854_dp, 1.5430806348152437_dp, & 1.3640925837349942_dp, 1.4892172380307673_dp, 1.0293339187973498_dp] arg_x = [-0.67922251126_dp, -0.54363892699177885_dp, -0.29691551032790681_dp, & 0.67922251126401767_dp, 0.54363892699177885_dp, 0.29691551032790681_dp, 0.5707963267948966_dp, & 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp, -0.7281628262782_dp, & 0.5707963267948966_dp, 0.07796627122261770_dp, 0.2620530499450677_dp, -0.24404138779115148_dp] arg_y = [-0.679222465_sp, -0.543638885_sp, -0.296915501_sp, & 0.679222465_sp, 0.543638885_sp, 0.296915501_sp, 0.57079637_sp, & 0.077966249_sp, 0.262053013_sp, -0.244041398_sp, -0.7281628262782_sp, & 0.57079637_sp, 0.077966249_sp, 0.262053013_sp, -0.244041398_sp] expected_y = [1.20388472_sp, 1.13678503_sp, 1.04310536_sp, & 1.20388472_sp, 1.13678503_sp, 1.04310536_sp, 1.54308069_sp, & 1.36409259_sp, 1.48921716_sp, 1.02933395_sp] res_x = cosh(arg_x) res_y = cosh(arg_y) expected_res_x = [1.2396773477464105_dp, 1.1514470944182906_dp, 1.0444041956586250_dp, & 1.2396773477493541_dp, 1.1514470944182906_dp, 1.0444041956586250_dp, 1.1673755027897188_dp, & 1.0030409096642332_dp, 1.0345328431712835_dp, 1.0299261823832639_dp, 1.2770334891369264_dp, & 1.1673755027897188_dp, 1.0030409096642332_dp, 1.0345328431712835_dp, 1.0299261823832639_dp] expected_res_y = [1.23967731_sp, 1.15144706_sp, 1.04440415_sp, & 1.23967731_sp, 1.15144706_sp, 1.04440415_sp, 1.16737556_sp, & 1.00304091_sp, 1.03453279_sp, 1.02992618_sp, 1.27703345_sp, & 1.16737556_sp, 1.00304091_sp, 1.03453279_sp, 1.02992618_sp] do i = 1, size(res_dp) print *, res_dp(i) if (abs(res_dp(i) - expected_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_x) print *, res_x(i) if (abs(res_x(i)) - abs(expected_res_x(i)) > 1e-12_dp) error stop end do do i = 1, size(res_sp) print *, res_sp(i) if (abs(res_sp(i) - expected_y(i)) > 1e-5) error stop end do do i = 1, size(res_y) print *, res_y(i) if (abs(res_y(i)) - abs(expected_res_y(i)) > 1e-5) error stop end do print *, cosh(a) if (abs(cosh(a)) - 1.1370904024390038_dp > 1e-12) error stop print *, cosh(0.5178181202_dp) if (abs(cosh(0.5178181202_dp) - 1.1370904024390038_dp) > 1e-12) error stop print *, cosh(b) if (cosh(b) - (1.00265229_sp) > 1e-5) error stop print *, cosh(-0.072816_sp) if (cosh(-0.072816_sp) - (1.00265229_sp) > 1e-5) error stop print *, cosh(c) if (cosh(c) - (1.1370904024390038_dp) > 1e-12) error stop print *, cosh(-0.5178181202_dp) if (cosh(-0.5178181202_dp) - (1.1370904024390038_dp) > 1e-12) error stop print *, cosh(d) if (cosh(d) - (1.00265229_sp) > 1e-5) error stop print *, cosh(0.072816_sp) if (cosh(0.072816_sp) - (1.00265229_sp) > 1e-5) error stop a = -0.271927291_dp b = -0.6382728_sp c = 0.271927291_dp d = 0.6382728_sp print *, cosh(a) if (abs(cosh(a) - (1.0372006123287354_dp)) > 1e-12) error stop print *, cosh(-0.271927291_dp) if (abs(cosh(-0.271927291_dp) - (1.0372006123287354_dp)) > 1e-12) error stop print *, cosh(b) if (cosh(b) - (1.21070600_sp) > 1e-5) error stop print *, cosh(-0.6382728_sp) if (cosh(-0.6382728_sp) - (1.21070600_sp) > 1e-5) error stop print *, cosh(c) if (cosh(c) - (1.0372006123287354_dp) > 1e-12) error stop print *, cosh(0.271927291_dp) if (cosh(0.271927291_dp) - (1.0372006123287354_dp) > 1e-12) error stop print *, cosh(d) if (cosh(d) - (1.21070600_sp) > 1e-5) error stop print *, cosh(0.6382728_sp) if (cosh(0.6382728_sp) - (1.21070600_sp) > 1e-5) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_263.f900000664000175000017500000000336215141516316024503 0ustar alastairalastairprogram intrinsics_263 implicit none integer(4), parameter :: i1 = maxval([1, 2, 3]) real(4), parameter :: i2 = maxval([1.0, 2.0, 3.0]) integer(8), parameter :: i3 = maxval([1, 2, 3], [.true., .true., .true.]) real(8), parameter :: i4 = maxval([1.5_8, 22.9_8, 3.0_8], mask = [.true., .false., .true.]) integer(4), parameter :: i5 = maxval([11, 2, 5], 1, mask = [.true., .false., .true.]) real(4), parameter :: i6 = maxval([1.0, 3.0, 55.9], mask = [.true., .false., .true.], dim = 1) integer(4) :: ar1(4) = [1, 2, 7, 9] real(4) :: ar2(4) = [1.0, 3.1, 7.2, 9.0] logical(4) :: mask(4) = [.true., .false., .true., .true.] integer(4) :: dim = 1 print *, i1 if (i1 /= 3) error stop print *, i2 if (abs(i2 - 3.00000000e+00) > 1e-6) error stop print *, i3 if (i3 /= 3) error stop print *, i4 if (abs(i4 - 3.00000000000000000e+00) > 1e-12) error stop print *, i5 if (i5 /= 11) error stop print *, i6 if (abs(i6 - 5.59000015e+01) > 1e-6) error stop print *, maxval(ar1) if (maxval(ar1) /= 9) error stop print *, maxval(ar2) if (abs(maxval(ar2) - 9.00000000e+00) >1e-6 ) error stop print *, maxval(ar1, mask) if (maxval(ar1, mask) /= 9) error stop print *, maxval(ar2, mask = mask) if (abs(maxval(ar2, mask = mask) - 9.00000000e+00) > 1e-6) error stop print *, maxval(ar1, dim) if (maxval(ar1, dim) /= 9) error stop print *, maxval(ar2, dim = dim) if (abs(maxval(ar2, dim = dim) - 9.00000000e+00) > 1e-6) error stop print *, maxval(ar1, mask = mask, dim = dim) if (maxval(ar1, mask = mask, dim = dim) /= 9) error stop print *, maxval(ar2, dim, mask) if (abs(maxval(ar2, dim, mask) - 9.00000000e+00) > 1e-6) error stop end programlfortran-lfortran-2f73434/integration_tests/class_55.f900000664000175000017500000000141315141516316023335 0ustar alastairalastairprogram class_55 type coor integer :: x integer :: y end type class(*), allocatable :: c type(coor), allocatable :: i i = coor(11, 22) allocate(c, source = i) select type (c) type is (integer) error stop type is (real) error stop type is (coor) if (c%x /= 11) error stop print *, c class default error stop end select deallocate(c) allocate(c, source = 4) select type (c) type is (integer) if (c /= 4) error stop print *, c type is (real) error stop type is (coor) error stop class default error stop end select end program lfortran-lfortran-2f73434/integration_tests/dict_test_13_.f900000664000175000017500000000336115141516316024347 0ustar alastairalastairmodule dict_test_13_mod implicit none type(_lfortran_dict(character(len=:), integer(4))) :: I4C contains subroutine init_I4C() I4C = _lfortran_dict_constant( & "0", 0, "1", 1, "2", 2, "3", 3, & "4", 4, "5", 5, "6", 6, "7", 7, & "8", 8, "9", 9, & "a", 10, "b", 11, "c", 12, "d", 13, & "A", 10, "B", 11, "C", 12, "D", 13, & "e", 14, "f", 15, & "E", 14, "F", 15) end subroutine function cnvi(s, base) result(result) character(len=*), intent(in) :: s integer(4), intent(in) :: base integer(4) :: result integer :: i, len_s character(len=1) :: c integer(4) :: pow_, incr if (base /= 10 .and. base /= 8 .and. base /= 16 .and. base /= 2) error stop call init_I4C() len_s = len(s) result = 0 pow_ = base ** (len_s - 1) do i = 1, len_s c = s(i:i) incr = pow_ * _lfortran_get_item(I4C, c) result = result + incr pow_ = pow_ / base end do end function subroutine test_dict() integer(4) :: result result = cnvi("0b0", 2) print *, result if (result /= 22) error stop result = cnvi("0b1", 2) print *, result if (result /= 23) error stop result = cnvi("0b10", 2) print *, result if (result /= 46) error stop result = cnvi("0b11", 2) print *, result if (result /= 47) error stop result = cnvi("0b11110100111", 2) print *, result if (result /= 24487) error stop result = cnvi("0b7a7", 16) print *, result if (result /= 47015) error stop end subroutine end module program test_dict_13 use dict_test_13_mod implicit none call test_dict() end program lfortran-lfortran-2f73434/integration_tests/format_01.f900000664000175000017500000000640215141516316023512 0ustar alastairalastairprogram format_01 implicit none 1 format(/,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) integer :: x 2 format(/ ,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 3 format( /,'BDF2 step ',i6,': T=',es12.5,', H=',es12.5,', ETAH=',es12.5) 4 format(2x,'Preconditioner update FAILED at T=',es12.5,', ETAH=',es12.5) 5 format(/) 6 format(/ ) 7 format( /) 8 format(i6, /) 9 format(i6,/) 10 format(/ , /) 121 FORMAT( /, 80A, / ) integer :: y 122 FORMAT( /, 80A, /) 123 FORMAT(/, 80A, /) 124 FORMAT(/, 80A, / ) 130 FORMAT( 10X, & 'keyword Input Echo - Values from input or default', / ,& 80A, / ) 131 FORMAT( 10X, & 'keyword Input Echo - Values from input or default', / ,& 80A, /) 158 FORMAT( 4X, 'epsi = ', ES11.4, /, 4X, 'iitm = ', I3, /, & 4X, 'oitm = ', I4, /, 4X, 'timedep = ', I1, /, & 4X, 'swp_typ = ', I1, /, 4X, 'multiswp = ', I1, /, & 4X, 'angcpy = ', I1, /, 4X, 'it_det = ', I1, /, & 4X, 'soloutp = ', I1, /, 4X, 'kplane = ', I4, /, & 4X, 'popout = ', I1, /, 4X, 'fluxp = ', I1, /, & 4X, 'fixup = ', I1, / ) 161 FORMAT( 'slgg(nmat,nmom,ng,ng) echo', /, 'Column-order loops:',& ' Mats (fastest ), Moments, Groups, Groups (slowest)' ) 162 FORMAT( 2X, ES15.8, 2X, ES15.8, 2X, ES15.8, 2X, ES15.8 ) 221 FORMAT( 4X, 'Group ', I3, 4X, ' Inner ', I5, 4X, ' Dfmxi ', & ES11.4, ' Fixup x/y/z/t ', 4(ES9.2,1x) ) 306 FORMAT( 2X, I4, 6(1X, ES11.4) ) 324 FORMAT( 4(2X, ES17.10) ) 422 FORMAT( /, 4X, 'Manufactured/Computed Solutions Max Diff=', & ES13.6 ) 500 format( "IARRAY =", *( I0, :, ",")) 501 format(*( I0, :, ",")) 510 FORMAT (1X, F10.3, I5, F10.3, I5/F10.3, I5, F10.3, I5) 511 FORMAT (3/,I5) 512 format(3/) 513 FORMAT (1x, A, 3/ 1x, 2(I10,F10.2) // 1x, 2E15.7) 520 FORMAT (1X, I1, 1X, 'ISN''T', 1X, I1) 530 FORMAT (1PE12.4, I10) 540 FORMAT (I12, /, ' Dates: ', 2 (2I3, I5)) 550 FORMAT (ES12.3, ES12.3E3, G3.4, G3.4E100) 600 format(//,63x,'Internal',/, & 1x,'Cell',3(5x,'Temp '), 7x,'P',8x,'Density',6x,'Energy', & /,2x,'Num',6x,'(K)',7x,'(C)',7x,'(F)',6x,'(Pa)',6x, & '(kg/m**3)',5x,'(J/kg)' ) 610 format(71('-'),/,(1x,i4,0p,3f10.1,1p,3e12.3)) 620 format((1x,i4,0p,3(2x,'|',2x,f5.1),1p, 3(1x,'|',1x,e9.3))) 630 format( //,' Format Number ',i4) 631 format(//,' Format Number ',i4) 640 format("Table form of A"/(2F8.2)) 650 FORMAT( 5X, 'ng= ', I4, / & 5X, 'mat_opt= ', I2, / & 5X, 'src_opt= ', I2, / & 5X, 'scatp= ', I2 ) 660 format(' Format Number ',0PF17.8,' Ry' ) 670 format(/'xx') 680 format(/"xx") 690 format(/ "xx") 700 format(/ 'xx') 710 format(/ i5, 'x') 720 format(// i5, 'x') 730 format(//) integer :: z x = 5 740 FORMAT(/1X'(',I2,')', X, A) end program lfortran-lfortran-2f73434/integration_tests/implicit_interface_18.f900000664000175000017500000000167315141516316026071 0ustar alastairalastairprogram optional_example implicit none real(8) :: result call power_function(3.0_8, result) if (result /= 9.0_8) error stop call power_function(3.0_8, result, 3) if (result /= 27.0_8) error stop call interface_trouble(5) contains subroutine power_function(base, res, exponent) implicit none real(8), intent(in) :: base integer, intent(in), optional :: exponent real(8), intent(out) :: res integer :: exp_value if (present(exponent)) then exp_value = exponent else exp_value = 2 end if res = base ** exp_value end subroutine power_function recursive subroutine interface_trouble(n,t) implicit none integer, intent(in) :: n real(8), intent(out), optional :: t if(n <= 0) return call interface_trouble(n-1, t) end subroutine interface_trouble end program optional_example lfortran-lfortran-2f73434/integration_tests/select_type_05.f900000664000175000017500000000407515141516316024552 0ustar alastairalastairprogram select_type_05 implicit none type point real :: x, y end type point type line type(point) :: start type(point) :: end end type line ! TODO: test with point_arr(10) type(point) :: point_arr type(line) :: line_arr integer :: case_int, case_real, case_default, case_point, case_line integer :: intarr(10) real(8) :: realarr(10) complex :: complexarr(10) call get_sum(intarr, case_int) call get_sum(realarr, case_real) call get_sum(complexarr, case_default) call get_sum_polymorphic(point_arr, case_point) call get_sum_polymorphic(line_arr, case_line) print *, case_int, case_real, case_default, case_point, case_line if (case_int /= 0) error stop if (case_real /= 1) error stop if (case_default /= 2) error stop if (case_point /= 3) error stop if (case_line /= 4) error stop contains subroutine get_sum(generic, selected_case) class(*) :: generic(:) integer, intent(out) :: selected_case integer :: i, isum real :: rsum ! TODO: Add case type is (point) select type(generic) type is (integer) isum = 0 do i = 1, 10 isum = isum + generic(i) end do print *, isum selected_case = 0 type is (real(8)) rsum = 0.0 do i = 1, 10 rsum = rsum + generic(i) end do print *, rsum selected_case = 1 class default print *, '*get_sum* crud -- procedure does not know about this type' selected_case = 2 end select end subroutine get_sum subroutine get_sum_polymorphic(generic, selected_case) class(*) :: generic integer, intent(out) :: selected_case select type(generic) type is (point) print *, "point" selected_case = 3 type is (line) print *, "line" selected_case = 4 class default print *, '*get_sum_polymorphic* crud -- procedure does not know about this type' selected_case = 2 end select end subroutine get_sum_polymorphic end program select_type_05 lfortran-lfortran-2f73434/integration_tests/class_03.f900000664000175000017500000000145215141516316023331 0ustar alastairalastairmodule hr implicit none type, public :: person character(len=20) :: first, last integer :: birthyear character(len=1) :: sgender end type person type, public :: employee type(person) :: person integer :: hire_date character(len=20) :: department end type employee end module hr program hr_code use hr, only: person, employee implicit none type(person) :: jack type(employee) :: jill jack = person( "Jack", "Smith", 1984, "M" ) jill = employee( person( "Jill", "Smith", 1984, "F" ), 2003, "sales" ) print *, jack%first, jack%last, jack%birthyear, jack%sgender print *, jill%person%first, jill%person%last, jill%person%birthyear, jill%person%sgender, jill%department, jill%hire_date end program hr_code lfortran-lfortran-2f73434/integration_tests/expr_16.f900000664000175000017500000000025115141516316023202 0ustar alastairalastairprogram parconst implicit none integer a parameter (a = 8) integer (a) b b = 10_8 print *, b if (b /= 10_8) error stop end program parconst lfortran-lfortran-2f73434/integration_tests/file_05_data.dat0000664000175000017500000000003015141516316024277 0ustar alastairalastairlfortran-lfortran-2f73434/integration_tests/openmp_54.f900000664000175000017500000000165715141516316023537 0ustar alastairalastairprogram openmp_54 use omp_lib implicit none integer, parameter :: N = 1000 integer :: i, tid integer :: total_sum integer :: partial_sum !$omp parallel shared(total_sum) private(i, partial_sum, tid) tid = omp_get_thread_num() partial_sum = 0 total_sum = 0 !$omp barrier !$omp do do i = 1, N partial_sum = partial_sum + i end do !$omp end do ! Critical update to the shared total_sum !$omp critical total_sum = total_sum + partial_sum print *, "Thread ", tid, " added partial_sum ", partial_sum !$omp end critical !$omp barrier !$omp single if (total_sum /= N*(N+1)/2) then print *, "ERROR: total_sum = ", total_sum, " expected = ", N*(N+1)/2 error stop else print *, "Success! total_sum = ", total_sum end if !$omp end single !$omp end parallel end program openmp_54lfortran-lfortran-2f73434/integration_tests/procedure_23.f900000664000175000017500000000271515141516316024221 0ustar alastairalastairmodule procedure_23_mod implicit none type :: dependency_config_t integer :: id = -1 end type dependency_config_t type, extends(dependency_config_t) :: dependency_node_t character(:), allocatable :: name end type dependency_node_t type :: dependency_tree_t integer :: key contains procedure :: add_dependency procedure :: add_dependency_node generic :: add => add_dependency, add_dependency_node end type dependency_tree_t contains subroutine add_dependency(this, cfg) class(dependency_tree_t), intent(inout) :: this type(dependency_config_t), intent(inout) :: cfg cfg%id = 101 this%key = 2 end subroutine add_dependency subroutine add_dependency_node(this, node) class(dependency_tree_t), intent(inout) :: this type(dependency_node_t), intent(inout) :: node node%id = 202 this%key = 3 node%name = "LFortran" end subroutine add_dependency_node end module procedure_23_mod program procedure_23 use procedure_23_mod implicit none type(dependency_tree_t) :: tree type(dependency_config_t) :: cfg type(dependency_node_t) :: node call tree%add(cfg) if (cfg%id /= 101) error stop if (tree%key /= 2) error stop call tree%add(node) if (node%id /= 202) error stop if (node%name /= "LFortran") error stop if (tree%key /= 3) error stop end program procedure_23 lfortran-lfortran-2f73434/integration_tests/modules_28.f900000664000175000017500000000015715141516316023704 0ustar alastairalastairprogram modules_28 use fpm_manifest_dependency implicit none print *, "running modules_28 program" end program lfortran-lfortran-2f73434/integration_tests/derived_types_06.f900000664000175000017500000000027315141516316025075 0ustar alastairalastairmodule abstract_type implicit none contains subroutine subrout(a) class(*), intent(out) :: a end subroutine end module program derived_types_01 end programlfortran-lfortran-2f73434/integration_tests/functions_04.f900000664000175000017500000000114715141516316024236 0ustar alastairalastairmodule stdlib_int implicit none interface to_negative module procedure :: to_negative end interface to_negative contains pure function to_negative(int) result(neg_int) integer, intent(in) :: int integer :: neg_int if (int >= 0) then neg_int = -int else neg_int = int end if end function to_negative end module stdlib_int program functions_04 use stdlib_int implicit none integer :: int = 4 if (to_negative(int) /= -4) error stop int = -4 if (to_negative(int) /= -4) error stop end program lfortran-lfortran-2f73434/integration_tests/abort_01.f900000664000175000017500000000010715141516316023325 0ustar alastairalastairprogram abort1 implicit none if (.false.) call abort() end program lfortran-lfortran-2f73434/integration_tests/template_lapack_01.f900000664000175000017500000000761315141516316025355 0ustar alastairalastairmodule template_lapack_01_m implicit none private public :: test_template requirement gemm_r(T, gemm) type, deferred :: T subroutine gemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc type(T), intent(in) :: alpha, a(lda, *), b(ldb, *), beta type(T), intent(out) :: c(ldc, *) end subroutine end requirement requirement cast_r(T, U, cast) type, deferred :: T type, deferred :: U pure elemental function cast(arg) result(res) type(T), intent(in) :: arg type(U) :: res end function end requirement template external_matmul_t(T, gemm, cast_to_T) require :: gemm_r(T, gemm) require :: cast_r(real, T, cast_to_T) private contains function nonsimple_external_matmul(a,b) result(c) type(T), intent(in) :: a(:,:), b(:,:) type(T) :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call gemm('n', 'n', m, n, k, cast_to_T(1.0), a, m, b, k, cast_to_T(0.0), c, m) end function end template contains subroutine my_gemm_real(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc real, intent(in) :: alpha, a(lda, *), b(ldb, *), beta real, intent(out) :: c(ldc, *) end subroutine subroutine my_gemm_double(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) integer, parameter :: dp = kind(1.d0) character, intent(in) :: transa, transb integer, intent(in) :: m, n, k, lda, ldb, ldc real(dp), intent(in) :: alpha, a(lda, *), b(ldb, *), beta real(dp), intent(out) :: c(ldc, *) end subroutine pure elemental function my_cast_to_real(a) result(b) real, intent(in) :: a real :: b b = a end function pure elemental function my_cast_to_double(a) result(b) integer, parameter :: dp = kind(1.d0) real, intent(in) :: a real(dp) :: b b = a end function function my_external_matmul(a, b) result(c) real, intent(in) :: a(:,:), b(:,:) real :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call my_gemm_real('n', 'n', m, n, k, my_cast_to_real(1.0), a, m, b, k, my_cast_to_real(0.0), c, m) end function function simple_external_matmul {T, gemm, cast_to_T} (a, b) result(c) require :: gemm_r(T, gemm) require :: cast_r(real, T, cast_to_T) type(T), intent(in) :: a(:,:), b(:,:) type(T) :: c(size(a,1), size(b,2)) integer :: m, n, k m = size(a, dim=1) n = size(b, dim=2) k = size(a, dim=1) call gemm('n', 'n', m, n, k, cast_to_T(1.0), a, m, b, k, cast_to_T(0.0), c, m) end function subroutine test_template() integer, parameter :: dp = kind(1.d0) instantiate external_matmul_t(real, my_gemm_real, my_cast_to_real), & only: nonsimple_external_matmul_real => nonsimple_external_matmul instantiate external_matmul_t(real(dp), my_gemm_double, my_cast_to_double), & only: nonsimple_external_matmul_double => nonsimple_external_matmul real :: asp(2,2), bsp(2,2), csp(2,2) real(dp) :: adp(2,2), bdp(2,2), cdp(2,2) csp = simple_external_matmul {real, my_gemm_real, my_cast_to_real} (asp, bsp) cdp = simple_external_matmul {real(dp), my_gemm_double, my_cast_to_double} (adp, bdp) end subroutine end module program template_lapack_01 use template_lapack_01_m implicit none call test_template() end programlfortran-lfortran-2f73434/integration_tests/file_02.f900000664000175000017500000000072015141516316023137 0ustar alastairalastairprogram file_02 implicit none integer :: iostat, unit=10, i open(UNIT=unit, file="file_01_data.txt") ! TODO: return iostat value read(UNIT, *, iostat=iostat) i if (is_iostat_end(iostat)) then print *, "End of file reached." stop else if (is_iostat_eor(iostat)) then print *, "End of record reached." stop end if print *, i if (i /= 10130) error stop close(UNIT=unit) end program file_02 lfortran-lfortran-2f73434/integration_tests/functions_51.f900000664000175000017500000000100215141516316024226 0ustar alastairalastairmodule functions_51_mod implicit none contains integer pure function multiply_2(inp) result(r) integer, intent(in) :: inp r = inp * 2 end function multiply_2 end module functions_51_mod program functions_51 use functions_51_mod implicit none integer :: n(5) character(:), allocatable :: x n(3) = 5 x = sayHi() if (x /= "Hello") error stop print *, x contains character(multiply_2(5)) function sayHi() result(res) res = "Hello" end function sayHi end program functions_51 lfortran-lfortran-2f73434/integration_tests/file_23_data.txt0000664000175000017500000000002415141516316024351 0ustar alastairalastairHelloWorld! LFortranlfortran-lfortran-2f73434/integration_tests/class_74.f900000664000175000017500000000176315141516316023346 0ustar alastairalastairmodule class_74_mod implicit none type :: toml_table integer :: count = 0 contains procedure :: push_back end type toml_table type :: toml_parser type(toml_table), pointer :: table type(toml_table), allocatable :: table2 end type toml_parser contains subroutine push_back(self) class(toml_table), intent(inout) :: self self%count = self%count + 1 end subroutine push_back end module class_74_mod program class_74 use class_74_mod implicit none type(toml_table), target :: tab class(toml_parser), allocatable :: parser allocate(parser) parser%table => tab parser%table2 = tab call add_table(parser%table) call add_table(parser%table2) print *, parser%table%count print *, parser%table2%count if (parser%table%count /= 1) error stop if (parser%table2%count /= 1) error stop contains subroutine add_table(table) class(toml_table), intent(inout) :: table call table%push_back() end subroutine add_table end program class_74 lfortran-lfortran-2f73434/integration_tests/implied_do_loops4.f900000664000175000017500000000030615141516316025324 0ustar alastairalastairprogram implied_do_loops4 integer :: i, j real :: x(5) j = 12 x = (/ (real(i),i=1,5) /) print *, (i,i=1,3), (i,i=4,6), j write (*,*) (i,i=1,3), (i,i=4,6), j print *, (x(i) + 1.0, i=1,5) end program lfortran-lfortran-2f73434/integration_tests/allocate_10.f900000664000175000017500000000114015141516316024000 0ustar alastairalastairmodule A_allocate_10 implicit none contains subroutine f(argument, is_allocated) character(len=:), allocatable, intent(inout) :: argument logical, intent(out) :: is_allocated call g() is_allocated = allocated(argument) contains subroutine g() allocate(character(len=10) :: argument) end subroutine end subroutine end module program allocate_10 use A_allocate_10 implicit none character(len=:), allocatable :: allocA logical :: is_allocated_allocA is_allocated_allocA = .false. call f(allocA, is_allocated_allocA) print *, is_allocated_allocA if( .not. is_allocated_allocA ) error stop end program lfortran-lfortran-2f73434/integration_tests/allocate_34.f900000664000175000017500000000113715141516316024014 0ustar alastairalastairprogram allocate_34 implicit none type :: t1 integer, allocatable :: arr(:) end type t1 type :: t2 type(t1), allocatable :: arr(:) end type t2 type :: t3 type(t2), allocatable :: z(:) end type t3 type(t3) :: obj if (.not. allocated(obj%z)) then allocate(obj%z(2)) end if if (.not. allocated(obj%z(1)%arr)) then allocate(obj%z(1)%arr(3)) end if if (.not. allocated(obj%z(1)%arr(1)%arr)) then allocate(obj%z(1)%arr(1)%arr(5)) end if if (size(obj%z(1)%arr(1)%arr) /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/class_99.f900000664000175000017500000000137115141516316023350 0ustar alastairalastair! Test for https://github.com/lfortran/lfortran/issues/6787 ! Abstract type-bound operator was rejected by semantic analysis ! Error was: "add doesn't exist inside abstype type" module class_99_abstracted type, abstract :: abstype contains private procedure(addop), deferred :: add generic, public :: operator(+) => add end type abstype abstract interface function addop(a,b) result (r) import :: abstype class(abstype), intent(in) :: a, b class(abstype), allocatable :: r end function addop end interface end module class_99_abstracted module class_99_test use class_99_abstracted end module class_99_test program class_99 use class_99_test print *, "PASS" end program class_99 lfortran-lfortran-2f73434/integration_tests/any_01.f900000664000175000017500000000106015141516316023004 0ustar alastairalastairprogram any_01 logical :: c1(2), c2(3) integer :: a(2, 3), b(2, 3) ! TODO: Deal with passing array constants to intrinsics ! logical :: l ! l = any((/.true., .true., .true./)) ! print *, l a = 1 b = 1 b(2, 2) = 2 call section(a, b, 1, c1) print *, c1 call section(a, b, 2, c2) print *, c2 contains subroutine section(a, b, axis, c) integer, intent(in) :: a(2, 3), b(2, 3), axis logical, intent(out) :: c(:) c = any(a == b, axis) end subroutine section end program any_01 lfortran-lfortran-2f73434/integration_tests/allocate_02.f900000664000175000017500000000123215141516316024003 0ustar alastairalastairprogram allocate_01 implicit none integer, allocatable :: a(:), b(:), c(:) integer :: n, ierr, isource n = 10 allocate(a(n), b(n), c(n), stat=ierr, source=isource) a = 1 b = 2 c = 3 print *, whole_square(a, b, c) contains integer function whole_square(a, b, c) result(status) implicit none integer, allocatable :: a(:), b(:), c(:) integer, allocatable :: a_2(:), b_2(:), c_2(:) integer, allocatable :: ab(:), bc(:), ca(:), abc(:) integer :: n n = size(a) allocate(a_2(n), b_2(n), c_2(n)) allocate(ab(n), bc(n), ca(n), abc(n)) status = 0 a_2 = a*a b_2 = b*b c_2 = c*c ab = 2*a*b bc = 2*b*c ca = 2*c*a abc = 2*a*b*c status = 1 end function whole_square end lfortran-lfortran-2f73434/integration_tests/test_unsigned.f900000664000175000017500000000115715141516316024577 0ustar alastairalastairprogram unsigned_test implicit none ! 4 byte unsigned int type(unsigned) :: x integer(kind=4) :: y integer :: i x = 1 y = 1 do i = 1, 30 x = x * _lfortran_unsigned(2) y = y * 2 if ( x < _lfortran_unsigned(0) ) error stop if ( y < 0 ) error stop end do x = x * _lfortran_unsigned(2) y = y * 2 if ( x < _lfortran_unsigned(0) ) error stop if ( y > 0 ) error stop x = x * _lfortran_unsigned(2) y = y * 2 if ( x /= _lfortran_unsigned(0) ) error stop if ( y /= 0 ) error stop end program unsigned_test lfortran-lfortran-2f73434/integration_tests/do_concurrent_02.f900000664000175000017500000000052415141516316025066 0ustar alastairalastair! equivalent of openmp_01.f90 subroutine omp_func(n) implicit none integer, intent(in) :: n integer :: i do concurrent (i = 1:n) shared(n) print *, "xyz" end do print *, "n = ", n if (n /= 100) error stop end subroutine program do_concurrent_02 integer, parameter :: n = 100 call omp_func(n) print *, "Done for n = ", n end program lfortran-lfortran-2f73434/integration_tests/nbody.f900000664000175000017500000001331715141516316023040 0ustar alastairalastair! The Computer Language Benchmarks Game ! Source: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/nbody-ifc-6.html ! ! contributed by Simon Geard, translated from Mark C. Williams nbody.java ! modified by Brian Taylor ! modified by yuankun shi ! modified by Padraig O Conbhui program nbody implicit none integer, parameter :: dp = kind(1.d0) real(kind=dp), parameter :: tstep = 0.01d0 real(kind=dp), parameter :: PI = 3.141592653589793d0 real(kind=dp), parameter :: SOLAR_MASS = 4 * PI * PI real(kind=dp), parameter :: DAYS_PER_YEAR = 365.24d0 type body real(kind=dp) :: x, y, z, u, vx, vy, vz, vu, mass end type body type(body), parameter :: jupiter = body(& 4.84143144246472090d0, -1.16032004402742839d0, & -1.03622044471123109d-01, 0.d0, 1.66007664274403694d-03 * DAYS_PER_YEAR, & 7.69901118419740425d-03 * DAYS_PER_YEAR, & -6.90460016972063023d-05 * DAYS_PER_YEAR, 0.d0,& 9.54791938424326609d-04 * SOLAR_MASS) type(body), parameter :: saturn = body(& 8.34336671824457987d+00, & 4.12479856412430479d+00, & -4.03523417114321381d-01, 0.d0, & -2.76742510726862411d-03 * DAYS_PER_YEAR, & 4.99852801234917238d-03 * DAYS_PER_YEAR, & 2.30417297573763929d-05 * DAYS_PER_YEAR, 0.d0,& 2.85885980666130812d-04 * SOLAR_MASS) type(body), parameter :: uranus = body(& 1.28943695621391310d+01, & -1.51111514016986312d+01, & -2.23307578892655734d-01, 0.d0,& 2.96460137564761618d-03 * DAYS_PER_YEAR, & 2.37847173959480950d-03 * DAYS_PER_YEAR, & -2.96589568540237556d-05 * DAYS_PER_YEAR, 0.d0,& 4.36624404335156298d-05 * SOLAR_MASS ) type(body), parameter :: neptune = body(& 1.53796971148509165d+01, & -2.59193146099879641d+01, & 1.79258772950371181d-01, 0.d0,& 2.68067772490389322d-03 * DAYS_PER_YEAR, & 1.62824170038242295d-03 * DAYS_PER_YEAR, & -9.51592254519715870d-05 * DAYS_PER_YEAR, 0.d0,& 5.15138902046611451d-05 * SOLAR_MASS) type(body), parameter :: sun = body(0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, & 0.0d0, 0.d0, 0.d0, SOLAR_MASS) integer, parameter :: nb = 5 integer, parameter :: N = (nb-1)*nb/2 real(kind=dp), parameter :: mass(nb) = (/ sun%mass, jupiter%mass, saturn%mass, & uranus%mass, neptune%mass /) integer :: num, i character(len=8) :: argv real(kind=dp) :: e, x(3,nb), v(3,nb) x(:,1) = (/ sun%x, sun%y, sun%z /) x(:,2) = (/ jupiter%x, jupiter%y, jupiter%z /) x(:,3) = (/ saturn%x, saturn%y, saturn%z /) x(:,4) = (/ uranus%x, uranus%y, uranus%z /) x(:,5) = (/ neptune%x, neptune%y, neptune%z /) v(:,1) = (/ sun%vx, sun%vy, sun%vz /) v(:,2) = (/ jupiter%vx, jupiter%vy, jupiter%vz /) v(:,3) = (/ saturn%vx, saturn%vy, saturn%vz /) v(:,4) = (/ uranus%vx, uranus%vy, uranus%vz /) v(:,5) = (/ neptune%vx, neptune%vy, neptune%vz /) ! call getarg(1, argv) ! read (argv,*) num num = 1000 call offsetMomentum(1, v, mass) e = energy(x, v, mass) ! workaround print *, e if (abs(e + 0.16907516382852447) > 1e-8) error stop do i = 1, num call advance(tstep, x, v, mass) end do e = energy(x, v, mass) ! workaround print *, e if (abs(e + 0.16908760523460617) > 1e-8) error stop contains subroutine offsetMomentum(k, v, mass) integer, intent(in) :: k real(kind=dp), dimension(3,nb), intent(inout) :: v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp), dimension(3) :: p integer :: i p = (/ (sum(v(i,:) * mass(:)), i=1,3) /) v(:,k) = -p / SOLAR_MASS end subroutine offsetMomentum pure subroutine advance(tstep, x, v, mass) real(kind=dp), intent(in) :: tstep real(kind=dp), dimension(3, nb), intent(inout) :: x, v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp) :: r(3, N), mag(N) real(kind=dp) :: distance, d2 integer :: i, j, m m = 1 do i = 1, nb do j = i + 1, nb r(:,m) = x(:,i) - x(:,j) m = m + 1 end do end do do m = 1, N d2 = sum(r(:,m)**2) distance = 1/sqrt(real(d2)) distance = distance * (1.5d0 - 0.5d0 * d2 * distance * distance) !distance = distance * (1.5d0 - 0.5d0 * d2 * distance * distance) mag(m) = tstep * distance**3 end do m = 1 do i = 1, nb do j = i + 1, nb v(:,i) = v(:,i) - r(:,m) * mass(j) * mag(m) v(:,j) = v(:,j) + r(:,m) * mass(i) * mag(m) m = m + 1 end do end do x = x + tstep * v end subroutine advance pure function energy(x, v, mass) real(kind=dp) :: energy real(kind=dp), dimension(3,nb), intent(in) :: x, v real(kind=dp), dimension(nb), intent(in) :: mass real(kind=dp) :: distance, tmp real(kind=dp), dimension(3) :: d integer :: i, j energy = 0.0d0 do i = 1, nb energy = energy + 0.5d0 * mass(i) * sum(v(:,i)**2) do j = i + 1, nb d = x(:,i) - x(:,j) tmp = sum(d**2) distance = sqrt(tmp) energy = energy - (mass(i) * mass(j)) / distance end do end do end function energy pure function sum(arr) result(r) real(kind=dp), intent(in) :: arr(:) real(kind=dp) :: r integer :: i r = 0.0 do i = 1, size(arr) r = r + arr(i) end do end function sum end program nbody lfortran-lfortran-2f73434/integration_tests/associate_18.f900000664000175000017500000000015015141516316024177 0ustar alastairalastairprogram associate_18 use associate_18_module_2, only: extract_datetime implicit none end programlfortran-lfortran-2f73434/integration_tests/derived_types_79.f900000664000175000017500000000204515141516316025106 0ustar alastairalastairmodule m_labels_derived_types_79 implicit none type :: toml_label character(:), allocatable :: source end type toml_label type :: toml_diagnostic type(toml_label), allocatable :: label(:) end type toml_diagnostic end module m_labels_derived_types_79 module m_render_derived_types_79 use m_labels_derived_types_79 implicit none contains function render_diagnostic(d) result(out) type(toml_diagnostic), intent(in) :: d character(:), allocatable :: out if (allocated(d%label)) then out = "Diagnostic: " // d%label(1)%source else out = "Empty diagnostic" end if end function render_diagnostic end module m_render_derived_types_79 program derived_types_79 use m_labels_derived_types_79 use m_render_derived_types_79 implicit none type(toml_diagnostic) :: diag type(toml_label) :: lbl(1) lbl(1)%source = "Something went wrong" diag%label = lbl print *, render_diagnostic(diag) end program derived_types_79 lfortran-lfortran-2f73434/integration_tests/bindc_06.f900000664000175000017500000000157415141516316023313 0ustar alastairalastair! this tests module variables with bindC are ! correctly assigned in the C file module bindc_06_mod use iso_c_binding, only: c_ptr implicit none integer, bind(C, name="c_int4") :: f_int4 logical, bind(C, name="c_logical") :: f_logical type(c_ptr), bind(C, name="c_type_c_ptr") :: f_type_c_ptr integer(8), bind(C, name="c_int8") :: f_int8 end module program bindc_06 use bindc_06_mod use iso_c_binding, only: c_f_pointer, c_int implicit none integer(c_int), pointer :: ptr_f_type_c_ptr print *, "f_int4: ", f_int4 if (f_int4 /= 1) error stop print *, "f_int8: ", f_int8 if (f_int8 /= 2) error stop print *, "f_logical: ", f_logical if (f_logical .neqv. .false.) error stop call c_f_pointer(f_type_c_ptr, ptr_f_type_c_ptr) print *, "ptr_f_type_c_ptr: ", ptr_f_type_c_ptr if (ptr_f_type_c_ptr /= 12) error stop end program bindc_06 lfortran-lfortran-2f73434/integration_tests/modules_40.f900000664000175000017500000000204615141516316023675 0ustar alastairalastairmodule modules_40_tomlf_de_tokenizer implicit none integer, parameter :: tfc = 4 type :: toml_key character(kind=tfc, len=:), allocatable :: key end type toml_key type, abstract :: toml_tokenizer contains procedure, private :: parse_select end type toml_tokenizer contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de contains subroutine fill_stack(de, top, stack) class(toml_tokenizer), intent(inout), target :: de integer, intent(out) :: top type(toml_key), allocatable, intent(out) :: stack(:) do if (top >= size(stack)) then call resize(stack) end if end do end subroutine fill_stack subroutine resize(stack, n) type(toml_key), allocatable, intent(inout) :: stack(:) integer, intent(in), optional :: n end subroutine resize end subroutine parse_select end module modules_40_tomlf_de_tokenizer program modules_40 implicit none print *, "executing modules_40" end program modules_40 lfortran-lfortran-2f73434/integration_tests/arrays_99.f900000664000175000017500000000032215141516316023537 0ustar alastairalastair!Test global array of strings module arrays_99_mod character(10) :: arr(2) end module program arrays_99 use arrays_99_mod arr(1) = "aa" print *, arr(1) if(arr(1) /= "aa") error stop end programlfortran-lfortran-2f73434/integration_tests/implied_do_loops2.f900000664000175000017500000000023315141516316025321 0ustar alastairalastairprogram implied_do_loop2 integer :: i, j integer, dimension(3,5) :: array array = reshape([(i,(i+j,j=1,4),i=1,3)], (/3,5/)) print *, array end programlfortran-lfortran-2f73434/integration_tests/print_03.f900000664000175000017500000000034115141516316023354 0ustar alastairalastairprogram main implicit none integer :: x(3), a real :: z(2) x(1) = 1 x(2) = 2 x(3) = 3 a = 10249275 z(1) = 20.420 z(2) = 3204.02 print *, "x is printed:", x, 42, 53, z, a end program lfortran-lfortran-2f73434/integration_tests/openmp_29.f900000664000175000017500000000204015141516316023524 0ustar alastairalastairprogram openmp_29 use omp_lib implicit none integer :: i integer :: seed integer, parameter :: n = 10000 double precision :: x(n) double precision :: max1 double precision :: max2 double precision :: max3 seed = 1325 do i = 1, n seed = mod ( ( 3125 * seed ), 65536 ) x(i) = ( seed - 32768.0 ) / 16384.0 end do max1 = - huge(max1) do i = 1, n if ( max1 < x(i) ) then max1 = x(i) end if end do !$omp parallel shared(x) private(i) reduction(max:max2) !$omp do do i = 1, n max2 = max ( max2, x(i) ) end do !$omp end do !$omp end parallel print *, "Done with parallel loop 1" max3 = - huge(max3) !$omp parallel shared(x) private(i) reduction(max:max3) !$omp do do i = 1, n if ( max3 < x(i) ) then max3 = x(i) end if end do !$omp end do !$omp end parallel print *, 'Done' print *, ' X_MAX should be ', max1 print *, ' Computed X_MAX2 = ', max2 print *, ' Computed X_MAX3 = ', max3 if (abs(max1 - max2) > 1e-8) error stop if (abs(max1 - max3) > 1e-8) error stop if (abs(max2 - max3) > 1e-8) error stop end lfortran-lfortran-2f73434/integration_tests/intrinsics_328.f900000664000175000017500000000143315141516316024502 0ustar alastairalastairmodule intrinsics_238_module implicit none contains subroutine test_diag_int16() integer, parameter :: n = 4 integer :: a(n, n), e(n,n) a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [n, n]) e = diag1(diag(a)) print *, sum(a) if (sum(a) /= 136) error stop contains function diag(A) result(res) integer, intent(in) :: A(:,:) integer :: res(minval(shape(A))) integer :: i do i = 1, minval(shape(A)) res(i) = A(i, i) end do end function diag function diag1(v) result(res) integer, intent(in) :: v(:) integer :: res(size(v),size(v)) integer :: i res = 0 do i = 1, size(v) res(i, i) = v(i) end do end function diag1 end subroutine test_diag_int16 end module program intrinsics_238 use intrinsics_238_module implicit none call test_diag_int16() end program lfortran-lfortran-2f73434/integration_tests/intrinsics_147.f900000664000175000017500000000510515141516316024501 0ustar alastairalastairprogram intrinsics_147 type :: my_type integer :: a end type integer :: m(5) integer :: res, i double precision :: n(5) double precision :: res_d real :: res_r real :: o(5) logical :: b logical :: a(5) real :: vector(7) complex :: p(2) type(my_type), allocatable :: struct_packed(:) type(my_type) :: struct_arr(5) vector = [5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0] m = [1, 0, 0, 2, 99] a = [.false., .false., .false., .false., .true.] print *, pack(m, [.false., .false., .false., .false., .true.], [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, [.false., .false., .false., .false., .true.], [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 154) error stop b = .true. print *, pack(m, b, [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, b, [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 144) error stop print *, pack(m, m /= 0, [ 5, 6, 3, 4, 0, 13, 29 ]) res = sum(pack(m, m /= 0, [ 5, 6, 3, 4, 0, 13, 29 ])) print *, res if (res /= 148) error stop n = [1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0] print*, pack([ 1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0 ], [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ]) res_d = sum(pack([ 1.0D0, 0.0D0, 0.0D0, 2.0D0, 99.0D0 ], [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ])) print *, res_d if (abs(res_d - 154.0D0) > 1e-12) error stop print *, res_d res_d = sum(pack(n, [.false., .false., .false., .false., .true.], & [ 5.0D0, 6.0D0, 3.0D0, 4.0D0, 0.0D0, 13.0D0, 29.0D0 ])) if (abs(res_d - 154.0D0) > 1e-12) error stop print *, pack([ 1.0, 0.0, 0.0, 2.0, 99.0 ], a, & [ 5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0 ]) res_r = sum(pack([ 1.0, 0.0, 0.0, 2.0, 99.0 ], [.false., .false., .false., .false., .true.], & [ 5.0, 6.0, 3.0, 4.0, 0.0, 13.0, 29.0 ])) print *, res_r if (abs(res_r - 154.0) > 1e-8) error stop o = [1.0, 0.0, 0.0, 2.0, 99.0] print *, pack(o, a, vector) res_r = sum(pack(o, a, vector)) print *, res_r if (abs(res_r - 154.0) > 1e-6) error stop p = [(1.0, 2.0), (2.0, 3.0)] res_r = abs(sum(pack(p, .true., [(123.123, 9814.14), (-124151.41, 414.1)]))) print *, res_r if (abs(res_r - 5.83095169) > 1e-8) error stop do i = 1, 5 struct_arr(i)%a = i end do a = [.true., .false., .true., .false., .true.] allocate(struct_packed(count(a))) struct_packed = pack(struct_arr, a) if (size(struct_packed) /= 3) error stop if (struct_packed(1)%a /= 1) error stop if (struct_packed(2)%a /= 3) error stop if (struct_packed(3)%a /= 5) error stop end program lfortran-lfortran-2f73434/integration_tests/intrinsics_201.f900000664000175000017500000000132315141516316024466 0ustar alastairalastairprogram intrinsics_201 real, dimension(3) :: x = [1.0, 2.0, 3.0] logical, dimension(3) :: mask = [.true., .false., .true.] integer, dimension(3) :: y = [1, 2, 3] print *, median_all_1_rsp_sp(x) if (median_all_1_rsp_sp(x)) error stop print *, median_all_mask_1_iint8_dp(y, mask) if (median_all_mask_1_iint8_dp(y, mask)) error stop contains function median_all_1_rsp_sp (x) result(res) use ieee_arithmetic real, intent(in) :: x(:) logical :: res res = any(ieee_is_nan(x)) end function median_all_1_rsp_sp function median_all_mask_1_iint8_dp(x, mask) result(res) integer, intent(in) :: x(:) logical, intent(in) :: mask(:) logical :: res res = any(shape(x) /= shape(mask)) end function median_all_mask_1_iint8_dp end program lfortran-lfortran-2f73434/integration_tests/string_18.f900000664000175000017500000000114615141516316023540 0ustar alastairalastairprogram string_18 implicit none character(len=3) :: x character(len=5) :: y x = "123" y = "123 " ! Compile time if ("123 " < "123") error stop if ("123 " /= "123") error stop if ("123 " > "123") error stop if ("123 " > "123 ") error stop ! Run time if (x /= y) error stop if (.not.(x == y)) error stop if (x > y) error stop if (x < y) error stop y = " 123" if (y /= " 123 ") error stop y = " " if (y /= "") error stop y = " 1" if (y /= " 1") error stop y = "1 " if (y /= "1 ") error stop end program string_18 lfortran-lfortran-2f73434/integration_tests/real_dp_02.f900000664000175000017500000000033415141516316023627 0ustar alastairalastairprogram test implicit none integer, parameter :: RP = kind(0.d0) real(kind=RP), parameter :: PI = 3.141592653589793_RP write(unit=*, fmt=*) PI if (abs(PI - 3.141592653589793_RP) > 1e-6_RP) error stop end program test lfortran-lfortran-2f73434/integration_tests/complex_implicit_cast.f900000664000175000017500000001322715141516316026300 0ustar alastairalastairprogram complex_implicit_cast_test implicit none ! Test variables for different kinds and types complex(4) :: c4_1, c4_2 complex(8) :: c8_1, c8_2 real(4) :: r4_1, r4_2 real(8) :: r8_1, r8_2 integer :: i1, i2 ! Initialize test values c4_1 = (1.5, 2.5) c8_1 = (3.5d0, 4.5d0) r4_1 = 5.5 r8_1 = 6.5d0 i1 = 7 print *, "=== Complex Implicit Casting Tests ===" ! Test 1: Integer to Complex casting print *, "Test 1: Integer to Complex" c4_2 = i1 ! IntegerToComplex c8_2 = i1 ! IntegerToComplex print *, "c4_2 from integer:", c4_2 print *, "c8_2 from integer:", c8_2 if (abs(real(c4_2) - 7.0) > 1e-5) error stop "Integer to complex(4) real part failed" if (abs(aimag(c4_2) - 0.0) > 1e-5) error stop "Integer to complex(4) imag part failed" if (abs(real(c8_2) - 7.0d0) > 1e-10) error stop "Integer to complex(8) real part failed" if (abs(aimag(c8_2) - 0.0d0) > 1e-10) error stop "Integer to complex(8) imag part failed" ! Test 2: Real to Complex casting print *, "Test 2: Real to Complex" c4_2 = r4_1 ! RealToComplex c8_2 = r8_1 ! RealToComplex print *, "c4_2 from real(4):", c4_2 print *, "c8_2 from real(8):", c8_2 if (abs(real(c4_2) - 5.5) > 1e-5) error stop "Real(4) to complex(4) real part failed" if (abs(aimag(c4_2) - 0.0) > 1e-5) error stop "Real(4) to complex(4) imag part failed" if (abs(real(c8_2) - 6.5d0) > 1e-10) error stop "Real(8) to complex(8) real part failed" if (abs(aimag(c8_2) - 0.0d0) > 1e-10) error stop "Real(8) to complex(8) imag part failed" ! Test 3: Complex to Real casting (takes real part) print *, "Test 3: Complex to Real" r4_2 = c4_1 ! ComplexToReal r8_2 = c8_1 ! ComplexToReal print *, "r4_2 from complex(4):", r4_2 print *, "r8_2 from complex(8):", r8_2 if (abs(r4_2 - 1.5) > 1e-5) error stop "Complex(4) to real(4) failed" if (abs(r8_2 - 3.5d0) > 1e-10) error stop "Complex(8) to real(8) failed" ! Test 4: Complex to Integer casting (takes real part) print *, "Test 4: Complex to Integer" i2 = c4_1 ! ComplexToInteger print *, "i2 from complex(4):", i2 if (i2 /= 1) error stop "Complex(4) to integer failed" ! Test 5: Complex kind conversion (ComplexToComplex) print *, "Test 5: Complex kind conversion" c8_2 = c4_1 ! ComplexToComplex (4 to 8) c4_2 = c8_1 ! ComplexToComplex (8 to 4) print *, "c8_2 from complex(4):", c8_2 print *, "c4_2 from complex(8):", c4_2 if (abs(real(c8_2) - 1.5d0) > 1e-10) error stop "Complex(4) to complex(8) real part failed" if (abs(aimag(c8_2) - 2.5d0) > 1e-10) error stop "Complex(4) to complex(8) imag part failed" if (abs(real(c4_2) - 3.5) > 1e-5) error stop "Complex(8) to complex(4) real part failed" if (abs(aimag(c4_2) - 4.5) > 1e-5) error stop "Complex(8) to complex(4) imag part failed" ! Test 6: Cross-kind casting with ComplexRe and ComplexIm print *, "Test 6: ComplexRe/ComplexIm with kind conversion" r8_2 = c4_1%re ! ComplexRe with RealToReal cast (4 to 8) r4_2 = c8_1%re ! ComplexRe with RealToReal cast (8 to 4) print *, "r8_2 from c4_1%re:", r8_2 print *, "r4_2 from c8_1%re:", r4_2 if (abs(r8_2 - 1.5d0) > 1e-10) error stop "ComplexRe real(4) to real(8) failed" if (abs(r4_2 - 3.5) > 1e-5) error stop "ComplexRe real(8) to real(4) failed" r8_2 = c4_1%im ! ComplexIm with RealToReal cast (4 to 8) r4_2 = c8_1%im ! ComplexIm with RealToReal cast (8 to 4) print *, "r8_2 from c4_1%im:", r8_2 print *, "r4_2 from c8_1%im:", r4_2 if (abs(r8_2 - 2.5d0) > 1e-10) error stop "ComplexIm real(4) to real(8) failed" if (abs(r4_2 - 4.5) > 1e-5) error stop "ComplexIm real(8) to real(4) failed" ! Test 7: Complex constructor with mixed types (implicit casting) print *, "Test 7: Complex constructor with mixed types" c4_2 = cmplx(i1, r4_1) ! Integer and real(4) to complex(4) c8_2 = cmplx(r8_1, i1) ! Real(8) and integer to complex(8) print *, "c4_2 from cmplx(int, real4):", c4_2 print *, "c8_2 from cmplx(real8, int):", c8_2 if (abs(real(c4_2) - 7.0) > 1e-5) error stop "cmplx(int, real4) real part failed" if (abs(aimag(c4_2) - 5.5) > 1e-5) error stop "cmplx(int, real4) imag part failed" if (abs(real(c8_2) - 6.5d0) > 1e-10) error stop "cmplx(real8, int) real part failed" if (abs(aimag(c8_2) - 7.0d0) > 1e-10) error stop "cmplx(real8, int) imag part failed" ! Test 8: Array operations with implicit casting print *, "Test 8: Array operations with implicit casting" block complex(4) :: c4_arr(2) = [(1.0, 2.0), (3.0, 4.0)] complex(8) :: c8_arr(2) real(8) :: r8_arr(2) c8_arr = c4_arr ! ComplexToComplex array casting r8_arr = c4_arr%re ! ComplexRe with RealToReal array casting print *, "c8_arr from c4_arr:", c8_arr print *, "r8_arr from c4_arr%re:", r8_arr if (abs(real(c8_arr(1)) - 1.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [1] real failed" if (abs(aimag(c8_arr(1)) - 2.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [1] imag failed" if (abs(real(c8_arr(2)) - 3.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [2] real failed" if (abs(aimag(c8_arr(2)) - 4.0d0) > 1e-10) error stop "Array complex(4) to complex(8) [2] imag failed" if (abs(r8_arr(1) - 1.0d0) > 1e-10) error stop "Array ComplexRe real(4) to real(8) [1] failed" if (abs(r8_arr(2) - 3.0d0) > 1e-10) error stop "Array ComplexRe real(4) to real(8) [2] failed" end block print *, "=== All Complex Implicit Casting Tests Passed! ===" end programlfortran-lfortran-2f73434/integration_tests/select_rank_05.f900000664000175000017500000000133615141516316024521 0ustar alastairalastairprogram select_rank_04 implicit none integer :: a(2) = [4, 2] integer :: b(2, 3) = reshape([1, 2, 3, 4, 5, 6], [2, 3]) call check(a) call check(b) contains subroutine check(x) integer, intent(in) :: x(..) integer :: l1(1) integer :: l2(2) integer :: c(2, 1) integer :: d(3, 2) select rank(x) rank (1) c = reshape(x, [2, 1]) print *, c if (any(c /= reshape([4, 2], [2, 1]))) error stop rank (2) d = reshape(x, [3, 2]) print *, d if (any(d /= reshape([1, 2, 3, 4, 5, 6], [3, 2]))) error stop end select end subroutine check end program select_rank_04lfortran-lfortran-2f73434/integration_tests/array_op_10.f900000664000175000017500000000114715141516316024037 0ustar alastairalastairmodule linalg_mod_array_op_10 contains function solve(x) result(y) real :: y(5), x(5) integer :: P(5) P = [3, 4, 1, 2, 5] ! Example permutation array y(P) = x ! Handle the permutation. end function solve end module linalg_mod_array_op_10 program array_op_10 use linalg_mod_array_op_10 implicit none real :: x(5) x = [1.0, 2.0, 3.0, 4.0, 5.0] ! Example initialization x = solve(x) ! Call the solve function print *, x if ( abs(x(1) - 3.0) > 1e-8 .or. & abs(x(2) - 4.0) > 1e-8 .or. & abs(x(3) - 1.0) > 1e-8 .or. & abs(x(4) - 2.0) > 1e-8 .or. & abs(x(5) - 5.0) > 1e-8 ) error stop end program lfortran-lfortran-2f73434/integration_tests/class_63_module_2.f900000664000175000017500000000060215141516316025121 0ustar alastairalastairmodule class_63_module_2 use class_63_module_1, only: AbsType type :: MyType class(AbsType), allocatable :: arr(:) contains procedure :: method end type MyType contains subroutine method(self) class(MyType), intent(inout) :: self associate ( element => self%arr(size(self%arr)) ) end associate end subroutine method end module lfortran-lfortran-2f73434/integration_tests/complex_13.f900000664000175000017500000000027715141516316023700 0ustar alastairalastairprogram main implicit none complex(8) :: l complex(4) :: z l=cmplx(3,-4) z=l print *,z if (real(z) /= 3) error stop if (aimag(z) /= -4) error stop end program lfortran-lfortran-2f73434/integration_tests/functions_22.f900000664000175000017500000000155415141516316024240 0ustar alastairalastairpure integer function fn1(A) result(r) implicit none real, intent(in) :: A(:,:) r = minval(shape(A)) end function subroutine diag_rsp_mat(A, res) implicit none interface pure integer function fn1(B) implicit none real, intent(in) :: B(:,:) end function end interface real, intent(in) :: A(:,:) real, intent(out) :: res(fn1(A)) print *, shape(res), fn1(A) if (fn1(A) /= 5) error stop end subroutine diag_rsp_mat program functions_22 implicit none real :: A(5, 5) real :: res(5) integer :: result interface subroutine diag_rsp_mat(A, res) implicit none interface pure integer function fn1(C) implicit none real, intent(in) :: C(:,:) end function end interface real, intent(in) :: A(:,:) real, intent(out) :: res(fn1(A)) end subroutine diag_rsp_mat end interface call diag_rsp_mat(A, res) end program lfortran-lfortran-2f73434/integration_tests/print_09.f900000664000175000017500000000042215141516316023362 0ustar alastairalastairprogram print_09 implicit none integer, parameter :: dp = kind(0.d0) print *, 0.14, 123.456, 0.001, 1.5e-5 print *, 0.14_dp, 456.789_dp, 0.0001_dp write(*,*) 0.14, 123.456, 0.001, 1.5e-5 write(*,*) 0.14_dp, 456.789_dp, 0.0001_dp end program print_09 lfortran-lfortran-2f73434/integration_tests/while_04.f900000664000175000017500000000076715141516316023345 0ustar alastairalastair! Check handling while's test expression when a temporary is needed program while_04 integer :: flag = 1 integer :: hit = 0 do while(foo(flag) == "Hello") print *, "hi" flag = -1 hit = hit + 1 end do if(hit /= 1) error stop contains function foo(x) result (str) integer :: x character(:),allocatable :: str if(x == 1) then str = "Hello" else str = "bla-bla" end if end function end program lfortran-lfortran-2f73434/integration_tests/template_simple_03.f900000664000175000017500000000516615141516316025416 0ustar alastairalastairmodule template_simple_03_m implicit none private public :: generic_sum, test_template requirement operator_r(T, U, V, binary_func) type, deferred :: T type, deferred :: U type, deferred :: V pure elemental function binary_func(lhs, rhs) result(res) type(T), intent(in) :: lhs type(U), intent(in) :: rhs type(V) :: res end function end requirement requirement cast_r(T, cast) type, deferred :: T pure elemental function cast(arg) result(res) integer, intent(in) :: arg type(T) :: res end function end requirement contains pure elemental function cast_integer(arg) result(res) integer, intent(in) :: arg integer :: res res = 0 end function pure elemental function cast_real(arg) result(res) integer, intent(in) :: arg real :: res res = 0.0 end function pure elemental function div_integer(lhs, rhs) result(res) integer, intent(in) :: lhs, rhs integer :: res res = lhs / rhs end function pure elemental function div_real(lhs, rhs) result(res) real, intent(in) :: lhs integer, intent(in) :: rhs real :: res res = lhs / rhs end function pure function generic_sum {T, add, cast} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) res = cast(0) if (n > 0) then res = arr(1) do i=2,n res = add(res, arr(i)) end do end if end function pure function generic_avg {T, add, cast, div} (arr) result(res) require :: operator_r(T, T, T, add), cast_r(T, cast) require :: operator_r(T, integer, T, div) type(T), intent(in) :: arr(:) type(T) :: res integer :: n, i n = size(arr) if (n > 0) then res = div(generic_sum{T, add, cast}(arr), n) else res = cast(0) end if end function subroutine test_template() integer :: a_i(10), i, s_i real :: a_r(10), s_r do i = 1, size(a_i) a_i(i) = i a_r(i) = i end do s_i = generic_avg{integer, operator(+), cast_integer, div_integer}(a_i) s_r = generic_avg{real, operator(+), cast_real, div_real}(a_r) print *, s_i end subroutine end module program template_simple_03 use template_simple_03_m implicit none call test_template() endlfortran-lfortran-2f73434/integration_tests/complex_unary_minus_03.f900000664000175000017500000000110115141516316026313 0ustar alastairalastair! Test for complex unary minus in implicit interface call with PARAMETER ! Reproduces ICE from LAPACK clasyf_aa.f subroutine csub(alpha, n, ok) implicit none integer, intent(in) :: n complex, intent(in) :: alpha logical, intent(out) :: ok ok = (real(alpha) == -1.0) .and. (aimag(alpha) == 0.0) end subroutine program complex_unary_minus_03 implicit none complex, parameter :: zero = 0.0e+0, one = 1.0e+0 logical :: ok external :: csub ok = .false. call csub(-one, 1, ok) if (.not. ok) error stop print *, 'PASS' end program lfortran-lfortran-2f73434/integration_tests/select_type_17.f900000664000175000017500000000056215141516316024552 0ustar alastairalastairprogram select_type_17 implicit none call print_any(" Hello World ") contains subroutine print_any(generic) class(*), intent(in) :: generic character(len = 15) :: a select type (generic) type is (character(len=*)) print *, generic end select end subroutine print_any end program select_type_17 lfortran-lfortran-2f73434/integration_tests/intrinsics_73.f900000664000175000017500000000027215141516316024417 0ustar alastairalastairprogram intrinsics_73 real(8) :: y real :: x y = 5.2d0 x = sngl(y) if(abs(x - 5.19999981)>1e-8) error stop ! if(kind(sngl(y)) /= 4) error stop //TODO end programlfortran-lfortran-2f73434/integration_tests/separate_compilation_20.f900000664000175000017500000000032615141516316026424 0ustar alastairalastairprogram separate_compilation_20 use stdlib_error_separate_compilation_20 implicit none integer :: tester = 1 call error_stop(tester) print *, tester if (tester /= 3) error stop end programlfortran-lfortran-2f73434/integration_tests/abs_01.f900000664000175000017500000000022015141516316022757 0ustar alastairalastairprogram abs_01 implicit none real :: x x = abs(1.5) print *, x if (x < 0) error stop x = abs(-1.5) print *, x if (x < 0) error stop end program lfortran-lfortran-2f73434/integration_tests/array_constructor_03.f900000664000175000017500000000117715141516316026013 0ustar alastairalastairmodule array_constructor_03_mod implicit none type :: string_t character(len=:), allocatable :: s end type string_t contains subroutine new(args) type(string_t), intent(in) :: args(:) if (size(args) /= 0) then error stop "ERROR: args is not zero-sized" end if if (lbound(args,1) /= 1) then error stop "ERROR: unexpected lower bound" end if print *, "OK: new() called with zero arguments" end subroutine new end module array_constructor_03_mod program array_constructor_03 use array_constructor_03_mod implicit none call new([string_t::]) end program array_constructor_03 lfortran-lfortran-2f73434/integration_tests/intrinsics_222.f900000664000175000017500000000176015141516316024476 0ustar alastairalastairprogram intrinsics_222 use, intrinsic :: iso_fortran_env, only: dp => real64 complex(8) :: a, b, c, d real(dp) :: expected(4) integer :: i real(dp), parameter :: result(4) = dreal([(1.0_8, 2.0_8), (-3.7280_8, 4.0_8), (-1.0_8, -1.0_8), (10.829_8, -189.0_8)]) expected = [1.0000000000000000_dp, -3.7280000000000000_dp, -1.0000000000000000_dp, 10.8290000000000000_dp] do i = 1, size(expected) print *, result(i) if (abs(result(i) - expected(i)) > 1e-12_dp) error stop end do a = (1.0_8, 2.0_8) b = (-3.7280_8, 4.0_8) c = (-1.0_8, -1.0_8) d = (10.829_8, -189.0_8) print *, dreal(a) if (abs(dreal(a) - 1.0000000000000000_dp) > 1e-12_dp) error stop print *, dreal(b) if (abs(dreal(b) + 3.7280000000000000_dp) > 1e-12_dp) error stop print *, dreal(c) if (abs(dreal(c) + 1.0000000000000000_dp) > 1e-12_dp) error stop print *, dreal(d) if (abs(dreal(d) - 10.8290000000000000_dp) > 1e-12_dp) error stop end programlfortran-lfortran-2f73434/integration_tests/intrinsics_213.f900000664000175000017500000000112515141516316024471 0ustar alastairalastairprogram intrinsics_213 ! Which is faster: exp or log? integer:: n, k = 2 real:: x,dx,y,z,t1,t2 print "(A,I0)",'k = ',k dx = 1e-6 call cpu_time(t1) x = 0 do n = 1,10**k x = x+dx z = exp(-1/x) end do call cpu_time(t2) print "(2(A,F10.3))",'after 10**k exp, abs(t2-t1) = ',abs(t2-t1),' s; z=',z if (abs(z) > 1e-8) error stop x = 1 do n = 1,10**k x = x+dx z = log(x) end do call cpu_time(t1) print "(2(A,F10.3))",'after 10**k log, abs(t2-t1) = ',abs(t2-t1),' s; z=',z if (abs(z - (9.53628842e-05)) > 1e-8) error stop end program intrinsics_213 lfortran-lfortran-2f73434/integration_tests/intrinsics_303.f900000664000175000017500000000016515141516316024474 0ustar alastairalastairprogram intrinsics_303 integer :: a call random_seed(a) print *, a if (a /= 8) error stop end programlfortran-lfortran-2f73434/integration_tests/functions_15.f900000664000175000017500000000237615141516316024245 0ustar alastairalastairmodule functions_15_module_1 implicit none contains subroutine sub_1(a, b, c, d, e, f) integer, intent(inout) :: a real, intent(inout) :: b logical, intent(in) :: c real, intent(in), optional :: d integer, intent(in), optional :: e real, intent(in) :: f if (present(d)) then a = b ** 2 + d if (present(e)) then b = b * f + e else b = b * f end if else a = b ** 2 if (present(e)) then b = b * f + e else b = b * f end if end if end subroutine sub_1 end module program functions_15 use functions_15_module_1, only: sub_1 implicit none integer :: a real :: b a = 1 b = 2 call sub_1(a, b, .true., d=12.0, e=5, f=6.0) call sub_1(a, b, .false., f=6.0) call sub_1(a, b, .true., e=78, f=117.0) call sub_1(a, b, .false., d=58.0, f=123.0) print *, a, b if (a /= 144288208) error stop if (b /= 1477476.00) error stop print *, f(), f(42) ! "f t" contains logical function f(x) integer, intent(in), optional :: x f = present(x) end function end program functions_15 lfortran-lfortran-2f73434/integration_tests/openmp_53.f900000664000175000017500000000053515141516316023530 0ustar alastairalastairprogram openmp_53 use omp_lib implicit none integer :: x integer, parameter:: N = 0 !$omp parallel shared(x) x=N !$omp barrier !$omp critical x = x + 1 !$omp end critical !$omp end parallel print *, "Final x:", x if (x /= omp_get_max_threads()) error stop "x is not equal to number of threads" end program openmp_53lfortran-lfortran-2f73434/integration_tests/transfer_06.f900000664000175000017500000000045015141516316024050 0ustar alastairalastairprogram transfer_06 integer :: i character(1) :: res i = 321 res = transfer(i, res) print *, res if(res /= 'A') error stop ! -------------------------------------------- ! i = 65 res = transfer(i, res) print *, res if(res /= 'A') error stop end programlfortran-lfortran-2f73434/integration_tests/types_10.f900000664000175000017500000000062315141516316023365 0ustar alastairalastairprogram types_10 implicit none integer :: i, j save i save :: j contains subroutine f(i) integer, intent(in) :: i integer, save :: j j = i end subroutine subroutine g(i) integer, intent(in) :: i integer :: j save j j = i end subroutine subroutine h(i) integer, intent(in) :: i integer :: j save j = i end subroutine end program lfortran-lfortran-2f73434/integration_tests/common_24b.f900000664000175000017500000000022015141516316023651 0ustar alastairalastairsubroutine set2() implicit none integer :: info integer :: iunit common /infoc/ info, iunit info = 2 end subroutine set2 lfortran-lfortran-2f73434/integration_tests/test_str.f900000664000175000017500000000261615141516316023574 0ustar alastairalastair! Testing Python's str casting ! -- Example -- ! i = 10 ! s = "Hi" ! s = str(i) # Equivalent in LFortran is `lfortran_str()` program test_str character(30) :: str integer :: i real :: r i = 11 str = "HI"//_lfortran_str(9) // _lfortran_str(i) print *, str, "|" if(trim(str) /= "HI911") error stop ! --------------------------------------------------------------------------- ! r = 2.3 str = trim(str) // "World" //_lfortran_str(r) // "--"// _lfortran_str(22.5) print *, str,"|" if(trim(str) /= "HI911World2.300000--22.500000") error stop ! --------------------------------------------------------------------------- ! call test(_lfortran_str(112233) ,"112233") call test(_lfortran_str(i) ,"11") ! --------------------------------------------------------------------------- ! ! --------------------------------------------------------------------------- ! ! --------------------------------------------------------------------------- ! CONTAINS subroutine test (str_from_cast, test_against_str) character(*) :: str_from_cast character(*) :: test_against_str print *, len(str_from_cast) print *, str_from_cast print *, len(test_against_str) print *, test_against_str if(str_from_cast /= test_against_str) error stop end subroutine end programlfortran-lfortran-2f73434/integration_tests/issue_4901.f900000664000175000017500000000037415141516316023531 0ustar alastairalastairprogram linetest character(80) :: line write(line(1:3), '(I3)') 666 if (line(1:3) /= "666") then write(*, *) "Test Failed: Expected '666', got '", line(1:3), "'" error stop 1 end if write(*, '(A)') line(1:3) end program linetestlfortran-lfortran-2f73434/integration_tests/arrays_reshape_31.f900000664000175000017500000000070415141516316025234 0ustar alastairalastairprogram arrays_reshape_31 implicit none character(len=10) :: arr1d(6) character(len=10) :: arr2d(2, 3) arr1d = ["one ", "two ", "three", "four ", "five ", "six "] arr2d = reshape(arr1d, [2, 3]) if (trim(arr2d(1, 1)) /= "one") error stop "arr2d(1,1) wrong" if (trim(arr2d(2, 1)) /= "two") error stop "arr2d(2,1) wrong" if (trim(arr2d(1, 2)) /= "three") error stop "arr2d(1,2) wrong" print *, "PASS" end program lfortran-lfortran-2f73434/integration_tests/class_50.f900000664000175000017500000000176515141516316023342 0ustar alastairalastairmodule class_50_m_1 private type, public, abstract :: Addition contains procedure(addto), deferred :: addto end type Addition abstract interface subroutine addto(self,a) import class(Addition), intent(in) :: self integer, intent(inout) :: a end subroutine addto end interface end module class_50_m_1 module class_50_m_2 use class_50_m_1, only: Addition private type, public, extends(Addition) :: AdderClass contains procedure :: addto end type AdderClass contains subroutine addto(self,a) class(AdderClass), intent(in) :: self integer, intent(inout) :: a a = a + 3 end subroutine addto end module class_50_m_2 program class_50 use class_50_m_1, only: Addition use class_50_m_2, only: AdderClass integer :: a class(Addition), allocatable :: adder a = 1 adder = AdderClass() call adder%addto(a) if (a /= 4) error stop end program class_50 lfortran-lfortran-2f73434/integration_tests/custom_operator_04.f900000664000175000017500000000105415141516316025450 0ustar alastairalastairmodule custom_operator_04_a implicit none public :: operator(.negation.) integer :: negation = 3 interface operator(.negation.) module procedure negative end interface contains function negative(i) result(res) integer, intent(in) :: i integer :: res res = -i print *, negation end function negative end module custom_operator_04_a program custom_operator_04 use custom_operator_04_a, only: operator(.negation.) implicit none integer :: res res = .negation. 10 print *, res end program custom_operator_04 lfortran-lfortran-2f73434/integration_tests/string_60.f900000664000175000017500000000076215141516316023540 0ustar alastairalastair!Test StringSection program string_60 character(10):: ss ss = "ABCDEFGHIJ" ss = reverse(ss) print *, ss if(ss /= "JIHGFEDCBA") error stop contains function reverse(string) result(reverse_string) character(len=*), intent(in) :: string character(len=len(string)) :: reverse_string integer :: i, n n = len(string) do i = 1, n reverse_string(n-i+1:n-i+1) = string(i:i) end do end function reverse end programlfortran-lfortran-2f73434/integration_tests/format_49.f900000664000175000017500000000220015141516316023516 0ustar alastairalastairprogram format_49 ! Test E format exponent adjustment when mantissa rounds to 0.999... ! Bug: exponent was off by one for extreme values like 1.0d-200 ! when using high precision formats like E25.17 use, intrinsic :: iso_fortran_env, only: dp => real64 implicit none real(dp) :: val character(30) :: output integer :: exp_val, i, exp_start ! 1.0d-200 with E25.17 format: ! Mantissa rounds to 0.99999999999999998 ! So exponent must be -200 (not -199) val = 1.0d-200 write(output, '(E25.17)') val ! Find the exponent sign position (last - or + in the string) exp_start = 0 do i = len_trim(output), 1, -1 if (output(i:i) == '-' .or. output(i:i) == '+') then exp_start = i exit end if end do ! Parse exponent from the sign position read(output(exp_start:), '(I4)') exp_val if (exp_val /= -200) then print *, "FAIL: 1.0d-200 exponent should be -200, got ", exp_val print *, "Output was: ", trim(output) error stop end if print *, "PASS: E format exponent correctly adjusted for 1.0d-200" end program lfortran-lfortran-2f73434/integration_tests/format_51.f900000664000175000017500000000170015141516316023513 0ustar alastairalastairprogram format_51 ! Test binary (B) format descriptor implicit none integer :: i character(50) :: str ! Binary format tests print "(A,B32.32)", 'binary 2: ', 2 print "(A,B8.8)", 'binary 255: ', 255 print "(A,B16.16)", 'binary -1: ', -1 print "(A,B0)", 'binary 42: ', 42 print "(A,B10)", 'binary 7: ', 7 print "(B5.5)", 15 print "(B3.3)", 4 ! Verify with write statements write(str, "(B32.32)") 2 if (trim(adjustl(str)) /= "00000000000000000000000000000010") error stop "B32.32 failed" write(str, "(B8.8)") 255 if (trim(adjustl(str)) /= "11111111") error stop "B8.8 failed" write(str, "(B0)") 42 if (trim(adjustl(str)) /= "101010") error stop "B0 failed" write(str, "(B10)") 7 if (trim(adjustl(str)) /= "111") error stop "B10 failed" write(str, "(B5.5)") 15 if (trim(adjustl(str)) /= "01111") error stop "B5.5 failed" print *, "PASSED" end program format_51 lfortran-lfortran-2f73434/integration_tests/bindc_07.f900000664000175000017500000000465515141516316023317 0ustar alastairalastairprogram bindc_07 use iso_c_binding, only: c_char, c_ptr, c_null_ptr, c_size_t, c_int, c_associated, c_f_pointer implicit none interface function test_getcwd(buf, size) result(res) bind(c, name="getcwd_dummy") import c_char, c_size_t, c_ptr character(kind=c_char,len=1), intent(out) :: buf integer(c_size_t), value, intent(in) :: size type(c_ptr) :: res end function test_getcwd function test_char_array(buf, len) result(res) bind(c, name="test_char_array") import c_char, c_int, c_ptr character(kind=c_char), dimension(*), intent(inout) :: buf integer(c_int), value, intent(in) :: len type(c_ptr) :: res end function test_char_array end interface ! Test variables character(len=1024) :: large_result character(len=1) :: small_result(256) character(len=50) :: medium_result type(c_ptr) :: ptr_result integer :: i type(c_ptr) :: res_ptr print *, "=== ROBUST BIND(C) CHARACTER ARRAY TEST ===" print *, "" ! Test 1: Large character variable print *, "TEST 1: Large character variable" large_result = repeat(' ', len(large_result)) ptr_result = test_getcwd(large_result, int(len(large_result), c_size_t)) if (c_associated(ptr_result)) then print *, "SUCCESS: Large buffer test passed" print *, "Result: '", trim(large_result), "'" else print *, "FAILED: Large buffer test failed" end if print *, "" ! Test 2: Array of single characters print *, "TEST 2: Array of single characters" small_result = ' ' res_ptr = test_char_array(small_result, int(size(small_result), c_int)) if (c_associated(res_ptr)) then print *, "SUCCESS: Small array test passed" write(*,'(A)', advance='no') "Result: '" do i = 1, min(size(small_result), 50) if (small_result(i) == char(0)) exit write(*,'(A)', advance='no') ,small_result(i) end do write(*,'(A)') "'" else print *, "FAILED: Small array test failed" end if ! Test 3: Medium character variable print *, "TEST 3: Medium character variable" medium_result = repeat(' ', len(medium_result)) ptr_result = test_getcwd(medium_result, int(len(medium_result), c_size_t)) if (c_associated(ptr_result)) then print *, "SUCCESS: Medium buffer test passed" print *, "Result: '", trim(medium_result), "'" else print *, "FAILED: Medium buffer test failed" end if print *, "" print *, "=== ALL TESTS COMPLETED ===" end program bindc_07lfortran-lfortran-2f73434/integration_tests/elemental_13.f900000664000175000017500000001206215141516316024172 0ustar alastairalastairprogram elemental_13 implicit none real, dimension(2, 2, 3) :: array_param, expected_ans real :: scalar_param, epsilon = 1.0e-6 real, dimension(2, 2, 3) :: result_2param real, dimension(2, 2, 3) :: result_3param array_param = reshape([ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], shape(array_param)) scalar_param = 1.0 print *, "Testing 2-parameter elemental function:" result_2param = func2(array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Array does not match to expected array" end if result_2param = func2(array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Array, Scalar does not match to expected array" end if result_2param = func2(scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_2param) /= size(expected_ans) .or. .not. all(result_2param == expected_ans) ) then error stop "Scalar, Array does not match to expected array" end if result_2param = func2(scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_2param(1, 1, 1) - expected_ans(1, 1, 1)) > epsilon) then error stop "Scalar, Scalar does not match 2.0" end if print *, "\nTesting 3-parameter elemental function:" result_3param = func3(array_param, array_param, array_param) expected_ans = reshape([2.0, 6.0, 12.0, 20.0, 30.0, 42.0, 56.0, 72.0, 90.0, 110.0, 132.0, 156.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Array does not match to expected array" end if result_3param = func3(array_param, array_param, scalar_param) expected_ans = reshape([2.0, 5.0, 10.0, 17.0, 26.0, 37.0, 50.0, 65.0, 82.0, 101.0, 122.0, 145.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Array, Scalar does not match to expected array" end if result_3param = func3(array_param, scalar_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Array does not match to expected array" end if result_3param = func3(array_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Array, Scalar, Scalar does not match to expected array" end if result_3param = func3(scalar_param, array_param, array_param) expected_ans = reshape([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Array does not match to expected array" end if result_3param = func3(scalar_param, array_param, scalar_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Array, Scalar does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, array_param) expected_ans = reshape([2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0], shape(array_param)) if ( size(result_3param) /= size(expected_ans) .or. .not. all(result_3param == expected_ans) ) then error stop "Scalar, Scalar, Array does not match to expected array" end if result_3param = func3(scalar_param, scalar_param, scalar_param) expected_ans = reshape([2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], shape(array_param)) if (abs(result_3param(1, 1, 1) - expected_ans(1, 1, 1)) > epsilon) then error stop "Scalar, Scalar, Scalar does not match 2.0" end if print *, "All tests passed successfully" contains elemental function func2(x, y) result(res) real, intent(in) :: x, y real :: res res = x + y end function func2 elemental function func3(x, y, z) result(res) real, intent(in) :: x, y, z real :: res res = x * y + z end function func3 end program elemental_13 lfortran-lfortran-2f73434/integration_tests/template_vector.f900000664000175000017500000000321215141516316025113 0ustar alastairalastairmodule template_vector_m implicit none private public :: vector_t, main template vector_t(T) type, deferred :: T public :: Vector type :: Vector type(T), allocatable :: elements(:) integer :: sz = 0 contains procedure :: resize procedure :: push_back end type contains subroutine push_back(this, item) class(Vector), intent(in) :: this type(T), intent(in) :: item integer :: new_size new_size = this%sz + 1 call this%resize(new_size) this%elements(new_size) = item this%sz = new_size end subroutine subroutine resize(this, n) class(Vector), intent(inout) :: this integer, intent(in) :: n type(T), allocatable :: tmp(:) integer :: i if (.not. allocated(this%elements)) then allocate(this%elements(n)) return end if if (this%sz >= n) return allocate(tmp(this%sz)) do i = 1, this%sz tmp(i) = this%elements(i) end do allocate(this%elements(n)) this%elements(1:this%sz) = tmp end subroutine end template contains subroutine main() instantiate vector_t(integer), only: IntVector => Vector type(IntVector) :: v call v%push_back(10) if (v%elements(1) /= 10) error stop end subroutine end module program template_vector use template_vector_m implicit none call main() end program lfortran-lfortran-2f73434/integration_tests/class_44.f900000664000175000017500000000070015141516316023331 0ustar alastairalastairmodule class_44_mod type, abstract :: SomeType end type SomeType type :: OtherType contains procedure :: method end type OtherType contains recursive subroutine method(self,arr) class(OtherType), intent(inout) :: self class(SomeType), intent(inout) :: arr(:) call self%method(arr) end subroutine method end module class_44_mod program class_44 use class_44_mod end program class_44lfortran-lfortran-2f73434/integration_tests/modules_25_module.f900000664000175000017500000000171215141516316025244 0ustar alastairalastairmodule tomlf_de_tokenizer_25 implicit none private public :: toml_tokenizer type :: toml_table logical :: inline = .false. end type toml_table type, abstract :: toml_tokenizer type(toml_table), pointer :: current => null() contains procedure(next_token), deferred :: next_token end type toml_tokenizer abstract interface subroutine next_token(de, dot_is_token) import :: toml_tokenizer class(toml_tokenizer), intent(inout) :: de logical, intent(in) :: dot_is_token end subroutine next_token end interface type, extends(toml_tokenizer), abstract :: toml_tokenizer_ end type toml_tokenizer_ contains subroutine parse_select(de) class(toml_tokenizer), intent(inout), target :: de type(toml_table), pointer :: table nullify(table) de%current => table end subroutine parse_select end module tomlf_de_tokenizer_25 lfortran-lfortran-2f73434/integration_tests/interface_18.f900000664000175000017500000000266315141516316024177 0ustar alastairalastairmodule module_interface_18 implicit none abstract interface subroutine OBJ(x, f) implicit none real(4), intent(in) :: x(:) real(4), intent(out) :: f end subroutine OBJ end interface interface evaluate module procedure evaluatef end interface evaluate contains function moderatex(x) result(y) implicit none real, intent(in) :: x(:) real :: y(size(x)) y = 2 end function moderatex subroutine evaluatef(calfun, x, f) implicit none procedure(OBJ) :: calfun real, intent(in) :: x(:) real, intent(out) :: f call calfun(moderatex(x), f) end subroutine evaluatef subroutine initxf(calfun, xpt) implicit none procedure(OBJ) :: calfun real, intent(out) :: xpt(:, :) real :: f real :: x(size(xpt, 1)) x = 1 f = 2 call evaluate(calfun, x, f) end subroutine initxf end module module_interface_18 program interface_18 use module_interface_18 implicit none real :: xpt(1, 5) call initxf(calfun, xpt) contains subroutine calfun(x, f) implicit none real, intent(in) :: x(:) real, intent(out) :: f print * , "x = " , x print * , "f = " , f if (x(1) /= 2.0) error stop if (f /= 2.0) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/subroutines_19.f900000664000175000017500000000036015141516316024612 0ustar alastairalastairprogram subroutines_19 implicit none integer :: x = 1 call f(x) contains subroutine f(a) integer :: a intent(in) :: a print * , a if (a /= 1) error stop end subroutine end program lfortran-lfortran-2f73434/integration_tests/types_11.f900000664000175000017500000000021415141516316023362 0ustar alastairalastairprogram types_11 implicit none enum, bind(c) enumerator :: a = 1 enumerator :: b = 2 enumerator :: c = 3 end enum end program lfortran-lfortran-2f73434/integration_tests/modules_06.f900000664000175000017500000000033615141516316023677 0ustar alastairalastairmodule modules_06_a implicit none contains integer function b() result(r) print *, "b()" r = 5 end function end module program modules_06 use modules_06_a, only: b implicit none integer :: i i = b() print *, i end lfortran-lfortran-2f73434/integration_tests/polymorphic_arguments_01.f900000664000175000017500000000107215141516316026652 0ustar alastairalastairprogram polymorphic_argument_01 implicit none type :: MyStruct integer :: intMember real :: realMember end type MyStruct type(MyStruct) :: structInstance call unused_dummy_argument(structInstance) contains subroutine unused_dummy_argument(dummy) class(*), intent(in) :: dummy select type(dummy) type is (MyStruct) print *, "Hello world" class default print *, "Surprise!!" end select end subroutine end program polymorphic_argument_01 lfortran-lfortran-2f73434/integration_tests/write_09.f900000664000175000017500000000142215141516316023361 0ustar alastairalastairmodule write_09_m type :: mytype character(len=:), allocatable :: raw end type interface write(unformatted) module procedure :: my_write end interface contains subroutine my_write(x, unit, iostat, iomsg) class(mytype), intent(in) :: x integer, intent(in) :: unit integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg write(unit, iostat=iostat, iomsg=iomsg) len(x%raw) end subroutine end module program write_09 use write_09_m implicit none type(mytype) :: x integer :: u, iostat character(len=100) :: iomsg x%raw = "hello" open(newunit=u, form="unformatted", status="scratch") write(u, iostat=iostat, iomsg=iomsg) x close(u) end program write_09 lfortran-lfortran-2f73434/bench.sh0000775000175000017500000000212215141516316017246 0ustar alastairalastair#!/usr/bin/env bash # # Compile the latest master and a given PR in Release mode from scratch. # # Install the usual `lf` environment, and also `mamba install zlib fmt`. # # Example: # # ./bench.sh 448 # bench/main/src/bin/parse # bench/pr/src/bin/parse # bench/main/src/bin/parse2 # bench/pr/src/bin/parse2 set -ex PR=$1 if [[ $PR == "" ]]; then echo "Specify the PR number as an argument" exit 1 fi echo "Benchmarking the latest master against the PR !$1" rm -rf bench mkdir bench cd bench git clone https://github.com/lfortran/lfortran cd lfortran ./build0.sh cd .. mkdir main cd main #cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_FMT=yes -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" ../lfortran cmake -DWITH_FMT=yes ../lfortran make -j cd .. cd lfortran git clean -dfx git fetch origin pull/$PR/head:pr-origin-$PR git checkout pr-origin-$PR ./build0.sh cd .. mkdir pr cd pr #cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_FMT=yes -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" ../lfortran cmake -DWITH_FMT=yes ../lfortran make -j cd .. lfortran-lfortran-2f73434/.pre-commit-config.yaml0000664000175000017500000000124615141516316022117 0ustar alastairalastairexclude: ^tests/.* repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: - id: trailing-whitespace exclude: ".md" - id: end-of-file-fixer - id: fix-encoding-pragma args: [--remove] - id: check-yaml exclude: ^(tests/|doc/) - id: check-toml - id: check-json - id: check-merge-conflict - id: pretty-format-json args: [--autofix] - id: debug-statements language_version: python3 - repo: https://github.com/pre-commit/mirrors-clang-format rev: v13.0.1 hooks: - id: clang-format args: [--style=file, -i] exclude: ".json"